blob: 1a0aadf0291a3235553b4fd91482f5e48170e4bf [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 /**
Maggie Benthall0469f412013-09-05 15:30:26 -0400163 * Activity Action: Show trusted credentials settings, opening to the user tab,
164 * to allow management of installed credentials.
165 * <p>
166 * In some cases, a matching Activity may not exist, so ensure you
167 * safeguard against this.
168 * <p>
169 * Input: Nothing.
170 * <p>
171 * Output: Nothing.
172 * @hide
173 */
174 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
175 public static final String ACTION_TRUSTED_CREDENTIALS_USER =
176 "com.android.settings.TRUSTED_CREDENTIALS_USER";
177
178 /**
179 * Activity Action: Show dialog explaining that an installed CA cert may enable
180 * monitoring of encrypted network traffic.
181 * <p>
182 * In some cases, a matching Activity may not exist, so ensure you
183 * safeguard against this.
184 * <p>
185 * Input: Nothing.
186 * <p>
187 * Output: Nothing.
188 * @hide
189 */
190 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
191 public static final String ACTION_MONITORING_CERT_INFO =
192 "com.android.settings.MONITORING_CERT_INFO";
193
194 /**
Amith Yamasanic15255a2009-09-23 15:33:19 -0700195 * Activity Action: Show settings to allow configuration of privacy options.
196 * <p>
197 * In some cases, a matching Activity may not exist, so ensure you
198 * safeguard against this.
199 * <p>
200 * Input: Nothing.
201 * <p>
202 * Output: Nothing.
203 */
204 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
205 public static final String ACTION_PRIVACY_SETTINGS =
206 "android.settings.PRIVACY_SETTINGS";
207
208 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800209 * Activity Action: Show settings to allow configuration of Wi-Fi.
210
211 * <p>
212 * In some cases, a matching Activity may not exist, so ensure you
213 * safeguard against this.
214 * <p>
215 * Input: Nothing.
216 * <p>
217 * Output: Nothing.
218
219 */
220 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
221 public static final String ACTION_WIFI_SETTINGS =
222 "android.settings.WIFI_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700223
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800224 /**
225 * Activity Action: Show settings to allow configuration of a static IP
226 * address for Wi-Fi.
227 * <p>
228 * In some cases, a matching Activity may not exist, so ensure you safeguard
229 * against this.
230 * <p>
231 * Input: Nothing.
232 * <p>
233 * Output: Nothing.
234 */
235 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
236 public static final String ACTION_WIFI_IP_SETTINGS =
237 "android.settings.WIFI_IP_SETTINGS";
238
239 /**
240 * Activity Action: Show settings to allow configuration of Bluetooth.
241 * <p>
242 * In some cases, a matching Activity may not exist, so ensure you
243 * safeguard against this.
244 * <p>
245 * Input: Nothing.
246 * <p>
247 * Output: Nothing.
248 */
249 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
250 public static final String ACTION_BLUETOOTH_SETTINGS =
251 "android.settings.BLUETOOTH_SETTINGS";
252
253 /**
Jeff Brown89d55462012-09-19 11:33:42 -0700254 * Activity Action: Show settings to allow configuration of Wifi Displays.
255 * <p>
256 * In some cases, a matching Activity may not exist, so ensure you
257 * safeguard against this.
258 * <p>
259 * Input: Nothing.
260 * <p>
261 * Output: Nothing.
262 * @hide
263 */
264 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
265 public static final String ACTION_WIFI_DISPLAY_SETTINGS =
266 "android.settings.WIFI_DISPLAY_SETTINGS";
267
268 /**
Jeff Brown1a937b02014-07-01 22:13:04 -0700269 * Activity Action: Show settings to allow configuration of
270 * {@link android.media.routing.MediaRouteService media route providers}.
271 * <p>
272 * In some cases, a matching Activity may not exist, so ensure you
273 * safeguard against this.
274 * <p>
275 * Input: Nothing.
276 * <p>
277 * Output: Nothing.
278 */
279 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
280 public static final String ACTION_CAST_SETTINGS =
281 "android.settings.CAST_SETTINGS";
282
283 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800284 * Activity Action: Show settings to allow configuration of date and time.
285 * <p>
286 * In some cases, a matching Activity may not exist, so ensure you
287 * safeguard against this.
288 * <p>
289 * Input: Nothing.
290 * <p>
291 * Output: Nothing.
292 */
293 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
294 public static final String ACTION_DATE_SETTINGS =
295 "android.settings.DATE_SETTINGS";
296
297 /**
298 * Activity Action: Show settings to allow configuration of sound and volume.
299 * <p>
300 * In some cases, a matching Activity may not exist, so ensure you
301 * safeguard against this.
302 * <p>
303 * Input: Nothing.
304 * <p>
305 * Output: Nothing.
306 */
307 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
308 public static final String ACTION_SOUND_SETTINGS =
309 "android.settings.SOUND_SETTINGS";
310
311 /**
312 * Activity Action: Show settings to allow configuration of display.
313 * <p>
314 * In some cases, a matching Activity may not exist, so ensure you
315 * safeguard against this.
316 * <p>
317 * Input: Nothing.
318 * <p>
319 * Output: Nothing.
320 */
321 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
322 public static final String ACTION_DISPLAY_SETTINGS =
323 "android.settings.DISPLAY_SETTINGS";
324
325 /**
326 * Activity Action: Show settings to allow configuration of locale.
327 * <p>
328 * In some cases, a matching Activity may not exist, so ensure you
329 * safeguard against this.
330 * <p>
331 * Input: Nothing.
332 * <p>
333 * Output: Nothing.
334 */
335 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
336 public static final String ACTION_LOCALE_SETTINGS =
337 "android.settings.LOCALE_SETTINGS";
338
339 /**
340 * Activity Action: Show settings to configure input methods, in particular
341 * allowing the user to enable input methods.
342 * <p>
343 * In some cases, a matching Activity may not exist, so ensure you
344 * safeguard against this.
345 * <p>
346 * Input: Nothing.
347 * <p>
348 * Output: Nothing.
349 */
350 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
351 public static final String ACTION_INPUT_METHOD_SETTINGS =
352 "android.settings.INPUT_METHOD_SETTINGS";
353
354 /**
Tadashi G. Takaokaf49688f2011-01-20 17:56:13 +0900355 * Activity Action: Show settings to enable/disable input method subtypes.
satok86417ea2010-10-27 14:11:03 +0900356 * <p>
357 * In some cases, a matching Activity may not exist, so ensure you
358 * safeguard against this.
359 * <p>
Tadashi G. Takaoka25480202011-01-20 23:13:02 +0900360 * To tell which input method's subtypes are displayed in the settings, add
361 * {@link #EXTRA_INPUT_METHOD_ID} extra to this Intent with the input method id.
362 * If there is no extra in this Intent, subtypes from all installed input methods
363 * will be displayed in the settings.
364 *
365 * @see android.view.inputmethod.InputMethodInfo#getId
366 * <p>
satok86417ea2010-10-27 14:11:03 +0900367 * Input: Nothing.
368 * <p>
369 * Output: Nothing.
370 */
371 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
Tadashi G. Takaokaf49688f2011-01-20 17:56:13 +0900372 public static final String ACTION_INPUT_METHOD_SUBTYPE_SETTINGS =
373 "android.settings.INPUT_METHOD_SUBTYPE_SETTINGS";
satok86417ea2010-10-27 14:11:03 +0900374
375 /**
satok7cfc0ed2011-06-20 21:29:36 +0900376 * Activity Action: Show a dialog to select input method.
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 * @hide
385 */
386 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
387 public static final String ACTION_SHOW_INPUT_METHOD_PICKER =
388 "android.settings.SHOW_INPUT_METHOD_PICKER";
389
390 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800391 * Activity Action: Show settings to manage the user input dictionary.
392 * <p>
Chet Haasee8222dd2013-09-05 07:44:18 -0700393 * Starting with {@link android.os.Build.VERSION_CODES#KITKAT},
Satoshi Kataoka2aa2bc52013-07-30 14:25:11 +0900394 * it is guaranteed there will always be an appropriate implementation for this Intent action.
395 * 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 -0800396 * <p>
397 * Input: Nothing.
398 * <p>
399 * Output: Nothing.
400 */
401 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
402 public static final String ACTION_USER_DICTIONARY_SETTINGS =
403 "android.settings.USER_DICTIONARY_SETTINGS";
404
405 /**
Gilles Debunnee90bed12011-08-30 14:28:27 -0700406 * Activity Action: Adds a word to the user dictionary.
407 * <p>
408 * In some cases, a matching Activity may not exist, so ensure you
409 * safeguard against this.
410 * <p>
411 * Input: An extra with key <code>word</code> that contains the word
412 * that should be added to the dictionary.
413 * <p>
414 * Output: Nothing.
415 *
416 * @hide
417 */
418 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
419 public static final String ACTION_USER_DICTIONARY_INSERT =
420 "com.android.settings.USER_DICTIONARY_INSERT";
421
422 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800423 * Activity Action: Show settings to allow configuration of application-related settings.
424 * <p>
425 * In some cases, a matching Activity may not exist, so ensure you
426 * safeguard against this.
427 * <p>
428 * Input: Nothing.
429 * <p>
430 * Output: Nothing.
431 */
432 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
433 public static final String ACTION_APPLICATION_SETTINGS =
434 "android.settings.APPLICATION_SETTINGS";
435
436 /**
437 * Activity Action: Show settings to allow configuration of application
Dianne Hackborn8d866e52012-10-10 18:39:45 -0700438 * development-related settings. As of
439 * {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1} this action is
440 * a required part of the platform.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800441 * <p>
442 * Input: Nothing.
443 * <p>
444 * Output: Nothing.
445 */
446 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
447 public static final String ACTION_APPLICATION_DEVELOPMENT_SETTINGS =
448 "android.settings.APPLICATION_DEVELOPMENT_SETTINGS";
449
450 /**
451 * Activity Action: Show settings to allow configuration of quick launch shortcuts.
452 * <p>
453 * In some cases, a matching Activity may not exist, so ensure you
454 * safeguard against this.
455 * <p>
456 * Input: Nothing.
457 * <p>
458 * Output: Nothing.
459 */
460 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
461 public static final String ACTION_QUICK_LAUNCH_SETTINGS =
462 "android.settings.QUICK_LAUNCH_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700463
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800464 /**
465 * Activity Action: Show settings to manage installed applications.
466 * <p>
467 * In some cases, a matching Activity may not exist, so ensure you
468 * safeguard against this.
469 * <p>
470 * Input: Nothing.
471 * <p>
472 * Output: Nothing.
473 */
474 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
475 public static final String ACTION_MANAGE_APPLICATIONS_SETTINGS =
476 "android.settings.MANAGE_APPLICATIONS_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700477
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800478 /**
Winson Chung44e8ff92010-09-27 14:36:52 -0700479 * Activity Action: Show settings to manage all applications.
480 * <p>
481 * In some cases, a matching Activity may not exist, so ensure you
482 * safeguard against this.
483 * <p>
484 * Input: Nothing.
485 * <p>
486 * Output: Nothing.
487 */
488 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
489 public static final String ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS =
490 "android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS";
491
492 /**
Dianne Hackbornb7bb3b32010-06-06 22:47:50 -0700493 * Activity Action: Show screen of details about a particular application.
494 * <p>
495 * In some cases, a matching Activity may not exist, so ensure you
496 * safeguard against this.
497 * <p>
498 * Input: The Intent's data URI specifies the application package name
499 * to be shown, with the "package" scheme. That is "package:com.my.app".
500 * <p>
501 * Output: Nothing.
502 */
503 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
504 public static final String ACTION_APPLICATION_DETAILS_SETTINGS =
505 "android.settings.APPLICATION_DETAILS_SETTINGS";
506
507 /**
Dianne Hackborn35654b62013-01-14 17:38:02 -0800508 * @hide
509 * Activity Action: Show the "app ops" settings screen.
510 * <p>
511 * Input: Nothing.
512 * <p>
513 * Output: Nothing.
514 */
515 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
516 public static final String ACTION_APP_OPS_SETTINGS =
517 "android.settings.APP_OPS_SETTINGS";
518
519 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800520 * Activity Action: Show settings for system update functionality.
521 * <p>
522 * In some cases, a matching Activity may not exist, so ensure you
523 * safeguard against this.
524 * <p>
525 * Input: Nothing.
526 * <p>
527 * Output: Nothing.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700528 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800529 * @hide
530 */
531 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
532 public static final String ACTION_SYSTEM_UPDATE_SETTINGS =
533 "android.settings.SYSTEM_UPDATE_SETTINGS";
534
535 /**
536 * Activity Action: Show settings to allow configuration of sync settings.
537 * <p>
538 * In some cases, a matching Activity may not exist, so ensure you
539 * safeguard against this.
540 * <p>
Erikeebc8e22010-02-18 13:27:19 -0800541 * The account types available to add via the add account button may be restricted by adding an
542 * {@link #EXTRA_AUTHORITIES} extra to this Intent with one or more syncable content provider's
543 * authorities. Only account types which can sync with that content provider will be offered to
544 * the user.
545 * <p>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800546 * Input: Nothing.
547 * <p>
548 * Output: Nothing.
549 */
550 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
551 public static final String ACTION_SYNC_SETTINGS =
552 "android.settings.SYNC_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700553
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800554 /**
Erikeebc8e22010-02-18 13:27:19 -0800555 * Activity Action: Show add account screen for creating a new account.
556 * <p>
557 * In some cases, a matching Activity may not exist, so ensure you
558 * safeguard against this.
559 * <p>
560 * The account types available to add may be restricted by adding an {@link #EXTRA_AUTHORITIES}
561 * extra to the Intent with one or more syncable content provider's authorities. Only account
562 * types which can sync with that content provider will be offered to the user.
563 * <p>
Alon Albert50359c22013-02-26 14:47:48 -0800564 * Account types can also be filtered by adding an {@link #EXTRA_ACCOUNT_TYPES} extra to the
565 * Intent with one or more account types.
566 * <p>
Erikeebc8e22010-02-18 13:27:19 -0800567 * Input: Nothing.
568 * <p>
569 * Output: Nothing.
570 */
571 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
572 public static final String ACTION_ADD_ACCOUNT =
573 "android.settings.ADD_ACCOUNT_SETTINGS";
574
575 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800576 * Activity Action: Show settings for selecting the network operator.
577 * <p>
578 * In some cases, a matching Activity may not exist, so ensure you
579 * safeguard against this.
580 * <p>
581 * Input: Nothing.
582 * <p>
583 * Output: Nothing.
584 */
585 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
586 public static final String ACTION_NETWORK_OPERATOR_SETTINGS =
587 "android.settings.NETWORK_OPERATOR_SETTINGS";
588
589 /**
590 * Activity Action: Show settings for selection of 2G/3G.
591 * <p>
592 * In some cases, a matching Activity may not exist, so ensure you
593 * safeguard against this.
594 * <p>
595 * Input: Nothing.
596 * <p>
597 * Output: Nothing.
598 */
599 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
600 public static final String ACTION_DATA_ROAMING_SETTINGS =
601 "android.settings.DATA_ROAMING_SETTINGS";
602
603 /**
604 * Activity Action: Show settings for internal storage.
605 * <p>
606 * In some cases, a matching Activity may not exist, so ensure you
607 * safeguard against this.
608 * <p>
609 * Input: Nothing.
610 * <p>
611 * Output: Nothing.
612 */
613 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
614 public static final String ACTION_INTERNAL_STORAGE_SETTINGS =
615 "android.settings.INTERNAL_STORAGE_SETTINGS";
616 /**
617 * Activity Action: Show settings for memory card storage.
618 * <p>
619 * In some cases, a matching Activity may not exist, so ensure you
620 * safeguard against this.
621 * <p>
622 * Input: Nothing.
623 * <p>
624 * Output: Nothing.
625 */
626 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
627 public static final String ACTION_MEMORY_CARD_SETTINGS =
628 "android.settings.MEMORY_CARD_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700629
Justin Mattsonef340352010-01-13 21:05:46 -0800630 /**
631 * Activity Action: Show settings for global search.
632 * <p>
633 * In some cases, a matching Activity may not exist, so ensure you
634 * safeguard against this.
635 * <p>
636 * Input: Nothing.
637 * <p>
638 * Output: Nothing
639 */
640 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
641 public static final String ACTION_SEARCH_SETTINGS =
642 "android.search.action.SEARCH_SETTINGS";
643
Daniel Sandler9d8b8762010-01-22 20:50:15 -0500644 /**
645 * Activity Action: Show general device information settings (serial
646 * number, software version, phone number, etc.).
647 * <p>
648 * In some cases, a matching Activity may not exist, so ensure you
649 * safeguard against this.
650 * <p>
651 * Input: Nothing.
652 * <p>
653 * Output: Nothing
654 */
655 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
656 public static final String ACTION_DEVICE_INFO_SETTINGS =
657 "android.settings.DEVICE_INFO_SETTINGS";
658
Martijn Coenen9b3c83f2011-07-28 11:21:39 -0500659 /**
Nick Pellycccf01d2011-10-31 14:49:40 -0700660 * Activity Action: Show NFC settings.
661 * <p>
662 * This shows UI that allows NFC to be turned on or off.
Martijn Coenen9b3c83f2011-07-28 11:21:39 -0500663 * <p>
664 * In some cases, a matching Activity may not exist, so ensure you
665 * safeguard against this.
666 * <p>
667 * Input: Nothing.
668 * <p>
669 * Output: Nothing
Nick Pellycccf01d2011-10-31 14:49:40 -0700670 * @see android.nfc.NfcAdapter#isEnabled()
671 */
672 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
673 public static final String ACTION_NFC_SETTINGS = "android.settings.NFC_SETTINGS";
674
675 /**
676 * Activity Action: Show NFC Sharing settings.
677 * <p>
678 * This shows UI that allows NDEF Push (Android Beam) to be turned on or
679 * off.
680 * <p>
681 * In some cases, a matching Activity may not exist, so ensure you
682 * safeguard against this.
683 * <p>
684 * Input: Nothing.
685 * <p>
686 * Output: Nothing
687 * @see android.nfc.NfcAdapter#isNdefPushEnabled()
Martijn Coenen9b3c83f2011-07-28 11:21:39 -0500688 */
689 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
690 public static final String ACTION_NFCSHARING_SETTINGS =
691 "android.settings.NFCSHARING_SETTINGS";
692
Daniel Sandlerc08cd022012-11-27 22:47:37 -0500693 /**
Martijn Coenen62c196a2013-08-09 13:43:34 -0700694 * Activity Action: Show NFC Tap & Pay settings
695 * <p>
696 * This shows UI that allows the user to configure Tap&Pay
697 * settings.
698 * <p>
699 * In some cases, a matching Activity may not exist, so ensure you
700 * safeguard against this.
701 * <p>
702 * Input: Nothing.
703 * <p>
704 * Output: Nothing
705 */
706 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
707 public static final String ACTION_NFC_PAYMENT_SETTINGS =
708 "android.settings.NFC_PAYMENT_SETTINGS";
709
710 /**
Daniel Sandlerc08cd022012-11-27 22:47:37 -0500711 * Activity Action: Show Daydream settings.
712 * <p>
713 * In some cases, a matching Activity may not exist, so ensure you
714 * safeguard against this.
715 * <p>
716 * Input: Nothing.
717 * <p>
718 * Output: Nothing.
719 * @see android.service.dreams.DreamService
Daniel Sandlerc08cd022012-11-27 22:47:37 -0500720 */
721 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
722 public static final String ACTION_DREAM_SETTINGS = "android.settings.DREAM_SETTINGS";
723
Daniel Sandler5feceeb2013-03-22 18:29:23 -0700724 /**
725 * Activity Action: Show Notification listener settings.
726 * <p>
727 * In some cases, a matching Activity may not exist, so ensure you
728 * safeguard against this.
729 * <p>
730 * Input: Nothing.
731 * <p>
732 * Output: Nothing.
733 * @see android.service.notification.NotificationListenerService
734 * @hide
735 */
736 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
737 public static final String ACTION_NOTIFICATION_LISTENER_SETTINGS
738 = "android.settings.NOTIFICATION_LISTENER_SETTINGS";
739
Alan Viverette69ce69b2013-08-29 12:23:48 -0700740 /**
John Spurlock7340fc82014-04-24 18:50:12 -0400741 * @hide
742 */
743 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
744 public static final String ACTION_CONDITION_PROVIDER_SETTINGS
745 = "android.settings.ACTION_CONDITION_PROVIDER_SETTINGS";
746
747 /**
Alan Viverette69ce69b2013-08-29 12:23:48 -0700748 * Activity Action: Show settings for video captioning.
749 * <p>
750 * In some cases, a matching Activity may not exist, so ensure you safeguard
751 * against this.
752 * <p>
753 * Input: Nothing.
754 * <p>
755 * Output: Nothing.
756 */
757 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
758 public static final String ACTION_CAPTIONING_SETTINGS = "android.settings.CAPTIONING_SETTINGS";
759
Svetoslav773f54d2013-09-03 14:01:43 -0700760 /**
761 * Activity Action: Show the top level print settings.
762 * <p>
763 * In some cases, a matching Activity may not exist, so ensure you
764 * safeguard against this.
765 * <p>
766 * Input: Nothing.
767 * <p>
768 * Output: Nothing.
769 */
770 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
771 public static final String ACTION_PRINT_SETTINGS =
772 "android.settings.ACTION_PRINT_SETTINGS";
773
John Spurlockde547002014-02-28 17:50:39 -0500774 /**
775 * Activity Action: Show Zen Mode configuration settings.
776 *
777 * @hide
778 */
779 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
780 public static final String ACTION_ZEN_MODE_SETTINGS = "android.settings.ZEN_MODE_SETTINGS";
781
Santos Cordona4c75242014-07-09 12:07:51 -0700782 /**
783 * Activity Action: Show the regulatory information screen for the device.
784 * <p>
785 * In some cases, a matching Activity may not exist, so ensure you safeguard
786 * against this.
787 * <p>
788 * Input: Nothing.
789 * <p>
790 * Output: Nothing.
791 */
Jeff Sharkeydd77fda2014-04-16 17:23:08 -0700792 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
793 public static final String
794 ACTION_SHOW_REGULATORY_INFO = "android.settings.SHOW_REGULATORY_INFO";
795
Jerome Poichet7974cb32014-05-14 12:04:43 -0700796 /**
797 * Activity Action: Show Device Name Settings.
798 * <p>
799 * In some cases, a matching Activity may not exist, so ensure you safeguard
Tim Kilbourn87cd0dc2014-04-14 15:37:51 -0700800 * against this.
Jerome Poichet7974cb32014-05-14 12:04:43 -0700801 *
802 * @hide
803 */
804 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
805 public static final String DEVICE_NAME_SETTINGS = "android.settings.DEVICE_NAME";
806
Tim Kilbourn87cd0dc2014-04-14 15:37:51 -0700807 /**
808 * Activity Action: Show pairing settings.
809 * <p>
810 * In some cases, a matching Activity may not exist, so ensure you safeguard
811 * against this.
812 *
813 * @hide
814 */
815 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
816 public static final String ACTION_PAIRING_SETTINGS = "android.settings.PAIRING_SETTINGS";
817
John Spurlockf8f524c2014-06-10 14:47:29 -0400818 /**
819 * Activity Action: Show battery saver settings.
820 *
821 * @hide
822 */
823 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
824 public static final String ACTION_BATTERY_SAVER_SETTINGS
825 = "android.settings.BATTERY_SAVER_SETTINGS";
826
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800827 // End of Intent actions for Settings
828
Erikeebc8e22010-02-18 13:27:19 -0800829 /**
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800830 * @hide - Private call() method on SettingsProvider to read from 'system' table.
831 */
832 public static final String CALL_METHOD_GET_SYSTEM = "GET_system";
833
834 /**
835 * @hide - Private call() method on SettingsProvider to read from 'secure' table.
836 */
837 public static final String CALL_METHOD_GET_SECURE = "GET_secure";
838
839 /**
Christopher Tate06efb532012-08-24 15:29:27 -0700840 * @hide - Private call() method on SettingsProvider to read from 'global' table.
841 */
842 public static final String CALL_METHOD_GET_GLOBAL = "GET_global";
843
844 /**
845 * @hide - User handle argument extra to the fast-path call()-based requests
846 */
847 public static final String CALL_METHOD_USER_KEY = "_user";
848
849 /** @hide - Private call() method to write to 'system' table */
850 public static final String CALL_METHOD_PUT_SYSTEM = "PUT_system";
851
852 /** @hide - Private call() method to write to 'secure' table */
853 public static final String CALL_METHOD_PUT_SECURE = "PUT_secure";
854
855 /** @hide - Private call() method to write to 'global' table */
856 public static final String CALL_METHOD_PUT_GLOBAL= "PUT_global";
857
858 /**
Erikeebc8e22010-02-18 13:27:19 -0800859 * Activity Extra: Limit available options in launched activity based on the given authority.
860 * <p>
861 * This can be passed as an extra field in an Activity Intent with one or more syncable content
862 * provider's authorities as a String[]. This field is used by some intents to alter the
863 * behavior of the called activity.
864 * <p>
865 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types available based
866 * on the authority given.
867 */
Alon Albert50359c22013-02-26 14:47:48 -0800868 public static final String EXTRA_AUTHORITIES = "authorities";
869
Alon Albertd35bf1f2013-04-18 14:26:51 -0700870 /**
871 * Activity Extra: Limit available options in launched activity based on the given account
872 * types.
873 * <p>
874 * This can be passed as an extra field in an Activity Intent with one or more account types
875 * as a String[]. This field is used by some intents to alter the behavior of the called
876 * activity.
877 * <p>
878 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types to the specified
879 * list.
880 */
Alon Albert50359c22013-02-26 14:47:48 -0800881 public static final String EXTRA_ACCOUNT_TYPES = "account_types";
Erikeebc8e22010-02-18 13:27:19 -0800882
Tadashi G. Takaoka25480202011-01-20 23:13:02 +0900883 public static final String EXTRA_INPUT_METHOD_ID = "input_method_id";
884
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800885 private static final String JID_RESOURCE_PREFIX = "android";
886
887 public static final String AUTHORITY = "settings";
888
889 private static final String TAG = "Settings";
Christopher Tate06efb532012-08-24 15:29:27 -0700890 private static final boolean LOCAL_LOGV = false;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800891
David Christie3f7b6522013-08-06 19:19:08 -0700892 // Lock ensures that when enabling/disabling the master location switch, we don't end up
893 // with a partial enable/disable state in multi-threaded situations.
894 private static final Object mLocationSettingsLock = new Object();
895
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800896 public static class SettingNotFoundException extends AndroidException {
897 public SettingNotFoundException(String msg) {
898 super(msg);
899 }
900 }
901
902 /**
903 * Common base for tables of name/value settings.
904 */
905 public static class NameValueTable implements BaseColumns {
906 public static final String NAME = "name";
907 public static final String VALUE = "value";
908
909 protected static boolean putString(ContentResolver resolver, Uri uri,
910 String name, String value) {
911 // The database will take care of replacing duplicates.
912 try {
913 ContentValues values = new ContentValues();
914 values.put(NAME, name);
915 values.put(VALUE, value);
916 resolver.insert(uri, values);
917 return true;
918 } catch (SQLException e) {
Dianne Hackborna33e3f72009-09-29 17:28:24 -0700919 Log.w(TAG, "Can't set key " + name + " in " + uri, e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800920 return false;
921 }
922 }
923
924 public static Uri getUriFor(Uri uri, String name) {
925 return Uri.withAppendedPath(uri, name);
926 }
927 }
928
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800929 // Thread-safe.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800930 private static class NameValueCache {
931 private final String mVersionSystemProperty;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800932 private final Uri mUri;
933
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800934 private static final String[] SELECT_VALUE =
935 new String[] { Settings.NameValueTable.VALUE };
936 private static final String NAME_EQ_PLACEHOLDER = "name=?";
937
938 // Must synchronize on 'this' to access mValues and mValuesVersion.
Dan Egnor799f7212009-11-24 16:24:44 -0800939 private final HashMap<String, String> mValues = new HashMap<String, String>();
940 private long mValuesVersion = 0;
941
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800942 // Initially null; set lazily and held forever. Synchronized on 'this'.
943 private IContentProvider mContentProvider = null;
944
945 // The method we'll call (or null, to not use) on the provider
946 // for the fast path of retrieving settings.
Christopher Tate06efb532012-08-24 15:29:27 -0700947 private final String mCallGetCommand;
948 private final String mCallSetCommand;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800949
Christopher Tate06efb532012-08-24 15:29:27 -0700950 public NameValueCache(String versionSystemProperty, Uri uri,
951 String getCommand, String setCommand) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800952 mVersionSystemProperty = versionSystemProperty;
953 mUri = uri;
Christopher Tate06efb532012-08-24 15:29:27 -0700954 mCallGetCommand = getCommand;
955 mCallSetCommand = setCommand;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800956 }
957
Christopher Tate06efb532012-08-24 15:29:27 -0700958 private IContentProvider lazyGetProvider(ContentResolver cr) {
959 IContentProvider cp = null;
960 synchronized (this) {
961 cp = mContentProvider;
962 if (cp == null) {
963 cp = mContentProvider = cr.acquireProvider(mUri.getAuthority());
964 }
965 }
966 return cp;
967 }
968
969 public boolean putStringForUser(ContentResolver cr, String name, String value,
970 final int userHandle) {
971 try {
972 Bundle arg = new Bundle();
973 arg.putString(Settings.NameValueTable.VALUE, value);
Christopher Tated5fe1472012-09-10 15:48:38 -0700974 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
Christopher Tate06efb532012-08-24 15:29:27 -0700975 IContentProvider cp = lazyGetProvider(cr);
Dianne Hackborn35654b62013-01-14 17:38:02 -0800976 cp.call(cr.getPackageName(), mCallSetCommand, name, arg);
Christopher Tate06efb532012-08-24 15:29:27 -0700977 } catch (RemoteException e) {
978 Log.w(TAG, "Can't set key " + name + " in " + mUri, e);
979 return false;
980 }
981 return true;
982 }
983
Christopher Tate06efb532012-08-24 15:29:27 -0700984 public String getStringForUser(ContentResolver cr, String name, final int userHandle) {
Christopher Tate78d2a662012-09-13 16:19:44 -0700985 final boolean isSelf = (userHandle == UserHandle.myUserId());
986 if (isSelf) {
987 long newValuesVersion = SystemProperties.getLong(mVersionSystemProperty, 0);
Dan Egnor799f7212009-11-24 16:24:44 -0800988
Christopher Tate78d2a662012-09-13 16:19:44 -0700989 // Our own user's settings data uses a client-side cache
990 synchronized (this) {
991 if (mValuesVersion != newValuesVersion) {
992 if (LOCAL_LOGV || false) {
993 Log.v(TAG, "invalidate [" + mUri.getLastPathSegment() + "]: current "
994 + newValuesVersion + " != cached " + mValuesVersion);
995 }
996
997 mValues.clear();
998 mValuesVersion = newValuesVersion;
Dan Egnor799f7212009-11-24 16:24:44 -0800999 }
1000
Christopher Tate78d2a662012-09-13 16:19:44 -07001001 if (mValues.containsKey(name)) {
1002 return mValues.get(name); // Could be null, that's OK -- negative caching
1003 }
Dan Egnor799f7212009-11-24 16:24:44 -08001004 }
Christopher Tate78d2a662012-09-13 16:19:44 -07001005 } else {
1006 if (LOCAL_LOGV) Log.v(TAG, "get setting for user " + userHandle
1007 + " by user " + UserHandle.myUserId() + " so skipping cache");
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001008 }
Dan Egnor799f7212009-11-24 16:24:44 -08001009
Christopher Tate06efb532012-08-24 15:29:27 -07001010 IContentProvider cp = lazyGetProvider(cr);
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001011
1012 // Try the fast path first, not using query(). If this
1013 // fails (alternate Settings provider that doesn't support
1014 // this interface?) then we fall back to the query/table
1015 // interface.
Christopher Tate06efb532012-08-24 15:29:27 -07001016 if (mCallGetCommand != null) {
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001017 try {
Christopher Tate06efb532012-08-24 15:29:27 -07001018 Bundle args = null;
Christopher Tate5e08af02012-09-21 17:17:22 -07001019 if (!isSelf) {
Christopher Tate06efb532012-08-24 15:29:27 -07001020 args = new Bundle();
1021 args.putInt(CALL_METHOD_USER_KEY, userHandle);
1022 }
Dianne Hackborn35654b62013-01-14 17:38:02 -08001023 Bundle b = cp.call(cr.getPackageName(), mCallGetCommand, name, args);
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001024 if (b != null) {
1025 String value = b.getPairValue();
Christopher Tate78d2a662012-09-13 16:19:44 -07001026 // Don't update our cache for reads of other users' data
1027 if (isSelf) {
1028 synchronized (this) {
1029 mValues.put(name, value);
1030 }
1031 } else {
1032 if (LOCAL_LOGV) Log.i(TAG, "call-query of user " + userHandle
1033 + " by " + UserHandle.myUserId()
1034 + " so not updating cache");
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001035 }
1036 return value;
1037 }
1038 // If the response Bundle is null, we fall through
1039 // to the query interface below.
1040 } catch (RemoteException e) {
1041 // Not supported by the remote side? Fall through
1042 // to query().
1043 }
1044 }
1045
Dan Egnor799f7212009-11-24 16:24:44 -08001046 Cursor c = null;
1047 try {
Dianne Hackborn35654b62013-01-14 17:38:02 -08001048 c = cp.query(cr.getPackageName(), mUri, SELECT_VALUE, NAME_EQ_PLACEHOLDER,
Jeff Brown75ea64f2012-01-25 19:37:13 -08001049 new String[]{name}, null, null);
Dan Egnor799f7212009-11-24 16:24:44 -08001050 if (c == null) {
1051 Log.w(TAG, "Can't get key " + name + " from " + mUri);
1052 return null;
1053 }
1054
1055 String value = c.moveToNext() ? c.getString(0) : null;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001056 synchronized (this) {
Dan Egnor799f7212009-11-24 16:24:44 -08001057 mValues.put(name, value);
1058 }
1059 if (LOCAL_LOGV) {
1060 Log.v(TAG, "cache miss [" + mUri.getLastPathSegment() + "]: " +
1061 name + " = " + (value == null ? "(null)" : value));
1062 }
1063 return value;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001064 } catch (RemoteException e) {
Dan Egnor799f7212009-11-24 16:24:44 -08001065 Log.w(TAG, "Can't get key " + name + " from " + mUri, e);
1066 return null; // Return null, but don't cache it.
1067 } finally {
1068 if (c != null) c.close();
1069 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001070 }
1071 }
1072
1073 /**
1074 * System settings, containing miscellaneous system preferences. This
1075 * table holds simple name/value pairs. There are convenience
1076 * functions for accessing individual settings entries.
1077 */
1078 public static final class System extends NameValueTable {
1079 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_system_version";
1080
Dianne Hackborn139748f2012-09-24 11:36:57 -07001081 /**
1082 * The content:// style URL for this table
1083 */
1084 public static final Uri CONTENT_URI =
1085 Uri.parse("content://" + AUTHORITY + "/system");
1086
1087 private static final NameValueCache sNameValueCache = new NameValueCache(
1088 SYS_PROP_SETTING_VERSION,
1089 CONTENT_URI,
1090 CALL_METHOD_GET_SYSTEM,
1091 CALL_METHOD_PUT_SYSTEM);
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001092
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001093 private static final HashSet<String> MOVED_TO_SECURE;
1094 static {
1095 MOVED_TO_SECURE = new HashSet<String>(30);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001096 MOVED_TO_SECURE.add(Secure.ANDROID_ID);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001097 MOVED_TO_SECURE.add(Secure.HTTP_PROXY);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001098 MOVED_TO_SECURE.add(Secure.LOCATION_PROVIDERS_ALLOWED);
Danielle Millett925a7d82012-03-19 18:02:20 -04001099 MOVED_TO_SECURE.add(Secure.LOCK_BIOMETRIC_WEAK_FLAGS);
Amith Yamasani156c4352010-03-05 17:10:03 -08001100 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_ENABLED);
1101 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_VISIBLE);
1102 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001103 MOVED_TO_SECURE.add(Secure.LOGGING_ID);
1104 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_ENABLED);
1105 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_LAST_UPDATE);
1106 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_REDIRECT_URL);
1107 MOVED_TO_SECURE.add(Secure.SETTINGS_CLASSNAME);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001108 MOVED_TO_SECURE.add(Secure.USE_GOOGLE_MAIL);
1109 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
1110 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
1111 MOVED_TO_SECURE.add(Secure.WIFI_NUM_OPEN_NETWORKS_KEPT);
1112 MOVED_TO_SECURE.add(Secure.WIFI_ON);
1113 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE);
1114 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_AP_COUNT);
1115 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS);
1116 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED);
1117 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS);
1118 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT);
1119 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_MAX_AP_CHECKS);
1120 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ON);
1121 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_COUNT);
1122 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_DELAY_MS);
1123 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS);
Christopher Tateaa036a22014-05-19 16:33:27 -07001124
1125 // At one time in System, then Global, but now back in Secure
1126 MOVED_TO_SECURE.add(Secure.INSTALL_NON_MARKET_APPS);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001127 }
1128
Christopher Tate06efb532012-08-24 15:29:27 -07001129 private static final HashSet<String> MOVED_TO_GLOBAL;
Christopher Tate66488d62012-10-02 11:58:01 -07001130 private static final HashSet<String> MOVED_TO_SECURE_THEN_GLOBAL;
Christopher Tate06efb532012-08-24 15:29:27 -07001131 static {
1132 MOVED_TO_GLOBAL = new HashSet<String>();
Christopher Tate66488d62012-10-02 11:58:01 -07001133 MOVED_TO_SECURE_THEN_GLOBAL = new HashSet<String>();
1134
Christopher Tate92198742012-09-07 12:00:13 -07001135 // these were originally in system but migrated to secure in the past,
1136 // so are duplicated in the Secure.* namespace
Christopher Tate66488d62012-10-02 11:58:01 -07001137 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.ADB_ENABLED);
1138 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.BLUETOOTH_ON);
1139 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DATA_ROAMING);
1140 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DEVICE_PROVISIONED);
Christopher Tate66488d62012-10-02 11:58:01 -07001141 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.USB_MASS_STORAGE_ENABLED);
1142 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.HTTP_PROXY);
Christopher Tate06efb532012-08-24 15:29:27 -07001143
Christopher Tate92198742012-09-07 12:00:13 -07001144 // these are moving directly from system to global
Christopher Tate06efb532012-08-24 15:29:27 -07001145 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_ON);
1146 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_RADIOS);
1147 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS);
1148 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME);
1149 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME_ZONE);
1150 MOVED_TO_GLOBAL.add(Settings.Global.CAR_DOCK_SOUND);
1151 MOVED_TO_GLOBAL.add(Settings.Global.CAR_UNDOCK_SOUND);
1152 MOVED_TO_GLOBAL.add(Settings.Global.DESK_DOCK_SOUND);
1153 MOVED_TO_GLOBAL.add(Settings.Global.DESK_UNDOCK_SOUND);
1154 MOVED_TO_GLOBAL.add(Settings.Global.DOCK_SOUNDS_ENABLED);
1155 MOVED_TO_GLOBAL.add(Settings.Global.LOCK_SOUND);
1156 MOVED_TO_GLOBAL.add(Settings.Global.UNLOCK_SOUND);
1157 MOVED_TO_GLOBAL.add(Settings.Global.LOW_BATTERY_SOUND);
1158 MOVED_TO_GLOBAL.add(Settings.Global.POWER_SOUNDS_ENABLED);
1159 MOVED_TO_GLOBAL.add(Settings.Global.STAY_ON_WHILE_PLUGGED_IN);
1160 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SLEEP_POLICY);
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07001161 MOVED_TO_GLOBAL.add(Settings.Global.MODE_RINGER);
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001162 MOVED_TO_GLOBAL.add(Settings.Global.WINDOW_ANIMATION_SCALE);
1163 MOVED_TO_GLOBAL.add(Settings.Global.TRANSITION_ANIMATION_SCALE);
1164 MOVED_TO_GLOBAL.add(Settings.Global.ANIMATOR_DURATION_SCALE);
1165 MOVED_TO_GLOBAL.add(Settings.Global.FANCY_IME_ANIMATIONS);
1166 MOVED_TO_GLOBAL.add(Settings.Global.COMPATIBILITY_MODE);
1167 MOVED_TO_GLOBAL.add(Settings.Global.EMERGENCY_TONE);
1168 MOVED_TO_GLOBAL.add(Settings.Global.CALL_AUTO_RETRY);
1169 MOVED_TO_GLOBAL.add(Settings.Global.DEBUG_APP);
1170 MOVED_TO_GLOBAL.add(Settings.Global.WAIT_FOR_DEBUGGER);
1171 MOVED_TO_GLOBAL.add(Settings.Global.SHOW_PROCESSES);
1172 MOVED_TO_GLOBAL.add(Settings.Global.ALWAYS_FINISH_ACTIVITIES);
Geremy Condraa0735112013-03-26 21:49:26 -07001173 MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_CONTENT_URL);
1174 MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_METADATA_URL);
1175 MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_CONTENT_URL);
1176 MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_METADATA_URL);
1177 MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_CONTENT_URL);
1178 MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_METADATA_URL);
1179 MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_CONTENT_URL);
1180 MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_METADATA_URL);
Christopher Tate06efb532012-08-24 15:29:27 -07001181 }
1182
Christopher Tate66488d62012-10-02 11:58:01 -07001183 /** @hide */
1184 public static void getMovedKeys(HashSet<String> outKeySet) {
1185 outKeySet.addAll(MOVED_TO_GLOBAL);
1186 outKeySet.addAll(MOVED_TO_SECURE_THEN_GLOBAL);
1187 }
1188
1189 /** @hide */
1190 public static void getNonLegacyMovedKeys(HashSet<String> outKeySet) {
1191 outKeySet.addAll(MOVED_TO_GLOBAL);
1192 }
1193
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001194 /**
1195 * Look up a name in the database.
1196 * @param resolver to access the database with
1197 * @param name to look up in the table
1198 * @return the corresponding value, or null if not present
1199 */
Dianne Hackborn139748f2012-09-24 11:36:57 -07001200 public static String getString(ContentResolver resolver, String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07001201 return getStringForUser(resolver, name, UserHandle.myUserId());
1202 }
1203
1204 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -07001205 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -07001206 int userHandle) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001207 if (MOVED_TO_SECURE.contains(name)) {
1208 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1209 + " to android.provider.Settings.Secure, returning read-only value.");
Christopher Tate06efb532012-08-24 15:29:27 -07001210 return Secure.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001211 }
Christopher Tate66488d62012-10-02 11:58:01 -07001212 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07001213 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1214 + " to android.provider.Settings.Global, returning read-only value.");
1215 return Global.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001216 }
Christopher Tate06efb532012-08-24 15:29:27 -07001217 return sNameValueCache.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001218 }
1219
1220 /**
1221 * Store a name/value pair into the database.
1222 * @param resolver to access the database with
1223 * @param name to store
1224 * @param value to associate with the name
1225 * @return true if the value was set, false on database errors
1226 */
1227 public static boolean putString(ContentResolver resolver, String name, String value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001228 return putStringForUser(resolver, name, value, UserHandle.myUserId());
1229 }
1230
1231 /** @hide */
1232 public static boolean putStringForUser(ContentResolver resolver, String name, String value,
1233 int userHandle) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001234 if (MOVED_TO_SECURE.contains(name)) {
1235 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1236 + " to android.provider.Settings.Secure, value is unchanged.");
1237 return false;
1238 }
Christopher Tate66488d62012-10-02 11:58:01 -07001239 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07001240 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1241 + " to android.provider.Settings.Global, value is unchanged.");
1242 return false;
1243 }
Christopher Tate06efb532012-08-24 15:29:27 -07001244 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001245 }
1246
1247 /**
1248 * Construct the content URI for a particular name/value pair,
1249 * useful for monitoring changes with a ContentObserver.
1250 * @param name to look up in the table
1251 * @return the corresponding content URI, or null if not present
1252 */
1253 public static Uri getUriFor(String name) {
1254 if (MOVED_TO_SECURE.contains(name)) {
1255 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1256 + " to android.provider.Settings.Secure, returning Secure URI.");
1257 return Secure.getUriFor(Secure.CONTENT_URI, name);
1258 }
Christopher Tate66488d62012-10-02 11:58:01 -07001259 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07001260 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1261 + " to android.provider.Settings.Global, returning read-only global URI.");
1262 return Global.getUriFor(Global.CONTENT_URI, name);
1263 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001264 return getUriFor(CONTENT_URI, name);
1265 }
1266
1267 /**
1268 * Convenience function for retrieving a single system settings value
1269 * as an integer. Note that internally setting values are always
1270 * stored as strings; this function converts the string to an integer
1271 * for you. The default value will be returned if the setting is
1272 * not defined or not an integer.
1273 *
1274 * @param cr The ContentResolver to access.
1275 * @param name The name of the setting to retrieve.
1276 * @param def Value to return if the setting is not defined.
1277 *
1278 * @return The setting's current value, or 'def' if it is not defined
1279 * or not a valid integer.
1280 */
1281 public static int getInt(ContentResolver cr, String name, int def) {
Christopher Tate06efb532012-08-24 15:29:27 -07001282 return getIntForUser(cr, name, def, UserHandle.myUserId());
1283 }
1284
1285 /** @hide */
1286 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
1287 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001288 try {
1289 return v != null ? Integer.parseInt(v) : def;
1290 } catch (NumberFormatException e) {
1291 return def;
1292 }
1293 }
1294
1295 /**
1296 * Convenience function for retrieving a single system settings value
1297 * as an integer. Note that internally setting values are always
1298 * stored as strings; this function converts the string to an integer
1299 * for you.
1300 * <p>
1301 * This version does not take a default value. If the setting has not
1302 * been set, or the string value is not a number,
1303 * it throws {@link SettingNotFoundException}.
1304 *
1305 * @param cr The ContentResolver to access.
1306 * @param name The name of the setting to retrieve.
1307 *
1308 * @throws SettingNotFoundException Thrown if a setting by the given
1309 * name can't be found or the setting value is not an integer.
1310 *
1311 * @return The setting's current value.
1312 */
1313 public static int getInt(ContentResolver cr, String name)
1314 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07001315 return getIntForUser(cr, name, UserHandle.myUserId());
1316 }
1317
1318 /** @hide */
1319 public static int getIntForUser(ContentResolver cr, String name, int userHandle)
1320 throws SettingNotFoundException {
1321 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001322 try {
1323 return Integer.parseInt(v);
1324 } catch (NumberFormatException e) {
1325 throw new SettingNotFoundException(name);
1326 }
1327 }
1328
1329 /**
1330 * Convenience function for updating a single settings value as an
1331 * integer. This will either create a new entry in the table if the
1332 * given name does not exist, or modify the value of the existing row
1333 * with that name. Note that internally setting values are always
1334 * stored as strings, so this function converts the given value to a
1335 * string before storing it.
1336 *
1337 * @param cr The ContentResolver to access.
1338 * @param name The name of the setting to modify.
1339 * @param value The new value for the setting.
1340 * @return true if the value was set, false on database errors
1341 */
1342 public static boolean putInt(ContentResolver cr, String name, int value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001343 return putIntForUser(cr, name, value, UserHandle.myUserId());
1344 }
1345
1346 /** @hide */
1347 public static boolean putIntForUser(ContentResolver cr, String name, int value,
1348 int userHandle) {
1349 return putStringForUser(cr, name, Integer.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001350 }
1351
1352 /**
1353 * Convenience function for retrieving a single system settings value
1354 * as a {@code long}. Note that internally setting values are always
1355 * stored as strings; this function converts the string to a {@code long}
1356 * for you. The default value will be returned if the setting is
1357 * not defined or not a {@code long}.
1358 *
1359 * @param cr The ContentResolver to access.
1360 * @param name The name of the setting to retrieve.
1361 * @param def Value to return if the setting is not defined.
1362 *
1363 * @return The setting's current value, or 'def' if it is not defined
1364 * or not a valid {@code long}.
1365 */
1366 public static long getLong(ContentResolver cr, String name, long def) {
Christopher Tate06efb532012-08-24 15:29:27 -07001367 return getLongForUser(cr, name, def, UserHandle.myUserId());
1368 }
1369
1370 /** @hide */
1371 public static long getLongForUser(ContentResolver cr, String name, long def,
1372 int userHandle) {
1373 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001374 long value;
1375 try {
1376 value = valString != null ? Long.parseLong(valString) : def;
1377 } catch (NumberFormatException e) {
1378 value = def;
1379 }
1380 return value;
1381 }
1382
1383 /**
1384 * Convenience function for retrieving a single system settings value
1385 * as a {@code long}. Note that internally setting values are always
1386 * stored as strings; this function converts the string to a {@code long}
1387 * for you.
1388 * <p>
1389 * This version does not take a default value. If the setting has not
1390 * been set, or the string value is not a number,
1391 * it throws {@link SettingNotFoundException}.
1392 *
1393 * @param cr The ContentResolver to access.
1394 * @param name The name of the setting to retrieve.
1395 *
1396 * @return The setting's current value.
1397 * @throws SettingNotFoundException Thrown if a setting by the given
1398 * name can't be found or the setting value is not an integer.
1399 */
1400 public static long getLong(ContentResolver cr, String name)
1401 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07001402 return getLongForUser(cr, name, UserHandle.myUserId());
1403 }
1404
1405 /** @hide */
1406 public static long getLongForUser(ContentResolver cr, String name, int userHandle)
1407 throws SettingNotFoundException {
1408 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001409 try {
1410 return Long.parseLong(valString);
1411 } catch (NumberFormatException e) {
1412 throw new SettingNotFoundException(name);
1413 }
1414 }
1415
1416 /**
1417 * Convenience function for updating a single settings value as a long
1418 * integer. This will either create a new entry in the table if the
1419 * given name does not exist, or modify the value of the existing row
1420 * with that name. Note that internally setting values are always
1421 * stored as strings, so this function converts the given value to a
1422 * string before storing it.
1423 *
1424 * @param cr The ContentResolver to access.
1425 * @param name The name of the setting to modify.
1426 * @param value The new value for the setting.
1427 * @return true if the value was set, false on database errors
1428 */
1429 public static boolean putLong(ContentResolver cr, String name, long value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001430 return putLongForUser(cr, name, value, UserHandle.myUserId());
1431 }
1432
1433 /** @hide */
1434 public static boolean putLongForUser(ContentResolver cr, String name, long value,
1435 int userHandle) {
1436 return putStringForUser(cr, name, Long.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001437 }
1438
1439 /**
1440 * Convenience function for retrieving a single system settings value
1441 * as a floating point number. Note that internally setting values are
1442 * always stored as strings; this function converts the string to an
1443 * float for you. The default value will be returned if the setting
1444 * is not defined or not a valid float.
1445 *
1446 * @param cr The ContentResolver to access.
1447 * @param name The name of the setting to retrieve.
1448 * @param def Value to return if the setting is not defined.
1449 *
1450 * @return The setting's current value, or 'def' if it is not defined
1451 * or not a valid float.
1452 */
1453 public static float getFloat(ContentResolver cr, String name, float def) {
Christopher Tate06efb532012-08-24 15:29:27 -07001454 return getFloatForUser(cr, name, def, UserHandle.myUserId());
1455 }
1456
1457 /** @hide */
1458 public static float getFloatForUser(ContentResolver cr, String name, float def,
1459 int userHandle) {
1460 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001461 try {
1462 return v != null ? Float.parseFloat(v) : def;
1463 } catch (NumberFormatException e) {
1464 return def;
1465 }
1466 }
1467
1468 /**
1469 * Convenience function for retrieving a single system settings value
1470 * as a float. Note that internally setting values are always
1471 * stored as strings; this function converts the string to a float
1472 * for you.
1473 * <p>
1474 * This version does not take a default value. If the setting has not
1475 * been set, or the string value is not a number,
1476 * it throws {@link SettingNotFoundException}.
1477 *
1478 * @param cr The ContentResolver to access.
1479 * @param name The name of the setting to retrieve.
1480 *
1481 * @throws SettingNotFoundException Thrown if a setting by the given
1482 * name can't be found or the setting value is not a float.
1483 *
1484 * @return The setting's current value.
1485 */
1486 public static float getFloat(ContentResolver cr, String name)
1487 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07001488 return getFloatForUser(cr, name, UserHandle.myUserId());
1489 }
1490
1491 /** @hide */
1492 public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
1493 throws SettingNotFoundException {
1494 String v = getStringForUser(cr, name, userHandle);
Brian Muramatsue1d46982010-12-06 17:34:20 -08001495 if (v == null) {
1496 throw new SettingNotFoundException(name);
1497 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001498 try {
1499 return Float.parseFloat(v);
1500 } catch (NumberFormatException e) {
1501 throw new SettingNotFoundException(name);
1502 }
1503 }
1504
1505 /**
1506 * Convenience function for updating a single settings value as a
1507 * floating point number. This will either create a new entry in the
1508 * table if the given name does not exist, or modify the value of the
1509 * existing row with that name. Note that internally setting values
1510 * are always stored as strings, so this function converts the given
1511 * value to a string before storing it.
1512 *
1513 * @param cr The ContentResolver to access.
1514 * @param name The name of the setting to modify.
1515 * @param value The new value for the setting.
1516 * @return true if the value was set, false on database errors
1517 */
1518 public static boolean putFloat(ContentResolver cr, String name, float value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001519 return putFloatForUser(cr, name, value, UserHandle.myUserId());
1520 }
1521
1522 /** @hide */
1523 public static boolean putFloatForUser(ContentResolver cr, String name, float value,
1524 int userHandle) {
1525 return putStringForUser(cr, name, Float.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001526 }
1527
1528 /**
1529 * Convenience function to read all of the current
1530 * configuration-related settings into a
1531 * {@link Configuration} object.
1532 *
1533 * @param cr The ContentResolver to access.
1534 * @param outConfig Where to place the configuration settings.
1535 */
1536 public static void getConfiguration(ContentResolver cr, Configuration outConfig) {
Christopher Tate06efb532012-08-24 15:29:27 -07001537 getConfigurationForUser(cr, outConfig, UserHandle.myUserId());
1538 }
1539
1540 /** @hide */
1541 public static void getConfigurationForUser(ContentResolver cr, Configuration outConfig,
1542 int userHandle) {
1543 outConfig.fontScale = Settings.System.getFloatForUser(
1544 cr, FONT_SCALE, outConfig.fontScale, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001545 if (outConfig.fontScale < 0) {
1546 outConfig.fontScale = 1;
1547 }
1548 }
1549
1550 /**
Dianne Hackborn31ca8542011-07-19 14:58:28 -07001551 * @hide Erase the fields in the Configuration that should be applied
1552 * by the settings.
1553 */
1554 public static void clearConfiguration(Configuration inoutConfig) {
1555 inoutConfig.fontScale = 0;
1556 }
Narayan Kamath6d632962011-08-24 11:51:37 +01001557
Dianne Hackborn31ca8542011-07-19 14:58:28 -07001558 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001559 * Convenience function to write a batch of configuration-related
1560 * settings from a {@link Configuration} object.
1561 *
1562 * @param cr The ContentResolver to access.
1563 * @param config The settings to write.
1564 * @return true if the values were set, false on database errors
1565 */
1566 public static boolean putConfiguration(ContentResolver cr, Configuration config) {
Christopher Tate06efb532012-08-24 15:29:27 -07001567 return putConfigurationForUser(cr, config, UserHandle.myUserId());
1568 }
1569
1570 /** @hide */
1571 public static boolean putConfigurationForUser(ContentResolver cr, Configuration config,
1572 int userHandle) {
1573 return Settings.System.putFloatForUser(cr, FONT_SCALE, config.fontScale, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001574 }
1575
Dianne Hackbornb8b11a02010-03-10 15:53:11 -08001576 /** @hide */
1577 public static boolean hasInterestingConfigurationChanges(int changes) {
1578 return (changes&ActivityInfo.CONFIG_FONT_SCALE) != 0;
1579 }
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07001580
Christopher Tate06efb532012-08-24 15:29:27 -07001581 /** @deprecated - Do not use */
1582 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001583 public static boolean getShowGTalkServiceStatus(ContentResolver cr) {
Christopher Tate06efb532012-08-24 15:29:27 -07001584 return getShowGTalkServiceStatusForUser(cr, UserHandle.myUserId());
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001585 }
1586
Christopher Tate06efb532012-08-24 15:29:27 -07001587 /**
1588 * @hide
1589 * @deprecated - Do not use
1590 */
1591 public static boolean getShowGTalkServiceStatusForUser(ContentResolver cr,
1592 int userHandle) {
1593 return getIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, 0, userHandle) != 0;
1594 }
1595
1596 /** @deprecated - Do not use */
1597 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001598 public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag) {
Christopher Tatec8c08382012-09-19 17:18:18 -07001599 setShowGTalkServiceStatusForUser(cr, flag, UserHandle.myUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07001600 }
1601
1602 /**
1603 * @hide
1604 * @deprecated - Do not use
1605 */
1606 @Deprecated
1607 public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean flag,
1608 int userHandle) {
1609 putIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, flag ? 1 : 0, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001610 }
1611
1612 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001613 * @deprecated Use {@link android.provider.Settings.Global#STAY_ON_WHILE_PLUGGED_IN} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001614 */
Christopher Tate06efb532012-08-24 15:29:27 -07001615 @Deprecated
1616 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 -08001617
1618 /**
1619 * What happens when the user presses the end call button if they're not
1620 * on a call.<br/>
1621 * <b>Values:</b><br/>
1622 * 0 - The end button does nothing.<br/>
1623 * 1 - The end button goes to the home screen.<br/>
1624 * 2 - The end button puts the device to sleep and locks the keyguard.<br/>
1625 * 3 - The end button goes to the home screen. If the user is already on the
1626 * home screen, it puts the device to sleep.
1627 */
1628 public static final String END_BUTTON_BEHAVIOR = "end_button_behavior";
1629
1630 /**
David Brown458e8062010-03-08 21:52:11 -08001631 * END_BUTTON_BEHAVIOR value for "go home".
1632 * @hide
1633 */
1634 public static final int END_BUTTON_BEHAVIOR_HOME = 0x1;
1635
1636 /**
1637 * END_BUTTON_BEHAVIOR value for "go to sleep".
1638 * @hide
1639 */
1640 public static final int END_BUTTON_BEHAVIOR_SLEEP = 0x2;
1641
1642 /**
1643 * END_BUTTON_BEHAVIOR default value.
1644 * @hide
1645 */
1646 public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_SLEEP;
1647
1648 /**
Joe Onorato9cdffa12011-04-06 18:27:27 -07001649 * Is advanced settings mode turned on. 0 == no, 1 == yes
1650 * @hide
1651 */
1652 public static final String ADVANCED_SETTINGS = "advanced_settings";
1653
1654 /**
1655 * ADVANCED_SETTINGS default value.
1656 * @hide
1657 */
1658 public static final int ADVANCED_SETTINGS_DEFAULT = 0;
1659
1660 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001661 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001662 */
Christopher Tate06efb532012-08-24 15:29:27 -07001663 @Deprecated
1664 public static final String AIRPLANE_MODE_ON = Global.AIRPLANE_MODE_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001665
1666 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001667 * @deprecated Use {@link android.provider.Settings.Global#RADIO_BLUETOOTH} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001668 */
Christopher Tate06efb532012-08-24 15:29:27 -07001669 @Deprecated
1670 public static final String RADIO_BLUETOOTH = Global.RADIO_BLUETOOTH;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001671
1672 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001673 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIFI} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001674 */
Christopher Tate06efb532012-08-24 15:29:27 -07001675 @Deprecated
1676 public static final String RADIO_WIFI = Global.RADIO_WIFI;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001677
Robert Greenwalt8588e472011-11-08 10:12:25 -08001678 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001679 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIMAX} instead
Robert Greenwalt8588e472011-11-08 10:12:25 -08001680 * {@hide}
1681 */
Christopher Tate06efb532012-08-24 15:29:27 -07001682 @Deprecated
1683 public static final String RADIO_WIMAX = Global.RADIO_WIMAX;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001684
1685 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001686 * @deprecated Use {@link android.provider.Settings.Global#RADIO_CELL} instead
Nick Pelly8d32a012011-08-09 07:03:49 -07001687 */
Christopher Tate06efb532012-08-24 15:29:27 -07001688 @Deprecated
1689 public static final String RADIO_CELL = Global.RADIO_CELL;
Nick Pelly8d32a012011-08-09 07:03:49 -07001690
1691 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001692 * @deprecated Use {@link android.provider.Settings.Global#RADIO_NFC} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001693 */
Christopher Tate06efb532012-08-24 15:29:27 -07001694 @Deprecated
1695 public static final String RADIO_NFC = Global.RADIO_NFC;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001696
1697 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001698 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_RADIOS} instead
1699 */
1700 @Deprecated
1701 public static final String AIRPLANE_MODE_RADIOS = Global.AIRPLANE_MODE_RADIOS;
1702
1703 /**
1704 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_TOGGLEABLE_RADIOS} instead
Mike Lockwoodbd5ddf02009-07-29 21:37:14 -07001705 *
1706 * {@hide}
1707 */
Christopher Tate06efb532012-08-24 15:29:27 -07001708 @Deprecated
1709 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS =
1710 Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS;
Mike Lockwoodbd5ddf02009-07-29 21:37:14 -07001711
1712 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001713 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001714 */
Christopher Tate06efb532012-08-24 15:29:27 -07001715 @Deprecated
1716 public static final String WIFI_SLEEP_POLICY = Global.WIFI_SLEEP_POLICY;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001717
1718 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001719 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_DEFAULT} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001720 */
Christopher Tate06efb532012-08-24 15:29:27 -07001721 @Deprecated
1722 public static final int WIFI_SLEEP_POLICY_DEFAULT = Global.WIFI_SLEEP_POLICY_DEFAULT;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001723
1724 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001725 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001726 */
Christopher Tate06efb532012-08-24 15:29:27 -07001727 @Deprecated
1728 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED =
1729 Global.WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001730
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001731 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001732 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001733 */
Christopher Tate06efb532012-08-24 15:29:27 -07001734 @Deprecated
1735 public static final int WIFI_SLEEP_POLICY_NEVER = Global.WIFI_SLEEP_POLICY_NEVER;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001736
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07001737 /**
1738 * @deprecated Use {@link android.provider.Settings.Global#MODE_RINGER} instead
1739 */
1740 @Deprecated
1741 public static final String MODE_RINGER = Global.MODE_RINGER;
1742
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001743 /**
1744 * Whether to use static IP and other static network attributes.
1745 * <p>
1746 * Set to 1 for true and 0 for false.
Jeff Sharkey625239a2012-09-26 22:03:49 -07001747 *
1748 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001749 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07001750 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001751 public static final String WIFI_USE_STATIC_IP = "wifi_use_static_ip";
1752
1753 /**
1754 * The static IP address.
1755 * <p>
1756 * Example: "192.168.1.51"
Jeff Sharkey625239a2012-09-26 22:03:49 -07001757 *
1758 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001759 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07001760 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001761 public static final String WIFI_STATIC_IP = "wifi_static_ip";
1762
1763 /**
1764 * If using static IP, the gateway's IP address.
1765 * <p>
1766 * Example: "192.168.1.1"
Jeff Sharkey625239a2012-09-26 22:03:49 -07001767 *
1768 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001769 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07001770 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001771 public static final String WIFI_STATIC_GATEWAY = "wifi_static_gateway";
1772
1773 /**
1774 * If using static IP, the net mask.
1775 * <p>
1776 * Example: "255.255.255.0"
Jeff Sharkey625239a2012-09-26 22:03:49 -07001777 *
1778 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001779 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07001780 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001781 public static final String WIFI_STATIC_NETMASK = "wifi_static_netmask";
1782
1783 /**
1784 * If using static IP, the primary DNS's IP address.
1785 * <p>
1786 * Example: "192.168.1.1"
Jeff Sharkey625239a2012-09-26 22:03:49 -07001787 *
1788 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001789 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07001790 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001791 public static final String WIFI_STATIC_DNS1 = "wifi_static_dns1";
1792
1793 /**
1794 * If using static IP, the secondary DNS's IP address.
1795 * <p>
1796 * Example: "192.168.1.2"
Jeff Sharkey625239a2012-09-26 22:03:49 -07001797 *
1798 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001799 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07001800 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001801 public static final String WIFI_STATIC_DNS2 = "wifi_static_dns2";
1802
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001803
1804 /**
1805 * Determines whether remote devices may discover and/or connect to
1806 * this device.
1807 * <P>Type: INT</P>
1808 * 2 -- discoverable and connectable
1809 * 1 -- connectable but not discoverable
1810 * 0 -- neither connectable nor discoverable
1811 */
1812 public static final String BLUETOOTH_DISCOVERABILITY =
1813 "bluetooth_discoverability";
1814
1815 /**
1816 * Bluetooth discoverability timeout. If this value is nonzero, then
1817 * Bluetooth becomes discoverable for a certain number of seconds,
1818 * after which is becomes simply connectable. The value is in seconds.
1819 */
1820 public static final String BLUETOOTH_DISCOVERABILITY_TIMEOUT =
1821 "bluetooth_discoverability_timeout";
1822
1823 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08001824 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_ENABLED}
1825 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001826 */
Amith Yamasani156c4352010-03-05 17:10:03 -08001827 @Deprecated
1828 public static final String LOCK_PATTERN_ENABLED = Secure.LOCK_PATTERN_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001829
1830 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08001831 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_VISIBLE}
1832 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001833 */
Amith Yamasani156c4352010-03-05 17:10:03 -08001834 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001835 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
1836
1837 /**
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07001838 * @deprecated Use
Amith Yamasani156c4352010-03-05 17:10:03 -08001839 * {@link android.provider.Settings.Secure#LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED}
1840 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001841 */
Amith Yamasani156c4352010-03-05 17:10:03 -08001842 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001843 public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED =
1844 "lock_pattern_tactile_feedback_enabled";
1845
1846
1847 /**
1848 * A formatted string of the next alarm that is set, or the empty string
1849 * if there is no alarm set.
Adrian Roosc42a1e12014-07-07 23:35:53 +02001850 *
1851 * @deprecated Use {@link android.app.AlarmManager#getNextAlarmClock()}.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001852 */
Adrian Roosc42a1e12014-07-07 23:35:53 +02001853 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001854 public static final String NEXT_ALARM_FORMATTED = "next_alarm_formatted";
1855
1856 /**
1857 * Scaling factor for fonts, float.
1858 */
1859 public static final String FONT_SCALE = "font_scale";
1860
1861 /**
1862 * Name of an application package to be debugged.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001863 *
1864 * @deprecated Use {@link Global#DEBUG_APP} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001865 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001866 @Deprecated
1867 public static final String DEBUG_APP = Global.DEBUG_APP;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001868
1869 /**
1870 * If 1, when launching DEBUG_APP it will wait for the debugger before
1871 * starting user code. If 0, it will run normally.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001872 *
1873 * @deprecated Use {@link Global#WAIT_FOR_DEBUGGER} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001874 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001875 @Deprecated
1876 public static final String WAIT_FOR_DEBUGGER = Global.WAIT_FOR_DEBUGGER;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001877
1878 /**
1879 * Whether or not to dim the screen. 0=no 1=yes
Jeff Brown96307042012-07-27 15:51:34 -07001880 * @deprecated This setting is no longer used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001881 */
Jeff Brown96307042012-07-27 15:51:34 -07001882 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001883 public static final String DIM_SCREEN = "dim_screen";
1884
1885 /**
1886 * The timeout before the screen turns off.
1887 */
1888 public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout";
1889
1890 /**
1891 * The screen backlight brightness between 0 and 255.
1892 */
1893 public static final String SCREEN_BRIGHTNESS = "screen_brightness";
1894
1895 /**
Dan Murphy951764b2009-08-27 14:59:03 -05001896 * Control whether to enable automatic brightness mode.
Dan Murphy951764b2009-08-27 14:59:03 -05001897 */
1898 public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode";
1899
1900 /**
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08001901 * Adjustment to auto-brightness to make it generally more (>0.0 <1.0)
1902 * or less (<0.0 >-1.0) bright.
Dianne Hackborn518a3d82012-05-09 16:30:49 -07001903 * @hide
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08001904 */
1905 public static final String SCREEN_AUTO_BRIGHTNESS_ADJ = "screen_auto_brightness_adj";
1906
1907 /**
Mike Lockwooddc3494e2009-10-14 21:17:09 -07001908 * SCREEN_BRIGHTNESS_MODE value for manual mode.
Mike Lockwooddc3494e2009-10-14 21:17:09 -07001909 */
1910 public static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0;
1911
1912 /**
Scott Main52bfc242012-02-09 10:09:14 -08001913 * SCREEN_BRIGHTNESS_MODE value for automatic mode.
Mike Lockwooddc3494e2009-10-14 21:17:09 -07001914 */
1915 public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1;
1916
1917 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001918 * Control whether the process CPU usage meter should be shown.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001919 *
1920 * @deprecated Use {@link Global#SHOW_PROCESSES} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001921 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001922 @Deprecated
1923 public static final String SHOW_PROCESSES = Global.SHOW_PROCESSES;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001924
1925 /**
1926 * If 1, the activity manager will aggressively finish activities and
1927 * processes as soon as they are no longer needed. If 0, the normal
1928 * extended lifetime is used.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001929 *
1930 * @deprecated Use {@link Global#ALWAYS_FINISH_ACTIVITIES} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001931 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001932 @Deprecated
1933 public static final String ALWAYS_FINISH_ACTIVITIES = Global.ALWAYS_FINISH_ACTIVITIES;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001934
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001935 /**
1936 * Determines which streams are affected by ringer mode changes. The
1937 * stream type's bit should be set to 1 if it should be muted when going
1938 * into an inaudible ringer mode.
1939 */
1940 public static final String MODE_RINGER_STREAMS_AFFECTED = "mode_ringer_streams_affected";
1941
1942 /**
1943 * Determines which streams are affected by mute. The
1944 * stream type's bit should be set to 1 if it should be muted when a mute request
1945 * is received.
1946 */
1947 public static final String MUTE_STREAMS_AFFECTED = "mute_streams_affected";
1948
1949 /**
1950 * Whether vibrate is on for different events. This is used internally,
1951 * changing this value will not change the vibrate. See AudioManager.
1952 */
1953 public static final String VIBRATE_ON = "vibrate_on";
1954
1955 /**
Jeff Brown7f6c2312012-04-13 20:38:38 -07001956 * If 1, redirects the system vibrator to all currently attached input devices
1957 * that support vibration. If there are no such input devices, then the system
1958 * vibrator is used instead.
1959 * If 0, does not register the system vibrator.
1960 *
1961 * This setting is mainly intended to provide a compatibility mechanism for
1962 * applications that only know about the system vibrator and do not use the
1963 * input device vibrator API.
1964 *
1965 * @hide
1966 */
1967 public static final String VIBRATE_INPUT_DEVICES = "vibrate_input_devices";
1968
1969 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001970 * Ringer volume. This is used internally, changing this value will not
1971 * change the volume. See AudioManager.
1972 */
1973 public static final String VOLUME_RING = "volume_ring";
1974
1975 /**
1976 * System/notifications volume. This is used internally, changing this
1977 * value will not change the volume. See AudioManager.
1978 */
1979 public static final String VOLUME_SYSTEM = "volume_system";
1980
1981 /**
1982 * Voice call volume. This is used internally, changing this value will
1983 * not change the volume. See AudioManager.
1984 */
1985 public static final String VOLUME_VOICE = "volume_voice";
1986
1987 /**
1988 * Music/media/gaming volume. This is used internally, changing this
1989 * value will not change the volume. See AudioManager.
1990 */
1991 public static final String VOLUME_MUSIC = "volume_music";
1992
1993 /**
1994 * Alarm volume. This is used internally, changing this
1995 * value will not change the volume. See AudioManager.
1996 */
1997 public static final String VOLUME_ALARM = "volume_alarm";
1998
1999 /**
2000 * Notification volume. This is used internally, changing this
2001 * value will not change the volume. See AudioManager.
2002 */
2003 public static final String VOLUME_NOTIFICATION = "volume_notification";
2004
2005 /**
Eric Laurent484d2882009-12-08 09:05:45 -08002006 * Bluetooth Headset volume. This is used internally, changing this value will
2007 * not change the volume. See AudioManager.
2008 */
2009 public static final String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco";
2010
2011 /**
Mike Lockwood8517e462011-10-25 14:47:19 -04002012 * Master volume (float in the range 0.0f to 1.0f).
2013 * @hide
2014 */
2015 public static final String VOLUME_MASTER = "volume_master";
2016
2017 /**
Justin Koh57978ed2012-04-03 17:37:58 -07002018 * Master volume mute (int 1 = mute, 0 = not muted).
2019 *
2020 * @hide
2021 */
2022 public static final String VOLUME_MASTER_MUTE = "volume_master_mute";
2023
2024 /**
2025 * Whether the notifications should use the ring volume (value of 1) or
2026 * a separate notification volume (value of 0). In most cases, users
2027 * will have this enabled so the notification and ringer volumes will be
2028 * the same. However, power users can disable this and use the separate
2029 * notification volume control.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002030 * <p>
Justin Koh57978ed2012-04-03 17:37:58 -07002031 * Note: This is a one-off setting that will be removed in the future
2032 * when there is profile support. For this reason, it is kept hidden
2033 * from the public APIs.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002034 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002035 * @hide
Amith Yamasani42722bf2011-07-22 10:34:27 -07002036 * @deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002037 */
Gilles Debunnee90bed12011-08-30 14:28:27 -07002038 @Deprecated
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002039 public static final String NOTIFICATIONS_USE_RING_VOLUME =
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002040 "notifications_use_ring_volume";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002041
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002042 /**
Daniel Sandler6329bf72010-02-26 15:17:44 -05002043 * Whether silent mode should allow vibration feedback. This is used
2044 * internally in AudioService and the Sound settings activity to
2045 * coordinate decoupling of vibrate and silent modes. This setting
2046 * will likely be removed in a future release with support for
2047 * audio/vibe feedback profiles.
2048 *
Eric Laurentbffc3d12012-05-07 17:43:49 -07002049 * Not used anymore. On devices with vibrator, the user explicitly selects
2050 * silent or vibrate mode.
2051 * Kept for use by legacy database upgrade code in DatabaseHelper.
Daniel Sandler6329bf72010-02-26 15:17:44 -05002052 * @hide
2053 */
2054 public static final String VIBRATE_IN_SILENT = "vibrate_in_silent";
2055
2056 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002057 * The mapping of stream type (integer) to its setting.
2058 */
2059 public static final String[] VOLUME_SETTINGS = {
2060 VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC,
Eric Laurent484d2882009-12-08 09:05:45 -08002061 VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002062 };
2063
2064 /**
2065 * Appended to various volume related settings to record the previous
2066 * values before they the settings were affected by a silent/vibrate
2067 * ringer mode change.
2068 */
2069 public static final String APPEND_FOR_LAST_AUDIBLE = "_last_audible";
2070
2071 /**
2072 * Persistent store for the system-wide default ringtone URI.
2073 * <p>
2074 * If you need to play the default ringtone at any given time, it is recommended
2075 * you give {@link #DEFAULT_RINGTONE_URI} to the media player. It will resolve
2076 * to the set default ringtone at the time of playing.
2077 *
2078 * @see #DEFAULT_RINGTONE_URI
2079 */
2080 public static final String RINGTONE = "ringtone";
2081
2082 /**
2083 * A {@link Uri} that will point to the current default ringtone at any
2084 * given time.
2085 * <p>
2086 * If the current default ringtone is in the DRM provider and the caller
2087 * does not have permission, the exception will be a
2088 * FileNotFoundException.
2089 */
2090 public static final Uri DEFAULT_RINGTONE_URI = getUriFor(RINGTONE);
2091
2092 /**
2093 * Persistent store for the system-wide default notification sound.
2094 *
2095 * @see #RINGTONE
2096 * @see #DEFAULT_NOTIFICATION_URI
2097 */
2098 public static final String NOTIFICATION_SOUND = "notification_sound";
2099
2100 /**
2101 * A {@link Uri} that will point to the current default notification
2102 * sound at any given time.
2103 *
2104 * @see #DEFAULT_RINGTONE_URI
2105 */
2106 public static final Uri DEFAULT_NOTIFICATION_URI = getUriFor(NOTIFICATION_SOUND);
2107
2108 /**
Patrick Scott3156bb002009-04-13 09:57:38 -07002109 * Persistent store for the system-wide default alarm alert.
2110 *
2111 * @see #RINGTONE
2112 * @see #DEFAULT_ALARM_ALERT_URI
2113 */
2114 public static final String ALARM_ALERT = "alarm_alert";
2115
2116 /**
2117 * A {@link Uri} that will point to the current default alarm alert at
2118 * any given time.
2119 *
2120 * @see #DEFAULT_ALARM_ALERT_URI
2121 */
2122 public static final Uri DEFAULT_ALARM_ALERT_URI = getUriFor(ALARM_ALERT);
2123
2124 /**
Jean-Michel Trivid589fea2011-04-15 11:28:10 -07002125 * Persistent store for the system default media button event receiver.
2126 *
2127 * @hide
2128 */
2129 public static final String MEDIA_BUTTON_RECEIVER = "media_button_receiver";
2130
2131 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002132 * Setting to enable Auto Replace (AutoText) in text editors. 1 = On, 0 = Off
2133 */
2134 public static final String TEXT_AUTO_REPLACE = "auto_replace";
2135
2136 /**
2137 * Setting to enable Auto Caps in text editors. 1 = On, 0 = Off
2138 */
2139 public static final String TEXT_AUTO_CAPS = "auto_caps";
2140
2141 /**
2142 * Setting to enable Auto Punctuate in text editors. 1 = On, 0 = Off. This
2143 * feature converts two spaces to a "." and space.
2144 */
2145 public static final String TEXT_AUTO_PUNCTUATE = "auto_punctuate";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002146
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002147 /**
2148 * Setting to showing password characters in text editors. 1 = On, 0 = Off
2149 */
2150 public static final String TEXT_SHOW_PASSWORD = "show_password";
2151
2152 public static final String SHOW_GTALK_SERVICE_STATUS =
2153 "SHOW_GTALK_SERVICE_STATUS";
2154
2155 /**
2156 * Name of activity to use for wallpaper on the home screen.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002157 *
2158 * @deprecated Use {@link WallpaperManager} instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002159 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002160 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002161 public static final String WALLPAPER_ACTIVITY = "wallpaper_activity";
2162
2163 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002164 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME}
2165 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002166 */
Christopher Tate06efb532012-08-24 15:29:27 -07002167 @Deprecated
2168 public static final String AUTO_TIME = Global.AUTO_TIME;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002169
2170 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002171 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME_ZONE}
2172 * instead
Amith Yamasaniad450be2010-09-16 16:47:00 -07002173 */
Christopher Tate06efb532012-08-24 15:29:27 -07002174 @Deprecated
2175 public static final String AUTO_TIME_ZONE = Global.AUTO_TIME_ZONE;
Amith Yamasaniad450be2010-09-16 16:47:00 -07002176
2177 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002178 * Display times as 12 or 24 hours
2179 * 12
2180 * 24
2181 */
2182 public static final String TIME_12_24 = "time_12_24";
2183
2184 /**
2185 * Date format string
2186 * mm/dd/yyyy
2187 * dd/mm/yyyy
2188 * yyyy/mm/dd
2189 */
2190 public static final String DATE_FORMAT = "date_format";
2191
2192 /**
2193 * Whether the setup wizard has been run before (on first boot), or if
2194 * it still needs to be run.
2195 *
2196 * nonzero = it has been run in the past
2197 * 0 = it has not been run in the past
2198 */
2199 public static final String SETUP_WIZARD_HAS_RUN = "setup_wizard_has_run";
2200
2201 /**
2202 * Scaling factor for normal window animations. Setting to 0 will disable window
2203 * animations.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002204 *
2205 * @deprecated Use {@link Global#WINDOW_ANIMATION_SCALE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002206 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002207 @Deprecated
2208 public static final String WINDOW_ANIMATION_SCALE = Global.WINDOW_ANIMATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002209
2210 /**
2211 * Scaling factor for activity transition animations. Setting to 0 will disable window
2212 * animations.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002213 *
2214 * @deprecated Use {@link Global#TRANSITION_ANIMATION_SCALE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002215 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002216 @Deprecated
2217 public static final String TRANSITION_ANIMATION_SCALE = Global.TRANSITION_ANIMATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002218
2219 /**
Chet Haasec38fa1f2012-02-01 16:37:46 -08002220 * Scaling factor for Animator-based animations. This affects both the start delay and
2221 * duration of all such animations. Setting to 0 will cause animations to end immediately.
2222 * The default value is 1.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002223 *
2224 * @deprecated Use {@link Global#ANIMATOR_DURATION_SCALE} instead
Chet Haasec38fa1f2012-02-01 16:37:46 -08002225 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002226 @Deprecated
2227 public static final String ANIMATOR_DURATION_SCALE = Global.ANIMATOR_DURATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002228
2229 /**
2230 * Control whether the accelerometer will be used to change screen
2231 * orientation. If 0, it will not be used unless explicitly requested
2232 * by the application; if 1, it will be used by default unless explicitly
2233 * disabled by the application.
2234 */
2235 public static final String ACCELEROMETER_ROTATION = "accelerometer_rotation";
2236
2237 /**
Daniel Sandlerb73617d2010-08-17 00:41:00 -04002238 * Default screen rotation when no other policy applies.
2239 * When {@link #ACCELEROMETER_ROTATION} is zero and no on-screen Activity expresses a
2240 * preference, this rotation value will be used. Must be one of the
Brian Muramatsue1d46982010-12-06 17:34:20 -08002241 * {@link android.view.Surface#ROTATION_0 Surface rotation constants}.
Daniel Sandlerb73617d2010-08-17 00:41:00 -04002242 *
2243 * @see Display#getRotation
2244 */
2245 public static final String USER_ROTATION = "user_rotation";
2246
2247 /**
Jeff Brown207673cd2012-06-05 17:47:11 -07002248 * Control whether the rotation lock toggle in the System UI should be hidden.
2249 * Typically this is done for accessibility purposes to make it harder for
2250 * the user to accidentally toggle the rotation lock while the display rotation
2251 * has been locked for accessibility.
2252 *
2253 * If 0, then rotation lock toggle is not hidden for accessibility (although it may be
2254 * unavailable for other reasons). If 1, then the rotation lock toggle is hidden.
2255 *
2256 * @hide
2257 */
2258 public static final String HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY =
2259 "hide_rotation_lock_toggle_for_accessibility";
2260
2261 /**
Daisuke Miyakawa3c60eeb2012-05-08 12:08:25 -07002262 * Whether the phone vibrates when it is ringing due to an incoming call. This will
2263 * be used by Phone and Setting apps; it shouldn't affect other apps.
2264 * The value is boolean (1 or 0).
2265 *
2266 * Note: this is not same as "vibrate on ring", which had been available until ICS.
2267 * It was about AudioManager's setting and thus affected all the applications which
2268 * relied on the setting, while this is purely about the vibration setting for incoming
2269 * calls.
2270 *
2271 * @hide
2272 */
2273 public static final String VIBRATE_WHEN_RINGING = "vibrate_when_ringing";
2274
2275 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002276 * Whether the audible DTMF tones are played by the dialer when dialing. The value is
2277 * boolean (1 or 0).
2278 */
2279 public static final String DTMF_TONE_WHEN_DIALING = "dtmf_tone";
2280
2281 /**
David Kraused0f67152009-06-13 18:01:13 -05002282 * CDMA only settings
2283 * DTMF tone type played by the dialer when dialing.
2284 * 0 = Normal
2285 * 1 = Long
2286 * @hide
2287 */
2288 public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type";
2289
2290 /**
David Kraused0f67152009-06-13 18:01:13 -05002291 * Whether the hearing aid is enabled. The value is
2292 * boolean (1 or 0).
2293 * @hide
2294 */
2295 public static final String HEARING_AID = "hearing_aid";
2296
2297 /**
2298 * CDMA only settings
2299 * TTY Mode
2300 * 0 = OFF
2301 * 1 = FULL
2302 * 2 = VCO
2303 * 3 = HCO
2304 * @hide
2305 */
2306 public static final String TTY_MODE = "tty_mode";
2307
2308 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002309 * Whether the sounds effects (key clicks, lid open ...) are enabled. The value is
2310 * boolean (1 or 0).
2311 */
2312 public static final String SOUND_EFFECTS_ENABLED = "sound_effects_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002313
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002314 /**
2315 * Whether the haptic feedback (long presses, ...) are enabled. The value is
2316 * boolean (1 or 0).
2317 */
2318 public static final String HAPTIC_FEEDBACK_ENABLED = "haptic_feedback_enabled";
Sanjay Jeyakumar21bf2412009-07-09 13:31:48 -07002319
Mike LeBeau48603e72009-06-05 00:27:00 +01002320 /**
Bjorn Bringert24abb662010-09-21 12:21:18 +01002321 * @deprecated Each application that shows web suggestions should have its own
2322 * setting for this.
Mike LeBeau48603e72009-06-05 00:27:00 +01002323 */
Bjorn Bringert24abb662010-09-21 12:21:18 +01002324 @Deprecated
Mike LeBeau48603e72009-06-05 00:27:00 +01002325 public static final String SHOW_WEB_SUGGESTIONS = "show_web_suggestions";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002326
-b master501eec92009-07-06 13:53:11 -07002327 /**
Amith Yamasaniae3ed702009-12-01 19:02:05 -08002328 * Whether the notification LED should repeatedly flash when a notification is
2329 * pending. The value is boolean (1 or 0).
2330 * @hide
2331 */
2332 public static final String NOTIFICATION_LIGHT_PULSE = "notification_light_pulse";
2333
2334 /**
Dianne Hackborn90d2db32010-02-11 22:19:06 -08002335 * Show pointer location on screen?
2336 * 0 = no
2337 * 1 = yes
2338 * @hide
2339 */
2340 public static final String POINTER_LOCATION = "pointer_location";
2341
2342 /**
Jeff Browndaf4a122011-08-26 17:14:14 -07002343 * Show touch positions on screen?
2344 * 0 = no
2345 * 1 = yes
2346 * @hide
2347 */
2348 public static final String SHOW_TOUCHES = "show_touches";
2349
2350 /**
Jeff Brown4519f072011-01-23 13:16:01 -08002351 * Log raw orientation data from {@link WindowOrientationListener} for use with the
2352 * orientationplot.py tool.
2353 * 0 = no
2354 * 1 = yes
2355 * @hide
2356 */
2357 public static final String WINDOW_ORIENTATION_LISTENER_LOG =
2358 "window_orientation_listener_log";
2359
2360 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002361 * @deprecated Use {@link android.provider.Settings.Global#POWER_SOUNDS_ENABLED}
2362 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002363 * @hide
2364 */
Christopher Tate06efb532012-08-24 15:29:27 -07002365 @Deprecated
2366 public static final String POWER_SOUNDS_ENABLED = Global.POWER_SOUNDS_ENABLED;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002367
2368 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002369 * @deprecated Use {@link android.provider.Settings.Global#DOCK_SOUNDS_ENABLED}
2370 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002371 * @hide
2372 */
Christopher Tate06efb532012-08-24 15:29:27 -07002373 @Deprecated
2374 public static final String DOCK_SOUNDS_ENABLED = Global.DOCK_SOUNDS_ENABLED;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002375
2376 /**
2377 * Whether to play sounds when the keyguard is shown and dismissed.
2378 * @hide
2379 */
2380 public static final String LOCKSCREEN_SOUNDS_ENABLED = "lockscreen_sounds_enabled";
2381
2382 /**
Mike Lockwood7bef7392011-10-20 16:51:53 -04002383 * Whether the lockscreen should be completely disabled.
2384 * @hide
2385 */
2386 public static final String LOCKSCREEN_DISABLED = "lockscreen.disabled";
2387
2388 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002389 * @deprecated Use {@link android.provider.Settings.Global#LOW_BATTERY_SOUND}
2390 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002391 * @hide
2392 */
Christopher Tate06efb532012-08-24 15:29:27 -07002393 @Deprecated
2394 public static final String LOW_BATTERY_SOUND = Global.LOW_BATTERY_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002395
2396 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002397 * @deprecated Use {@link android.provider.Settings.Global#DESK_DOCK_SOUND}
2398 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002399 * @hide
2400 */
Christopher Tate06efb532012-08-24 15:29:27 -07002401 @Deprecated
2402 public static final String DESK_DOCK_SOUND = Global.DESK_DOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002403
2404 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002405 * @deprecated Use {@link android.provider.Settings.Global#DESK_UNDOCK_SOUND}
2406 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002407 * @hide
2408 */
Christopher Tate06efb532012-08-24 15:29:27 -07002409 @Deprecated
2410 public static final String DESK_UNDOCK_SOUND = Global.DESK_UNDOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002411
2412 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002413 * @deprecated Use {@link android.provider.Settings.Global#CAR_DOCK_SOUND}
2414 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002415 * @hide
2416 */
Christopher Tate06efb532012-08-24 15:29:27 -07002417 @Deprecated
2418 public static final String CAR_DOCK_SOUND = Global.CAR_DOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002419
2420 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002421 * @deprecated Use {@link android.provider.Settings.Global#CAR_UNDOCK_SOUND}
2422 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002423 * @hide
2424 */
Christopher Tate06efb532012-08-24 15:29:27 -07002425 @Deprecated
2426 public static final String CAR_UNDOCK_SOUND = Global.CAR_UNDOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002427
2428 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002429 * @deprecated Use {@link android.provider.Settings.Global#LOCK_SOUND}
2430 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002431 * @hide
2432 */
Christopher Tate06efb532012-08-24 15:29:27 -07002433 @Deprecated
2434 public static final String LOCK_SOUND = Global.LOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002435
2436 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002437 * @deprecated Use {@link android.provider.Settings.Global#UNLOCK_SOUND}
2438 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002439 * @hide
2440 */
Christopher Tate06efb532012-08-24 15:29:27 -07002441 @Deprecated
2442 public static final String UNLOCK_SOUND = Global.UNLOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002443
2444 /**
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08002445 * Receive incoming SIP calls?
2446 * 0 = no
2447 * 1 = yes
2448 * @hide
2449 */
2450 public static final String SIP_RECEIVE_CALLS = "sip_receive_calls";
2451
2452 /**
2453 * Call Preference String.
2454 * "SIP_ALWAYS" : Always use SIP with network access
2455 * "SIP_ADDRESS_ONLY" : Only if destination is a SIP address
2456 * "SIP_ASK_ME_EACH_TIME" : Always ask me each time
2457 * @hide
2458 */
2459 public static final String SIP_CALL_OPTIONS = "sip_call_options";
2460
2461 /**
2462 * One of the sip call options: Always use SIP with network access.
2463 * @hide
2464 */
2465 public static final String SIP_ALWAYS = "SIP_ALWAYS";
2466
2467 /**
2468 * One of the sip call options: Only if destination is a SIP address.
2469 * @hide
2470 */
2471 public static final String SIP_ADDRESS_ONLY = "SIP_ADDRESS_ONLY";
2472
2473 /**
2474 * One of the sip call options: Always ask me each time.
2475 * @hide
2476 */
2477 public static final String SIP_ASK_ME_EACH_TIME = "SIP_ASK_ME_EACH_TIME";
2478
2479 /**
Jeff Brown1a84fd12011-06-02 01:26:32 -07002480 * Pointer speed setting.
2481 * This is an integer value in a range between -7 and +7, so there are 15 possible values.
2482 * -7 = slowest
2483 * 0 = default speed
2484 * +7 = fastest
2485 * @hide
2486 */
2487 public static final String POINTER_SPEED = "pointer_speed";
2488
2489 /**
Jason Monk62515be2014-05-21 16:06:19 -04002490 * Whether lock-to-app will be triggered by long-press on recents.
2491 * @hide
2492 */
2493 public static final String LOCK_TO_APP_ENABLED = "lock_to_app_enabled";
2494
2495 /**
2496 * Whether lock-to-app will lock the keyguard when exiting.
2497 * @hide
2498 */
2499 public static final String LOCK_TO_APP_EXIT_LOCKED = "lock_to_app_exit_locked";
2500
2501 /**
Daniel Sandler2fdb68b2013-10-03 00:12:11 -04002502 * I am the lolrus.
2503 * <p>
2504 * Nonzero values indicate that the user has a bukkit.
2505 * Backward-compatible with <code>PrefGetPreference(prefAllowEasterEggs)</code>.
2506 * @hide
2507 */
2508 public static final String EGG_MODE = "egg_mode";
2509
2510 /**
-b master501eec92009-07-06 13:53:11 -07002511 * Settings to backup. This is here so that it's in the same place as the settings
2512 * keys and easy to update.
Svetoslav Ganova571a582011-09-20 18:32:20 -07002513 *
2514 * NOTE: Settings are backed up and restored in the order they appear
2515 * in this array. If you have one setting depending on another,
2516 * make sure that they are ordered appropriately.
2517 *
-b master501eec92009-07-06 13:53:11 -07002518 * @hide
2519 */
2520 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate66488d62012-10-02 11:58:01 -07002521 STAY_ON_WHILE_PLUGGED_IN, // moved to global
-b master501eec92009-07-06 13:53:11 -07002522 WIFI_USE_STATIC_IP,
2523 WIFI_STATIC_IP,
2524 WIFI_STATIC_GATEWAY,
2525 WIFI_STATIC_NETMASK,
2526 WIFI_STATIC_DNS1,
2527 WIFI_STATIC_DNS2,
2528 BLUETOOTH_DISCOVERABILITY,
2529 BLUETOOTH_DISCOVERABILITY_TIMEOUT,
2530 DIM_SCREEN,
2531 SCREEN_OFF_TIMEOUT,
2532 SCREEN_BRIGHTNESS,
Christopher Tate362aca62009-09-25 15:58:03 -07002533 SCREEN_BRIGHTNESS_MODE,
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08002534 SCREEN_AUTO_BRIGHTNESS_ADJ,
Jeff Brown7f6c2312012-04-13 20:38:38 -07002535 VIBRATE_INPUT_DEVICES,
Amith Yamasani8823c0a82009-07-07 14:30:17 -07002536 MODE_RINGER_STREAMS_AFFECTED,
Amith Yamasani8823c0a82009-07-07 14:30:17 -07002537 VOLUME_VOICE,
2538 VOLUME_SYSTEM,
2539 VOLUME_RING,
2540 VOLUME_MUSIC,
2541 VOLUME_ALARM,
2542 VOLUME_NOTIFICATION,
Eric Laurent484d2882009-12-08 09:05:45 -08002543 VOLUME_BLUETOOTH_SCO,
Amith Yamasani8823c0a82009-07-07 14:30:17 -07002544 VOLUME_VOICE + APPEND_FOR_LAST_AUDIBLE,
2545 VOLUME_SYSTEM + APPEND_FOR_LAST_AUDIBLE,
2546 VOLUME_RING + APPEND_FOR_LAST_AUDIBLE,
2547 VOLUME_MUSIC + APPEND_FOR_LAST_AUDIBLE,
2548 VOLUME_ALARM + APPEND_FOR_LAST_AUDIBLE,
2549 VOLUME_NOTIFICATION + APPEND_FOR_LAST_AUDIBLE,
Eric Laurent484d2882009-12-08 09:05:45 -08002550 VOLUME_BLUETOOTH_SCO + APPEND_FOR_LAST_AUDIBLE,
-b master501eec92009-07-06 13:53:11 -07002551 TEXT_AUTO_REPLACE,
2552 TEXT_AUTO_CAPS,
2553 TEXT_AUTO_PUNCTUATE,
2554 TEXT_SHOW_PASSWORD,
Christopher Tate66488d62012-10-02 11:58:01 -07002555 AUTO_TIME, // moved to global
2556 AUTO_TIME_ZONE, // moved to global
-b master501eec92009-07-06 13:53:11 -07002557 TIME_12_24,
2558 DATE_FORMAT,
-b master501eec92009-07-06 13:53:11 -07002559 DTMF_TONE_WHEN_DIALING,
2560 DTMF_TONE_TYPE_WHEN_DIALING,
-b master501eec92009-07-06 13:53:11 -07002561 HEARING_AID,
2562 TTY_MODE,
2563 SOUND_EFFECTS_ENABLED,
2564 HAPTIC_FEEDBACK_ENABLED,
Christopher Tate66488d62012-10-02 11:58:01 -07002565 POWER_SOUNDS_ENABLED, // moved to global
2566 DOCK_SOUNDS_ENABLED, // moved to global
Christopher Tate14c2d792010-02-25 16:49:44 -08002567 LOCKSCREEN_SOUNDS_ENABLED,
Amith Yamasaniae3ed702009-12-01 19:02:05 -08002568 SHOW_WEB_SUGGESTIONS,
Mike Lockwoodeabe8bf2010-08-31 14:35:23 -04002569 NOTIFICATION_LIGHT_PULSE,
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08002570 SIP_CALL_OPTIONS,
Nick Pelly038cabe2010-09-23 16:12:11 -07002571 SIP_RECEIVE_CALLS,
Jeff Brown1a84fd12011-06-02 01:26:32 -07002572 POINTER_SPEED,
Amith Yamasani622bf2222013-09-06 13:54:28 -07002573 VIBRATE_WHEN_RINGING,
2574 RINGTONE,
2575 NOTIFICATION_SOUND
-b master501eec92009-07-06 13:53:11 -07002576 };
2577
Sailesh Nepal1bd78762014-02-11 22:32:21 -08002578 /**
2579 * When to use Wi-Fi calling
2580 *
2581 * @see android.telephony.TelephonyManager.WifiCallingChoices
2582 * @hide
2583 */
2584 public static final String WHEN_TO_MAKE_WIFI_CALLS = "when_to_make_wifi_calls";
2585
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002586 // Settings moved to Settings.Secure
2587
2588 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002589 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002590 * instead
2591 */
2592 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002593 public static final String ADB_ENABLED = Global.ADB_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002594
2595 /**
2596 * @deprecated Use {@link android.provider.Settings.Secure#ANDROID_ID} instead
2597 */
2598 @Deprecated
2599 public static final String ANDROID_ID = Secure.ANDROID_ID;
2600
2601 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002602 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002603 */
2604 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002605 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002606
2607 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002608 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002609 */
2610 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002611 public static final String DATA_ROAMING = Global.DATA_ROAMING;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002612
2613 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002614 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002615 */
2616 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002617 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002618
2619 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07002620 * @deprecated Use {@link android.provider.Settings.Global#HTTP_PROXY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002621 */
2622 @Deprecated
Jeff Sharkey625239a2012-09-26 22:03:49 -07002623 public static final String HTTP_PROXY = Global.HTTP_PROXY;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002624
2625 /**
Christopher Tateaa036a22014-05-19 16:33:27 -07002626 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002627 */
2628 @Deprecated
Christopher Tateaa036a22014-05-19 16:33:27 -07002629 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002630
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002631 /**
2632 * @deprecated Use {@link android.provider.Settings.Secure#LOCATION_PROVIDERS_ALLOWED}
2633 * instead
2634 */
2635 @Deprecated
2636 public static final String LOCATION_PROVIDERS_ALLOWED = Secure.LOCATION_PROVIDERS_ALLOWED;
2637
2638 /**
2639 * @deprecated Use {@link android.provider.Settings.Secure#LOGGING_ID} instead
2640 */
2641 @Deprecated
2642 public static final String LOGGING_ID = Secure.LOGGING_ID;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002643
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002644 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002645 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002646 */
2647 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002648 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002649
2650 /**
2651 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_ENABLED}
2652 * instead
2653 */
2654 @Deprecated
2655 public static final String PARENTAL_CONTROL_ENABLED = Secure.PARENTAL_CONTROL_ENABLED;
2656
2657 /**
2658 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_LAST_UPDATE}
2659 * instead
2660 */
2661 @Deprecated
2662 public static final String PARENTAL_CONTROL_LAST_UPDATE = Secure.PARENTAL_CONTROL_LAST_UPDATE;
2663
2664 /**
2665 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_REDIRECT_URL}
2666 * instead
2667 */
2668 @Deprecated
2669 public static final String PARENTAL_CONTROL_REDIRECT_URL =
2670 Secure.PARENTAL_CONTROL_REDIRECT_URL;
2671
2672 /**
2673 * @deprecated Use {@link android.provider.Settings.Secure#SETTINGS_CLASSNAME} instead
2674 */
2675 @Deprecated
2676 public static final String SETTINGS_CLASSNAME = Secure.SETTINGS_CLASSNAME;
2677
2678 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002679 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002680 */
2681 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002682 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002683
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002684 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002685 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002686 */
2687 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002688 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002689
Dianne Hackborn4a51c202009-08-21 15:14:02 -07002690 /**
2691 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07002692 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
Dianne Hackborn4a51c202009-08-21 15:14:02 -07002693 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002694 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002695 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 -08002696
Dianne Hackborn4a51c202009-08-21 15:14:02 -07002697 /**
2698 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07002699 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
Dianne Hackborn4a51c202009-08-21 15:14:02 -07002700 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002701 @Deprecated
2702 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
Christopher Tate06efb532012-08-24 15:29:27 -07002703 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002704
2705 /**
2706 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07002707 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002708 */
2709 @Deprecated
2710 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
Christopher Tate06efb532012-08-24 15:29:27 -07002711 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002712
2713 /**
2714 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07002715 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002716 */
2717 @Deprecated
2718 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
Christopher Tate06efb532012-08-24 15:29:27 -07002719 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002720
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002721 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002722 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002723 * instead
2724 */
2725 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002726 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 -08002727
2728 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002729 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002730 */
2731 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002732 public static final String WIFI_ON = Global.WIFI_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002733
2734 /**
2735 * @deprecated Use
2736 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE}
2737 * instead
2738 */
2739 @Deprecated
2740 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
2741 Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE;
2742
2743 /**
2744 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_AP_COUNT} instead
2745 */
2746 @Deprecated
2747 public static final String WIFI_WATCHDOG_AP_COUNT = Secure.WIFI_WATCHDOG_AP_COUNT;
2748
2749 /**
2750 * @deprecated Use
2751 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS} instead
2752 */
2753 @Deprecated
2754 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
2755 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002756
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002757 /**
2758 * @deprecated Use
2759 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED} instead
2760 */
2761 @Deprecated
2762 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
2763 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED;
2764
2765 /**
2766 * @deprecated Use
2767 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS}
2768 * instead
2769 */
2770 @Deprecated
2771 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
2772 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS;
2773
2774 /**
2775 * @deprecated Use
2776 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT} instead
2777 */
2778 @Deprecated
2779 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
2780 Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT;
2781
2782 /**
2783 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_MAX_AP_CHECKS}
2784 * instead
2785 */
2786 @Deprecated
2787 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = Secure.WIFI_WATCHDOG_MAX_AP_CHECKS;
2788
2789 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002790 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002791 */
2792 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002793 public static final String WIFI_WATCHDOG_ON = Global.WIFI_WATCHDOG_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002794
2795 /**
2796 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_COUNT} instead
2797 */
2798 @Deprecated
2799 public static final String WIFI_WATCHDOG_PING_COUNT = Secure.WIFI_WATCHDOG_PING_COUNT;
2800
2801 /**
2802 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_DELAY_MS}
2803 * instead
2804 */
2805 @Deprecated
2806 public static final String WIFI_WATCHDOG_PING_DELAY_MS = Secure.WIFI_WATCHDOG_PING_DELAY_MS;
2807
2808 /**
2809 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_TIMEOUT_MS}
2810 * instead
2811 */
2812 @Deprecated
2813 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS =
2814 Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS;
2815 }
2816
2817 /**
2818 * Secure system settings, containing system preferences that applications
2819 * can read but are not allowed to write. These are for preferences that
2820 * the user must explicitly modify through the system UI or specialized
2821 * APIs for those values, not modified directly by applications.
2822 */
2823 public static final class Secure extends NameValueTable {
2824 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_secure_version";
2825
Dianne Hackborn139748f2012-09-24 11:36:57 -07002826 /**
2827 * The content:// style URL for this table
2828 */
2829 public static final Uri CONTENT_URI =
2830 Uri.parse("content://" + AUTHORITY + "/secure");
2831
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08002832 // Populated lazily, guarded by class object:
Dianne Hackborn139748f2012-09-24 11:36:57 -07002833 private static final NameValueCache sNameValueCache = new NameValueCache(
2834 SYS_PROP_SETTING_VERSION,
2835 CONTENT_URI,
2836 CALL_METHOD_GET_SECURE,
2837 CALL_METHOD_PUT_SECURE);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002838
Amith Yamasani52c489c2012-03-28 11:42:42 -07002839 private static ILockSettings sLockSettings = null;
2840
Amith Yamasani7ab8c4a2012-04-06 09:27:12 -07002841 private static boolean sIsSystemProcess;
Amith Yamasani52c489c2012-03-28 11:42:42 -07002842 private static final HashSet<String> MOVED_TO_LOCK_SETTINGS;
Christopher Tate06efb532012-08-24 15:29:27 -07002843 private static final HashSet<String> MOVED_TO_GLOBAL;
Amith Yamasani52c489c2012-03-28 11:42:42 -07002844 static {
2845 MOVED_TO_LOCK_SETTINGS = new HashSet<String>(3);
2846 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_ENABLED);
2847 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_VISIBLE);
2848 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
Christopher Tate06efb532012-08-24 15:29:27 -07002849
2850 MOVED_TO_GLOBAL = new HashSet<String>();
2851 MOVED_TO_GLOBAL.add(Settings.Global.ADB_ENABLED);
2852 MOVED_TO_GLOBAL.add(Settings.Global.ASSISTED_GPS_ENABLED);
2853 MOVED_TO_GLOBAL.add(Settings.Global.BLUETOOTH_ON);
Christopher Tate58f41ec2013-01-11 15:40:36 -08002854 MOVED_TO_GLOBAL.add(Settings.Global.BUGREPORT_IN_POWER_MENU);
Christopher Tate06efb532012-08-24 15:29:27 -07002855 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_CELL_BROADCAST_SMS);
2856 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_ROAMING_MODE);
2857 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_SUBSCRIPTION_MODE);
2858 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_MOBILE);
2859 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_WIFI);
2860 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ROAMING);
2861 MOVED_TO_GLOBAL.add(Settings.Global.DEVELOPMENT_SETTINGS_ENABLED);
2862 MOVED_TO_GLOBAL.add(Settings.Global.DEVICE_PROVISIONED);
2863 MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_DENSITY_FORCED);
2864 MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_SIZE_FORCED);
2865 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_MAX_BYTES_OVER_MOBILE);
2866 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE);
Christopher Tate06efb532012-08-24 15:29:27 -07002867 MOVED_TO_GLOBAL.add(Settings.Global.MOBILE_DATA);
2868 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_BUCKET_DURATION);
2869 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_DELETE_AGE);
2870 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_PERSIST_BYTES);
2871 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_ROTATE_AGE);
2872 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_ENABLED);
2873 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_GLOBAL_ALERT_BYTES);
2874 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_POLL_INTERVAL);
2875 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_REPORT_XT_OVER_DEV);
2876 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_SAMPLE_ENABLED);
2877 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_TIME_CACHE_MAX_AGE);
2878 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_BUCKET_DURATION);
2879 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_DELETE_AGE);
2880 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_PERSIST_BYTES);
2881 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_ROTATE_AGE);
2882 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_BUCKET_DURATION);
2883 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_DELETE_AGE);
2884 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_PERSIST_BYTES);
2885 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_ROTATE_AGE);
2886 MOVED_TO_GLOBAL.add(Settings.Global.NETWORK_PREFERENCE);
2887 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_DIFF);
2888 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_SPACING);
2889 MOVED_TO_GLOBAL.add(Settings.Global.NTP_SERVER);
2890 MOVED_TO_GLOBAL.add(Settings.Global.NTP_TIMEOUT);
2891 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_ERROR_POLL_COUNT);
2892 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_LONG_POLL_INTERVAL_MS);
2893 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT);
2894 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_POLL_INTERVAL_MS);
2895 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_TRIGGER_PACKET_COUNT);
2896 MOVED_TO_GLOBAL.add(Settings.Global.SAMPLING_PROFILER_MS);
2897 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DATA_SERVICE_URL);
2898 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_REDIR_HOST);
2899 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_TARGET_URL);
2900 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_APN);
2901 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_REQUIRED);
2902 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_SUPPORTED);
Christopher Tate06efb532012-08-24 15:29:27 -07002903 MOVED_TO_GLOBAL.add(Settings.Global.USB_MASS_STORAGE_ENABLED);
2904 MOVED_TO_GLOBAL.add(Settings.Global.USE_GOOGLE_MAIL);
Robert Greenwalt3ea0c992013-10-03 21:13:49 +00002905 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_COUNTRY_CODE);
Christopher Tate06efb532012-08-24 15:29:27 -07002906 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FRAMEWORK_SCAN_INTERVAL_MS);
2907 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FREQUENCY_BAND);
2908 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_IDLE_MS);
2909 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MAX_DHCP_RETRY_COUNT);
2910 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS);
2911 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
2912 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
2913 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NUM_OPEN_NETWORKS_KEPT);
2914 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ON);
2915 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_P2P_DEVICE_NAME);
2916 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SAVED_STATE);
2917 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUPPLICANT_SCAN_INTERVAL_MS);
2918 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUSPEND_OPTIMIZATIONS_ENABLED);
vandwalle7c3606c2014-03-31 19:12:07 -07002919 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ENHANCED_AUTO_JOIN);
2920 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORK_SHOW_RSSI);
Christopher Tate06efb532012-08-24 15:29:27 -07002921 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_ON);
2922 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED);
Christopher Tate06efb532012-08-24 15:29:27 -07002923 MOVED_TO_GLOBAL.add(Settings.Global.WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON);
Christopher Tatec868b642012-09-12 17:41:04 -07002924 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_ENABLE);
2925 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_TIMEOUT);
2926 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_DEFAULT_RESPONSE);
2927 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS);
2928 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS);
2929 MOVED_TO_GLOBAL.add(Settings.Global.GPRS_REGISTER_CHECK_PERIOD_MS);
Christopher Tate06efb532012-08-24 15:29:27 -07002930 MOVED_TO_GLOBAL.add(Settings.Global.WTF_IS_FATAL);
Jeff Sharkey625239a2012-09-26 22:03:49 -07002931 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_DURATION_THRESHOLD);
2932 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_THRESHOLD);
2933 MOVED_TO_GLOBAL.add(Settings.Global.SEND_ACTION_APP_ERROR);
2934 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_AGE_SECONDS);
2935 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_MAX_FILES);
2936 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_KB);
2937 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_PERCENT);
2938 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_RESERVE_PERCENT);
2939 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_TAG_PREFIX);
2940 MOVED_TO_GLOBAL.add(Settings.Global.ERROR_LOGCAT_PREFIX);
2941 MOVED_TO_GLOBAL.add(Settings.Global.SYS_FREE_STORAGE_LOG_INTERVAL);
2942 MOVED_TO_GLOBAL.add(Settings.Global.DISK_FREE_CHANGE_REPORTING_THRESHOLD);
2943 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_PERCENTAGE);
2944 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_MAX_BYTES);
2945 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_FULL_THRESHOLD_BYTES);
2946 MOVED_TO_GLOBAL.add(Settings.Global.SYNC_MAX_RETRY_DELAY_IN_SECONDS);
2947 MOVED_TO_GLOBAL.add(Settings.Global.CONNECTIVITY_CHANGE_DELAY);
2948 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED);
2949 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_SERVER);
2950 MOVED_TO_GLOBAL.add(Settings.Global.NSD_ON);
2951 MOVED_TO_GLOBAL.add(Settings.Global.SET_INSTALL_LOCATION);
2952 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_INSTALL_LOCATION);
2953 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_UP_DELAY);
2954 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_DOWN_DELAY);
2955 MOVED_TO_GLOBAL.add(Settings.Global.READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT);
2956 MOVED_TO_GLOBAL.add(Settings.Global.HTTP_PROXY);
2957 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_HOST);
2958 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_PORT);
2959 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST);
2960 MOVED_TO_GLOBAL.add(Settings.Global.SET_GLOBAL_HTTP_PROXY);
2961 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_DNS_SERVER);
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002962 MOVED_TO_GLOBAL.add(Settings.Global.PREFERRED_NETWORK_MODE);
Selim Gurun178201f2014-05-16 11:38:44 -07002963 MOVED_TO_GLOBAL.add(Settings.Global.WEBVIEW_DATA_REDUCTION_PROXY_KEY);
Christopher Tate06efb532012-08-24 15:29:27 -07002964 }
2965
Christopher Tate66488d62012-10-02 11:58:01 -07002966 /** @hide */
2967 public static void getMovedKeys(HashSet<String> outKeySet) {
2968 outKeySet.addAll(MOVED_TO_GLOBAL);
2969 }
2970
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002971 /**
2972 * Look up a name in the database.
2973 * @param resolver to access the database with
2974 * @param name to look up in the table
2975 * @return the corresponding value, or null if not present
2976 */
Dianne Hackborn139748f2012-09-24 11:36:57 -07002977 public static String getString(ContentResolver resolver, String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07002978 return getStringForUser(resolver, name, UserHandle.myUserId());
2979 }
2980
2981 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -07002982 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -07002983 int userHandle) {
2984 if (MOVED_TO_GLOBAL.contains(name)) {
2985 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
2986 + " to android.provider.Settings.Global.");
2987 return Global.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002988 }
Amith Yamasani52c489c2012-03-28 11:42:42 -07002989
Dianne Hackborn139748f2012-09-24 11:36:57 -07002990 if (MOVED_TO_LOCK_SETTINGS.contains(name)) {
2991 synchronized (Secure.class) {
2992 if (sLockSettings == null) {
2993 sLockSettings = ILockSettings.Stub.asInterface(
2994 (IBinder) ServiceManager.getService("lock_settings"));
2995 sIsSystemProcess = Process.myUid() == Process.SYSTEM_UID;
2996 }
2997 }
2998 if (sLockSettings != null && !sIsSystemProcess) {
2999 try {
3000 return sLockSettings.getString(name, "0", userHandle);
3001 } catch (RemoteException re) {
3002 // Fall through
3003 }
Amith Yamasani52c489c2012-03-28 11:42:42 -07003004 }
3005 }
3006
Christopher Tate06efb532012-08-24 15:29:27 -07003007 return sNameValueCache.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003008 }
3009
3010 /**
3011 * Store a name/value pair into the database.
3012 * @param resolver to access the database with
3013 * @param name to store
3014 * @param value to associate with the name
3015 * @return true if the value was set, false on database errors
3016 */
Christopher Tate06efb532012-08-24 15:29:27 -07003017 public static boolean putString(ContentResolver resolver, String name, String value) {
3018 return putStringForUser(resolver, name, value, UserHandle.myUserId());
3019 }
3020
3021 /** @hide */
3022 public static boolean putStringForUser(ContentResolver resolver, String name, String value,
3023 int userHandle) {
3024 if (MOVED_TO_GLOBAL.contains(name)) {
3025 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
3026 + " to android.provider.Settings.Global");
3027 return Global.putStringForUser(resolver, name, value, userHandle);
3028 }
Christopher Tate06efb532012-08-24 15:29:27 -07003029 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003030 }
3031
3032 /**
3033 * Construct the content URI for a particular name/value pair,
3034 * useful for monitoring changes with a ContentObserver.
3035 * @param name to look up in the table
3036 * @return the corresponding content URI, or null if not present
3037 */
3038 public static Uri getUriFor(String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07003039 if (MOVED_TO_GLOBAL.contains(name)) {
3040 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
3041 + " to android.provider.Settings.Global, returning global URI.");
3042 return Global.getUriFor(Global.CONTENT_URI, name);
3043 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003044 return getUriFor(CONTENT_URI, name);
3045 }
3046
3047 /**
3048 * Convenience function for retrieving a single secure settings value
3049 * as an integer. Note that internally setting values are always
3050 * stored as strings; this function converts the string to an integer
3051 * for you. The default value will be returned if the setting is
3052 * not defined or not an integer.
3053 *
3054 * @param cr The ContentResolver to access.
3055 * @param name The name of the setting to retrieve.
3056 * @param def Value to return if the setting is not defined.
3057 *
3058 * @return The setting's current value, or 'def' if it is not defined
3059 * or not a valid integer.
3060 */
3061 public static int getInt(ContentResolver cr, String name, int def) {
Christopher Tate06efb532012-08-24 15:29:27 -07003062 return getIntForUser(cr, name, def, UserHandle.myUserId());
3063 }
3064
3065 /** @hide */
3066 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
Tom O'Neill7f6f4572013-08-27 10:53:15 -07003067 if (LOCATION_MODE.equals(name)) {
3068 // HACK ALERT: temporary hack to work around b/10491283.
3069 // TODO: once b/10491283 fixed, remove this hack
3070 return getLocationModeForUser(cr, userHandle);
3071 }
Christopher Tate06efb532012-08-24 15:29:27 -07003072 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003073 try {
3074 return v != null ? Integer.parseInt(v) : def;
3075 } catch (NumberFormatException e) {
3076 return def;
3077 }
3078 }
3079
3080 /**
3081 * Convenience function for retrieving a single secure settings value
3082 * as an integer. Note that internally setting values are always
3083 * stored as strings; this function converts the string to an integer
3084 * for you.
3085 * <p>
3086 * This version does not take a default value. If the setting has not
3087 * been set, or the string value is not a number,
3088 * it throws {@link SettingNotFoundException}.
3089 *
3090 * @param cr The ContentResolver to access.
3091 * @param name The name of the setting to retrieve.
3092 *
3093 * @throws SettingNotFoundException Thrown if a setting by the given
3094 * name can't be found or the setting value is not an integer.
3095 *
3096 * @return The setting's current value.
3097 */
3098 public static int getInt(ContentResolver cr, String name)
3099 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07003100 return getIntForUser(cr, name, UserHandle.myUserId());
3101 }
3102
3103 /** @hide */
3104 public static int getIntForUser(ContentResolver cr, String name, int userHandle)
3105 throws SettingNotFoundException {
Tom O'Neill7f6f4572013-08-27 10:53:15 -07003106 if (LOCATION_MODE.equals(name)) {
3107 // HACK ALERT: temporary hack to work around b/10491283.
3108 // TODO: once b/10491283 fixed, remove this hack
3109 return getLocationModeForUser(cr, userHandle);
3110 }
Christopher Tate06efb532012-08-24 15:29:27 -07003111 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003112 try {
3113 return Integer.parseInt(v);
3114 } catch (NumberFormatException e) {
3115 throw new SettingNotFoundException(name);
3116 }
3117 }
3118
3119 /**
3120 * Convenience function for updating a single settings value as an
3121 * integer. This will either create a new entry in the table if the
3122 * given name does not exist, or modify the value of the existing row
3123 * with that name. Note that internally setting values are always
3124 * stored as strings, so this function converts the given value to a
3125 * string before storing it.
3126 *
3127 * @param cr The ContentResolver to access.
3128 * @param name The name of the setting to modify.
3129 * @param value The new value for the setting.
3130 * @return true if the value was set, false on database errors
3131 */
3132 public static boolean putInt(ContentResolver cr, String name, int value) {
Christopher Tate06efb532012-08-24 15:29:27 -07003133 return putIntForUser(cr, name, value, UserHandle.myUserId());
3134 }
3135
3136 /** @hide */
3137 public static boolean putIntForUser(ContentResolver cr, String name, int value,
3138 int userHandle) {
Tom O'Neilla324ac72013-08-26 14:40:23 -07003139 if (LOCATION_MODE.equals(name)) {
3140 // HACK ALERT: temporary hack to work around b/10491283.
3141 // TODO: once b/10491283 fixed, remove this hack
3142 return setLocationModeForUser(cr, value, userHandle);
3143 }
Christopher Tate06efb532012-08-24 15:29:27 -07003144 return putStringForUser(cr, name, Integer.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003145 }
3146
3147 /**
3148 * Convenience function for retrieving a single secure settings value
3149 * as a {@code long}. Note that internally setting values are always
3150 * stored as strings; this function converts the string to a {@code long}
3151 * for you. The default value will be returned if the setting is
3152 * not defined or not a {@code long}.
3153 *
3154 * @param cr The ContentResolver to access.
3155 * @param name The name of the setting to retrieve.
3156 * @param def Value to return if the setting is not defined.
3157 *
3158 * @return The setting's current value, or 'def' if it is not defined
3159 * or not a valid {@code long}.
3160 */
3161 public static long getLong(ContentResolver cr, String name, long def) {
Christopher Tate06efb532012-08-24 15:29:27 -07003162 return getLongForUser(cr, name, def, UserHandle.myUserId());
3163 }
3164
3165 /** @hide */
3166 public static long getLongForUser(ContentResolver cr, String name, long def,
3167 int userHandle) {
3168 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003169 long value;
3170 try {
3171 value = valString != null ? Long.parseLong(valString) : def;
3172 } catch (NumberFormatException e) {
3173 value = def;
3174 }
3175 return value;
3176 }
3177
3178 /**
3179 * Convenience function for retrieving a single secure settings value
3180 * as a {@code long}. Note that internally setting values are always
3181 * stored as strings; this function converts the string to a {@code long}
3182 * for you.
3183 * <p>
3184 * This version does not take a default value. If the setting has not
3185 * been set, or the string value is not a number,
3186 * it throws {@link SettingNotFoundException}.
3187 *
3188 * @param cr The ContentResolver to access.
3189 * @param name The name of the setting to retrieve.
3190 *
3191 * @return The setting's current value.
3192 * @throws SettingNotFoundException Thrown if a setting by the given
3193 * name can't be found or the setting value is not an integer.
3194 */
3195 public static long getLong(ContentResolver cr, String name)
3196 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07003197 return getLongForUser(cr, name, UserHandle.myUserId());
3198 }
3199
3200 /** @hide */
3201 public static long getLongForUser(ContentResolver cr, String name, int userHandle)
3202 throws SettingNotFoundException {
3203 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003204 try {
3205 return Long.parseLong(valString);
3206 } catch (NumberFormatException e) {
3207 throw new SettingNotFoundException(name);
3208 }
3209 }
3210
3211 /**
3212 * Convenience function for updating a secure settings value as a long
3213 * integer. This will either create a new entry in the table if the
3214 * given name does not exist, or modify the value of the existing row
3215 * with that name. Note that internally setting values are always
3216 * stored as strings, so this function converts the given value to a
3217 * string before storing it.
3218 *
3219 * @param cr The ContentResolver to access.
3220 * @param name The name of the setting to modify.
3221 * @param value The new value for the setting.
3222 * @return true if the value was set, false on database errors
3223 */
3224 public static boolean putLong(ContentResolver cr, String name, long value) {
Christopher Tate06efb532012-08-24 15:29:27 -07003225 return putLongForUser(cr, name, value, UserHandle.myUserId());
3226 }
3227
3228 /** @hide */
3229 public static boolean putLongForUser(ContentResolver cr, String name, long value,
3230 int userHandle) {
3231 return putStringForUser(cr, name, Long.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003232 }
3233
3234 /**
3235 * Convenience function for retrieving a single secure settings value
3236 * as a floating point number. Note that internally setting values are
3237 * always stored as strings; this function converts the string to an
3238 * float for you. The default value will be returned if the setting
3239 * is not defined or not a valid float.
3240 *
3241 * @param cr The ContentResolver to access.
3242 * @param name The name of the setting to retrieve.
3243 * @param def Value to return if the setting is not defined.
3244 *
3245 * @return The setting's current value, or 'def' if it is not defined
3246 * or not a valid float.
3247 */
3248 public static float getFloat(ContentResolver cr, String name, float def) {
Christopher Tate06efb532012-08-24 15:29:27 -07003249 return getFloatForUser(cr, name, def, UserHandle.myUserId());
3250 }
3251
3252 /** @hide */
3253 public static float getFloatForUser(ContentResolver cr, String name, float def,
3254 int userHandle) {
3255 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003256 try {
3257 return v != null ? Float.parseFloat(v) : def;
3258 } catch (NumberFormatException e) {
3259 return def;
3260 }
3261 }
3262
3263 /**
3264 * Convenience function for retrieving a single secure settings value
3265 * as a float. Note that internally setting values are always
3266 * stored as strings; this function converts the string to a float
3267 * for you.
3268 * <p>
3269 * This version does not take a default value. If the setting has not
3270 * been set, or the string value is not a number,
3271 * it throws {@link SettingNotFoundException}.
3272 *
3273 * @param cr The ContentResolver to access.
3274 * @param name The name of the setting to retrieve.
3275 *
3276 * @throws SettingNotFoundException Thrown if a setting by the given
3277 * name can't be found or the setting value is not a float.
3278 *
3279 * @return The setting's current value.
3280 */
3281 public static float getFloat(ContentResolver cr, String name)
3282 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07003283 return getFloatForUser(cr, name, UserHandle.myUserId());
3284 }
3285
3286 /** @hide */
3287 public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
3288 throws SettingNotFoundException {
3289 String v = getStringForUser(cr, name, userHandle);
Brian Muramatsue1d46982010-12-06 17:34:20 -08003290 if (v == null) {
3291 throw new SettingNotFoundException(name);
3292 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003293 try {
3294 return Float.parseFloat(v);
3295 } catch (NumberFormatException e) {
3296 throw new SettingNotFoundException(name);
3297 }
3298 }
3299
3300 /**
3301 * Convenience function for updating a single settings value as a
3302 * floating point number. This will either create a new entry in the
3303 * table if the given name does not exist, or modify the value of the
3304 * existing row with that name. Note that internally setting values
3305 * are always stored as strings, so this function converts the given
3306 * value to a string before storing it.
3307 *
3308 * @param cr The ContentResolver to access.
3309 * @param name The name of the setting to modify.
3310 * @param value The new value for the setting.
3311 * @return true if the value was set, false on database errors
3312 */
3313 public static boolean putFloat(ContentResolver cr, String name, float value) {
Christopher Tate06efb532012-08-24 15:29:27 -07003314 return putFloatForUser(cr, name, value, UserHandle.myUserId());
3315 }
3316
3317 /** @hide */
3318 public static boolean putFloatForUser(ContentResolver cr, String name, float value,
3319 int userHandle) {
3320 return putStringForUser(cr, name, Float.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003321 }
3322
3323 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003324 * @deprecated Use {@link android.provider.Settings.Global#DEVELOPMENT_SETTINGS_ENABLED}
3325 * instead
Dianne Hackborn895f99e2012-02-02 11:49:12 -08003326 */
Christopher Tate06efb532012-08-24 15:29:27 -07003327 @Deprecated
3328 public static final String DEVELOPMENT_SETTINGS_ENABLED =
3329 Global.DEVELOPMENT_SETTINGS_ENABLED;
Dianne Hackborn895f99e2012-02-02 11:49:12 -08003330
3331 /**
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07003332 * When the user has enable the option to have a "bug report" command
3333 * in the power menu.
Christopher Tate58f41ec2013-01-11 15:40:36 -08003334 * @deprecated Use {@link android.provider.Settings.Global#BUGREPORT_IN_POWER_MENU} instead
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07003335 * @hide
3336 */
Christopher Tate58f41ec2013-01-11 15:40:36 -08003337 @Deprecated
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07003338 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
3339
3340 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003341 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003342 */
Christopher Tate06efb532012-08-24 15:29:27 -07003343 @Deprecated
3344 public static final String ADB_ENABLED = Global.ADB_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003345
3346 /**
3347 * Setting to allow mock locations and location provider status to be injected into the
3348 * LocationManager service for testing purposes during application development. These
3349 * locations and status values override actual location and status information generated
3350 * by network, gps, or other location providers.
3351 */
3352 public static final String ALLOW_MOCK_LOCATION = "mock_location";
3353
3354 /**
Doug Zongkerd8893db2010-01-26 12:29:44 -08003355 * A 64-bit number (as a hex string) that is randomly
Scott Main44895332013-11-12 09:23:13 -08003356 * generated when the user first sets up the device and should remain
3357 * constant for the lifetime of the user's device. The value may
3358 * change if a factory reset is performed on the device.
3359 * <p class="note"><strong>Note:</strong> When a device has <a
3360 * href="{@docRoot}about/versions/android-4.2.html#MultipleUsers">multiple users</a>
3361 * (available on certain devices running Android 4.2 or higher), each user appears as a
3362 * completely separate device, so the {@code ANDROID_ID} value is unique to each
3363 * user.</p>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003364 */
3365 public static final String ANDROID_ID = "android_id";
3366
3367 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003368 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003369 */
Christopher Tate06efb532012-08-24 15:29:27 -07003370 @Deprecated
3371 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003372
3373 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003374 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003375 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07003376 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003377 public static final String DATA_ROAMING = Global.DATA_ROAMING;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003378
3379 /**
3380 * Setting to record the input method used by default, holding the ID
3381 * of the desired method.
3382 */
3383 public static final String DEFAULT_INPUT_METHOD = "default_input_method";
3384
3385 /**
satokab751aa2010-09-14 19:17:36 +09003386 * Setting to record the input method subtype used by default, holding the ID
3387 * of the desired method.
3388 */
3389 public static final String SELECTED_INPUT_METHOD_SUBTYPE =
3390 "selected_input_method_subtype";
3391
3392 /**
satok723a27e2010-11-11 14:58:11 +09003393 * Setting to record the history of input method subtype, holding the pair of ID of IME
3394 * and its last used subtype.
3395 * @hide
3396 */
3397 public static final String INPUT_METHODS_SUBTYPE_HISTORY =
3398 "input_methods_subtype_history";
3399
3400 /**
satok5c58dfc2010-12-14 21:54:47 +09003401 * Setting to record the visibility of input method selector
3402 */
3403 public static final String INPUT_METHOD_SELECTOR_VISIBILITY =
3404 "input_method_selector_visibility";
3405
3406 /**
Dianne Hackborn91097de2014-04-04 18:02:06 -07003407 * The currently selected voice interaction service flattened ComponentName.
3408 * @hide
3409 */
3410 public static final String VOICE_INTERACTION_SERVICE = "voice_interaction_service";
3411
3412 /**
Zhihai Xuaf5971e2013-06-10 20:28:31 -07003413 * bluetooth HCI snoop log configuration
3414 * @hide
3415 */
3416 public static final String BLUETOOTH_HCI_LOG =
3417 "bluetooth_hci_log";
3418
3419 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003420 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003421 */
Christopher Tate06efb532012-08-24 15:29:27 -07003422 @Deprecated
3423 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003424
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003425 /**
Russell Brennerde6ae442012-09-26 20:53:10 -07003426 * Whether the current user has been set up via setup wizard (0 = false, 1 = true)
3427 * @hide
3428 */
3429 public static final String USER_SETUP_COMPLETE = "user_setup_complete";
3430
3431 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003432 * List of input methods that are currently enabled. This is a string
3433 * containing the IDs of all enabled input methods, each ID separated
3434 * by ':'.
3435 */
3436 public static final String ENABLED_INPUT_METHODS = "enabled_input_methods";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003437
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003438 /**
Amith Yamasanie861ec12010-03-24 21:39:27 -07003439 * List of system input methods that are currently disabled. This is a string
3440 * containing the IDs of all disabled input methods, each ID separated
3441 * by ':'.
3442 * @hide
3443 */
3444 public static final String DISABLED_SYSTEM_INPUT_METHODS = "disabled_system_input_methods";
3445
3446 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07003447 * Host name and port for global http proxy. Uses ':' seperator for
3448 * between host and port.
3449 *
3450 * @deprecated Use {@link Global#HTTP_PROXY}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003451 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07003452 @Deprecated
3453 public static final String HTTP_PROXY = Global.HTTP_PROXY;
Robert Greenwalte90aa5e2010-09-01 11:34:05 -07003454
3455 /**
Christopher Tateaa036a22014-05-19 16:33:27 -07003456 * Whether applications can be installed for this user via the system's
3457 * {@link Intent#ACTION_INSTALL_PACKAGE} mechanism.
3458 *
3459 * <p>1 = permit app installation via the system package installer intent
3460 * <p>0 = do not allow use of the package installer
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003461 */
Christopher Tateaa036a22014-05-19 16:33:27 -07003462 public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003463
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003464 /**
Tom O'Neill923c0dc2014-03-03 11:07:55 -08003465 * Comma-separated list of location providers that activities may access. Do not rely on
3466 * this value being present in settings.db or on ContentObserver notifications on the
3467 * corresponding Uri.
Tom O'Neilla324ac72013-08-26 14:40:23 -07003468 *
Tom O'Neill923c0dc2014-03-03 11:07:55 -08003469 * @deprecated use {@link #LOCATION_MODE} and
3470 * {@link LocationManager#MODE_CHANGED_ACTION} (or
3471 * {@link LocationManager#PROVIDERS_CHANGED_ACTION})
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003472 */
Tom O'Neilla324ac72013-08-26 14:40:23 -07003473 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003474 public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003475
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003476 /**
Tom O'Neill7f6f4572013-08-27 10:53:15 -07003477 * The degree of location access enabled by the user.
Tom O'Neill923c0dc2014-03-03 11:07:55 -08003478 * <p>
Tom O'Neill7f6f4572013-08-27 10:53:15 -07003479 * When used with {@link #putInt(ContentResolver, String, int)}, must be one of {@link
3480 * #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY}, {@link
3481 * #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}. When used with {@link
3482 * #getInt(ContentResolver, String)}, the caller must gracefully handle additional location
3483 * modes that might be added in the future.
Tom O'Neill923c0dc2014-03-03 11:07:55 -08003484 * <p>
3485 * Note: do not rely on this value being present in settings.db or on ContentObserver
3486 * notifications for the corresponding Uri. Use {@link LocationManager#MODE_CHANGED_ACTION}
3487 * to receive changes in this value.
Tom O'Neilla324ac72013-08-26 14:40:23 -07003488 */
3489 public static final String LOCATION_MODE = "location_mode";
3490
3491 /**
Tom O'Neill7f6f4572013-08-27 10:53:15 -07003492 * Location access disabled.
Tom O'Neill1f48b782013-08-19 18:14:56 -07003493 */
3494 public static final int LOCATION_MODE_OFF = 0;
3495 /**
3496 * Network Location Provider disabled, but GPS and other sensors enabled.
3497 */
3498 public static final int LOCATION_MODE_SENSORS_ONLY = 1;
3499 /**
Tom O'Neilld5759432013-09-11 11:03:03 -07003500 * Reduced power usage, such as limiting the number of GPS updates per hour. Requests
3501 * with {@link android.location.Criteria#POWER_HIGH} may be downgraded to
3502 * {@link android.location.Criteria#POWER_MEDIUM}.
Tom O'Neill1f48b782013-08-19 18:14:56 -07003503 */
3504 public static final int LOCATION_MODE_BATTERY_SAVING = 2;
3505 /**
3506 * Best-effort location computation allowed.
3507 */
3508 public static final int LOCATION_MODE_HIGH_ACCURACY = 3;
3509
3510 /**
Danielle Millett925a7d82012-03-19 18:02:20 -04003511 * A flag containing settings used for biometric weak
3512 * @hide
3513 */
3514 public static final String LOCK_BIOMETRIC_WEAK_FLAGS =
3515 "lock_biometric_weak_flags";
3516
3517 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08003518 * Whether autolock is enabled (0 = false, 1 = true)
3519 */
3520 public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock";
3521
3522 /**
3523 * Whether lock pattern is visible as user enters (0 = false, 1 = true)
3524 */
3525 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
3526
3527 /**
Jeff Sharkey5ed9d682012-10-10 14:28:27 -07003528 * Whether lock pattern will vibrate as user enters (0 = false, 1 =
3529 * true)
3530 *
3531 * @deprecated Starting in {@link VERSION_CODES#JELLY_BEAN_MR1} the
3532 * lockscreen uses
3533 * {@link Settings.System#HAPTIC_FEEDBACK_ENABLED}.
Amith Yamasani156c4352010-03-05 17:10:03 -08003534 */
Jeff Sharkey5ed9d682012-10-10 14:28:27 -07003535 @Deprecated
3536 public static final String
3537 LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = "lock_pattern_tactile_feedback_enabled";
Amith Yamasani156c4352010-03-05 17:10:03 -08003538
3539 /**
Jim Millerbc4603b2010-08-30 21:21:34 -07003540 * This preference allows the device to be locked given time after screen goes off,
3541 * subject to current DeviceAdmin policy limits.
3542 * @hide
3543 */
3544 public static final String LOCK_SCREEN_LOCK_AFTER_TIMEOUT = "lock_screen_lock_after_timeout";
3545
3546
3547 /**
John Spurlock5f050e52012-10-27 10:44:19 -04003548 * This preference contains the string that shows for owner info on LockScreen.
Jim Miller253a5ef2010-10-13 20:57:29 -07003549 * @hide
Jim Miller187ec582013-04-15 18:27:54 -07003550 * @deprecated
Jim Miller253a5ef2010-10-13 20:57:29 -07003551 */
3552 public static final String LOCK_SCREEN_OWNER_INFO = "lock_screen_owner_info";
3553
3554 /**
John Spurlock5f050e52012-10-27 10:44:19 -04003555 * Ids of the user-selected appwidgets on the lockscreen (comma-delimited).
Jim Millerf229e4d2012-09-12 20:32:50 -07003556 * @hide
3557 */
Michael Jurkaaa2859a2012-10-24 12:46:49 -07003558 public static final String LOCK_SCREEN_APPWIDGET_IDS =
3559 "lock_screen_appwidget_ids";
Jim Millerf229e4d2012-09-12 20:32:50 -07003560
3561 /**
Jim Miller08fa40c2014-04-29 18:18:47 -07003562 * List of enrolled fingerprint identifiers (comma-delimited).
3563 * @hide
3564 */
3565 public static final String USER_FINGERPRINT_IDS = "user_fingerprint_ids";
3566
3567 /**
Jim Miller51117262012-11-04 17:58:09 -08003568 * Id of the appwidget shown on the lock screen when appwidgets are disabled.
3569 * @hide
3570 */
3571 public static final String LOCK_SCREEN_FALLBACK_APPWIDGET_ID =
3572 "lock_screen_fallback_appwidget_id";
3573
3574 /**
John Spurlock5f050e52012-10-27 10:44:19 -04003575 * Index of the lockscreen appwidget to restore, -1 if none.
3576 * @hide
3577 */
3578 public static final String LOCK_SCREEN_STICKY_APPWIDGET =
3579 "lock_screen_sticky_appwidget";
3580
3581 /**
3582 * This preference enables showing the owner info on LockScreen.
Jim Miller253a5ef2010-10-13 20:57:29 -07003583 * @hide
Jim Miller187ec582013-04-15 18:27:54 -07003584 * @deprecated
Jim Miller253a5ef2010-10-13 20:57:29 -07003585 */
3586 public static final String LOCK_SCREEN_OWNER_INFO_ENABLED =
3587 "lock_screen_owner_info_enabled";
3588
3589 /**
Dan Sandler5d7c3cc2014-02-18 17:35:15 -05003590 * When set by a user, allows notifications to be shown atop a securely locked screen
3591 * in their full "private" form (same as when the device is unlocked).
Dan Sandlerfd16d562014-02-13 18:43:31 -08003592 * @hide
3593 */
3594 public static final String LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS =
3595 "lock_screen_allow_private_notifications";
3596
3597 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003598 * The Logging ID (a unique 64-bit value) as a hex string.
3599 * Used as a pseudonymous identifier for logging.
3600 * @deprecated This identifier is poorly initialized and has
3601 * many collisions. It should not be used.
3602 */
3603 @Deprecated
3604 public static final String LOGGING_ID = "logging_id";
3605
3606 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003607 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003608 */
Christopher Tate06efb532012-08-24 15:29:27 -07003609 @Deprecated
3610 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003611
3612 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08003613 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003614 */
3615 public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003616
3617 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08003618 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003619 */
3620 public static final String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003621
3622 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08003623 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003624 */
3625 public static final String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003626
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003627 /**
3628 * Settings classname to launch when Settings is clicked from All
3629 * Applications. Needed because of user testing between the old
3630 * and new Settings apps.
3631 */
3632 // TODO: 881807
3633 public static final String SETTINGS_CLASSNAME = "settings_classname";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003634
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003635 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003636 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003637 */
Christopher Tate06efb532012-08-24 15:29:27 -07003638 @Deprecated
3639 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003640
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003641 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003642 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003643 */
Christopher Tate06efb532012-08-24 15:29:27 -07003644 @Deprecated
3645 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003646
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003647 /**
svetoslavganov75986cf2009-05-14 22:28:01 -07003648 * If accessibility is enabled.
3649 */
3650 public static final String ACCESSIBILITY_ENABLED = "accessibility_enabled";
3651
3652 /**
Svetoslav Ganov00aabf72011-07-21 11:35:03 -07003653 * If touch exploration is enabled.
Svetoslav Ganov35bfede2011-07-14 17:57:06 -07003654 */
Svetoslav Ganov00aabf72011-07-21 11:35:03 -07003655 public static final String TOUCH_EXPLORATION_ENABLED = "touch_exploration_enabled";
Svetoslav Ganov35bfede2011-07-14 17:57:06 -07003656
3657 /**
svetoslavganov75986cf2009-05-14 22:28:01 -07003658 * List of the enabled accessibility providers.
3659 */
3660 public static final String ENABLED_ACCESSIBILITY_SERVICES =
3661 "enabled_accessibility_services";
3662
3663 /**
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07003664 * List of the accessibility services to which the user has granted
Svetoslav Ganov9a4c5cd2012-05-30 14:06:32 -07003665 * permission to put the device into touch exploration mode.
3666 *
3667 * @hide
3668 */
3669 public static final String TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES =
3670 "touch_exploration_granted_accessibility_services";
3671
3672 /**
Svetoslav Ganov55f937a2011-12-05 11:42:07 -08003673 * Whether to speak passwords while in accessibility mode.
3674 */
3675 public static final String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password";
3676
3677 /**
Chris Craikcce47eb2014-07-16 15:12:15 -07003678 * Whether to draw text with high contrast while in accessibility mode.
3679 *
3680 * @hide
3681 */
3682 public static final String ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED =
3683 "high_text_contrast_enabled";
3684
3685 /**
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08003686 * If injection of accessibility enhancing JavaScript screen-reader
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07003687 * is enabled.
3688 * <p>
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08003689 * Note: The JavaScript based screen-reader is served by the
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07003690 * Google infrastructure and enable users with disabilities to
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07003691 * efficiently navigate in and explore web content.
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07003692 * </p>
3693 * <p>
3694 * This property represents a boolean value.
3695 * </p>
3696 * @hide
3697 */
3698 public static final String ACCESSIBILITY_SCRIPT_INJECTION =
3699 "accessibility_script_injection";
3700
3701 /**
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08003702 * The URL for the injected JavaScript based screen-reader used
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07003703 * for providing accessibility of content in WebView.
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08003704 * <p>
3705 * Note: The JavaScript based screen-reader is served by the
3706 * Google infrastructure and enable users with disabilities to
3707 * efficiently navigate in and explore web content.
3708 * </p>
3709 * <p>
3710 * This property represents a string value.
3711 * </p>
3712 * @hide
3713 */
3714 public static final String ACCESSIBILITY_SCREEN_READER_URL =
3715 "accessibility_script_injection_url";
3716
3717 /**
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07003718 * Key bindings for navigation in built-in accessibility support for web content.
3719 * <p>
3720 * Note: These key bindings are for the built-in accessibility navigation for
3721 * web content which is used as a fall back solution if JavaScript in a WebView
3722 * is not enabled or the user has not opted-in script injection from Google.
3723 * </p>
3724 * <p>
3725 * The bindings are separated by semi-colon. A binding is a mapping from
3726 * a key to a sequence of actions (for more details look at
3727 * android.webkit.AccessibilityInjector). A key is represented as the hexademical
3728 * string representation of an integer obtained from a meta state (optional) shifted
3729 * sixteen times left and bitwise ored with a key code. An action is represented
3730 * as a hexademical string representation of an integer where the first two digits
3731 * are navigation action index, the second, the third, and the fourth digit pairs
3732 * represent the action arguments. The separate actions in a binding are colon
3733 * separated. The key and the action sequence it maps to are separated by equals.
3734 * </p>
3735 * <p>
3736 * For example, the binding below maps the DPAD right button to traverse the
3737 * current navigation axis once without firing an accessibility event and to
3738 * perform the same traversal again but to fire an event:
3739 * <code>
3740 * 0x16=0x01000100:0x01000101;
3741 * </code>
3742 * </p>
3743 * <p>
3744 * The goal of this binding is to enable dynamic rebinding of keys to
3745 * navigation actions for web content without requiring a framework change.
3746 * </p>
3747 * <p>
3748 * This property represents a string value.
3749 * </p>
3750 * @hide
3751 */
3752 public static final String ACCESSIBILITY_WEB_CONTENT_KEY_BINDINGS =
3753 "accessibility_web_content_key_bindings";
3754
3755 /**
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07003756 * Setting that specifies whether the display magnification is enabled.
3757 * Display magnifications allows the user to zoom in the display content
3758 * and is targeted to low vision users. The current magnification scale
3759 * is controlled by {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}.
3760 *
3761 * @hide
3762 */
3763 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED =
3764 "accessibility_display_magnification_enabled";
3765
3766 /**
3767 * Setting that specifies what the display magnification scale is.
3768 * Display magnifications allows the user to zoom in the display
3769 * content and is targeted to low vision users. Whether a display
3770 * magnification is performed is controlled by
3771 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED}
3772 *
3773 * @hide
3774 */
3775 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE =
3776 "accessibility_display_magnification_scale";
3777
3778 /**
3779 * Setting that specifies whether the display magnification should be
3780 * automatically updated. If this fearture is enabled the system will
3781 * exit magnification mode or pan the viewport when a context change
3782 * occurs. For example, on staring a new activity or rotating the screen,
3783 * the system may zoom out so the user can see the new context he is in.
3784 * Another example is on showing a window that is not visible in the
3785 * magnified viewport the system may pan the viewport to make the window
3786 * the has popped up so the user knows that the context has changed.
3787 * Whether a screen magnification is performed is controlled by
3788 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED}
3789 *
3790 * @hide
3791 */
3792 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE =
3793 "accessibility_display_magnification_auto_update";
3794
3795 /**
Alan Viveretteef793802013-07-23 14:15:28 -07003796 * Setting that specifies whether timed text (captions) should be
3797 * displayed in video content. Text display properties are controlled by
3798 * the following settings:
3799 * <ul>
3800 * <li>{@link #ACCESSIBILITY_CAPTIONING_LOCALE}
3801 * <li>{@link #ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR}
3802 * <li>{@link #ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR}
3803 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_COLOR}
3804 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_TYPE}
3805 * <li>{@link #ACCESSIBILITY_CAPTIONING_TYPEFACE}
Alan Viverette69ce69b2013-08-29 12:23:48 -07003806 * <li>{@link #ACCESSIBILITY_CAPTIONING_FONT_SCALE}
Alan Viveretteef793802013-07-23 14:15:28 -07003807 * </ul>
3808 *
3809 * @hide
3810 */
3811 public static final String ACCESSIBILITY_CAPTIONING_ENABLED =
3812 "accessibility_captioning_enabled";
3813
3814 /**
3815 * Setting that specifies the language for captions as a locale string,
3816 * e.g. en_US.
3817 *
3818 * @see java.util.Locale#toString
3819 * @hide
3820 */
3821 public static final String ACCESSIBILITY_CAPTIONING_LOCALE =
3822 "accessibility_captioning_locale";
3823
3824 /**
Alan Viverette43a1e3d2013-08-02 16:45:03 -07003825 * Integer property that specifies the preset style for captions, one
3826 * of:
3827 * <ul>
Alan Viverette69ce69b2013-08-29 12:23:48 -07003828 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESET_CUSTOM}
3829 * <li>a valid index of {@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESETS}
Alan Viverette43a1e3d2013-08-02 16:45:03 -07003830 * </ul>
3831 *
3832 * @see java.util.Locale#toString
3833 * @hide
3834 */
3835 public static final String ACCESSIBILITY_CAPTIONING_PRESET =
3836 "accessibility_captioning_preset";
3837
3838 /**
Alan Viveretteef793802013-07-23 14:15:28 -07003839 * Integer property that specifes the background color for captions as a
3840 * packed 32-bit color.
3841 *
3842 * @see android.graphics.Color#argb
3843 * @hide
3844 */
3845 public static final String ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR =
3846 "accessibility_captioning_background_color";
3847
3848 /**
3849 * Integer property that specifes the foreground color for captions as a
3850 * packed 32-bit color.
3851 *
3852 * @see android.graphics.Color#argb
3853 * @hide
3854 */
3855 public static final String ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR =
3856 "accessibility_captioning_foreground_color";
3857
3858 /**
3859 * Integer property that specifes the edge type for captions, one of:
3860 * <ul>
Alan Viverette69ce69b2013-08-29 12:23:48 -07003861 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_NONE}
3862 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_OUTLINE}
3863 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_DROP_SHADOW}
Alan Viveretteef793802013-07-23 14:15:28 -07003864 * </ul>
3865 *
3866 * @see #ACCESSIBILITY_CAPTIONING_EDGE_COLOR
3867 * @hide
3868 */
3869 public static final String ACCESSIBILITY_CAPTIONING_EDGE_TYPE =
3870 "accessibility_captioning_edge_type";
3871
3872 /**
3873 * Integer property that specifes the edge color for captions as a
3874 * packed 32-bit color.
3875 *
3876 * @see #ACCESSIBILITY_CAPTIONING_EDGE_TYPE
3877 * @see android.graphics.Color#argb
3878 * @hide
3879 */
3880 public static final String ACCESSIBILITY_CAPTIONING_EDGE_COLOR =
3881 "accessibility_captioning_edge_color";
3882
3883 /**
Alan Viverette55d70622013-12-11 15:22:14 -08003884 * Integer property that specifes the window color for captions as a
3885 * packed 32-bit color.
3886 *
3887 * @see android.graphics.Color#argb
3888 * @hide
3889 */
3890 public static final String ACCESSIBILITY_CAPTIONING_WINDOW_COLOR =
3891 "accessibility_captioning_window_color";
3892
3893 /**
Alan Viveretteef793802013-07-23 14:15:28 -07003894 * String property that specifies the typeface for captions, one of:
3895 * <ul>
3896 * <li>DEFAULT
3897 * <li>MONOSPACE
3898 * <li>SANS_SERIF
3899 * <li>SERIF
3900 * </ul>
3901 *
3902 * @see android.graphics.Typeface
3903 * @hide
3904 */
3905 public static final String ACCESSIBILITY_CAPTIONING_TYPEFACE =
3906 "accessibility_captioning_typeface";
3907
3908 /**
Alan Viverette69ce69b2013-08-29 12:23:48 -07003909 * Floating point property that specifies font scaling for captions.
Alan Viveretteef793802013-07-23 14:15:28 -07003910 *
3911 * @hide
3912 */
Alan Viverette69ce69b2013-08-29 12:23:48 -07003913 public static final String ACCESSIBILITY_CAPTIONING_FONT_SCALE =
3914 "accessibility_captioning_font_scale";
Alan Viveretteef793802013-07-23 14:15:28 -07003915
3916 /**
Alan Viverette410d4e32013-09-30 15:37:38 -07003917 * Setting that specifies whether the quick setting tile for display
3918 * color inversion is enabled.
3919 *
3920 * @hide
3921 */
3922 public static final String ACCESSIBILITY_DISPLAY_INVERSION_QUICK_SETTING_ENABLED =
3923 "accessibility_display_inversion_quick_setting_enabled";
3924
3925 /**
3926 * Setting that specifies whether display color inversion is enabled.
Alan Viverette410d4e32013-09-30 15:37:38 -07003927 */
3928 public static final String ACCESSIBILITY_DISPLAY_INVERSION_ENABLED =
3929 "accessibility_display_inversion_enabled";
3930
3931 /**
Alan Viverette410d4e32013-09-30 15:37:38 -07003932 * Setting that specifies whether the quick setting tile for display
3933 * color space adjustment is enabled.
3934 *
3935 * @hide
3936 */
3937 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER_QUICK_SETTING_ENABLED =
3938 "accessibility_display_daltonizer_quick_setting_enabled";
3939
3940 /**
3941 * Setting that specifies whether display color space adjustment is
3942 * enabled.
3943 *
3944 * @hide
3945 */
3946 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED =
3947 "accessibility_display_daltonizer_enabled";
3948
3949 /**
3950 * Integer property that specifies the type of color space adjustment to
3951 * perform. Valid values are defined in AccessibilityManager.
3952 *
3953 * @hide
3954 */
3955 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER =
3956 "accessibility_display_daltonizer";
3957
3958 /**
Svetoslav Ganov54d068e2011-03-02 12:58:40 -08003959 * The timout for considering a press to be a long press in milliseconds.
3960 * @hide
3961 */
3962 public static final String LONG_PRESS_TIMEOUT = "long_press_timeout";
3963
3964 /**
Svetoslav Ganov6bd20bc2013-09-02 15:24:45 -07003965 * List of the enabled print services.
Svetoslav Ganov4b9a4d12013-06-11 15:20:06 -07003966 * @hide
3967 */
3968 public static final String ENABLED_PRINT_SERVICES =
3969 "enabled_print_services";
3970
3971 /**
Svetoslav Ganov6bd20bc2013-09-02 15:24:45 -07003972 * List of the system print services we enabled on first boot. On
3973 * first boot we enable all system, i.e. bundled print services,
3974 * once, so they work out-of-the-box.
3975 * @hide
3976 */
3977 public static final String ENABLED_ON_FIRST_BOOT_SYSTEM_PRINT_SERVICES =
3978 "enabled_on_first_boot_system_print_services";
3979
3980 /**
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07003981 * Setting to always use the default text-to-speech settings regardless
3982 * of the application settings.
3983 * 1 = override application settings,
3984 * 0 = use application settings (if specified).
Narayan Kamath6d632962011-08-24 11:51:37 +01003985 *
3986 * @deprecated The value of this setting is no longer respected by
3987 * the framework text to speech APIs as of the Ice Cream Sandwich release.
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07003988 */
Narayan Kamath6d632962011-08-24 11:51:37 +01003989 @Deprecated
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07003990 public static final String TTS_USE_DEFAULTS = "tts_use_defaults";
3991
3992 /**
3993 * Default text-to-speech engine speech rate. 100 = 1x
3994 */
3995 public static final String TTS_DEFAULT_RATE = "tts_default_rate";
3996
3997 /**
3998 * Default text-to-speech engine pitch. 100 = 1x
3999 */
4000 public static final String TTS_DEFAULT_PITCH = "tts_default_pitch";
4001
4002 /**
4003 * Default text-to-speech engine.
4004 */
4005 public static final String TTS_DEFAULT_SYNTH = "tts_default_synth";
4006
4007 /**
Jean-Michel Trivif4782672009-06-09 16:22:48 -07004008 * Default text-to-speech language.
Narayan Kamath6d632962011-08-24 11:51:37 +01004009 *
4010 * @deprecated this setting is no longer in use, as of the Ice Cream
4011 * Sandwich release. Apps should never need to read this setting directly,
4012 * instead can query the TextToSpeech framework classes for the default
4013 * locale. {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivif4782672009-06-09 16:22:48 -07004014 */
Narayan Kamath6d632962011-08-24 11:51:37 +01004015 @Deprecated
Jean-Michel Trivif4782672009-06-09 16:22:48 -07004016 public static final String TTS_DEFAULT_LANG = "tts_default_lang";
4017
4018 /**
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07004019 * Default text-to-speech country.
Narayan Kamath6d632962011-08-24 11:51:37 +01004020 *
4021 * @deprecated this setting is no longer in use, as of the Ice Cream
4022 * Sandwich release. Apps should never need to read this setting directly,
4023 * instead can query the TextToSpeech framework classes for the default
4024 * locale. {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07004025 */
Narayan Kamath6d632962011-08-24 11:51:37 +01004026 @Deprecated
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07004027 public static final String TTS_DEFAULT_COUNTRY = "tts_default_country";
4028
4029 /**
4030 * Default text-to-speech locale variant.
Narayan Kamath6d632962011-08-24 11:51:37 +01004031 *
4032 * @deprecated this setting is no longer in use, as of the Ice Cream
4033 * Sandwich release. Apps should never need to read this setting directly,
4034 * instead can query the TextToSpeech framework classes for the
4035 * locale that is in use {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07004036 */
Narayan Kamath6d632962011-08-24 11:51:37 +01004037 @Deprecated
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07004038 public static final String TTS_DEFAULT_VARIANT = "tts_default_variant";
4039
4040 /**
Narayan Kamathe5b8c4d2011-08-22 15:37:47 +01004041 * Stores the default tts locales on a per engine basis. Stored as
4042 * a comma seperated list of values, each value being of the form
4043 * {@code engine_name:locale} for example,
Narayan Kamath6d632962011-08-24 11:51:37 +01004044 * {@code com.foo.ttsengine:eng-USA,com.bar.ttsengine:esp-ESP}. This
4045 * supersedes {@link #TTS_DEFAULT_LANG}, {@link #TTS_DEFAULT_COUNTRY} and
4046 * {@link #TTS_DEFAULT_VARIANT}. Apps should never need to read this
4047 * setting directly, and can query the TextToSpeech framework classes
4048 * for the locale that is in use.
Narayan Kamathe5b8c4d2011-08-22 15:37:47 +01004049 *
4050 * @hide
4051 */
4052 public static final String TTS_DEFAULT_LOCALE = "tts_default_locale";
4053
4054 /**
Charles Chenceffa152010-03-16 21:18:10 -07004055 * Space delimited list of plugin packages that are enabled.
4056 */
4057 public static final String TTS_ENABLED_PLUGINS = "tts_enabled_plugins";
4058
4059 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004060 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON}
4061 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004062 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004063 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004064 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004065 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004066
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004067 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004068 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY}
4069 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004070 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004071 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004072 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004073 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004074
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004075 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004076 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
4077 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004078 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004079 @Deprecated
4080 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT =
4081 Global.WIFI_NUM_OPEN_NETWORKS_KEPT;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004082
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004083 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004084 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON}
4085 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004086 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004087 @Deprecated
4088 public static final String WIFI_ON = Global.WIFI_ON;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004089
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004090 /**
4091 * The acceptable packet loss percentage (range 0 - 100) before trying
4092 * another AP on the same network.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004093 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004094 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004095 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004096 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
4097 "wifi_watchdog_acceptable_packet_loss_percentage";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004098
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004099 /**
4100 * The number of access points required for a network in order for the
4101 * watchdog to monitor it.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004102 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004103 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004104 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004105 public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004106
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004107 /**
4108 * The delay between background checks.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004109 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004110 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004111 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004112 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
4113 "wifi_watchdog_background_check_delay_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004114
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004115 /**
4116 * Whether the Wi-Fi watchdog is enabled for background checking even
4117 * after it thinks the user has connected to a good access point.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004118 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004119 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004120 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004121 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
4122 "wifi_watchdog_background_check_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004123
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004124 /**
4125 * The timeout for a background ping
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004126 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004127 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004128 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004129 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
4130 "wifi_watchdog_background_check_timeout_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004131
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004132 /**
4133 * The number of initial pings to perform that *may* be ignored if they
4134 * fail. Again, if these fail, they will *not* be used in packet loss
4135 * calculation. For example, one network always seemed to time out for
4136 * the first couple pings, so this is set to 3 by default.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004137 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004138 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004139 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004140 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
4141 "wifi_watchdog_initial_ignored_ping_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004142
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004143 /**
4144 * The maximum number of access points (per network) to attempt to test.
4145 * If this number is reached, the watchdog will no longer monitor the
4146 * initial connection state for the network. This is a safeguard for
4147 * networks containing multiple APs whose DNS does not respond to pings.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004148 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004149 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004150 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004151 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = "wifi_watchdog_max_ap_checks";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004152
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004153 /**
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07004154 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004155 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07004156 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004157 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
4158
4159 /**
4160 * A comma-separated list of SSIDs for which the Wi-Fi watchdog should be enabled.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004161 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004162 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004163 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004164 public static final String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list";
4165
4166 /**
4167 * The number of pings to test if an access point is a good connection.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004168 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004169 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004170 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004171 public static final String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004172
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004173 /**
4174 * The delay between pings.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004175 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004176 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004177 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004178 public static final String WIFI_WATCHDOG_PING_DELAY_MS = "wifi_watchdog_ping_delay_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004179
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004180 /**
4181 * The timeout per ping.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004182 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004183 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004184 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004185 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004186
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004187 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004188 * @deprecated Use
4189 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004190 */
Christopher Tate06efb532012-08-24 15:29:27 -07004191 @Deprecated
4192 public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004193
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004194 /**
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004195 * @deprecated Use
4196 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004197 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07004198 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004199 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004200 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004201
4202 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07004203 * Whether background data usage is allowed.
4204 *
4205 * @deprecated As of {@link VERSION_CODES#ICE_CREAM_SANDWICH},
4206 * availability of background data depends on several
4207 * combined factors. When background data is unavailable,
4208 * {@link ConnectivityManager#getActiveNetworkInfo()} will
4209 * now appear disconnected.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004210 */
Jeff Sharkey3a844fc2011-08-16 14:37:57 -07004211 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004212 public static final String BACKGROUND_DATA = "background_data";
Wink Saville04e71b32009-04-02 11:00:54 -07004213
4214 /**
Bjorn Bringert98bfa392010-03-24 10:59:48 +00004215 * Origins for which browsers should allow geolocation by default.
4216 * The value is a space-separated list of origins.
4217 */
4218 public static final String ALLOWED_GEOLOCATION_ORIGINS
4219 = "allowed_geolocation_origins";
4220
4221 /**
Wink Savillee9b06d72009-05-18 21:47:50 -07004222 * The preferred TTY mode 0 = TTy Off, CDMA default
4223 * 1 = TTY Full
4224 * 2 = TTY HCO
4225 * 3 = TTY VCO
4226 * @hide
4227 */
4228 public static final String PREFERRED_TTY_MODE =
4229 "preferred_tty_mode";
4230
Wink Saville04e71b32009-04-02 11:00:54 -07004231 /**
Wink Saville04e71b32009-04-02 11:00:54 -07004232 * Whether the enhanced voice privacy mode is enabled.
4233 * 0 = normal voice privacy
4234 * 1 = enhanced voice privacy
4235 * @hide
4236 */
4237 public static final String ENHANCED_VOICE_PRIVACY_ENABLED = "enhanced_voice_privacy_enabled";
4238
4239 /**
4240 * Whether the TTY mode mode is enabled.
4241 * 0 = disabled
4242 * 1 = enabled
4243 * @hide
4244 */
4245 public static final String TTY_MODE_ENABLED = "tty_mode_enabled";
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07004246
4247 /**
Christopher Tate8031a3d2009-07-06 16:36:05 -07004248 * Controls whether settings backup is enabled.
Dianne Hackborncf098292009-07-01 19:55:20 -07004249 * Type: int ( 0 = disabled, 1 = enabled )
4250 * @hide
4251 */
4252 public static final String BACKUP_ENABLED = "backup_enabled";
4253
4254 /**
Christopher Tatecce9da52010-02-03 15:11:15 -08004255 * Controls whether application data is automatically restored from backup
4256 * at install time.
4257 * Type: int ( 0 = disabled, 1 = enabled )
4258 * @hide
4259 */
4260 public static final String BACKUP_AUTO_RESTORE = "backup_auto_restore";
4261
4262 /**
Christopher Tate8031a3d2009-07-06 16:36:05 -07004263 * Indicates whether settings backup has been fully provisioned.
4264 * Type: int ( 0 = unprovisioned, 1 = fully provisioned )
4265 * @hide
4266 */
4267 public static final String BACKUP_PROVISIONED = "backup_provisioned";
4268
4269 /**
Dianne Hackborncf098292009-07-01 19:55:20 -07004270 * Component of the transport to use for backup/restore.
4271 * @hide
4272 */
4273 public static final String BACKUP_TRANSPORT = "backup_transport";
Sanjay Jeyakumar21bf2412009-07-09 13:31:48 -07004274
Dianne Hackbornd7cd29d2009-07-01 11:22:45 -07004275 /**
4276 * Version for which the setup wizard was last shown. Bumped for
4277 * each release when there is new setup information to show.
4278 * @hide
4279 */
4280 public static final String LAST_SETUP_SHOWN = "last_setup_shown";
Dianne Hackborncf098292009-07-01 19:55:20 -07004281
4282 /**
Doug Zongker43866e02010-01-07 12:09:54 -08004283 * The interval in milliseconds after which Wi-Fi is considered idle.
4284 * When idle, it is possible for the device to be switched from Wi-Fi to
4285 * the mobile data network.
4286 * @hide
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004287 * @deprecated Use {@link android.provider.Settings.Global#WIFI_IDLE_MS}
4288 * instead.
Doug Zongker43866e02010-01-07 12:09:54 -08004289 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004290 @Deprecated
4291 public static final String WIFI_IDLE_MS = Global.WIFI_IDLE_MS;
Doug Zongker43866e02010-01-07 12:09:54 -08004292
4293 /**
Narayan Kamathee69ff42011-06-28 12:07:18 +01004294 * The global search provider chosen by the user (if multiple global
4295 * search providers are installed). This will be the provider returned
4296 * by {@link SearchManager#getGlobalSearchActivity()} if it's still
4297 * installed. This setting is stored as a flattened component name as
4298 * per {@link ComponentName#flattenToString()}.
4299 *
4300 * @hide
4301 */
4302 public static final String SEARCH_GLOBAL_SEARCH_ACTIVITY =
4303 "search_global_search_activity";
4304
4305 /**
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08004306 * The number of promoted sources in GlobalSearch.
4307 * @hide
4308 */
4309 public static final String SEARCH_NUM_PROMOTED_SOURCES = "search_num_promoted_sources";
4310 /**
4311 * The maximum number of suggestions returned by GlobalSearch.
4312 * @hide
4313 */
4314 public static final String SEARCH_MAX_RESULTS_TO_DISPLAY = "search_max_results_to_display";
4315 /**
4316 * The number of suggestions GlobalSearch will ask each non-web search source for.
4317 * @hide
4318 */
4319 public static final String SEARCH_MAX_RESULTS_PER_SOURCE = "search_max_results_per_source";
4320 /**
4321 * The number of suggestions the GlobalSearch will ask the web search source for.
4322 * @hide
4323 */
4324 public static final String SEARCH_WEB_RESULTS_OVERRIDE_LIMIT =
4325 "search_web_results_override_limit";
4326 /**
4327 * The number of milliseconds that GlobalSearch will wait for suggestions from
4328 * promoted sources before continuing with all other sources.
4329 * @hide
4330 */
4331 public static final String SEARCH_PROMOTED_SOURCE_DEADLINE_MILLIS =
4332 "search_promoted_source_deadline_millis";
4333 /**
4334 * The number of milliseconds before GlobalSearch aborts search suggesiton queries.
4335 * @hide
4336 */
4337 public static final String SEARCH_SOURCE_TIMEOUT_MILLIS = "search_source_timeout_millis";
4338 /**
4339 * The maximum number of milliseconds that GlobalSearch shows the previous results
4340 * after receiving a new query.
4341 * @hide
4342 */
4343 public static final String SEARCH_PREFILL_MILLIS = "search_prefill_millis";
4344 /**
4345 * The maximum age of log data used for shortcuts in GlobalSearch.
4346 * @hide
4347 */
4348 public static final String SEARCH_MAX_STAT_AGE_MILLIS = "search_max_stat_age_millis";
4349 /**
4350 * The maximum age of log data used for source ranking in GlobalSearch.
4351 * @hide
4352 */
4353 public static final String SEARCH_MAX_SOURCE_EVENT_AGE_MILLIS =
4354 "search_max_source_event_age_millis";
4355 /**
4356 * The minimum number of impressions needed to rank a source in GlobalSearch.
4357 * @hide
4358 */
4359 public static final String SEARCH_MIN_IMPRESSIONS_FOR_SOURCE_RANKING =
4360 "search_min_impressions_for_source_ranking";
4361 /**
4362 * The minimum number of clicks needed to rank a source in GlobalSearch.
4363 * @hide
4364 */
4365 public static final String SEARCH_MIN_CLICKS_FOR_SOURCE_RANKING =
4366 "search_min_clicks_for_source_ranking";
4367 /**
4368 * The maximum number of shortcuts shown by GlobalSearch.
4369 * @hide
4370 */
4371 public static final String SEARCH_MAX_SHORTCUTS_RETURNED = "search_max_shortcuts_returned";
4372 /**
4373 * The size of the core thread pool for suggestion queries in GlobalSearch.
4374 * @hide
4375 */
4376 public static final String SEARCH_QUERY_THREAD_CORE_POOL_SIZE =
4377 "search_query_thread_core_pool_size";
4378 /**
4379 * The maximum size of the thread pool for suggestion queries in GlobalSearch.
4380 * @hide
4381 */
4382 public static final String SEARCH_QUERY_THREAD_MAX_POOL_SIZE =
4383 "search_query_thread_max_pool_size";
4384 /**
4385 * The size of the core thread pool for shortcut refreshing in GlobalSearch.
4386 * @hide
4387 */
4388 public static final String SEARCH_SHORTCUT_REFRESH_CORE_POOL_SIZE =
4389 "search_shortcut_refresh_core_pool_size";
4390 /**
4391 * The maximum size of the thread pool for shortcut refreshing in GlobalSearch.
4392 * @hide
4393 */
4394 public static final String SEARCH_SHORTCUT_REFRESH_MAX_POOL_SIZE =
4395 "search_shortcut_refresh_max_pool_size";
4396 /**
4397 * The maximun time that excess threads in the GlobalSeach thread pools will
4398 * wait before terminating.
4399 * @hide
4400 */
4401 public static final String SEARCH_THREAD_KEEPALIVE_SECONDS =
4402 "search_thread_keepalive_seconds";
4403 /**
4404 * The maximum number of concurrent suggestion queries to each source.
4405 * @hide
4406 */
4407 public static final String SEARCH_PER_SOURCE_CONCURRENT_QUERY_LIMIT =
4408 "search_per_source_concurrent_query_limit";
4409
San Mehat87734d32010-01-08 12:53:06 -08004410 /**
4411 * Whether or not alert sounds are played on MountService events. (0 = false, 1 = true)
4412 * @hide
4413 */
4414 public static final String MOUNT_PLAY_NOTIFICATION_SND = "mount_play_not_snd";
4415
4416 /**
4417 * Whether or not UMS auto-starts on UMS host detection. (0 = false, 1 = true)
4418 * @hide
4419 */
4420 public static final String MOUNT_UMS_AUTOSTART = "mount_ums_autostart";
4421
4422 /**
4423 * Whether or not a notification is displayed on UMS host detection. (0 = false, 1 = true)
4424 * @hide
4425 */
4426 public static final String MOUNT_UMS_PROMPT = "mount_ums_prompt";
4427
4428 /**
4429 * Whether or not a notification is displayed while UMS is enabled. (0 = false, 1 = true)
4430 * @hide
4431 */
4432 public static final String MOUNT_UMS_NOTIFY_ENABLED = "mount_ums_notify_enabled";
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08004433
Dan Egnor42471dd2010-01-07 17:25:22 -08004434 /**
4435 * If nonzero, ANRs in invisible background processes bring up a dialog.
4436 * Otherwise, the process will be silently killed.
4437 * @hide
4438 */
4439 public static final String ANR_SHOW_BACKGROUND = "anr_show_background";
Erikeebc8e22010-02-18 13:27:19 -08004440
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08004441 /**
Selim Guruna83f1e32014-05-05 15:59:39 -07004442 * (Experimental). If nonzero, WebView uses data reduction proxy to save network
4443 * bandwidth. Otherwise, WebView does not use data reduction proxy.
4444 * @hide
4445 */
4446 public static final String WEBVIEW_DATA_REDUCTION_PROXY = "webview_data_reduction_proxy";
4447
4448 /**
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08004449 * The {@link ComponentName} string of the service to be used as the voice recognition
4450 * service.
Erikeebc8e22010-02-18 13:27:19 -08004451 *
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08004452 * @hide
4453 */
4454 public static final String VOICE_RECOGNITION_SERVICE = "voice_recognition_service";
Dan Egnor42471dd2010-01-07 17:25:22 -08004455
William Luh623a4282013-06-24 12:14:18 -07004456 /**
4457 * Stores whether an user has consented to have apps verified through PAM.
4458 * The value is boolean (1 or 0).
4459 *
4460 * @hide
4461 */
4462 public static final String PACKAGE_VERIFIER_USER_CONSENT =
4463 "package_verifier_user_consent";
satok988323c2011-06-22 16:38:13 +09004464
4465 /**
satokada8c4e2011-08-23 14:56:56 +09004466 * The {@link ComponentName} string of the selected spell checker service which is
4467 * one of the services managed by the text service manager.
4468 *
4469 * @hide
4470 */
4471 public static final String SELECTED_SPELL_CHECKER = "selected_spell_checker";
4472
4473 /**
4474 * The {@link ComponentName} string of the selected subtype of the selected spell checker
satok988323c2011-06-22 16:38:13 +09004475 * service which is one of the services managed by the text service manager.
4476 *
4477 * @hide
4478 */
satokada8c4e2011-08-23 14:56:56 +09004479 public static final String SELECTED_SPELL_CHECKER_SUBTYPE =
4480 "selected_spell_checker_subtype";
satok988323c2011-06-22 16:38:13 +09004481
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08004482 /**
satoka33c4fc2011-08-25 16:50:11 +09004483 * The {@link ComponentName} string whether spell checker is enabled or not.
4484 *
4485 * @hide
4486 */
4487 public static final String SPELL_CHECKER_ENABLED = "spell_checker_enabled";
4488
4489 /**
David Brown458e8062010-03-08 21:52:11 -08004490 * What happens when the user presses the Power button while in-call
4491 * and the screen is on.<br/>
4492 * <b>Values:</b><br/>
4493 * 1 - The Power button turns off the screen and locks the device. (Default behavior)<br/>
4494 * 2 - The Power button hangs up the current call.<br/>
4495 *
4496 * @hide
4497 */
4498 public static final String INCALL_POWER_BUTTON_BEHAVIOR = "incall_power_button_behavior";
4499
4500 /**
4501 * INCALL_POWER_BUTTON_BEHAVIOR value for "turn off screen".
4502 * @hide
4503 */
4504 public static final int INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF = 0x1;
4505
4506 /**
4507 * INCALL_POWER_BUTTON_BEHAVIOR value for "hang up".
4508 * @hide
4509 */
4510 public static final int INCALL_POWER_BUTTON_BEHAVIOR_HANGUP = 0x2;
4511
4512 /**
4513 * INCALL_POWER_BUTTON_BEHAVIOR default value.
4514 * @hide
4515 */
4516 public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT =
4517 INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF;
4518
4519 /**
Jeff Browna20dda42014-05-27 20:57:24 -07004520 * Whether the device should wake when the wake gesture sensor detects motion.
4521 * @hide
4522 */
4523 public static final String WAKE_GESTURE_ENABLED = "wake_gesture_enabled";
4524
4525 /**
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07004526 * The current night mode that has been selected by the user. Owned
4527 * and controlled by UiModeManagerService. Constants are as per
4528 * UiModeManager.
4529 * @hide
4530 */
4531 public static final String UI_NIGHT_MODE = "ui_night_mode";
Suchi Amalapurapu40e47252010-04-07 16:15:50 -07004532
4533 /**
John Spurlock1a868b72012-08-22 09:56:51 -04004534 * Whether screensavers are enabled.
Daniel Sandler0601eb72011-04-13 01:01:32 -04004535 * @hide
4536 */
Daniel Sandler2d545362011-11-17 10:38:37 -08004537 public static final String SCREENSAVER_ENABLED = "screensaver_enabled";
Daniel Sandler0601eb72011-04-13 01:01:32 -04004538
4539 /**
John Spurlock1a868b72012-08-22 09:56:51 -04004540 * The user's chosen screensaver components.
Daniel Sandler2d545362011-11-17 10:38:37 -08004541 *
John Spurlock1a868b72012-08-22 09:56:51 -04004542 * These will be launched by the PhoneWindowManager after a timeout when not on
Daniel Sandler2d545362011-11-17 10:38:37 -08004543 * battery, or upon dock insertion (if SCREENSAVER_ACTIVATE_ON_DOCK is set to 1).
Daniel Sandler0601eb72011-04-13 01:01:32 -04004544 * @hide
4545 */
John Spurlock1a868b72012-08-22 09:56:51 -04004546 public static final String SCREENSAVER_COMPONENTS = "screensaver_components";
Daniel Sandler2d545362011-11-17 10:38:37 -08004547
4548 /**
John Spurlock1a868b72012-08-22 09:56:51 -04004549 * If screensavers are enabled, whether the screensaver should be automatically launched
4550 * when the device is inserted into a (desk) dock.
Daniel Sandler2d545362011-11-17 10:38:37 -08004551 * @hide
4552 */
4553 public static final String SCREENSAVER_ACTIVATE_ON_DOCK = "screensaver_activate_on_dock";
Daniel Sandler0601eb72011-04-13 01:01:32 -04004554
John Spurlock1a868b72012-08-22 09:56:51 -04004555 /**
4556 * If screensavers are enabled, whether the screensaver should be automatically launched
4557 * when the screen times out when not on battery.
4558 * @hide
4559 */
4560 public static final String SCREENSAVER_ACTIVATE_ON_SLEEP = "screensaver_activate_on_sleep";
4561
4562 /**
4563 * If screensavers are enabled, the default screensaver component.
4564 * @hide
4565 */
4566 public static final String SCREENSAVER_DEFAULT_COMPONENT = "screensaver_default_component";
4567
Daniel Sandler0601eb72011-04-13 01:01:32 -04004568 /**
Martijn Coenena7397882013-07-30 20:07:47 -07004569 * The default NFC payment component
4570 * @hide
4571 */
4572 public static final String NFC_PAYMENT_DEFAULT_COMPONENT = "nfc_payment_default_component";
4573
4574 /**
Martijn Coenen2f6f3a012014-04-25 17:00:21 -07004575 * Whether NFC payment is handled by the foreground application or a default.
4576 * @hide
4577 */
4578 public static final String NFC_PAYMENT_FOREGROUND = "nfc_payment_foreground";
4579
4580 /**
David Braunf5d83192013-09-16 13:43:51 -07004581 * Specifies the package name currently configured to be the primary sms application
4582 * @hide
4583 */
4584 public static final String SMS_DEFAULT_APPLICATION = "sms_default_application";
4585
4586 /**
Daniel Sandler4b749ef2013-03-18 21:53:04 -04004587 * Name of a package that the current user has explicitly allowed to see all of that
4588 * user's notifications.
4589 *
4590 * @hide
4591 */
4592 public static final String ENABLED_NOTIFICATION_LISTENERS = "enabled_notification_listeners";
4593
John Spurlock7340fc82014-04-24 18:50:12 -04004594 /**
4595 * @hide
4596 */
4597 public static final String ENABLED_CONDITION_PROVIDERS = "enabled_condition_providers";
4598
John Spurlock5c454122013-06-17 07:35:46 -04004599 /** @hide */
4600 public static final String BAR_SERVICE_COMPONENT = "bar_service_component";
4601
John Spurlockd67ec252013-09-05 11:31:54 -04004602 /** @hide */
John Spurlockf1a36642013-10-12 17:50:42 -04004603 public static final String IMMERSIVE_MODE_CONFIRMATIONS = "immersive_mode_confirmations";
John Spurlockd67ec252013-09-05 11:31:54 -04004604
Yorke Lee647f8f32013-05-07 10:49:44 -07004605 /**
Svetoslavf43e8512013-09-30 17:33:05 -07004606 * This is the query URI for finding a print service to install.
4607 *
4608 * @hide
4609 */
4610 public static final String PRINT_SERVICE_SEARCH_URI = "print_service_search_uri";
4611
4612 /**
4613 * This is the query URI for finding a NFC payment service to install.
4614 *
4615 * @hide
4616 */
4617 public static final String PAYMENT_SERVICE_SEARCH_URI = "payment_service_search_uri";
4618
4619 /**
Amith Yamasani1e9c2182014-06-11 17:25:51 -07004620 * If enabled, apps should try to skip any introductory hints on first launch. This might
Amith Yamasani0c416392014-06-13 15:54:39 -07004621 * apply to users that are already familiar with the environment or temporary users.
Amith Yamasani1e9c2182014-06-11 17:25:51 -07004622 * <p>
4623 * Type : int (0 to show hints, 1 to skip showing hints)
Amith Yamasani1e9c2182014-06-11 17:25:51 -07004624 */
4625 public static final String SKIP_FIRST_USE_HINTS = "skip_first_use_hints";
4626
4627 /**
Svetoslav Ganova571a582011-09-20 18:32:20 -07004628 * This are the settings to be backed up.
4629 *
4630 * NOTE: Settings are backed up and restored in the order they appear
4631 * in this array. If you have one setting depending on another,
4632 * make sure that they are ordered appropriately.
4633 *
-b master501eec92009-07-06 13:53:11 -07004634 * @hide
4635 */
4636 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate58f41ec2013-01-11 15:40:36 -08004637 BUGREPORT_IN_POWER_MENU, // moved to global
Amith Yamasani8823c0a82009-07-07 14:30:17 -07004638 ALLOW_MOCK_LOCATION,
-b master501eec92009-07-06 13:53:11 -07004639 PARENTAL_CONTROL_ENABLED,
4640 PARENTAL_CONTROL_REDIRECT_URL,
Christopher Tate66488d62012-10-02 11:58:01 -07004641 USB_MASS_STORAGE_ENABLED, // moved to global
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07004642 ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED,
4643 ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE,
4644 ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE,
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07004645 ACCESSIBILITY_SCRIPT_INJECTION,
Christopher Tate14c2d792010-02-25 16:49:44 -08004646 BACKUP_AUTO_RESTORE,
-b master501eec92009-07-06 13:53:11 -07004647 ENABLED_ACCESSIBILITY_SERVICES,
Svetoslav Ganov9a4c5cd2012-05-30 14:06:32 -07004648 TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES,
Svetoslav Ganova28a16d2011-07-28 11:24:21 -07004649 TOUCH_EXPLORATION_ENABLED,
Svetoslav Ganova571a582011-09-20 18:32:20 -07004650 ACCESSIBILITY_ENABLED,
Svetoslav Ganov55f937a2011-12-05 11:42:07 -08004651 ACCESSIBILITY_SPEAK_PASSWORD,
Chris Craikcce47eb2014-07-16 15:12:15 -07004652 ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED,
Alan Viveretteef793802013-07-23 14:15:28 -07004653 ACCESSIBILITY_CAPTIONING_ENABLED,
4654 ACCESSIBILITY_CAPTIONING_LOCALE,
4655 ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR,
4656 ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR,
4657 ACCESSIBILITY_CAPTIONING_EDGE_TYPE,
4658 ACCESSIBILITY_CAPTIONING_EDGE_COLOR,
4659 ACCESSIBILITY_CAPTIONING_TYPEFACE,
Alan Viverette69ce69b2013-08-29 12:23:48 -07004660 ACCESSIBILITY_CAPTIONING_FONT_SCALE,
-b master501eec92009-07-06 13:53:11 -07004661 TTS_USE_DEFAULTS,
4662 TTS_DEFAULT_RATE,
4663 TTS_DEFAULT_PITCH,
4664 TTS_DEFAULT_SYNTH,
4665 TTS_DEFAULT_LANG,
4666 TTS_DEFAULT_COUNTRY,
Charles Chenceffa152010-03-16 21:18:10 -07004667 TTS_ENABLED_PLUGINS,
Narayan Kamath6d632962011-08-24 11:51:37 +01004668 TTS_DEFAULT_LOCALE,
Christopher Tate66488d62012-10-02 11:58:01 -07004669 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, // moved to global
4670 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, // moved to global
4671 WIFI_NUM_OPEN_NETWORKS_KEPT, // moved to global
San Mehat87734d32010-01-08 12:53:06 -08004672 MOUNT_PLAY_NOTIFICATION_SND,
4673 MOUNT_UMS_AUTOSTART,
4674 MOUNT_UMS_PROMPT,
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07004675 MOUNT_UMS_NOTIFY_ENABLED,
Yorke Lee35785bf2013-08-21 19:16:20 -07004676 UI_NIGHT_MODE
-b master501eec92009-07-06 13:53:11 -07004677 };
4678
4679 /**
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07004680 * Helper method for determining if a location provider is enabled.
Tom O'Neilld5759432013-09-11 11:03:03 -07004681 *
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07004682 * @param cr the content resolver to use
4683 * @param provider the location provider to query
4684 * @return true if the provider is enabled
Tom O'Neilld5759432013-09-11 11:03:03 -07004685 *
4686 * @deprecated use {@link #LOCATION_MODE} or
4687 * {@link LocationManager#isProviderEnabled(String)}
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07004688 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07004689 @Deprecated
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07004690 public static final boolean isLocationProviderEnabled(ContentResolver cr, String provider) {
Victoria Leaseb711d572012-10-02 13:14:11 -07004691 return isLocationProviderEnabledForUser(cr, provider, UserHandle.myUserId());
4692 }
4693
4694 /**
4695 * Helper method for determining if a location provider is enabled.
4696 * @param cr the content resolver to use
4697 * @param provider the location provider to query
4698 * @param userId the userId to query
4699 * @return true if the provider is enabled
Tom O'Neilld5759432013-09-11 11:03:03 -07004700 * @deprecated use {@link #LOCATION_MODE} or
4701 * {@link LocationManager#isProviderEnabled(String)}
Victoria Leaseb711d572012-10-02 13:14:11 -07004702 * @hide
4703 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07004704 @Deprecated
Victoria Leaseb711d572012-10-02 13:14:11 -07004705 public static final boolean isLocationProviderEnabledForUser(ContentResolver cr, String provider, int userId) {
4706 String allowedProviders = Settings.Secure.getStringForUser(cr,
4707 LOCATION_PROVIDERS_ALLOWED, userId);
Brad Fitzpatrick11fe1812010-09-10 16:07:52 -07004708 return TextUtils.delimitedStringContains(allowedProviders, ',', provider);
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07004709 }
4710
4711 /**
4712 * Thread-safe method for enabling or disabling a single location provider.
4713 * @param cr the content resolver to use
4714 * @param provider the location provider to enable or disable
4715 * @param enabled true if the provider should be enabled
Tom O'Neilla324ac72013-08-26 14:40:23 -07004716 * @deprecated use {@link #putInt(ContentResolver, String, int)} and {@link #LOCATION_MODE}
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07004717 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07004718 @Deprecated
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07004719 public static final void setLocationProviderEnabled(ContentResolver cr,
4720 String provider, boolean enabled) {
Victoria Leaseb711d572012-10-02 13:14:11 -07004721 setLocationProviderEnabledForUser(cr, provider, enabled, UserHandle.myUserId());
4722 }
4723
4724 /**
4725 * Thread-safe method for enabling or disabling a single location provider.
Tom O'Neilla324ac72013-08-26 14:40:23 -07004726 *
Victoria Leaseb711d572012-10-02 13:14:11 -07004727 * @param cr the content resolver to use
4728 * @param provider the location provider to enable or disable
4729 * @param enabled true if the provider should be enabled
4730 * @param userId the userId for which to enable/disable providers
Tom O'Neilla324ac72013-08-26 14:40:23 -07004731 * @return true if the value was set, false on database errors
4732 * @deprecated use {@link #putIntForUser(ContentResolver, String, int, int)} and
4733 * {@link #LOCATION_MODE}
Victoria Leaseb711d572012-10-02 13:14:11 -07004734 * @hide
4735 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07004736 @Deprecated
Tom O'Neilla324ac72013-08-26 14:40:23 -07004737 public static final boolean setLocationProviderEnabledForUser(ContentResolver cr,
Victoria Leaseb711d572012-10-02 13:14:11 -07004738 String provider, boolean enabled, int userId) {
David Christie3f7b6522013-08-06 19:19:08 -07004739 synchronized (mLocationSettingsLock) {
4740 // to ensure thread safety, we write the provider name with a '+' or '-'
4741 // and let the SettingsProvider handle it rather than reading and modifying
4742 // the list of enabled providers.
4743 if (enabled) {
4744 provider = "+" + provider;
4745 } else {
4746 provider = "-" + provider;
4747 }
Tom O'Neilla324ac72013-08-26 14:40:23 -07004748 return putStringForUser(cr, Settings.Secure.LOCATION_PROVIDERS_ALLOWED, provider,
David Christie3f7b6522013-08-06 19:19:08 -07004749 userId);
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07004750 }
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07004751 }
Tom O'Neill1f48b782013-08-19 18:14:56 -07004752
4753 /**
4754 * Thread-safe method for setting the location mode to one of
4755 * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY},
4756 * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}.
4757 *
Tom O'Neill1f48b782013-08-19 18:14:56 -07004758 * @param cr the content resolver to use
4759 * @param mode such as {@link #LOCATION_MODE_HIGH_ACCURACY}
4760 * @param userId the userId for which to change mode
Tom O'Neilla324ac72013-08-26 14:40:23 -07004761 * @return true if the value was set, false on database errors
Tom O'Neill1f48b782013-08-19 18:14:56 -07004762 *
4763 * @throws IllegalArgumentException if mode is not one of the supported values
4764 */
Tom O'Neill7f6f4572013-08-27 10:53:15 -07004765 private static final boolean setLocationModeForUser(ContentResolver cr, int mode,
4766 int userId) {
Tom O'Neill1f48b782013-08-19 18:14:56 -07004767 synchronized (mLocationSettingsLock) {
4768 boolean gps = false;
4769 boolean network = false;
4770 switch (mode) {
4771 case LOCATION_MODE_OFF:
4772 break;
4773 case LOCATION_MODE_SENSORS_ONLY:
4774 gps = true;
4775 break;
4776 case LOCATION_MODE_BATTERY_SAVING:
4777 network = true;
4778 break;
4779 case LOCATION_MODE_HIGH_ACCURACY:
4780 gps = true;
4781 network = true;
4782 break;
4783 default:
4784 throw new IllegalArgumentException("Invalid location mode: " + mode);
4785 }
Tom O'Neilla324ac72013-08-26 14:40:23 -07004786 boolean gpsSuccess = Settings.Secure.setLocationProviderEnabledForUser(
Tom O'Neill1f48b782013-08-19 18:14:56 -07004787 cr, LocationManager.GPS_PROVIDER, gps, userId);
Tom O'Neilla324ac72013-08-26 14:40:23 -07004788 boolean nlpSuccess = Settings.Secure.setLocationProviderEnabledForUser(
Tom O'Neill1f48b782013-08-19 18:14:56 -07004789 cr, LocationManager.NETWORK_PROVIDER, network, userId);
Tom O'Neilla324ac72013-08-26 14:40:23 -07004790 return gpsSuccess && nlpSuccess;
Tom O'Neill1f48b782013-08-19 18:14:56 -07004791 }
4792 }
4793
4794 /**
Tom O'Neill1f48b782013-08-19 18:14:56 -07004795 * Thread-safe method for reading the location mode, returns one of
4796 * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY},
4797 * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}.
4798 *
4799 * @param cr the content resolver to use
4800 * @param userId the userId for which to read the mode
4801 * @return the location mode
4802 */
Tom O'Neill7f6f4572013-08-27 10:53:15 -07004803 private static final int getLocationModeForUser(ContentResolver cr, int userId) {
Tom O'Neill1f48b782013-08-19 18:14:56 -07004804 synchronized (mLocationSettingsLock) {
4805 boolean gpsEnabled = Settings.Secure.isLocationProviderEnabledForUser(
4806 cr, LocationManager.GPS_PROVIDER, userId);
4807 boolean networkEnabled = Settings.Secure.isLocationProviderEnabledForUser(
4808 cr, LocationManager.NETWORK_PROVIDER, userId);
4809 if (gpsEnabled && networkEnabled) {
4810 return LOCATION_MODE_HIGH_ACCURACY;
4811 } else if (gpsEnabled) {
4812 return LOCATION_MODE_SENSORS_ONLY;
4813 } else if (networkEnabled) {
4814 return LOCATION_MODE_BATTERY_SAVING;
4815 } else {
4816 return LOCATION_MODE_OFF;
4817 }
4818 }
4819 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004820 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004821
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004822 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004823 * Global system settings, containing preferences that always apply identically
4824 * to all defined users. Applications can read these but are not allowed to write;
4825 * like the "Secure" settings, these are for preferences that the user must
4826 * explicitly modify through the system UI or specialized APIs for those values.
4827 */
4828 public static final class Global extends NameValueTable {
4829 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_global_version";
4830
4831 /**
4832 * The content:// style URL for global secure settings items. Not public.
4833 */
4834 public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/global");
4835
4836 /**
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07004837 * Setting whether the global gesture for enabling accessibility is enabled.
4838 * If this gesture is enabled the user will be able to perfrom it to enable
4839 * the accessibility state without visiting the settings app.
4840 * @hide
4841 */
4842 public static final String ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED =
4843 "enable_accessibility_global_gesture_enabled";
4844
4845 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004846 * Whether Airplane Mode is on.
4847 */
4848 public static final String AIRPLANE_MODE_ON = "airplane_mode_on";
4849
4850 /**
4851 * Constant for use in AIRPLANE_MODE_RADIOS to specify Bluetooth radio.
4852 */
4853 public static final String RADIO_BLUETOOTH = "bluetooth";
4854
4855 /**
4856 * Constant for use in AIRPLANE_MODE_RADIOS to specify Wi-Fi radio.
4857 */
4858 public static final String RADIO_WIFI = "wifi";
4859
4860 /**
4861 * {@hide}
4862 */
4863 public static final String RADIO_WIMAX = "wimax";
4864 /**
4865 * Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio.
4866 */
4867 public static final String RADIO_CELL = "cell";
4868
4869 /**
4870 * Constant for use in AIRPLANE_MODE_RADIOS to specify NFC radio.
4871 */
4872 public static final String RADIO_NFC = "nfc";
4873
4874 /**
4875 * A comma separated list of radios that need to be disabled when airplane mode
4876 * is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are
4877 * included in the comma separated list.
4878 */
4879 public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios";
4880
4881 /**
4882 * A comma separated list of radios that should to be disabled when airplane mode
4883 * is on, but can be manually reenabled by the user. For example, if RADIO_WIFI is
4884 * added to both AIRPLANE_MODE_RADIOS and AIRPLANE_MODE_TOGGLEABLE_RADIOS, then Wifi
4885 * will be turned off when entering airplane mode, but the user will be able to reenable
4886 * Wifi in the Settings app.
4887 *
4888 * {@hide}
4889 */
4890 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios";
4891
4892 /**
4893 * The policy for deciding when Wi-Fi should go to sleep (which will in
4894 * turn switch to using the mobile data as an Internet connection).
4895 * <p>
4896 * Set to one of {@link #WIFI_SLEEP_POLICY_DEFAULT},
4897 * {@link #WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED}, or
4898 * {@link #WIFI_SLEEP_POLICY_NEVER}.
4899 */
4900 public static final String WIFI_SLEEP_POLICY = "wifi_sleep_policy";
4901
4902 /**
4903 * Value for {@link #WIFI_SLEEP_POLICY} to use the default Wi-Fi sleep
4904 * policy, which is to sleep shortly after the turning off
4905 * according to the {@link #STAY_ON_WHILE_PLUGGED_IN} setting.
4906 */
4907 public static final int WIFI_SLEEP_POLICY_DEFAULT = 0;
4908
4909 /**
4910 * Value for {@link #WIFI_SLEEP_POLICY} to use the default policy when
4911 * the device is on battery, and never go to sleep when the device is
4912 * plugged in.
4913 */
4914 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1;
4915
4916 /**
4917 * Value for {@link #WIFI_SLEEP_POLICY} to never go to sleep.
4918 */
4919 public static final int WIFI_SLEEP_POLICY_NEVER = 2;
4920
4921 /**
4922 * Value to specify if the user prefers the date, time and time zone
4923 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
4924 */
4925 public static final String AUTO_TIME = "auto_time";
4926
4927 /**
4928 * Value to specify if the user prefers the time zone
4929 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
4930 */
4931 public static final String AUTO_TIME_ZONE = "auto_time_zone";
4932
4933 /**
4934 * URI for the car dock "in" event sound.
4935 * @hide
4936 */
4937 public static final String CAR_DOCK_SOUND = "car_dock_sound";
4938
4939 /**
4940 * URI for the car dock "out" event sound.
4941 * @hide
4942 */
4943 public static final String CAR_UNDOCK_SOUND = "car_undock_sound";
4944
4945 /**
4946 * URI for the desk dock "in" event sound.
4947 * @hide
4948 */
4949 public static final String DESK_DOCK_SOUND = "desk_dock_sound";
4950
4951 /**
4952 * URI for the desk dock "out" event sound.
4953 * @hide
4954 */
4955 public static final String DESK_UNDOCK_SOUND = "desk_undock_sound";
4956
4957 /**
4958 * Whether to play a sound for dock events.
4959 * @hide
4960 */
4961 public static final String DOCK_SOUNDS_ENABLED = "dock_sounds_enabled";
4962
4963 /**
4964 * URI for the "device locked" (keyguard shown) sound.
4965 * @hide
4966 */
4967 public static final String LOCK_SOUND = "lock_sound";
4968
4969 /**
4970 * URI for the "device unlocked" sound.
4971 * @hide
4972 */
4973 public static final String UNLOCK_SOUND = "unlock_sound";
4974
4975 /**
4976 * URI for the low battery sound file.
4977 * @hide
4978 */
4979 public static final String LOW_BATTERY_SOUND = "low_battery_sound";
4980
4981 /**
4982 * Whether to play a sound for low-battery alerts.
4983 * @hide
4984 */
4985 public static final String POWER_SOUNDS_ENABLED = "power_sounds_enabled";
4986
4987 /**
Jeff Brown84e27562012-12-07 13:56:34 -08004988 * URI for the "wireless charging started" sound.
4989 * @hide
4990 */
4991 public static final String WIRELESS_CHARGING_STARTED_SOUND =
4992 "wireless_charging_started_sound";
4993
4994 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004995 * Whether we keep the device on while the device is plugged in.
4996 * Supported values are:
4997 * <ul>
4998 * <li>{@code 0} to never stay on while plugged in</li>
4999 * <li>{@link BatteryManager#BATTERY_PLUGGED_AC} to stay on for AC charger</li>
5000 * <li>{@link BatteryManager#BATTERY_PLUGGED_USB} to stay on for USB charger</li>
5001 * <li>{@link BatteryManager#BATTERY_PLUGGED_WIRELESS} to stay on for wireless charger</li>
5002 * </ul>
5003 * These values can be OR-ed together.
5004 */
5005 public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in";
5006
5007 /**
Christopher Tate58f41ec2013-01-11 15:40:36 -08005008 * When the user has enable the option to have a "bug report" command
5009 * in the power menu.
5010 * @hide
5011 */
5012 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
5013
5014 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005015 * Whether ADB is enabled.
5016 */
5017 public static final String ADB_ENABLED = "adb_enabled";
5018
5019 /**
5020 * Whether assisted GPS should be enabled or not.
5021 * @hide
5022 */
5023 public static final String ASSISTED_GPS_ENABLED = "assisted_gps_enabled";
5024
5025 /**
5026 * Whether bluetooth is enabled/disabled
5027 * 0=disabled. 1=enabled.
5028 */
5029 public static final String BLUETOOTH_ON = "bluetooth_on";
5030
5031 /**
5032 * CDMA Cell Broadcast SMS
5033 * 0 = CDMA Cell Broadcast SMS disabled
5034 * 1 = CDMA Cell Broadcast SMS enabled
5035 * @hide
5036 */
5037 public static final String CDMA_CELL_BROADCAST_SMS =
5038 "cdma_cell_broadcast_sms";
5039
5040 /**
5041 * The CDMA roaming mode 0 = Home Networks, CDMA default
5042 * 1 = Roaming on Affiliated networks
5043 * 2 = Roaming on any networks
5044 * @hide
5045 */
5046 public static final String CDMA_ROAMING_MODE = "roaming_settings";
5047
5048 /**
5049 * The CDMA subscription mode 0 = RUIM/SIM (default)
5050 * 1 = NV
5051 * @hide
5052 */
5053 public static final String CDMA_SUBSCRIPTION_MODE = "subscription_mode";
5054
5055 /** Inactivity timeout to track mobile data activity.
5056 *
5057 * If set to a positive integer, it indicates the inactivity timeout value in seconds to
5058 * infer the data activity of mobile network. After a period of no activity on mobile
5059 * networks with length specified by the timeout, an {@code ACTION_DATA_ACTIVITY_CHANGE}
5060 * intent is fired to indicate a transition of network status from "active" to "idle". Any
5061 * subsequent activity on mobile networks triggers the firing of {@code
5062 * ACTION_DATA_ACTIVITY_CHANGE} intent indicating transition from "idle" to "active".
5063 *
5064 * Network activity refers to transmitting or receiving data on the network interfaces.
5065 *
5066 * Tracking is disabled if set to zero or negative value.
5067 *
5068 * @hide
5069 */
5070 public static final String DATA_ACTIVITY_TIMEOUT_MOBILE = "data_activity_timeout_mobile";
5071
5072 /** Timeout to tracking Wifi data activity. Same as {@code DATA_ACTIVITY_TIMEOUT_MOBILE}
5073 * but for Wifi network.
5074 * @hide
5075 */
5076 public static final String DATA_ACTIVITY_TIMEOUT_WIFI = "data_activity_timeout_wifi";
5077
5078 /**
5079 * Whether or not data roaming is enabled. (0 = false, 1 = true)
5080 */
5081 public static final String DATA_ROAMING = "data_roaming";
5082
5083 /**
Wink Saville75c1e692013-03-20 17:06:50 -07005084 * The value passed to a Mobile DataConnection via bringUp which defines the
5085 * number of retries to preform when setting up the initial connection. The default
5086 * value defined in DataConnectionTrackerBase#DEFAULT_MDC_INITIAL_RETRY is currently 1.
5087 * @hide
5088 */
5089 public static final String MDC_INITIAL_MAX_RETRY = "mdc_initial_max_retry";
5090
5091 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005092 * Whether user has enabled development settings.
5093 */
5094 public static final String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled";
5095
5096 /**
5097 * Whether the device has been provisioned (0 = false, 1 = true)
5098 */
5099 public static final String DEVICE_PROVISIONED = "device_provisioned";
5100
5101 /**
5102 * The saved value for WindowManagerService.setForcedDisplayDensity().
5103 * One integer in dpi. If unset, then use the real display density.
5104 * @hide
5105 */
5106 public static final String DISPLAY_DENSITY_FORCED = "display_density_forced";
5107
5108 /**
5109 * The saved value for WindowManagerService.setForcedDisplaySize().
5110 * Two integers separated by a comma. If unset, then use the real display size.
5111 * @hide
5112 */
5113 public static final String DISPLAY_SIZE_FORCED = "display_size_forced";
5114
5115 /**
5116 * The maximum size, in bytes, of a download that the download manager will transfer over
5117 * a non-wifi connection.
5118 * @hide
5119 */
5120 public static final String DOWNLOAD_MAX_BYTES_OVER_MOBILE =
5121 "download_manager_max_bytes_over_mobile";
5122
5123 /**
5124 * The recommended maximum size, in bytes, of a download that the download manager should
5125 * transfer over a non-wifi connection. Over this size, the use will be warned, but will
5126 * have the option to start the download over the mobile connection anyway.
5127 * @hide
5128 */
5129 public static final String DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE =
5130 "download_manager_recommended_max_bytes_over_mobile";
5131
5132 /**
Christopher Tateaa036a22014-05-19 16:33:27 -07005133 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
Christopher Tate06efb532012-08-24 15:29:27 -07005134 */
Christopher Tateaa036a22014-05-19 16:33:27 -07005135 @Deprecated
5136 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
Christopher Tate06efb532012-08-24 15:29:27 -07005137
5138 /**
Jinsuk Kimb3d91772014-07-10 12:48:54 +09005139 * Whether HDMI control shall be enabled. If disabled, no CEC/MHL command will be
5140 * sent or processed. (0 = false, 1 = true)
5141 * @hide
5142 */
5143 public static final String HDMI_CONTROL_ENABLED = "hdmi_control_enabled";
5144
5145 /**
5146 * Whether HDMI system audio is enabled. If enabled, TV internal speaker is muted,
5147 * and the output is redirected to AV Receiver connected via
5148 * {@Global#HDMI_SYSTEM_AUDIO_OUTPUT}.
5149 * @hide
5150 */
5151 public static final String HDMI_SYSTEM_AUDIO_ENABLED = "hdmi_system_audio_enabled";
5152
5153 /**
5154 * Output of the audio to be used for system audio mode, as defined in AudioSystem.java.
5155 * <ul>
5156 * <li>DEVICE_OUT_SPDIF</li>
5157 * <li>DEVICE_OUT_HDMI_ARC</li>
5158 * <li>DEVICE_OUT_LINE</li>
5159 * </ul>
5160 * @hide
5161 */
5162 public static final String HDMI_SYSTEM_AUDIO_OUTPUT = "hdmi_system_audio_output";
5163
5164 /**
5165 * Whether TV will automatically turn on upon reception of the CEC command
5166 * &lt;Text View On&gt; or &lt;Image View On&gt;. (0 = false, 1 = true)
5167 * @hide
5168 */
5169 public static final String HDMI_CONTROL_AUTO_WAKEUP_ENABLED =
5170 "hdmi_control_auto_wakeup_enabled";
5171
5172 /**
5173 * Whether TV will also turn off other CEC devices when it goes to standby mode.
5174 * (0 = false, 1 = true)
5175 * @hide
5176 */
5177 public static final String HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED =
5178 "hdmi_control_auto_device_off_enabled";
5179
5180 /**
5181 * Whether TV will switch to MHL port when a mobile device is plugged in.
5182 * (0 = false, 1 = true)
5183 * @hide
5184 */
5185 public static final String MHL_INPUT_SWITCHING_ENABLED = "mhl_input_switching_enabled";
5186
5187 /**
5188 * Whether TV will charge the mobile device connected at MHL port. (0 = false, 1 = true)
5189 * @hide
5190 */
5191 public static final String MHL_POWER_CHARGE_ENABLED = "mhl_power_charge_enabled";
5192
5193 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005194 * Whether mobile data connections are allowed by the user. See
5195 * ConnectivityManager for more info.
5196 * @hide
5197 */
5198 public static final String MOBILE_DATA = "mobile_data";
5199
5200 /** {@hide} */
5201 public static final String NETSTATS_ENABLED = "netstats_enabled";
5202 /** {@hide} */
5203 public static final String NETSTATS_POLL_INTERVAL = "netstats_poll_interval";
5204 /** {@hide} */
5205 public static final String NETSTATS_TIME_CACHE_MAX_AGE = "netstats_time_cache_max_age";
5206 /** {@hide} */
5207 public static final String NETSTATS_GLOBAL_ALERT_BYTES = "netstats_global_alert_bytes";
5208 /** {@hide} */
5209 public static final String NETSTATS_SAMPLE_ENABLED = "netstats_sample_enabled";
5210 /** {@hide} */
5211 public static final String NETSTATS_REPORT_XT_OVER_DEV = "netstats_report_xt_over_dev";
5212
5213 /** {@hide} */
5214 public static final String NETSTATS_DEV_BUCKET_DURATION = "netstats_dev_bucket_duration";
5215 /** {@hide} */
5216 public static final String NETSTATS_DEV_PERSIST_BYTES = "netstats_dev_persist_bytes";
5217 /** {@hide} */
5218 public static final String NETSTATS_DEV_ROTATE_AGE = "netstats_dev_rotate_age";
5219 /** {@hide} */
5220 public static final String NETSTATS_DEV_DELETE_AGE = "netstats_dev_delete_age";
5221
5222 /** {@hide} */
5223 public static final String NETSTATS_UID_BUCKET_DURATION = "netstats_uid_bucket_duration";
5224 /** {@hide} */
5225 public static final String NETSTATS_UID_PERSIST_BYTES = "netstats_uid_persist_bytes";
5226 /** {@hide} */
5227 public static final String NETSTATS_UID_ROTATE_AGE = "netstats_uid_rotate_age";
5228 /** {@hide} */
5229 public static final String NETSTATS_UID_DELETE_AGE = "netstats_uid_delete_age";
5230
5231 /** {@hide} */
5232 public static final String NETSTATS_UID_TAG_BUCKET_DURATION = "netstats_uid_tag_bucket_duration";
5233 /** {@hide} */
5234 public static final String NETSTATS_UID_TAG_PERSIST_BYTES = "netstats_uid_tag_persist_bytes";
5235 /** {@hide} */
5236 public static final String NETSTATS_UID_TAG_ROTATE_AGE = "netstats_uid_tag_rotate_age";
5237 /** {@hide} */
5238 public static final String NETSTATS_UID_TAG_DELETE_AGE = "netstats_uid_tag_delete_age";
5239
5240 /**
5241 * User preference for which network(s) should be used. Only the
5242 * connectivity service should touch this.
5243 */
5244 public static final String NETWORK_PREFERENCE = "network_preference";
5245
5246 /**
Jeff Davidsondd6fd1e2014-04-14 15:14:30 -07005247 * Which package name to use for network scoring. If null, or if the package is not a valid
5248 * scorer app, external network scores will neither be requested nor accepted.
5249 * @hide
5250 */
5251 public static final String NETWORK_SCORER_APP = "network_scorer_app";
5252
5253 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005254 * If the NITZ_UPDATE_DIFF time is exceeded then an automatic adjustment
5255 * to SystemClock will be allowed even if NITZ_UPDATE_SPACING has not been
5256 * exceeded.
5257 * @hide
5258 */
5259 public static final String NITZ_UPDATE_DIFF = "nitz_update_diff";
5260
5261 /**
5262 * The length of time in milli-seconds that automatic small adjustments to
5263 * SystemClock are ignored if NITZ_UPDATE_DIFF is not exceeded.
5264 * @hide
5265 */
5266 public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing";
5267
5268 /** Preferred NTP server. {@hide} */
5269 public static final String NTP_SERVER = "ntp_server";
5270 /** Timeout in milliseconds to wait for NTP server. {@hide} */
5271 public static final String NTP_TIMEOUT = "ntp_timeout";
5272
5273 /**
rich cannings4d8fc792012-09-07 14:43:43 -07005274 * Whether the package manager should send package verification broadcasts for verifiers to
5275 * review apps prior to installation.
5276 * 1 = request apps to be verified prior to installation, if a verifier exists.
5277 * 0 = do not verify apps before installation
rich cannings4e5753f2012-09-19 16:03:56 -07005278 * @hide
rich cannings4d8fc792012-09-07 14:43:43 -07005279 */
5280 public static final String PACKAGE_VERIFIER_ENABLE = "package_verifier_enable";
5281
5282 /** Timeout for package verification.
rich cannings4e5753f2012-09-19 16:03:56 -07005283 * @hide */
rich cannings4d8fc792012-09-07 14:43:43 -07005284 public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout";
5285
5286 /** Default response code for package verification.
rich cannings4e5753f2012-09-19 16:03:56 -07005287 * @hide */
rich cannings4d8fc792012-09-07 14:43:43 -07005288 public static final String PACKAGE_VERIFIER_DEFAULT_RESPONSE = "verifier_default_response";
5289
rich cannings4e5753f2012-09-19 16:03:56 -07005290 /**
5291 * Show package verification setting in the Settings app.
rich canningse6686b32012-09-16 14:02:20 -07005292 * 1 = show (default)
5293 * 0 = hide
rich cannings4e5753f2012-09-19 16:03:56 -07005294 * @hide
rich canningse6686b32012-09-16 14:02:20 -07005295 */
5296 public static final String PACKAGE_VERIFIER_SETTING_VISIBLE = "verifier_setting_visible";
5297
rich cannings4d8fc792012-09-07 14:43:43 -07005298 /**
rich cannings4e5753f2012-09-19 16:03:56 -07005299 * Run package verificaiton on apps installed through ADB/ADT/USB
5300 * 1 = perform package verification on ADB installs (default)
5301 * 0 = bypass package verification on ADB installs
5302 * @hide
5303 */
5304 public static final String PACKAGE_VERIFIER_INCLUDE_ADB = "verifier_verify_adb_installs";
5305
5306 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005307 * The interval in milliseconds at which to check packet counts on the
5308 * mobile data interface when screen is on, to detect possible data
5309 * connection problems.
5310 * @hide
5311 */
5312 public static final String PDP_WATCHDOG_POLL_INTERVAL_MS =
5313 "pdp_watchdog_poll_interval_ms";
5314
5315 /**
5316 * The interval in milliseconds at which to check packet counts on the
5317 * mobile data interface when screen is off, to detect possible data
5318 * connection problems.
5319 * @hide
5320 */
5321 public static final String PDP_WATCHDOG_LONG_POLL_INTERVAL_MS =
5322 "pdp_watchdog_long_poll_interval_ms";
5323
5324 /**
5325 * The interval in milliseconds at which to check packet counts on the
5326 * mobile data interface after {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT}
5327 * outgoing packets has been reached without incoming packets.
5328 * @hide
5329 */
5330 public static final String PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS =
5331 "pdp_watchdog_error_poll_interval_ms";
5332
5333 /**
5334 * The number of outgoing packets sent without seeing an incoming packet
5335 * that triggers a countdown (of {@link #PDP_WATCHDOG_ERROR_POLL_COUNT}
5336 * device is logged to the event log
5337 * @hide
5338 */
5339 public static final String PDP_WATCHDOG_TRIGGER_PACKET_COUNT =
5340 "pdp_watchdog_trigger_packet_count";
5341
5342 /**
5343 * The number of polls to perform (at {@link #PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS})
5344 * after hitting {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} before
5345 * attempting data connection recovery.
5346 * @hide
5347 */
5348 public static final String PDP_WATCHDOG_ERROR_POLL_COUNT =
5349 "pdp_watchdog_error_poll_count";
5350
5351 /**
5352 * The number of failed PDP reset attempts before moving to something more
5353 * drastic: re-registering to the network.
5354 * @hide
5355 */
5356 public static final String PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT =
5357 "pdp_watchdog_max_pdp_reset_fail_count";
5358
5359 /**
5360 * A positive value indicates how often the SamplingProfiler
5361 * should take snapshots. Zero value means SamplingProfiler
5362 * is disabled.
5363 *
5364 * @hide
5365 */
5366 public static final String SAMPLING_PROFILER_MS = "sampling_profiler_ms";
5367
5368 /**
5369 * URL to open browser on to allow user to manage a prepay account
5370 * @hide
5371 */
5372 public static final String SETUP_PREPAID_DATA_SERVICE_URL =
5373 "setup_prepaid_data_service_url";
5374
5375 /**
5376 * URL to attempt a GET on to see if this is a prepay device
5377 * @hide
5378 */
5379 public static final String SETUP_PREPAID_DETECTION_TARGET_URL =
5380 "setup_prepaid_detection_target_url";
5381
5382 /**
5383 * Host to check for a redirect to after an attempt to GET
5384 * SETUP_PREPAID_DETECTION_TARGET_URL. (If we redirected there,
5385 * this is a prepaid device with zero balance.)
5386 * @hide
5387 */
5388 public static final String SETUP_PREPAID_DETECTION_REDIR_HOST =
5389 "setup_prepaid_detection_redir_host";
5390
5391 /**
Jake Hamby76a61422012-09-06 17:40:21 -07005392 * The interval in milliseconds at which to check the number of SMS sent out without asking
5393 * for use permit, to limit the un-authorized SMS usage.
5394 *
5395 * @hide
5396 */
5397 public static final String SMS_OUTGOING_CHECK_INTERVAL_MS =
5398 "sms_outgoing_check_interval_ms";
5399
5400 /**
5401 * The number of outgoing SMS sent without asking for user permit (of {@link
5402 * #SMS_OUTGOING_CHECK_INTERVAL_MS}
5403 *
5404 * @hide
5405 */
5406 public static final String SMS_OUTGOING_CHECK_MAX_COUNT =
5407 "sms_outgoing_check_max_count";
5408
5409 /**
5410 * Used to disable SMS short code confirmation - defaults to true.
Robert Greenwalt026efcc2012-09-24 10:03:21 -07005411 * True indcates we will do the check, etc. Set to false to disable.
Jake Hamby76a61422012-09-06 17:40:21 -07005412 * @see com.android.internal.telephony.SmsUsageMonitor
5413 * @hide
5414 */
5415 public static final String SMS_SHORT_CODE_CONFIRMATION = "sms_short_code_confirmation";
5416
Robert Greenwalt026efcc2012-09-24 10:03:21 -07005417 /**
5418 * Used to select which country we use to determine premium sms codes.
5419 * One of com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_SIM,
5420 * com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_NETWORK,
5421 * or com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_BOTH.
5422 * @hide
5423 */
5424 public static final String SMS_SHORT_CODE_RULE = "sms_short_code_rule";
5425
Jake Hamby76a61422012-09-06 17:40:21 -07005426 /**
JP Abgrall32d1ac4d2014-02-21 12:05:20 -08005427 * Used to select TCP's default initial receiver window size in segments - defaults to a build config value
5428 * @hide
5429 */
5430 public static final String TCP_DEFAULT_INIT_RWND = "tcp_default_init_rwnd";
5431
5432 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005433 * Used to disable Tethering on a device - defaults to true
5434 * @hide
5435 */
5436 public static final String TETHER_SUPPORTED = "tether_supported";
5437
5438 /**
5439 * Used to require DUN APN on the device or not - defaults to a build config value
5440 * which defaults to false
5441 * @hide
5442 */
5443 public static final String TETHER_DUN_REQUIRED = "tether_dun_required";
5444
5445 /**
5446 * Used to hold a gservices-provisioned apn value for DUN. If set, or the
5447 * corresponding build config values are set it will override the APN DB
5448 * values.
5449 * Consists of a comma seperated list of strings:
5450 * "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type"
5451 * note that empty fields can be ommitted: "name,apn,,,,,,,,,310,260,,DUN"
5452 * @hide
5453 */
5454 public static final String TETHER_DUN_APN = "tether_dun_apn";
5455
5456 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005457 * USB Mass Storage Enabled
5458 */
5459 public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled";
5460
5461 /**
5462 * If this setting is set (to anything), then all references
5463 * to Gmail on the device must change to Google Mail.
5464 */
5465 public static final String USE_GOOGLE_MAIL = "use_google_mail";
5466
Selim Gurun178201f2014-05-16 11:38:44 -07005467 /**
5468 * Webview Data reduction proxy key.
5469 * @hide
5470 */
5471 public static final String WEBVIEW_DATA_REDUCTION_PROXY_KEY =
5472 "webview_data_reduction_proxy_key";
5473
Christopher Tate06efb532012-08-24 15:29:27 -07005474 /**
Jeff Brown89d55462012-09-19 11:33:42 -07005475 * Whether Wifi display is enabled/disabled
5476 * 0=disabled. 1=enabled.
5477 * @hide
5478 */
5479 public static final String WIFI_DISPLAY_ON = "wifi_display_on";
5480
5481 /**
Chong Zhang1f3ecaa2013-05-03 15:55:36 -07005482 * Whether Wifi display certification mode is enabled/disabled
5483 * 0=disabled. 1=enabled.
5484 * @hide
5485 */
5486 public static final String WIFI_DISPLAY_CERTIFICATION_ON =
5487 "wifi_display_certification_on";
5488
5489 /**
Chong Zhange38af812013-08-29 17:25:17 -07005490 * WPS Configuration method used by Wifi display, this setting only
5491 * takes effect when WIFI_DISPLAY_CERTIFICATION_ON is 1 (enabled).
5492 *
5493 * Possible values are:
5494 *
5495 * WpsInfo.INVALID: use default WPS method chosen by framework
5496 * WpsInfo.PBC : use Push button
5497 * WpsInfo.KEYPAD : use Keypad
5498 * WpsInfo.DISPLAY: use Display
5499 * @hide
5500 */
5501 public static final String WIFI_DISPLAY_WPS_CONFIG =
5502 "wifi_display_wps_config";
5503
5504 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005505 * Whether to notify the user of open networks.
5506 * <p>
5507 * If not connected and the scan results have an open network, we will
5508 * put this notification up. If we attempt to connect to a network or
5509 * the open network(s) disappear, we remove the notification. When we
5510 * show the notification, we will not show it again for
5511 * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time.
5512 */
5513 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
5514 "wifi_networks_available_notification_on";
5515 /**
5516 * {@hide}
5517 */
5518 public static final String WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON =
5519 "wimax_networks_available_notification_on";
5520
5521 /**
5522 * Delay (in seconds) before repeating the Wi-Fi networks available notification.
5523 * Connecting to a network will reset the timer.
5524 */
5525 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
5526 "wifi_networks_available_repeat_delay";
5527
5528 /**
Robert Greenwalt3ea0c992013-10-03 21:13:49 +00005529 * 802.11 country code in ISO 3166 format
5530 * @hide
5531 */
5532 public static final String WIFI_COUNTRY_CODE = "wifi_country_code";
5533
5534 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005535 * The interval in milliseconds to issue wake up scans when wifi needs
5536 * to connect. This is necessary to connect to an access point when
5537 * device is on the move and the screen is off.
5538 * @hide
5539 */
5540 public static final String WIFI_FRAMEWORK_SCAN_INTERVAL_MS =
5541 "wifi_framework_scan_interval_ms";
5542
5543 /**
5544 * The interval in milliseconds after which Wi-Fi is considered idle.
5545 * When idle, it is possible for the device to be switched from Wi-Fi to
5546 * the mobile data network.
5547 * @hide
5548 */
5549 public static final String WIFI_IDLE_MS = "wifi_idle_ms";
5550
5551 /**
5552 * When the number of open networks exceeds this number, the
5553 * least-recently-used excess networks will be removed.
5554 */
5555 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept";
5556
5557 /**
5558 * Whether the Wi-Fi should be on. Only the Wi-Fi service should touch this.
5559 */
5560 public static final String WIFI_ON = "wifi_on";
5561
5562 /**
Irfan Sheriff11aefad2013-03-06 07:57:41 -08005563 * Setting to allow scans to be enabled even wifi is turned off for connectivity.
5564 * @hide
5565 */
5566 public static final String WIFI_SCAN_ALWAYS_AVAILABLE =
5567 "wifi_scan_always_enabled";
5568
5569 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005570 * Used to save the Wifi_ON state prior to tethering.
5571 * This state will be checked to restore Wifi after
5572 * the user turns off tethering.
5573 *
5574 * @hide
5575 */
5576 public static final String WIFI_SAVED_STATE = "wifi_saved_state";
5577
5578 /**
5579 * The interval in milliseconds to scan as used by the wifi supplicant
5580 * @hide
5581 */
5582 public static final String WIFI_SUPPLICANT_SCAN_INTERVAL_MS =
5583 "wifi_supplicant_scan_interval_ms";
5584
vandwalle7c3606c2014-03-31 19:12:07 -07005585 /**
5586 * whether frameworks handles wifi auto-join
5587 * @hide
5588 */
5589 public static final String WIFI_ENHANCED_AUTO_JOIN =
5590 "wifi_enhanced_auto_join";
5591
5592 /**
5593 * whether settings show RSSI
5594 * @hide
5595 */
5596 public static final String WIFI_NETWORK_SHOW_RSSI =
5597 "wifi_network_show_rssi";
5598
5599 /**
Irfan Sheriff3809f502012-09-17 16:04:57 -07005600 * The interval in milliseconds to scan at supplicant when p2p is connected
5601 * @hide
5602 */
5603 public static final String WIFI_SCAN_INTERVAL_WHEN_P2P_CONNECTED_MS =
5604 "wifi_scan_interval_p2p_connected_ms";
5605
5606 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005607 * Whether the Wi-Fi watchdog is enabled.
5608 */
5609 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
5610
5611 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005612 * Setting to turn off poor network avoidance on Wi-Fi. Feature is enabled by default and
5613 * the setting needs to be set to 0 to disable it.
5614 * @hide
5615 */
5616 public static final String WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED =
5617 "wifi_watchdog_poor_network_test_enabled";
5618
5619 /**
5620 * Setting to turn on suspend optimizations at screen off on Wi-Fi. Enabled by default and
5621 * needs to be set to 0 to disable it.
5622 * @hide
5623 */
5624 public static final String WIFI_SUSPEND_OPTIMIZATIONS_ENABLED =
5625 "wifi_suspend_optimizations_enabled";
5626
5627 /**
5628 * The maximum number of times we will retry a connection to an access
5629 * point for which we have failed in acquiring an IP address from DHCP.
5630 * A value of N means that we will make N+1 connection attempts in all.
5631 */
5632 public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count";
5633
5634 /**
5635 * Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile
5636 * data connectivity to be established after a disconnect from Wi-Fi.
5637 */
5638 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
5639 "wifi_mobile_data_transition_wakelock_timeout_ms";
5640
5641 /**
5642 * The operational wifi frequency band
5643 * Set to one of {@link WifiManager#WIFI_FREQUENCY_BAND_AUTO},
5644 * {@link WifiManager#WIFI_FREQUENCY_BAND_5GHZ} or
5645 * {@link WifiManager#WIFI_FREQUENCY_BAND_2GHZ}
5646 *
5647 * @hide
5648 */
5649 public static final String WIFI_FREQUENCY_BAND = "wifi_frequency_band";
5650
5651 /**
5652 * The Wi-Fi peer-to-peer device name
5653 * @hide
5654 */
5655 public static final String WIFI_P2P_DEVICE_NAME = "wifi_p2p_device_name";
5656
5657 /**
Robert Greenwaltc12783a2013-05-16 12:48:20 -07005658 * The min time between wifi disable and wifi enable
5659 * @hide
5660 */
5661 public static final String WIFI_REENABLE_DELAY_MS = "wifi_reenable_delay";
5662
5663 /**
Christopher Tatec868b642012-09-12 17:41:04 -07005664 * The number of milliseconds to delay when checking for data stalls during
5665 * non-aggressive detection. (screen is turned off.)
5666 * @hide
5667 */
5668 public static final String DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS =
5669 "data_stall_alarm_non_aggressive_delay_in_ms";
5670
5671 /**
5672 * The number of milliseconds to delay when checking for data stalls during
5673 * aggressive detection. (screen on or suspected data stall)
5674 * @hide
5675 */
5676 public static final String DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS =
5677 "data_stall_alarm_aggressive_delay_in_ms";
5678
5679 /**
Wink Savillece1e3792013-09-03 16:41:44 -07005680 * The number of milliseconds to allow the provisioning apn to remain active
5681 * @hide
5682 */
5683 public static final String PROVISIONING_APN_ALARM_DELAY_IN_MS =
5684 "provisioning_apn_alarm_delay_in_ms";
5685
5686 /**
Christopher Tatec868b642012-09-12 17:41:04 -07005687 * The interval in milliseconds at which to check gprs registration
5688 * after the first registration mismatch of gprs and voice service,
5689 * to detect possible data network registration problems.
5690 *
5691 * @hide
5692 */
5693 public static final String GPRS_REGISTER_CHECK_PERIOD_MS =
5694 "gprs_register_check_period_ms";
5695
5696 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005697 * Nonzero causes Log.wtf() to crash.
5698 * @hide
5699 */
5700 public static final String WTF_IS_FATAL = "wtf_is_fatal";
5701
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07005702 /**
5703 * Ringer mode. This is used internally, changing this value will not
5704 * change the ringer mode. See AudioManager.
5705 */
5706 public static final String MODE_RINGER = "mode_ringer";
Christopher Tate06efb532012-08-24 15:29:27 -07005707
Jeff Brownd4935962012-09-25 13:27:20 -07005708 /**
5709 * Overlay display devices setting.
5710 * The associated value is a specially formatted string that describes the
5711 * size and density of simulated secondary display devices.
5712 * <p>
5713 * Format: {width}x{height}/{dpi};...
5714 * </p><p>
5715 * Example:
5716 * <ul>
5717 * <li><code>1280x720/213</code>: make one overlay that is 1280x720 at 213dpi.</li>
5718 * <li><code>1920x1080/320;1280x720/213</code>: make two overlays, the first
5719 * at 1080p and the second at 720p.</li>
5720 * <li>If the value is empty, then no overlay display devices are created.</li>
5721 * </ul></p>
5722 *
5723 * @hide
5724 */
5725 public static final String OVERLAY_DISPLAY_DEVICES = "overlay_display_devices";
Christopher Tate06efb532012-08-24 15:29:27 -07005726
Jeff Sharkey625239a2012-09-26 22:03:49 -07005727 /**
5728 * Threshold values for the duration and level of a discharge cycle,
5729 * under which we log discharge cycle info.
5730 *
5731 * @hide
5732 */
5733 public static final String
5734 BATTERY_DISCHARGE_DURATION_THRESHOLD = "battery_discharge_duration_threshold";
5735
5736 /** @hide */
5737 public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold";
5738
5739 /**
5740 * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR
5741 * intents on application crashes and ANRs. If this is disabled, the
5742 * crash/ANR dialog will never display the "Report" button.
5743 * <p>
5744 * Type: int (0 = disallow, 1 = allow)
5745 *
5746 * @hide
5747 */
5748 public static final String SEND_ACTION_APP_ERROR = "send_action_app_error";
5749
5750 /**
5751 * Maximum age of entries kept by {@link DropBoxManager}.
5752 *
5753 * @hide
5754 */
5755 public static final String DROPBOX_AGE_SECONDS = "dropbox_age_seconds";
5756
5757 /**
5758 * Maximum number of entry files which {@link DropBoxManager} will keep
5759 * around.
5760 *
5761 * @hide
5762 */
5763 public static final String DROPBOX_MAX_FILES = "dropbox_max_files";
5764
5765 /**
5766 * Maximum amount of disk space used by {@link DropBoxManager} no matter
5767 * what.
5768 *
5769 * @hide
5770 */
5771 public static final String DROPBOX_QUOTA_KB = "dropbox_quota_kb";
5772
5773 /**
5774 * Percent of free disk (excluding reserve) which {@link DropBoxManager}
5775 * will use.
5776 *
5777 * @hide
5778 */
5779 public static final String DROPBOX_QUOTA_PERCENT = "dropbox_quota_percent";
5780
5781 /**
5782 * Percent of total disk which {@link DropBoxManager} will never dip
5783 * into.
5784 *
5785 * @hide
5786 */
5787 public static final String DROPBOX_RESERVE_PERCENT = "dropbox_reserve_percent";
5788
5789 /**
5790 * Prefix for per-tag dropbox disable/enable settings.
5791 *
5792 * @hide
5793 */
5794 public static final String DROPBOX_TAG_PREFIX = "dropbox:";
5795
5796 /**
5797 * Lines of logcat to include with system crash/ANR/etc. reports, as a
5798 * prefix of the dropbox tag of the report type. For example,
5799 * "logcat_for_system_server_anr" controls the lines of logcat captured
5800 * with system server ANR reports. 0 to disable.
5801 *
5802 * @hide
5803 */
5804 public static final String ERROR_LOGCAT_PREFIX = "logcat_for_";
5805
5806 /**
5807 * The interval in minutes after which the amount of free storage left
5808 * on the device is logged to the event log
5809 *
5810 * @hide
5811 */
5812 public static final String SYS_FREE_STORAGE_LOG_INTERVAL = "sys_free_storage_log_interval";
5813
5814 /**
5815 * Threshold for the amount of change in disk free space required to
5816 * report the amount of free space. Used to prevent spamming the logs
5817 * when the disk free space isn't changing frequently.
5818 *
5819 * @hide
5820 */
5821 public static final String
5822 DISK_FREE_CHANGE_REPORTING_THRESHOLD = "disk_free_change_reporting_threshold";
5823
5824 /**
5825 * Minimum percentage of free storage on the device that is used to
5826 * determine if the device is running low on storage. The default is 10.
5827 * <p>
5828 * Say this value is set to 10, the device is considered running low on
5829 * storage if 90% or more of the device storage is filled up.
5830 *
5831 * @hide
5832 */
5833 public static final String
5834 SYS_STORAGE_THRESHOLD_PERCENTAGE = "sys_storage_threshold_percentage";
5835
5836 /**
5837 * Maximum byte size of the low storage threshold. This is to ensure
5838 * that {@link #SYS_STORAGE_THRESHOLD_PERCENTAGE} does not result in an
5839 * overly large threshold for large storage devices. Currently this must
5840 * be less than 2GB. This default is 500MB.
5841 *
5842 * @hide
5843 */
5844 public static final String
5845 SYS_STORAGE_THRESHOLD_MAX_BYTES = "sys_storage_threshold_max_bytes";
5846
5847 /**
5848 * Minimum bytes of free storage on the device before the data partition
5849 * is considered full. By default, 1 MB is reserved to avoid system-wide
5850 * SQLite disk full exceptions.
5851 *
5852 * @hide
5853 */
5854 public static final String
5855 SYS_STORAGE_FULL_THRESHOLD_BYTES = "sys_storage_full_threshold_bytes";
5856
5857 /**
5858 * The maximum reconnect delay for short network outages or when the
5859 * network is suspended due to phone use.
5860 *
5861 * @hide
5862 */
5863 public static final String
5864 SYNC_MAX_RETRY_DELAY_IN_SECONDS = "sync_max_retry_delay_in_seconds";
5865
5866 /**
5867 * The number of milliseconds to delay before sending out
5868 * {@link ConnectivityManager#CONNECTIVITY_ACTION} broadcasts.
5869 *
5870 * @hide
5871 */
5872 public static final String CONNECTIVITY_CHANGE_DELAY = "connectivity_change_delay";
5873
Vinit Deshapnde1f12cb52013-08-21 13:09:01 -07005874
5875 /**
5876 * Network sampling interval, in seconds. We'll generate link information
5877 * about bytes/packets sent and error rates based on data sampled in this interval
5878 *
5879 * @hide
5880 */
5881
5882 public static final String CONNECTIVITY_SAMPLING_INTERVAL_IN_SECONDS =
5883 "connectivity_sampling_interval_in_seconds";
5884
Jeff Sharkey625239a2012-09-26 22:03:49 -07005885 /**
Jason Monk602b2322013-07-03 17:04:33 -04005886 * The series of successively longer delays used in retrying to download PAC file.
5887 * Last delay is used between successful PAC downloads.
5888 *
5889 * @hide
5890 */
5891 public static final String PAC_CHANGE_DELAY = "pac_change_delay";
5892
5893 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07005894 * Setting to turn off captive portal detection. Feature is enabled by
5895 * default and the setting needs to be set to 0 to disable it.
5896 *
5897 * @hide
5898 */
5899 public static final String
5900 CAPTIVE_PORTAL_DETECTION_ENABLED = "captive_portal_detection_enabled";
5901
5902 /**
5903 * The server used for captive portal detection upon a new conection. A
5904 * 204 response code from the server is used for validation.
5905 *
5906 * @hide
5907 */
5908 public static final String CAPTIVE_PORTAL_SERVER = "captive_portal_server";
5909
5910 /**
5911 * Whether network service discovery is enabled.
5912 *
5913 * @hide
5914 */
5915 public static final String NSD_ON = "nsd_on";
5916
5917 /**
5918 * Let user pick default install location.
5919 *
5920 * @hide
5921 */
5922 public static final String SET_INSTALL_LOCATION = "set_install_location";
5923
5924 /**
5925 * Default install location value.
5926 * 0 = auto, let system decide
5927 * 1 = internal
5928 * 2 = sdcard
5929 * @hide
5930 */
5931 public static final String DEFAULT_INSTALL_LOCATION = "default_install_location";
5932
5933 /**
5934 * ms during which to consume extra events related to Inet connection
5935 * condition after a transtion to fully-connected
5936 *
5937 * @hide
5938 */
5939 public static final String
5940 INET_CONDITION_DEBOUNCE_UP_DELAY = "inet_condition_debounce_up_delay";
5941
5942 /**
5943 * ms during which to consume extra events related to Inet connection
5944 * condtion after a transtion to partly-connected
5945 *
5946 * @hide
5947 */
5948 public static final String
5949 INET_CONDITION_DEBOUNCE_DOWN_DELAY = "inet_condition_debounce_down_delay";
5950
5951 /** {@hide} */
5952 public static final String
5953 READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT = "read_external_storage_enforced_default";
5954
5955 /**
5956 * Host name and port for global http proxy. Uses ':' seperator for
5957 * between host and port.
5958 */
5959 public static final String HTTP_PROXY = "http_proxy";
5960
5961 /**
5962 * Host name for global http proxy. Set via ConnectivityManager.
5963 *
5964 * @hide
5965 */
5966 public static final String GLOBAL_HTTP_PROXY_HOST = "global_http_proxy_host";
5967
5968 /**
5969 * Integer host port for global http proxy. Set via ConnectivityManager.
5970 *
5971 * @hide
5972 */
5973 public static final String GLOBAL_HTTP_PROXY_PORT = "global_http_proxy_port";
5974
5975 /**
5976 * Exclusion list for global proxy. This string contains a list of
5977 * comma-separated domains where the global proxy does not apply.
5978 * Domains should be listed in a comma- separated list. Example of
5979 * acceptable formats: ".domain1.com,my.domain2.com" Use
5980 * ConnectivityManager to set/get.
5981 *
5982 * @hide
5983 */
5984 public static final String
5985 GLOBAL_HTTP_PROXY_EXCLUSION_LIST = "global_http_proxy_exclusion_list";
5986
5987 /**
Jason Monk602b2322013-07-03 17:04:33 -04005988 * The location PAC File for the proxy.
5989 * @hide
5990 */
5991 public static final String
5992 GLOBAL_HTTP_PROXY_PAC = "global_proxy_pac_url";
5993
5994 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07005995 * Enables the UI setting to allow the user to specify the global HTTP
5996 * proxy and associated exclusion list.
5997 *
5998 * @hide
5999 */
6000 public static final String SET_GLOBAL_HTTP_PROXY = "set_global_http_proxy";
6001
6002 /**
6003 * Setting for default DNS in case nobody suggests one
6004 *
6005 * @hide
6006 */
6007 public static final String DEFAULT_DNS_SERVER = "default_dns_server";
6008
Jeff Sharkey0ac10282012-10-01 12:50:22 -07006009 /** {@hide} */
6010 public static final String
6011 BLUETOOTH_HEADSET_PRIORITY_PREFIX = "bluetooth_headset_priority_";
6012 /** {@hide} */
6013 public static final String
6014 BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX = "bluetooth_a2dp_sink_priority_";
6015 /** {@hide} */
6016 public static final String
6017 BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX = "bluetooth_input_device_priority_";
Kim Schulz0d376052013-08-22 11:18:02 +02006018 /** {@hide} */
6019 public static final String
6020 BLUETOOTH_MAP_PRIORITY_PREFIX = "bluetooth_map_priority_";
Jeff Sharkey0ac10282012-10-01 12:50:22 -07006021
6022 /**
6023 * Get the key that retrieves a bluetooth headset's priority.
6024 * @hide
6025 */
6026 public static final String getBluetoothHeadsetPriorityKey(String address) {
Elliott Hughescb64d432013-08-02 10:00:44 -07006027 return BLUETOOTH_HEADSET_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
Jeff Sharkey0ac10282012-10-01 12:50:22 -07006028 }
6029
6030 /**
6031 * Get the key that retrieves a bluetooth a2dp sink's priority.
6032 * @hide
6033 */
6034 public static final String getBluetoothA2dpSinkPriorityKey(String address) {
Elliott Hughescb64d432013-08-02 10:00:44 -07006035 return BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
Jeff Sharkey0ac10282012-10-01 12:50:22 -07006036 }
6037
6038 /**
6039 * Get the key that retrieves a bluetooth Input Device's priority.
6040 * @hide
6041 */
6042 public static final String getBluetoothInputDevicePriorityKey(String address) {
Elliott Hughescb64d432013-08-02 10:00:44 -07006043 return BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
Jeff Sharkey0ac10282012-10-01 12:50:22 -07006044 }
6045
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07006046 /**
Kim Schulz0d376052013-08-22 11:18:02 +02006047 * Get the key that retrieves a bluetooth map priority.
6048 * @hide
6049 */
6050 public static final String getBluetoothMapPriorityKey(String address) {
6051 return BLUETOOTH_MAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
6052 }
6053 /**
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07006054 * Scaling factor for normal window animations. Setting to 0 will
6055 * disable window animations.
6056 */
6057 public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale";
6058
6059 /**
6060 * Scaling factor for activity transition animations. Setting to 0 will
6061 * disable window animations.
6062 */
6063 public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale";
6064
6065 /**
6066 * Scaling factor for Animator-based animations. This affects both the
6067 * start delay and duration of all such animations. Setting to 0 will
6068 * cause animations to end immediately. The default value is 1.
6069 */
6070 public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale";
6071
6072 /**
6073 * Scaling factor for normal window animations. Setting to 0 will
6074 * disable window animations.
6075 *
6076 * @hide
6077 */
6078 public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations";
6079
6080 /**
6081 * If 0, the compatibility mode is off for all applications.
6082 * If 1, older applications run under compatibility mode.
6083 * TODO: remove this settings before code freeze (bug/1907571)
6084 * @hide
6085 */
6086 public static final String COMPATIBILITY_MODE = "compatibility_mode";
6087
6088 /**
6089 * CDMA only settings
6090 * Emergency Tone 0 = Off
6091 * 1 = Alert
6092 * 2 = Vibrate
6093 * @hide
6094 */
6095 public static final String EMERGENCY_TONE = "emergency_tone";
6096
6097 /**
6098 * CDMA only settings
6099 * Whether the auto retry is enabled. The value is
6100 * boolean (1 or 0).
6101 * @hide
6102 */
6103 public static final String CALL_AUTO_RETRY = "call_auto_retry";
6104
6105 /**
6106 * The preferred network mode 7 = Global
6107 * 6 = EvDo only
6108 * 5 = CDMA w/o EvDo
6109 * 4 = CDMA / EvDo auto
6110 * 3 = GSM / WCDMA auto
6111 * 2 = WCDMA only
6112 * 1 = GSM only
6113 * 0 = GSM / WCDMA preferred
6114 * @hide
6115 */
6116 public static final String PREFERRED_NETWORK_MODE =
6117 "preferred_network_mode";
6118
6119 /**
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07006120 * Name of an application package to be debugged.
6121 */
6122 public static final String DEBUG_APP = "debug_app";
6123
6124 /**
6125 * If 1, when launching DEBUG_APP it will wait for the debugger before
6126 * starting user code. If 0, it will run normally.
6127 */
6128 public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger";
6129
6130 /**
6131 * Control whether the process CPU usage meter should be shown.
6132 */
6133 public static final String SHOW_PROCESSES = "show_processes";
6134
6135 /**
Ruchi Kandoi62b8a492014-04-17 18:01:40 -07006136 * If 1 low power mode is enabled.
6137 * @hide
6138 */
6139 public static final String LOW_POWER_MODE = "low_power";
6140
John Spurlockf8f524c2014-06-10 14:47:29 -04006141 /**
6142 * Battery level [1-99] at which low power mode automatically turns on.
Dianne Hackborn14272302014-06-10 23:13:02 -07006143 * If 0, it will not automatically turn on.
John Spurlockf8f524c2014-06-10 14:47:29 -04006144 * @hide
6145 */
6146 public static final String LOW_POWER_MODE_TRIGGER_LEVEL = "low_power_trigger_level";
6147
Ruchi Kandoi62b8a492014-04-17 18:01:40 -07006148 /**
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07006149 * If 1, the activity manager will aggressively finish activities and
6150 * processes as soon as they are no longer needed. If 0, the normal
6151 * extended lifetime is used.
6152 */
6153 public static final String ALWAYS_FINISH_ACTIVITIES =
6154 "always_finish_activities";
6155
Christopher Tate66488d62012-10-02 11:58:01 -07006156 /**
Eric Laurent7ee1e4f2012-10-26 18:11:21 -07006157 * Use Dock audio output for media:
6158 * 0 = disabled
6159 * 1 = enabled
6160 * @hide
6161 */
6162 public static final String DOCK_AUDIO_MEDIA_ENABLED = "dock_audio_media_enabled";
6163
6164 /**
Eric Laurent05274f32012-11-29 12:48:18 -08006165 * Persisted safe headphone volume management state by AudioService
6166 * @hide
6167 */
6168 public static final String AUDIO_SAFE_VOLUME_STATE = "audio_safe_volume_state";
6169
6170 /**
Geremy Condraa0735112013-03-26 21:49:26 -07006171 * URL for tzinfo (time zone) updates
6172 * @hide
6173 */
6174 public static final String TZINFO_UPDATE_CONTENT_URL = "tzinfo_content_url";
6175
6176 /**
6177 * URL for tzinfo (time zone) update metadata
6178 * @hide
6179 */
6180 public static final String TZINFO_UPDATE_METADATA_URL = "tzinfo_metadata_url";
6181
6182 /**
6183 * URL for selinux (mandatory access control) updates
6184 * @hide
6185 */
6186 public static final String SELINUX_UPDATE_CONTENT_URL = "selinux_content_url";
6187
6188 /**
6189 * URL for selinux (mandatory access control) update metadata
6190 * @hide
6191 */
6192 public static final String SELINUX_UPDATE_METADATA_URL = "selinux_metadata_url";
6193
6194 /**
6195 * URL for sms short code updates
6196 * @hide
6197 */
6198 public static final String SMS_SHORT_CODES_UPDATE_CONTENT_URL =
6199 "sms_short_codes_content_url";
6200
6201 /**
6202 * URL for sms short code update metadata
6203 * @hide
6204 */
6205 public static final String SMS_SHORT_CODES_UPDATE_METADATA_URL =
6206 "sms_short_codes_metadata_url";
6207
6208 /**
6209 * URL for cert pinlist updates
6210 * @hide
6211 */
6212 public static final String CERT_PIN_UPDATE_CONTENT_URL = "cert_pin_content_url";
6213
6214 /**
6215 * URL for cert pinlist updates
6216 * @hide
6217 */
6218 public static final String CERT_PIN_UPDATE_METADATA_URL = "cert_pin_metadata_url";
6219
Geremy Condra757ee522013-03-29 16:39:45 -07006220 /**
Ben Gruver633dc9b2013-04-04 12:05:49 -07006221 * URL for intent firewall updates
6222 * @hide
6223 */
6224 public static final String INTENT_FIREWALL_UPDATE_CONTENT_URL =
6225 "intent_firewall_content_url";
6226
6227 /**
6228 * URL for intent firewall update metadata
6229 * @hide
6230 */
6231 public static final String INTENT_FIREWALL_UPDATE_METADATA_URL =
6232 "intent_firewall_metadata_url";
6233
6234 /**
Geremy Condra4e7f7e82013-03-26 21:09:01 -07006235 * SELinux enforcement status. If 0, permissive; if 1, enforcing.
6236 * @hide
6237 */
6238 public static final String SELINUX_STATUS = "selinux_status";
6239
Geremy Condraa0735112013-03-26 21:49:26 -07006240 /**
Amith Yamasanid8415f42013-08-07 20:15:10 -07006241 * Developer setting to force RTL layout.
6242 * @hide
6243 */
6244 public static final String DEVELOPMENT_FORCE_RTL = "debug.force_rtl";
6245
6246 /**
Daniel Sandlerdea64622013-09-23 16:05:57 -04006247 * Milliseconds after screen-off after which low battery sounds will be silenced.
6248 *
6249 * If zero, battery sounds will always play.
6250 * Defaults to @integer/def_low_battery_sound_timeout in SettingsProvider.
6251 *
6252 * @hide
6253 */
6254 public static final String LOW_BATTERY_SOUND_TIMEOUT = "low_battery_sound_timeout";
6255
6256 /**
Evan Charltoncc7b0432014-01-14 14:47:11 -08006257 * Milliseconds to wait before bouncing Wi-Fi after settings is restored. Note that after
6258 * the caller is done with this, they should call {@link ContentResolver#delete(Uri)} to
6259 * clean up any value that they may have written.
6260 *
6261 * @hide
6262 */
6263 public static final String WIFI_BOUNCE_DELAY_OVERRIDE_MS = "wifi_bounce_delay_override_ms";
6264
John Spurlockc6d1c602014-01-17 15:22:06 -05006265 /**
6266 * Defines global runtime overrides to window policy.
6267 *
6268 * See {@link com.android.internal.policy.impl.PolicyControl} for value format.
6269 *
6270 * @hide
6271 */
6272 public static final String POLICY_CONTROL = "policy_control";
Evan Charltoncc7b0432014-01-14 14:47:11 -08006273
Dan Sandler5d7c3cc2014-02-18 17:35:15 -05006274
6275 /**
6276 * This preference enables notification display even over a securely
6277 * locked screen.
6278 * @hide
6279 */
6280 public static final String LOCK_SCREEN_SHOW_NOTIFICATIONS =
6281 "lock_screen_show_notifications";
6282
Evan Charltoncc7b0432014-01-14 14:47:11 -08006283 /**
John Spurlockae641c92014-06-30 18:11:40 -04006284 * Defines global zen mode. ZEN_MODE_OFF, ZEN_MODE_IMPORTANT_INTERRUPTIONS,
6285 * or ZEN_MODE_NO_INTERRUPTIONS.
John Spurlocke677d712014-02-13 12:52:19 -05006286 *
6287 * @hide
6288 */
6289 public static final String ZEN_MODE = "zen_mode";
6290
6291 /** @hide */ public static final int ZEN_MODE_OFF = 0;
John Spurlockae641c92014-06-30 18:11:40 -04006292 /** @hide */ public static final int ZEN_MODE_IMPORTANT_INTERRUPTIONS = 1;
6293 /** @hide */ public static final int ZEN_MODE_NO_INTERRUPTIONS = 2;
John Spurlocke677d712014-02-13 12:52:19 -05006294
6295 /** @hide */ public static String zenModeToString(int mode) {
John Spurlockae641c92014-06-30 18:11:40 -04006296 if (mode == ZEN_MODE_IMPORTANT_INTERRUPTIONS) return "ZEN_MODE_IMPORTANT_INTERRUPTIONS";
6297 if (mode == ZEN_MODE_NO_INTERRUPTIONS) return "ZEN_MODE_NO_INTERRUPTIONS";
6298 return "ZEN_MODE_OFF";
John Spurlocke677d712014-02-13 12:52:19 -05006299 }
6300
6301 /**
John Spurlock056c5192014-04-20 21:52:01 -04006302 * Opaque value, changes when persisted zen mode configuration changes.
6303 *
6304 * @hide
6305 */
6306 public static final String ZEN_MODE_CONFIG_ETAG = "zen_mode_config_etag";
6307
6308 /**
Chris Wren7bd241232014-02-28 16:25:05 -05006309 * Defines global heads up toggle. One of HEADS_UP_OFF, HEADS_UP_ON.
6310 *
6311 * @hide
6312 */
Chris Wren10d82df2014-03-01 10:34:51 -05006313 public static final String HEADS_UP_NOTIFICATIONS_ENABLED =
6314 "heads_up_notifications_enabled";
Chris Wren7bd241232014-02-28 16:25:05 -05006315
6316 /** @hide */ public static final int HEADS_UP_OFF = 0;
6317 /** @hide */ public static final int HEADS_UP_ON = 1;
6318
6319 /**
Jerome Poichet147b4d72014-05-12 18:13:27 -07006320 * The name of the device
6321 *
6322 * @hide
6323 */
6324 public static final String DEVICE_NAME = "device_name";
6325
6326 /**
Amith Yamasani1e9c2182014-06-11 17:25:51 -07006327 * Whether it should be possible to create a guest user on the device.
6328 * <p>
6329 * Type: int (0 for disabled, 1 for enabled)
6330 * @hide
6331 */
6332 public static final String GUEST_USER_ENABLED = "guest_user_enabled";
6333
6334 /**
Christopher Tate66488d62012-10-02 11:58:01 -07006335 * Settings to backup. This is here so that it's in the same place as the settings
6336 * keys and easy to update.
6337 *
6338 * These keys may be mentioned in the SETTINGS_TO_BACKUP arrays in System
6339 * and Secure as well. This is because those tables drive both backup and
6340 * restore, and restore needs to properly whitelist keys that used to live
6341 * in those namespaces. The keys will only actually be backed up / restored
6342 * if they are also mentioned in this table (Global.SETTINGS_TO_BACKUP).
6343 *
6344 * NOTE: Settings are backed up and restored in the order they appear
6345 * in this array. If you have one setting depending on another,
6346 * make sure that they are ordered appropriately.
6347 *
6348 * @hide
6349 */
6350 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate58f41ec2013-01-11 15:40:36 -08006351 BUGREPORT_IN_POWER_MENU,
Christopher Tate66488d62012-10-02 11:58:01 -07006352 STAY_ON_WHILE_PLUGGED_IN,
Christopher Tate66488d62012-10-02 11:58:01 -07006353 AUTO_TIME,
6354 AUTO_TIME_ZONE,
6355 POWER_SOUNDS_ENABLED,
6356 DOCK_SOUNDS_ENABLED,
6357 USB_MASS_STORAGE_ENABLED,
6358 ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED,
6359 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
6360 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY,
Christopher Tate16eb7cd2012-10-09 15:26:30 -07006361 WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED,
Christopher Tate66488d62012-10-02 11:58:01 -07006362 WIFI_NUM_OPEN_NETWORKS_KEPT,
6363 EMERGENCY_TONE,
6364 CALL_AUTO_RETRY,
Eric Laurent7ee1e4f2012-10-26 18:11:21 -07006365 DOCK_AUDIO_MEDIA_ENABLED
Christopher Tate66488d62012-10-02 11:58:01 -07006366 };
6367
Christopher Tate06efb532012-08-24 15:29:27 -07006368 // Populated lazily, guarded by class object:
Dianne Hackborn139748f2012-09-24 11:36:57 -07006369 private static NameValueCache sNameValueCache = new NameValueCache(
6370 SYS_PROP_SETTING_VERSION,
6371 CONTENT_URI,
6372 CALL_METHOD_GET_GLOBAL,
6373 CALL_METHOD_PUT_GLOBAL);
Christopher Tate06efb532012-08-24 15:29:27 -07006374
Christopher Tateaa036a22014-05-19 16:33:27 -07006375 // Certain settings have been moved from global to the per-user secure namespace
6376 private static final HashSet<String> MOVED_TO_SECURE;
6377 static {
6378 MOVED_TO_SECURE = new HashSet<String>(1);
6379 MOVED_TO_SECURE.add(Settings.Global.INSTALL_NON_MARKET_APPS);
6380 }
6381
Christopher Tate06efb532012-08-24 15:29:27 -07006382 /**
6383 * Look up a name in the database.
6384 * @param resolver to access the database with
6385 * @param name to look up in the table
6386 * @return the corresponding value, or null if not present
6387 */
Dianne Hackborn139748f2012-09-24 11:36:57 -07006388 public static String getString(ContentResolver resolver, String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07006389 return getStringForUser(resolver, name, UserHandle.myUserId());
6390 }
6391
6392 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -07006393 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -07006394 int userHandle) {
Christopher Tateaa036a22014-05-19 16:33:27 -07006395 if (MOVED_TO_SECURE.contains(name)) {
6396 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
6397 + " to android.provider.Settings.Secure, returning read-only value.");
6398 return Secure.getStringForUser(resolver, name, userHandle);
6399 }
Christopher Tate06efb532012-08-24 15:29:27 -07006400 return sNameValueCache.getStringForUser(resolver, name, userHandle);
6401 }
6402
6403 /**
6404 * Store a name/value pair into the database.
6405 * @param resolver to access the database with
6406 * @param name to store
6407 * @param value to associate with the name
6408 * @return true if the value was set, false on database errors
6409 */
6410 public static boolean putString(ContentResolver resolver,
6411 String name, String value) {
6412 return putStringForUser(resolver, name, value, UserHandle.myUserId());
6413 }
6414
6415 /** @hide */
6416 public static boolean putStringForUser(ContentResolver resolver,
6417 String name, String value, int userHandle) {
Christopher Tate06efb532012-08-24 15:29:27 -07006418 if (LOCAL_LOGV) {
6419 Log.v(TAG, "Global.putString(name=" + name + ", value=" + value
6420 + " for " + userHandle);
6421 }
Christopher Tateaa036a22014-05-19 16:33:27 -07006422 // Global and Secure have the same access policy so we can forward writes
6423 if (MOVED_TO_SECURE.contains(name)) {
6424 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
6425 + " to android.provider.Settings.Secure, value is unchanged.");
6426 return Secure.putStringForUser(resolver, name, value, userHandle);
6427 }
Christopher Tate06efb532012-08-24 15:29:27 -07006428 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
6429 }
6430
6431 /**
6432 * Construct the content URI for a particular name/value pair,
6433 * useful for monitoring changes with a ContentObserver.
6434 * @param name to look up in the table
6435 * @return the corresponding content URI, or null if not present
6436 */
6437 public static Uri getUriFor(String name) {
6438 return getUriFor(CONTENT_URI, name);
6439 }
6440
6441 /**
6442 * Convenience function for retrieving a single secure settings value
6443 * as an integer. Note that internally setting values are always
6444 * stored as strings; this function converts the string to an integer
6445 * for you. The default value will be returned if the setting is
6446 * not defined or not an integer.
6447 *
6448 * @param cr The ContentResolver to access.
6449 * @param name The name of the setting to retrieve.
6450 * @param def Value to return if the setting is not defined.
6451 *
6452 * @return The setting's current value, or 'def' if it is not defined
6453 * or not a valid integer.
6454 */
6455 public static int getInt(ContentResolver cr, String name, int def) {
6456 String v = getString(cr, name);
6457 try {
6458 return v != null ? Integer.parseInt(v) : def;
6459 } catch (NumberFormatException e) {
6460 return def;
6461 }
6462 }
6463
6464 /**
6465 * Convenience function for retrieving a single secure settings value
6466 * as an integer. Note that internally setting values are always
6467 * stored as strings; this function converts the string to an integer
6468 * for you.
6469 * <p>
6470 * This version does not take a default value. If the setting has not
6471 * been set, or the string value is not a number,
6472 * it throws {@link SettingNotFoundException}.
6473 *
6474 * @param cr The ContentResolver to access.
6475 * @param name The name of the setting to retrieve.
6476 *
6477 * @throws SettingNotFoundException Thrown if a setting by the given
6478 * name can't be found or the setting value is not an integer.
6479 *
6480 * @return The setting's current value.
6481 */
6482 public static int getInt(ContentResolver cr, String name)
6483 throws SettingNotFoundException {
6484 String v = getString(cr, name);
6485 try {
6486 return Integer.parseInt(v);
6487 } catch (NumberFormatException e) {
6488 throw new SettingNotFoundException(name);
6489 }
6490 }
6491
6492 /**
6493 * Convenience function for updating a single settings value as an
6494 * integer. This will either create a new entry in the table if the
6495 * given name does not exist, or modify the value of the existing row
6496 * with that name. Note that internally setting values are always
6497 * stored as strings, so this function converts the given value to a
6498 * string before storing it.
6499 *
6500 * @param cr The ContentResolver to access.
6501 * @param name The name of the setting to modify.
6502 * @param value The new value for the setting.
6503 * @return true if the value was set, false on database errors
6504 */
6505 public static boolean putInt(ContentResolver cr, String name, int value) {
6506 return putString(cr, name, Integer.toString(value));
6507 }
6508
6509 /**
6510 * Convenience function for retrieving a single secure settings value
6511 * as a {@code long}. Note that internally setting values are always
6512 * stored as strings; this function converts the string to a {@code long}
6513 * for you. The default value will be returned if the setting is
6514 * not defined or not a {@code long}.
6515 *
6516 * @param cr The ContentResolver to access.
6517 * @param name The name of the setting to retrieve.
6518 * @param def Value to return if the setting is not defined.
6519 *
6520 * @return The setting's current value, or 'def' if it is not defined
6521 * or not a valid {@code long}.
6522 */
6523 public static long getLong(ContentResolver cr, String name, long def) {
6524 String valString = getString(cr, name);
6525 long value;
6526 try {
6527 value = valString != null ? Long.parseLong(valString) : def;
6528 } catch (NumberFormatException e) {
6529 value = def;
6530 }
6531 return value;
6532 }
6533
6534 /**
6535 * Convenience function for retrieving a single secure settings value
6536 * as a {@code long}. Note that internally setting values are always
6537 * stored as strings; this function converts the string to a {@code long}
6538 * for you.
6539 * <p>
6540 * This version does not take a default value. If the setting has not
6541 * been set, or the string value is not a number,
6542 * it throws {@link SettingNotFoundException}.
6543 *
6544 * @param cr The ContentResolver to access.
6545 * @param name The name of the setting to retrieve.
6546 *
6547 * @return The setting's current value.
6548 * @throws SettingNotFoundException Thrown if a setting by the given
6549 * name can't be found or the setting value is not an integer.
6550 */
6551 public static long getLong(ContentResolver cr, String name)
6552 throws SettingNotFoundException {
6553 String valString = getString(cr, name);
6554 try {
6555 return Long.parseLong(valString);
6556 } catch (NumberFormatException e) {
6557 throw new SettingNotFoundException(name);
6558 }
6559 }
6560
6561 /**
6562 * Convenience function for updating a secure settings value as a long
6563 * integer. This will either create a new entry in the table if the
6564 * given name does not exist, or modify the value of the existing row
6565 * with that name. Note that internally setting values are always
6566 * stored as strings, so this function converts the given value to a
6567 * string before storing it.
6568 *
6569 * @param cr The ContentResolver to access.
6570 * @param name The name of the setting to modify.
6571 * @param value The new value for the setting.
6572 * @return true if the value was set, false on database errors
6573 */
6574 public static boolean putLong(ContentResolver cr, String name, long value) {
6575 return putString(cr, name, Long.toString(value));
6576 }
6577
6578 /**
6579 * Convenience function for retrieving a single secure settings value
6580 * as a floating point number. Note that internally setting values are
6581 * always stored as strings; this function converts the string to an
6582 * float for you. The default value will be returned if the setting
6583 * is not defined or not a valid float.
6584 *
6585 * @param cr The ContentResolver to access.
6586 * @param name The name of the setting to retrieve.
6587 * @param def Value to return if the setting is not defined.
6588 *
6589 * @return The setting's current value, or 'def' if it is not defined
6590 * or not a valid float.
6591 */
6592 public static float getFloat(ContentResolver cr, String name, float def) {
6593 String v = getString(cr, name);
6594 try {
6595 return v != null ? Float.parseFloat(v) : def;
6596 } catch (NumberFormatException e) {
6597 return def;
6598 }
6599 }
6600
6601 /**
6602 * Convenience function for retrieving a single secure settings value
6603 * as a float. Note that internally setting values are always
6604 * stored as strings; this function converts the string to a float
6605 * for you.
6606 * <p>
6607 * This version does not take a default value. If the setting has not
6608 * been set, or the string value is not a number,
6609 * it throws {@link SettingNotFoundException}.
6610 *
6611 * @param cr The ContentResolver to access.
6612 * @param name The name of the setting to retrieve.
6613 *
6614 * @throws SettingNotFoundException Thrown if a setting by the given
6615 * name can't be found or the setting value is not a float.
6616 *
6617 * @return The setting's current value.
6618 */
6619 public static float getFloat(ContentResolver cr, String name)
6620 throws SettingNotFoundException {
6621 String v = getString(cr, name);
6622 if (v == null) {
6623 throw new SettingNotFoundException(name);
6624 }
6625 try {
6626 return Float.parseFloat(v);
6627 } catch (NumberFormatException e) {
6628 throw new SettingNotFoundException(name);
6629 }
6630 }
6631
6632 /**
6633 * Convenience function for updating a single settings value as a
6634 * floating point number. This will either create a new entry in the
6635 * table if the given name does not exist, or modify the value of the
6636 * existing row with that name. Note that internally setting values
6637 * are always stored as strings, so this function converts the given
6638 * value to a string before storing it.
6639 *
6640 * @param cr The ContentResolver to access.
6641 * @param name The name of the setting to modify.
6642 * @param value The new value for the setting.
6643 * @return true if the value was set, false on database errors
6644 */
6645 public static boolean putFloat(ContentResolver cr, String name, float value) {
6646 return putString(cr, name, Float.toString(value));
6647 }
Wink Savillefb40dd42014-06-12 17:02:31 -07006648
6649
6650 /**
6651 * Subscription to be used for voice call on a multi sim device. The supported values
6652 * are 0 = SUB1, 1 = SUB2 and etc.
6653 * @hide
6654 */
6655 public static final String MULTI_SIM_VOICE_CALL_SUBSCRIPTION = "multi_sim_voice_call";
6656
6657 /**
6658 * Used to provide option to user to select subscription during dial.
6659 * The supported values are 0 = disable or 1 = enable prompt.
6660 * @hide
6661 */
6662 public static final String MULTI_SIM_VOICE_PROMPT = "multi_sim_voice_prompt";
6663
6664 /**
6665 * Subscription to be used for data call on a multi sim device. The supported values
6666 * are 0 = SUB1, 1 = SUB2 and etc.
6667 * @hide
6668 */
6669 public static final String MULTI_SIM_DATA_CALL_SUBSCRIPTION = "multi_sim_data_call";
6670
6671 /**
6672 * Subscription to be used for SMS on a multi sim device. The supported values
6673 * are 0 = SUB1, 1 = SUB2 and etc.
6674 * @hide
6675 */
6676 public static final String MULTI_SIM_SMS_SUBSCRIPTION = "multi_sim_sms";
6677
6678 /**
6679 * Used to provide option to user to select subscription during send SMS.
6680 * The value 1 - enable, 0 - disable
6681 * @hide
6682 */
6683 public static final String MULTI_SIM_SMS_PROMPT = "multi_sim_sms_prompt";
6684
6685
6686
6687 /** User preferred subscriptions setting.
6688 * This holds the details of the user selected subscription from the card and
6689 * the activation status. Each settings string have the coma separated values
6690 * iccId,appType,appId,activationStatus,3gppIndex,3gpp2Index
6691 * @hide
6692 */
6693 public static final String[] MULTI_SIM_USER_PREFERRED_SUBS = {"user_preferred_sub1",
6694 "user_preferred_sub2","user_preferred_sub3"};
Christopher Tate06efb532012-08-24 15:29:27 -07006695 }
6696
6697 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006698 * User-defined bookmarks and shortcuts. The target of each bookmark is an
6699 * Intent URL, allowing it to be either a web page or a particular
6700 * application activity.
6701 *
6702 * @hide
6703 */
6704 public static final class Bookmarks implements BaseColumns
6705 {
6706 private static final String TAG = "Bookmarks";
6707
6708 /**
6709 * The content:// style URL for this table
6710 */
6711 public static final Uri CONTENT_URI =
6712 Uri.parse("content://" + AUTHORITY + "/bookmarks");
6713
6714 /**
6715 * The row ID.
6716 * <p>Type: INTEGER</p>
6717 */
6718 public static final String ID = "_id";
6719
6720 /**
6721 * Descriptive name of the bookmark that can be displayed to the user.
6722 * If this is empty, the title should be resolved at display time (use
6723 * {@link #getTitle(Context, Cursor)} any time you want to display the
6724 * title of a bookmark.)
6725 * <P>
6726 * Type: TEXT
6727 * </P>
6728 */
6729 public static final String TITLE = "title";
6730
6731 /**
6732 * Arbitrary string (displayed to the user) that allows bookmarks to be
6733 * organized into categories. There are some special names for
6734 * standard folders, which all start with '@'. The label displayed for
6735 * the folder changes with the locale (via {@link #getLabelForFolder}) but
6736 * the folder name does not change so you can consistently query for
6737 * the folder regardless of the current locale.
6738 *
6739 * <P>Type: TEXT</P>
6740 *
6741 */
6742 public static final String FOLDER = "folder";
6743
6744 /**
6745 * The Intent URL of the bookmark, describing what it points to. This
6746 * value is given to {@link android.content.Intent#getIntent} to create
6747 * an Intent that can be launched.
6748 * <P>Type: TEXT</P>
6749 */
6750 public static final String INTENT = "intent";
6751
6752 /**
6753 * Optional shortcut character associated with this bookmark.
6754 * <P>Type: INTEGER</P>
6755 */
6756 public static final String SHORTCUT = "shortcut";
6757
6758 /**
6759 * The order in which the bookmark should be displayed
6760 * <P>Type: INTEGER</P>
6761 */
6762 public static final String ORDERING = "ordering";
6763
6764 private static final String[] sIntentProjection = { INTENT };
6765 private static final String[] sShortcutProjection = { ID, SHORTCUT };
6766 private static final String sShortcutSelection = SHORTCUT + "=?";
6767
6768 /**
6769 * Convenience function to retrieve the bookmarked Intent for a
6770 * particular shortcut key.
6771 *
6772 * @param cr The ContentResolver to query.
6773 * @param shortcut The shortcut key.
6774 *
6775 * @return Intent The bookmarked URL, or null if there is no bookmark
6776 * matching the given shortcut.
6777 */
6778 public static Intent getIntentForShortcut(ContentResolver cr, char shortcut)
6779 {
6780 Intent intent = null;
6781
6782 Cursor c = cr.query(CONTENT_URI,
6783 sIntentProjection, sShortcutSelection,
6784 new String[] { String.valueOf((int) shortcut) }, ORDERING);
6785 // Keep trying until we find a valid shortcut
6786 try {
6787 while (intent == null && c.moveToNext()) {
6788 try {
6789 String intentURI = c.getString(c.getColumnIndexOrThrow(INTENT));
Christian Mehlmauera34d2c92010-05-25 19:04:20 +02006790 intent = Intent.parseUri(intentURI, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006791 } catch (java.net.URISyntaxException e) {
6792 // The stored URL is bad... ignore it.
6793 } catch (IllegalArgumentException e) {
6794 // Column not found
Dianne Hackborna33e3f72009-09-29 17:28:24 -07006795 Log.w(TAG, "Intent column not found", e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006796 }
6797 }
6798 } finally {
6799 if (c != null) c.close();
6800 }
6801
6802 return intent;
6803 }
6804
6805 /**
6806 * Add a new bookmark to the system.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006807 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006808 * @param cr The ContentResolver to query.
6809 * @param intent The desired target of the bookmark.
6810 * @param title Bookmark title that is shown to the user; null if none
6811 * or it should be resolved to the intent's title.
6812 * @param folder Folder in which to place the bookmark; null if none.
6813 * @param shortcut Shortcut that will invoke the bookmark; 0 if none. If
6814 * this is non-zero and there is an existing bookmark entry
6815 * with this same shortcut, then that existing shortcut is
6816 * cleared (the bookmark is not removed).
6817 * @return The unique content URL for the new bookmark entry.
6818 */
6819 public static Uri add(ContentResolver cr,
6820 Intent intent,
6821 String title,
6822 String folder,
6823 char shortcut,
6824 int ordering)
6825 {
6826 // If a shortcut is supplied, and it is already defined for
6827 // another bookmark, then remove the old definition.
6828 if (shortcut != 0) {
Jeff Hamilton7cd51ef2010-05-12 17:30:27 -05006829 cr.delete(CONTENT_URI, sShortcutSelection,
6830 new String[] { String.valueOf((int) shortcut) });
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006831 }
6832
6833 ContentValues values = new ContentValues();
6834 if (title != null) values.put(TITLE, title);
6835 if (folder != null) values.put(FOLDER, folder);
Jean-Baptiste Queru3b9f0a32010-06-21 13:46:59 -07006836 values.put(INTENT, intent.toUri(0));
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006837 if (shortcut != 0) values.put(SHORTCUT, (int) shortcut);
6838 values.put(ORDERING, ordering);
6839 return cr.insert(CONTENT_URI, values);
6840 }
6841
6842 /**
6843 * Return the folder name as it should be displayed to the user. This
6844 * takes care of localizing special folders.
6845 *
6846 * @param r Resources object for current locale; only need access to
6847 * system resources.
6848 * @param folder The value found in the {@link #FOLDER} column.
6849 *
6850 * @return CharSequence The label for this folder that should be shown
6851 * to the user.
6852 */
6853 public static CharSequence getLabelForFolder(Resources r, String folder) {
6854 return folder;
6855 }
6856
6857 /**
6858 * Return the title as it should be displayed to the user. This takes
6859 * care of localizing bookmarks that point to activities.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006860 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006861 * @param context A context.
6862 * @param cursor A cursor pointing to the row whose title should be
6863 * returned. The cursor must contain at least the {@link #TITLE}
6864 * and {@link #INTENT} columns.
6865 * @return A title that is localized and can be displayed to the user,
6866 * or the empty string if one could not be found.
6867 */
6868 public static CharSequence getTitle(Context context, Cursor cursor) {
6869 int titleColumn = cursor.getColumnIndex(TITLE);
6870 int intentColumn = cursor.getColumnIndex(INTENT);
6871 if (titleColumn == -1 || intentColumn == -1) {
6872 throw new IllegalArgumentException(
6873 "The cursor must contain the TITLE and INTENT columns.");
6874 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006875
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006876 String title = cursor.getString(titleColumn);
6877 if (!TextUtils.isEmpty(title)) {
6878 return title;
6879 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006880
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006881 String intentUri = cursor.getString(intentColumn);
6882 if (TextUtils.isEmpty(intentUri)) {
6883 return "";
6884 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006885
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006886 Intent intent;
6887 try {
Christian Mehlmauera34d2c92010-05-25 19:04:20 +02006888 intent = Intent.parseUri(intentUri, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006889 } catch (URISyntaxException e) {
6890 return "";
6891 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006892
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006893 PackageManager packageManager = context.getPackageManager();
6894 ResolveInfo info = packageManager.resolveActivity(intent, 0);
6895 return info != null ? info.loadLabel(packageManager) : "";
6896 }
6897 }
6898
6899 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006900 * Returns the device ID that we should use when connecting to the mobile gtalk server.
6901 * This is a string like "android-0x1242", where the hex string is the Android ID obtained
6902 * from the GoogleLoginService.
6903 *
6904 * @param androidId The Android ID for this device.
6905 * @return The device ID that should be used when connecting to the mobile gtalk server.
6906 * @hide
6907 */
6908 public static String getGTalkDeviceId(long androidId) {
6909 return "android-" + Long.toHexString(androidId);
6910 }
6911}