blob: f0842637151c6360b7acfd89d248172e17679ddf [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;
Bryce Leecdfebd62015-02-02 08:19:11 -080021import android.annotation.SystemApi;
Narayan Kamathee69ff42011-06-28 12:07:18 +010022import android.app.SearchManager;
Jeff Sharkey6e2bee72012-10-01 13:39:08 -070023import android.app.WallpaperManager;
Mike LeBeau5d34e9b2010-02-10 19:34:56 -080024import android.content.ComponentName;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080025import android.content.ContentResolver;
26import android.content.ContentValues;
27import android.content.Context;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -080028import android.content.IContentProvider;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080029import android.content.Intent;
Dianne Hackbornb8b11a02010-03-10 15:53:11 -080030import android.content.pm.ActivityInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080031import android.content.pm.PackageManager;
32import android.content.pm.ResolveInfo;
33import android.content.res.Configuration;
34import android.content.res.Resources;
35import android.database.Cursor;
36import android.database.SQLException;
David Christie3f7b6522013-08-06 19:19:08 -070037import android.location.LocationManager;
Jeff Sharkey625239a2012-09-26 22:03:49 -070038import android.net.ConnectivityManager;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080039import android.net.Uri;
Irfan Sheriff36f74132010-11-04 16:57:37 -070040import android.net.wifi.WifiManager;
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -070041import android.os.BatteryManager;
42import android.os.Bundle;
Jeff Sharkey625239a2012-09-26 22:03:49 -070043import android.os.DropBoxManager;
Amith Yamasani52c489c2012-03-28 11:42:42 -070044import android.os.IBinder;
Amith Yamasani7ab8c4a2012-04-06 09:27:12 -070045import android.os.Process;
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -070046import android.os.RemoteException;
Amith Yamasani52c489c2012-03-28 11:42:42 -070047import android.os.ServiceManager;
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -070048import android.os.SystemProperties;
Dianne Hackbornf02b60a2012-08-16 10:48:27 -070049import android.os.UserHandle;
Jeff Sharkey625239a2012-09-26 22:03:49 -070050import android.os.Build.VERSION_CODES;
Narayan Kamath6d632962011-08-24 11:51:37 +010051import android.speech.tts.TextToSpeech;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080052import android.text.TextUtils;
53import android.util.AndroidException;
Svetoslav683914b2015-01-15 14:22:26 -080054import android.util.ArrayMap;
55import android.util.ArraySet;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080056import android.util.Log;
57
Svetoslav683914b2015-01-15 14:22:26 -080058import com.android.internal.util.ArrayUtils;
Amith Yamasani52c489c2012-03-28 11:42:42 -070059import com.android.internal.widget.ILockSettings;
60
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080061import java.net.URISyntaxException;
Svetoslav683914b2015-01-15 14:22:26 -080062import java.text.SimpleDateFormat;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080063import java.util.HashMap;
64import java.util.HashSet;
Elliott Hughescb64d432013-08-02 10:00:44 -070065import java.util.Locale;
Svetoslav683914b2015-01-15 14:22:26 -080066import java.util.Map;
67import java.util.Set;
68import java.util.regex.Pattern;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080069
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080070/**
71 * The Settings provider contains global system-level device preferences.
72 */
73public final class Settings {
74
75 // Intent actions for Settings
76
77 /**
78 * Activity Action: Show system settings.
79 * <p>
80 * Input: Nothing.
81 * <p>
Gilles Debunnee90bed12011-08-30 14:28:27 -070082 * Output: Nothing.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080083 */
84 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
85 public static final String ACTION_SETTINGS = "android.settings.SETTINGS";
86
87 /**
88 * Activity Action: Show settings to allow configuration of APNs.
89 * <p>
90 * Input: Nothing.
91 * <p>
Gilles Debunnee90bed12011-08-30 14:28:27 -070092 * Output: Nothing.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080093 */
94 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
95 public static final String ACTION_APN_SETTINGS = "android.settings.APN_SETTINGS";
96
97 /**
98 * Activity Action: Show settings to allow configuration of current location
99 * sources.
100 * <p>
101 * In some cases, a matching Activity may not exist, so ensure you
102 * safeguard against this.
103 * <p>
104 * Input: Nothing.
105 * <p>
106 * Output: Nothing.
107 */
108 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
109 public static final String ACTION_LOCATION_SOURCE_SETTINGS =
110 "android.settings.LOCATION_SOURCE_SETTINGS";
111
112 /**
113 * Activity Action: Show settings to allow configuration of wireless controls
114 * such as Wi-Fi, Bluetooth and Mobile networks.
115 * <p>
116 * In some cases, a matching Activity may not exist, so ensure you
117 * safeguard against this.
118 * <p>
119 * Input: Nothing.
120 * <p>
121 * Output: Nothing.
122 */
123 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
124 public static final String ACTION_WIRELESS_SETTINGS =
125 "android.settings.WIRELESS_SETTINGS";
126
127 /**
128 * Activity Action: Show settings to allow entering/exiting airplane mode.
129 * <p>
130 * In some cases, a matching Activity may not exist, so ensure you
131 * safeguard against this.
132 * <p>
133 * Input: Nothing.
134 * <p>
135 * Output: Nothing.
136 */
137 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
138 public static final String ACTION_AIRPLANE_MODE_SETTINGS =
139 "android.settings.AIRPLANE_MODE_SETTINGS";
140
141 /**
Barnaby James48f35522014-07-16 14:27:39 -0700142 * Activity Action: Modify Airplane mode settings using the users voice.
143 * <p>
144 * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
145 * <p>
146 * This intent MUST be started using
147 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
148 * startVoiceActivity}.
149 * <p>
150 * To tell which state airplane mode should be set to, add the
151 * {@link #EXTRA_AIRPLANE_MODE_ENABLED} extra to this Intent with the state specified.
152 * If there is no extra in this Intent, no changes will be made.
153 * <p>
154 * The activity should verify that
155 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before
156 * modifying the setting.
157 * <p>
158 * Input: Nothing.
159 * <p>
160 * Output: Nothing.
161 */
162 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
163 public static final String ACTION_VOICE_CONTROL_AIRPLANE_MODE =
164 "android.settings.VOICE_CONTROL_AIRPLANE_MODE";
165
166 /**
Dianne Hackborndd9b82c2009-09-03 00:18:47 -0700167 * Activity Action: Show settings for accessibility modules.
168 * <p>
169 * In some cases, a matching Activity may not exist, so ensure you
170 * safeguard against this.
171 * <p>
172 * Input: Nothing.
173 * <p>
174 * Output: Nothing.
175 */
176 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
177 public static final String ACTION_ACCESSIBILITY_SETTINGS =
178 "android.settings.ACCESSIBILITY_SETTINGS";
179
180 /**
Dianne Hackborna3fb40d2014-08-12 15:06:50 -0700181 * Activity Action: Show settings to control access to usage information.
182 * <p>
183 * In some cases, a matching Activity may not exist, so ensure you
184 * safeguard against this.
185 * <p>
186 * Input: Nothing.
187 * <p>
188 * Output: Nothing.
189 */
190 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
191 public static final String ACTION_USAGE_ACCESS_SETTINGS =
192 "android.settings.USAGE_ACCESS_SETTINGS";
193
194 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800195 * Activity Action: Show settings to allow configuration of security and
196 * location privacy.
197 * <p>
198 * In some cases, a matching Activity may not exist, so ensure you
199 * safeguard against this.
200 * <p>
201 * Input: Nothing.
202 * <p>
203 * Output: Nothing.
204 */
205 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
206 public static final String ACTION_SECURITY_SETTINGS =
207 "android.settings.SECURITY_SETTINGS";
208
209 /**
Maggie Benthall0469f412013-09-05 15:30:26 -0400210 * Activity Action: Show trusted credentials settings, opening to the user tab,
211 * to allow management of installed credentials.
212 * <p>
213 * In some cases, a matching Activity may not exist, so ensure you
214 * safeguard against this.
215 * <p>
216 * Input: Nothing.
217 * <p>
218 * Output: Nothing.
219 * @hide
220 */
221 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
222 public static final String ACTION_TRUSTED_CREDENTIALS_USER =
223 "com.android.settings.TRUSTED_CREDENTIALS_USER";
224
225 /**
226 * Activity Action: Show dialog explaining that an installed CA cert may enable
227 * monitoring of encrypted network traffic.
228 * <p>
229 * In some cases, a matching Activity may not exist, so ensure you
230 * safeguard against this.
231 * <p>
232 * Input: Nothing.
233 * <p>
234 * Output: Nothing.
235 * @hide
236 */
237 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
238 public static final String ACTION_MONITORING_CERT_INFO =
239 "com.android.settings.MONITORING_CERT_INFO";
240
241 /**
Amith Yamasanic15255a2009-09-23 15:33:19 -0700242 * Activity Action: Show settings to allow configuration of privacy options.
243 * <p>
244 * In some cases, a matching Activity may not exist, so ensure you
245 * safeguard against this.
246 * <p>
247 * Input: Nothing.
248 * <p>
249 * Output: Nothing.
250 */
251 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
252 public static final String ACTION_PRIVACY_SETTINGS =
253 "android.settings.PRIVACY_SETTINGS";
254
255 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800256 * Activity Action: Show settings to allow configuration of Wi-Fi.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800257 * <p>
258 * In some cases, a matching Activity may not exist, so ensure you
259 * safeguard against this.
260 * <p>
261 * Input: Nothing.
262 * <p>
263 * Output: Nothing.
264
265 */
266 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
267 public static final String ACTION_WIFI_SETTINGS =
268 "android.settings.WIFI_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700269
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800270 /**
271 * Activity Action: Show settings to allow configuration of a static IP
272 * address for Wi-Fi.
273 * <p>
274 * In some cases, a matching Activity may not exist, so ensure you safeguard
275 * against this.
276 * <p>
277 * Input: Nothing.
278 * <p>
279 * Output: Nothing.
280 */
281 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
282 public static final String ACTION_WIFI_IP_SETTINGS =
283 "android.settings.WIFI_IP_SETTINGS";
284
285 /**
286 * Activity Action: Show settings to allow configuration of Bluetooth.
287 * <p>
288 * In some cases, a matching Activity may not exist, so ensure you
289 * safeguard against this.
290 * <p>
291 * Input: Nothing.
292 * <p>
293 * Output: Nothing.
294 */
295 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
296 public static final String ACTION_BLUETOOTH_SETTINGS =
297 "android.settings.BLUETOOTH_SETTINGS";
298
299 /**
Jeff Brown89d55462012-09-19 11:33:42 -0700300 * Activity Action: Show settings to allow configuration of Wifi Displays.
301 * <p>
302 * In some cases, a matching Activity may not exist, so ensure you
303 * safeguard against this.
304 * <p>
305 * Input: Nothing.
306 * <p>
307 * Output: Nothing.
308 * @hide
309 */
310 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
311 public static final String ACTION_WIFI_DISPLAY_SETTINGS =
312 "android.settings.WIFI_DISPLAY_SETTINGS";
313
314 /**
Jeff Brown1a937b02014-07-01 22:13:04 -0700315 * Activity Action: Show settings to allow configuration of
316 * {@link android.media.routing.MediaRouteService media route providers}.
317 * <p>
318 * In some cases, a matching Activity may not exist, so ensure you
319 * safeguard against this.
320 * <p>
321 * Input: Nothing.
322 * <p>
323 * Output: Nothing.
324 */
325 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
326 public static final String ACTION_CAST_SETTINGS =
327 "android.settings.CAST_SETTINGS";
328
329 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800330 * Activity Action: Show settings to allow configuration of date and time.
331 * <p>
332 * In some cases, a matching Activity may not exist, so ensure you
333 * safeguard against this.
334 * <p>
335 * Input: Nothing.
336 * <p>
337 * Output: Nothing.
338 */
339 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
340 public static final String ACTION_DATE_SETTINGS =
341 "android.settings.DATE_SETTINGS";
342
343 /**
344 * Activity Action: Show settings to allow configuration of sound and volume.
345 * <p>
346 * In some cases, a matching Activity may not exist, so ensure you
347 * safeguard against this.
348 * <p>
349 * Input: Nothing.
350 * <p>
351 * Output: Nothing.
352 */
353 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
354 public static final String ACTION_SOUND_SETTINGS =
355 "android.settings.SOUND_SETTINGS";
356
357 /**
358 * Activity Action: Show settings to allow configuration of display.
359 * <p>
360 * In some cases, a matching Activity may not exist, so ensure you
361 * safeguard against this.
362 * <p>
363 * Input: Nothing.
364 * <p>
365 * Output: Nothing.
366 */
367 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
368 public static final String ACTION_DISPLAY_SETTINGS =
369 "android.settings.DISPLAY_SETTINGS";
370
371 /**
372 * Activity Action: Show settings to allow configuration of locale.
373 * <p>
374 * In some cases, a matching Activity may not exist, so ensure you
375 * safeguard against this.
376 * <p>
377 * Input: Nothing.
378 * <p>
379 * Output: Nothing.
380 */
381 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
382 public static final String ACTION_LOCALE_SETTINGS =
383 "android.settings.LOCALE_SETTINGS";
384
385 /**
386 * Activity Action: Show settings to configure input methods, in particular
387 * allowing the user to enable input methods.
388 * <p>
389 * In some cases, a matching Activity may not exist, so ensure you
390 * safeguard against this.
391 * <p>
392 * Input: Nothing.
393 * <p>
394 * Output: Nothing.
395 */
396 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
Dianne Hackborna3fb40d2014-08-12 15:06:50 -0700397 public static final String ACTION_VOICE_INPUT_SETTINGS =
398 "android.settings.VOICE_INPUT_SETTINGS";
399
400 /**
401 * Activity Action: Show settings to configure input methods, in particular
402 * allowing the user to enable input methods.
403 * <p>
404 * In some cases, a matching Activity may not exist, so ensure you
405 * safeguard against this.
406 * <p>
407 * Input: Nothing.
408 * <p>
409 * Output: Nothing.
410 */
411 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800412 public static final String ACTION_INPUT_METHOD_SETTINGS =
413 "android.settings.INPUT_METHOD_SETTINGS";
414
415 /**
Tadashi G. Takaokaf49688f2011-01-20 17:56:13 +0900416 * Activity Action: Show settings to enable/disable input method subtypes.
satok86417ea2010-10-27 14:11:03 +0900417 * <p>
418 * In some cases, a matching Activity may not exist, so ensure you
419 * safeguard against this.
420 * <p>
Tadashi G. Takaoka25480202011-01-20 23:13:02 +0900421 * To tell which input method's subtypes are displayed in the settings, add
422 * {@link #EXTRA_INPUT_METHOD_ID} extra to this Intent with the input method id.
423 * If there is no extra in this Intent, subtypes from all installed input methods
424 * will be displayed in the settings.
425 *
426 * @see android.view.inputmethod.InputMethodInfo#getId
427 * <p>
satok86417ea2010-10-27 14:11:03 +0900428 * Input: Nothing.
429 * <p>
430 * Output: Nothing.
431 */
432 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
Tadashi G. Takaokaf49688f2011-01-20 17:56:13 +0900433 public static final String ACTION_INPUT_METHOD_SUBTYPE_SETTINGS =
434 "android.settings.INPUT_METHOD_SUBTYPE_SETTINGS";
satok86417ea2010-10-27 14:11:03 +0900435
436 /**
satok7cfc0ed2011-06-20 21:29:36 +0900437 * Activity Action: Show a dialog to select input method.
438 * <p>
439 * In some cases, a matching Activity may not exist, so ensure you
440 * safeguard against this.
441 * <p>
442 * Input: Nothing.
443 * <p>
444 * Output: Nothing.
445 * @hide
446 */
447 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
448 public static final String ACTION_SHOW_INPUT_METHOD_PICKER =
449 "android.settings.SHOW_INPUT_METHOD_PICKER";
450
451 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800452 * Activity Action: Show settings to manage the user input dictionary.
453 * <p>
Chet Haasee8222dd2013-09-05 07:44:18 -0700454 * Starting with {@link android.os.Build.VERSION_CODES#KITKAT},
Satoshi Kataoka2aa2bc52013-07-30 14:25:11 +0900455 * it is guaranteed there will always be an appropriate implementation for this Intent action.
456 * 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 -0800457 * <p>
458 * Input: Nothing.
459 * <p>
460 * Output: Nothing.
461 */
462 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
463 public static final String ACTION_USER_DICTIONARY_SETTINGS =
464 "android.settings.USER_DICTIONARY_SETTINGS";
465
466 /**
Gilles Debunnee90bed12011-08-30 14:28:27 -0700467 * Activity Action: Adds a word to the user dictionary.
468 * <p>
469 * In some cases, a matching Activity may not exist, so ensure you
470 * safeguard against this.
471 * <p>
472 * Input: An extra with key <code>word</code> that contains the word
473 * that should be added to the dictionary.
474 * <p>
475 * Output: Nothing.
476 *
477 * @hide
478 */
479 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
480 public static final String ACTION_USER_DICTIONARY_INSERT =
481 "com.android.settings.USER_DICTIONARY_INSERT";
482
483 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800484 * Activity Action: Show settings to allow configuration of application-related settings.
485 * <p>
486 * In some cases, a matching Activity may not exist, so ensure you
487 * safeguard against this.
488 * <p>
489 * Input: Nothing.
490 * <p>
491 * Output: Nothing.
492 */
493 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
494 public static final String ACTION_APPLICATION_SETTINGS =
495 "android.settings.APPLICATION_SETTINGS";
496
497 /**
498 * Activity Action: Show settings to allow configuration of application
Dianne Hackborn8d866e52012-10-10 18:39:45 -0700499 * development-related settings. As of
500 * {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1} this action is
501 * a required part of the platform.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800502 * <p>
503 * Input: Nothing.
504 * <p>
505 * Output: Nothing.
506 */
507 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
508 public static final String ACTION_APPLICATION_DEVELOPMENT_SETTINGS =
509 "android.settings.APPLICATION_DEVELOPMENT_SETTINGS";
510
511 /**
512 * Activity Action: Show settings to allow configuration of quick launch shortcuts.
513 * <p>
514 * In some cases, a matching Activity may not exist, so ensure you
515 * safeguard against this.
516 * <p>
517 * Input: Nothing.
518 * <p>
519 * Output: Nothing.
520 */
521 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
522 public static final String ACTION_QUICK_LAUNCH_SETTINGS =
523 "android.settings.QUICK_LAUNCH_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700524
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800525 /**
526 * Activity Action: Show settings to manage installed applications.
527 * <p>
528 * In some cases, a matching Activity may not exist, so ensure you
529 * safeguard against this.
530 * <p>
531 * Input: Nothing.
532 * <p>
533 * Output: Nothing.
534 */
535 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
536 public static final String ACTION_MANAGE_APPLICATIONS_SETTINGS =
537 "android.settings.MANAGE_APPLICATIONS_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700538
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800539 /**
Winson Chung44e8ff92010-09-27 14:36:52 -0700540 * Activity Action: Show settings to manage all applications.
541 * <p>
542 * In some cases, a matching Activity may not exist, so ensure you
543 * safeguard against this.
544 * <p>
545 * Input: Nothing.
546 * <p>
547 * Output: Nothing.
548 */
549 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
550 public static final String ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS =
551 "android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS";
552
553 /**
Dianne Hackbornb7bb3b32010-06-06 22:47:50 -0700554 * Activity Action: Show screen of details about a particular application.
555 * <p>
556 * In some cases, a matching Activity may not exist, so ensure you
557 * safeguard against this.
558 * <p>
559 * Input: The Intent's data URI specifies the application package name
560 * to be shown, with the "package" scheme. That is "package:com.my.app".
561 * <p>
562 * Output: Nothing.
563 */
564 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
565 public static final String ACTION_APPLICATION_DETAILS_SETTINGS =
566 "android.settings.APPLICATION_DETAILS_SETTINGS";
567
568 /**
Dianne Hackborn35654b62013-01-14 17:38:02 -0800569 * @hide
570 * Activity Action: Show the "app ops" settings screen.
571 * <p>
572 * Input: Nothing.
573 * <p>
574 * Output: Nothing.
575 */
576 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
577 public static final String ACTION_APP_OPS_SETTINGS =
578 "android.settings.APP_OPS_SETTINGS";
579
580 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800581 * Activity Action: Show settings for system update functionality.
582 * <p>
583 * In some cases, a matching Activity may not exist, so ensure you
584 * safeguard against this.
585 * <p>
586 * Input: Nothing.
587 * <p>
588 * Output: Nothing.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700589 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800590 * @hide
591 */
592 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
593 public static final String ACTION_SYSTEM_UPDATE_SETTINGS =
594 "android.settings.SYSTEM_UPDATE_SETTINGS";
595
596 /**
597 * Activity Action: Show settings to allow configuration of sync settings.
598 * <p>
599 * In some cases, a matching Activity may not exist, so ensure you
600 * safeguard against this.
601 * <p>
Erikeebc8e22010-02-18 13:27:19 -0800602 * The account types available to add via the add account button may be restricted by adding an
603 * {@link #EXTRA_AUTHORITIES} extra to this Intent with one or more syncable content provider's
604 * authorities. Only account types which can sync with that content provider will be offered to
605 * the user.
606 * <p>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800607 * Input: Nothing.
608 * <p>
609 * Output: Nothing.
610 */
611 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
612 public static final String ACTION_SYNC_SETTINGS =
613 "android.settings.SYNC_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700614
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800615 /**
Erikeebc8e22010-02-18 13:27:19 -0800616 * Activity Action: Show add account screen for creating a new account.
617 * <p>
618 * In some cases, a matching Activity may not exist, so ensure you
619 * safeguard against this.
620 * <p>
621 * The account types available to add may be restricted by adding an {@link #EXTRA_AUTHORITIES}
622 * extra to the Intent with one or more syncable content provider's authorities. Only account
623 * types which can sync with that content provider will be offered to the user.
624 * <p>
Alon Albert50359c22013-02-26 14:47:48 -0800625 * Account types can also be filtered by adding an {@link #EXTRA_ACCOUNT_TYPES} extra to the
626 * Intent with one or more account types.
627 * <p>
Erikeebc8e22010-02-18 13:27:19 -0800628 * Input: Nothing.
629 * <p>
630 * Output: Nothing.
631 */
632 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
633 public static final String ACTION_ADD_ACCOUNT =
634 "android.settings.ADD_ACCOUNT_SETTINGS";
635
636 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800637 * Activity Action: Show settings for selecting the network operator.
638 * <p>
639 * In some cases, a matching Activity may not exist, so ensure you
640 * safeguard against this.
641 * <p>
642 * Input: Nothing.
643 * <p>
644 * Output: Nothing.
645 */
646 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
647 public static final String ACTION_NETWORK_OPERATOR_SETTINGS =
648 "android.settings.NETWORK_OPERATOR_SETTINGS";
649
650 /**
651 * Activity Action: Show settings for selection of 2G/3G.
652 * <p>
653 * In some cases, a matching Activity may not exist, so ensure you
654 * safeguard against this.
655 * <p>
656 * Input: Nothing.
657 * <p>
658 * Output: Nothing.
659 */
660 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
661 public static final String ACTION_DATA_ROAMING_SETTINGS =
662 "android.settings.DATA_ROAMING_SETTINGS";
663
664 /**
665 * Activity Action: Show settings for internal storage.
666 * <p>
667 * In some cases, a matching Activity may not exist, so ensure you
668 * safeguard against this.
669 * <p>
670 * Input: Nothing.
671 * <p>
672 * Output: Nothing.
673 */
674 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
675 public static final String ACTION_INTERNAL_STORAGE_SETTINGS =
676 "android.settings.INTERNAL_STORAGE_SETTINGS";
677 /**
678 * Activity Action: Show settings for memory card storage.
679 * <p>
680 * In some cases, a matching Activity may not exist, so ensure you
681 * safeguard against this.
682 * <p>
683 * Input: Nothing.
684 * <p>
685 * Output: Nothing.
686 */
687 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
688 public static final String ACTION_MEMORY_CARD_SETTINGS =
689 "android.settings.MEMORY_CARD_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700690
Justin Mattsonef340352010-01-13 21:05:46 -0800691 /**
692 * Activity Action: Show settings for global search.
693 * <p>
694 * In some cases, a matching Activity may not exist, so ensure you
695 * safeguard against this.
696 * <p>
697 * Input: Nothing.
698 * <p>
699 * Output: Nothing
700 */
701 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
702 public static final String ACTION_SEARCH_SETTINGS =
703 "android.search.action.SEARCH_SETTINGS";
704
Daniel Sandler9d8b8762010-01-22 20:50:15 -0500705 /**
706 * Activity Action: Show general device information settings (serial
707 * number, software version, phone number, etc.).
708 * <p>
709 * In some cases, a matching Activity may not exist, so ensure you
710 * safeguard against this.
711 * <p>
712 * Input: Nothing.
713 * <p>
714 * Output: Nothing
715 */
716 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
717 public static final String ACTION_DEVICE_INFO_SETTINGS =
718 "android.settings.DEVICE_INFO_SETTINGS";
719
Martijn Coenen9b3c83f2011-07-28 11:21:39 -0500720 /**
Nick Pellycccf01d2011-10-31 14:49:40 -0700721 * Activity Action: Show NFC settings.
722 * <p>
723 * This shows UI that allows NFC to be turned on or off.
Martijn Coenen9b3c83f2011-07-28 11:21:39 -0500724 * <p>
725 * In some cases, a matching Activity may not exist, so ensure you
726 * safeguard against this.
727 * <p>
728 * Input: Nothing.
729 * <p>
730 * Output: Nothing
Nick Pellycccf01d2011-10-31 14:49:40 -0700731 * @see android.nfc.NfcAdapter#isEnabled()
732 */
733 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
734 public static final String ACTION_NFC_SETTINGS = "android.settings.NFC_SETTINGS";
735
736 /**
737 * Activity Action: Show NFC Sharing settings.
738 * <p>
739 * This shows UI that allows NDEF Push (Android Beam) to be turned on or
740 * off.
741 * <p>
742 * In some cases, a matching Activity may not exist, so ensure you
743 * safeguard against this.
744 * <p>
745 * Input: Nothing.
746 * <p>
747 * Output: Nothing
748 * @see android.nfc.NfcAdapter#isNdefPushEnabled()
Martijn Coenen9b3c83f2011-07-28 11:21:39 -0500749 */
750 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
751 public static final String ACTION_NFCSHARING_SETTINGS =
752 "android.settings.NFCSHARING_SETTINGS";
753
Daniel Sandlerc08cd022012-11-27 22:47:37 -0500754 /**
Martijn Coenen62c196a2013-08-09 13:43:34 -0700755 * Activity Action: Show NFC Tap & Pay settings
756 * <p>
757 * This shows UI that allows the user to configure Tap&Pay
758 * settings.
759 * <p>
760 * In some cases, a matching Activity may not exist, so ensure you
761 * safeguard against this.
762 * <p>
763 * Input: Nothing.
764 * <p>
765 * Output: Nothing
766 */
767 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
768 public static final String ACTION_NFC_PAYMENT_SETTINGS =
769 "android.settings.NFC_PAYMENT_SETTINGS";
770
771 /**
Daniel Sandlerc08cd022012-11-27 22:47:37 -0500772 * Activity Action: Show Daydream settings.
773 * <p>
774 * In some cases, a matching Activity may not exist, so ensure you
775 * safeguard against this.
776 * <p>
777 * Input: Nothing.
778 * <p>
779 * Output: Nothing.
780 * @see android.service.dreams.DreamService
Daniel Sandlerc08cd022012-11-27 22:47:37 -0500781 */
782 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
783 public static final String ACTION_DREAM_SETTINGS = "android.settings.DREAM_SETTINGS";
784
Daniel Sandler5feceeb2013-03-22 18:29:23 -0700785 /**
786 * Activity Action: Show Notification listener settings.
787 * <p>
788 * In some cases, a matching Activity may not exist, so ensure you
789 * safeguard against this.
790 * <p>
791 * Input: Nothing.
792 * <p>
793 * Output: Nothing.
794 * @see android.service.notification.NotificationListenerService
Daniel Sandler5feceeb2013-03-22 18:29:23 -0700795 */
796 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
797 public static final String ACTION_NOTIFICATION_LISTENER_SETTINGS
Chris Wren8326a8a2014-10-22 14:13:32 -0400798 = "android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS";
Daniel Sandler5feceeb2013-03-22 18:29:23 -0700799
Alan Viverette69ce69b2013-08-29 12:23:48 -0700800 /**
John Spurlock7340fc82014-04-24 18:50:12 -0400801 * @hide
802 */
803 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
804 public static final String ACTION_CONDITION_PROVIDER_SETTINGS
805 = "android.settings.ACTION_CONDITION_PROVIDER_SETTINGS";
806
807 /**
Alan Viverette69ce69b2013-08-29 12:23:48 -0700808 * Activity Action: Show settings for video captioning.
809 * <p>
810 * In some cases, a matching Activity may not exist, so ensure you safeguard
811 * against this.
812 * <p>
813 * Input: Nothing.
814 * <p>
815 * Output: Nothing.
816 */
817 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
818 public static final String ACTION_CAPTIONING_SETTINGS = "android.settings.CAPTIONING_SETTINGS";
819
Svetoslav773f54d2013-09-03 14:01:43 -0700820 /**
821 * Activity Action: Show the top level print settings.
822 * <p>
823 * In some cases, a matching Activity may not exist, so ensure you
824 * safeguard against this.
825 * <p>
826 * Input: Nothing.
827 * <p>
828 * Output: Nothing.
829 */
830 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
831 public static final String ACTION_PRINT_SETTINGS =
832 "android.settings.ACTION_PRINT_SETTINGS";
833
John Spurlockde547002014-02-28 17:50:39 -0500834 /**
835 * Activity Action: Show Zen Mode configuration settings.
836 *
837 * @hide
838 */
839 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
840 public static final String ACTION_ZEN_MODE_SETTINGS = "android.settings.ZEN_MODE_SETTINGS";
841
Santos Cordona4c75242014-07-09 12:07:51 -0700842 /**
843 * Activity Action: Show the regulatory information screen for the device.
844 * <p>
845 * In some cases, a matching Activity may not exist, so ensure you safeguard
846 * against this.
847 * <p>
848 * Input: Nothing.
849 * <p>
850 * Output: Nothing.
851 */
Jeff Sharkeydd77fda2014-04-16 17:23:08 -0700852 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
853 public static final String
854 ACTION_SHOW_REGULATORY_INFO = "android.settings.SHOW_REGULATORY_INFO";
855
Jerome Poichet7974cb32014-05-14 12:04:43 -0700856 /**
857 * Activity Action: Show Device Name Settings.
858 * <p>
859 * In some cases, a matching Activity may not exist, so ensure you safeguard
Tim Kilbourn87cd0dc2014-04-14 15:37:51 -0700860 * against this.
Jerome Poichet7974cb32014-05-14 12:04:43 -0700861 *
862 * @hide
863 */
864 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
865 public static final String DEVICE_NAME_SETTINGS = "android.settings.DEVICE_NAME";
866
Tim Kilbourn87cd0dc2014-04-14 15:37:51 -0700867 /**
868 * Activity Action: Show pairing settings.
869 * <p>
870 * In some cases, a matching Activity may not exist, so ensure you safeguard
871 * against this.
872 *
873 * @hide
874 */
875 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
876 public static final String ACTION_PAIRING_SETTINGS = "android.settings.PAIRING_SETTINGS";
877
John Spurlockf8f524c2014-06-10 14:47:29 -0400878 /**
879 * Activity Action: Show battery saver settings.
John Spurlock73466662014-10-30 13:42:05 -0400880 * <p>
881 * In some cases, a matching Activity may not exist, so ensure you safeguard
882 * against this.
John Spurlockf8f524c2014-06-10 14:47:29 -0400883 */
884 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
885 public static final String ACTION_BATTERY_SAVER_SETTINGS
886 = "android.settings.BATTERY_SAVER_SETTINGS";
887
Amith Yamasanieb7b94a2014-07-14 18:02:08 -0700888 /**
889 * Activity Action: Show Home selection settings. If there are multiple activities
890 * that can satisfy the {@link Intent#CATEGORY_HOME} intent, this screen allows you
891 * to pick your preferred activity.
892 */
893 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
894 public static final String ACTION_HOME_SETTINGS
895 = "android.settings.HOME_SETTINGS";
896
John Spurlock2b0e09c2014-07-27 13:27:47 -0400897 /**
898 * Activity Action: Show notification settings.
899 *
900 * @hide
901 */
902 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
903 public static final String ACTION_NOTIFICATION_SETTINGS
904 = "android.settings.NOTIFICATION_SETTINGS";
905
906 /**
907 * Activity Action: Show notification settings for a single app.
908 *
909 * @hide
910 */
911 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
912 public static final String ACTION_APP_NOTIFICATION_SETTINGS
913 = "android.settings.APP_NOTIFICATION_SETTINGS";
914
Chris Wrencd8f4f72014-08-27 18:48:13 -0400915 /**
916 * Activity Action: Show notification redaction settings.
917 *
918 * @hide
919 */
920 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
921 public static final String ACTION_APP_NOTIFICATION_REDACTION
922 = "android.settings.ACTION_APP_NOTIFICATION_REDACTION";
923
John Spurlock2b0e09c2014-07-27 13:27:47 -0400924 /** @hide */ public static final String EXTRA_APP_UID = "app_uid";
925 /** @hide */ public static final String EXTRA_APP_PACKAGE = "app_package";
926
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800927 // End of Intent actions for Settings
928
Erikeebc8e22010-02-18 13:27:19 -0800929 /**
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800930 * @hide - Private call() method on SettingsProvider to read from 'system' table.
931 */
932 public static final String CALL_METHOD_GET_SYSTEM = "GET_system";
933
934 /**
935 * @hide - Private call() method on SettingsProvider to read from 'secure' table.
936 */
937 public static final String CALL_METHOD_GET_SECURE = "GET_secure";
938
939 /**
Christopher Tate06efb532012-08-24 15:29:27 -0700940 * @hide - Private call() method on SettingsProvider to read from 'global' table.
941 */
942 public static final String CALL_METHOD_GET_GLOBAL = "GET_global";
943
944 /**
945 * @hide - User handle argument extra to the fast-path call()-based requests
946 */
947 public static final String CALL_METHOD_USER_KEY = "_user";
948
949 /** @hide - Private call() method to write to 'system' table */
950 public static final String CALL_METHOD_PUT_SYSTEM = "PUT_system";
951
952 /** @hide - Private call() method to write to 'secure' table */
953 public static final String CALL_METHOD_PUT_SECURE = "PUT_secure";
954
955 /** @hide - Private call() method to write to 'global' table */
956 public static final String CALL_METHOD_PUT_GLOBAL= "PUT_global";
957
958 /**
Erikeebc8e22010-02-18 13:27:19 -0800959 * Activity Extra: Limit available options in launched activity based on the given authority.
960 * <p>
961 * This can be passed as an extra field in an Activity Intent with one or more syncable content
962 * provider's authorities as a String[]. This field is used by some intents to alter the
963 * behavior of the called activity.
964 * <p>
965 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types available based
966 * on the authority given.
967 */
Alon Albert50359c22013-02-26 14:47:48 -0800968 public static final String EXTRA_AUTHORITIES = "authorities";
969
Alon Albertd35bf1f2013-04-18 14:26:51 -0700970 /**
971 * Activity Extra: Limit available options in launched activity based on the given account
972 * types.
973 * <p>
974 * This can be passed as an extra field in an Activity Intent with one or more account types
975 * as a String[]. This field is used by some intents to alter the behavior of the called
976 * activity.
977 * <p>
978 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types to the specified
979 * list.
980 */
Alon Albert50359c22013-02-26 14:47:48 -0800981 public static final String EXTRA_ACCOUNT_TYPES = "account_types";
Erikeebc8e22010-02-18 13:27:19 -0800982
Tadashi G. Takaoka25480202011-01-20 23:13:02 +0900983 public static final String EXTRA_INPUT_METHOD_ID = "input_method_id";
984
Barnaby James48f35522014-07-16 14:27:39 -0700985 /**
Michael Wrightc93fbd12014-09-22 20:07:59 -0700986 * Activity Extra: The device identifier to act upon.
987 * <p>
988 * This can be passed as an extra field in an Activity Intent with a single
989 * InputDeviceIdentifier. This field is used by some activities to jump straight into the
990 * settings for the given device.
991 * <p>
Dianne Hackbornad6a99b2014-11-18 10:11:10 -0800992 * Example: The {@link #ACTION_INPUT_METHOD_SETTINGS} intent opens the keyboard layout
993 * dialog for the given device.
Michael Wrightc93fbd12014-09-22 20:07:59 -0700994 * @hide
995 */
996 public static final String EXTRA_INPUT_DEVICE_IDENTIFIER = "input_device_identifier";
997
998 /**
Barnaby James48f35522014-07-16 14:27:39 -0700999 * Activity Extra: Enable or disable Airplane Mode.
1000 * <p>
1001 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_AIRPLANE_MODE}
1002 * intent as a boolean.
1003 */
1004 public static final String EXTRA_AIRPLANE_MODE_ENABLED = "airplane_mode_enabled";
1005
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001006 private static final String JID_RESOURCE_PREFIX = "android";
1007
1008 public static final String AUTHORITY = "settings";
1009
1010 private static final String TAG = "Settings";
Christopher Tate06efb532012-08-24 15:29:27 -07001011 private static final boolean LOCAL_LOGV = false;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001012
David Christie3f7b6522013-08-06 19:19:08 -07001013 // Lock ensures that when enabling/disabling the master location switch, we don't end up
1014 // with a partial enable/disable state in multi-threaded situations.
1015 private static final Object mLocationSettingsLock = new Object();
1016
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001017 public static class SettingNotFoundException extends AndroidException {
1018 public SettingNotFoundException(String msg) {
1019 super(msg);
1020 }
1021 }
1022
1023 /**
1024 * Common base for tables of name/value settings.
1025 */
1026 public static class NameValueTable implements BaseColumns {
1027 public static final String NAME = "name";
1028 public static final String VALUE = "value";
1029
1030 protected static boolean putString(ContentResolver resolver, Uri uri,
1031 String name, String value) {
1032 // The database will take care of replacing duplicates.
1033 try {
1034 ContentValues values = new ContentValues();
1035 values.put(NAME, name);
1036 values.put(VALUE, value);
1037 resolver.insert(uri, values);
1038 return true;
1039 } catch (SQLException e) {
Dianne Hackborna33e3f72009-09-29 17:28:24 -07001040 Log.w(TAG, "Can't set key " + name + " in " + uri, e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001041 return false;
1042 }
1043 }
1044
1045 public static Uri getUriFor(Uri uri, String name) {
1046 return Uri.withAppendedPath(uri, name);
1047 }
1048 }
1049
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001050 // Thread-safe.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001051 private static class NameValueCache {
1052 private final String mVersionSystemProperty;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001053 private final Uri mUri;
1054
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001055 private static final String[] SELECT_VALUE =
1056 new String[] { Settings.NameValueTable.VALUE };
1057 private static final String NAME_EQ_PLACEHOLDER = "name=?";
1058
1059 // Must synchronize on 'this' to access mValues and mValuesVersion.
Dan Egnor799f7212009-11-24 16:24:44 -08001060 private final HashMap<String, String> mValues = new HashMap<String, String>();
1061 private long mValuesVersion = 0;
1062
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001063 // Initially null; set lazily and held forever. Synchronized on 'this'.
1064 private IContentProvider mContentProvider = null;
1065
1066 // The method we'll call (or null, to not use) on the provider
1067 // for the fast path of retrieving settings.
Christopher Tate06efb532012-08-24 15:29:27 -07001068 private final String mCallGetCommand;
1069 private final String mCallSetCommand;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001070
Christopher Tate06efb532012-08-24 15:29:27 -07001071 public NameValueCache(String versionSystemProperty, Uri uri,
1072 String getCommand, String setCommand) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001073 mVersionSystemProperty = versionSystemProperty;
1074 mUri = uri;
Christopher Tate06efb532012-08-24 15:29:27 -07001075 mCallGetCommand = getCommand;
1076 mCallSetCommand = setCommand;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001077 }
1078
Christopher Tate06efb532012-08-24 15:29:27 -07001079 private IContentProvider lazyGetProvider(ContentResolver cr) {
1080 IContentProvider cp = null;
1081 synchronized (this) {
1082 cp = mContentProvider;
1083 if (cp == null) {
1084 cp = mContentProvider = cr.acquireProvider(mUri.getAuthority());
1085 }
1086 }
1087 return cp;
1088 }
1089
1090 public boolean putStringForUser(ContentResolver cr, String name, String value,
1091 final int userHandle) {
1092 try {
1093 Bundle arg = new Bundle();
1094 arg.putString(Settings.NameValueTable.VALUE, value);
Christopher Tated5fe1472012-09-10 15:48:38 -07001095 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
Christopher Tate06efb532012-08-24 15:29:27 -07001096 IContentProvider cp = lazyGetProvider(cr);
Dianne Hackborn35654b62013-01-14 17:38:02 -08001097 cp.call(cr.getPackageName(), mCallSetCommand, name, arg);
Christopher Tate06efb532012-08-24 15:29:27 -07001098 } catch (RemoteException e) {
1099 Log.w(TAG, "Can't set key " + name + " in " + mUri, e);
1100 return false;
1101 }
1102 return true;
1103 }
1104
Christopher Tate06efb532012-08-24 15:29:27 -07001105 public String getStringForUser(ContentResolver cr, String name, final int userHandle) {
Christopher Tate78d2a662012-09-13 16:19:44 -07001106 final boolean isSelf = (userHandle == UserHandle.myUserId());
1107 if (isSelf) {
1108 long newValuesVersion = SystemProperties.getLong(mVersionSystemProperty, 0);
Dan Egnor799f7212009-11-24 16:24:44 -08001109
Christopher Tate78d2a662012-09-13 16:19:44 -07001110 // Our own user's settings data uses a client-side cache
1111 synchronized (this) {
1112 if (mValuesVersion != newValuesVersion) {
1113 if (LOCAL_LOGV || false) {
1114 Log.v(TAG, "invalidate [" + mUri.getLastPathSegment() + "]: current "
1115 + newValuesVersion + " != cached " + mValuesVersion);
1116 }
1117
1118 mValues.clear();
1119 mValuesVersion = newValuesVersion;
Dan Egnor799f7212009-11-24 16:24:44 -08001120 }
1121
Christopher Tate78d2a662012-09-13 16:19:44 -07001122 if (mValues.containsKey(name)) {
1123 return mValues.get(name); // Could be null, that's OK -- negative caching
1124 }
Dan Egnor799f7212009-11-24 16:24:44 -08001125 }
Christopher Tate78d2a662012-09-13 16:19:44 -07001126 } else {
1127 if (LOCAL_LOGV) Log.v(TAG, "get setting for user " + userHandle
1128 + " by user " + UserHandle.myUserId() + " so skipping cache");
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001129 }
Dan Egnor799f7212009-11-24 16:24:44 -08001130
Christopher Tate06efb532012-08-24 15:29:27 -07001131 IContentProvider cp = lazyGetProvider(cr);
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001132
1133 // Try the fast path first, not using query(). If this
1134 // fails (alternate Settings provider that doesn't support
1135 // this interface?) then we fall back to the query/table
1136 // interface.
Christopher Tate06efb532012-08-24 15:29:27 -07001137 if (mCallGetCommand != null) {
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001138 try {
Christopher Tate06efb532012-08-24 15:29:27 -07001139 Bundle args = null;
Christopher Tate5e08af02012-09-21 17:17:22 -07001140 if (!isSelf) {
Christopher Tate06efb532012-08-24 15:29:27 -07001141 args = new Bundle();
1142 args.putInt(CALL_METHOD_USER_KEY, userHandle);
1143 }
Dianne Hackborn35654b62013-01-14 17:38:02 -08001144 Bundle b = cp.call(cr.getPackageName(), mCallGetCommand, name, args);
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001145 if (b != null) {
1146 String value = b.getPairValue();
Christopher Tate78d2a662012-09-13 16:19:44 -07001147 // Don't update our cache for reads of other users' data
1148 if (isSelf) {
1149 synchronized (this) {
1150 mValues.put(name, value);
1151 }
1152 } else {
1153 if (LOCAL_LOGV) Log.i(TAG, "call-query of user " + userHandle
1154 + " by " + UserHandle.myUserId()
1155 + " so not updating cache");
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001156 }
1157 return value;
1158 }
1159 // If the response Bundle is null, we fall through
1160 // to the query interface below.
1161 } catch (RemoteException e) {
1162 // Not supported by the remote side? Fall through
1163 // to query().
1164 }
1165 }
1166
Dan Egnor799f7212009-11-24 16:24:44 -08001167 Cursor c = null;
1168 try {
Dianne Hackborn35654b62013-01-14 17:38:02 -08001169 c = cp.query(cr.getPackageName(), mUri, SELECT_VALUE, NAME_EQ_PLACEHOLDER,
Jeff Brown75ea64f2012-01-25 19:37:13 -08001170 new String[]{name}, null, null);
Dan Egnor799f7212009-11-24 16:24:44 -08001171 if (c == null) {
1172 Log.w(TAG, "Can't get key " + name + " from " + mUri);
1173 return null;
1174 }
1175
1176 String value = c.moveToNext() ? c.getString(0) : null;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001177 synchronized (this) {
Dan Egnor799f7212009-11-24 16:24:44 -08001178 mValues.put(name, value);
1179 }
1180 if (LOCAL_LOGV) {
1181 Log.v(TAG, "cache miss [" + mUri.getLastPathSegment() + "]: " +
1182 name + " = " + (value == null ? "(null)" : value));
1183 }
1184 return value;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001185 } catch (RemoteException e) {
Dan Egnor799f7212009-11-24 16:24:44 -08001186 Log.w(TAG, "Can't get key " + name + " from " + mUri, e);
1187 return null; // Return null, but don't cache it.
1188 } finally {
1189 if (c != null) c.close();
1190 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001191 }
1192 }
1193
1194 /**
1195 * System settings, containing miscellaneous system preferences. This
1196 * table holds simple name/value pairs. There are convenience
1197 * functions for accessing individual settings entries.
1198 */
1199 public static final class System extends NameValueTable {
1200 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_system_version";
1201
Svetoslav683914b2015-01-15 14:22:26 -08001202 /** @hide */
1203 public static interface Validator {
1204 public boolean validate(String value);
1205 }
1206
Dianne Hackborn139748f2012-09-24 11:36:57 -07001207 /**
1208 * The content:// style URL for this table
1209 */
1210 public static final Uri CONTENT_URI =
1211 Uri.parse("content://" + AUTHORITY + "/system");
1212
1213 private static final NameValueCache sNameValueCache = new NameValueCache(
1214 SYS_PROP_SETTING_VERSION,
1215 CONTENT_URI,
1216 CALL_METHOD_GET_SYSTEM,
1217 CALL_METHOD_PUT_SYSTEM);
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001218
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001219 private static final HashSet<String> MOVED_TO_SECURE;
1220 static {
1221 MOVED_TO_SECURE = new HashSet<String>(30);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001222 MOVED_TO_SECURE.add(Secure.ANDROID_ID);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001223 MOVED_TO_SECURE.add(Secure.HTTP_PROXY);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001224 MOVED_TO_SECURE.add(Secure.LOCATION_PROVIDERS_ALLOWED);
Danielle Millett925a7d82012-03-19 18:02:20 -04001225 MOVED_TO_SECURE.add(Secure.LOCK_BIOMETRIC_WEAK_FLAGS);
Amith Yamasani156c4352010-03-05 17:10:03 -08001226 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_ENABLED);
1227 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_VISIBLE);
1228 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001229 MOVED_TO_SECURE.add(Secure.LOGGING_ID);
1230 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_ENABLED);
1231 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_LAST_UPDATE);
1232 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_REDIRECT_URL);
1233 MOVED_TO_SECURE.add(Secure.SETTINGS_CLASSNAME);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001234 MOVED_TO_SECURE.add(Secure.USE_GOOGLE_MAIL);
1235 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
1236 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
1237 MOVED_TO_SECURE.add(Secure.WIFI_NUM_OPEN_NETWORKS_KEPT);
1238 MOVED_TO_SECURE.add(Secure.WIFI_ON);
1239 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE);
1240 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_AP_COUNT);
1241 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS);
1242 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED);
1243 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS);
1244 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT);
1245 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_MAX_AP_CHECKS);
1246 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ON);
1247 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_COUNT);
1248 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_DELAY_MS);
1249 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS);
Christopher Tateaa036a22014-05-19 16:33:27 -07001250
1251 // At one time in System, then Global, but now back in Secure
1252 MOVED_TO_SECURE.add(Secure.INSTALL_NON_MARKET_APPS);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001253 }
1254
Christopher Tate06efb532012-08-24 15:29:27 -07001255 private static final HashSet<String> MOVED_TO_GLOBAL;
Christopher Tate66488d62012-10-02 11:58:01 -07001256 private static final HashSet<String> MOVED_TO_SECURE_THEN_GLOBAL;
Christopher Tate06efb532012-08-24 15:29:27 -07001257 static {
1258 MOVED_TO_GLOBAL = new HashSet<String>();
Christopher Tate66488d62012-10-02 11:58:01 -07001259 MOVED_TO_SECURE_THEN_GLOBAL = new HashSet<String>();
1260
Christopher Tate92198742012-09-07 12:00:13 -07001261 // these were originally in system but migrated to secure in the past,
1262 // so are duplicated in the Secure.* namespace
Christopher Tate66488d62012-10-02 11:58:01 -07001263 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.ADB_ENABLED);
1264 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.BLUETOOTH_ON);
1265 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DATA_ROAMING);
1266 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DEVICE_PROVISIONED);
Christopher Tate66488d62012-10-02 11:58:01 -07001267 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.USB_MASS_STORAGE_ENABLED);
1268 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.HTTP_PROXY);
Christopher Tate06efb532012-08-24 15:29:27 -07001269
Christopher Tate92198742012-09-07 12:00:13 -07001270 // these are moving directly from system to global
Christopher Tate06efb532012-08-24 15:29:27 -07001271 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_ON);
1272 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_RADIOS);
1273 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS);
1274 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME);
1275 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME_ZONE);
1276 MOVED_TO_GLOBAL.add(Settings.Global.CAR_DOCK_SOUND);
1277 MOVED_TO_GLOBAL.add(Settings.Global.CAR_UNDOCK_SOUND);
1278 MOVED_TO_GLOBAL.add(Settings.Global.DESK_DOCK_SOUND);
1279 MOVED_TO_GLOBAL.add(Settings.Global.DESK_UNDOCK_SOUND);
1280 MOVED_TO_GLOBAL.add(Settings.Global.DOCK_SOUNDS_ENABLED);
1281 MOVED_TO_GLOBAL.add(Settings.Global.LOCK_SOUND);
1282 MOVED_TO_GLOBAL.add(Settings.Global.UNLOCK_SOUND);
1283 MOVED_TO_GLOBAL.add(Settings.Global.LOW_BATTERY_SOUND);
1284 MOVED_TO_GLOBAL.add(Settings.Global.POWER_SOUNDS_ENABLED);
1285 MOVED_TO_GLOBAL.add(Settings.Global.STAY_ON_WHILE_PLUGGED_IN);
1286 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SLEEP_POLICY);
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07001287 MOVED_TO_GLOBAL.add(Settings.Global.MODE_RINGER);
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001288 MOVED_TO_GLOBAL.add(Settings.Global.WINDOW_ANIMATION_SCALE);
1289 MOVED_TO_GLOBAL.add(Settings.Global.TRANSITION_ANIMATION_SCALE);
1290 MOVED_TO_GLOBAL.add(Settings.Global.ANIMATOR_DURATION_SCALE);
1291 MOVED_TO_GLOBAL.add(Settings.Global.FANCY_IME_ANIMATIONS);
1292 MOVED_TO_GLOBAL.add(Settings.Global.COMPATIBILITY_MODE);
1293 MOVED_TO_GLOBAL.add(Settings.Global.EMERGENCY_TONE);
1294 MOVED_TO_GLOBAL.add(Settings.Global.CALL_AUTO_RETRY);
1295 MOVED_TO_GLOBAL.add(Settings.Global.DEBUG_APP);
1296 MOVED_TO_GLOBAL.add(Settings.Global.WAIT_FOR_DEBUGGER);
1297 MOVED_TO_GLOBAL.add(Settings.Global.SHOW_PROCESSES);
1298 MOVED_TO_GLOBAL.add(Settings.Global.ALWAYS_FINISH_ACTIVITIES);
Geremy Condraa0735112013-03-26 21:49:26 -07001299 MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_CONTENT_URL);
1300 MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_METADATA_URL);
1301 MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_CONTENT_URL);
1302 MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_METADATA_URL);
1303 MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_CONTENT_URL);
1304 MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_METADATA_URL);
1305 MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_CONTENT_URL);
1306 MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_METADATA_URL);
Christopher Tate06efb532012-08-24 15:29:27 -07001307 }
1308
Svetoslav683914b2015-01-15 14:22:26 -08001309 private static final Validator sBooleanValidator =
1310 new DiscreteValueValidator(new String[] {"0", "1"});
1311
1312 private static final Validator sNonNegativeIntegerValidator = new Validator() {
1313 @Override
1314 public boolean validate(String value) {
1315 try {
1316 return Integer.parseInt(value) >= 0;
1317 } catch (NumberFormatException e) {
1318 return false;
1319 }
1320 }
1321 };
1322
Svetoslav683914b2015-01-15 14:22:26 -08001323 private static final Validator sUriValidator = new Validator() {
1324 @Override
1325 public boolean validate(String value) {
1326 try {
1327 Uri.decode(value);
1328 return true;
1329 } catch (IllegalArgumentException e) {
1330 return false;
1331 }
1332 }
1333 };
1334
1335 private static final Validator sLenientIpAddressValidator = new Validator() {
1336 private static final int MAX_IPV6_LENGTH = 45;
1337
1338 @Override
1339 public boolean validate(String value) {
1340 return value.length() <= MAX_IPV6_LENGTH;
1341 }
1342 };
1343
Christopher Tate66488d62012-10-02 11:58:01 -07001344 /** @hide */
Svetoslav683914b2015-01-15 14:22:26 -08001345 public static void getMovedToGlobalSettings(Set<String> outKeySet) {
Christopher Tate66488d62012-10-02 11:58:01 -07001346 outKeySet.addAll(MOVED_TO_GLOBAL);
1347 outKeySet.addAll(MOVED_TO_SECURE_THEN_GLOBAL);
1348 }
1349
1350 /** @hide */
Svetoslav683914b2015-01-15 14:22:26 -08001351 public static void getMovedToSecureSettings(Set<String> outKeySet) {
1352 outKeySet.addAll(MOVED_TO_SECURE);
1353 }
1354
1355 /** @hide */
Christopher Tate66488d62012-10-02 11:58:01 -07001356 public static void getNonLegacyMovedKeys(HashSet<String> outKeySet) {
1357 outKeySet.addAll(MOVED_TO_GLOBAL);
1358 }
1359
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001360 /**
1361 * Look up a name in the database.
1362 * @param resolver to access the database with
1363 * @param name to look up in the table
1364 * @return the corresponding value, or null if not present
1365 */
Dianne Hackborn139748f2012-09-24 11:36:57 -07001366 public static String getString(ContentResolver resolver, String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07001367 return getStringForUser(resolver, name, UserHandle.myUserId());
1368 }
1369
1370 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -07001371 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -07001372 int userHandle) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001373 if (MOVED_TO_SECURE.contains(name)) {
1374 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1375 + " to android.provider.Settings.Secure, returning read-only value.");
Christopher Tate06efb532012-08-24 15:29:27 -07001376 return Secure.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001377 }
Christopher Tate66488d62012-10-02 11:58:01 -07001378 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07001379 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1380 + " to android.provider.Settings.Global, returning read-only value.");
1381 return Global.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001382 }
Christopher Tate06efb532012-08-24 15:29:27 -07001383 return sNameValueCache.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001384 }
1385
1386 /**
1387 * Store a name/value pair into the database.
1388 * @param resolver to access the database with
1389 * @param name to store
1390 * @param value to associate with the name
1391 * @return true if the value was set, false on database errors
1392 */
1393 public static boolean putString(ContentResolver resolver, String name, String value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001394 return putStringForUser(resolver, name, value, UserHandle.myUserId());
1395 }
1396
1397 /** @hide */
1398 public static boolean putStringForUser(ContentResolver resolver, String name, String value,
1399 int userHandle) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001400 if (MOVED_TO_SECURE.contains(name)) {
1401 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1402 + " to android.provider.Settings.Secure, value is unchanged.");
1403 return false;
1404 }
Christopher Tate66488d62012-10-02 11:58:01 -07001405 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07001406 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1407 + " to android.provider.Settings.Global, value is unchanged.");
1408 return false;
1409 }
Christopher Tate06efb532012-08-24 15:29:27 -07001410 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001411 }
1412
1413 /**
1414 * Construct the content URI for a particular name/value pair,
1415 * useful for monitoring changes with a ContentObserver.
1416 * @param name to look up in the table
1417 * @return the corresponding content URI, or null if not present
1418 */
1419 public static Uri getUriFor(String name) {
1420 if (MOVED_TO_SECURE.contains(name)) {
1421 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1422 + " to android.provider.Settings.Secure, returning Secure URI.");
1423 return Secure.getUriFor(Secure.CONTENT_URI, name);
1424 }
Christopher Tate66488d62012-10-02 11:58:01 -07001425 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07001426 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1427 + " to android.provider.Settings.Global, returning read-only global URI.");
1428 return Global.getUriFor(Global.CONTENT_URI, name);
1429 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001430 return getUriFor(CONTENT_URI, name);
1431 }
1432
1433 /**
1434 * Convenience function for retrieving a single system settings value
1435 * as an integer. Note that internally setting values are always
1436 * stored as strings; this function converts the string to an integer
1437 * for you. The default value will be returned if the setting is
1438 * not defined or not an integer.
1439 *
1440 * @param cr The ContentResolver to access.
1441 * @param name The name of the setting to retrieve.
1442 * @param def Value to return if the setting is not defined.
1443 *
1444 * @return The setting's current value, or 'def' if it is not defined
1445 * or not a valid integer.
1446 */
1447 public static int getInt(ContentResolver cr, String name, int def) {
Christopher Tate06efb532012-08-24 15:29:27 -07001448 return getIntForUser(cr, name, def, UserHandle.myUserId());
1449 }
1450
1451 /** @hide */
1452 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
1453 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001454 try {
1455 return v != null ? Integer.parseInt(v) : def;
1456 } catch (NumberFormatException e) {
1457 return def;
1458 }
1459 }
1460
1461 /**
1462 * Convenience function for retrieving a single system settings value
1463 * as an integer. Note that internally setting values are always
1464 * stored as strings; this function converts the string to an integer
1465 * for you.
1466 * <p>
1467 * This version does not take a default value. If the setting has not
1468 * been set, or the string value is not a number,
1469 * it throws {@link SettingNotFoundException}.
1470 *
1471 * @param cr The ContentResolver to access.
1472 * @param name The name of the setting to retrieve.
1473 *
1474 * @throws SettingNotFoundException Thrown if a setting by the given
1475 * name can't be found or the setting value is not an integer.
1476 *
1477 * @return The setting's current value.
1478 */
1479 public static int getInt(ContentResolver cr, String name)
1480 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07001481 return getIntForUser(cr, name, UserHandle.myUserId());
1482 }
1483
1484 /** @hide */
1485 public static int getIntForUser(ContentResolver cr, String name, int userHandle)
1486 throws SettingNotFoundException {
1487 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001488 try {
1489 return Integer.parseInt(v);
1490 } catch (NumberFormatException e) {
1491 throw new SettingNotFoundException(name);
1492 }
1493 }
1494
1495 /**
1496 * Convenience function for updating a single settings value as an
1497 * integer. This will either create a new entry in the table if the
1498 * given name does not exist, or modify the value of the existing row
1499 * with that name. Note that internally setting values are always
1500 * stored as strings, so this function converts the given value to a
1501 * string before storing it.
1502 *
1503 * @param cr The ContentResolver to access.
1504 * @param name The name of the setting to modify.
1505 * @param value The new value for the setting.
1506 * @return true if the value was set, false on database errors
1507 */
1508 public static boolean putInt(ContentResolver cr, String name, int value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001509 return putIntForUser(cr, name, value, UserHandle.myUserId());
1510 }
1511
1512 /** @hide */
1513 public static boolean putIntForUser(ContentResolver cr, String name, int value,
1514 int userHandle) {
1515 return putStringForUser(cr, name, Integer.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001516 }
1517
1518 /**
1519 * Convenience function for retrieving a single system settings value
1520 * as a {@code long}. Note that internally setting values are always
1521 * stored as strings; this function converts the string to a {@code long}
1522 * for you. The default value will be returned if the setting is
1523 * not defined or not a {@code long}.
1524 *
1525 * @param cr The ContentResolver to access.
1526 * @param name The name of the setting to retrieve.
1527 * @param def Value to return if the setting is not defined.
1528 *
1529 * @return The setting's current value, or 'def' if it is not defined
1530 * or not a valid {@code long}.
1531 */
1532 public static long getLong(ContentResolver cr, String name, long def) {
Christopher Tate06efb532012-08-24 15:29:27 -07001533 return getLongForUser(cr, name, def, UserHandle.myUserId());
1534 }
1535
1536 /** @hide */
1537 public static long getLongForUser(ContentResolver cr, String name, long def,
1538 int userHandle) {
1539 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001540 long value;
1541 try {
1542 value = valString != null ? Long.parseLong(valString) : def;
1543 } catch (NumberFormatException e) {
1544 value = def;
1545 }
1546 return value;
1547 }
1548
1549 /**
1550 * Convenience function for retrieving a single system settings value
1551 * as a {@code long}. Note that internally setting values are always
1552 * stored as strings; this function converts the string to a {@code long}
1553 * for you.
1554 * <p>
1555 * This version does not take a default value. If the setting has not
1556 * been set, or the string value is not a number,
1557 * it throws {@link SettingNotFoundException}.
1558 *
1559 * @param cr The ContentResolver to access.
1560 * @param name The name of the setting to retrieve.
1561 *
1562 * @return The setting's current value.
1563 * @throws SettingNotFoundException Thrown if a setting by the given
1564 * name can't be found or the setting value is not an integer.
1565 */
1566 public static long getLong(ContentResolver cr, String name)
1567 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07001568 return getLongForUser(cr, name, UserHandle.myUserId());
1569 }
1570
1571 /** @hide */
1572 public static long getLongForUser(ContentResolver cr, String name, int userHandle)
1573 throws SettingNotFoundException {
1574 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001575 try {
1576 return Long.parseLong(valString);
1577 } catch (NumberFormatException e) {
1578 throw new SettingNotFoundException(name);
1579 }
1580 }
1581
1582 /**
1583 * Convenience function for updating a single settings value as a long
1584 * integer. This will either create a new entry in the table if the
1585 * given name does not exist, or modify the value of the existing row
1586 * with that name. Note that internally setting values are always
1587 * stored as strings, so this function converts the given value to a
1588 * string before storing it.
1589 *
1590 * @param cr The ContentResolver to access.
1591 * @param name The name of the setting to modify.
1592 * @param value The new value for the setting.
1593 * @return true if the value was set, false on database errors
1594 */
1595 public static boolean putLong(ContentResolver cr, String name, long value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001596 return putLongForUser(cr, name, value, UserHandle.myUserId());
1597 }
1598
1599 /** @hide */
1600 public static boolean putLongForUser(ContentResolver cr, String name, long value,
1601 int userHandle) {
1602 return putStringForUser(cr, name, Long.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001603 }
1604
1605 /**
1606 * Convenience function for retrieving a single system settings value
1607 * as a floating point number. Note that internally setting values are
1608 * always stored as strings; this function converts the string to an
1609 * float for you. The default value will be returned if the setting
1610 * is not defined or not a valid float.
1611 *
1612 * @param cr The ContentResolver to access.
1613 * @param name The name of the setting to retrieve.
1614 * @param def Value to return if the setting is not defined.
1615 *
1616 * @return The setting's current value, or 'def' if it is not defined
1617 * or not a valid float.
1618 */
1619 public static float getFloat(ContentResolver cr, String name, float def) {
Christopher Tate06efb532012-08-24 15:29:27 -07001620 return getFloatForUser(cr, name, def, UserHandle.myUserId());
1621 }
1622
1623 /** @hide */
1624 public static float getFloatForUser(ContentResolver cr, String name, float def,
1625 int userHandle) {
1626 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001627 try {
1628 return v != null ? Float.parseFloat(v) : def;
1629 } catch (NumberFormatException e) {
1630 return def;
1631 }
1632 }
1633
1634 /**
1635 * Convenience function for retrieving a single system settings value
1636 * as a float. Note that internally setting values are always
1637 * stored as strings; this function converts the string to a float
1638 * for you.
1639 * <p>
1640 * This version does not take a default value. If the setting has not
1641 * been set, or the string value is not a number,
1642 * it throws {@link SettingNotFoundException}.
1643 *
1644 * @param cr The ContentResolver to access.
1645 * @param name The name of the setting to retrieve.
1646 *
1647 * @throws SettingNotFoundException Thrown if a setting by the given
1648 * name can't be found or the setting value is not a float.
1649 *
1650 * @return The setting's current value.
1651 */
1652 public static float getFloat(ContentResolver cr, String name)
1653 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07001654 return getFloatForUser(cr, name, UserHandle.myUserId());
1655 }
1656
1657 /** @hide */
1658 public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
1659 throws SettingNotFoundException {
1660 String v = getStringForUser(cr, name, userHandle);
Brian Muramatsue1d46982010-12-06 17:34:20 -08001661 if (v == null) {
1662 throw new SettingNotFoundException(name);
1663 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001664 try {
1665 return Float.parseFloat(v);
1666 } catch (NumberFormatException e) {
1667 throw new SettingNotFoundException(name);
1668 }
1669 }
1670
1671 /**
1672 * Convenience function for updating a single settings value as a
1673 * floating point number. This will either create a new entry in the
1674 * table if the given name does not exist, or modify the value of the
1675 * existing row with that name. Note that internally setting values
1676 * are always stored as strings, so this function converts the given
1677 * value to a string before storing it.
1678 *
1679 * @param cr The ContentResolver to access.
1680 * @param name The name of the setting to modify.
1681 * @param value The new value for the setting.
1682 * @return true if the value was set, false on database errors
1683 */
1684 public static boolean putFloat(ContentResolver cr, String name, float value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001685 return putFloatForUser(cr, name, value, UserHandle.myUserId());
1686 }
1687
1688 /** @hide */
1689 public static boolean putFloatForUser(ContentResolver cr, String name, float value,
1690 int userHandle) {
1691 return putStringForUser(cr, name, Float.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001692 }
1693
1694 /**
1695 * Convenience function to read all of the current
1696 * configuration-related settings into a
1697 * {@link Configuration} object.
1698 *
1699 * @param cr The ContentResolver to access.
1700 * @param outConfig Where to place the configuration settings.
1701 */
1702 public static void getConfiguration(ContentResolver cr, Configuration outConfig) {
Christopher Tate06efb532012-08-24 15:29:27 -07001703 getConfigurationForUser(cr, outConfig, UserHandle.myUserId());
1704 }
1705
1706 /** @hide */
1707 public static void getConfigurationForUser(ContentResolver cr, Configuration outConfig,
1708 int userHandle) {
1709 outConfig.fontScale = Settings.System.getFloatForUser(
1710 cr, FONT_SCALE, outConfig.fontScale, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001711 if (outConfig.fontScale < 0) {
1712 outConfig.fontScale = 1;
1713 }
1714 }
1715
1716 /**
Dianne Hackborn31ca8542011-07-19 14:58:28 -07001717 * @hide Erase the fields in the Configuration that should be applied
1718 * by the settings.
1719 */
1720 public static void clearConfiguration(Configuration inoutConfig) {
1721 inoutConfig.fontScale = 0;
1722 }
Narayan Kamath6d632962011-08-24 11:51:37 +01001723
Dianne Hackborn31ca8542011-07-19 14:58:28 -07001724 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001725 * Convenience function to write a batch of configuration-related
1726 * settings from a {@link Configuration} object.
1727 *
1728 * @param cr The ContentResolver to access.
1729 * @param config The settings to write.
1730 * @return true if the values were set, false on database errors
1731 */
1732 public static boolean putConfiguration(ContentResolver cr, Configuration config) {
Christopher Tate06efb532012-08-24 15:29:27 -07001733 return putConfigurationForUser(cr, config, UserHandle.myUserId());
1734 }
1735
1736 /** @hide */
1737 public static boolean putConfigurationForUser(ContentResolver cr, Configuration config,
1738 int userHandle) {
1739 return Settings.System.putFloatForUser(cr, FONT_SCALE, config.fontScale, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001740 }
1741
Dianne Hackbornb8b11a02010-03-10 15:53:11 -08001742 /** @hide */
1743 public static boolean hasInterestingConfigurationChanges(int changes) {
1744 return (changes&ActivityInfo.CONFIG_FONT_SCALE) != 0;
1745 }
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07001746
Christopher Tate06efb532012-08-24 15:29:27 -07001747 /** @deprecated - Do not use */
1748 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001749 public static boolean getShowGTalkServiceStatus(ContentResolver cr) {
Christopher Tate06efb532012-08-24 15:29:27 -07001750 return getShowGTalkServiceStatusForUser(cr, UserHandle.myUserId());
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001751 }
1752
Christopher Tate06efb532012-08-24 15:29:27 -07001753 /**
1754 * @hide
1755 * @deprecated - Do not use
1756 */
1757 public static boolean getShowGTalkServiceStatusForUser(ContentResolver cr,
1758 int userHandle) {
1759 return getIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, 0, userHandle) != 0;
1760 }
1761
1762 /** @deprecated - Do not use */
1763 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001764 public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag) {
Christopher Tatec8c08382012-09-19 17:18:18 -07001765 setShowGTalkServiceStatusForUser(cr, flag, UserHandle.myUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07001766 }
1767
1768 /**
1769 * @hide
1770 * @deprecated - Do not use
1771 */
1772 @Deprecated
1773 public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean flag,
1774 int userHandle) {
1775 putIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, flag ? 1 : 0, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001776 }
1777
Svetoslav683914b2015-01-15 14:22:26 -08001778 private static final class DiscreteValueValidator implements Validator {
1779 private final String[] mValues;
1780
1781 public DiscreteValueValidator(String[] values) {
1782 mValues = values;
1783 }
1784
Svetoslav1b71ea92015-02-17 18:20:29 -08001785 @Override
Svetoslav683914b2015-01-15 14:22:26 -08001786 public boolean validate(String value) {
1787 return ArrayUtils.contains(mValues, value);
1788 }
1789 }
1790
1791 private static final class InclusiveIntegerRangeValidator implements Validator {
1792 private final int mMin;
1793 private final int mMax;
1794
1795 public InclusiveIntegerRangeValidator(int min, int max) {
1796 mMin = min;
1797 mMax = max;
1798 }
1799
Svetoslav1b71ea92015-02-17 18:20:29 -08001800 @Override
Svetoslav683914b2015-01-15 14:22:26 -08001801 public boolean validate(String value) {
1802 try {
1803 final int intValue = Integer.parseInt(value);
1804 return intValue >= mMin && intValue <= mMax;
1805 } catch (NumberFormatException e) {
1806 return false;
1807 }
1808 }
1809 }
1810
1811 private static final class InclusiveFloatRangeValidator implements Validator {
1812 private final float mMin;
1813 private final float mMax;
1814
1815 public InclusiveFloatRangeValidator(float min, float max) {
1816 mMin = min;
1817 mMax = max;
1818 }
1819
Svetoslav1b71ea92015-02-17 18:20:29 -08001820 @Override
Svetoslav683914b2015-01-15 14:22:26 -08001821 public boolean validate(String value) {
1822 try {
1823 final float floatValue = Float.parseFloat(value);
1824 return floatValue >= mMin && floatValue <= mMax;
1825 } catch (NumberFormatException e) {
1826 return false;
1827 }
1828 }
1829 }
1830
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001831 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001832 * @deprecated Use {@link android.provider.Settings.Global#STAY_ON_WHILE_PLUGGED_IN} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001833 */
Christopher Tate06efb532012-08-24 15:29:27 -07001834 @Deprecated
1835 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 -08001836
1837 /**
1838 * What happens when the user presses the end call button if they're not
1839 * on a call.<br/>
1840 * <b>Values:</b><br/>
1841 * 0 - The end button does nothing.<br/>
1842 * 1 - The end button goes to the home screen.<br/>
1843 * 2 - The end button puts the device to sleep and locks the keyguard.<br/>
1844 * 3 - The end button goes to the home screen. If the user is already on the
1845 * home screen, it puts the device to sleep.
1846 */
1847 public static final String END_BUTTON_BEHAVIOR = "end_button_behavior";
1848
Svetoslav683914b2015-01-15 14:22:26 -08001849 private static final Validator END_BUTTON_BEHAVIOR_VALIDATOR =
1850 new InclusiveIntegerRangeValidator(0, 3);
1851
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001852 /**
David Brown458e8062010-03-08 21:52:11 -08001853 * END_BUTTON_BEHAVIOR value for "go home".
1854 * @hide
1855 */
1856 public static final int END_BUTTON_BEHAVIOR_HOME = 0x1;
1857
1858 /**
1859 * END_BUTTON_BEHAVIOR value for "go to sleep".
1860 * @hide
1861 */
1862 public static final int END_BUTTON_BEHAVIOR_SLEEP = 0x2;
1863
1864 /**
1865 * END_BUTTON_BEHAVIOR default value.
1866 * @hide
1867 */
1868 public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_SLEEP;
1869
1870 /**
Joe Onorato9cdffa12011-04-06 18:27:27 -07001871 * Is advanced settings mode turned on. 0 == no, 1 == yes
1872 * @hide
1873 */
1874 public static final String ADVANCED_SETTINGS = "advanced_settings";
1875
Svetoslav683914b2015-01-15 14:22:26 -08001876 private static final Validator ADVANCED_SETTINGS_VALIDATOR = sBooleanValidator;
1877
Joe Onorato9cdffa12011-04-06 18:27:27 -07001878 /**
1879 * ADVANCED_SETTINGS default value.
1880 * @hide
1881 */
1882 public static final int ADVANCED_SETTINGS_DEFAULT = 0;
1883
1884 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001885 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001886 */
Christopher Tate06efb532012-08-24 15:29:27 -07001887 @Deprecated
1888 public static final String AIRPLANE_MODE_ON = Global.AIRPLANE_MODE_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001889
1890 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001891 * @deprecated Use {@link android.provider.Settings.Global#RADIO_BLUETOOTH} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001892 */
Christopher Tate06efb532012-08-24 15:29:27 -07001893 @Deprecated
1894 public static final String RADIO_BLUETOOTH = Global.RADIO_BLUETOOTH;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001895
1896 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001897 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIFI} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001898 */
Christopher Tate06efb532012-08-24 15:29:27 -07001899 @Deprecated
1900 public static final String RADIO_WIFI = Global.RADIO_WIFI;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001901
Robert Greenwalt8588e472011-11-08 10:12:25 -08001902 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001903 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIMAX} instead
Robert Greenwalt8588e472011-11-08 10:12:25 -08001904 * {@hide}
1905 */
Christopher Tate06efb532012-08-24 15:29:27 -07001906 @Deprecated
1907 public static final String RADIO_WIMAX = Global.RADIO_WIMAX;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001908
1909 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001910 * @deprecated Use {@link android.provider.Settings.Global#RADIO_CELL} instead
Nick Pelly8d32a012011-08-09 07:03:49 -07001911 */
Christopher Tate06efb532012-08-24 15:29:27 -07001912 @Deprecated
1913 public static final String RADIO_CELL = Global.RADIO_CELL;
Nick Pelly8d32a012011-08-09 07:03:49 -07001914
1915 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001916 * @deprecated Use {@link android.provider.Settings.Global#RADIO_NFC} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001917 */
Christopher Tate06efb532012-08-24 15:29:27 -07001918 @Deprecated
1919 public static final String RADIO_NFC = Global.RADIO_NFC;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001920
1921 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001922 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_RADIOS} instead
1923 */
1924 @Deprecated
1925 public static final String AIRPLANE_MODE_RADIOS = Global.AIRPLANE_MODE_RADIOS;
1926
1927 /**
1928 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_TOGGLEABLE_RADIOS} instead
Mike Lockwoodbd5ddf02009-07-29 21:37:14 -07001929 *
1930 * {@hide}
1931 */
Christopher Tate06efb532012-08-24 15:29:27 -07001932 @Deprecated
1933 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS =
1934 Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS;
Mike Lockwoodbd5ddf02009-07-29 21:37:14 -07001935
1936 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001937 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001938 */
Christopher Tate06efb532012-08-24 15:29:27 -07001939 @Deprecated
1940 public static final String WIFI_SLEEP_POLICY = Global.WIFI_SLEEP_POLICY;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001941
1942 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001943 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_DEFAULT} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001944 */
Christopher Tate06efb532012-08-24 15:29:27 -07001945 @Deprecated
1946 public static final int WIFI_SLEEP_POLICY_DEFAULT = Global.WIFI_SLEEP_POLICY_DEFAULT;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001947
1948 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001949 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001950 */
Christopher Tate06efb532012-08-24 15:29:27 -07001951 @Deprecated
1952 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED =
1953 Global.WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001954
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001955 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001956 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001957 */
Christopher Tate06efb532012-08-24 15:29:27 -07001958 @Deprecated
1959 public static final int WIFI_SLEEP_POLICY_NEVER = Global.WIFI_SLEEP_POLICY_NEVER;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001960
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07001961 /**
1962 * @deprecated Use {@link android.provider.Settings.Global#MODE_RINGER} instead
1963 */
1964 @Deprecated
1965 public static final String MODE_RINGER = Global.MODE_RINGER;
1966
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001967 /**
1968 * Whether to use static IP and other static network attributes.
1969 * <p>
1970 * Set to 1 for true and 0 for false.
Jeff Sharkey625239a2012-09-26 22:03:49 -07001971 *
1972 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001973 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07001974 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001975 public static final String WIFI_USE_STATIC_IP = "wifi_use_static_ip";
1976
Svetoslav683914b2015-01-15 14:22:26 -08001977 private static final Validator WIFI_USE_STATIC_IP_VALIDATOR = sBooleanValidator;
1978
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001979 /**
1980 * The static IP address.
1981 * <p>
1982 * Example: "192.168.1.51"
Jeff Sharkey625239a2012-09-26 22:03:49 -07001983 *
1984 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001985 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07001986 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001987 public static final String WIFI_STATIC_IP = "wifi_static_ip";
1988
Svetoslav683914b2015-01-15 14:22:26 -08001989 private static final Validator WIFI_STATIC_IP_VALIDATOR = sLenientIpAddressValidator;
1990
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001991 /**
1992 * If using static IP, the gateway's IP address.
1993 * <p>
1994 * Example: "192.168.1.1"
Jeff Sharkey625239a2012-09-26 22:03:49 -07001995 *
1996 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001997 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07001998 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001999 public static final String WIFI_STATIC_GATEWAY = "wifi_static_gateway";
2000
Svetoslav683914b2015-01-15 14:22:26 -08002001 private static final Validator WIFI_STATIC_GATEWAY_VALIDATOR = sLenientIpAddressValidator;
2002
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002003 /**
2004 * If using static IP, the net mask.
2005 * <p>
2006 * Example: "255.255.255.0"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002007 *
2008 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002009 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002010 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002011 public static final String WIFI_STATIC_NETMASK = "wifi_static_netmask";
2012
Svetoslav683914b2015-01-15 14:22:26 -08002013 private static final Validator WIFI_STATIC_NETMASK_VALIDATOR = sLenientIpAddressValidator;
2014
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002015 /**
2016 * If using static IP, the primary DNS's IP address.
2017 * <p>
2018 * Example: "192.168.1.1"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002019 *
2020 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002021 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002022 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002023 public static final String WIFI_STATIC_DNS1 = "wifi_static_dns1";
2024
Svetoslav683914b2015-01-15 14:22:26 -08002025 private static final Validator WIFI_STATIC_DNS1_VALIDATOR = sLenientIpAddressValidator;
2026
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002027 /**
2028 * If using static IP, the secondary DNS's IP address.
2029 * <p>
2030 * Example: "192.168.1.2"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002031 *
2032 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002033 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002034 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002035 public static final String WIFI_STATIC_DNS2 = "wifi_static_dns2";
2036
Svetoslav683914b2015-01-15 14:22:26 -08002037 private static final Validator WIFI_STATIC_DNS2_VALIDATOR = sLenientIpAddressValidator;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002038
2039 /**
2040 * Determines whether remote devices may discover and/or connect to
2041 * this device.
2042 * <P>Type: INT</P>
2043 * 2 -- discoverable and connectable
2044 * 1 -- connectable but not discoverable
2045 * 0 -- neither connectable nor discoverable
2046 */
2047 public static final String BLUETOOTH_DISCOVERABILITY =
2048 "bluetooth_discoverability";
2049
Svetoslav683914b2015-01-15 14:22:26 -08002050 private static final Validator BLUETOOTH_DISCOVERABILITY_VALIDATOR =
2051 new InclusiveIntegerRangeValidator(0, 2);
2052
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002053 /**
2054 * Bluetooth discoverability timeout. If this value is nonzero, then
2055 * Bluetooth becomes discoverable for a certain number of seconds,
2056 * after which is becomes simply connectable. The value is in seconds.
2057 */
2058 public static final String BLUETOOTH_DISCOVERABILITY_TIMEOUT =
2059 "bluetooth_discoverability_timeout";
2060
Svetoslav683914b2015-01-15 14:22:26 -08002061 private static final Validator BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR =
2062 sNonNegativeIntegerValidator;
2063
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002064 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08002065 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_ENABLED}
2066 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002067 */
Amith Yamasani156c4352010-03-05 17:10:03 -08002068 @Deprecated
2069 public static final String LOCK_PATTERN_ENABLED = Secure.LOCK_PATTERN_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002070
2071 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08002072 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_VISIBLE}
2073 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002074 */
Amith Yamasani156c4352010-03-05 17:10:03 -08002075 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002076 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
2077
2078 /**
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07002079 * @deprecated Use
Amith Yamasani156c4352010-03-05 17:10:03 -08002080 * {@link android.provider.Settings.Secure#LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED}
2081 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002082 */
Amith Yamasani156c4352010-03-05 17:10:03 -08002083 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002084 public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED =
2085 "lock_pattern_tactile_feedback_enabled";
2086
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002087 /**
2088 * A formatted string of the next alarm that is set, or the empty string
2089 * if there is no alarm set.
Adrian Roosc42a1e12014-07-07 23:35:53 +02002090 *
2091 * @deprecated Use {@link android.app.AlarmManager#getNextAlarmClock()}.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002092 */
Adrian Roosc42a1e12014-07-07 23:35:53 +02002093 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002094 public static final String NEXT_ALARM_FORMATTED = "next_alarm_formatted";
2095
Svetoslav683914b2015-01-15 14:22:26 -08002096 private static final Validator NEXT_ALARM_FORMATTED_VALIDATOR = new Validator() {
2097 private static final int MAX_LENGTH = 1000;
Svetoslav1b71ea92015-02-17 18:20:29 -08002098
Svetoslav683914b2015-01-15 14:22:26 -08002099 @Override
2100 public boolean validate(String value) {
2101 // TODO: No idea what the correct format is.
Svetoslav64d6e9c2015-02-12 11:30:36 -08002102 return value == null || value.length() < MAX_LENGTH;
Svetoslav683914b2015-01-15 14:22:26 -08002103 }
2104 };
2105
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002106 /**
2107 * Scaling factor for fonts, float.
2108 */
2109 public static final String FONT_SCALE = "font_scale";
2110
Svetoslav683914b2015-01-15 14:22:26 -08002111 private static final Validator FONT_SCALE_VALIDATOR = new Validator() {
2112 @Override
2113 public boolean validate(String value) {
2114 try {
2115 return Float.parseFloat(value) >= 0;
2116 } catch (NumberFormatException e) {
2117 return false;
2118 }
2119 }
2120 };
2121
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002122 /**
2123 * Name of an application package to be debugged.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002124 *
2125 * @deprecated Use {@link Global#DEBUG_APP} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002126 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002127 @Deprecated
2128 public static final String DEBUG_APP = Global.DEBUG_APP;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002129
2130 /**
2131 * If 1, when launching DEBUG_APP it will wait for the debugger before
2132 * starting user code. If 0, it will run normally.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002133 *
2134 * @deprecated Use {@link Global#WAIT_FOR_DEBUGGER} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002135 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002136 @Deprecated
2137 public static final String WAIT_FOR_DEBUGGER = Global.WAIT_FOR_DEBUGGER;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002138
2139 /**
2140 * Whether or not to dim the screen. 0=no 1=yes
Jeff Brown96307042012-07-27 15:51:34 -07002141 * @deprecated This setting is no longer used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002142 */
Jeff Brown96307042012-07-27 15:51:34 -07002143 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002144 public static final String DIM_SCREEN = "dim_screen";
2145
Svetoslav683914b2015-01-15 14:22:26 -08002146 private static final Validator DIM_SCREEN_VALIDATOR = sBooleanValidator;
2147
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002148 /**
Jeff Brown05af6ad2014-09-30 20:54:30 -07002149 * The amount of time in milliseconds before the device goes to sleep or begins
2150 * to dream after a period of inactivity. This value is also known as the
2151 * user activity timeout period since the screen isn't necessarily turned off
2152 * when it expires.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002153 */
2154 public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout";
2155
Svetoslav683914b2015-01-15 14:22:26 -08002156 private static final Validator SCREEN_OFF_TIMEOUT_VALIDATOR = sNonNegativeIntegerValidator;
2157
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002158 /**
2159 * The screen backlight brightness between 0 and 255.
2160 */
2161 public static final String SCREEN_BRIGHTNESS = "screen_brightness";
2162
Svetoslav683914b2015-01-15 14:22:26 -08002163 private static final Validator SCREEN_BRIGHTNESS_VALIDATOR =
2164 new InclusiveIntegerRangeValidator(0, 255);
2165
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002166 /**
Dan Murphy951764b2009-08-27 14:59:03 -05002167 * Control whether to enable automatic brightness mode.
Dan Murphy951764b2009-08-27 14:59:03 -05002168 */
2169 public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode";
2170
Svetoslav683914b2015-01-15 14:22:26 -08002171 private static final Validator SCREEN_BRIGHTNESS_MODE_VALIDATOR = sBooleanValidator;
2172
Dan Murphy951764b2009-08-27 14:59:03 -05002173 /**
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08002174 * Adjustment to auto-brightness to make it generally more (>0.0 <1.0)
2175 * or less (<0.0 >-1.0) bright.
Dianne Hackborn518a3d82012-05-09 16:30:49 -07002176 * @hide
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08002177 */
2178 public static final String SCREEN_AUTO_BRIGHTNESS_ADJ = "screen_auto_brightness_adj";
2179
Svetoslav683914b2015-01-15 14:22:26 -08002180 private static final Validator SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR =
2181 new InclusiveFloatRangeValidator(-1, 1);
2182
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08002183 /**
Mike Lockwooddc3494e2009-10-14 21:17:09 -07002184 * SCREEN_BRIGHTNESS_MODE value for manual mode.
Mike Lockwooddc3494e2009-10-14 21:17:09 -07002185 */
2186 public static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0;
2187
2188 /**
Scott Main52bfc242012-02-09 10:09:14 -08002189 * SCREEN_BRIGHTNESS_MODE value for automatic mode.
Mike Lockwooddc3494e2009-10-14 21:17:09 -07002190 */
2191 public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1;
2192
2193 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002194 * Control whether the process CPU usage meter should be shown.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002195 *
2196 * @deprecated Use {@link Global#SHOW_PROCESSES} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002197 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002198 @Deprecated
2199 public static final String SHOW_PROCESSES = Global.SHOW_PROCESSES;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002200
2201 /**
2202 * If 1, the activity manager will aggressively finish activities and
2203 * processes as soon as they are no longer needed. If 0, the normal
2204 * extended lifetime is used.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002205 *
2206 * @deprecated Use {@link Global#ALWAYS_FINISH_ACTIVITIES} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002207 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002208 @Deprecated
2209 public static final String ALWAYS_FINISH_ACTIVITIES = Global.ALWAYS_FINISH_ACTIVITIES;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002210
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002211 /**
2212 * Determines which streams are affected by ringer mode changes. The
2213 * stream type's bit should be set to 1 if it should be muted when going
2214 * into an inaudible ringer mode.
2215 */
2216 public static final String MODE_RINGER_STREAMS_AFFECTED = "mode_ringer_streams_affected";
2217
Svetoslav683914b2015-01-15 14:22:26 -08002218 private static final Validator MODE_RINGER_STREAMS_AFFECTED_VALIDATOR =
2219 sNonNegativeIntegerValidator;
2220
2221 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002222 * Determines which streams are affected by mute. The
2223 * stream type's bit should be set to 1 if it should be muted when a mute request
2224 * is received.
2225 */
Svetoslav683914b2015-01-15 14:22:26 -08002226 public static final String MUTE_STREAMS_AFFECTED = "mute_streams_affected";
2227
2228 private static final Validator MUTE_STREAMS_AFFECTED_VALIDATOR =
2229 sNonNegativeIntegerValidator;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002230
2231 /**
2232 * Whether vibrate is on for different events. This is used internally,
2233 * changing this value will not change the vibrate. See AudioManager.
2234 */
2235 public static final String VIBRATE_ON = "vibrate_on";
2236
Svetoslav683914b2015-01-15 14:22:26 -08002237 private static final Validator VIBRATE_ON_VALIDATOR = sBooleanValidator;
2238
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002239 /**
Jeff Brown7f6c2312012-04-13 20:38:38 -07002240 * If 1, redirects the system vibrator to all currently attached input devices
2241 * that support vibration. If there are no such input devices, then the system
2242 * vibrator is used instead.
2243 * If 0, does not register the system vibrator.
2244 *
2245 * This setting is mainly intended to provide a compatibility mechanism for
2246 * applications that only know about the system vibrator and do not use the
2247 * input device vibrator API.
2248 *
2249 * @hide
2250 */
2251 public static final String VIBRATE_INPUT_DEVICES = "vibrate_input_devices";
2252
Svetoslav683914b2015-01-15 14:22:26 -08002253 private static final Validator VIBRATE_INPUT_DEVICES_VALIDATOR = sBooleanValidator;
2254
Jeff Brown7f6c2312012-04-13 20:38:38 -07002255 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002256 * Ringer volume. This is used internally, changing this value will not
2257 * change the volume. See AudioManager.
2258 */
2259 public static final String VOLUME_RING = "volume_ring";
2260
2261 /**
2262 * System/notifications volume. This is used internally, changing this
2263 * value will not change the volume. See AudioManager.
2264 */
2265 public static final String VOLUME_SYSTEM = "volume_system";
2266
2267 /**
2268 * Voice call volume. This is used internally, changing this value will
2269 * not change the volume. See AudioManager.
2270 */
2271 public static final String VOLUME_VOICE = "volume_voice";
2272
2273 /**
2274 * Music/media/gaming volume. This is used internally, changing this
2275 * value will not change the volume. See AudioManager.
2276 */
2277 public static final String VOLUME_MUSIC = "volume_music";
2278
2279 /**
2280 * Alarm volume. This is used internally, changing this
2281 * value will not change the volume. See AudioManager.
2282 */
2283 public static final String VOLUME_ALARM = "volume_alarm";
2284
2285 /**
2286 * Notification volume. This is used internally, changing this
2287 * value will not change the volume. See AudioManager.
2288 */
2289 public static final String VOLUME_NOTIFICATION = "volume_notification";
2290
2291 /**
Eric Laurent484d2882009-12-08 09:05:45 -08002292 * Bluetooth Headset volume. This is used internally, changing this value will
2293 * not change the volume. See AudioManager.
2294 */
2295 public static final String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco";
2296
2297 /**
Mike Lockwood8517e462011-10-25 14:47:19 -04002298 * Master volume (float in the range 0.0f to 1.0f).
2299 * @hide
2300 */
2301 public static final String VOLUME_MASTER = "volume_master";
2302
Svetoslav1b71ea92015-02-17 18:20:29 -08002303 private static final Validator VOLUME_MASTER_VALIDATOR =
2304 new InclusiveFloatRangeValidator(0, 1);
Svetoslav683914b2015-01-15 14:22:26 -08002305
Mike Lockwood8517e462011-10-25 14:47:19 -04002306 /**
Justin Koh57978ed2012-04-03 17:37:58 -07002307 * Master volume mute (int 1 = mute, 0 = not muted).
2308 *
2309 * @hide
2310 */
2311 public static final String VOLUME_MASTER_MUTE = "volume_master_mute";
2312
Svetoslav683914b2015-01-15 14:22:26 -08002313 private static final Validator VOLUME_MASTER_MUTE_VALIDATOR = sBooleanValidator;
2314
Justin Koh57978ed2012-04-03 17:37:58 -07002315 /**
Julia Reynoldsb53453f2014-08-22 11:42:43 -04002316 * Microphone mute (int 1 = mute, 0 = not muted).
2317 *
2318 * @hide
2319 */
2320 public static final String MICROPHONE_MUTE = "microphone_mute";
2321
Svetoslav683914b2015-01-15 14:22:26 -08002322 private static final Validator MICROPHONE_MUTE_VALIDATOR = sBooleanValidator;
2323
Julia Reynoldsb53453f2014-08-22 11:42:43 -04002324 /**
Justin Koh57978ed2012-04-03 17:37:58 -07002325 * Whether the notifications should use the ring volume (value of 1) or
2326 * a separate notification volume (value of 0). In most cases, users
2327 * will have this enabled so the notification and ringer volumes will be
2328 * the same. However, power users can disable this and use the separate
2329 * notification volume control.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002330 * <p>
Justin Koh57978ed2012-04-03 17:37:58 -07002331 * Note: This is a one-off setting that will be removed in the future
2332 * when there is profile support. For this reason, it is kept hidden
2333 * from the public APIs.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002334 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002335 * @hide
Amith Yamasani42722bf2011-07-22 10:34:27 -07002336 * @deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002337 */
Gilles Debunnee90bed12011-08-30 14:28:27 -07002338 @Deprecated
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002339 public static final String NOTIFICATIONS_USE_RING_VOLUME =
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002340 "notifications_use_ring_volume";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002341
Svetoslav683914b2015-01-15 14:22:26 -08002342 private static final Validator NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR = sBooleanValidator;
2343
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002344 /**
Daniel Sandler6329bf72010-02-26 15:17:44 -05002345 * Whether silent mode should allow vibration feedback. This is used
2346 * internally in AudioService and the Sound settings activity to
2347 * coordinate decoupling of vibrate and silent modes. This setting
2348 * will likely be removed in a future release with support for
2349 * audio/vibe feedback profiles.
2350 *
Eric Laurentbffc3d12012-05-07 17:43:49 -07002351 * Not used anymore. On devices with vibrator, the user explicitly selects
2352 * silent or vibrate mode.
2353 * Kept for use by legacy database upgrade code in DatabaseHelper.
Daniel Sandler6329bf72010-02-26 15:17:44 -05002354 * @hide
2355 */
2356 public static final String VIBRATE_IN_SILENT = "vibrate_in_silent";
2357
Svetoslav683914b2015-01-15 14:22:26 -08002358 private static final Validator VIBRATE_IN_SILENT_VALIDATOR = sBooleanValidator;
2359
Daniel Sandler6329bf72010-02-26 15:17:44 -05002360 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002361 * The mapping of stream type (integer) to its setting.
2362 */
2363 public static final String[] VOLUME_SETTINGS = {
2364 VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC,
Eric Laurent484d2882009-12-08 09:05:45 -08002365 VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002366 };
2367
2368 /**
2369 * Appended to various volume related settings to record the previous
2370 * values before they the settings were affected by a silent/vibrate
2371 * ringer mode change.
2372 */
2373 public static final String APPEND_FOR_LAST_AUDIBLE = "_last_audible";
2374
2375 /**
2376 * Persistent store for the system-wide default ringtone URI.
2377 * <p>
2378 * If you need to play the default ringtone at any given time, it is recommended
2379 * you give {@link #DEFAULT_RINGTONE_URI} to the media player. It will resolve
2380 * to the set default ringtone at the time of playing.
2381 *
2382 * @see #DEFAULT_RINGTONE_URI
2383 */
2384 public static final String RINGTONE = "ringtone";
2385
Svetoslav683914b2015-01-15 14:22:26 -08002386 private static final Validator RINGTONE_VALIDATOR = sUriValidator;
2387
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002388 /**
2389 * A {@link Uri} that will point to the current default ringtone at any
2390 * given time.
2391 * <p>
2392 * If the current default ringtone is in the DRM provider and the caller
2393 * does not have permission, the exception will be a
2394 * FileNotFoundException.
2395 */
2396 public static final Uri DEFAULT_RINGTONE_URI = getUriFor(RINGTONE);
2397
2398 /**
2399 * Persistent store for the system-wide default notification sound.
2400 *
2401 * @see #RINGTONE
2402 * @see #DEFAULT_NOTIFICATION_URI
2403 */
2404 public static final String NOTIFICATION_SOUND = "notification_sound";
2405
Svetoslav683914b2015-01-15 14:22:26 -08002406 private static final Validator NOTIFICATION_SOUND_VALIDATOR = sUriValidator;
2407
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002408 /**
2409 * A {@link Uri} that will point to the current default notification
2410 * sound at any given time.
2411 *
2412 * @see #DEFAULT_RINGTONE_URI
2413 */
2414 public static final Uri DEFAULT_NOTIFICATION_URI = getUriFor(NOTIFICATION_SOUND);
2415
2416 /**
Patrick Scott3156bb002009-04-13 09:57:38 -07002417 * Persistent store for the system-wide default alarm alert.
2418 *
2419 * @see #RINGTONE
2420 * @see #DEFAULT_ALARM_ALERT_URI
2421 */
2422 public static final String ALARM_ALERT = "alarm_alert";
2423
Svetoslav683914b2015-01-15 14:22:26 -08002424 private static final Validator ALARM_ALERT_VALIDATOR = sUriValidator;
2425
Patrick Scott3156bb002009-04-13 09:57:38 -07002426 /**
2427 * A {@link Uri} that will point to the current default alarm alert at
2428 * any given time.
2429 *
2430 * @see #DEFAULT_ALARM_ALERT_URI
2431 */
2432 public static final Uri DEFAULT_ALARM_ALERT_URI = getUriFor(ALARM_ALERT);
2433
2434 /**
Jean-Michel Trivid589fea2011-04-15 11:28:10 -07002435 * Persistent store for the system default media button event receiver.
2436 *
2437 * @hide
2438 */
2439 public static final String MEDIA_BUTTON_RECEIVER = "media_button_receiver";
2440
Svetoslav683914b2015-01-15 14:22:26 -08002441 private static final Validator MEDIA_BUTTON_RECEIVER_VALIDATOR = new Validator() {
2442 @Override
2443 public boolean validate(String value) {
2444 try {
2445 ComponentName.unflattenFromString(value);
2446 return true;
2447 } catch (NullPointerException e) {
2448 return false;
2449 }
2450 }
2451 };
2452
Jean-Michel Trivid589fea2011-04-15 11:28:10 -07002453 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002454 * Setting to enable Auto Replace (AutoText) in text editors. 1 = On, 0 = Off
2455 */
2456 public static final String TEXT_AUTO_REPLACE = "auto_replace";
2457
Svetoslav683914b2015-01-15 14:22:26 -08002458 private static final Validator TEXT_AUTO_REPLACE_VALIDATOR = sBooleanValidator;
2459
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002460 /**
2461 * Setting to enable Auto Caps in text editors. 1 = On, 0 = Off
2462 */
2463 public static final String TEXT_AUTO_CAPS = "auto_caps";
2464
Svetoslav683914b2015-01-15 14:22:26 -08002465 private static final Validator TEXT_AUTO_CAPS_VALIDATOR = sBooleanValidator;
2466
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002467 /**
2468 * Setting to enable Auto Punctuate in text editors. 1 = On, 0 = Off. This
2469 * feature converts two spaces to a "." and space.
2470 */
2471 public static final String TEXT_AUTO_PUNCTUATE = "auto_punctuate";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002472
Svetoslav683914b2015-01-15 14:22:26 -08002473 private static final Validator TEXT_AUTO_PUNCTUATE_VALIDATOR = sBooleanValidator;
2474
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002475 /**
2476 * Setting to showing password characters in text editors. 1 = On, 0 = Off
2477 */
2478 public static final String TEXT_SHOW_PASSWORD = "show_password";
2479
Svetoslav683914b2015-01-15 14:22:26 -08002480 private static final Validator TEXT_SHOW_PASSWORD_VALIDATOR = sBooleanValidator;
2481
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002482 public static final String SHOW_GTALK_SERVICE_STATUS =
2483 "SHOW_GTALK_SERVICE_STATUS";
2484
Svetoslav683914b2015-01-15 14:22:26 -08002485 private static final Validator SHOW_GTALK_SERVICE_STATUS_VALIDATOR = sBooleanValidator;
2486
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002487 /**
2488 * Name of activity to use for wallpaper on the home screen.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002489 *
2490 * @deprecated Use {@link WallpaperManager} instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002491 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002492 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002493 public static final String WALLPAPER_ACTIVITY = "wallpaper_activity";
2494
Svetoslav683914b2015-01-15 14:22:26 -08002495 private static final Validator WALLPAPER_ACTIVITY_VALIDATOR = new Validator() {
2496 private static final int MAX_LENGTH = 1000;
2497
2498 @Override
2499 public boolean validate(String value) {
2500 if (value != null && value.length() > MAX_LENGTH) {
2501 return false;
2502 }
2503 return ComponentName.unflattenFromString(value) != null;
2504 }
2505 };
2506
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002507 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002508 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME}
2509 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002510 */
Christopher Tate06efb532012-08-24 15:29:27 -07002511 @Deprecated
2512 public static final String AUTO_TIME = Global.AUTO_TIME;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002513
2514 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002515 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME_ZONE}
2516 * instead
Amith Yamasaniad450be2010-09-16 16:47:00 -07002517 */
Christopher Tate06efb532012-08-24 15:29:27 -07002518 @Deprecated
2519 public static final String AUTO_TIME_ZONE = Global.AUTO_TIME_ZONE;
Amith Yamasaniad450be2010-09-16 16:47:00 -07002520
2521 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002522 * Display times as 12 or 24 hours
2523 * 12
2524 * 24
2525 */
2526 public static final String TIME_12_24 = "time_12_24";
2527
Svetoslav683914b2015-01-15 14:22:26 -08002528 /** @hide */
2529 public static final Validator TIME_12_24_VALIDATOR =
2530 new DiscreteValueValidator(new String[] {"12", "24"});
2531
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002532 /**
2533 * Date format string
2534 * mm/dd/yyyy
2535 * dd/mm/yyyy
2536 * yyyy/mm/dd
2537 */
2538 public static final String DATE_FORMAT = "date_format";
2539
Svetoslav683914b2015-01-15 14:22:26 -08002540 /** @hide */
2541 public static final Validator DATE_FORMAT_VALIDATOR = new Validator() {
2542 @Override
2543 public boolean validate(String value) {
2544 try {
2545 new SimpleDateFormat(value);
2546 return true;
2547 } catch (IllegalArgumentException e) {
2548 return false;
2549 }
2550 }
2551 };
2552
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002553 /**
2554 * Whether the setup wizard has been run before (on first boot), or if
2555 * it still needs to be run.
2556 *
2557 * nonzero = it has been run in the past
2558 * 0 = it has not been run in the past
2559 */
2560 public static final String SETUP_WIZARD_HAS_RUN = "setup_wizard_has_run";
2561
Svetoslav683914b2015-01-15 14:22:26 -08002562 /** @hide */
2563 public static final Validator SETUP_WIZARD_HAS_RUN_VALIDATOR = sBooleanValidator;
2564
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002565 /**
2566 * Scaling factor for normal window animations. Setting to 0 will disable window
2567 * animations.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002568 *
2569 * @deprecated Use {@link Global#WINDOW_ANIMATION_SCALE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002570 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002571 @Deprecated
2572 public static final String WINDOW_ANIMATION_SCALE = Global.WINDOW_ANIMATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002573
2574 /**
2575 * Scaling factor for activity transition animations. Setting to 0 will disable window
2576 * animations.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002577 *
2578 * @deprecated Use {@link Global#TRANSITION_ANIMATION_SCALE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002579 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002580 @Deprecated
2581 public static final String TRANSITION_ANIMATION_SCALE = Global.TRANSITION_ANIMATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002582
2583 /**
Chet Haasec38fa1f2012-02-01 16:37:46 -08002584 * Scaling factor for Animator-based animations. This affects both the start delay and
2585 * duration of all such animations. Setting to 0 will cause animations to end immediately.
2586 * The default value is 1.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002587 *
2588 * @deprecated Use {@link Global#ANIMATOR_DURATION_SCALE} instead
Chet Haasec38fa1f2012-02-01 16:37:46 -08002589 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002590 @Deprecated
2591 public static final String ANIMATOR_DURATION_SCALE = Global.ANIMATOR_DURATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002592
2593 /**
2594 * Control whether the accelerometer will be used to change screen
2595 * orientation. If 0, it will not be used unless explicitly requested
2596 * by the application; if 1, it will be used by default unless explicitly
2597 * disabled by the application.
2598 */
2599 public static final String ACCELEROMETER_ROTATION = "accelerometer_rotation";
2600
Svetoslav683914b2015-01-15 14:22:26 -08002601 /** @hide */
2602 public static final Validator ACCELEROMETER_ROTATION_VALIDATOR = sBooleanValidator;
2603
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002604 /**
Daniel Sandlerb73617d2010-08-17 00:41:00 -04002605 * Default screen rotation when no other policy applies.
2606 * When {@link #ACCELEROMETER_ROTATION} is zero and no on-screen Activity expresses a
2607 * preference, this rotation value will be used. Must be one of the
Brian Muramatsue1d46982010-12-06 17:34:20 -08002608 * {@link android.view.Surface#ROTATION_0 Surface rotation constants}.
Daniel Sandlerb73617d2010-08-17 00:41:00 -04002609 *
Dianne Hackborn16ec0802014-08-15 18:32:33 -07002610 * @see android.view.Display#getRotation
Daniel Sandlerb73617d2010-08-17 00:41:00 -04002611 */
2612 public static final String USER_ROTATION = "user_rotation";
2613
Svetoslav683914b2015-01-15 14:22:26 -08002614 /** @hide */
2615 public static final Validator USER_ROTATION_VALIDATOR =
2616 new InclusiveIntegerRangeValidator(0, 3);
2617
Daniel Sandlerb73617d2010-08-17 00:41:00 -04002618 /**
Jeff Brown207673cd2012-06-05 17:47:11 -07002619 * Control whether the rotation lock toggle in the System UI should be hidden.
2620 * Typically this is done for accessibility purposes to make it harder for
2621 * the user to accidentally toggle the rotation lock while the display rotation
2622 * has been locked for accessibility.
2623 *
2624 * If 0, then rotation lock toggle is not hidden for accessibility (although it may be
2625 * unavailable for other reasons). If 1, then the rotation lock toggle is hidden.
2626 *
2627 * @hide
2628 */
2629 public static final String HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY =
2630 "hide_rotation_lock_toggle_for_accessibility";
2631
Svetoslav683914b2015-01-15 14:22:26 -08002632 /** @hide */
2633 public static final Validator HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR =
2634 sBooleanValidator;
2635
Jeff Brown207673cd2012-06-05 17:47:11 -07002636 /**
Daisuke Miyakawa3c60eeb2012-05-08 12:08:25 -07002637 * Whether the phone vibrates when it is ringing due to an incoming call. This will
2638 * be used by Phone and Setting apps; it shouldn't affect other apps.
2639 * The value is boolean (1 or 0).
2640 *
2641 * Note: this is not same as "vibrate on ring", which had been available until ICS.
2642 * It was about AudioManager's setting and thus affected all the applications which
2643 * relied on the setting, while this is purely about the vibration setting for incoming
2644 * calls.
2645 *
2646 * @hide
2647 */
2648 public static final String VIBRATE_WHEN_RINGING = "vibrate_when_ringing";
2649
Svetoslav683914b2015-01-15 14:22:26 -08002650 /** @hide */
2651 public static final Validator VIBRATE_WHEN_RINGING_VALIDATOR = sBooleanValidator;
2652
Daisuke Miyakawa3c60eeb2012-05-08 12:08:25 -07002653 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002654 * Whether the audible DTMF tones are played by the dialer when dialing. The value is
2655 * boolean (1 or 0).
2656 */
2657 public static final String DTMF_TONE_WHEN_DIALING = "dtmf_tone";
2658
Svetoslav683914b2015-01-15 14:22:26 -08002659 /** @hide */
2660 public static final Validator DTMF_TONE_WHEN_DIALING_VALIDATOR = sBooleanValidator;
2661
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002662 /**
David Kraused0f67152009-06-13 18:01:13 -05002663 * CDMA only settings
2664 * DTMF tone type played by the dialer when dialing.
2665 * 0 = Normal
2666 * 1 = Long
2667 * @hide
2668 */
2669 public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type";
2670
Svetoslav683914b2015-01-15 14:22:26 -08002671 /** @hide */
2672 public static final Validator DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR = sBooleanValidator;
2673
David Kraused0f67152009-06-13 18:01:13 -05002674 /**
David Kraused0f67152009-06-13 18:01:13 -05002675 * Whether the hearing aid is enabled. The value is
2676 * boolean (1 or 0).
2677 * @hide
2678 */
2679 public static final String HEARING_AID = "hearing_aid";
2680
Svetoslav683914b2015-01-15 14:22:26 -08002681 /** @hide */
2682 public static final Validator HEARING_AID_VALIDATOR = sBooleanValidator;
2683
David Kraused0f67152009-06-13 18:01:13 -05002684 /**
2685 * CDMA only settings
2686 * TTY Mode
2687 * 0 = OFF
2688 * 1 = FULL
2689 * 2 = VCO
2690 * 3 = HCO
2691 * @hide
2692 */
2693 public static final String TTY_MODE = "tty_mode";
2694
Svetoslav683914b2015-01-15 14:22:26 -08002695 /** @hide */
2696 public static final Validator TTY_MODE_VALIDATOR = new InclusiveIntegerRangeValidator(0, 3);
2697
David Kraused0f67152009-06-13 18:01:13 -05002698 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002699 * Whether the sounds effects (key clicks, lid open ...) are enabled. The value is
2700 * boolean (1 or 0).
2701 */
2702 public static final String SOUND_EFFECTS_ENABLED = "sound_effects_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002703
Svetoslav683914b2015-01-15 14:22:26 -08002704 /** @hide */
2705 public static final Validator SOUND_EFFECTS_ENABLED_VALIDATOR = sBooleanValidator;
2706
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002707 /**
2708 * Whether the haptic feedback (long presses, ...) are enabled. The value is
2709 * boolean (1 or 0).
2710 */
2711 public static final String HAPTIC_FEEDBACK_ENABLED = "haptic_feedback_enabled";
Sanjay Jeyakumar21bf2412009-07-09 13:31:48 -07002712
Svetoslav683914b2015-01-15 14:22:26 -08002713 /** @hide */
2714 public static final Validator HAPTIC_FEEDBACK_ENABLED_VALIDATOR = sBooleanValidator;
2715
Mike LeBeau48603e72009-06-05 00:27:00 +01002716 /**
Bjorn Bringert24abb662010-09-21 12:21:18 +01002717 * @deprecated Each application that shows web suggestions should have its own
2718 * setting for this.
Mike LeBeau48603e72009-06-05 00:27:00 +01002719 */
Bjorn Bringert24abb662010-09-21 12:21:18 +01002720 @Deprecated
Mike LeBeau48603e72009-06-05 00:27:00 +01002721 public static final String SHOW_WEB_SUGGESTIONS = "show_web_suggestions";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002722
Svetoslav683914b2015-01-15 14:22:26 -08002723 /** @hide */
2724 public static final Validator SHOW_WEB_SUGGESTIONS_VALIDATOR = sBooleanValidator;
2725
-b master501eec92009-07-06 13:53:11 -07002726 /**
Amith Yamasaniae3ed702009-12-01 19:02:05 -08002727 * Whether the notification LED should repeatedly flash when a notification is
2728 * pending. The value is boolean (1 or 0).
2729 * @hide
2730 */
2731 public static final String NOTIFICATION_LIGHT_PULSE = "notification_light_pulse";
2732
Svetoslav683914b2015-01-15 14:22:26 -08002733 /** @hide */
2734 public static final Validator NOTIFICATION_LIGHT_PULSE_VALIDATOR = sBooleanValidator;
2735
Amith Yamasaniae3ed702009-12-01 19:02:05 -08002736 /**
Dianne Hackborn90d2db32010-02-11 22:19:06 -08002737 * Show pointer location on screen?
2738 * 0 = no
2739 * 1 = yes
2740 * @hide
2741 */
2742 public static final String POINTER_LOCATION = "pointer_location";
2743
Svetoslav683914b2015-01-15 14:22:26 -08002744 /** @hide */
2745 public static final Validator POINTER_LOCATION_VALIDATOR = sBooleanValidator;
2746
Dianne Hackborn90d2db32010-02-11 22:19:06 -08002747 /**
Jeff Browndaf4a122011-08-26 17:14:14 -07002748 * Show touch positions on screen?
2749 * 0 = no
2750 * 1 = yes
2751 * @hide
2752 */
2753 public static final String SHOW_TOUCHES = "show_touches";
2754
Svetoslav683914b2015-01-15 14:22:26 -08002755 /** @hide */
2756 public static final Validator SHOW_TOUCHES_VALIDATOR = sBooleanValidator;
2757
Jeff Browndaf4a122011-08-26 17:14:14 -07002758 /**
Dianne Hackborn16ec0802014-08-15 18:32:33 -07002759 * Log raw orientation data from
Jorim Jaggib10e33f2015-02-04 21:57:40 +01002760 * {@link com.android.server.policy.WindowOrientationListener} for use with the
Jeff Brown4519f072011-01-23 13:16:01 -08002761 * orientationplot.py tool.
2762 * 0 = no
2763 * 1 = yes
2764 * @hide
2765 */
2766 public static final String WINDOW_ORIENTATION_LISTENER_LOG =
2767 "window_orientation_listener_log";
2768
Svetoslav683914b2015-01-15 14:22:26 -08002769 /** @hide */
2770 public static final Validator WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR = sBooleanValidator;
2771
Jeff Brown4519f072011-01-23 13:16:01 -08002772 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002773 * @deprecated Use {@link android.provider.Settings.Global#POWER_SOUNDS_ENABLED}
2774 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002775 * @hide
2776 */
Christopher Tate06efb532012-08-24 15:29:27 -07002777 @Deprecated
2778 public static final String POWER_SOUNDS_ENABLED = Global.POWER_SOUNDS_ENABLED;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002779
2780 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002781 * @deprecated Use {@link android.provider.Settings.Global#DOCK_SOUNDS_ENABLED}
2782 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002783 * @hide
2784 */
Christopher Tate06efb532012-08-24 15:29:27 -07002785 @Deprecated
2786 public static final String DOCK_SOUNDS_ENABLED = Global.DOCK_SOUNDS_ENABLED;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002787
2788 /**
2789 * Whether to play sounds when the keyguard is shown and dismissed.
2790 * @hide
2791 */
2792 public static final String LOCKSCREEN_SOUNDS_ENABLED = "lockscreen_sounds_enabled";
2793
Svetoslav683914b2015-01-15 14:22:26 -08002794 /** @hide */
2795 public static final Validator LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR = sBooleanValidator;
2796
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002797 /**
Mike Lockwood7bef7392011-10-20 16:51:53 -04002798 * Whether the lockscreen should be completely disabled.
2799 * @hide
2800 */
2801 public static final String LOCKSCREEN_DISABLED = "lockscreen.disabled";
2802
Svetoslav683914b2015-01-15 14:22:26 -08002803 /** @hide */
2804 public static final Validator LOCKSCREEN_DISABLED_VALIDATOR = sBooleanValidator;
2805
Mike Lockwood7bef7392011-10-20 16:51:53 -04002806 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002807 * @deprecated Use {@link android.provider.Settings.Global#LOW_BATTERY_SOUND}
2808 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002809 * @hide
2810 */
Christopher Tate06efb532012-08-24 15:29:27 -07002811 @Deprecated
2812 public static final String LOW_BATTERY_SOUND = Global.LOW_BATTERY_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002813
2814 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002815 * @deprecated Use {@link android.provider.Settings.Global#DESK_DOCK_SOUND}
2816 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002817 * @hide
2818 */
Christopher Tate06efb532012-08-24 15:29:27 -07002819 @Deprecated
2820 public static final String DESK_DOCK_SOUND = Global.DESK_DOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002821
2822 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002823 * @deprecated Use {@link android.provider.Settings.Global#DESK_UNDOCK_SOUND}
2824 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002825 * @hide
2826 */
Christopher Tate06efb532012-08-24 15:29:27 -07002827 @Deprecated
2828 public static final String DESK_UNDOCK_SOUND = Global.DESK_UNDOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002829
2830 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002831 * @deprecated Use {@link android.provider.Settings.Global#CAR_DOCK_SOUND}
2832 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002833 * @hide
2834 */
Christopher Tate06efb532012-08-24 15:29:27 -07002835 @Deprecated
2836 public static final String CAR_DOCK_SOUND = Global.CAR_DOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002837
2838 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002839 * @deprecated Use {@link android.provider.Settings.Global#CAR_UNDOCK_SOUND}
2840 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002841 * @hide
2842 */
Christopher Tate06efb532012-08-24 15:29:27 -07002843 @Deprecated
2844 public static final String CAR_UNDOCK_SOUND = Global.CAR_UNDOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002845
2846 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002847 * @deprecated Use {@link android.provider.Settings.Global#LOCK_SOUND}
2848 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002849 * @hide
2850 */
Christopher Tate06efb532012-08-24 15:29:27 -07002851 @Deprecated
2852 public static final String LOCK_SOUND = Global.LOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002853
2854 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002855 * @deprecated Use {@link android.provider.Settings.Global#UNLOCK_SOUND}
2856 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002857 * @hide
2858 */
Christopher Tate06efb532012-08-24 15:29:27 -07002859 @Deprecated
2860 public static final String UNLOCK_SOUND = Global.UNLOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002861
2862 /**
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08002863 * Receive incoming SIP calls?
2864 * 0 = no
2865 * 1 = yes
2866 * @hide
2867 */
2868 public static final String SIP_RECEIVE_CALLS = "sip_receive_calls";
2869
Svetoslav683914b2015-01-15 14:22:26 -08002870 /** @hide */
2871 public static final Validator SIP_RECEIVE_CALLS_VALIDATOR = sBooleanValidator;
2872
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08002873 /**
2874 * Call Preference String.
2875 * "SIP_ALWAYS" : Always use SIP with network access
2876 * "SIP_ADDRESS_ONLY" : Only if destination is a SIP address
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08002877 * @hide
2878 */
2879 public static final String SIP_CALL_OPTIONS = "sip_call_options";
2880
Svetoslav683914b2015-01-15 14:22:26 -08002881 /** @hide */
2882 public static final Validator SIP_CALL_OPTIONS_VALIDATOR = new DiscreteValueValidator(
2883 new String[] {"SIP_ALWAYS", "SIP_ADDRESS_ONLY"});
2884
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08002885 /**
2886 * One of the sip call options: Always use SIP with network access.
2887 * @hide
2888 */
2889 public static final String SIP_ALWAYS = "SIP_ALWAYS";
2890
Svetoslav683914b2015-01-15 14:22:26 -08002891 /** @hide */
2892 public static final Validator SIP_ALWAYS_VALIDATOR = sBooleanValidator;
2893
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08002894 /**
2895 * One of the sip call options: Only if destination is a SIP address.
2896 * @hide
2897 */
2898 public static final String SIP_ADDRESS_ONLY = "SIP_ADDRESS_ONLY";
2899
Svetoslav683914b2015-01-15 14:22:26 -08002900 /** @hide */
2901 public static final Validator SIP_ADDRESS_ONLY_VALIDATOR = sBooleanValidator;
2902
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08002903 /**
Tyler Gunn2c830a22014-09-02 08:39:35 -07002904 * @deprecated Use SIP_ALWAYS or SIP_ADDRESS_ONLY instead. Formerly used to indicate that
2905 * the user should be prompted each time a call is made whether it should be placed using
2906 * SIP. The {@link com.android.providers.settings.DatabaseHelper} replaces this with
2907 * SIP_ADDRESS_ONLY.
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08002908 * @hide
2909 */
Tyler Gunn2c830a22014-09-02 08:39:35 -07002910 @Deprecated
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08002911 public static final String SIP_ASK_ME_EACH_TIME = "SIP_ASK_ME_EACH_TIME";
2912
Svetoslav683914b2015-01-15 14:22:26 -08002913 /** @hide */
2914 public static final Validator SIP_ASK_ME_EACH_TIME_VALIDATOR = sBooleanValidator;
2915
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08002916 /**
Jeff Brown1a84fd12011-06-02 01:26:32 -07002917 * Pointer speed setting.
2918 * This is an integer value in a range between -7 and +7, so there are 15 possible values.
2919 * -7 = slowest
2920 * 0 = default speed
2921 * +7 = fastest
2922 * @hide
2923 */
2924 public static final String POINTER_SPEED = "pointer_speed";
2925
Svetoslav683914b2015-01-15 14:22:26 -08002926 /** @hide */
2927 public static final Validator POINTER_SPEED_VALIDATOR =
2928 new InclusiveFloatRangeValidator(-7, 7);
2929
Jeff Brown1a84fd12011-06-02 01:26:32 -07002930 /**
Jason Monk56e09b42014-07-18 10:29:14 -04002931 * Whether lock-to-app will be triggered by long-press on recents.
2932 * @hide
2933 */
2934 public static final String LOCK_TO_APP_ENABLED = "lock_to_app_enabled";
2935
Svetoslav683914b2015-01-15 14:22:26 -08002936 /** @hide */
2937 public static final Validator LOCK_TO_APP_ENABLED_VALIDATOR = sBooleanValidator;
2938
Jason Monk56e09b42014-07-18 10:29:14 -04002939 /**
Daniel Sandler2fdb68b2013-10-03 00:12:11 -04002940 * I am the lolrus.
2941 * <p>
2942 * Nonzero values indicate that the user has a bukkit.
2943 * Backward-compatible with <code>PrefGetPreference(prefAllowEasterEggs)</code>.
2944 * @hide
2945 */
2946 public static final String EGG_MODE = "egg_mode";
2947
Svetoslav683914b2015-01-15 14:22:26 -08002948 /** @hide */
2949 public static final Validator EGG_MODE_VALIDATOR = sBooleanValidator;
2950
2951 /**
2952 * IMPORTANT: If you add a new public settings you also have to add it to
2953 * PUBLIC_SETTINGS below. If the new setting is hidden you have to add
2954 * it to PRIVATE_SETTINGS below. Also add a validator that can validate
2955 * the setting value. See an example above.
2956 */
2957
Daniel Sandler2fdb68b2013-10-03 00:12:11 -04002958 /**
-b master501eec92009-07-06 13:53:11 -07002959 * Settings to backup. This is here so that it's in the same place as the settings
2960 * keys and easy to update.
Svetoslav Ganova571a582011-09-20 18:32:20 -07002961 *
2962 * NOTE: Settings are backed up and restored in the order they appear
2963 * in this array. If you have one setting depending on another,
2964 * make sure that they are ordered appropriately.
2965 *
-b master501eec92009-07-06 13:53:11 -07002966 * @hide
2967 */
2968 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate66488d62012-10-02 11:58:01 -07002969 STAY_ON_WHILE_PLUGGED_IN, // moved to global
-b master501eec92009-07-06 13:53:11 -07002970 WIFI_USE_STATIC_IP,
2971 WIFI_STATIC_IP,
2972 WIFI_STATIC_GATEWAY,
2973 WIFI_STATIC_NETMASK,
2974 WIFI_STATIC_DNS1,
2975 WIFI_STATIC_DNS2,
2976 BLUETOOTH_DISCOVERABILITY,
2977 BLUETOOTH_DISCOVERABILITY_TIMEOUT,
2978 DIM_SCREEN,
2979 SCREEN_OFF_TIMEOUT,
2980 SCREEN_BRIGHTNESS,
Christopher Tate362aca62009-09-25 15:58:03 -07002981 SCREEN_BRIGHTNESS_MODE,
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08002982 SCREEN_AUTO_BRIGHTNESS_ADJ,
Jeff Brown7f6c2312012-04-13 20:38:38 -07002983 VIBRATE_INPUT_DEVICES,
Amith Yamasani8823c0a82009-07-07 14:30:17 -07002984 MODE_RINGER_STREAMS_AFFECTED,
Amith Yamasani8823c0a82009-07-07 14:30:17 -07002985 VOLUME_VOICE,
2986 VOLUME_SYSTEM,
2987 VOLUME_RING,
2988 VOLUME_MUSIC,
2989 VOLUME_ALARM,
2990 VOLUME_NOTIFICATION,
Eric Laurent484d2882009-12-08 09:05:45 -08002991 VOLUME_BLUETOOTH_SCO,
Amith Yamasani8823c0a82009-07-07 14:30:17 -07002992 VOLUME_VOICE + APPEND_FOR_LAST_AUDIBLE,
2993 VOLUME_SYSTEM + APPEND_FOR_LAST_AUDIBLE,
2994 VOLUME_RING + APPEND_FOR_LAST_AUDIBLE,
2995 VOLUME_MUSIC + APPEND_FOR_LAST_AUDIBLE,
2996 VOLUME_ALARM + APPEND_FOR_LAST_AUDIBLE,
2997 VOLUME_NOTIFICATION + APPEND_FOR_LAST_AUDIBLE,
Eric Laurent484d2882009-12-08 09:05:45 -08002998 VOLUME_BLUETOOTH_SCO + APPEND_FOR_LAST_AUDIBLE,
-b master501eec92009-07-06 13:53:11 -07002999 TEXT_AUTO_REPLACE,
3000 TEXT_AUTO_CAPS,
3001 TEXT_AUTO_PUNCTUATE,
3002 TEXT_SHOW_PASSWORD,
Christopher Tate66488d62012-10-02 11:58:01 -07003003 AUTO_TIME, // moved to global
3004 AUTO_TIME_ZONE, // moved to global
-b master501eec92009-07-06 13:53:11 -07003005 TIME_12_24,
3006 DATE_FORMAT,
-b master501eec92009-07-06 13:53:11 -07003007 DTMF_TONE_WHEN_DIALING,
3008 DTMF_TONE_TYPE_WHEN_DIALING,
-b master501eec92009-07-06 13:53:11 -07003009 HEARING_AID,
3010 TTY_MODE,
3011 SOUND_EFFECTS_ENABLED,
3012 HAPTIC_FEEDBACK_ENABLED,
Christopher Tate66488d62012-10-02 11:58:01 -07003013 POWER_SOUNDS_ENABLED, // moved to global
3014 DOCK_SOUNDS_ENABLED, // moved to global
Christopher Tate14c2d792010-02-25 16:49:44 -08003015 LOCKSCREEN_SOUNDS_ENABLED,
Amith Yamasaniae3ed702009-12-01 19:02:05 -08003016 SHOW_WEB_SUGGESTIONS,
Mike Lockwoodeabe8bf2010-08-31 14:35:23 -04003017 NOTIFICATION_LIGHT_PULSE,
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003018 SIP_CALL_OPTIONS,
Nick Pelly038cabe2010-09-23 16:12:11 -07003019 SIP_RECEIVE_CALLS,
Jeff Brown1a84fd12011-06-02 01:26:32 -07003020 POINTER_SPEED,
Amith Yamasani622bf2222013-09-06 13:54:28 -07003021 VIBRATE_WHEN_RINGING,
3022 RINGTONE,
Jason Monk94cfd9d2014-10-31 13:18:21 -04003023 LOCK_TO_APP_ENABLED,
Amith Yamasani622bf2222013-09-06 13:54:28 -07003024 NOTIFICATION_SOUND
-b master501eec92009-07-06 13:53:11 -07003025 };
3026
Sailesh Nepal1bd78762014-02-11 22:32:21 -08003027 /**
Svetoslav683914b2015-01-15 14:22:26 -08003028 * These are all pulbic system settings
3029 *
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07003030 * @hide
3031 */
Svetoslav683914b2015-01-15 14:22:26 -08003032 public static final Set<String> PUBLIC_SETTINGS = new ArraySet<>();
3033 static {
3034 PUBLIC_SETTINGS.add(END_BUTTON_BEHAVIOR);
3035 PUBLIC_SETTINGS.add(WIFI_USE_STATIC_IP);
3036 PUBLIC_SETTINGS.add(WIFI_STATIC_IP);
3037 PUBLIC_SETTINGS.add(WIFI_STATIC_GATEWAY);
3038 PUBLIC_SETTINGS.add(WIFI_STATIC_NETMASK);
3039 PUBLIC_SETTINGS.add(WIFI_STATIC_DNS1);
3040 PUBLIC_SETTINGS.add(WIFI_STATIC_DNS2);
3041 PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY);
3042 PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY_TIMEOUT);
3043 PUBLIC_SETTINGS.add(NEXT_ALARM_FORMATTED);
3044 PUBLIC_SETTINGS.add(FONT_SCALE);
3045 PUBLIC_SETTINGS.add(DIM_SCREEN);
3046 PUBLIC_SETTINGS.add(SCREEN_OFF_TIMEOUT);
3047 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS);
3048 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_MODE);
3049 PUBLIC_SETTINGS.add(MODE_RINGER_STREAMS_AFFECTED);
3050 PUBLIC_SETTINGS.add(MUTE_STREAMS_AFFECTED);
3051 PUBLIC_SETTINGS.add(VIBRATE_ON);
3052 PUBLIC_SETTINGS.add(VOLUME_RING);
3053 PUBLIC_SETTINGS.add(VOLUME_SYSTEM);
3054 PUBLIC_SETTINGS.add(VOLUME_VOICE);
3055 PUBLIC_SETTINGS.add(VOLUME_MUSIC);
3056 PUBLIC_SETTINGS.add(VOLUME_ALARM);
3057 PUBLIC_SETTINGS.add(VOLUME_NOTIFICATION);
3058 PUBLIC_SETTINGS.add(VOLUME_BLUETOOTH_SCO);
3059 PUBLIC_SETTINGS.add(RINGTONE);
3060 PUBLIC_SETTINGS.add(NOTIFICATION_SOUND);
3061 PUBLIC_SETTINGS.add(ALARM_ALERT);
3062 PUBLIC_SETTINGS.add(TEXT_AUTO_REPLACE);
3063 PUBLIC_SETTINGS.add(TEXT_AUTO_CAPS);
3064 PUBLIC_SETTINGS.add(TEXT_AUTO_PUNCTUATE);
3065 PUBLIC_SETTINGS.add(TEXT_SHOW_PASSWORD);
3066 PUBLIC_SETTINGS.add(SHOW_GTALK_SERVICE_STATUS);
3067 PUBLIC_SETTINGS.add(WALLPAPER_ACTIVITY);
3068 PUBLIC_SETTINGS.add(TIME_12_24);
3069 PUBLIC_SETTINGS.add(DATE_FORMAT);
3070 PUBLIC_SETTINGS.add(SETUP_WIZARD_HAS_RUN);
3071 PUBLIC_SETTINGS.add(ACCELEROMETER_ROTATION);
3072 PUBLIC_SETTINGS.add(USER_ROTATION);
3073 PUBLIC_SETTINGS.add(DTMF_TONE_WHEN_DIALING);
3074 PUBLIC_SETTINGS.add(SOUND_EFFECTS_ENABLED);
3075 PUBLIC_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED);
3076 PUBLIC_SETTINGS.add(SHOW_WEB_SUGGESTIONS);
3077 }
3078
3079 /**
3080 * These are all hidden system settings.
3081 *
3082 * @hide
3083 */
3084 public static final Set<String> PRIVATE_SETTINGS = new ArraySet<>();
3085 static {
3086 PRIVATE_SETTINGS.add(WIFI_USE_STATIC_IP);
3087 PRIVATE_SETTINGS.add(END_BUTTON_BEHAVIOR);
3088 PRIVATE_SETTINGS.add(ADVANCED_SETTINGS);
3089 PRIVATE_SETTINGS.add(SCREEN_AUTO_BRIGHTNESS_ADJ);
3090 PRIVATE_SETTINGS.add(VIBRATE_INPUT_DEVICES);
3091 PRIVATE_SETTINGS.add(VOLUME_MASTER);
3092 PRIVATE_SETTINGS.add(VOLUME_MASTER_MUTE);
3093 PRIVATE_SETTINGS.add(MICROPHONE_MUTE);
3094 PRIVATE_SETTINGS.add(NOTIFICATIONS_USE_RING_VOLUME);
3095 PRIVATE_SETTINGS.add(VIBRATE_IN_SILENT);
3096 PRIVATE_SETTINGS.add(MEDIA_BUTTON_RECEIVER);
3097 PRIVATE_SETTINGS.add(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY);
3098 PRIVATE_SETTINGS.add(VIBRATE_WHEN_RINGING);
3099 PRIVATE_SETTINGS.add(DTMF_TONE_TYPE_WHEN_DIALING);
3100 PRIVATE_SETTINGS.add(HEARING_AID);
3101 PRIVATE_SETTINGS.add(TTY_MODE);
3102 PRIVATE_SETTINGS.add(NOTIFICATION_LIGHT_PULSE);
3103 PRIVATE_SETTINGS.add(POINTER_LOCATION);
3104 PRIVATE_SETTINGS.add(SHOW_TOUCHES);
3105 PRIVATE_SETTINGS.add(WINDOW_ORIENTATION_LISTENER_LOG);
3106 PRIVATE_SETTINGS.add(POWER_SOUNDS_ENABLED);
3107 PRIVATE_SETTINGS.add(DOCK_SOUNDS_ENABLED);
3108 PRIVATE_SETTINGS.add(LOCKSCREEN_SOUNDS_ENABLED);
3109 PRIVATE_SETTINGS.add(LOCKSCREEN_DISABLED);
3110 PRIVATE_SETTINGS.add(LOW_BATTERY_SOUND);
3111 PRIVATE_SETTINGS.add(DESK_DOCK_SOUND);
3112 PRIVATE_SETTINGS.add(DESK_UNDOCK_SOUND);
3113 PRIVATE_SETTINGS.add(CAR_DOCK_SOUND);
3114 PRIVATE_SETTINGS.add(CAR_UNDOCK_SOUND);
3115 PRIVATE_SETTINGS.add(LOCK_SOUND);
3116 PRIVATE_SETTINGS.add(UNLOCK_SOUND);
3117 PRIVATE_SETTINGS.add(SIP_RECEIVE_CALLS);
3118 PRIVATE_SETTINGS.add(SIP_CALL_OPTIONS);
3119 PRIVATE_SETTINGS.add(SIP_ALWAYS);
3120 PRIVATE_SETTINGS.add(SIP_ADDRESS_ONLY);
3121 PRIVATE_SETTINGS.add(SIP_ASK_ME_EACH_TIME);
3122 PRIVATE_SETTINGS.add(POINTER_SPEED);
3123 PRIVATE_SETTINGS.add(LOCK_TO_APP_ENABLED);
3124 PRIVATE_SETTINGS.add(EGG_MODE);
3125 }
3126
3127 /**
3128 * These are all pulbic system settings
3129 *
3130 * @hide
3131 */
3132 public static final Map<String, Validator> VALIDATORS = new ArrayMap<>();
3133 static {
3134 VALIDATORS.put(END_BUTTON_BEHAVIOR,END_BUTTON_BEHAVIOR_VALIDATOR);
3135 VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR);
3136 VALIDATORS.put(BLUETOOTH_DISCOVERABILITY, BLUETOOTH_DISCOVERABILITY_VALIDATOR);
3137 VALIDATORS.put(BLUETOOTH_DISCOVERABILITY_TIMEOUT,
3138 BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR);
3139 VALIDATORS.put(NEXT_ALARM_FORMATTED, NEXT_ALARM_FORMATTED_VALIDATOR);
3140 VALIDATORS.put(FONT_SCALE, FONT_SCALE_VALIDATOR);
3141 VALIDATORS.put(DIM_SCREEN, DIM_SCREEN_VALIDATOR);
3142 VALIDATORS.put(SCREEN_OFF_TIMEOUT, SCREEN_OFF_TIMEOUT_VALIDATOR);
3143 VALIDATORS.put(SCREEN_BRIGHTNESS, SCREEN_BRIGHTNESS_VALIDATOR);
3144 VALIDATORS.put(SCREEN_BRIGHTNESS_MODE, SCREEN_BRIGHTNESS_MODE_VALIDATOR);
3145 VALIDATORS.put(MODE_RINGER_STREAMS_AFFECTED, MODE_RINGER_STREAMS_AFFECTED_VALIDATOR);
3146 VALIDATORS.put(MUTE_STREAMS_AFFECTED, MUTE_STREAMS_AFFECTED_VALIDATOR);
3147 VALIDATORS.put(VIBRATE_ON, VIBRATE_ON_VALIDATOR);
Svetoslav683914b2015-01-15 14:22:26 -08003148 VALIDATORS.put(RINGTONE, RINGTONE_VALIDATOR);
3149 VALIDATORS.put(NOTIFICATION_SOUND, NOTIFICATION_SOUND_VALIDATOR);
3150 VALIDATORS.put(ALARM_ALERT, ALARM_ALERT_VALIDATOR);
3151 VALIDATORS.put(TEXT_AUTO_REPLACE, TEXT_AUTO_REPLACE_VALIDATOR);
3152 VALIDATORS.put(TEXT_AUTO_CAPS, TEXT_AUTO_CAPS_VALIDATOR);
3153 VALIDATORS.put(TEXT_AUTO_PUNCTUATE, TEXT_AUTO_PUNCTUATE_VALIDATOR);
3154 VALIDATORS.put(TEXT_SHOW_PASSWORD, TEXT_SHOW_PASSWORD_VALIDATOR);
3155 VALIDATORS.put(SHOW_GTALK_SERVICE_STATUS, SHOW_GTALK_SERVICE_STATUS_VALIDATOR);
3156 VALIDATORS.put(WALLPAPER_ACTIVITY, WALLPAPER_ACTIVITY_VALIDATOR);
3157 VALIDATORS.put(TIME_12_24, TIME_12_24_VALIDATOR);
3158 VALIDATORS.put(DATE_FORMAT, DATE_FORMAT_VALIDATOR);
3159 VALIDATORS.put(SETUP_WIZARD_HAS_RUN, SETUP_WIZARD_HAS_RUN_VALIDATOR);
3160 VALIDATORS.put(ACCELEROMETER_ROTATION, ACCELEROMETER_ROTATION_VALIDATOR);
3161 VALIDATORS.put(USER_ROTATION, USER_ROTATION_VALIDATOR);
3162 VALIDATORS.put(DTMF_TONE_WHEN_DIALING, DTMF_TONE_WHEN_DIALING_VALIDATOR);
3163 VALIDATORS.put(SOUND_EFFECTS_ENABLED, SOUND_EFFECTS_ENABLED_VALIDATOR);
3164 VALIDATORS.put(HAPTIC_FEEDBACK_ENABLED, HAPTIC_FEEDBACK_ENABLED_VALIDATOR);
3165 VALIDATORS.put(SHOW_WEB_SUGGESTIONS, SHOW_WEB_SUGGESTIONS_VALIDATOR);
3166 VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR);
3167 VALIDATORS.put(END_BUTTON_BEHAVIOR, END_BUTTON_BEHAVIOR_VALIDATOR);
3168 VALIDATORS.put(ADVANCED_SETTINGS, ADVANCED_SETTINGS_VALIDATOR);
3169 VALIDATORS.put(SCREEN_AUTO_BRIGHTNESS_ADJ, SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR);
3170 VALIDATORS.put(VIBRATE_INPUT_DEVICES, VIBRATE_INPUT_DEVICES_VALIDATOR);
3171 VALIDATORS.put(VOLUME_MASTER, VOLUME_MASTER_VALIDATOR);
3172 VALIDATORS.put(VOLUME_MASTER_MUTE, VOLUME_MASTER_MUTE_VALIDATOR);
3173 VALIDATORS.put(MICROPHONE_MUTE, MICROPHONE_MUTE_VALIDATOR);
3174 VALIDATORS.put(NOTIFICATIONS_USE_RING_VOLUME, NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR);
3175 VALIDATORS.put(VIBRATE_IN_SILENT, VIBRATE_IN_SILENT_VALIDATOR);
3176 VALIDATORS.put(MEDIA_BUTTON_RECEIVER, MEDIA_BUTTON_RECEIVER_VALIDATOR);
3177 VALIDATORS.put(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY,
3178 HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR);
3179 VALIDATORS.put(VIBRATE_WHEN_RINGING, VIBRATE_WHEN_RINGING_VALIDATOR);
3180 VALIDATORS.put(DTMF_TONE_TYPE_WHEN_DIALING, DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR);
3181 VALIDATORS.put(HEARING_AID, HEARING_AID_VALIDATOR);
3182 VALIDATORS.put(TTY_MODE, TTY_MODE_VALIDATOR);
3183 VALIDATORS.put(NOTIFICATION_LIGHT_PULSE, NOTIFICATION_LIGHT_PULSE_VALIDATOR);
3184 VALIDATORS.put(POINTER_LOCATION, POINTER_LOCATION_VALIDATOR);
3185 VALIDATORS.put(SHOW_TOUCHES, SHOW_TOUCHES_VALIDATOR);
3186 VALIDATORS.put(WINDOW_ORIENTATION_LISTENER_LOG,
3187 WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR);
3188 VALIDATORS.put(LOCKSCREEN_SOUNDS_ENABLED, LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR);
3189 VALIDATORS.put(LOCKSCREEN_DISABLED, LOCKSCREEN_DISABLED_VALIDATOR);
3190 VALIDATORS.put(SIP_RECEIVE_CALLS, SIP_RECEIVE_CALLS_VALIDATOR);
3191 VALIDATORS.put(SIP_CALL_OPTIONS, SIP_CALL_OPTIONS_VALIDATOR);
3192 VALIDATORS.put(SIP_ALWAYS, SIP_ALWAYS_VALIDATOR);
3193 VALIDATORS.put(SIP_ADDRESS_ONLY, SIP_ADDRESS_ONLY_VALIDATOR);
3194 VALIDATORS.put(SIP_ASK_ME_EACH_TIME, SIP_ASK_ME_EACH_TIME_VALIDATOR);
3195 VALIDATORS.put(POINTER_SPEED, POINTER_SPEED_VALIDATOR);
3196 VALIDATORS.put(LOCK_TO_APP_ENABLED, LOCK_TO_APP_ENABLED_VALIDATOR);
3197 VALIDATORS.put(EGG_MODE, EGG_MODE_VALIDATOR);
3198 VALIDATORS.put(WIFI_STATIC_IP, WIFI_STATIC_IP_VALIDATOR);
3199 VALIDATORS.put(WIFI_STATIC_GATEWAY, WIFI_STATIC_GATEWAY_VALIDATOR);
3200 VALIDATORS.put(WIFI_STATIC_NETMASK, WIFI_STATIC_NETMASK_VALIDATOR);
3201 VALIDATORS.put(WIFI_STATIC_DNS1, WIFI_STATIC_DNS1_VALIDATOR);
3202 VALIDATORS.put(WIFI_STATIC_DNS2, WIFI_STATIC_DNS2_VALIDATOR);
3203 }
3204
3205 /**
3206 * These entries are considered common between the personal and the managed profile,
3207 * since the managed profile doesn't get to change them.
3208 */
3209 private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>();
3210 static {
3211 CLONE_TO_MANAGED_PROFILE.add(DATE_FORMAT);
3212 CLONE_TO_MANAGED_PROFILE.add(HAPTIC_FEEDBACK_ENABLED);
3213 CLONE_TO_MANAGED_PROFILE.add(SOUND_EFFECTS_ENABLED);
3214 CLONE_TO_MANAGED_PROFILE.add(TEXT_SHOW_PASSWORD);
3215 CLONE_TO_MANAGED_PROFILE.add(TIME_12_24);
3216 }
3217
3218 /** @hide */
3219 public static void getCloneToManagedProfileSettings(Set<String> outKeySet) {
3220 outKeySet.addAll(CLONE_TO_MANAGED_PROFILE);
3221 }
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07003222
3223 /**
Sailesh Nepal1bd78762014-02-11 22:32:21 -08003224 * When to use Wi-Fi calling
3225 *
3226 * @see android.telephony.TelephonyManager.WifiCallingChoices
3227 * @hide
3228 */
3229 public static final String WHEN_TO_MAKE_WIFI_CALLS = "when_to_make_wifi_calls";
3230
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003231 // Settings moved to Settings.Secure
3232
3233 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003234 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003235 * instead
3236 */
3237 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003238 public static final String ADB_ENABLED = Global.ADB_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003239
3240 /**
3241 * @deprecated Use {@link android.provider.Settings.Secure#ANDROID_ID} instead
3242 */
3243 @Deprecated
3244 public static final String ANDROID_ID = Secure.ANDROID_ID;
3245
3246 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003247 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003248 */
3249 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003250 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003251
3252 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003253 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003254 */
3255 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003256 public static final String DATA_ROAMING = Global.DATA_ROAMING;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003257
3258 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003259 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003260 */
3261 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003262 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003263
3264 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07003265 * @deprecated Use {@link android.provider.Settings.Global#HTTP_PROXY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003266 */
3267 @Deprecated
Jeff Sharkey625239a2012-09-26 22:03:49 -07003268 public static final String HTTP_PROXY = Global.HTTP_PROXY;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003269
3270 /**
Christopher Tateaa036a22014-05-19 16:33:27 -07003271 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003272 */
3273 @Deprecated
Christopher Tateaa036a22014-05-19 16:33:27 -07003274 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003275
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003276 /**
3277 * @deprecated Use {@link android.provider.Settings.Secure#LOCATION_PROVIDERS_ALLOWED}
3278 * instead
3279 */
3280 @Deprecated
3281 public static final String LOCATION_PROVIDERS_ALLOWED = Secure.LOCATION_PROVIDERS_ALLOWED;
3282
3283 /**
3284 * @deprecated Use {@link android.provider.Settings.Secure#LOGGING_ID} instead
3285 */
3286 @Deprecated
3287 public static final String LOGGING_ID = Secure.LOGGING_ID;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003288
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003289 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003290 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003291 */
3292 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003293 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003294
3295 /**
3296 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_ENABLED}
3297 * instead
3298 */
3299 @Deprecated
3300 public static final String PARENTAL_CONTROL_ENABLED = Secure.PARENTAL_CONTROL_ENABLED;
3301
3302 /**
3303 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_LAST_UPDATE}
3304 * instead
3305 */
3306 @Deprecated
3307 public static final String PARENTAL_CONTROL_LAST_UPDATE = Secure.PARENTAL_CONTROL_LAST_UPDATE;
3308
3309 /**
3310 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_REDIRECT_URL}
3311 * instead
3312 */
3313 @Deprecated
3314 public static final String PARENTAL_CONTROL_REDIRECT_URL =
3315 Secure.PARENTAL_CONTROL_REDIRECT_URL;
3316
3317 /**
3318 * @deprecated Use {@link android.provider.Settings.Secure#SETTINGS_CLASSNAME} instead
3319 */
3320 @Deprecated
3321 public static final String SETTINGS_CLASSNAME = Secure.SETTINGS_CLASSNAME;
3322
3323 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003324 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003325 */
3326 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003327 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003328
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003329 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003330 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003331 */
3332 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003333 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003334
Dianne Hackborn4a51c202009-08-21 15:14:02 -07003335 /**
3336 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07003337 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
Dianne Hackborn4a51c202009-08-21 15:14:02 -07003338 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003339 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003340 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 -08003341
Dianne Hackborn4a51c202009-08-21 15:14:02 -07003342 /**
3343 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07003344 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
Dianne Hackborn4a51c202009-08-21 15:14:02 -07003345 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003346 @Deprecated
3347 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
Christopher Tate06efb532012-08-24 15:29:27 -07003348 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003349
3350 /**
3351 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07003352 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003353 */
3354 @Deprecated
3355 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
Christopher Tate06efb532012-08-24 15:29:27 -07003356 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003357
3358 /**
3359 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07003360 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003361 */
3362 @Deprecated
3363 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
Christopher Tate06efb532012-08-24 15:29:27 -07003364 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003365
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003366 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003367 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003368 * instead
3369 */
3370 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003371 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 -08003372
3373 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003374 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003375 */
3376 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003377 public static final String WIFI_ON = Global.WIFI_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003378
3379 /**
3380 * @deprecated Use
3381 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE}
3382 * instead
3383 */
3384 @Deprecated
3385 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
3386 Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE;
3387
3388 /**
3389 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_AP_COUNT} instead
3390 */
3391 @Deprecated
3392 public static final String WIFI_WATCHDOG_AP_COUNT = Secure.WIFI_WATCHDOG_AP_COUNT;
3393
3394 /**
3395 * @deprecated Use
3396 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS} instead
3397 */
3398 @Deprecated
3399 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
3400 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003401
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003402 /**
3403 * @deprecated Use
3404 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED} instead
3405 */
3406 @Deprecated
3407 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
3408 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED;
3409
3410 /**
3411 * @deprecated Use
3412 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS}
3413 * instead
3414 */
3415 @Deprecated
3416 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
3417 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS;
3418
3419 /**
3420 * @deprecated Use
3421 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT} instead
3422 */
3423 @Deprecated
3424 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
3425 Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT;
3426
3427 /**
3428 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_MAX_AP_CHECKS}
3429 * instead
3430 */
3431 @Deprecated
3432 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = Secure.WIFI_WATCHDOG_MAX_AP_CHECKS;
3433
3434 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003435 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003436 */
3437 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003438 public static final String WIFI_WATCHDOG_ON = Global.WIFI_WATCHDOG_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003439
3440 /**
3441 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_COUNT} instead
3442 */
3443 @Deprecated
3444 public static final String WIFI_WATCHDOG_PING_COUNT = Secure.WIFI_WATCHDOG_PING_COUNT;
3445
3446 /**
3447 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_DELAY_MS}
3448 * instead
3449 */
3450 @Deprecated
3451 public static final String WIFI_WATCHDOG_PING_DELAY_MS = Secure.WIFI_WATCHDOG_PING_DELAY_MS;
3452
3453 /**
3454 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_TIMEOUT_MS}
3455 * instead
3456 */
3457 @Deprecated
3458 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS =
3459 Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS;
3460 }
3461
3462 /**
3463 * Secure system settings, containing system preferences that applications
3464 * can read but are not allowed to write. These are for preferences that
3465 * the user must explicitly modify through the system UI or specialized
3466 * APIs for those values, not modified directly by applications.
3467 */
3468 public static final class Secure extends NameValueTable {
3469 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_secure_version";
3470
Dianne Hackborn139748f2012-09-24 11:36:57 -07003471 /**
3472 * The content:// style URL for this table
3473 */
3474 public static final Uri CONTENT_URI =
3475 Uri.parse("content://" + AUTHORITY + "/secure");
3476
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08003477 // Populated lazily, guarded by class object:
Dianne Hackborn139748f2012-09-24 11:36:57 -07003478 private static final NameValueCache sNameValueCache = new NameValueCache(
3479 SYS_PROP_SETTING_VERSION,
3480 CONTENT_URI,
3481 CALL_METHOD_GET_SECURE,
3482 CALL_METHOD_PUT_SECURE);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003483
Amith Yamasani52c489c2012-03-28 11:42:42 -07003484 private static ILockSettings sLockSettings = null;
3485
Amith Yamasani7ab8c4a2012-04-06 09:27:12 -07003486 private static boolean sIsSystemProcess;
Amith Yamasani52c489c2012-03-28 11:42:42 -07003487 private static final HashSet<String> MOVED_TO_LOCK_SETTINGS;
Christopher Tate06efb532012-08-24 15:29:27 -07003488 private static final HashSet<String> MOVED_TO_GLOBAL;
Amith Yamasani52c489c2012-03-28 11:42:42 -07003489 static {
3490 MOVED_TO_LOCK_SETTINGS = new HashSet<String>(3);
3491 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_ENABLED);
3492 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_VISIBLE);
3493 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
Christopher Tate06efb532012-08-24 15:29:27 -07003494
3495 MOVED_TO_GLOBAL = new HashSet<String>();
3496 MOVED_TO_GLOBAL.add(Settings.Global.ADB_ENABLED);
3497 MOVED_TO_GLOBAL.add(Settings.Global.ASSISTED_GPS_ENABLED);
3498 MOVED_TO_GLOBAL.add(Settings.Global.BLUETOOTH_ON);
Christopher Tate58f41ec2013-01-11 15:40:36 -08003499 MOVED_TO_GLOBAL.add(Settings.Global.BUGREPORT_IN_POWER_MENU);
Christopher Tate06efb532012-08-24 15:29:27 -07003500 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_CELL_BROADCAST_SMS);
3501 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_ROAMING_MODE);
3502 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_SUBSCRIPTION_MODE);
3503 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_MOBILE);
3504 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_WIFI);
3505 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ROAMING);
3506 MOVED_TO_GLOBAL.add(Settings.Global.DEVELOPMENT_SETTINGS_ENABLED);
3507 MOVED_TO_GLOBAL.add(Settings.Global.DEVICE_PROVISIONED);
3508 MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_DENSITY_FORCED);
3509 MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_SIZE_FORCED);
3510 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_MAX_BYTES_OVER_MOBILE);
3511 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE);
Christopher Tate06efb532012-08-24 15:29:27 -07003512 MOVED_TO_GLOBAL.add(Settings.Global.MOBILE_DATA);
3513 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_BUCKET_DURATION);
3514 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_DELETE_AGE);
3515 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_PERSIST_BYTES);
3516 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_ROTATE_AGE);
3517 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_ENABLED);
3518 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_GLOBAL_ALERT_BYTES);
3519 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_POLL_INTERVAL);
Christopher Tate06efb532012-08-24 15:29:27 -07003520 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_SAMPLE_ENABLED);
3521 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_TIME_CACHE_MAX_AGE);
3522 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_BUCKET_DURATION);
3523 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_DELETE_AGE);
3524 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_PERSIST_BYTES);
3525 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_ROTATE_AGE);
3526 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_BUCKET_DURATION);
3527 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_DELETE_AGE);
3528 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_PERSIST_BYTES);
3529 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_ROTATE_AGE);
3530 MOVED_TO_GLOBAL.add(Settings.Global.NETWORK_PREFERENCE);
3531 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_DIFF);
3532 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_SPACING);
3533 MOVED_TO_GLOBAL.add(Settings.Global.NTP_SERVER);
3534 MOVED_TO_GLOBAL.add(Settings.Global.NTP_TIMEOUT);
3535 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_ERROR_POLL_COUNT);
3536 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_LONG_POLL_INTERVAL_MS);
3537 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT);
3538 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_POLL_INTERVAL_MS);
3539 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_TRIGGER_PACKET_COUNT);
3540 MOVED_TO_GLOBAL.add(Settings.Global.SAMPLING_PROFILER_MS);
3541 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DATA_SERVICE_URL);
3542 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_REDIR_HOST);
3543 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_TARGET_URL);
3544 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_APN);
3545 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_REQUIRED);
3546 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_SUPPORTED);
Christopher Tate06efb532012-08-24 15:29:27 -07003547 MOVED_TO_GLOBAL.add(Settings.Global.USB_MASS_STORAGE_ENABLED);
3548 MOVED_TO_GLOBAL.add(Settings.Global.USE_GOOGLE_MAIL);
Robert Greenwalt3ea0c992013-10-03 21:13:49 +00003549 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_COUNTRY_CODE);
Christopher Tate06efb532012-08-24 15:29:27 -07003550 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FRAMEWORK_SCAN_INTERVAL_MS);
3551 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FREQUENCY_BAND);
3552 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_IDLE_MS);
3553 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MAX_DHCP_RETRY_COUNT);
3554 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS);
3555 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
3556 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
3557 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NUM_OPEN_NETWORKS_KEPT);
3558 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ON);
3559 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_P2P_DEVICE_NAME);
3560 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SAVED_STATE);
3561 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUPPLICANT_SCAN_INTERVAL_MS);
3562 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUSPEND_OPTIMIZATIONS_ENABLED);
vandwalle7c3606c2014-03-31 19:12:07 -07003563 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ENHANCED_AUTO_JOIN);
3564 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORK_SHOW_RSSI);
Christopher Tate06efb532012-08-24 15:29:27 -07003565 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_ON);
3566 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED);
Christopher Tate06efb532012-08-24 15:29:27 -07003567 MOVED_TO_GLOBAL.add(Settings.Global.WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON);
Christopher Tatec868b642012-09-12 17:41:04 -07003568 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_ENABLE);
3569 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_TIMEOUT);
3570 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_DEFAULT_RESPONSE);
3571 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS);
3572 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS);
3573 MOVED_TO_GLOBAL.add(Settings.Global.GPRS_REGISTER_CHECK_PERIOD_MS);
Christopher Tate06efb532012-08-24 15:29:27 -07003574 MOVED_TO_GLOBAL.add(Settings.Global.WTF_IS_FATAL);
Jeff Sharkey625239a2012-09-26 22:03:49 -07003575 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_DURATION_THRESHOLD);
3576 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_THRESHOLD);
3577 MOVED_TO_GLOBAL.add(Settings.Global.SEND_ACTION_APP_ERROR);
3578 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_AGE_SECONDS);
3579 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_MAX_FILES);
3580 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_KB);
3581 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_PERCENT);
3582 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_RESERVE_PERCENT);
3583 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_TAG_PREFIX);
3584 MOVED_TO_GLOBAL.add(Settings.Global.ERROR_LOGCAT_PREFIX);
3585 MOVED_TO_GLOBAL.add(Settings.Global.SYS_FREE_STORAGE_LOG_INTERVAL);
3586 MOVED_TO_GLOBAL.add(Settings.Global.DISK_FREE_CHANGE_REPORTING_THRESHOLD);
3587 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_PERCENTAGE);
3588 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_MAX_BYTES);
3589 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_FULL_THRESHOLD_BYTES);
3590 MOVED_TO_GLOBAL.add(Settings.Global.SYNC_MAX_RETRY_DELAY_IN_SECONDS);
3591 MOVED_TO_GLOBAL.add(Settings.Global.CONNECTIVITY_CHANGE_DELAY);
3592 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED);
3593 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_SERVER);
3594 MOVED_TO_GLOBAL.add(Settings.Global.NSD_ON);
3595 MOVED_TO_GLOBAL.add(Settings.Global.SET_INSTALL_LOCATION);
3596 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_INSTALL_LOCATION);
3597 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_UP_DELAY);
3598 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_DOWN_DELAY);
3599 MOVED_TO_GLOBAL.add(Settings.Global.READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT);
3600 MOVED_TO_GLOBAL.add(Settings.Global.HTTP_PROXY);
3601 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_HOST);
3602 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_PORT);
3603 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST);
3604 MOVED_TO_GLOBAL.add(Settings.Global.SET_GLOBAL_HTTP_PROXY);
3605 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_DNS_SERVER);
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003606 MOVED_TO_GLOBAL.add(Settings.Global.PREFERRED_NETWORK_MODE);
Hui Shu22671772014-10-01 21:41:07 +00003607 MOVED_TO_GLOBAL.add(Settings.Global.WEBVIEW_DATA_REDUCTION_PROXY_KEY);
Christopher Tate06efb532012-08-24 15:29:27 -07003608 }
3609
Christopher Tate66488d62012-10-02 11:58:01 -07003610 /** @hide */
Svetoslav683914b2015-01-15 14:22:26 -08003611 public static void getMovedToGlobalSettings(Set<String> outKeySet) {
Christopher Tate66488d62012-10-02 11:58:01 -07003612 outKeySet.addAll(MOVED_TO_GLOBAL);
3613 }
3614
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003615 /**
3616 * Look up a name in the database.
3617 * @param resolver to access the database with
3618 * @param name to look up in the table
3619 * @return the corresponding value, or null if not present
3620 */
Dianne Hackborn139748f2012-09-24 11:36:57 -07003621 public static String getString(ContentResolver resolver, String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07003622 return getStringForUser(resolver, name, UserHandle.myUserId());
3623 }
3624
3625 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -07003626 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -07003627 int userHandle) {
3628 if (MOVED_TO_GLOBAL.contains(name)) {
3629 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
3630 + " to android.provider.Settings.Global.");
3631 return Global.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003632 }
Amith Yamasani52c489c2012-03-28 11:42:42 -07003633
Dianne Hackborn139748f2012-09-24 11:36:57 -07003634 if (MOVED_TO_LOCK_SETTINGS.contains(name)) {
3635 synchronized (Secure.class) {
3636 if (sLockSettings == null) {
3637 sLockSettings = ILockSettings.Stub.asInterface(
3638 (IBinder) ServiceManager.getService("lock_settings"));
3639 sIsSystemProcess = Process.myUid() == Process.SYSTEM_UID;
3640 }
3641 }
3642 if (sLockSettings != null && !sIsSystemProcess) {
3643 try {
3644 return sLockSettings.getString(name, "0", userHandle);
3645 } catch (RemoteException re) {
3646 // Fall through
3647 }
Amith Yamasani52c489c2012-03-28 11:42:42 -07003648 }
3649 }
3650
Christopher Tate06efb532012-08-24 15:29:27 -07003651 return sNameValueCache.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003652 }
3653
3654 /**
3655 * Store a name/value pair into the database.
3656 * @param resolver to access the database with
3657 * @param name to store
3658 * @param value to associate with the name
3659 * @return true if the value was set, false on database errors
3660 */
Christopher Tate06efb532012-08-24 15:29:27 -07003661 public static boolean putString(ContentResolver resolver, String name, String value) {
3662 return putStringForUser(resolver, name, value, UserHandle.myUserId());
3663 }
3664
3665 /** @hide */
3666 public static boolean putStringForUser(ContentResolver resolver, String name, String value,
3667 int userHandle) {
Julia Reynolds82735bc2014-09-04 16:43:30 -04003668 if (LOCATION_MODE.equals(name)) {
3669 // HACK ALERT: temporary hack to work around b/10491283.
3670 // TODO: once b/10491283 fixed, remove this hack
3671 return setLocationModeForUser(resolver, Integer.parseInt(value), userHandle);
3672 }
Christopher Tate06efb532012-08-24 15:29:27 -07003673 if (MOVED_TO_GLOBAL.contains(name)) {
3674 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
3675 + " to android.provider.Settings.Global");
3676 return Global.putStringForUser(resolver, name, value, userHandle);
3677 }
Christopher Tate06efb532012-08-24 15:29:27 -07003678 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003679 }
3680
3681 /**
3682 * Construct the content URI for a particular name/value pair,
3683 * useful for monitoring changes with a ContentObserver.
3684 * @param name to look up in the table
3685 * @return the corresponding content URI, or null if not present
3686 */
3687 public static Uri getUriFor(String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07003688 if (MOVED_TO_GLOBAL.contains(name)) {
3689 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
3690 + " to android.provider.Settings.Global, returning global URI.");
3691 return Global.getUriFor(Global.CONTENT_URI, name);
3692 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003693 return getUriFor(CONTENT_URI, name);
3694 }
3695
3696 /**
3697 * Convenience function for retrieving a single secure settings value
3698 * as an integer. Note that internally setting values are always
3699 * stored as strings; this function converts the string to an integer
3700 * for you. The default value will be returned if the setting is
3701 * not defined or not an integer.
3702 *
3703 * @param cr The ContentResolver to access.
3704 * @param name The name of the setting to retrieve.
3705 * @param def Value to return if the setting is not defined.
3706 *
3707 * @return The setting's current value, or 'def' if it is not defined
3708 * or not a valid integer.
3709 */
3710 public static int getInt(ContentResolver cr, String name, int def) {
Christopher Tate06efb532012-08-24 15:29:27 -07003711 return getIntForUser(cr, name, def, UserHandle.myUserId());
3712 }
3713
3714 /** @hide */
3715 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
Tom O'Neill7f6f4572013-08-27 10:53:15 -07003716 if (LOCATION_MODE.equals(name)) {
3717 // HACK ALERT: temporary hack to work around b/10491283.
3718 // TODO: once b/10491283 fixed, remove this hack
3719 return getLocationModeForUser(cr, userHandle);
3720 }
Christopher Tate06efb532012-08-24 15:29:27 -07003721 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003722 try {
3723 return v != null ? Integer.parseInt(v) : def;
3724 } catch (NumberFormatException e) {
3725 return def;
3726 }
3727 }
3728
3729 /**
3730 * Convenience function for retrieving a single secure settings value
3731 * as an integer. Note that internally setting values are always
3732 * stored as strings; this function converts the string to an integer
3733 * for you.
3734 * <p>
3735 * This version does not take a default value. If the setting has not
3736 * been set, or the string value is not a number,
3737 * it throws {@link SettingNotFoundException}.
3738 *
3739 * @param cr The ContentResolver to access.
3740 * @param name The name of the setting to retrieve.
3741 *
3742 * @throws SettingNotFoundException Thrown if a setting by the given
3743 * name can't be found or the setting value is not an integer.
3744 *
3745 * @return The setting's current value.
3746 */
3747 public static int getInt(ContentResolver cr, String name)
3748 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07003749 return getIntForUser(cr, name, UserHandle.myUserId());
3750 }
3751
3752 /** @hide */
3753 public static int getIntForUser(ContentResolver cr, String name, int userHandle)
3754 throws SettingNotFoundException {
Tom O'Neill7f6f4572013-08-27 10:53:15 -07003755 if (LOCATION_MODE.equals(name)) {
3756 // HACK ALERT: temporary hack to work around b/10491283.
3757 // TODO: once b/10491283 fixed, remove this hack
3758 return getLocationModeForUser(cr, userHandle);
3759 }
Christopher Tate06efb532012-08-24 15:29:27 -07003760 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003761 try {
3762 return Integer.parseInt(v);
3763 } catch (NumberFormatException e) {
3764 throw new SettingNotFoundException(name);
3765 }
3766 }
3767
3768 /**
3769 * Convenience function for updating a single settings value as an
3770 * integer. This will either create a new entry in the table if the
3771 * given name does not exist, or modify the value of the existing row
3772 * with that name. Note that internally setting values are always
3773 * stored as strings, so this function converts the given value to a
3774 * string before storing it.
3775 *
3776 * @param cr The ContentResolver to access.
3777 * @param name The name of the setting to modify.
3778 * @param value The new value for the setting.
3779 * @return true if the value was set, false on database errors
3780 */
3781 public static boolean putInt(ContentResolver cr, String name, int value) {
Christopher Tate06efb532012-08-24 15:29:27 -07003782 return putIntForUser(cr, name, value, UserHandle.myUserId());
3783 }
3784
3785 /** @hide */
3786 public static boolean putIntForUser(ContentResolver cr, String name, int value,
3787 int userHandle) {
3788 return putStringForUser(cr, name, Integer.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003789 }
3790
3791 /**
3792 * Convenience function for retrieving a single secure settings value
3793 * as a {@code long}. Note that internally setting values are always
3794 * stored as strings; this function converts the string to a {@code long}
3795 * for you. The default value will be returned if the setting is
3796 * not defined or not a {@code long}.
3797 *
3798 * @param cr The ContentResolver to access.
3799 * @param name The name of the setting to retrieve.
3800 * @param def Value to return if the setting is not defined.
3801 *
3802 * @return The setting's current value, or 'def' if it is not defined
3803 * or not a valid {@code long}.
3804 */
3805 public static long getLong(ContentResolver cr, String name, long def) {
Christopher Tate06efb532012-08-24 15:29:27 -07003806 return getLongForUser(cr, name, def, UserHandle.myUserId());
3807 }
3808
3809 /** @hide */
3810 public static long getLongForUser(ContentResolver cr, String name, long def,
3811 int userHandle) {
3812 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003813 long value;
3814 try {
3815 value = valString != null ? Long.parseLong(valString) : def;
3816 } catch (NumberFormatException e) {
3817 value = def;
3818 }
3819 return value;
3820 }
3821
3822 /**
3823 * Convenience function for retrieving a single secure settings value
3824 * as a {@code long}. Note that internally setting values are always
3825 * stored as strings; this function converts the string to a {@code long}
3826 * for you.
3827 * <p>
3828 * This version does not take a default value. If the setting has not
3829 * been set, or the string value is not a number,
3830 * it throws {@link SettingNotFoundException}.
3831 *
3832 * @param cr The ContentResolver to access.
3833 * @param name The name of the setting to retrieve.
3834 *
3835 * @return The setting's current value.
3836 * @throws SettingNotFoundException Thrown if a setting by the given
3837 * name can't be found or the setting value is not an integer.
3838 */
3839 public static long getLong(ContentResolver cr, String name)
3840 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07003841 return getLongForUser(cr, name, UserHandle.myUserId());
3842 }
3843
3844 /** @hide */
3845 public static long getLongForUser(ContentResolver cr, String name, int userHandle)
3846 throws SettingNotFoundException {
3847 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003848 try {
3849 return Long.parseLong(valString);
3850 } catch (NumberFormatException e) {
3851 throw new SettingNotFoundException(name);
3852 }
3853 }
3854
3855 /**
3856 * Convenience function for updating a secure settings value as a long
3857 * integer. This will either create a new entry in the table if the
3858 * given name does not exist, or modify the value of the existing row
3859 * with that name. Note that internally setting values are always
3860 * stored as strings, so this function converts the given value to a
3861 * string before storing it.
3862 *
3863 * @param cr The ContentResolver to access.
3864 * @param name The name of the setting to modify.
3865 * @param value The new value for the setting.
3866 * @return true if the value was set, false on database errors
3867 */
3868 public static boolean putLong(ContentResolver cr, String name, long value) {
Christopher Tate06efb532012-08-24 15:29:27 -07003869 return putLongForUser(cr, name, value, UserHandle.myUserId());
3870 }
3871
3872 /** @hide */
3873 public static boolean putLongForUser(ContentResolver cr, String name, long value,
3874 int userHandle) {
3875 return putStringForUser(cr, name, Long.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003876 }
3877
3878 /**
3879 * Convenience function for retrieving a single secure settings value
3880 * as a floating point number. Note that internally setting values are
3881 * always stored as strings; this function converts the string to an
3882 * float for you. The default value will be returned if the setting
3883 * is not defined or not a valid float.
3884 *
3885 * @param cr The ContentResolver to access.
3886 * @param name The name of the setting to retrieve.
3887 * @param def Value to return if the setting is not defined.
3888 *
3889 * @return The setting's current value, or 'def' if it is not defined
3890 * or not a valid float.
3891 */
3892 public static float getFloat(ContentResolver cr, String name, float def) {
Christopher Tate06efb532012-08-24 15:29:27 -07003893 return getFloatForUser(cr, name, def, UserHandle.myUserId());
3894 }
3895
3896 /** @hide */
3897 public static float getFloatForUser(ContentResolver cr, String name, float def,
3898 int userHandle) {
3899 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003900 try {
3901 return v != null ? Float.parseFloat(v) : def;
3902 } catch (NumberFormatException e) {
3903 return def;
3904 }
3905 }
3906
3907 /**
3908 * Convenience function for retrieving a single secure settings value
3909 * as a float. Note that internally setting values are always
3910 * stored as strings; this function converts the string to a float
3911 * for you.
3912 * <p>
3913 * This version does not take a default value. If the setting has not
3914 * been set, or the string value is not a number,
3915 * it throws {@link SettingNotFoundException}.
3916 *
3917 * @param cr The ContentResolver to access.
3918 * @param name The name of the setting to retrieve.
3919 *
3920 * @throws SettingNotFoundException Thrown if a setting by the given
3921 * name can't be found or the setting value is not a float.
3922 *
3923 * @return The setting's current value.
3924 */
3925 public static float getFloat(ContentResolver cr, String name)
3926 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07003927 return getFloatForUser(cr, name, UserHandle.myUserId());
3928 }
3929
3930 /** @hide */
3931 public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
3932 throws SettingNotFoundException {
3933 String v = getStringForUser(cr, name, userHandle);
Brian Muramatsue1d46982010-12-06 17:34:20 -08003934 if (v == null) {
3935 throw new SettingNotFoundException(name);
3936 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003937 try {
3938 return Float.parseFloat(v);
3939 } catch (NumberFormatException e) {
3940 throw new SettingNotFoundException(name);
3941 }
3942 }
3943
3944 /**
3945 * Convenience function for updating a single settings value as a
3946 * floating point number. This will either create a new entry in the
3947 * table if the given name does not exist, or modify the value of the
3948 * existing row with that name. Note that internally setting values
3949 * are always stored as strings, so this function converts the given
3950 * value to a string before storing it.
3951 *
3952 * @param cr The ContentResolver to access.
3953 * @param name The name of the setting to modify.
3954 * @param value The new value for the setting.
3955 * @return true if the value was set, false on database errors
3956 */
3957 public static boolean putFloat(ContentResolver cr, String name, float value) {
Christopher Tate06efb532012-08-24 15:29:27 -07003958 return putFloatForUser(cr, name, value, UserHandle.myUserId());
3959 }
3960
3961 /** @hide */
3962 public static boolean putFloatForUser(ContentResolver cr, String name, float value,
3963 int userHandle) {
3964 return putStringForUser(cr, name, Float.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003965 }
3966
3967 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003968 * @deprecated Use {@link android.provider.Settings.Global#DEVELOPMENT_SETTINGS_ENABLED}
3969 * instead
Dianne Hackborn895f99e2012-02-02 11:49:12 -08003970 */
Christopher Tate06efb532012-08-24 15:29:27 -07003971 @Deprecated
3972 public static final String DEVELOPMENT_SETTINGS_ENABLED =
3973 Global.DEVELOPMENT_SETTINGS_ENABLED;
Dianne Hackborn895f99e2012-02-02 11:49:12 -08003974
3975 /**
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07003976 * When the user has enable the option to have a "bug report" command
3977 * in the power menu.
Christopher Tate58f41ec2013-01-11 15:40:36 -08003978 * @deprecated Use {@link android.provider.Settings.Global#BUGREPORT_IN_POWER_MENU} instead
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07003979 * @hide
3980 */
Christopher Tate58f41ec2013-01-11 15:40:36 -08003981 @Deprecated
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07003982 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
3983
3984 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003985 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003986 */
Christopher Tate06efb532012-08-24 15:29:27 -07003987 @Deprecated
3988 public static final String ADB_ENABLED = Global.ADB_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003989
3990 /**
3991 * Setting to allow mock locations and location provider status to be injected into the
3992 * LocationManager service for testing purposes during application development. These
3993 * locations and status values override actual location and status information generated
3994 * by network, gps, or other location providers.
3995 */
3996 public static final String ALLOW_MOCK_LOCATION = "mock_location";
3997
3998 /**
Doug Zongkerd8893db2010-01-26 12:29:44 -08003999 * A 64-bit number (as a hex string) that is randomly
Scott Main44895332013-11-12 09:23:13 -08004000 * generated when the user first sets up the device and should remain
4001 * constant for the lifetime of the user's device. The value may
4002 * change if a factory reset is performed on the device.
4003 * <p class="note"><strong>Note:</strong> When a device has <a
4004 * href="{@docRoot}about/versions/android-4.2.html#MultipleUsers">multiple users</a>
4005 * (available on certain devices running Android 4.2 or higher), each user appears as a
4006 * completely separate device, so the {@code ANDROID_ID} value is unique to each
4007 * user.</p>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004008 */
4009 public static final String ANDROID_ID = "android_id";
4010
4011 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004012 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004013 */
Christopher Tate06efb532012-08-24 15:29:27 -07004014 @Deprecated
4015 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004016
4017 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004018 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004019 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07004020 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07004021 public static final String DATA_ROAMING = Global.DATA_ROAMING;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004022
4023 /**
4024 * Setting to record the input method used by default, holding the ID
4025 * of the desired method.
4026 */
4027 public static final String DEFAULT_INPUT_METHOD = "default_input_method";
4028
4029 /**
satokab751aa2010-09-14 19:17:36 +09004030 * Setting to record the input method subtype used by default, holding the ID
4031 * of the desired method.
4032 */
4033 public static final String SELECTED_INPUT_METHOD_SUBTYPE =
4034 "selected_input_method_subtype";
4035
4036 /**
satok723a27e2010-11-11 14:58:11 +09004037 * Setting to record the history of input method subtype, holding the pair of ID of IME
4038 * and its last used subtype.
4039 * @hide
4040 */
4041 public static final String INPUT_METHODS_SUBTYPE_HISTORY =
4042 "input_methods_subtype_history";
4043
4044 /**
satok5c58dfc2010-12-14 21:54:47 +09004045 * Setting to record the visibility of input method selector
4046 */
4047 public static final String INPUT_METHOD_SELECTOR_VISIBILITY =
4048 "input_method_selector_visibility";
4049
4050 /**
Dianne Hackborn91097de2014-04-04 18:02:06 -07004051 * The currently selected voice interaction service flattened ComponentName.
4052 * @hide
4053 */
4054 public static final String VOICE_INTERACTION_SERVICE = "voice_interaction_service";
4055
4056 /**
Zhihai Xuaf5971e2013-06-10 20:28:31 -07004057 * bluetooth HCI snoop log configuration
4058 * @hide
4059 */
4060 public static final String BLUETOOTH_HCI_LOG =
4061 "bluetooth_hci_log";
4062
4063 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004064 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004065 */
Christopher Tate06efb532012-08-24 15:29:27 -07004066 @Deprecated
4067 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004068
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004069 /**
Russell Brennerde6ae442012-09-26 20:53:10 -07004070 * Whether the current user has been set up via setup wizard (0 = false, 1 = true)
4071 * @hide
4072 */
4073 public static final String USER_SETUP_COMPLETE = "user_setup_complete";
4074
4075 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004076 * List of input methods that are currently enabled. This is a string
4077 * containing the IDs of all enabled input methods, each ID separated
4078 * by ':'.
4079 */
4080 public static final String ENABLED_INPUT_METHODS = "enabled_input_methods";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004081
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004082 /**
Amith Yamasanie861ec12010-03-24 21:39:27 -07004083 * List of system input methods that are currently disabled. This is a string
4084 * containing the IDs of all disabled input methods, each ID separated
4085 * by ':'.
4086 * @hide
4087 */
4088 public static final String DISABLED_SYSTEM_INPUT_METHODS = "disabled_system_input_methods";
4089
4090 /**
Michael Wright7b5a96b2014-08-09 19:28:42 -07004091 * Whether to show the IME when a hard keyboard is connected. This is a boolean that
4092 * determines if the IME should be shown when a hard keyboard is attached.
4093 * @hide
4094 */
4095 public static final String SHOW_IME_WITH_HARD_KEYBOARD = "show_ime_with_hard_keyboard";
4096
4097 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07004098 * Host name and port for global http proxy. Uses ':' seperator for
4099 * between host and port.
4100 *
4101 * @deprecated Use {@link Global#HTTP_PROXY}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004102 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07004103 @Deprecated
4104 public static final String HTTP_PROXY = Global.HTTP_PROXY;
Robert Greenwalte90aa5e2010-09-01 11:34:05 -07004105
4106 /**
Christopher Tateaa036a22014-05-19 16:33:27 -07004107 * Whether applications can be installed for this user via the system's
4108 * {@link Intent#ACTION_INSTALL_PACKAGE} mechanism.
4109 *
4110 * <p>1 = permit app installation via the system package installer intent
4111 * <p>0 = do not allow use of the package installer
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004112 */
Christopher Tateaa036a22014-05-19 16:33:27 -07004113 public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004114
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004115 /**
Tom O'Neill923c0dc2014-03-03 11:07:55 -08004116 * Comma-separated list of location providers that activities may access. Do not rely on
4117 * this value being present in settings.db or on ContentObserver notifications on the
4118 * corresponding Uri.
Tom O'Neilla324ac72013-08-26 14:40:23 -07004119 *
Tom O'Neill923c0dc2014-03-03 11:07:55 -08004120 * @deprecated use {@link #LOCATION_MODE} and
4121 * {@link LocationManager#MODE_CHANGED_ACTION} (or
4122 * {@link LocationManager#PROVIDERS_CHANGED_ACTION})
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004123 */
Tom O'Neilla324ac72013-08-26 14:40:23 -07004124 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004125 public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004126
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004127 /**
Tom O'Neill7f6f4572013-08-27 10:53:15 -07004128 * The degree of location access enabled by the user.
Tom O'Neill923c0dc2014-03-03 11:07:55 -08004129 * <p>
Tom O'Neill7f6f4572013-08-27 10:53:15 -07004130 * When used with {@link #putInt(ContentResolver, String, int)}, must be one of {@link
4131 * #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY}, {@link
4132 * #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}. When used with {@link
4133 * #getInt(ContentResolver, String)}, the caller must gracefully handle additional location
4134 * modes that might be added in the future.
Tom O'Neill923c0dc2014-03-03 11:07:55 -08004135 * <p>
4136 * Note: do not rely on this value being present in settings.db or on ContentObserver
4137 * notifications for the corresponding Uri. Use {@link LocationManager#MODE_CHANGED_ACTION}
4138 * to receive changes in this value.
Tom O'Neilla324ac72013-08-26 14:40:23 -07004139 */
4140 public static final String LOCATION_MODE = "location_mode";
4141
4142 /**
Tom O'Neill7f6f4572013-08-27 10:53:15 -07004143 * Location access disabled.
Tom O'Neill1f48b782013-08-19 18:14:56 -07004144 */
4145 public static final int LOCATION_MODE_OFF = 0;
4146 /**
4147 * Network Location Provider disabled, but GPS and other sensors enabled.
4148 */
4149 public static final int LOCATION_MODE_SENSORS_ONLY = 1;
4150 /**
Tom O'Neilld5759432013-09-11 11:03:03 -07004151 * Reduced power usage, such as limiting the number of GPS updates per hour. Requests
4152 * with {@link android.location.Criteria#POWER_HIGH} may be downgraded to
4153 * {@link android.location.Criteria#POWER_MEDIUM}.
Tom O'Neill1f48b782013-08-19 18:14:56 -07004154 */
4155 public static final int LOCATION_MODE_BATTERY_SAVING = 2;
4156 /**
4157 * Best-effort location computation allowed.
4158 */
4159 public static final int LOCATION_MODE_HIGH_ACCURACY = 3;
4160
4161 /**
Danielle Millett925a7d82012-03-19 18:02:20 -04004162 * A flag containing settings used for biometric weak
4163 * @hide
4164 */
Adrian Roos230635e2015-01-07 20:50:29 +01004165 @Deprecated
Danielle Millett925a7d82012-03-19 18:02:20 -04004166 public static final String LOCK_BIOMETRIC_WEAK_FLAGS =
4167 "lock_biometric_weak_flags";
4168
4169 /**
Jason Monk94cfd9d2014-10-31 13:18:21 -04004170 * Whether lock-to-app will lock the keyguard when exiting.
4171 * @hide
4172 */
4173 public static final String LOCK_TO_APP_EXIT_LOCKED = "lock_to_app_exit_locked";
4174
4175 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08004176 * Whether autolock is enabled (0 = false, 1 = true)
Adrian Roos9dd16eb2015-01-08 16:20:49 +01004177 *
4178 * @deprecated Use {@link android.app.KeyguardManager} to determine the state and security
4179 * level of the keyguard.
Amith Yamasani156c4352010-03-05 17:10:03 -08004180 */
Adrian Roos9dd16eb2015-01-08 16:20:49 +01004181 @Deprecated
Amith Yamasani156c4352010-03-05 17:10:03 -08004182 public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock";
4183
4184 /**
4185 * Whether lock pattern is visible as user enters (0 = false, 1 = true)
4186 */
4187 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
4188
4189 /**
Jeff Sharkey5ed9d682012-10-10 14:28:27 -07004190 * Whether lock pattern will vibrate as user enters (0 = false, 1 =
4191 * true)
4192 *
4193 * @deprecated Starting in {@link VERSION_CODES#JELLY_BEAN_MR1} the
4194 * lockscreen uses
4195 * {@link Settings.System#HAPTIC_FEEDBACK_ENABLED}.
Amith Yamasani156c4352010-03-05 17:10:03 -08004196 */
Jeff Sharkey5ed9d682012-10-10 14:28:27 -07004197 @Deprecated
4198 public static final String
4199 LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = "lock_pattern_tactile_feedback_enabled";
Amith Yamasani156c4352010-03-05 17:10:03 -08004200
4201 /**
Jim Millerbc4603b2010-08-30 21:21:34 -07004202 * This preference allows the device to be locked given time after screen goes off,
4203 * subject to current DeviceAdmin policy limits.
4204 * @hide
4205 */
4206 public static final String LOCK_SCREEN_LOCK_AFTER_TIMEOUT = "lock_screen_lock_after_timeout";
4207
4208
4209 /**
John Spurlock5f050e52012-10-27 10:44:19 -04004210 * This preference contains the string that shows for owner info on LockScreen.
Jim Miller253a5ef2010-10-13 20:57:29 -07004211 * @hide
Jim Miller187ec582013-04-15 18:27:54 -07004212 * @deprecated
Jim Miller253a5ef2010-10-13 20:57:29 -07004213 */
4214 public static final String LOCK_SCREEN_OWNER_INFO = "lock_screen_owner_info";
4215
4216 /**
John Spurlock5f050e52012-10-27 10:44:19 -04004217 * Ids of the user-selected appwidgets on the lockscreen (comma-delimited).
Jim Millerf229e4d2012-09-12 20:32:50 -07004218 * @hide
4219 */
Adrian Roos230635e2015-01-07 20:50:29 +01004220 @Deprecated
Michael Jurkaaa2859a2012-10-24 12:46:49 -07004221 public static final String LOCK_SCREEN_APPWIDGET_IDS =
4222 "lock_screen_appwidget_ids";
Jim Millerf229e4d2012-09-12 20:32:50 -07004223
4224 /**
Jim Miller08fa40c2014-04-29 18:18:47 -07004225 * List of enrolled fingerprint identifiers (comma-delimited).
4226 * @hide
4227 */
4228 public static final String USER_FINGERPRINT_IDS = "user_fingerprint_ids";
4229
4230 /**
Jim Miller51117262012-11-04 17:58:09 -08004231 * Id of the appwidget shown on the lock screen when appwidgets are disabled.
4232 * @hide
4233 */
Adrian Roos230635e2015-01-07 20:50:29 +01004234 @Deprecated
Jim Miller51117262012-11-04 17:58:09 -08004235 public static final String LOCK_SCREEN_FALLBACK_APPWIDGET_ID =
4236 "lock_screen_fallback_appwidget_id";
4237
4238 /**
John Spurlock5f050e52012-10-27 10:44:19 -04004239 * Index of the lockscreen appwidget to restore, -1 if none.
4240 * @hide
4241 */
Adrian Roos230635e2015-01-07 20:50:29 +01004242 @Deprecated
John Spurlock5f050e52012-10-27 10:44:19 -04004243 public static final String LOCK_SCREEN_STICKY_APPWIDGET =
4244 "lock_screen_sticky_appwidget";
4245
4246 /**
4247 * This preference enables showing the owner info on LockScreen.
Jim Miller253a5ef2010-10-13 20:57:29 -07004248 * @hide
Jim Miller187ec582013-04-15 18:27:54 -07004249 * @deprecated
Jim Miller253a5ef2010-10-13 20:57:29 -07004250 */
4251 public static final String LOCK_SCREEN_OWNER_INFO_ENABLED =
4252 "lock_screen_owner_info_enabled";
4253
4254 /**
Dan Sandler5d7c3cc2014-02-18 17:35:15 -05004255 * When set by a user, allows notifications to be shown atop a securely locked screen
4256 * in their full "private" form (same as when the device is unlocked).
Dan Sandlerfd16d562014-02-13 18:43:31 -08004257 * @hide
4258 */
4259 public static final String LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS =
4260 "lock_screen_allow_private_notifications";
4261
4262 /**
Chris Wrencd8f4f72014-08-27 18:48:13 -04004263 * Set by the system to track if the user needs to see the call to action for
4264 * the lockscreen notification policy.
4265 * @hide
4266 */
4267 public static final String SHOW_NOTE_ABOUT_NOTIFICATION_HIDING =
4268 "show_note_about_notification_hiding";
4269
4270 /**
Adrian Roos3870d452014-09-05 18:22:28 +02004271 * Set to 1 by the system after trust agents have been initialized.
4272 * @hide
4273 */
4274 public static final String TRUST_AGENTS_INITIALIZED =
4275 "trust_agents_initialized";
4276
4277 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004278 * The Logging ID (a unique 64-bit value) as a hex string.
4279 * Used as a pseudonymous identifier for logging.
4280 * @deprecated This identifier is poorly initialized and has
4281 * many collisions. It should not be used.
4282 */
4283 @Deprecated
4284 public static final String LOGGING_ID = "logging_id";
4285
4286 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004287 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004288 */
Christopher Tate06efb532012-08-24 15:29:27 -07004289 @Deprecated
4290 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004291
4292 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08004293 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004294 */
4295 public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004296
4297 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08004298 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004299 */
4300 public static final String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004301
4302 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08004303 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004304 */
4305 public static final String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004306
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004307 /**
4308 * Settings classname to launch when Settings is clicked from All
4309 * Applications. Needed because of user testing between the old
4310 * and new Settings apps.
4311 */
4312 // TODO: 881807
4313 public static final String SETTINGS_CLASSNAME = "settings_classname";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004314
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004315 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004316 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004317 */
Christopher Tate06efb532012-08-24 15:29:27 -07004318 @Deprecated
4319 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004320
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004321 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004322 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004323 */
Christopher Tate06efb532012-08-24 15:29:27 -07004324 @Deprecated
4325 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004326
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004327 /**
svetoslavganov75986cf2009-05-14 22:28:01 -07004328 * If accessibility is enabled.
4329 */
4330 public static final String ACCESSIBILITY_ENABLED = "accessibility_enabled";
4331
4332 /**
Svetoslav Ganov00aabf72011-07-21 11:35:03 -07004333 * If touch exploration is enabled.
Svetoslav Ganov35bfede2011-07-14 17:57:06 -07004334 */
Svetoslav Ganov00aabf72011-07-21 11:35:03 -07004335 public static final String TOUCH_EXPLORATION_ENABLED = "touch_exploration_enabled";
Svetoslav Ganov35bfede2011-07-14 17:57:06 -07004336
4337 /**
svetoslavganov75986cf2009-05-14 22:28:01 -07004338 * List of the enabled accessibility providers.
4339 */
4340 public static final String ENABLED_ACCESSIBILITY_SERVICES =
4341 "enabled_accessibility_services";
4342
4343 /**
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07004344 * List of the accessibility services to which the user has granted
Svetoslav Ganov9a4c5cd2012-05-30 14:06:32 -07004345 * permission to put the device into touch exploration mode.
4346 *
4347 * @hide
4348 */
4349 public static final String TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES =
4350 "touch_exploration_granted_accessibility_services";
4351
4352 /**
Svetoslav Ganov55f937a2011-12-05 11:42:07 -08004353 * Whether to speak passwords while in accessibility mode.
4354 */
4355 public static final String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password";
4356
4357 /**
Chris Craikcce47eb2014-07-16 15:12:15 -07004358 * Whether to draw text with high contrast while in accessibility mode.
4359 *
4360 * @hide
4361 */
4362 public static final String ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED =
4363 "high_text_contrast_enabled";
4364
4365 /**
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08004366 * If injection of accessibility enhancing JavaScript screen-reader
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07004367 * is enabled.
4368 * <p>
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08004369 * Note: The JavaScript based screen-reader is served by the
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07004370 * Google infrastructure and enable users with disabilities to
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07004371 * efficiently navigate in and explore web content.
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07004372 * </p>
4373 * <p>
4374 * This property represents a boolean value.
4375 * </p>
4376 * @hide
4377 */
4378 public static final String ACCESSIBILITY_SCRIPT_INJECTION =
4379 "accessibility_script_injection";
4380
4381 /**
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08004382 * The URL for the injected JavaScript based screen-reader used
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07004383 * for providing accessibility of content in WebView.
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08004384 * <p>
4385 * Note: The JavaScript based screen-reader is served by the
4386 * Google infrastructure and enable users with disabilities to
4387 * efficiently navigate in and explore web content.
4388 * </p>
4389 * <p>
4390 * This property represents a string value.
4391 * </p>
4392 * @hide
4393 */
4394 public static final String ACCESSIBILITY_SCREEN_READER_URL =
4395 "accessibility_script_injection_url";
4396
4397 /**
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07004398 * Key bindings for navigation in built-in accessibility support for web content.
4399 * <p>
4400 * Note: These key bindings are for the built-in accessibility navigation for
4401 * web content which is used as a fall back solution if JavaScript in a WebView
4402 * is not enabled or the user has not opted-in script injection from Google.
4403 * </p>
4404 * <p>
4405 * The bindings are separated by semi-colon. A binding is a mapping from
4406 * a key to a sequence of actions (for more details look at
4407 * android.webkit.AccessibilityInjector). A key is represented as the hexademical
4408 * string representation of an integer obtained from a meta state (optional) shifted
4409 * sixteen times left and bitwise ored with a key code. An action is represented
4410 * as a hexademical string representation of an integer where the first two digits
4411 * are navigation action index, the second, the third, and the fourth digit pairs
4412 * represent the action arguments. The separate actions in a binding are colon
4413 * separated. The key and the action sequence it maps to are separated by equals.
4414 * </p>
4415 * <p>
4416 * For example, the binding below maps the DPAD right button to traverse the
4417 * current navigation axis once without firing an accessibility event and to
4418 * perform the same traversal again but to fire an event:
4419 * <code>
4420 * 0x16=0x01000100:0x01000101;
4421 * </code>
4422 * </p>
4423 * <p>
4424 * The goal of this binding is to enable dynamic rebinding of keys to
4425 * navigation actions for web content without requiring a framework change.
4426 * </p>
4427 * <p>
4428 * This property represents a string value.
4429 * </p>
4430 * @hide
4431 */
4432 public static final String ACCESSIBILITY_WEB_CONTENT_KEY_BINDINGS =
4433 "accessibility_web_content_key_bindings";
4434
4435 /**
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07004436 * Setting that specifies whether the display magnification is enabled.
4437 * Display magnifications allows the user to zoom in the display content
4438 * and is targeted to low vision users. The current magnification scale
4439 * is controlled by {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}.
4440 *
4441 * @hide
4442 */
4443 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED =
4444 "accessibility_display_magnification_enabled";
4445
4446 /**
4447 * Setting that specifies what the display magnification scale is.
4448 * Display magnifications allows the user to zoom in the display
4449 * content and is targeted to low vision users. Whether a display
4450 * magnification is performed is controlled by
4451 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED}
4452 *
4453 * @hide
4454 */
4455 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE =
4456 "accessibility_display_magnification_scale";
4457
4458 /**
4459 * Setting that specifies whether the display magnification should be
4460 * automatically updated. If this fearture is enabled the system will
4461 * exit magnification mode or pan the viewport when a context change
4462 * occurs. For example, on staring a new activity or rotating the screen,
4463 * the system may zoom out so the user can see the new context he is in.
4464 * Another example is on showing a window that is not visible in the
4465 * magnified viewport the system may pan the viewport to make the window
4466 * the has popped up so the user knows that the context has changed.
4467 * Whether a screen magnification is performed is controlled by
4468 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED}
4469 *
4470 * @hide
4471 */
4472 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE =
4473 "accessibility_display_magnification_auto_update";
4474
4475 /**
Alan Viveretteef793802013-07-23 14:15:28 -07004476 * Setting that specifies whether timed text (captions) should be
4477 * displayed in video content. Text display properties are controlled by
4478 * the following settings:
4479 * <ul>
4480 * <li>{@link #ACCESSIBILITY_CAPTIONING_LOCALE}
4481 * <li>{@link #ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR}
4482 * <li>{@link #ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR}
4483 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_COLOR}
4484 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_TYPE}
4485 * <li>{@link #ACCESSIBILITY_CAPTIONING_TYPEFACE}
Alan Viverette69ce69b2013-08-29 12:23:48 -07004486 * <li>{@link #ACCESSIBILITY_CAPTIONING_FONT_SCALE}
Alan Viveretteef793802013-07-23 14:15:28 -07004487 * </ul>
4488 *
4489 * @hide
4490 */
4491 public static final String ACCESSIBILITY_CAPTIONING_ENABLED =
4492 "accessibility_captioning_enabled";
4493
4494 /**
4495 * Setting that specifies the language for captions as a locale string,
4496 * e.g. en_US.
4497 *
4498 * @see java.util.Locale#toString
4499 * @hide
4500 */
4501 public static final String ACCESSIBILITY_CAPTIONING_LOCALE =
4502 "accessibility_captioning_locale";
4503
4504 /**
Alan Viverette43a1e3d2013-08-02 16:45:03 -07004505 * Integer property that specifies the preset style for captions, one
4506 * of:
4507 * <ul>
Alan Viverette69ce69b2013-08-29 12:23:48 -07004508 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESET_CUSTOM}
4509 * <li>a valid index of {@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESETS}
Alan Viverette43a1e3d2013-08-02 16:45:03 -07004510 * </ul>
4511 *
4512 * @see java.util.Locale#toString
4513 * @hide
4514 */
4515 public static final String ACCESSIBILITY_CAPTIONING_PRESET =
4516 "accessibility_captioning_preset";
4517
4518 /**
Alan Viveretteef793802013-07-23 14:15:28 -07004519 * Integer property that specifes the background color for captions as a
4520 * packed 32-bit color.
4521 *
4522 * @see android.graphics.Color#argb
4523 * @hide
4524 */
4525 public static final String ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR =
4526 "accessibility_captioning_background_color";
4527
4528 /**
4529 * Integer property that specifes the foreground color for captions as a
4530 * packed 32-bit color.
4531 *
4532 * @see android.graphics.Color#argb
4533 * @hide
4534 */
4535 public static final String ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR =
4536 "accessibility_captioning_foreground_color";
4537
4538 /**
4539 * Integer property that specifes the edge type for captions, one of:
4540 * <ul>
Alan Viverette69ce69b2013-08-29 12:23:48 -07004541 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_NONE}
4542 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_OUTLINE}
4543 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_DROP_SHADOW}
Alan Viveretteef793802013-07-23 14:15:28 -07004544 * </ul>
4545 *
4546 * @see #ACCESSIBILITY_CAPTIONING_EDGE_COLOR
4547 * @hide
4548 */
4549 public static final String ACCESSIBILITY_CAPTIONING_EDGE_TYPE =
4550 "accessibility_captioning_edge_type";
4551
4552 /**
4553 * Integer property that specifes the edge color for captions as a
4554 * packed 32-bit color.
4555 *
4556 * @see #ACCESSIBILITY_CAPTIONING_EDGE_TYPE
4557 * @see android.graphics.Color#argb
4558 * @hide
4559 */
4560 public static final String ACCESSIBILITY_CAPTIONING_EDGE_COLOR =
4561 "accessibility_captioning_edge_color";
4562
4563 /**
Alan Viverette55d70622013-12-11 15:22:14 -08004564 * Integer property that specifes the window color for captions as a
4565 * packed 32-bit color.
4566 *
4567 * @see android.graphics.Color#argb
4568 * @hide
4569 */
4570 public static final String ACCESSIBILITY_CAPTIONING_WINDOW_COLOR =
4571 "accessibility_captioning_window_color";
4572
4573 /**
Alan Viveretteef793802013-07-23 14:15:28 -07004574 * String property that specifies the typeface for captions, one of:
4575 * <ul>
4576 * <li>DEFAULT
4577 * <li>MONOSPACE
4578 * <li>SANS_SERIF
4579 * <li>SERIF
4580 * </ul>
4581 *
4582 * @see android.graphics.Typeface
4583 * @hide
4584 */
4585 public static final String ACCESSIBILITY_CAPTIONING_TYPEFACE =
4586 "accessibility_captioning_typeface";
4587
4588 /**
Alan Viverette69ce69b2013-08-29 12:23:48 -07004589 * Floating point property that specifies font scaling for captions.
Alan Viveretteef793802013-07-23 14:15:28 -07004590 *
4591 * @hide
4592 */
Alan Viverette69ce69b2013-08-29 12:23:48 -07004593 public static final String ACCESSIBILITY_CAPTIONING_FONT_SCALE =
4594 "accessibility_captioning_font_scale";
Alan Viveretteef793802013-07-23 14:15:28 -07004595
4596 /**
Alan Viverette410d4e32013-09-30 15:37:38 -07004597 * Setting that specifies whether display color inversion is enabled.
Alan Viverette410d4e32013-09-30 15:37:38 -07004598 */
4599 public static final String ACCESSIBILITY_DISPLAY_INVERSION_ENABLED =
4600 "accessibility_display_inversion_enabled";
4601
4602 /**
Alan Viverette410d4e32013-09-30 15:37:38 -07004603 * Setting that specifies whether display color space adjustment is
4604 * enabled.
4605 *
4606 * @hide
4607 */
4608 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED =
4609 "accessibility_display_daltonizer_enabled";
4610
4611 /**
4612 * Integer property that specifies the type of color space adjustment to
4613 * perform. Valid values are defined in AccessibilityManager.
4614 *
4615 * @hide
4616 */
4617 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER =
4618 "accessibility_display_daltonizer";
4619
4620 /**
Svetoslav Ganov54d068e2011-03-02 12:58:40 -08004621 * The timout for considering a press to be a long press in milliseconds.
4622 * @hide
4623 */
4624 public static final String LONG_PRESS_TIMEOUT = "long_press_timeout";
4625
4626 /**
Svetoslav Ganov6bd20bc2013-09-02 15:24:45 -07004627 * List of the enabled print services.
Svetoslav Ganov4b9a4d12013-06-11 15:20:06 -07004628 * @hide
4629 */
4630 public static final String ENABLED_PRINT_SERVICES =
4631 "enabled_print_services";
4632
4633 /**
Svetoslav Ganov6bd20bc2013-09-02 15:24:45 -07004634 * List of the system print services we enabled on first boot. On
4635 * first boot we enable all system, i.e. bundled print services,
4636 * once, so they work out-of-the-box.
4637 * @hide
4638 */
4639 public static final String ENABLED_ON_FIRST_BOOT_SYSTEM_PRINT_SERVICES =
4640 "enabled_on_first_boot_system_print_services";
4641
4642 /**
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07004643 * Setting to always use the default text-to-speech settings regardless
4644 * of the application settings.
4645 * 1 = override application settings,
4646 * 0 = use application settings (if specified).
Narayan Kamath6d632962011-08-24 11:51:37 +01004647 *
4648 * @deprecated The value of this setting is no longer respected by
4649 * the framework text to speech APIs as of the Ice Cream Sandwich release.
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07004650 */
Narayan Kamath6d632962011-08-24 11:51:37 +01004651 @Deprecated
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07004652 public static final String TTS_USE_DEFAULTS = "tts_use_defaults";
4653
4654 /**
4655 * Default text-to-speech engine speech rate. 100 = 1x
4656 */
4657 public static final String TTS_DEFAULT_RATE = "tts_default_rate";
4658
4659 /**
4660 * Default text-to-speech engine pitch. 100 = 1x
4661 */
4662 public static final String TTS_DEFAULT_PITCH = "tts_default_pitch";
4663
4664 /**
4665 * Default text-to-speech engine.
4666 */
4667 public static final String TTS_DEFAULT_SYNTH = "tts_default_synth";
4668
4669 /**
Jean-Michel Trivif4782672009-06-09 16:22:48 -07004670 * Default text-to-speech language.
Narayan Kamath6d632962011-08-24 11:51:37 +01004671 *
4672 * @deprecated this setting is no longer in use, as of the Ice Cream
4673 * Sandwich release. Apps should never need to read this setting directly,
4674 * instead can query the TextToSpeech framework classes for the default
4675 * locale. {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivif4782672009-06-09 16:22:48 -07004676 */
Narayan Kamath6d632962011-08-24 11:51:37 +01004677 @Deprecated
Jean-Michel Trivif4782672009-06-09 16:22:48 -07004678 public static final String TTS_DEFAULT_LANG = "tts_default_lang";
4679
4680 /**
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07004681 * Default text-to-speech country.
Narayan Kamath6d632962011-08-24 11:51:37 +01004682 *
4683 * @deprecated this setting is no longer in use, as of the Ice Cream
4684 * Sandwich release. Apps should never need to read this setting directly,
4685 * instead can query the TextToSpeech framework classes for the default
4686 * locale. {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07004687 */
Narayan Kamath6d632962011-08-24 11:51:37 +01004688 @Deprecated
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07004689 public static final String TTS_DEFAULT_COUNTRY = "tts_default_country";
4690
4691 /**
4692 * Default text-to-speech locale variant.
Narayan Kamath6d632962011-08-24 11:51:37 +01004693 *
4694 * @deprecated this setting is no longer in use, as of the Ice Cream
4695 * Sandwich release. Apps should never need to read this setting directly,
4696 * instead can query the TextToSpeech framework classes for the
4697 * locale that is in use {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07004698 */
Narayan Kamath6d632962011-08-24 11:51:37 +01004699 @Deprecated
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07004700 public static final String TTS_DEFAULT_VARIANT = "tts_default_variant";
4701
4702 /**
Narayan Kamathe5b8c4d2011-08-22 15:37:47 +01004703 * Stores the default tts locales on a per engine basis. Stored as
4704 * a comma seperated list of values, each value being of the form
4705 * {@code engine_name:locale} for example,
Narayan Kamath6d632962011-08-24 11:51:37 +01004706 * {@code com.foo.ttsengine:eng-USA,com.bar.ttsengine:esp-ESP}. This
4707 * supersedes {@link #TTS_DEFAULT_LANG}, {@link #TTS_DEFAULT_COUNTRY} and
4708 * {@link #TTS_DEFAULT_VARIANT}. Apps should never need to read this
4709 * setting directly, and can query the TextToSpeech framework classes
4710 * for the locale that is in use.
Narayan Kamathe5b8c4d2011-08-22 15:37:47 +01004711 *
4712 * @hide
4713 */
4714 public static final String TTS_DEFAULT_LOCALE = "tts_default_locale";
4715
4716 /**
Charles Chenceffa152010-03-16 21:18:10 -07004717 * Space delimited list of plugin packages that are enabled.
4718 */
4719 public static final String TTS_ENABLED_PLUGINS = "tts_enabled_plugins";
4720
4721 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004722 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON}
4723 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004724 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004725 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004726 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004727 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004728
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004729 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004730 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY}
4731 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004732 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004733 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004734 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004735 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004736
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004737 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004738 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
4739 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004740 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004741 @Deprecated
4742 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT =
4743 Global.WIFI_NUM_OPEN_NETWORKS_KEPT;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004744
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004745 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004746 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON}
4747 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004748 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004749 @Deprecated
4750 public static final String WIFI_ON = Global.WIFI_ON;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004751
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004752 /**
4753 * The acceptable packet loss percentage (range 0 - 100) before trying
4754 * another AP on the same network.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004755 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004756 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004757 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004758 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
4759 "wifi_watchdog_acceptable_packet_loss_percentage";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004760
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004761 /**
4762 * The number of access points required for a network in order for the
4763 * watchdog to monitor it.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004764 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004765 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004766 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004767 public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004768
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004769 /**
4770 * The delay between background checks.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004771 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004772 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004773 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004774 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
4775 "wifi_watchdog_background_check_delay_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004776
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004777 /**
4778 * Whether the Wi-Fi watchdog is enabled for background checking even
4779 * after it thinks the user has connected to a good access point.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004780 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004781 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004782 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004783 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
4784 "wifi_watchdog_background_check_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004785
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004786 /**
4787 * The timeout for a background ping
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004788 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004789 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004790 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004791 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
4792 "wifi_watchdog_background_check_timeout_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004793
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004794 /**
4795 * The number of initial pings to perform that *may* be ignored if they
4796 * fail. Again, if these fail, they will *not* be used in packet loss
4797 * calculation. For example, one network always seemed to time out for
4798 * the first couple pings, so this is set to 3 by default.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004799 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004800 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004801 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004802 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
4803 "wifi_watchdog_initial_ignored_ping_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004804
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004805 /**
4806 * The maximum number of access points (per network) to attempt to test.
4807 * If this number is reached, the watchdog will no longer monitor the
4808 * initial connection state for the network. This is a safeguard for
4809 * networks containing multiple APs whose DNS does not respond to pings.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004810 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004811 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004812 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004813 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = "wifi_watchdog_max_ap_checks";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004814
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004815 /**
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07004816 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004817 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07004818 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004819 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
4820
4821 /**
4822 * A comma-separated list of SSIDs for which the Wi-Fi watchdog should be enabled.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004823 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004824 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004825 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004826 public static final String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list";
4827
4828 /**
4829 * The number of pings to test if an access point is a good connection.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004830 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004831 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004832 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004833 public static final String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004834
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004835 /**
4836 * The delay between pings.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004837 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004838 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004839 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004840 public static final String WIFI_WATCHDOG_PING_DELAY_MS = "wifi_watchdog_ping_delay_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004841
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004842 /**
4843 * The timeout per ping.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004844 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004845 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004846 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004847 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004848
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004849 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004850 * @deprecated Use
4851 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004852 */
Christopher Tate06efb532012-08-24 15:29:27 -07004853 @Deprecated
4854 public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004855
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004856 /**
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004857 * @deprecated Use
4858 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004859 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07004860 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004861 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004862 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004863
4864 /**
Jeremy Joslin79294842014-12-03 17:15:28 -08004865 * The number of milliseconds to hold on to a PendingIntent based request. This delay gives
4866 * the receivers of the PendingIntent an opportunity to make a new network request before
4867 * the Network satisfying the request is potentially removed.
4868 *
4869 * @hide
4870 */
4871 public static final String CONNECTIVITY_RELEASE_PENDING_INTENT_DELAY_MS =
4872 "connectivity_release_pending_intent_delay_ms";
4873
4874 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07004875 * Whether background data usage is allowed.
4876 *
4877 * @deprecated As of {@link VERSION_CODES#ICE_CREAM_SANDWICH},
4878 * availability of background data depends on several
4879 * combined factors. When background data is unavailable,
4880 * {@link ConnectivityManager#getActiveNetworkInfo()} will
4881 * now appear disconnected.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004882 */
Jeff Sharkey3a844fc2011-08-16 14:37:57 -07004883 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004884 public static final String BACKGROUND_DATA = "background_data";
Wink Saville04e71b32009-04-02 11:00:54 -07004885
4886 /**
Bjorn Bringert98bfa392010-03-24 10:59:48 +00004887 * Origins for which browsers should allow geolocation by default.
4888 * The value is a space-separated list of origins.
4889 */
4890 public static final String ALLOWED_GEOLOCATION_ORIGINS
4891 = "allowed_geolocation_origins";
4892
4893 /**
Wink Savillee9b06d72009-05-18 21:47:50 -07004894 * The preferred TTY mode 0 = TTy Off, CDMA default
4895 * 1 = TTY Full
4896 * 2 = TTY HCO
4897 * 3 = TTY VCO
4898 * @hide
4899 */
4900 public static final String PREFERRED_TTY_MODE =
4901 "preferred_tty_mode";
4902
Wink Saville04e71b32009-04-02 11:00:54 -07004903 /**
Wink Saville04e71b32009-04-02 11:00:54 -07004904 * Whether the enhanced voice privacy mode is enabled.
4905 * 0 = normal voice privacy
4906 * 1 = enhanced voice privacy
4907 * @hide
4908 */
4909 public static final String ENHANCED_VOICE_PRIVACY_ENABLED = "enhanced_voice_privacy_enabled";
4910
4911 /**
4912 * Whether the TTY mode mode is enabled.
4913 * 0 = disabled
4914 * 1 = enabled
4915 * @hide
4916 */
4917 public static final String TTY_MODE_ENABLED = "tty_mode_enabled";
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07004918
4919 /**
Christopher Tate8031a3d2009-07-06 16:36:05 -07004920 * Controls whether settings backup is enabled.
Dianne Hackborncf098292009-07-01 19:55:20 -07004921 * Type: int ( 0 = disabled, 1 = enabled )
4922 * @hide
4923 */
4924 public static final String BACKUP_ENABLED = "backup_enabled";
4925
4926 /**
Christopher Tatecce9da52010-02-03 15:11:15 -08004927 * Controls whether application data is automatically restored from backup
4928 * at install time.
4929 * Type: int ( 0 = disabled, 1 = enabled )
4930 * @hide
4931 */
4932 public static final String BACKUP_AUTO_RESTORE = "backup_auto_restore";
4933
4934 /**
Christopher Tate8031a3d2009-07-06 16:36:05 -07004935 * Indicates whether settings backup has been fully provisioned.
4936 * Type: int ( 0 = unprovisioned, 1 = fully provisioned )
4937 * @hide
4938 */
4939 public static final String BACKUP_PROVISIONED = "backup_provisioned";
4940
4941 /**
Dianne Hackborncf098292009-07-01 19:55:20 -07004942 * Component of the transport to use for backup/restore.
4943 * @hide
4944 */
4945 public static final String BACKUP_TRANSPORT = "backup_transport";
Sanjay Jeyakumar21bf2412009-07-09 13:31:48 -07004946
Dianne Hackbornd7cd29d2009-07-01 11:22:45 -07004947 /**
4948 * Version for which the setup wizard was last shown. Bumped for
4949 * each release when there is new setup information to show.
4950 * @hide
4951 */
4952 public static final String LAST_SETUP_SHOWN = "last_setup_shown";
Dianne Hackborncf098292009-07-01 19:55:20 -07004953
4954 /**
Doug Zongker43866e02010-01-07 12:09:54 -08004955 * The interval in milliseconds after which Wi-Fi is considered idle.
4956 * When idle, it is possible for the device to be switched from Wi-Fi to
4957 * the mobile data network.
4958 * @hide
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004959 * @deprecated Use {@link android.provider.Settings.Global#WIFI_IDLE_MS}
4960 * instead.
Doug Zongker43866e02010-01-07 12:09:54 -08004961 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004962 @Deprecated
4963 public static final String WIFI_IDLE_MS = Global.WIFI_IDLE_MS;
Doug Zongker43866e02010-01-07 12:09:54 -08004964
4965 /**
Narayan Kamathee69ff42011-06-28 12:07:18 +01004966 * The global search provider chosen by the user (if multiple global
4967 * search providers are installed). This will be the provider returned
4968 * by {@link SearchManager#getGlobalSearchActivity()} if it's still
4969 * installed. This setting is stored as a flattened component name as
4970 * per {@link ComponentName#flattenToString()}.
4971 *
4972 * @hide
4973 */
4974 public static final String SEARCH_GLOBAL_SEARCH_ACTIVITY =
4975 "search_global_search_activity";
4976
4977 /**
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08004978 * The number of promoted sources in GlobalSearch.
4979 * @hide
4980 */
4981 public static final String SEARCH_NUM_PROMOTED_SOURCES = "search_num_promoted_sources";
4982 /**
4983 * The maximum number of suggestions returned by GlobalSearch.
4984 * @hide
4985 */
4986 public static final String SEARCH_MAX_RESULTS_TO_DISPLAY = "search_max_results_to_display";
4987 /**
4988 * The number of suggestions GlobalSearch will ask each non-web search source for.
4989 * @hide
4990 */
4991 public static final String SEARCH_MAX_RESULTS_PER_SOURCE = "search_max_results_per_source";
4992 /**
4993 * The number of suggestions the GlobalSearch will ask the web search source for.
4994 * @hide
4995 */
4996 public static final String SEARCH_WEB_RESULTS_OVERRIDE_LIMIT =
4997 "search_web_results_override_limit";
4998 /**
4999 * The number of milliseconds that GlobalSearch will wait for suggestions from
5000 * promoted sources before continuing with all other sources.
5001 * @hide
5002 */
5003 public static final String SEARCH_PROMOTED_SOURCE_DEADLINE_MILLIS =
5004 "search_promoted_source_deadline_millis";
5005 /**
5006 * The number of milliseconds before GlobalSearch aborts search suggesiton queries.
5007 * @hide
5008 */
5009 public static final String SEARCH_SOURCE_TIMEOUT_MILLIS = "search_source_timeout_millis";
5010 /**
5011 * The maximum number of milliseconds that GlobalSearch shows the previous results
5012 * after receiving a new query.
5013 * @hide
5014 */
5015 public static final String SEARCH_PREFILL_MILLIS = "search_prefill_millis";
5016 /**
5017 * The maximum age of log data used for shortcuts in GlobalSearch.
5018 * @hide
5019 */
5020 public static final String SEARCH_MAX_STAT_AGE_MILLIS = "search_max_stat_age_millis";
5021 /**
5022 * The maximum age of log data used for source ranking in GlobalSearch.
5023 * @hide
5024 */
5025 public static final String SEARCH_MAX_SOURCE_EVENT_AGE_MILLIS =
5026 "search_max_source_event_age_millis";
5027 /**
5028 * The minimum number of impressions needed to rank a source in GlobalSearch.
5029 * @hide
5030 */
5031 public static final String SEARCH_MIN_IMPRESSIONS_FOR_SOURCE_RANKING =
5032 "search_min_impressions_for_source_ranking";
5033 /**
5034 * The minimum number of clicks needed to rank a source in GlobalSearch.
5035 * @hide
5036 */
5037 public static final String SEARCH_MIN_CLICKS_FOR_SOURCE_RANKING =
5038 "search_min_clicks_for_source_ranking";
5039 /**
5040 * The maximum number of shortcuts shown by GlobalSearch.
5041 * @hide
5042 */
5043 public static final String SEARCH_MAX_SHORTCUTS_RETURNED = "search_max_shortcuts_returned";
5044 /**
5045 * The size of the core thread pool for suggestion queries in GlobalSearch.
5046 * @hide
5047 */
5048 public static final String SEARCH_QUERY_THREAD_CORE_POOL_SIZE =
5049 "search_query_thread_core_pool_size";
5050 /**
5051 * The maximum size of the thread pool for suggestion queries in GlobalSearch.
5052 * @hide
5053 */
5054 public static final String SEARCH_QUERY_THREAD_MAX_POOL_SIZE =
5055 "search_query_thread_max_pool_size";
5056 /**
5057 * The size of the core thread pool for shortcut refreshing in GlobalSearch.
5058 * @hide
5059 */
5060 public static final String SEARCH_SHORTCUT_REFRESH_CORE_POOL_SIZE =
5061 "search_shortcut_refresh_core_pool_size";
5062 /**
5063 * The maximum size of the thread pool for shortcut refreshing in GlobalSearch.
5064 * @hide
5065 */
5066 public static final String SEARCH_SHORTCUT_REFRESH_MAX_POOL_SIZE =
5067 "search_shortcut_refresh_max_pool_size";
5068 /**
5069 * The maximun time that excess threads in the GlobalSeach thread pools will
5070 * wait before terminating.
5071 * @hide
5072 */
5073 public static final String SEARCH_THREAD_KEEPALIVE_SECONDS =
5074 "search_thread_keepalive_seconds";
5075 /**
5076 * The maximum number of concurrent suggestion queries to each source.
5077 * @hide
5078 */
5079 public static final String SEARCH_PER_SOURCE_CONCURRENT_QUERY_LIMIT =
5080 "search_per_source_concurrent_query_limit";
5081
San Mehat87734d32010-01-08 12:53:06 -08005082 /**
5083 * Whether or not alert sounds are played on MountService events. (0 = false, 1 = true)
5084 * @hide
5085 */
5086 public static final String MOUNT_PLAY_NOTIFICATION_SND = "mount_play_not_snd";
5087
5088 /**
5089 * Whether or not UMS auto-starts on UMS host detection. (0 = false, 1 = true)
5090 * @hide
5091 */
5092 public static final String MOUNT_UMS_AUTOSTART = "mount_ums_autostart";
5093
5094 /**
5095 * Whether or not a notification is displayed on UMS host detection. (0 = false, 1 = true)
5096 * @hide
5097 */
5098 public static final String MOUNT_UMS_PROMPT = "mount_ums_prompt";
5099
5100 /**
5101 * Whether or not a notification is displayed while UMS is enabled. (0 = false, 1 = true)
5102 * @hide
5103 */
5104 public static final String MOUNT_UMS_NOTIFY_ENABLED = "mount_ums_notify_enabled";
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08005105
Dan Egnor42471dd2010-01-07 17:25:22 -08005106 /**
5107 * If nonzero, ANRs in invisible background processes bring up a dialog.
5108 * Otherwise, the process will be silently killed.
5109 * @hide
5110 */
5111 public static final String ANR_SHOW_BACKGROUND = "anr_show_background";
Erikeebc8e22010-02-18 13:27:19 -08005112
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08005113 /**
5114 * The {@link ComponentName} string of the service to be used as the voice recognition
5115 * service.
Erikeebc8e22010-02-18 13:27:19 -08005116 *
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08005117 * @hide
5118 */
5119 public static final String VOICE_RECOGNITION_SERVICE = "voice_recognition_service";
Dan Egnor42471dd2010-01-07 17:25:22 -08005120
William Luh623a4282013-06-24 12:14:18 -07005121 /**
5122 * Stores whether an user has consented to have apps verified through PAM.
5123 * The value is boolean (1 or 0).
5124 *
5125 * @hide
5126 */
5127 public static final String PACKAGE_VERIFIER_USER_CONSENT =
5128 "package_verifier_user_consent";
satok988323c2011-06-22 16:38:13 +09005129
5130 /**
satokada8c4e2011-08-23 14:56:56 +09005131 * The {@link ComponentName} string of the selected spell checker service which is
5132 * one of the services managed by the text service manager.
5133 *
5134 * @hide
5135 */
5136 public static final String SELECTED_SPELL_CHECKER = "selected_spell_checker";
5137
5138 /**
5139 * The {@link ComponentName} string of the selected subtype of the selected spell checker
satok988323c2011-06-22 16:38:13 +09005140 * service which is one of the services managed by the text service manager.
5141 *
5142 * @hide
5143 */
satokada8c4e2011-08-23 14:56:56 +09005144 public static final String SELECTED_SPELL_CHECKER_SUBTYPE =
5145 "selected_spell_checker_subtype";
satok988323c2011-06-22 16:38:13 +09005146
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08005147 /**
satoka33c4fc2011-08-25 16:50:11 +09005148 * The {@link ComponentName} string whether spell checker is enabled or not.
5149 *
5150 * @hide
5151 */
5152 public static final String SPELL_CHECKER_ENABLED = "spell_checker_enabled";
5153
5154 /**
David Brown458e8062010-03-08 21:52:11 -08005155 * What happens when the user presses the Power button while in-call
5156 * and the screen is on.<br/>
5157 * <b>Values:</b><br/>
5158 * 1 - The Power button turns off the screen and locks the device. (Default behavior)<br/>
5159 * 2 - The Power button hangs up the current call.<br/>
5160 *
5161 * @hide
5162 */
5163 public static final String INCALL_POWER_BUTTON_BEHAVIOR = "incall_power_button_behavior";
5164
5165 /**
5166 * INCALL_POWER_BUTTON_BEHAVIOR value for "turn off screen".
5167 * @hide
5168 */
5169 public static final int INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF = 0x1;
5170
5171 /**
5172 * INCALL_POWER_BUTTON_BEHAVIOR value for "hang up".
5173 * @hide
5174 */
5175 public static final int INCALL_POWER_BUTTON_BEHAVIOR_HANGUP = 0x2;
5176
5177 /**
5178 * INCALL_POWER_BUTTON_BEHAVIOR default value.
5179 * @hide
5180 */
5181 public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT =
5182 INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF;
5183
5184 /**
Jeff Browna20dda42014-05-27 20:57:24 -07005185 * Whether the device should wake when the wake gesture sensor detects motion.
5186 * @hide
5187 */
5188 public static final String WAKE_GESTURE_ENABLED = "wake_gesture_enabled";
5189
5190 /**
John Spurlocka4215ce2014-08-04 14:50:38 -04005191 * Whether the device should doze if configured.
5192 * @hide
5193 */
5194 public static final String DOZE_ENABLED = "doze_enabled";
5195
5196 /**
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07005197 * The current night mode that has been selected by the user. Owned
5198 * and controlled by UiModeManagerService. Constants are as per
5199 * UiModeManager.
5200 * @hide
5201 */
5202 public static final String UI_NIGHT_MODE = "ui_night_mode";
Suchi Amalapurapu40e47252010-04-07 16:15:50 -07005203
5204 /**
John Spurlock1a868b72012-08-22 09:56:51 -04005205 * Whether screensavers are enabled.
Daniel Sandler0601eb72011-04-13 01:01:32 -04005206 * @hide
5207 */
Daniel Sandler2d545362011-11-17 10:38:37 -08005208 public static final String SCREENSAVER_ENABLED = "screensaver_enabled";
Daniel Sandler0601eb72011-04-13 01:01:32 -04005209
5210 /**
John Spurlock1a868b72012-08-22 09:56:51 -04005211 * The user's chosen screensaver components.
Daniel Sandler2d545362011-11-17 10:38:37 -08005212 *
John Spurlock1a868b72012-08-22 09:56:51 -04005213 * These will be launched by the PhoneWindowManager after a timeout when not on
Daniel Sandler2d545362011-11-17 10:38:37 -08005214 * battery, or upon dock insertion (if SCREENSAVER_ACTIVATE_ON_DOCK is set to 1).
Daniel Sandler0601eb72011-04-13 01:01:32 -04005215 * @hide
5216 */
John Spurlock1a868b72012-08-22 09:56:51 -04005217 public static final String SCREENSAVER_COMPONENTS = "screensaver_components";
Daniel Sandler2d545362011-11-17 10:38:37 -08005218
5219 /**
John Spurlock1a868b72012-08-22 09:56:51 -04005220 * If screensavers are enabled, whether the screensaver should be automatically launched
5221 * when the device is inserted into a (desk) dock.
Daniel Sandler2d545362011-11-17 10:38:37 -08005222 * @hide
5223 */
5224 public static final String SCREENSAVER_ACTIVATE_ON_DOCK = "screensaver_activate_on_dock";
Daniel Sandler0601eb72011-04-13 01:01:32 -04005225
John Spurlock1a868b72012-08-22 09:56:51 -04005226 /**
5227 * If screensavers are enabled, whether the screensaver should be automatically launched
5228 * when the screen times out when not on battery.
5229 * @hide
5230 */
5231 public static final String SCREENSAVER_ACTIVATE_ON_SLEEP = "screensaver_activate_on_sleep";
5232
5233 /**
5234 * If screensavers are enabled, the default screensaver component.
5235 * @hide
5236 */
5237 public static final String SCREENSAVER_DEFAULT_COMPONENT = "screensaver_default_component";
5238
Daniel Sandler0601eb72011-04-13 01:01:32 -04005239 /**
Martijn Coenena7397882013-07-30 20:07:47 -07005240 * The default NFC payment component
5241 * @hide
5242 */
5243 public static final String NFC_PAYMENT_DEFAULT_COMPONENT = "nfc_payment_default_component";
5244
5245 /**
Martijn Coenen2f6f3a012014-04-25 17:00:21 -07005246 * Whether NFC payment is handled by the foreground application or a default.
5247 * @hide
5248 */
5249 public static final String NFC_PAYMENT_FOREGROUND = "nfc_payment_foreground";
5250
5251 /**
David Braunf5d83192013-09-16 13:43:51 -07005252 * Specifies the package name currently configured to be the primary sms application
5253 * @hide
5254 */
5255 public static final String SMS_DEFAULT_APPLICATION = "sms_default_application";
5256
5257 /**
Chris Wren8326a8a2014-10-22 14:13:32 -04005258 * Names of the packages that the current user has explicitly allowed to
5259 * see all of the user's notifications, separated by ':'.
Daniel Sandler4b749ef2013-03-18 21:53:04 -04005260 *
5261 * @hide
5262 */
5263 public static final String ENABLED_NOTIFICATION_LISTENERS = "enabled_notification_listeners";
5264
John Spurlock7340fc82014-04-24 18:50:12 -04005265 /**
5266 * @hide
5267 */
5268 public static final String ENABLED_CONDITION_PROVIDERS = "enabled_condition_providers";
5269
John Spurlock5c454122013-06-17 07:35:46 -04005270 /** @hide */
5271 public static final String BAR_SERVICE_COMPONENT = "bar_service_component";
5272
John Spurlockd67ec252013-09-05 11:31:54 -04005273 /** @hide */
John Spurlockcdb57ae2015-02-11 19:04:11 -05005274 public static final String VOLUME_CONTROLLER_SERVICE_COMPONENT
5275 = "volume_controller_service_component";
5276
5277 /** @hide */
John Spurlockf1a36642013-10-12 17:50:42 -04005278 public static final String IMMERSIVE_MODE_CONFIRMATIONS = "immersive_mode_confirmations";
John Spurlockd67ec252013-09-05 11:31:54 -04005279
Yorke Lee647f8f32013-05-07 10:49:44 -07005280 /**
Svetoslavf43e8512013-09-30 17:33:05 -07005281 * This is the query URI for finding a print service to install.
5282 *
5283 * @hide
5284 */
5285 public static final String PRINT_SERVICE_SEARCH_URI = "print_service_search_uri";
5286
5287 /**
5288 * This is the query URI for finding a NFC payment service to install.
5289 *
5290 * @hide
5291 */
5292 public static final String PAYMENT_SERVICE_SEARCH_URI = "payment_service_search_uri";
5293
5294 /**
Amith Yamasani1e9c2182014-06-11 17:25:51 -07005295 * If enabled, apps should try to skip any introductory hints on first launch. This might
Amith Yamasani0c416392014-06-13 15:54:39 -07005296 * apply to users that are already familiar with the environment or temporary users.
Amith Yamasani1e9c2182014-06-11 17:25:51 -07005297 * <p>
5298 * Type : int (0 to show hints, 1 to skip showing hints)
Amith Yamasani1e9c2182014-06-11 17:25:51 -07005299 */
5300 public static final String SKIP_FIRST_USE_HINTS = "skip_first_use_hints";
5301
5302 /**
John Spurlockaa5ee4d2014-07-25 13:05:12 -04005303 * Persisted playback time after a user confirmation of an unsafe volume level.
5304 *
5305 * @hide
5306 */
5307 public static final String UNSAFE_VOLUME_MUSIC_ACTIVE_MS = "unsafe_volume_music_active_ms";
5308
5309 /**
Dan Sandler52e5701e2014-07-22 23:14:54 -04005310 * This preference enables notification display on the lockscreen.
5311 * @hide
5312 */
5313 public static final String LOCK_SCREEN_SHOW_NOTIFICATIONS =
5314 "lock_screen_show_notifications";
5315
5316 /**
Dongwon Kang4d933a02014-08-07 22:51:47 -07005317 * List of TV inputs that are currently hidden. This is a string
Jaewan Kimf0e530e2014-08-22 00:43:31 +09005318 * containing the IDs of all hidden TV inputs. Each ID is encoded by
5319 * {@link android.net.Uri#encode(String)} and separated by ':'.
Dongwon Kang4d933a02014-08-07 22:51:47 -07005320 * @hide
5321 */
5322 public static final String TV_INPUT_HIDDEN_INPUTS = "tv_input_hidden_inputs";
5323
5324 /**
5325 * List of custom TV input labels. This is a string containing <TV input id, custom name>
Jaewan Kimf0e530e2014-08-22 00:43:31 +09005326 * pairs. TV input id and custom name are encoded by {@link android.net.Uri#encode(String)}
5327 * and separated by ','. Each pair is separated by ':'.
Dongwon Kang4d933a02014-08-07 22:51:47 -07005328 * @hide
5329 */
5330 public static final String TV_INPUT_CUSTOM_LABELS = "tv_input_custom_labels";
5331
5332 /**
Glenn Kasten34cc4db2014-08-13 10:56:38 -07005333 * Whether automatic routing of system audio to USB audio peripheral is disabled.
5334 * The value is boolean (1 or 0), where 1 means automatic routing is disabled,
5335 * and 0 means automatic routing is enabled.
5336 *
5337 * @hide
5338 */
5339 public static final String USB_AUDIO_AUTOMATIC_ROUTING_DISABLED =
5340 "usb_audio_automatic_routing_disabled";
5341
5342 /**
Jeff Brown05af6ad2014-09-30 20:54:30 -07005343 * The timeout in milliseconds before the device fully goes to sleep after
5344 * a period of inactivity. This value sets an upper bound on how long the device
5345 * will stay awake or dreaming without user activity. It should generally
Dianne Hackbornad6a99b2014-11-18 10:11:10 -08005346 * be longer than {@link Settings.System#SCREEN_OFF_TIMEOUT} as otherwise the device
Jeff Brown05af6ad2014-09-30 20:54:30 -07005347 * will sleep before it ever has a chance to dream.
5348 * <p>
5349 * Use -1 to disable this timeout.
5350 * </p>
5351 *
5352 * @hide
5353 */
5354 public static final String SLEEP_TIMEOUT = "sleep_timeout";
5355
5356 /**
Svetoslav Ganova571a582011-09-20 18:32:20 -07005357 * This are the settings to be backed up.
5358 *
5359 * NOTE: Settings are backed up and restored in the order they appear
5360 * in this array. If you have one setting depending on another,
5361 * make sure that they are ordered appropriately.
5362 *
-b master501eec92009-07-06 13:53:11 -07005363 * @hide
5364 */
5365 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate58f41ec2013-01-11 15:40:36 -08005366 BUGREPORT_IN_POWER_MENU, // moved to global
Amith Yamasani8823c0a82009-07-07 14:30:17 -07005367 ALLOW_MOCK_LOCATION,
-b master501eec92009-07-06 13:53:11 -07005368 PARENTAL_CONTROL_ENABLED,
5369 PARENTAL_CONTROL_REDIRECT_URL,
Christopher Tate66488d62012-10-02 11:58:01 -07005370 USB_MASS_STORAGE_ENABLED, // moved to global
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07005371 ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED,
5372 ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE,
5373 ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE,
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07005374 ACCESSIBILITY_SCRIPT_INJECTION,
Christopher Tate14c2d792010-02-25 16:49:44 -08005375 BACKUP_AUTO_RESTORE,
-b master501eec92009-07-06 13:53:11 -07005376 ENABLED_ACCESSIBILITY_SERVICES,
Svetoslav Ganov9a4c5cd2012-05-30 14:06:32 -07005377 TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES,
Svetoslav Ganova28a16d2011-07-28 11:24:21 -07005378 TOUCH_EXPLORATION_ENABLED,
Svetoslav Ganova571a582011-09-20 18:32:20 -07005379 ACCESSIBILITY_ENABLED,
Svetoslav Ganov55f937a2011-12-05 11:42:07 -08005380 ACCESSIBILITY_SPEAK_PASSWORD,
Chris Craikcce47eb2014-07-16 15:12:15 -07005381 ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED,
Alan Viveretteef793802013-07-23 14:15:28 -07005382 ACCESSIBILITY_CAPTIONING_ENABLED,
5383 ACCESSIBILITY_CAPTIONING_LOCALE,
5384 ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR,
5385 ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR,
5386 ACCESSIBILITY_CAPTIONING_EDGE_TYPE,
5387 ACCESSIBILITY_CAPTIONING_EDGE_COLOR,
5388 ACCESSIBILITY_CAPTIONING_TYPEFACE,
Alan Viverette69ce69b2013-08-29 12:23:48 -07005389 ACCESSIBILITY_CAPTIONING_FONT_SCALE,
-b master501eec92009-07-06 13:53:11 -07005390 TTS_USE_DEFAULTS,
5391 TTS_DEFAULT_RATE,
5392 TTS_DEFAULT_PITCH,
5393 TTS_DEFAULT_SYNTH,
5394 TTS_DEFAULT_LANG,
5395 TTS_DEFAULT_COUNTRY,
Charles Chenceffa152010-03-16 21:18:10 -07005396 TTS_ENABLED_PLUGINS,
Narayan Kamath6d632962011-08-24 11:51:37 +01005397 TTS_DEFAULT_LOCALE,
Christopher Tate66488d62012-10-02 11:58:01 -07005398 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, // moved to global
5399 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, // moved to global
5400 WIFI_NUM_OPEN_NETWORKS_KEPT, // moved to global
San Mehat87734d32010-01-08 12:53:06 -08005401 MOUNT_PLAY_NOTIFICATION_SND,
5402 MOUNT_UMS_AUTOSTART,
5403 MOUNT_UMS_PROMPT,
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07005404 MOUNT_UMS_NOTIFY_ENABLED,
Jeff Brown05af6ad2014-09-30 20:54:30 -07005405 UI_NIGHT_MODE,
5406 SLEEP_TIMEOUT
-b master501eec92009-07-06 13:53:11 -07005407 };
5408
5409 /**
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07005410 * These entries are considered common between the personal and the managed profile,
5411 * since the managed profile doesn't get to change them.
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07005412 */
Svetoslav683914b2015-01-15 14:22:26 -08005413 private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>();
5414 static {
5415 CLONE_TO_MANAGED_PROFILE.add(ACCESSIBILITY_ENABLED);
5416 CLONE_TO_MANAGED_PROFILE.add(ALLOW_MOCK_LOCATION);
5417 CLONE_TO_MANAGED_PROFILE.add(ALLOWED_GEOLOCATION_ORIGINS);
5418 CLONE_TO_MANAGED_PROFILE.add(DEFAULT_INPUT_METHOD);
5419 CLONE_TO_MANAGED_PROFILE.add(ENABLED_ACCESSIBILITY_SERVICES);
5420 CLONE_TO_MANAGED_PROFILE.add(ENABLED_INPUT_METHODS);
5421 CLONE_TO_MANAGED_PROFILE.add(LOCATION_MODE);
5422 CLONE_TO_MANAGED_PROFILE.add(LOCATION_PROVIDERS_ALLOWED);
5423 CLONE_TO_MANAGED_PROFILE.add(LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS);
5424 CLONE_TO_MANAGED_PROFILE.add(SELECTED_INPUT_METHOD_SUBTYPE);
5425 CLONE_TO_MANAGED_PROFILE.add(SELECTED_SPELL_CHECKER);
5426 CLONE_TO_MANAGED_PROFILE.add(SELECTED_SPELL_CHECKER_SUBTYPE);
5427 }
5428
5429 /** @hide */
5430 public static void getCloneToManagedProfileSettings(Set<String> outKeySet) {
5431 outKeySet.addAll(CLONE_TO_MANAGED_PROFILE);
5432 }
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07005433
5434 /**
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005435 * Helper method for determining if a location provider is enabled.
Tom O'Neilld5759432013-09-11 11:03:03 -07005436 *
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005437 * @param cr the content resolver to use
5438 * @param provider the location provider to query
5439 * @return true if the provider is enabled
Tom O'Neilld5759432013-09-11 11:03:03 -07005440 *
5441 * @deprecated use {@link #LOCATION_MODE} or
5442 * {@link LocationManager#isProviderEnabled(String)}
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005443 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07005444 @Deprecated
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005445 public static final boolean isLocationProviderEnabled(ContentResolver cr, String provider) {
Victoria Leaseb711d572012-10-02 13:14:11 -07005446 return isLocationProviderEnabledForUser(cr, provider, UserHandle.myUserId());
5447 }
5448
5449 /**
5450 * Helper method for determining if a location provider is enabled.
5451 * @param cr the content resolver to use
5452 * @param provider the location provider to query
5453 * @param userId the userId to query
5454 * @return true if the provider is enabled
Tom O'Neilld5759432013-09-11 11:03:03 -07005455 * @deprecated use {@link #LOCATION_MODE} or
5456 * {@link LocationManager#isProviderEnabled(String)}
Victoria Leaseb711d572012-10-02 13:14:11 -07005457 * @hide
5458 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07005459 @Deprecated
Victoria Leaseb711d572012-10-02 13:14:11 -07005460 public static final boolean isLocationProviderEnabledForUser(ContentResolver cr, String provider, int userId) {
5461 String allowedProviders = Settings.Secure.getStringForUser(cr,
5462 LOCATION_PROVIDERS_ALLOWED, userId);
Brad Fitzpatrick11fe1812010-09-10 16:07:52 -07005463 return TextUtils.delimitedStringContains(allowedProviders, ',', provider);
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005464 }
5465
5466 /**
5467 * Thread-safe method for enabling or disabling a single location provider.
5468 * @param cr the content resolver to use
5469 * @param provider the location provider to enable or disable
5470 * @param enabled true if the provider should be enabled
Tom O'Neilla324ac72013-08-26 14:40:23 -07005471 * @deprecated use {@link #putInt(ContentResolver, String, int)} and {@link #LOCATION_MODE}
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005472 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07005473 @Deprecated
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005474 public static final void setLocationProviderEnabled(ContentResolver cr,
5475 String provider, boolean enabled) {
Victoria Leaseb711d572012-10-02 13:14:11 -07005476 setLocationProviderEnabledForUser(cr, provider, enabled, UserHandle.myUserId());
5477 }
5478
5479 /**
5480 * Thread-safe method for enabling or disabling a single location provider.
Tom O'Neilla324ac72013-08-26 14:40:23 -07005481 *
Victoria Leaseb711d572012-10-02 13:14:11 -07005482 * @param cr the content resolver to use
5483 * @param provider the location provider to enable or disable
5484 * @param enabled true if the provider should be enabled
5485 * @param userId the userId for which to enable/disable providers
Tom O'Neilla324ac72013-08-26 14:40:23 -07005486 * @return true if the value was set, false on database errors
5487 * @deprecated use {@link #putIntForUser(ContentResolver, String, int, int)} and
5488 * {@link #LOCATION_MODE}
Victoria Leaseb711d572012-10-02 13:14:11 -07005489 * @hide
5490 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07005491 @Deprecated
Tom O'Neilla324ac72013-08-26 14:40:23 -07005492 public static final boolean setLocationProviderEnabledForUser(ContentResolver cr,
Victoria Leaseb711d572012-10-02 13:14:11 -07005493 String provider, boolean enabled, int userId) {
David Christie3f7b6522013-08-06 19:19:08 -07005494 synchronized (mLocationSettingsLock) {
5495 // to ensure thread safety, we write the provider name with a '+' or '-'
5496 // and let the SettingsProvider handle it rather than reading and modifying
5497 // the list of enabled providers.
5498 if (enabled) {
5499 provider = "+" + provider;
5500 } else {
5501 provider = "-" + provider;
5502 }
Tom O'Neilla324ac72013-08-26 14:40:23 -07005503 return putStringForUser(cr, Settings.Secure.LOCATION_PROVIDERS_ALLOWED, provider,
David Christie3f7b6522013-08-06 19:19:08 -07005504 userId);
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005505 }
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005506 }
Tom O'Neill1f48b782013-08-19 18:14:56 -07005507
5508 /**
5509 * Thread-safe method for setting the location mode to one of
5510 * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY},
5511 * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}.
5512 *
Tom O'Neill1f48b782013-08-19 18:14:56 -07005513 * @param cr the content resolver to use
5514 * @param mode such as {@link #LOCATION_MODE_HIGH_ACCURACY}
5515 * @param userId the userId for which to change mode
Tom O'Neilla324ac72013-08-26 14:40:23 -07005516 * @return true if the value was set, false on database errors
Tom O'Neill1f48b782013-08-19 18:14:56 -07005517 *
5518 * @throws IllegalArgumentException if mode is not one of the supported values
5519 */
Tom O'Neill7f6f4572013-08-27 10:53:15 -07005520 private static final boolean setLocationModeForUser(ContentResolver cr, int mode,
5521 int userId) {
Tom O'Neill1f48b782013-08-19 18:14:56 -07005522 synchronized (mLocationSettingsLock) {
5523 boolean gps = false;
5524 boolean network = false;
5525 switch (mode) {
5526 case LOCATION_MODE_OFF:
5527 break;
5528 case LOCATION_MODE_SENSORS_ONLY:
5529 gps = true;
5530 break;
5531 case LOCATION_MODE_BATTERY_SAVING:
5532 network = true;
5533 break;
5534 case LOCATION_MODE_HIGH_ACCURACY:
5535 gps = true;
5536 network = true;
5537 break;
5538 default:
5539 throw new IllegalArgumentException("Invalid location mode: " + mode);
5540 }
Tom O'Neill7731a992014-10-09 11:30:49 -07005541 // Note it's important that we set the NLP mode first. The Google implementation
5542 // of NLP clears its NLP consent setting any time it receives a
5543 // LocationManager.PROVIDERS_CHANGED_ACTION broadcast and NLP is disabled. Also,
5544 // it shows an NLP consent dialog any time it receives the broadcast, NLP is
5545 // enabled, and the NLP consent is not set. If 1) we were to enable GPS first,
5546 // 2) a setup wizard has its own NLP consent UI that sets the NLP consent setting,
5547 // and 3) the receiver happened to complete before we enabled NLP, then the Google
5548 // NLP would detect the attempt to enable NLP and show a redundant NLP consent
5549 // dialog. Then the people who wrote the setup wizard would be sad.
Tom O'Neilla324ac72013-08-26 14:40:23 -07005550 boolean nlpSuccess = Settings.Secure.setLocationProviderEnabledForUser(
Tom O'Neill1f48b782013-08-19 18:14:56 -07005551 cr, LocationManager.NETWORK_PROVIDER, network, userId);
Tom O'Neill7731a992014-10-09 11:30:49 -07005552 boolean gpsSuccess = Settings.Secure.setLocationProviderEnabledForUser(
5553 cr, LocationManager.GPS_PROVIDER, gps, userId);
Tom O'Neilla324ac72013-08-26 14:40:23 -07005554 return gpsSuccess && nlpSuccess;
Tom O'Neill1f48b782013-08-19 18:14:56 -07005555 }
5556 }
5557
5558 /**
Tom O'Neill1f48b782013-08-19 18:14:56 -07005559 * Thread-safe method for reading the location mode, returns one of
5560 * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY},
5561 * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}.
5562 *
5563 * @param cr the content resolver to use
5564 * @param userId the userId for which to read the mode
5565 * @return the location mode
5566 */
Tom O'Neill7f6f4572013-08-27 10:53:15 -07005567 private static final int getLocationModeForUser(ContentResolver cr, int userId) {
Tom O'Neill1f48b782013-08-19 18:14:56 -07005568 synchronized (mLocationSettingsLock) {
5569 boolean gpsEnabled = Settings.Secure.isLocationProviderEnabledForUser(
5570 cr, LocationManager.GPS_PROVIDER, userId);
5571 boolean networkEnabled = Settings.Secure.isLocationProviderEnabledForUser(
5572 cr, LocationManager.NETWORK_PROVIDER, userId);
5573 if (gpsEnabled && networkEnabled) {
5574 return LOCATION_MODE_HIGH_ACCURACY;
5575 } else if (gpsEnabled) {
5576 return LOCATION_MODE_SENSORS_ONLY;
5577 } else if (networkEnabled) {
5578 return LOCATION_MODE_BATTERY_SAVING;
5579 } else {
5580 return LOCATION_MODE_OFF;
5581 }
5582 }
5583 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005584 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005585
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005586 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005587 * Global system settings, containing preferences that always apply identically
5588 * to all defined users. Applications can read these but are not allowed to write;
5589 * like the "Secure" settings, these are for preferences that the user must
5590 * explicitly modify through the system UI or specialized APIs for those values.
5591 */
5592 public static final class Global extends NameValueTable {
5593 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_global_version";
5594
5595 /**
5596 * The content:// style URL for global secure settings items. Not public.
5597 */
5598 public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/global");
5599
5600 /**
Amith Yamasani23a0f052014-07-25 12:26:53 -07005601 * Whether users are allowed to add more users or guest from lockscreen.
5602 * <p>
5603 * Type: int
5604 * @hide
5605 */
5606 public static final String ADD_USERS_WHEN_LOCKED = "add_users_when_locked";
5607
5608 /**
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07005609 * Setting whether the global gesture for enabling accessibility is enabled.
5610 * If this gesture is enabled the user will be able to perfrom it to enable
5611 * the accessibility state without visiting the settings app.
5612 * @hide
5613 */
5614 public static final String ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED =
5615 "enable_accessibility_global_gesture_enabled";
5616
5617 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005618 * Whether Airplane Mode is on.
5619 */
5620 public static final String AIRPLANE_MODE_ON = "airplane_mode_on";
5621
5622 /**
Bryce Lee584a4452014-10-21 15:55:55 -07005623 * Whether Theater Mode is on.
5624 * {@hide}
5625 */
Bryce Leecdfebd62015-02-02 08:19:11 -08005626 @SystemApi
Bryce Lee584a4452014-10-21 15:55:55 -07005627 public static final String THEATER_MODE_ON = "theater_mode_on";
5628
5629 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005630 * Constant for use in AIRPLANE_MODE_RADIOS to specify Bluetooth radio.
5631 */
5632 public static final String RADIO_BLUETOOTH = "bluetooth";
5633
5634 /**
5635 * Constant for use in AIRPLANE_MODE_RADIOS to specify Wi-Fi radio.
5636 */
5637 public static final String RADIO_WIFI = "wifi";
5638
5639 /**
5640 * {@hide}
5641 */
5642 public static final String RADIO_WIMAX = "wimax";
5643 /**
5644 * Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio.
5645 */
5646 public static final String RADIO_CELL = "cell";
5647
5648 /**
5649 * Constant for use in AIRPLANE_MODE_RADIOS to specify NFC radio.
5650 */
5651 public static final String RADIO_NFC = "nfc";
5652
5653 /**
5654 * A comma separated list of radios that need to be disabled when airplane mode
5655 * is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are
5656 * included in the comma separated list.
5657 */
5658 public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios";
5659
5660 /**
5661 * A comma separated list of radios that should to be disabled when airplane mode
5662 * is on, but can be manually reenabled by the user. For example, if RADIO_WIFI is
5663 * added to both AIRPLANE_MODE_RADIOS and AIRPLANE_MODE_TOGGLEABLE_RADIOS, then Wifi
5664 * will be turned off when entering airplane mode, but the user will be able to reenable
5665 * Wifi in the Settings app.
5666 *
5667 * {@hide}
5668 */
5669 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios";
5670
5671 /**
5672 * The policy for deciding when Wi-Fi should go to sleep (which will in
5673 * turn switch to using the mobile data as an Internet connection).
5674 * <p>
5675 * Set to one of {@link #WIFI_SLEEP_POLICY_DEFAULT},
5676 * {@link #WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED}, or
5677 * {@link #WIFI_SLEEP_POLICY_NEVER}.
5678 */
5679 public static final String WIFI_SLEEP_POLICY = "wifi_sleep_policy";
5680
5681 /**
5682 * Value for {@link #WIFI_SLEEP_POLICY} to use the default Wi-Fi sleep
5683 * policy, which is to sleep shortly after the turning off
5684 * according to the {@link #STAY_ON_WHILE_PLUGGED_IN} setting.
5685 */
5686 public static final int WIFI_SLEEP_POLICY_DEFAULT = 0;
5687
5688 /**
5689 * Value for {@link #WIFI_SLEEP_POLICY} to use the default policy when
5690 * the device is on battery, and never go to sleep when the device is
5691 * plugged in.
5692 */
5693 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1;
5694
5695 /**
5696 * Value for {@link #WIFI_SLEEP_POLICY} to never go to sleep.
5697 */
5698 public static final int WIFI_SLEEP_POLICY_NEVER = 2;
5699
5700 /**
5701 * Value to specify if the user prefers the date, time and time zone
5702 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
5703 */
5704 public static final String AUTO_TIME = "auto_time";
5705
5706 /**
5707 * Value to specify if the user prefers the time zone
5708 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
5709 */
5710 public static final String AUTO_TIME_ZONE = "auto_time_zone";
5711
5712 /**
5713 * URI for the car dock "in" event sound.
5714 * @hide
5715 */
5716 public static final String CAR_DOCK_SOUND = "car_dock_sound";
5717
5718 /**
5719 * URI for the car dock "out" event sound.
5720 * @hide
5721 */
5722 public static final String CAR_UNDOCK_SOUND = "car_undock_sound";
5723
5724 /**
5725 * URI for the desk dock "in" event sound.
5726 * @hide
5727 */
5728 public static final String DESK_DOCK_SOUND = "desk_dock_sound";
5729
5730 /**
5731 * URI for the desk dock "out" event sound.
5732 * @hide
5733 */
5734 public static final String DESK_UNDOCK_SOUND = "desk_undock_sound";
5735
5736 /**
5737 * Whether to play a sound for dock events.
5738 * @hide
5739 */
5740 public static final String DOCK_SOUNDS_ENABLED = "dock_sounds_enabled";
5741
5742 /**
5743 * URI for the "device locked" (keyguard shown) sound.
5744 * @hide
5745 */
5746 public static final String LOCK_SOUND = "lock_sound";
5747
5748 /**
5749 * URI for the "device unlocked" sound.
5750 * @hide
5751 */
5752 public static final String UNLOCK_SOUND = "unlock_sound";
5753
5754 /**
Adrian Roos49e057d2014-08-13 17:14:51 +02005755 * URI for the "device is trusted" sound, which is played when the device enters the trusted
5756 * state without unlocking.
5757 * @hide
5758 */
5759 public static final String TRUSTED_SOUND = "trusted_sound";
5760
5761 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005762 * URI for the low battery sound file.
5763 * @hide
5764 */
5765 public static final String LOW_BATTERY_SOUND = "low_battery_sound";
5766
5767 /**
5768 * Whether to play a sound for low-battery alerts.
5769 * @hide
5770 */
5771 public static final String POWER_SOUNDS_ENABLED = "power_sounds_enabled";
5772
5773 /**
Jeff Brown84e27562012-12-07 13:56:34 -08005774 * URI for the "wireless charging started" sound.
5775 * @hide
5776 */
5777 public static final String WIRELESS_CHARGING_STARTED_SOUND =
5778 "wireless_charging_started_sound";
5779
5780 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005781 * Whether we keep the device on while the device is plugged in.
5782 * Supported values are:
5783 * <ul>
5784 * <li>{@code 0} to never stay on while plugged in</li>
5785 * <li>{@link BatteryManager#BATTERY_PLUGGED_AC} to stay on for AC charger</li>
5786 * <li>{@link BatteryManager#BATTERY_PLUGGED_USB} to stay on for USB charger</li>
5787 * <li>{@link BatteryManager#BATTERY_PLUGGED_WIRELESS} to stay on for wireless charger</li>
5788 * </ul>
5789 * These values can be OR-ed together.
5790 */
5791 public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in";
5792
5793 /**
Christopher Tate58f41ec2013-01-11 15:40:36 -08005794 * When the user has enable the option to have a "bug report" command
5795 * in the power menu.
5796 * @hide
5797 */
5798 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
5799
5800 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005801 * Whether ADB is enabled.
5802 */
5803 public static final String ADB_ENABLED = "adb_enabled";
5804
5805 /**
Jon Miranda836c0a82014-08-11 12:32:26 -07005806 * Whether Views are allowed to save their attribute data.
5807 * @hide
5808 */
5809 public static final String DEBUG_VIEW_ATTRIBUTES = "debug_view_attributes";
5810
5811 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005812 * Whether assisted GPS should be enabled or not.
5813 * @hide
5814 */
5815 public static final String ASSISTED_GPS_ENABLED = "assisted_gps_enabled";
5816
5817 /**
5818 * Whether bluetooth is enabled/disabled
5819 * 0=disabled. 1=enabled.
5820 */
5821 public static final String BLUETOOTH_ON = "bluetooth_on";
5822
5823 /**
5824 * CDMA Cell Broadcast SMS
5825 * 0 = CDMA Cell Broadcast SMS disabled
5826 * 1 = CDMA Cell Broadcast SMS enabled
5827 * @hide
5828 */
5829 public static final String CDMA_CELL_BROADCAST_SMS =
5830 "cdma_cell_broadcast_sms";
5831
5832 /**
5833 * The CDMA roaming mode 0 = Home Networks, CDMA default
5834 * 1 = Roaming on Affiliated networks
5835 * 2 = Roaming on any networks
5836 * @hide
5837 */
5838 public static final String CDMA_ROAMING_MODE = "roaming_settings";
5839
5840 /**
5841 * The CDMA subscription mode 0 = RUIM/SIM (default)
5842 * 1 = NV
5843 * @hide
5844 */
5845 public static final String CDMA_SUBSCRIPTION_MODE = "subscription_mode";
5846
5847 /** Inactivity timeout to track mobile data activity.
5848 *
5849 * If set to a positive integer, it indicates the inactivity timeout value in seconds to
5850 * infer the data activity of mobile network. After a period of no activity on mobile
5851 * networks with length specified by the timeout, an {@code ACTION_DATA_ACTIVITY_CHANGE}
5852 * intent is fired to indicate a transition of network status from "active" to "idle". Any
5853 * subsequent activity on mobile networks triggers the firing of {@code
5854 * ACTION_DATA_ACTIVITY_CHANGE} intent indicating transition from "idle" to "active".
5855 *
5856 * Network activity refers to transmitting or receiving data on the network interfaces.
5857 *
5858 * Tracking is disabled if set to zero or negative value.
5859 *
5860 * @hide
5861 */
5862 public static final String DATA_ACTIVITY_TIMEOUT_MOBILE = "data_activity_timeout_mobile";
5863
5864 /** Timeout to tracking Wifi data activity. Same as {@code DATA_ACTIVITY_TIMEOUT_MOBILE}
5865 * but for Wifi network.
5866 * @hide
5867 */
5868 public static final String DATA_ACTIVITY_TIMEOUT_WIFI = "data_activity_timeout_wifi";
5869
5870 /**
5871 * Whether or not data roaming is enabled. (0 = false, 1 = true)
5872 */
5873 public static final String DATA_ROAMING = "data_roaming";
5874
5875 /**
Wink Saville75c1e692013-03-20 17:06:50 -07005876 * The value passed to a Mobile DataConnection via bringUp which defines the
5877 * number of retries to preform when setting up the initial connection. The default
5878 * value defined in DataConnectionTrackerBase#DEFAULT_MDC_INITIAL_RETRY is currently 1.
5879 * @hide
5880 */
5881 public static final String MDC_INITIAL_MAX_RETRY = "mdc_initial_max_retry";
5882
5883 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005884 * Whether user has enabled development settings.
5885 */
5886 public static final String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled";
5887
5888 /**
5889 * Whether the device has been provisioned (0 = false, 1 = true)
5890 */
5891 public static final String DEVICE_PROVISIONED = "device_provisioned";
5892
5893 /**
5894 * The saved value for WindowManagerService.setForcedDisplayDensity().
5895 * One integer in dpi. If unset, then use the real display density.
5896 * @hide
5897 */
5898 public static final String DISPLAY_DENSITY_FORCED = "display_density_forced";
5899
5900 /**
5901 * The saved value for WindowManagerService.setForcedDisplaySize().
5902 * Two integers separated by a comma. If unset, then use the real display size.
5903 * @hide
5904 */
5905 public static final String DISPLAY_SIZE_FORCED = "display_size_forced";
5906
5907 /**
5908 * The maximum size, in bytes, of a download that the download manager will transfer over
5909 * a non-wifi connection.
5910 * @hide
5911 */
5912 public static final String DOWNLOAD_MAX_BYTES_OVER_MOBILE =
5913 "download_manager_max_bytes_over_mobile";
5914
5915 /**
5916 * The recommended maximum size, in bytes, of a download that the download manager should
5917 * transfer over a non-wifi connection. Over this size, the use will be warned, but will
5918 * have the option to start the download over the mobile connection anyway.
5919 * @hide
5920 */
5921 public static final String DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE =
5922 "download_manager_recommended_max_bytes_over_mobile";
5923
5924 /**
Christopher Tateaa036a22014-05-19 16:33:27 -07005925 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
Christopher Tate06efb532012-08-24 15:29:27 -07005926 */
Christopher Tateaa036a22014-05-19 16:33:27 -07005927 @Deprecated
5928 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
Christopher Tate06efb532012-08-24 15:29:27 -07005929
5930 /**
Jinsuk Kimb3d91772014-07-10 12:48:54 +09005931 * Whether HDMI control shall be enabled. If disabled, no CEC/MHL command will be
5932 * sent or processed. (0 = false, 1 = true)
5933 * @hide
5934 */
5935 public static final String HDMI_CONTROL_ENABLED = "hdmi_control_enabled";
5936
5937 /**
5938 * Whether HDMI system audio is enabled. If enabled, TV internal speaker is muted,
5939 * and the output is redirected to AV Receiver connected via
5940 * {@Global#HDMI_SYSTEM_AUDIO_OUTPUT}.
5941 * @hide
5942 */
5943 public static final String HDMI_SYSTEM_AUDIO_ENABLED = "hdmi_system_audio_enabled";
5944
5945 /**
Jinsuk Kimb3d91772014-07-10 12:48:54 +09005946 * Whether TV will automatically turn on upon reception of the CEC command
5947 * &lt;Text View On&gt; or &lt;Image View On&gt;. (0 = false, 1 = true)
5948 * @hide
5949 */
5950 public static final String HDMI_CONTROL_AUTO_WAKEUP_ENABLED =
5951 "hdmi_control_auto_wakeup_enabled";
5952
5953 /**
5954 * Whether TV will also turn off other CEC devices when it goes to standby mode.
5955 * (0 = false, 1 = true)
5956 * @hide
5957 */
5958 public static final String HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED =
5959 "hdmi_control_auto_device_off_enabled";
5960
5961 /**
5962 * Whether TV will switch to MHL port when a mobile device is plugged in.
5963 * (0 = false, 1 = true)
5964 * @hide
5965 */
5966 public static final String MHL_INPUT_SWITCHING_ENABLED = "mhl_input_switching_enabled";
5967
5968 /**
5969 * Whether TV will charge the mobile device connected at MHL port. (0 = false, 1 = true)
5970 * @hide
5971 */
5972 public static final String MHL_POWER_CHARGE_ENABLED = "mhl_power_charge_enabled";
5973
5974 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005975 * Whether mobile data connections are allowed by the user. See
5976 * ConnectivityManager for more info.
5977 * @hide
5978 */
5979 public static final String MOBILE_DATA = "mobile_data";
5980
5981 /** {@hide} */
5982 public static final String NETSTATS_ENABLED = "netstats_enabled";
5983 /** {@hide} */
5984 public static final String NETSTATS_POLL_INTERVAL = "netstats_poll_interval";
5985 /** {@hide} */
5986 public static final String NETSTATS_TIME_CACHE_MAX_AGE = "netstats_time_cache_max_age";
5987 /** {@hide} */
5988 public static final String NETSTATS_GLOBAL_ALERT_BYTES = "netstats_global_alert_bytes";
5989 /** {@hide} */
5990 public static final String NETSTATS_SAMPLE_ENABLED = "netstats_sample_enabled";
Christopher Tate06efb532012-08-24 15:29:27 -07005991
5992 /** {@hide} */
5993 public static final String NETSTATS_DEV_BUCKET_DURATION = "netstats_dev_bucket_duration";
5994 /** {@hide} */
5995 public static final String NETSTATS_DEV_PERSIST_BYTES = "netstats_dev_persist_bytes";
5996 /** {@hide} */
5997 public static final String NETSTATS_DEV_ROTATE_AGE = "netstats_dev_rotate_age";
5998 /** {@hide} */
5999 public static final String NETSTATS_DEV_DELETE_AGE = "netstats_dev_delete_age";
6000
6001 /** {@hide} */
6002 public static final String NETSTATS_UID_BUCKET_DURATION = "netstats_uid_bucket_duration";
6003 /** {@hide} */
6004 public static final String NETSTATS_UID_PERSIST_BYTES = "netstats_uid_persist_bytes";
6005 /** {@hide} */
6006 public static final String NETSTATS_UID_ROTATE_AGE = "netstats_uid_rotate_age";
6007 /** {@hide} */
6008 public static final String NETSTATS_UID_DELETE_AGE = "netstats_uid_delete_age";
6009
6010 /** {@hide} */
6011 public static final String NETSTATS_UID_TAG_BUCKET_DURATION = "netstats_uid_tag_bucket_duration";
6012 /** {@hide} */
6013 public static final String NETSTATS_UID_TAG_PERSIST_BYTES = "netstats_uid_tag_persist_bytes";
6014 /** {@hide} */
6015 public static final String NETSTATS_UID_TAG_ROTATE_AGE = "netstats_uid_tag_rotate_age";
6016 /** {@hide} */
6017 public static final String NETSTATS_UID_TAG_DELETE_AGE = "netstats_uid_tag_delete_age";
6018
6019 /**
6020 * User preference for which network(s) should be used. Only the
6021 * connectivity service should touch this.
6022 */
6023 public static final String NETWORK_PREFERENCE = "network_preference";
6024
6025 /**
Jeff Davidsondd6fd1e2014-04-14 15:14:30 -07006026 * Which package name to use for network scoring. If null, or if the package is not a valid
6027 * scorer app, external network scores will neither be requested nor accepted.
6028 * @hide
6029 */
6030 public static final String NETWORK_SCORER_APP = "network_scorer_app";
6031
6032 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006033 * If the NITZ_UPDATE_DIFF time is exceeded then an automatic adjustment
6034 * to SystemClock will be allowed even if NITZ_UPDATE_SPACING has not been
6035 * exceeded.
6036 * @hide
6037 */
6038 public static final String NITZ_UPDATE_DIFF = "nitz_update_diff";
6039
6040 /**
6041 * The length of time in milli-seconds that automatic small adjustments to
6042 * SystemClock are ignored if NITZ_UPDATE_DIFF is not exceeded.
6043 * @hide
6044 */
6045 public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing";
6046
6047 /** Preferred NTP server. {@hide} */
6048 public static final String NTP_SERVER = "ntp_server";
6049 /** Timeout in milliseconds to wait for NTP server. {@hide} */
6050 public static final String NTP_TIMEOUT = "ntp_timeout";
6051
6052 /**
rich cannings4d8fc792012-09-07 14:43:43 -07006053 * Whether the package manager should send package verification broadcasts for verifiers to
6054 * review apps prior to installation.
6055 * 1 = request apps to be verified prior to installation, if a verifier exists.
6056 * 0 = do not verify apps before installation
rich cannings4e5753f2012-09-19 16:03:56 -07006057 * @hide
rich cannings4d8fc792012-09-07 14:43:43 -07006058 */
6059 public static final String PACKAGE_VERIFIER_ENABLE = "package_verifier_enable";
6060
6061 /** Timeout for package verification.
rich cannings4e5753f2012-09-19 16:03:56 -07006062 * @hide */
rich cannings4d8fc792012-09-07 14:43:43 -07006063 public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout";
6064
6065 /** Default response code for package verification.
rich cannings4e5753f2012-09-19 16:03:56 -07006066 * @hide */
rich cannings4d8fc792012-09-07 14:43:43 -07006067 public static final String PACKAGE_VERIFIER_DEFAULT_RESPONSE = "verifier_default_response";
6068
rich cannings4e5753f2012-09-19 16:03:56 -07006069 /**
6070 * Show package verification setting in the Settings app.
rich canningse6686b32012-09-16 14:02:20 -07006071 * 1 = show (default)
6072 * 0 = hide
rich cannings4e5753f2012-09-19 16:03:56 -07006073 * @hide
rich canningse6686b32012-09-16 14:02:20 -07006074 */
6075 public static final String PACKAGE_VERIFIER_SETTING_VISIBLE = "verifier_setting_visible";
6076
rich cannings4d8fc792012-09-07 14:43:43 -07006077 /**
rich cannings4e5753f2012-09-19 16:03:56 -07006078 * Run package verificaiton on apps installed through ADB/ADT/USB
6079 * 1 = perform package verification on ADB installs (default)
6080 * 0 = bypass package verification on ADB installs
6081 * @hide
6082 */
6083 public static final String PACKAGE_VERIFIER_INCLUDE_ADB = "verifier_verify_adb_installs";
6084
6085 /**
Christopher Tate7265abe2014-11-21 13:54:45 -08006086 * Time since last fstrim (milliseconds) after which we force one to happen
6087 * during device startup. If unset, the default is 3 days.
6088 * @hide
6089 */
6090 public static final String FSTRIM_MANDATORY_INTERVAL = "fstrim_mandatory_interval";
6091
6092 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006093 * The interval in milliseconds at which to check packet counts on the
6094 * mobile data interface when screen is on, to detect possible data
6095 * connection problems.
6096 * @hide
6097 */
6098 public static final String PDP_WATCHDOG_POLL_INTERVAL_MS =
6099 "pdp_watchdog_poll_interval_ms";
6100
6101 /**
6102 * The interval in milliseconds at which to check packet counts on the
6103 * mobile data interface when screen is off, to detect possible data
6104 * connection problems.
6105 * @hide
6106 */
6107 public static final String PDP_WATCHDOG_LONG_POLL_INTERVAL_MS =
6108 "pdp_watchdog_long_poll_interval_ms";
6109
6110 /**
6111 * The interval in milliseconds at which to check packet counts on the
6112 * mobile data interface after {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT}
6113 * outgoing packets has been reached without incoming packets.
6114 * @hide
6115 */
6116 public static final String PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS =
6117 "pdp_watchdog_error_poll_interval_ms";
6118
6119 /**
6120 * The number of outgoing packets sent without seeing an incoming packet
6121 * that triggers a countdown (of {@link #PDP_WATCHDOG_ERROR_POLL_COUNT}
6122 * device is logged to the event log
6123 * @hide
6124 */
6125 public static final String PDP_WATCHDOG_TRIGGER_PACKET_COUNT =
6126 "pdp_watchdog_trigger_packet_count";
6127
6128 /**
6129 * The number of polls to perform (at {@link #PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS})
6130 * after hitting {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} before
6131 * attempting data connection recovery.
6132 * @hide
6133 */
6134 public static final String PDP_WATCHDOG_ERROR_POLL_COUNT =
6135 "pdp_watchdog_error_poll_count";
6136
6137 /**
6138 * The number of failed PDP reset attempts before moving to something more
6139 * drastic: re-registering to the network.
6140 * @hide
6141 */
6142 public static final String PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT =
6143 "pdp_watchdog_max_pdp_reset_fail_count";
6144
6145 /**
6146 * A positive value indicates how often the SamplingProfiler
6147 * should take snapshots. Zero value means SamplingProfiler
6148 * is disabled.
6149 *
6150 * @hide
6151 */
6152 public static final String SAMPLING_PROFILER_MS = "sampling_profiler_ms";
6153
6154 /**
6155 * URL to open browser on to allow user to manage a prepay account
6156 * @hide
6157 */
6158 public static final String SETUP_PREPAID_DATA_SERVICE_URL =
6159 "setup_prepaid_data_service_url";
6160
6161 /**
6162 * URL to attempt a GET on to see if this is a prepay device
6163 * @hide
6164 */
6165 public static final String SETUP_PREPAID_DETECTION_TARGET_URL =
6166 "setup_prepaid_detection_target_url";
6167
6168 /**
6169 * Host to check for a redirect to after an attempt to GET
6170 * SETUP_PREPAID_DETECTION_TARGET_URL. (If we redirected there,
6171 * this is a prepaid device with zero balance.)
6172 * @hide
6173 */
6174 public static final String SETUP_PREPAID_DETECTION_REDIR_HOST =
6175 "setup_prepaid_detection_redir_host";
6176
6177 /**
Jake Hamby76a61422012-09-06 17:40:21 -07006178 * The interval in milliseconds at which to check the number of SMS sent out without asking
6179 * for use permit, to limit the un-authorized SMS usage.
6180 *
6181 * @hide
6182 */
6183 public static final String SMS_OUTGOING_CHECK_INTERVAL_MS =
6184 "sms_outgoing_check_interval_ms";
6185
6186 /**
6187 * The number of outgoing SMS sent without asking for user permit (of {@link
6188 * #SMS_OUTGOING_CHECK_INTERVAL_MS}
6189 *
6190 * @hide
6191 */
6192 public static final String SMS_OUTGOING_CHECK_MAX_COUNT =
6193 "sms_outgoing_check_max_count";
6194
6195 /**
6196 * Used to disable SMS short code confirmation - defaults to true.
Robert Greenwalt026efcc2012-09-24 10:03:21 -07006197 * True indcates we will do the check, etc. Set to false to disable.
Jake Hamby76a61422012-09-06 17:40:21 -07006198 * @see com.android.internal.telephony.SmsUsageMonitor
6199 * @hide
6200 */
6201 public static final String SMS_SHORT_CODE_CONFIRMATION = "sms_short_code_confirmation";
6202
Robert Greenwalt026efcc2012-09-24 10:03:21 -07006203 /**
6204 * Used to select which country we use to determine premium sms codes.
6205 * One of com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_SIM,
6206 * com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_NETWORK,
6207 * or com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_BOTH.
6208 * @hide
6209 */
6210 public static final String SMS_SHORT_CODE_RULE = "sms_short_code_rule";
6211
Jake Hamby76a61422012-09-06 17:40:21 -07006212 /**
JP Abgrall32d1ac4d2014-02-21 12:05:20 -08006213 * Used to select TCP's default initial receiver window size in segments - defaults to a build config value
6214 * @hide
6215 */
6216 public static final String TCP_DEFAULT_INIT_RWND = "tcp_default_init_rwnd";
6217
6218 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006219 * Used to disable Tethering on a device - defaults to true
6220 * @hide
6221 */
6222 public static final String TETHER_SUPPORTED = "tether_supported";
6223
6224 /**
6225 * Used to require DUN APN on the device or not - defaults to a build config value
6226 * which defaults to false
6227 * @hide
6228 */
6229 public static final String TETHER_DUN_REQUIRED = "tether_dun_required";
6230
6231 /**
6232 * Used to hold a gservices-provisioned apn value for DUN. If set, or the
6233 * corresponding build config values are set it will override the APN DB
6234 * values.
6235 * Consists of a comma seperated list of strings:
6236 * "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type"
6237 * note that empty fields can be ommitted: "name,apn,,,,,,,,,310,260,,DUN"
6238 * @hide
6239 */
6240 public static final String TETHER_DUN_APN = "tether_dun_apn";
6241
6242 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006243 * USB Mass Storage Enabled
6244 */
6245 public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled";
6246
6247 /**
6248 * If this setting is set (to anything), then all references
6249 * to Gmail on the device must change to Google Mail.
6250 */
6251 public static final String USE_GOOGLE_MAIL = "use_google_mail";
6252
Hui Shu22671772014-10-01 21:41:07 +00006253 /**
6254 * Webview Data reduction proxy key.
6255 * @hide
6256 */
6257 public static final String WEBVIEW_DATA_REDUCTION_PROXY_KEY =
6258 "webview_data_reduction_proxy_key";
6259
Christopher Tate06efb532012-08-24 15:29:27 -07006260 /**
Jeff Brown89d55462012-09-19 11:33:42 -07006261 * Whether Wifi display is enabled/disabled
6262 * 0=disabled. 1=enabled.
6263 * @hide
6264 */
6265 public static final String WIFI_DISPLAY_ON = "wifi_display_on";
6266
6267 /**
Chong Zhang1f3ecaa2013-05-03 15:55:36 -07006268 * Whether Wifi display certification mode is enabled/disabled
6269 * 0=disabled. 1=enabled.
6270 * @hide
6271 */
6272 public static final String WIFI_DISPLAY_CERTIFICATION_ON =
6273 "wifi_display_certification_on";
6274
6275 /**
Chong Zhange38af812013-08-29 17:25:17 -07006276 * WPS Configuration method used by Wifi display, this setting only
6277 * takes effect when WIFI_DISPLAY_CERTIFICATION_ON is 1 (enabled).
6278 *
6279 * Possible values are:
6280 *
6281 * WpsInfo.INVALID: use default WPS method chosen by framework
6282 * WpsInfo.PBC : use Push button
6283 * WpsInfo.KEYPAD : use Keypad
6284 * WpsInfo.DISPLAY: use Display
6285 * @hide
6286 */
6287 public static final String WIFI_DISPLAY_WPS_CONFIG =
6288 "wifi_display_wps_config";
6289
6290 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006291 * Whether to notify the user of open networks.
6292 * <p>
6293 * If not connected and the scan results have an open network, we will
6294 * put this notification up. If we attempt to connect to a network or
6295 * the open network(s) disappear, we remove the notification. When we
6296 * show the notification, we will not show it again for
6297 * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time.
6298 */
6299 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
6300 "wifi_networks_available_notification_on";
6301 /**
6302 * {@hide}
6303 */
6304 public static final String WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON =
6305 "wimax_networks_available_notification_on";
6306
6307 /**
6308 * Delay (in seconds) before repeating the Wi-Fi networks available notification.
6309 * Connecting to a network will reset the timer.
6310 */
6311 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
6312 "wifi_networks_available_repeat_delay";
6313
6314 /**
Robert Greenwalt3ea0c992013-10-03 21:13:49 +00006315 * 802.11 country code in ISO 3166 format
6316 * @hide
6317 */
6318 public static final String WIFI_COUNTRY_CODE = "wifi_country_code";
6319
6320 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006321 * The interval in milliseconds to issue wake up scans when wifi needs
6322 * to connect. This is necessary to connect to an access point when
6323 * device is on the move and the screen is off.
6324 * @hide
6325 */
6326 public static final String WIFI_FRAMEWORK_SCAN_INTERVAL_MS =
6327 "wifi_framework_scan_interval_ms";
6328
6329 /**
6330 * The interval in milliseconds after which Wi-Fi is considered idle.
6331 * When idle, it is possible for the device to be switched from Wi-Fi to
6332 * the mobile data network.
6333 * @hide
6334 */
6335 public static final String WIFI_IDLE_MS = "wifi_idle_ms";
6336
6337 /**
6338 * When the number of open networks exceeds this number, the
6339 * least-recently-used excess networks will be removed.
6340 */
6341 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept";
6342
6343 /**
6344 * Whether the Wi-Fi should be on. Only the Wi-Fi service should touch this.
6345 */
6346 public static final String WIFI_ON = "wifi_on";
6347
6348 /**
Irfan Sheriff11aefad2013-03-06 07:57:41 -08006349 * Setting to allow scans to be enabled even wifi is turned off for connectivity.
6350 * @hide
6351 */
6352 public static final String WIFI_SCAN_ALWAYS_AVAILABLE =
6353 "wifi_scan_always_enabled";
6354
6355 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006356 * Used to save the Wifi_ON state prior to tethering.
6357 * This state will be checked to restore Wifi after
6358 * the user turns off tethering.
6359 *
6360 * @hide
6361 */
6362 public static final String WIFI_SAVED_STATE = "wifi_saved_state";
6363
6364 /**
6365 * The interval in milliseconds to scan as used by the wifi supplicant
6366 * @hide
6367 */
6368 public static final String WIFI_SUPPLICANT_SCAN_INTERVAL_MS =
6369 "wifi_supplicant_scan_interval_ms";
6370
vandwalle7c3606c2014-03-31 19:12:07 -07006371 /**
6372 * whether frameworks handles wifi auto-join
6373 * @hide
6374 */
6375 public static final String WIFI_ENHANCED_AUTO_JOIN =
6376 "wifi_enhanced_auto_join";
6377
6378 /**
6379 * whether settings show RSSI
6380 * @hide
6381 */
6382 public static final String WIFI_NETWORK_SHOW_RSSI =
6383 "wifi_network_show_rssi";
6384
6385 /**
Irfan Sheriff3809f502012-09-17 16:04:57 -07006386 * The interval in milliseconds to scan at supplicant when p2p is connected
6387 * @hide
6388 */
6389 public static final String WIFI_SCAN_INTERVAL_WHEN_P2P_CONNECTED_MS =
6390 "wifi_scan_interval_p2p_connected_ms";
6391
6392 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006393 * Whether the Wi-Fi watchdog is enabled.
6394 */
6395 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
6396
6397 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006398 * Setting to turn off poor network avoidance on Wi-Fi. Feature is enabled by default and
6399 * the setting needs to be set to 0 to disable it.
6400 * @hide
6401 */
6402 public static final String WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED =
6403 "wifi_watchdog_poor_network_test_enabled";
6404
6405 /**
6406 * Setting to turn on suspend optimizations at screen off on Wi-Fi. Enabled by default and
6407 * needs to be set to 0 to disable it.
6408 * @hide
6409 */
6410 public static final String WIFI_SUSPEND_OPTIMIZATIONS_ENABLED =
6411 "wifi_suspend_optimizations_enabled";
6412
6413 /**
6414 * The maximum number of times we will retry a connection to an access
6415 * point for which we have failed in acquiring an IP address from DHCP.
6416 * A value of N means that we will make N+1 connection attempts in all.
6417 */
6418 public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count";
6419
6420 /**
6421 * Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile
6422 * data connectivity to be established after a disconnect from Wi-Fi.
6423 */
6424 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
6425 "wifi_mobile_data_transition_wakelock_timeout_ms";
6426
6427 /**
6428 * The operational wifi frequency band
6429 * Set to one of {@link WifiManager#WIFI_FREQUENCY_BAND_AUTO},
6430 * {@link WifiManager#WIFI_FREQUENCY_BAND_5GHZ} or
6431 * {@link WifiManager#WIFI_FREQUENCY_BAND_2GHZ}
6432 *
6433 * @hide
6434 */
6435 public static final String WIFI_FREQUENCY_BAND = "wifi_frequency_band";
6436
6437 /**
6438 * The Wi-Fi peer-to-peer device name
6439 * @hide
6440 */
6441 public static final String WIFI_P2P_DEVICE_NAME = "wifi_p2p_device_name";
6442
6443 /**
Robert Greenwaltc12783a2013-05-16 12:48:20 -07006444 * The min time between wifi disable and wifi enable
6445 * @hide
6446 */
6447 public static final String WIFI_REENABLE_DELAY_MS = "wifi_reenable_delay";
6448
6449 /**
Jeff Davidsona20ca67d2014-12-16 11:48:54 -08006450 * Timeout for ephemeral networks when all known BSSIDs go out of range. We will disconnect
6451 * from an ephemeral network if there is no BSSID for that network with a non-null score that
6452 * has been seen in this time period.
6453 *
6454 * If this is less than or equal to zero, we use a more conservative behavior and only check
6455 * for a non-null score from the currently connected or target BSSID.
6456 * @hide
6457 */
6458 public static final String WIFI_EPHEMERAL_OUT_OF_RANGE_TIMEOUT_MS =
6459 "wifi_ephemeral_out_of_range_timeout_ms";
6460
6461 /**
Christopher Tatec868b642012-09-12 17:41:04 -07006462 * The number of milliseconds to delay when checking for data stalls during
6463 * non-aggressive detection. (screen is turned off.)
6464 * @hide
6465 */
6466 public static final String DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS =
6467 "data_stall_alarm_non_aggressive_delay_in_ms";
6468
6469 /**
6470 * The number of milliseconds to delay when checking for data stalls during
6471 * aggressive detection. (screen on or suspected data stall)
6472 * @hide
6473 */
6474 public static final String DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS =
6475 "data_stall_alarm_aggressive_delay_in_ms";
6476
6477 /**
Wink Savillece1e3792013-09-03 16:41:44 -07006478 * The number of milliseconds to allow the provisioning apn to remain active
6479 * @hide
6480 */
6481 public static final String PROVISIONING_APN_ALARM_DELAY_IN_MS =
6482 "provisioning_apn_alarm_delay_in_ms";
6483
6484 /**
Christopher Tatec868b642012-09-12 17:41:04 -07006485 * The interval in milliseconds at which to check gprs registration
6486 * after the first registration mismatch of gprs and voice service,
6487 * to detect possible data network registration problems.
6488 *
6489 * @hide
6490 */
6491 public static final String GPRS_REGISTER_CHECK_PERIOD_MS =
6492 "gprs_register_check_period_ms";
6493
6494 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006495 * Nonzero causes Log.wtf() to crash.
6496 * @hide
6497 */
6498 public static final String WTF_IS_FATAL = "wtf_is_fatal";
6499
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07006500 /**
6501 * Ringer mode. This is used internally, changing this value will not
6502 * change the ringer mode. See AudioManager.
6503 */
6504 public static final String MODE_RINGER = "mode_ringer";
Christopher Tate06efb532012-08-24 15:29:27 -07006505
Jeff Brownd4935962012-09-25 13:27:20 -07006506 /**
6507 * Overlay display devices setting.
6508 * The associated value is a specially formatted string that describes the
6509 * size and density of simulated secondary display devices.
6510 * <p>
6511 * Format: {width}x{height}/{dpi};...
6512 * </p><p>
6513 * Example:
6514 * <ul>
6515 * <li><code>1280x720/213</code>: make one overlay that is 1280x720 at 213dpi.</li>
6516 * <li><code>1920x1080/320;1280x720/213</code>: make two overlays, the first
6517 * at 1080p and the second at 720p.</li>
6518 * <li>If the value is empty, then no overlay display devices are created.</li>
6519 * </ul></p>
6520 *
6521 * @hide
6522 */
6523 public static final String OVERLAY_DISPLAY_DEVICES = "overlay_display_devices";
Christopher Tate06efb532012-08-24 15:29:27 -07006524
Jeff Sharkey625239a2012-09-26 22:03:49 -07006525 /**
6526 * Threshold values for the duration and level of a discharge cycle,
6527 * under which we log discharge cycle info.
6528 *
6529 * @hide
6530 */
6531 public static final String
6532 BATTERY_DISCHARGE_DURATION_THRESHOLD = "battery_discharge_duration_threshold";
6533
6534 /** @hide */
6535 public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold";
6536
6537 /**
6538 * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR
6539 * intents on application crashes and ANRs. If this is disabled, the
6540 * crash/ANR dialog will never display the "Report" button.
6541 * <p>
6542 * Type: int (0 = disallow, 1 = allow)
6543 *
6544 * @hide
6545 */
6546 public static final String SEND_ACTION_APP_ERROR = "send_action_app_error";
6547
6548 /**
6549 * Maximum age of entries kept by {@link DropBoxManager}.
6550 *
6551 * @hide
6552 */
6553 public static final String DROPBOX_AGE_SECONDS = "dropbox_age_seconds";
6554
6555 /**
6556 * Maximum number of entry files which {@link DropBoxManager} will keep
6557 * around.
6558 *
6559 * @hide
6560 */
6561 public static final String DROPBOX_MAX_FILES = "dropbox_max_files";
6562
6563 /**
6564 * Maximum amount of disk space used by {@link DropBoxManager} no matter
6565 * what.
6566 *
6567 * @hide
6568 */
6569 public static final String DROPBOX_QUOTA_KB = "dropbox_quota_kb";
6570
6571 /**
6572 * Percent of free disk (excluding reserve) which {@link DropBoxManager}
6573 * will use.
6574 *
6575 * @hide
6576 */
6577 public static final String DROPBOX_QUOTA_PERCENT = "dropbox_quota_percent";
6578
6579 /**
6580 * Percent of total disk which {@link DropBoxManager} will never dip
6581 * into.
6582 *
6583 * @hide
6584 */
6585 public static final String DROPBOX_RESERVE_PERCENT = "dropbox_reserve_percent";
6586
6587 /**
6588 * Prefix for per-tag dropbox disable/enable settings.
6589 *
6590 * @hide
6591 */
6592 public static final String DROPBOX_TAG_PREFIX = "dropbox:";
6593
6594 /**
6595 * Lines of logcat to include with system crash/ANR/etc. reports, as a
6596 * prefix of the dropbox tag of the report type. For example,
6597 * "logcat_for_system_server_anr" controls the lines of logcat captured
6598 * with system server ANR reports. 0 to disable.
6599 *
6600 * @hide
6601 */
6602 public static final String ERROR_LOGCAT_PREFIX = "logcat_for_";
6603
6604 /**
6605 * The interval in minutes after which the amount of free storage left
6606 * on the device is logged to the event log
6607 *
6608 * @hide
6609 */
6610 public static final String SYS_FREE_STORAGE_LOG_INTERVAL = "sys_free_storage_log_interval";
6611
6612 /**
6613 * Threshold for the amount of change in disk free space required to
6614 * report the amount of free space. Used to prevent spamming the logs
6615 * when the disk free space isn't changing frequently.
6616 *
6617 * @hide
6618 */
6619 public static final String
6620 DISK_FREE_CHANGE_REPORTING_THRESHOLD = "disk_free_change_reporting_threshold";
6621
6622 /**
6623 * Minimum percentage of free storage on the device that is used to
6624 * determine if the device is running low on storage. The default is 10.
6625 * <p>
6626 * Say this value is set to 10, the device is considered running low on
6627 * storage if 90% or more of the device storage is filled up.
6628 *
6629 * @hide
6630 */
6631 public static final String
6632 SYS_STORAGE_THRESHOLD_PERCENTAGE = "sys_storage_threshold_percentage";
6633
6634 /**
6635 * Maximum byte size of the low storage threshold. This is to ensure
6636 * that {@link #SYS_STORAGE_THRESHOLD_PERCENTAGE} does not result in an
6637 * overly large threshold for large storage devices. Currently this must
6638 * be less than 2GB. This default is 500MB.
6639 *
6640 * @hide
6641 */
6642 public static final String
6643 SYS_STORAGE_THRESHOLD_MAX_BYTES = "sys_storage_threshold_max_bytes";
6644
6645 /**
6646 * Minimum bytes of free storage on the device before the data partition
6647 * is considered full. By default, 1 MB is reserved to avoid system-wide
6648 * SQLite disk full exceptions.
6649 *
6650 * @hide
6651 */
6652 public static final String
6653 SYS_STORAGE_FULL_THRESHOLD_BYTES = "sys_storage_full_threshold_bytes";
6654
6655 /**
6656 * The maximum reconnect delay for short network outages or when the
6657 * network is suspended due to phone use.
6658 *
6659 * @hide
6660 */
6661 public static final String
6662 SYNC_MAX_RETRY_DELAY_IN_SECONDS = "sync_max_retry_delay_in_seconds";
6663
6664 /**
6665 * The number of milliseconds to delay before sending out
Erik Kline8f29dcf2014-12-08 16:25:20 +09006666 * {@link ConnectivityManager#CONNECTIVITY_ACTION} broadcasts. Ignored.
Jeff Sharkey625239a2012-09-26 22:03:49 -07006667 *
6668 * @hide
6669 */
6670 public static final String CONNECTIVITY_CHANGE_DELAY = "connectivity_change_delay";
6671
Vinit Deshapnde1f12cb52013-08-21 13:09:01 -07006672
6673 /**
6674 * Network sampling interval, in seconds. We'll generate link information
6675 * about bytes/packets sent and error rates based on data sampled in this interval
6676 *
6677 * @hide
6678 */
6679
6680 public static final String CONNECTIVITY_SAMPLING_INTERVAL_IN_SECONDS =
6681 "connectivity_sampling_interval_in_seconds";
6682
Jeff Sharkey625239a2012-09-26 22:03:49 -07006683 /**
Jason Monk602b2322013-07-03 17:04:33 -04006684 * The series of successively longer delays used in retrying to download PAC file.
6685 * Last delay is used between successful PAC downloads.
6686 *
6687 * @hide
6688 */
6689 public static final String PAC_CHANGE_DELAY = "pac_change_delay";
6690
6691 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07006692 * Setting to turn off captive portal detection. Feature is enabled by
6693 * default and the setting needs to be set to 0 to disable it.
6694 *
6695 * @hide
6696 */
6697 public static final String
6698 CAPTIVE_PORTAL_DETECTION_ENABLED = "captive_portal_detection_enabled";
6699
6700 /**
6701 * The server used for captive portal detection upon a new conection. A
6702 * 204 response code from the server is used for validation.
6703 *
6704 * @hide
6705 */
6706 public static final String CAPTIVE_PORTAL_SERVER = "captive_portal_server";
6707
6708 /**
6709 * Whether network service discovery is enabled.
6710 *
6711 * @hide
6712 */
6713 public static final String NSD_ON = "nsd_on";
6714
6715 /**
6716 * Let user pick default install location.
6717 *
6718 * @hide
6719 */
6720 public static final String SET_INSTALL_LOCATION = "set_install_location";
6721
6722 /**
6723 * Default install location value.
6724 * 0 = auto, let system decide
6725 * 1 = internal
6726 * 2 = sdcard
6727 * @hide
6728 */
6729 public static final String DEFAULT_INSTALL_LOCATION = "default_install_location";
6730
6731 /**
6732 * ms during which to consume extra events related to Inet connection
6733 * condition after a transtion to fully-connected
6734 *
6735 * @hide
6736 */
6737 public static final String
6738 INET_CONDITION_DEBOUNCE_UP_DELAY = "inet_condition_debounce_up_delay";
6739
6740 /**
6741 * ms during which to consume extra events related to Inet connection
6742 * condtion after a transtion to partly-connected
6743 *
6744 * @hide
6745 */
6746 public static final String
6747 INET_CONDITION_DEBOUNCE_DOWN_DELAY = "inet_condition_debounce_down_delay";
6748
6749 /** {@hide} */
6750 public static final String
6751 READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT = "read_external_storage_enforced_default";
6752
6753 /**
6754 * Host name and port for global http proxy. Uses ':' seperator for
6755 * between host and port.
6756 */
6757 public static final String HTTP_PROXY = "http_proxy";
6758
6759 /**
6760 * Host name for global http proxy. Set via ConnectivityManager.
6761 *
6762 * @hide
6763 */
6764 public static final String GLOBAL_HTTP_PROXY_HOST = "global_http_proxy_host";
6765
6766 /**
6767 * Integer host port for global http proxy. Set via ConnectivityManager.
6768 *
6769 * @hide
6770 */
6771 public static final String GLOBAL_HTTP_PROXY_PORT = "global_http_proxy_port";
6772
6773 /**
6774 * Exclusion list for global proxy. This string contains a list of
6775 * comma-separated domains where the global proxy does not apply.
6776 * Domains should be listed in a comma- separated list. Example of
6777 * acceptable formats: ".domain1.com,my.domain2.com" Use
6778 * ConnectivityManager to set/get.
6779 *
6780 * @hide
6781 */
6782 public static final String
6783 GLOBAL_HTTP_PROXY_EXCLUSION_LIST = "global_http_proxy_exclusion_list";
6784
6785 /**
Jason Monk602b2322013-07-03 17:04:33 -04006786 * The location PAC File for the proxy.
6787 * @hide
6788 */
6789 public static final String
6790 GLOBAL_HTTP_PROXY_PAC = "global_proxy_pac_url";
6791
6792 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07006793 * Enables the UI setting to allow the user to specify the global HTTP
6794 * proxy and associated exclusion list.
6795 *
6796 * @hide
6797 */
6798 public static final String SET_GLOBAL_HTTP_PROXY = "set_global_http_proxy";
6799
6800 /**
6801 * Setting for default DNS in case nobody suggests one
6802 *
6803 * @hide
6804 */
6805 public static final String DEFAULT_DNS_SERVER = "default_dns_server";
6806
Jeff Sharkey0ac10282012-10-01 12:50:22 -07006807 /** {@hide} */
6808 public static final String
6809 BLUETOOTH_HEADSET_PRIORITY_PREFIX = "bluetooth_headset_priority_";
6810 /** {@hide} */
6811 public static final String
6812 BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX = "bluetooth_a2dp_sink_priority_";
6813 /** {@hide} */
6814 public static final String
6815 BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX = "bluetooth_input_device_priority_";
Kim Schulz0d376052013-08-22 11:18:02 +02006816 /** {@hide} */
6817 public static final String
6818 BLUETOOTH_MAP_PRIORITY_PREFIX = "bluetooth_map_priority_";
Jeff Sharkey0ac10282012-10-01 12:50:22 -07006819
6820 /**
6821 * Get the key that retrieves a bluetooth headset's priority.
6822 * @hide
6823 */
6824 public static final String getBluetoothHeadsetPriorityKey(String address) {
Elliott Hughescb64d432013-08-02 10:00:44 -07006825 return BLUETOOTH_HEADSET_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
Jeff Sharkey0ac10282012-10-01 12:50:22 -07006826 }
6827
6828 /**
6829 * Get the key that retrieves a bluetooth a2dp sink's priority.
6830 * @hide
6831 */
6832 public static final String getBluetoothA2dpSinkPriorityKey(String address) {
Elliott Hughescb64d432013-08-02 10:00:44 -07006833 return BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
Jeff Sharkey0ac10282012-10-01 12:50:22 -07006834 }
6835
6836 /**
6837 * Get the key that retrieves a bluetooth Input Device's priority.
6838 * @hide
6839 */
6840 public static final String getBluetoothInputDevicePriorityKey(String address) {
Elliott Hughescb64d432013-08-02 10:00:44 -07006841 return BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
Jeff Sharkey0ac10282012-10-01 12:50:22 -07006842 }
6843
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07006844 /**
Kim Schulz0d376052013-08-22 11:18:02 +02006845 * Get the key that retrieves a bluetooth map priority.
6846 * @hide
6847 */
6848 public static final String getBluetoothMapPriorityKey(String address) {
6849 return BLUETOOTH_MAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
6850 }
6851 /**
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07006852 * Scaling factor for normal window animations. Setting to 0 will
6853 * disable window animations.
6854 */
6855 public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale";
6856
6857 /**
6858 * Scaling factor for activity transition animations. Setting to 0 will
6859 * disable window animations.
6860 */
6861 public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale";
6862
6863 /**
6864 * Scaling factor for Animator-based animations. This affects both the
6865 * start delay and duration of all such animations. Setting to 0 will
6866 * cause animations to end immediately. The default value is 1.
6867 */
6868 public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale";
6869
6870 /**
6871 * Scaling factor for normal window animations. Setting to 0 will
6872 * disable window animations.
6873 *
6874 * @hide
6875 */
6876 public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations";
6877
6878 /**
6879 * If 0, the compatibility mode is off for all applications.
6880 * If 1, older applications run under compatibility mode.
6881 * TODO: remove this settings before code freeze (bug/1907571)
6882 * @hide
6883 */
6884 public static final String COMPATIBILITY_MODE = "compatibility_mode";
6885
6886 /**
6887 * CDMA only settings
6888 * Emergency Tone 0 = Off
6889 * 1 = Alert
6890 * 2 = Vibrate
6891 * @hide
6892 */
6893 public static final String EMERGENCY_TONE = "emergency_tone";
6894
6895 /**
6896 * CDMA only settings
6897 * Whether the auto retry is enabled. The value is
6898 * boolean (1 or 0).
6899 * @hide
6900 */
6901 public static final String CALL_AUTO_RETRY = "call_auto_retry";
6902
6903 /**
Sungmin Choie099ab12014-06-09 14:45:51 +09006904 * See RIL_PreferredNetworkType in ril.h
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07006905 * @hide
6906 */
6907 public static final String PREFERRED_NETWORK_MODE =
6908 "preferred_network_mode";
6909
6910 /**
Junda Liubbdc1c02014-11-07 11:18:02 -08006911 * Setting to 1 will hide carrier network settings.
6912 * Default is 0.
6913 * @hide
6914 */
6915 public static final String HIDE_CARRIER_NETWORK_SETTINGS =
6916 "hide_carrier_network_settings";
6917
6918 /**
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07006919 * Name of an application package to be debugged.
6920 */
6921 public static final String DEBUG_APP = "debug_app";
6922
6923 /**
6924 * If 1, when launching DEBUG_APP it will wait for the debugger before
6925 * starting user code. If 0, it will run normally.
6926 */
6927 public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger";
6928
6929 /**
6930 * Control whether the process CPU usage meter should be shown.
6931 */
6932 public static final String SHOW_PROCESSES = "show_processes";
6933
6934 /**
Ruchi Kandoi62b8a492014-04-17 18:01:40 -07006935 * If 1 low power mode is enabled.
6936 * @hide
6937 */
6938 public static final String LOW_POWER_MODE = "low_power";
6939
John Spurlockf8f524c2014-06-10 14:47:29 -04006940 /**
6941 * Battery level [1-99] at which low power mode automatically turns on.
Dianne Hackborn14272302014-06-10 23:13:02 -07006942 * If 0, it will not automatically turn on.
John Spurlockf8f524c2014-06-10 14:47:29 -04006943 * @hide
6944 */
6945 public static final String LOW_POWER_MODE_TRIGGER_LEVEL = "low_power_trigger_level";
6946
Ruchi Kandoi62b8a492014-04-17 18:01:40 -07006947 /**
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07006948 * If 1, the activity manager will aggressively finish activities and
6949 * processes as soon as they are no longer needed. If 0, the normal
6950 * extended lifetime is used.
6951 */
Dianne Hackborn89ad4562014-08-24 16:45:38 -07006952 public static final String ALWAYS_FINISH_ACTIVITIES = "always_finish_activities";
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07006953
Christopher Tate66488d62012-10-02 11:58:01 -07006954 /**
Eric Laurent7ee1e4f2012-10-26 18:11:21 -07006955 * Use Dock audio output for media:
6956 * 0 = disabled
6957 * 1 = enabled
6958 * @hide
6959 */
6960 public static final String DOCK_AUDIO_MEDIA_ENABLED = "dock_audio_media_enabled";
6961
6962 /**
Eric Laurent05274f32012-11-29 12:48:18 -08006963 * Persisted safe headphone volume management state by AudioService
6964 * @hide
6965 */
6966 public static final String AUDIO_SAFE_VOLUME_STATE = "audio_safe_volume_state";
6967
6968 /**
Geremy Condraa0735112013-03-26 21:49:26 -07006969 * URL for tzinfo (time zone) updates
6970 * @hide
6971 */
6972 public static final String TZINFO_UPDATE_CONTENT_URL = "tzinfo_content_url";
6973
6974 /**
6975 * URL for tzinfo (time zone) update metadata
6976 * @hide
6977 */
6978 public static final String TZINFO_UPDATE_METADATA_URL = "tzinfo_metadata_url";
6979
6980 /**
6981 * URL for selinux (mandatory access control) updates
6982 * @hide
6983 */
6984 public static final String SELINUX_UPDATE_CONTENT_URL = "selinux_content_url";
6985
6986 /**
6987 * URL for selinux (mandatory access control) update metadata
6988 * @hide
6989 */
6990 public static final String SELINUX_UPDATE_METADATA_URL = "selinux_metadata_url";
6991
6992 /**
6993 * URL for sms short code updates
6994 * @hide
6995 */
6996 public static final String SMS_SHORT_CODES_UPDATE_CONTENT_URL =
6997 "sms_short_codes_content_url";
6998
6999 /**
7000 * URL for sms short code update metadata
7001 * @hide
7002 */
7003 public static final String SMS_SHORT_CODES_UPDATE_METADATA_URL =
7004 "sms_short_codes_metadata_url";
7005
7006 /**
7007 * URL for cert pinlist updates
7008 * @hide
7009 */
7010 public static final String CERT_PIN_UPDATE_CONTENT_URL = "cert_pin_content_url";
7011
7012 /**
7013 * URL for cert pinlist updates
7014 * @hide
7015 */
7016 public static final String CERT_PIN_UPDATE_METADATA_URL = "cert_pin_metadata_url";
7017
Geremy Condra757ee522013-03-29 16:39:45 -07007018 /**
Ben Gruver633dc9b2013-04-04 12:05:49 -07007019 * URL for intent firewall updates
7020 * @hide
7021 */
7022 public static final String INTENT_FIREWALL_UPDATE_CONTENT_URL =
7023 "intent_firewall_content_url";
7024
7025 /**
7026 * URL for intent firewall update metadata
7027 * @hide
7028 */
7029 public static final String INTENT_FIREWALL_UPDATE_METADATA_URL =
7030 "intent_firewall_metadata_url";
7031
7032 /**
Geremy Condra4e7f7e82013-03-26 21:09:01 -07007033 * SELinux enforcement status. If 0, permissive; if 1, enforcing.
7034 * @hide
7035 */
7036 public static final String SELINUX_STATUS = "selinux_status";
7037
Geremy Condraa0735112013-03-26 21:49:26 -07007038 /**
Amith Yamasanid8415f42013-08-07 20:15:10 -07007039 * Developer setting to force RTL layout.
7040 * @hide
7041 */
7042 public static final String DEVELOPMENT_FORCE_RTL = "debug.force_rtl";
7043
7044 /**
Daniel Sandlerdea64622013-09-23 16:05:57 -04007045 * Milliseconds after screen-off after which low battery sounds will be silenced.
7046 *
7047 * If zero, battery sounds will always play.
7048 * Defaults to @integer/def_low_battery_sound_timeout in SettingsProvider.
7049 *
7050 * @hide
7051 */
7052 public static final String LOW_BATTERY_SOUND_TIMEOUT = "low_battery_sound_timeout";
7053
7054 /**
Evan Charltoncc7b0432014-01-14 14:47:11 -08007055 * Milliseconds to wait before bouncing Wi-Fi after settings is restored. Note that after
Dianne Hackborna3fb40d2014-08-12 15:06:50 -07007056 * the caller is done with this, they should call {@link ContentResolver#delete} to
Evan Charltoncc7b0432014-01-14 14:47:11 -08007057 * clean up any value that they may have written.
7058 *
7059 * @hide
7060 */
7061 public static final String WIFI_BOUNCE_DELAY_OVERRIDE_MS = "wifi_bounce_delay_override_ms";
7062
John Spurlockc6d1c602014-01-17 15:22:06 -05007063 /**
7064 * Defines global runtime overrides to window policy.
7065 *
Jorim Jaggib10e33f2015-02-04 21:57:40 +01007066 * See {@link com.android.server.policy.PolicyControl} for value format.
John Spurlockc6d1c602014-01-17 15:22:06 -05007067 *
7068 * @hide
7069 */
7070 public static final String POLICY_CONTROL = "policy_control";
Evan Charltoncc7b0432014-01-14 14:47:11 -08007071
7072 /**
John Spurlockae641c92014-06-30 18:11:40 -04007073 * Defines global zen mode. ZEN_MODE_OFF, ZEN_MODE_IMPORTANT_INTERRUPTIONS,
7074 * or ZEN_MODE_NO_INTERRUPTIONS.
John Spurlocke677d712014-02-13 12:52:19 -05007075 *
7076 * @hide
7077 */
7078 public static final String ZEN_MODE = "zen_mode";
7079
7080 /** @hide */ public static final int ZEN_MODE_OFF = 0;
John Spurlockae641c92014-06-30 18:11:40 -04007081 /** @hide */ public static final int ZEN_MODE_IMPORTANT_INTERRUPTIONS = 1;
7082 /** @hide */ public static final int ZEN_MODE_NO_INTERRUPTIONS = 2;
John Spurlocke677d712014-02-13 12:52:19 -05007083
7084 /** @hide */ public static String zenModeToString(int mode) {
John Spurlockae641c92014-06-30 18:11:40 -04007085 if (mode == ZEN_MODE_IMPORTANT_INTERRUPTIONS) return "ZEN_MODE_IMPORTANT_INTERRUPTIONS";
7086 if (mode == ZEN_MODE_NO_INTERRUPTIONS) return "ZEN_MODE_NO_INTERRUPTIONS";
7087 return "ZEN_MODE_OFF";
John Spurlocke677d712014-02-13 12:52:19 -05007088 }
7089
7090 /**
John Spurlock056c5192014-04-20 21:52:01 -04007091 * Opaque value, changes when persisted zen mode configuration changes.
7092 *
7093 * @hide
7094 */
7095 public static final String ZEN_MODE_CONFIG_ETAG = "zen_mode_config_etag";
7096
7097 /**
Chris Wren7bd241232014-02-28 16:25:05 -05007098 * Defines global heads up toggle. One of HEADS_UP_OFF, HEADS_UP_ON.
7099 *
7100 * @hide
7101 */
Chris Wren10d82df2014-03-01 10:34:51 -05007102 public static final String HEADS_UP_NOTIFICATIONS_ENABLED =
7103 "heads_up_notifications_enabled";
Chris Wren7bd241232014-02-28 16:25:05 -05007104
7105 /** @hide */ public static final int HEADS_UP_OFF = 0;
7106 /** @hide */ public static final int HEADS_UP_ON = 1;
7107
7108 /**
Jerome Poichet147b4d72014-05-12 18:13:27 -07007109 * The name of the device
7110 *
7111 * @hide
7112 */
7113 public static final String DEVICE_NAME = "device_name";
7114
7115 /**
Amith Yamasani1e9c2182014-06-11 17:25:51 -07007116 * Whether it should be possible to create a guest user on the device.
7117 * <p>
7118 * Type: int (0 for disabled, 1 for enabled)
7119 * @hide
7120 */
7121 public static final String GUEST_USER_ENABLED = "guest_user_enabled";
7122
7123 /**
Jeff Davidson56f9f732014-08-14 16:47:23 -07007124 * Whether the NetworkScoringService has been first initialized.
7125 * <p>
7126 * Type: int (0 for false, 1 for true)
7127 * @hide
7128 */
7129 public static final String NETWORK_SCORING_PROVISIONED = "network_scoring_provisioned";
7130
7131 /**
Jim Miller6848dc82014-10-13 18:51:53 -07007132 * Whether the user wants to be prompted for password to decrypt the device on boot.
7133 * This only matters if the storage is encrypted.
7134 * <p>
7135 * Type: int (0 for false, 1 for true)
7136 * @hide
7137 */
7138 public static final String REQUIRE_PASSWORD_TO_DECRYPT = "require_password_to_decrypt";
7139
7140 /**
Libin.Tang@motorola.com0499bb52014-10-10 14:55:57 -05007141 * Whether the Volte/VT is enabled
7142 * <p>
7143 * Type: int (0 for false, 1 for true)
7144 * @hide
7145 */
Etan Cohene41a9cf2014-10-22 10:50:46 -07007146 public static final String ENHANCED_4G_MODE_ENABLED = "volte_vt_enabled";
Libin.Tang@motorola.com0499bb52014-10-10 14:55:57 -05007147
7148 /**
Etan Cohen7ab0ad12014-11-24 11:18:01 -08007149 * Global override to disable VoLTE (independent of user setting)
7150 * <p>
7151 * Type: int (1 for disable VoLTE, 0 to use user configuration)
7152 * @hide
7153 */
7154 public static final String VOLTE_FEATURE_DISABLED = "volte_feature_disabled";
7155
7156 /**
Amit Mahajan4fea0922014-11-18 12:56:28 -08007157 * Whether user can enable/disable LTE as a preferred network. A carrier might control
7158 * this via gservices, OMA-DM, carrier app, etc.
7159 * <p>
7160 * Type: int (0 for false, 1 for true)
7161 * @hide
7162 */
7163 public static final String LTE_SERVICE_FORCED = "lte_service_forced";
7164
7165 /**
Christopher Tate66488d62012-10-02 11:58:01 -07007166 * Settings to backup. This is here so that it's in the same place as the settings
7167 * keys and easy to update.
7168 *
7169 * These keys may be mentioned in the SETTINGS_TO_BACKUP arrays in System
7170 * and Secure as well. This is because those tables drive both backup and
7171 * restore, and restore needs to properly whitelist keys that used to live
7172 * in those namespaces. The keys will only actually be backed up / restored
7173 * if they are also mentioned in this table (Global.SETTINGS_TO_BACKUP).
7174 *
7175 * NOTE: Settings are backed up and restored in the order they appear
7176 * in this array. If you have one setting depending on another,
7177 * make sure that they are ordered appropriately.
7178 *
7179 * @hide
7180 */
7181 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate58f41ec2013-01-11 15:40:36 -08007182 BUGREPORT_IN_POWER_MENU,
Christopher Tate66488d62012-10-02 11:58:01 -07007183 STAY_ON_WHILE_PLUGGED_IN,
Christopher Tate66488d62012-10-02 11:58:01 -07007184 AUTO_TIME,
7185 AUTO_TIME_ZONE,
7186 POWER_SOUNDS_ENABLED,
7187 DOCK_SOUNDS_ENABLED,
7188 USB_MASS_STORAGE_ENABLED,
7189 ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED,
7190 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
7191 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY,
Christopher Tate16eb7cd2012-10-09 15:26:30 -07007192 WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED,
Christopher Tate66488d62012-10-02 11:58:01 -07007193 WIFI_NUM_OPEN_NETWORKS_KEPT,
7194 EMERGENCY_TONE,
7195 CALL_AUTO_RETRY,
Amith Yamasani94005242014-10-31 11:35:13 -07007196 DOCK_AUDIO_MEDIA_ENABLED,
7197 LOW_POWER_MODE_TRIGGER_LEVEL
Christopher Tate66488d62012-10-02 11:58:01 -07007198 };
7199
Christopher Tate06efb532012-08-24 15:29:27 -07007200 // Populated lazily, guarded by class object:
Dianne Hackborn139748f2012-09-24 11:36:57 -07007201 private static NameValueCache sNameValueCache = new NameValueCache(
7202 SYS_PROP_SETTING_VERSION,
7203 CONTENT_URI,
7204 CALL_METHOD_GET_GLOBAL,
7205 CALL_METHOD_PUT_GLOBAL);
Christopher Tate06efb532012-08-24 15:29:27 -07007206
Christopher Tateaa036a22014-05-19 16:33:27 -07007207 // Certain settings have been moved from global to the per-user secure namespace
7208 private static final HashSet<String> MOVED_TO_SECURE;
7209 static {
7210 MOVED_TO_SECURE = new HashSet<String>(1);
7211 MOVED_TO_SECURE.add(Settings.Global.INSTALL_NON_MARKET_APPS);
7212 }
7213
Svetoslav683914b2015-01-15 14:22:26 -08007214 /** @hide */
7215 public static void getMovedToSecureSettings(Set<String> outKeySet) {
7216 outKeySet.addAll(MOVED_TO_SECURE);
7217 }
7218
Christopher Tate06efb532012-08-24 15:29:27 -07007219 /**
7220 * Look up a name in the database.
7221 * @param resolver to access the database with
7222 * @param name to look up in the table
7223 * @return the corresponding value, or null if not present
7224 */
Dianne Hackborn139748f2012-09-24 11:36:57 -07007225 public static String getString(ContentResolver resolver, String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07007226 return getStringForUser(resolver, name, UserHandle.myUserId());
7227 }
7228
7229 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -07007230 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -07007231 int userHandle) {
Christopher Tateaa036a22014-05-19 16:33:27 -07007232 if (MOVED_TO_SECURE.contains(name)) {
7233 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
7234 + " to android.provider.Settings.Secure, returning read-only value.");
7235 return Secure.getStringForUser(resolver, name, userHandle);
7236 }
Christopher Tate06efb532012-08-24 15:29:27 -07007237 return sNameValueCache.getStringForUser(resolver, name, userHandle);
7238 }
7239
7240 /**
7241 * Store a name/value pair into the database.
7242 * @param resolver to access the database with
7243 * @param name to store
7244 * @param value to associate with the name
7245 * @return true if the value was set, false on database errors
7246 */
7247 public static boolean putString(ContentResolver resolver,
7248 String name, String value) {
7249 return putStringForUser(resolver, name, value, UserHandle.myUserId());
7250 }
7251
7252 /** @hide */
7253 public static boolean putStringForUser(ContentResolver resolver,
7254 String name, String value, int userHandle) {
Christopher Tate06efb532012-08-24 15:29:27 -07007255 if (LOCAL_LOGV) {
7256 Log.v(TAG, "Global.putString(name=" + name + ", value=" + value
7257 + " for " + userHandle);
7258 }
Christopher Tateaa036a22014-05-19 16:33:27 -07007259 // Global and Secure have the same access policy so we can forward writes
7260 if (MOVED_TO_SECURE.contains(name)) {
7261 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
7262 + " to android.provider.Settings.Secure, value is unchanged.");
7263 return Secure.putStringForUser(resolver, name, value, userHandle);
7264 }
Christopher Tate06efb532012-08-24 15:29:27 -07007265 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
7266 }
7267
7268 /**
7269 * Construct the content URI for a particular name/value pair,
7270 * useful for monitoring changes with a ContentObserver.
7271 * @param name to look up in the table
7272 * @return the corresponding content URI, or null if not present
7273 */
7274 public static Uri getUriFor(String name) {
7275 return getUriFor(CONTENT_URI, name);
7276 }
7277
7278 /**
7279 * Convenience function for retrieving a single secure settings value
7280 * as an integer. Note that internally setting values are always
7281 * stored as strings; this function converts the string to an integer
7282 * for you. The default value will be returned if the setting is
7283 * not defined or not an integer.
7284 *
7285 * @param cr The ContentResolver to access.
7286 * @param name The name of the setting to retrieve.
7287 * @param def Value to return if the setting is not defined.
7288 *
7289 * @return The setting's current value, or 'def' if it is not defined
7290 * or not a valid integer.
7291 */
7292 public static int getInt(ContentResolver cr, String name, int def) {
7293 String v = getString(cr, name);
7294 try {
7295 return v != null ? Integer.parseInt(v) : def;
7296 } catch (NumberFormatException e) {
7297 return def;
7298 }
7299 }
7300
7301 /**
7302 * Convenience function for retrieving a single secure settings value
7303 * as an integer. Note that internally setting values are always
7304 * stored as strings; this function converts the string to an integer
7305 * for you.
7306 * <p>
7307 * This version does not take a default value. If the setting has not
7308 * been set, or the string value is not a number,
7309 * it throws {@link SettingNotFoundException}.
7310 *
7311 * @param cr The ContentResolver to access.
7312 * @param name The name of the setting to retrieve.
7313 *
7314 * @throws SettingNotFoundException Thrown if a setting by the given
7315 * name can't be found or the setting value is not an integer.
7316 *
7317 * @return The setting's current value.
7318 */
7319 public static int getInt(ContentResolver cr, String name)
7320 throws SettingNotFoundException {
7321 String v = getString(cr, name);
7322 try {
7323 return Integer.parseInt(v);
7324 } catch (NumberFormatException e) {
7325 throw new SettingNotFoundException(name);
7326 }
7327 }
7328
7329 /**
7330 * Convenience function for updating a single settings value as an
7331 * integer. This will either create a new entry in the table if the
7332 * given name does not exist, or modify the value of the existing row
7333 * with that name. Note that internally setting values are always
7334 * stored as strings, so this function converts the given value to a
7335 * string before storing it.
7336 *
7337 * @param cr The ContentResolver to access.
7338 * @param name The name of the setting to modify.
7339 * @param value The new value for the setting.
7340 * @return true if the value was set, false on database errors
7341 */
7342 public static boolean putInt(ContentResolver cr, String name, int value) {
7343 return putString(cr, name, Integer.toString(value));
7344 }
7345
7346 /**
7347 * Convenience function for retrieving a single secure settings value
7348 * as a {@code long}. Note that internally setting values are always
7349 * stored as strings; this function converts the string to a {@code long}
7350 * for you. The default value will be returned if the setting is
7351 * not defined or not a {@code long}.
7352 *
7353 * @param cr The ContentResolver to access.
7354 * @param name The name of the setting to retrieve.
7355 * @param def Value to return if the setting is not defined.
7356 *
7357 * @return The setting's current value, or 'def' if it is not defined
7358 * or not a valid {@code long}.
7359 */
7360 public static long getLong(ContentResolver cr, String name, long def) {
7361 String valString = getString(cr, name);
7362 long value;
7363 try {
7364 value = valString != null ? Long.parseLong(valString) : def;
7365 } catch (NumberFormatException e) {
7366 value = def;
7367 }
7368 return value;
7369 }
7370
7371 /**
7372 * Convenience function for retrieving a single secure settings value
7373 * as a {@code long}. Note that internally setting values are always
7374 * stored as strings; this function converts the string to a {@code long}
7375 * for you.
7376 * <p>
7377 * This version does not take a default value. If the setting has not
7378 * been set, or the string value is not a number,
7379 * it throws {@link SettingNotFoundException}.
7380 *
7381 * @param cr The ContentResolver to access.
7382 * @param name The name of the setting to retrieve.
7383 *
7384 * @return The setting's current value.
7385 * @throws SettingNotFoundException Thrown if a setting by the given
7386 * name can't be found or the setting value is not an integer.
7387 */
7388 public static long getLong(ContentResolver cr, String name)
7389 throws SettingNotFoundException {
7390 String valString = getString(cr, name);
7391 try {
7392 return Long.parseLong(valString);
7393 } catch (NumberFormatException e) {
7394 throw new SettingNotFoundException(name);
7395 }
7396 }
7397
7398 /**
7399 * Convenience function for updating a secure settings value as a long
7400 * integer. This will either create a new entry in the table if the
7401 * given name does not exist, or modify the value of the existing row
7402 * with that name. Note that internally setting values are always
7403 * stored as strings, so this function converts the given value to a
7404 * string before storing it.
7405 *
7406 * @param cr The ContentResolver to access.
7407 * @param name The name of the setting to modify.
7408 * @param value The new value for the setting.
7409 * @return true if the value was set, false on database errors
7410 */
7411 public static boolean putLong(ContentResolver cr, String name, long value) {
7412 return putString(cr, name, Long.toString(value));
7413 }
7414
7415 /**
7416 * Convenience function for retrieving a single secure settings value
7417 * as a floating point number. Note that internally setting values are
7418 * always stored as strings; this function converts the string to an
7419 * float for you. The default value will be returned if the setting
7420 * is not defined or not a valid float.
7421 *
7422 * @param cr The ContentResolver to access.
7423 * @param name The name of the setting to retrieve.
7424 * @param def Value to return if the setting is not defined.
7425 *
7426 * @return The setting's current value, or 'def' if it is not defined
7427 * or not a valid float.
7428 */
7429 public static float getFloat(ContentResolver cr, String name, float def) {
7430 String v = getString(cr, name);
7431 try {
7432 return v != null ? Float.parseFloat(v) : def;
7433 } catch (NumberFormatException e) {
7434 return def;
7435 }
7436 }
7437
7438 /**
7439 * Convenience function for retrieving a single secure settings value
7440 * as a float. Note that internally setting values are always
7441 * stored as strings; this function converts the string to a float
7442 * for you.
7443 * <p>
7444 * This version does not take a default value. If the setting has not
7445 * been set, or the string value is not a number,
7446 * it throws {@link SettingNotFoundException}.
7447 *
7448 * @param cr The ContentResolver to access.
7449 * @param name The name of the setting to retrieve.
7450 *
7451 * @throws SettingNotFoundException Thrown if a setting by the given
7452 * name can't be found or the setting value is not a float.
7453 *
7454 * @return The setting's current value.
7455 */
7456 public static float getFloat(ContentResolver cr, String name)
7457 throws SettingNotFoundException {
7458 String v = getString(cr, name);
7459 if (v == null) {
7460 throw new SettingNotFoundException(name);
7461 }
7462 try {
7463 return Float.parseFloat(v);
7464 } catch (NumberFormatException e) {
7465 throw new SettingNotFoundException(name);
7466 }
7467 }
7468
7469 /**
7470 * Convenience function for updating a single settings value as a
7471 * floating point number. This will either create a new entry in the
7472 * table if the given name does not exist, or modify the value of the
7473 * existing row with that name. Note that internally setting values
7474 * are always stored as strings, so this function converts the given
7475 * value to a string before storing it.
7476 *
7477 * @param cr The ContentResolver to access.
7478 * @param name The name of the setting to modify.
7479 * @param value The new value for the setting.
7480 * @return true if the value was set, false on database errors
7481 */
7482 public static boolean putFloat(ContentResolver cr, String name, float value) {
7483 return putString(cr, name, Float.toString(value));
7484 }
Wink Savillefb40dd42014-06-12 17:02:31 -07007485
7486
7487 /**
7488 * Subscription to be used for voice call on a multi sim device. The supported values
7489 * are 0 = SUB1, 1 = SUB2 and etc.
7490 * @hide
7491 */
7492 public static final String MULTI_SIM_VOICE_CALL_SUBSCRIPTION = "multi_sim_voice_call";
7493
7494 /**
7495 * Used to provide option to user to select subscription during dial.
7496 * The supported values are 0 = disable or 1 = enable prompt.
7497 * @hide
7498 */
7499 public static final String MULTI_SIM_VOICE_PROMPT = "multi_sim_voice_prompt";
7500
7501 /**
7502 * Subscription to be used for data call on a multi sim device. The supported values
7503 * are 0 = SUB1, 1 = SUB2 and etc.
7504 * @hide
7505 */
7506 public static final String MULTI_SIM_DATA_CALL_SUBSCRIPTION = "multi_sim_data_call";
7507
7508 /**
7509 * Subscription to be used for SMS on a multi sim device. The supported values
7510 * are 0 = SUB1, 1 = SUB2 and etc.
7511 * @hide
7512 */
7513 public static final String MULTI_SIM_SMS_SUBSCRIPTION = "multi_sim_sms";
7514
7515 /**
7516 * Used to provide option to user to select subscription during send SMS.
7517 * The value 1 - enable, 0 - disable
7518 * @hide
7519 */
7520 public static final String MULTI_SIM_SMS_PROMPT = "multi_sim_sms_prompt";
7521
7522
7523
7524 /** User preferred subscriptions setting.
7525 * This holds the details of the user selected subscription from the card and
7526 * the activation status. Each settings string have the coma separated values
7527 * iccId,appType,appId,activationStatus,3gppIndex,3gpp2Index
7528 * @hide
7529 */
7530 public static final String[] MULTI_SIM_USER_PREFERRED_SUBS = {"user_preferred_sub1",
7531 "user_preferred_sub2","user_preferred_sub3"};
Christopher Tate06efb532012-08-24 15:29:27 -07007532 }
7533
7534 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007535 * User-defined bookmarks and shortcuts. The target of each bookmark is an
7536 * Intent URL, allowing it to be either a web page or a particular
7537 * application activity.
7538 *
7539 * @hide
7540 */
7541 public static final class Bookmarks implements BaseColumns
7542 {
7543 private static final String TAG = "Bookmarks";
7544
7545 /**
7546 * The content:// style URL for this table
7547 */
7548 public static final Uri CONTENT_URI =
7549 Uri.parse("content://" + AUTHORITY + "/bookmarks");
7550
7551 /**
7552 * The row ID.
7553 * <p>Type: INTEGER</p>
7554 */
7555 public static final String ID = "_id";
7556
7557 /**
7558 * Descriptive name of the bookmark that can be displayed to the user.
7559 * If this is empty, the title should be resolved at display time (use
7560 * {@link #getTitle(Context, Cursor)} any time you want to display the
7561 * title of a bookmark.)
7562 * <P>
7563 * Type: TEXT
7564 * </P>
7565 */
7566 public static final String TITLE = "title";
7567
7568 /**
7569 * Arbitrary string (displayed to the user) that allows bookmarks to be
7570 * organized into categories. There are some special names for
7571 * standard folders, which all start with '@'. The label displayed for
7572 * the folder changes with the locale (via {@link #getLabelForFolder}) but
7573 * the folder name does not change so you can consistently query for
7574 * the folder regardless of the current locale.
7575 *
7576 * <P>Type: TEXT</P>
7577 *
7578 */
7579 public static final String FOLDER = "folder";
7580
7581 /**
7582 * The Intent URL of the bookmark, describing what it points to. This
7583 * value is given to {@link android.content.Intent#getIntent} to create
7584 * an Intent that can be launched.
7585 * <P>Type: TEXT</P>
7586 */
7587 public static final String INTENT = "intent";
7588
7589 /**
7590 * Optional shortcut character associated with this bookmark.
7591 * <P>Type: INTEGER</P>
7592 */
7593 public static final String SHORTCUT = "shortcut";
7594
7595 /**
7596 * The order in which the bookmark should be displayed
7597 * <P>Type: INTEGER</P>
7598 */
7599 public static final String ORDERING = "ordering";
7600
7601 private static final String[] sIntentProjection = { INTENT };
7602 private static final String[] sShortcutProjection = { ID, SHORTCUT };
7603 private static final String sShortcutSelection = SHORTCUT + "=?";
7604
7605 /**
7606 * Convenience function to retrieve the bookmarked Intent for a
7607 * particular shortcut key.
7608 *
7609 * @param cr The ContentResolver to query.
7610 * @param shortcut The shortcut key.
7611 *
7612 * @return Intent The bookmarked URL, or null if there is no bookmark
7613 * matching the given shortcut.
7614 */
7615 public static Intent getIntentForShortcut(ContentResolver cr, char shortcut)
7616 {
7617 Intent intent = null;
7618
7619 Cursor c = cr.query(CONTENT_URI,
7620 sIntentProjection, sShortcutSelection,
7621 new String[] { String.valueOf((int) shortcut) }, ORDERING);
7622 // Keep trying until we find a valid shortcut
7623 try {
7624 while (intent == null && c.moveToNext()) {
7625 try {
7626 String intentURI = c.getString(c.getColumnIndexOrThrow(INTENT));
Christian Mehlmauera34d2c92010-05-25 19:04:20 +02007627 intent = Intent.parseUri(intentURI, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007628 } catch (java.net.URISyntaxException e) {
7629 // The stored URL is bad... ignore it.
7630 } catch (IllegalArgumentException e) {
7631 // Column not found
Dianne Hackborna33e3f72009-09-29 17:28:24 -07007632 Log.w(TAG, "Intent column not found", e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007633 }
7634 }
7635 } finally {
7636 if (c != null) c.close();
7637 }
7638
7639 return intent;
7640 }
7641
7642 /**
7643 * Add a new bookmark to the system.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07007644 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007645 * @param cr The ContentResolver to query.
7646 * @param intent The desired target of the bookmark.
7647 * @param title Bookmark title that is shown to the user; null if none
7648 * or it should be resolved to the intent's title.
7649 * @param folder Folder in which to place the bookmark; null if none.
7650 * @param shortcut Shortcut that will invoke the bookmark; 0 if none. If
7651 * this is non-zero and there is an existing bookmark entry
7652 * with this same shortcut, then that existing shortcut is
7653 * cleared (the bookmark is not removed).
7654 * @return The unique content URL for the new bookmark entry.
7655 */
7656 public static Uri add(ContentResolver cr,
7657 Intent intent,
7658 String title,
7659 String folder,
7660 char shortcut,
7661 int ordering)
7662 {
7663 // If a shortcut is supplied, and it is already defined for
7664 // another bookmark, then remove the old definition.
7665 if (shortcut != 0) {
Jeff Hamilton7cd51ef2010-05-12 17:30:27 -05007666 cr.delete(CONTENT_URI, sShortcutSelection,
7667 new String[] { String.valueOf((int) shortcut) });
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007668 }
7669
7670 ContentValues values = new ContentValues();
7671 if (title != null) values.put(TITLE, title);
7672 if (folder != null) values.put(FOLDER, folder);
Jean-Baptiste Queru3b9f0a32010-06-21 13:46:59 -07007673 values.put(INTENT, intent.toUri(0));
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007674 if (shortcut != 0) values.put(SHORTCUT, (int) shortcut);
7675 values.put(ORDERING, ordering);
7676 return cr.insert(CONTENT_URI, values);
7677 }
7678
7679 /**
7680 * Return the folder name as it should be displayed to the user. This
7681 * takes care of localizing special folders.
7682 *
7683 * @param r Resources object for current locale; only need access to
7684 * system resources.
7685 * @param folder The value found in the {@link #FOLDER} column.
7686 *
7687 * @return CharSequence The label for this folder that should be shown
7688 * to the user.
7689 */
7690 public static CharSequence getLabelForFolder(Resources r, String folder) {
7691 return folder;
7692 }
7693
7694 /**
7695 * Return the title as it should be displayed to the user. This takes
7696 * care of localizing bookmarks that point to activities.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07007697 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007698 * @param context A context.
7699 * @param cursor A cursor pointing to the row whose title should be
7700 * returned. The cursor must contain at least the {@link #TITLE}
7701 * and {@link #INTENT} columns.
7702 * @return A title that is localized and can be displayed to the user,
7703 * or the empty string if one could not be found.
7704 */
7705 public static CharSequence getTitle(Context context, Cursor cursor) {
7706 int titleColumn = cursor.getColumnIndex(TITLE);
7707 int intentColumn = cursor.getColumnIndex(INTENT);
7708 if (titleColumn == -1 || intentColumn == -1) {
7709 throw new IllegalArgumentException(
7710 "The cursor must contain the TITLE and INTENT columns.");
7711 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07007712
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007713 String title = cursor.getString(titleColumn);
7714 if (!TextUtils.isEmpty(title)) {
7715 return title;
7716 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07007717
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007718 String intentUri = cursor.getString(intentColumn);
7719 if (TextUtils.isEmpty(intentUri)) {
7720 return "";
7721 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07007722
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007723 Intent intent;
7724 try {
Christian Mehlmauera34d2c92010-05-25 19:04:20 +02007725 intent = Intent.parseUri(intentUri, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007726 } catch (URISyntaxException e) {
7727 return "";
7728 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07007729
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007730 PackageManager packageManager = context.getPackageManager();
7731 ResolveInfo info = packageManager.resolveActivity(intent, 0);
7732 return info != null ? info.loadLabel(packageManager) : "";
7733 }
7734 }
7735
7736 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007737 * Returns the device ID that we should use when connecting to the mobile gtalk server.
7738 * This is a string like "android-0x1242", where the hex string is the Android ID obtained
7739 * from the GoogleLoginService.
7740 *
7741 * @param androidId The Android ID for this device.
7742 * @return The device ID that should be used when connecting to the mobile gtalk server.
7743 * @hide
7744 */
7745 public static String getGTalkDeviceId(long androidId) {
7746 return "android-" + Long.toHexString(androidId);
7747 }
7748}