blob: c1f58a2222ba0df9a95e952f822d0333cf8ded72 [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;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080068
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080069/**
70 * The Settings provider contains global system-level device preferences.
71 */
72public final class Settings {
73
74 // Intent actions for Settings
75
76 /**
77 * Activity Action: Show system settings.
78 * <p>
79 * Input: Nothing.
80 * <p>
Gilles Debunnee90bed12011-08-30 14:28:27 -070081 * Output: Nothing.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080082 */
83 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
84 public static final String ACTION_SETTINGS = "android.settings.SETTINGS";
85
86 /**
87 * Activity Action: Show settings to allow configuration of APNs.
88 * <p>
89 * Input: Nothing.
90 * <p>
Gilles Debunnee90bed12011-08-30 14:28:27 -070091 * Output: Nothing.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080092 */
93 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
94 public static final String ACTION_APN_SETTINGS = "android.settings.APN_SETTINGS";
95
96 /**
97 * Activity Action: Show settings to allow configuration of current location
98 * sources.
99 * <p>
100 * In some cases, a matching Activity may not exist, so ensure you
101 * safeguard against this.
102 * <p>
103 * Input: Nothing.
104 * <p>
105 * Output: Nothing.
106 */
107 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
108 public static final String ACTION_LOCATION_SOURCE_SETTINGS =
109 "android.settings.LOCATION_SOURCE_SETTINGS";
110
111 /**
112 * Activity Action: Show settings to allow configuration of wireless controls
113 * such as Wi-Fi, Bluetooth and Mobile networks.
114 * <p>
115 * In some cases, a matching Activity may not exist, so ensure you
116 * safeguard against this.
117 * <p>
118 * Input: Nothing.
119 * <p>
120 * Output: Nothing.
121 */
122 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
123 public static final String ACTION_WIRELESS_SETTINGS =
124 "android.settings.WIRELESS_SETTINGS";
125
126 /**
127 * Activity Action: Show settings to allow entering/exiting airplane mode.
128 * <p>
129 * In some cases, a matching Activity may not exist, so ensure you
130 * safeguard against this.
131 * <p>
132 * Input: Nothing.
133 * <p>
134 * Output: Nothing.
135 */
136 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
137 public static final String ACTION_AIRPLANE_MODE_SETTINGS =
138 "android.settings.AIRPLANE_MODE_SETTINGS";
139
140 /**
Barnaby Jamesb3006d32015-04-02 17:49:54 -0700141 * Activity Action: Modify Airplane mode settings using a voice command.
Barnaby James48f35522014-07-16 14:27:39 -0700142 * <p>
143 * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
144 * <p>
145 * This intent MUST be started using
146 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
147 * startVoiceActivity}.
148 * <p>
Barnaby Jamesb3006d32015-04-02 17:49:54 -0700149 * Note: The activity implementing this intent MUST verify that
Barnaby James48f35522014-07-16 14:27:39 -0700150 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before
151 * modifying the setting.
152 * <p>
Barnaby Jamesb3006d32015-04-02 17:49:54 -0700153 * Input: To tell which state airplane mode should be set to, add the
154 * {@link #EXTRA_AIRPLANE_MODE_ENABLED} extra to this Intent with the state specified.
155 * If the extra is not included, no changes will be made.
Barnaby James48f35522014-07-16 14:27:39 -0700156 * <p>
157 * Output: Nothing.
158 */
159 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
160 public static final String ACTION_VOICE_CONTROL_AIRPLANE_MODE =
161 "android.settings.VOICE_CONTROL_AIRPLANE_MODE";
162
163 /**
Dianne Hackborndd9b82c2009-09-03 00:18:47 -0700164 * Activity Action: Show settings for accessibility modules.
165 * <p>
166 * In some cases, a matching Activity may not exist, so ensure you
167 * safeguard against this.
168 * <p>
169 * Input: Nothing.
170 * <p>
171 * Output: Nothing.
172 */
173 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
174 public static final String ACTION_ACCESSIBILITY_SETTINGS =
175 "android.settings.ACCESSIBILITY_SETTINGS";
176
177 /**
Dianne Hackborna3fb40d2014-08-12 15:06:50 -0700178 * Activity Action: Show settings to control access to usage information.
179 * <p>
180 * In some cases, a matching Activity may not exist, so ensure you
181 * safeguard against this.
182 * <p>
183 * Input: Nothing.
184 * <p>
185 * Output: Nothing.
186 */
187 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
188 public static final String ACTION_USAGE_ACCESS_SETTINGS =
189 "android.settings.USAGE_ACCESS_SETTINGS";
190
191 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800192 * Activity Action: Show settings to allow configuration of security and
193 * location privacy.
194 * <p>
195 * In some cases, a matching Activity may not exist, so ensure you
196 * safeguard against this.
197 * <p>
198 * Input: Nothing.
199 * <p>
200 * Output: Nothing.
201 */
202 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
203 public static final String ACTION_SECURITY_SETTINGS =
204 "android.settings.SECURITY_SETTINGS";
205
206 /**
Maggie Benthall0469f412013-09-05 15:30:26 -0400207 * Activity Action: Show trusted credentials settings, opening to the user tab,
208 * to allow management of installed credentials.
209 * <p>
210 * In some cases, a matching Activity may not exist, so ensure you
211 * safeguard against this.
212 * <p>
213 * Input: Nothing.
214 * <p>
215 * Output: Nothing.
216 * @hide
217 */
218 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
219 public static final String ACTION_TRUSTED_CREDENTIALS_USER =
220 "com.android.settings.TRUSTED_CREDENTIALS_USER";
221
222 /**
223 * Activity Action: Show dialog explaining that an installed CA cert may enable
224 * monitoring of encrypted network traffic.
225 * <p>
226 * In some cases, a matching Activity may not exist, so ensure you
227 * safeguard against this.
228 * <p>
229 * Input: Nothing.
230 * <p>
231 * Output: Nothing.
232 * @hide
233 */
234 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
235 public static final String ACTION_MONITORING_CERT_INFO =
236 "com.android.settings.MONITORING_CERT_INFO";
237
238 /**
Amith Yamasanic15255a2009-09-23 15:33:19 -0700239 * Activity Action: Show settings to allow configuration of privacy options.
240 * <p>
241 * In some cases, a matching Activity may not exist, so ensure you
242 * safeguard against this.
243 * <p>
244 * Input: Nothing.
245 * <p>
246 * Output: Nothing.
247 */
248 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
249 public static final String ACTION_PRIVACY_SETTINGS =
250 "android.settings.PRIVACY_SETTINGS";
251
252 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800253 * Activity Action: Show settings to allow configuration of Wi-Fi.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800254 * <p>
255 * In some cases, a matching Activity may not exist, so ensure you
256 * safeguard against this.
257 * <p>
258 * Input: Nothing.
259 * <p>
260 * Output: Nothing.
261
262 */
263 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
264 public static final String ACTION_WIFI_SETTINGS =
265 "android.settings.WIFI_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700266
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800267 /**
268 * Activity Action: Show settings to allow configuration of a static IP
269 * address for Wi-Fi.
270 * <p>
271 * In some cases, a matching Activity may not exist, so ensure you safeguard
272 * against this.
273 * <p>
274 * Input: Nothing.
275 * <p>
276 * Output: Nothing.
277 */
278 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
279 public static final String ACTION_WIFI_IP_SETTINGS =
280 "android.settings.WIFI_IP_SETTINGS";
281
282 /**
283 * Activity Action: Show settings to allow configuration of Bluetooth.
284 * <p>
285 * In some cases, a matching Activity may not exist, so ensure you
286 * safeguard against this.
287 * <p>
288 * Input: Nothing.
289 * <p>
290 * Output: Nothing.
291 */
292 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
293 public static final String ACTION_BLUETOOTH_SETTINGS =
294 "android.settings.BLUETOOTH_SETTINGS";
295
296 /**
Jeff Brown89d55462012-09-19 11:33:42 -0700297 * Activity Action: Show settings to allow configuration of Wifi Displays.
298 * <p>
299 * In some cases, a matching Activity may not exist, so ensure you
300 * safeguard against this.
301 * <p>
302 * Input: Nothing.
303 * <p>
304 * Output: Nothing.
305 * @hide
306 */
307 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
308 public static final String ACTION_WIFI_DISPLAY_SETTINGS =
309 "android.settings.WIFI_DISPLAY_SETTINGS";
310
311 /**
Jeff Brown1a937b02014-07-01 22:13:04 -0700312 * Activity Action: Show settings to allow configuration of
313 * {@link android.media.routing.MediaRouteService media route providers}.
314 * <p>
315 * In some cases, a matching Activity may not exist, so ensure you
316 * safeguard against this.
317 * <p>
318 * Input: Nothing.
319 * <p>
320 * Output: Nothing.
321 */
322 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
323 public static final String ACTION_CAST_SETTINGS =
324 "android.settings.CAST_SETTINGS";
325
326 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800327 * Activity Action: Show settings to allow configuration of date and time.
328 * <p>
329 * In some cases, a matching Activity may not exist, so ensure you
330 * safeguard against this.
331 * <p>
332 * Input: Nothing.
333 * <p>
334 * Output: Nothing.
335 */
336 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
337 public static final String ACTION_DATE_SETTINGS =
338 "android.settings.DATE_SETTINGS";
339
340 /**
341 * Activity Action: Show settings to allow configuration of sound and volume.
342 * <p>
343 * In some cases, a matching Activity may not exist, so ensure you
344 * safeguard against this.
345 * <p>
346 * Input: Nothing.
347 * <p>
348 * Output: Nothing.
349 */
350 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
351 public static final String ACTION_SOUND_SETTINGS =
352 "android.settings.SOUND_SETTINGS";
353
354 /**
355 * Activity Action: Show settings to allow configuration of display.
356 * <p>
357 * In some cases, a matching Activity may not exist, so ensure you
358 * safeguard against this.
359 * <p>
360 * Input: Nothing.
361 * <p>
362 * Output: Nothing.
363 */
364 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
365 public static final String ACTION_DISPLAY_SETTINGS =
366 "android.settings.DISPLAY_SETTINGS";
367
368 /**
369 * Activity Action: Show settings to allow configuration of locale.
370 * <p>
371 * In some cases, a matching Activity may not exist, so ensure you
372 * safeguard against this.
373 * <p>
374 * Input: Nothing.
375 * <p>
376 * Output: Nothing.
377 */
378 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
379 public static final String ACTION_LOCALE_SETTINGS =
380 "android.settings.LOCALE_SETTINGS";
381
382 /**
383 * Activity Action: Show settings to configure input methods, in particular
384 * allowing the user to enable input methods.
385 * <p>
386 * In some cases, a matching Activity may not exist, so ensure you
387 * safeguard against this.
388 * <p>
389 * Input: Nothing.
390 * <p>
391 * Output: Nothing.
392 */
393 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
Dianne Hackborna3fb40d2014-08-12 15:06:50 -0700394 public static final String ACTION_VOICE_INPUT_SETTINGS =
395 "android.settings.VOICE_INPUT_SETTINGS";
396
397 /**
398 * Activity Action: Show settings to configure input methods, in particular
399 * allowing the user to enable input methods.
400 * <p>
401 * In some cases, a matching Activity may not exist, so ensure you
402 * safeguard against this.
403 * <p>
404 * Input: Nothing.
405 * <p>
406 * Output: Nothing.
407 */
408 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800409 public static final String ACTION_INPUT_METHOD_SETTINGS =
410 "android.settings.INPUT_METHOD_SETTINGS";
411
412 /**
Tadashi G. Takaokaf49688f2011-01-20 17:56:13 +0900413 * Activity Action: Show settings to enable/disable input method subtypes.
satok86417ea2010-10-27 14:11:03 +0900414 * <p>
415 * In some cases, a matching Activity may not exist, so ensure you
416 * safeguard against this.
417 * <p>
Tadashi G. Takaoka25480202011-01-20 23:13:02 +0900418 * To tell which input method's subtypes are displayed in the settings, add
419 * {@link #EXTRA_INPUT_METHOD_ID} extra to this Intent with the input method id.
420 * If there is no extra in this Intent, subtypes from all installed input methods
421 * will be displayed in the settings.
422 *
423 * @see android.view.inputmethod.InputMethodInfo#getId
424 * <p>
satok86417ea2010-10-27 14:11:03 +0900425 * Input: Nothing.
426 * <p>
427 * Output: Nothing.
428 */
429 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
Tadashi G. Takaokaf49688f2011-01-20 17:56:13 +0900430 public static final String ACTION_INPUT_METHOD_SUBTYPE_SETTINGS =
431 "android.settings.INPUT_METHOD_SUBTYPE_SETTINGS";
satok86417ea2010-10-27 14:11:03 +0900432
433 /**
satok7cfc0ed2011-06-20 21:29:36 +0900434 * Activity Action: Show a dialog to select input method.
435 * <p>
436 * In some cases, a matching Activity may not exist, so ensure you
437 * safeguard against this.
438 * <p>
439 * Input: Nothing.
440 * <p>
441 * Output: Nothing.
442 * @hide
443 */
444 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
445 public static final String ACTION_SHOW_INPUT_METHOD_PICKER =
446 "android.settings.SHOW_INPUT_METHOD_PICKER";
447
448 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800449 * Activity Action: Show settings to manage the user input dictionary.
450 * <p>
Chet Haasee8222dd2013-09-05 07:44:18 -0700451 * Starting with {@link android.os.Build.VERSION_CODES#KITKAT},
Satoshi Kataoka2aa2bc52013-07-30 14:25:11 +0900452 * it is guaranteed there will always be an appropriate implementation for this Intent action.
453 * 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 -0800454 * <p>
455 * Input: Nothing.
456 * <p>
457 * Output: Nothing.
458 */
459 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
460 public static final String ACTION_USER_DICTIONARY_SETTINGS =
461 "android.settings.USER_DICTIONARY_SETTINGS";
462
463 /**
Gilles Debunnee90bed12011-08-30 14:28:27 -0700464 * Activity Action: Adds a word to the user dictionary.
465 * <p>
466 * In some cases, a matching Activity may not exist, so ensure you
467 * safeguard against this.
468 * <p>
469 * Input: An extra with key <code>word</code> that contains the word
470 * that should be added to the dictionary.
471 * <p>
472 * Output: Nothing.
473 *
474 * @hide
475 */
476 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
477 public static final String ACTION_USER_DICTIONARY_INSERT =
478 "com.android.settings.USER_DICTIONARY_INSERT";
479
480 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800481 * Activity Action: Show settings to allow configuration of application-related settings.
482 * <p>
483 * In some cases, a matching Activity may not exist, so ensure you
484 * safeguard against this.
485 * <p>
486 * Input: Nothing.
487 * <p>
488 * Output: Nothing.
489 */
490 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
491 public static final String ACTION_APPLICATION_SETTINGS =
492 "android.settings.APPLICATION_SETTINGS";
493
494 /**
495 * Activity Action: Show settings to allow configuration of application
Dianne Hackborn8d866e52012-10-10 18:39:45 -0700496 * development-related settings. As of
497 * {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1} this action is
498 * a required part of the platform.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800499 * <p>
500 * Input: Nothing.
501 * <p>
502 * Output: Nothing.
503 */
504 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
505 public static final String ACTION_APPLICATION_DEVELOPMENT_SETTINGS =
506 "android.settings.APPLICATION_DEVELOPMENT_SETTINGS";
507
508 /**
509 * Activity Action: Show settings to allow configuration of quick launch shortcuts.
510 * <p>
511 * In some cases, a matching Activity may not exist, so ensure you
512 * safeguard against this.
513 * <p>
514 * Input: Nothing.
515 * <p>
516 * Output: Nothing.
517 */
518 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
519 public static final String ACTION_QUICK_LAUNCH_SETTINGS =
520 "android.settings.QUICK_LAUNCH_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700521
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800522 /**
523 * Activity Action: Show settings to manage installed applications.
524 * <p>
525 * In some cases, a matching Activity may not exist, so ensure you
526 * safeguard against this.
527 * <p>
528 * Input: Nothing.
529 * <p>
530 * Output: Nothing.
531 */
532 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
533 public static final String ACTION_MANAGE_APPLICATIONS_SETTINGS =
534 "android.settings.MANAGE_APPLICATIONS_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700535
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800536 /**
Winson Chung44e8ff92010-09-27 14:36:52 -0700537 * Activity Action: Show settings to manage all applications.
538 * <p>
539 * In some cases, a matching Activity may not exist, so ensure you
540 * safeguard against this.
541 * <p>
542 * Input: Nothing.
543 * <p>
544 * Output: Nothing.
545 */
546 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
547 public static final String ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS =
548 "android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS";
549
550 /**
Dianne Hackbornb7bb3b32010-06-06 22:47:50 -0700551 * Activity Action: Show screen of details about a particular application.
552 * <p>
553 * In some cases, a matching Activity may not exist, so ensure you
554 * safeguard against this.
555 * <p>
556 * Input: The Intent's data URI specifies the application package name
557 * to be shown, with the "package" scheme. That is "package:com.my.app".
558 * <p>
559 * Output: Nothing.
560 */
561 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
562 public static final String ACTION_APPLICATION_DETAILS_SETTINGS =
563 "android.settings.APPLICATION_DETAILS_SETTINGS";
564
565 /**
Dianne Hackborn35654b62013-01-14 17:38:02 -0800566 * @hide
567 * Activity Action: Show the "app ops" settings screen.
568 * <p>
569 * Input: Nothing.
570 * <p>
571 * Output: Nothing.
572 */
573 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
574 public static final String ACTION_APP_OPS_SETTINGS =
575 "android.settings.APP_OPS_SETTINGS";
576
577 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800578 * Activity Action: Show settings for system update functionality.
579 * <p>
580 * In some cases, a matching Activity may not exist, so ensure you
581 * safeguard against this.
582 * <p>
583 * Input: Nothing.
584 * <p>
585 * Output: Nothing.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700586 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800587 * @hide
588 */
589 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
590 public static final String ACTION_SYSTEM_UPDATE_SETTINGS =
591 "android.settings.SYSTEM_UPDATE_SETTINGS";
592
593 /**
594 * Activity Action: Show settings to allow configuration of sync settings.
595 * <p>
596 * In some cases, a matching Activity may not exist, so ensure you
597 * safeguard against this.
598 * <p>
Erikeebc8e22010-02-18 13:27:19 -0800599 * The account types available to add via the add account button may be restricted by adding an
600 * {@link #EXTRA_AUTHORITIES} extra to this Intent with one or more syncable content provider's
601 * authorities. Only account types which can sync with that content provider will be offered to
602 * the user.
603 * <p>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800604 * Input: Nothing.
605 * <p>
606 * Output: Nothing.
607 */
608 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
609 public static final String ACTION_SYNC_SETTINGS =
610 "android.settings.SYNC_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700611
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800612 /**
Erikeebc8e22010-02-18 13:27:19 -0800613 * Activity Action: Show add account screen for creating a new account.
614 * <p>
615 * In some cases, a matching Activity may not exist, so ensure you
616 * safeguard against this.
617 * <p>
618 * The account types available to add may be restricted by adding an {@link #EXTRA_AUTHORITIES}
619 * extra to the Intent with one or more syncable content provider's authorities. Only account
620 * types which can sync with that content provider will be offered to the user.
621 * <p>
Alon Albert50359c22013-02-26 14:47:48 -0800622 * Account types can also be filtered by adding an {@link #EXTRA_ACCOUNT_TYPES} extra to the
623 * Intent with one or more account types.
624 * <p>
Erikeebc8e22010-02-18 13:27:19 -0800625 * Input: Nothing.
626 * <p>
627 * Output: Nothing.
628 */
629 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
630 public static final String ACTION_ADD_ACCOUNT =
631 "android.settings.ADD_ACCOUNT_SETTINGS";
632
633 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800634 * Activity Action: Show settings for selecting the network operator.
635 * <p>
636 * In some cases, a matching Activity may not exist, so ensure you
637 * safeguard against this.
638 * <p>
639 * Input: Nothing.
640 * <p>
641 * Output: Nothing.
642 */
643 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
644 public static final String ACTION_NETWORK_OPERATOR_SETTINGS =
645 "android.settings.NETWORK_OPERATOR_SETTINGS";
646
647 /**
648 * Activity Action: Show settings for selection of 2G/3G.
649 * <p>
650 * In some cases, a matching Activity may not exist, so ensure you
651 * safeguard against this.
652 * <p>
653 * Input: Nothing.
654 * <p>
655 * Output: Nothing.
656 */
657 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
658 public static final String ACTION_DATA_ROAMING_SETTINGS =
659 "android.settings.DATA_ROAMING_SETTINGS";
660
661 /**
662 * Activity Action: Show settings for internal storage.
663 * <p>
664 * In some cases, a matching Activity may not exist, so ensure you
665 * safeguard against this.
666 * <p>
667 * Input: Nothing.
668 * <p>
669 * Output: Nothing.
670 */
671 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
672 public static final String ACTION_INTERNAL_STORAGE_SETTINGS =
673 "android.settings.INTERNAL_STORAGE_SETTINGS";
674 /**
675 * Activity Action: Show settings for memory card storage.
676 * <p>
677 * In some cases, a matching Activity may not exist, so ensure you
678 * safeguard against this.
679 * <p>
680 * Input: Nothing.
681 * <p>
682 * Output: Nothing.
683 */
684 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
685 public static final String ACTION_MEMORY_CARD_SETTINGS =
686 "android.settings.MEMORY_CARD_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700687
Justin Mattsonef340352010-01-13 21:05:46 -0800688 /**
689 * Activity Action: Show settings for global search.
690 * <p>
691 * In some cases, a matching Activity may not exist, so ensure you
692 * safeguard against this.
693 * <p>
694 * Input: Nothing.
695 * <p>
696 * Output: Nothing
697 */
698 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
699 public static final String ACTION_SEARCH_SETTINGS =
700 "android.search.action.SEARCH_SETTINGS";
701
Daniel Sandler9d8b8762010-01-22 20:50:15 -0500702 /**
703 * Activity Action: Show general device information settings (serial
704 * number, software version, phone number, etc.).
705 * <p>
706 * In some cases, a matching Activity may not exist, so ensure you
707 * safeguard against this.
708 * <p>
709 * Input: Nothing.
710 * <p>
711 * Output: Nothing
712 */
713 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
714 public static final String ACTION_DEVICE_INFO_SETTINGS =
715 "android.settings.DEVICE_INFO_SETTINGS";
716
Martijn Coenen9b3c83f2011-07-28 11:21:39 -0500717 /**
Nick Pellycccf01d2011-10-31 14:49:40 -0700718 * Activity Action: Show NFC settings.
719 * <p>
720 * This shows UI that allows NFC to be turned on or off.
Martijn Coenen9b3c83f2011-07-28 11:21:39 -0500721 * <p>
722 * In some cases, a matching Activity may not exist, so ensure you
723 * safeguard against this.
724 * <p>
725 * Input: Nothing.
726 * <p>
727 * Output: Nothing
Nick Pellycccf01d2011-10-31 14:49:40 -0700728 * @see android.nfc.NfcAdapter#isEnabled()
729 */
730 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
731 public static final String ACTION_NFC_SETTINGS = "android.settings.NFC_SETTINGS";
732
733 /**
734 * Activity Action: Show NFC Sharing settings.
735 * <p>
736 * This shows UI that allows NDEF Push (Android Beam) to be turned on or
737 * off.
738 * <p>
739 * In some cases, a matching Activity may not exist, so ensure you
740 * safeguard against this.
741 * <p>
742 * Input: Nothing.
743 * <p>
744 * Output: Nothing
745 * @see android.nfc.NfcAdapter#isNdefPushEnabled()
Martijn Coenen9b3c83f2011-07-28 11:21:39 -0500746 */
747 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
748 public static final String ACTION_NFCSHARING_SETTINGS =
749 "android.settings.NFCSHARING_SETTINGS";
750
Daniel Sandlerc08cd022012-11-27 22:47:37 -0500751 /**
Martijn Coenen62c196a2013-08-09 13:43:34 -0700752 * Activity Action: Show NFC Tap & Pay settings
753 * <p>
754 * This shows UI that allows the user to configure Tap&Pay
755 * settings.
756 * <p>
757 * In some cases, a matching Activity may not exist, so ensure you
758 * safeguard against this.
759 * <p>
760 * Input: Nothing.
761 * <p>
762 * Output: Nothing
763 */
764 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
765 public static final String ACTION_NFC_PAYMENT_SETTINGS =
766 "android.settings.NFC_PAYMENT_SETTINGS";
767
768 /**
Daniel Sandlerc08cd022012-11-27 22:47:37 -0500769 * Activity Action: Show Daydream settings.
770 * <p>
771 * In some cases, a matching Activity may not exist, so ensure you
772 * safeguard against this.
773 * <p>
774 * Input: Nothing.
775 * <p>
776 * Output: Nothing.
777 * @see android.service.dreams.DreamService
Daniel Sandlerc08cd022012-11-27 22:47:37 -0500778 */
779 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
780 public static final String ACTION_DREAM_SETTINGS = "android.settings.DREAM_SETTINGS";
781
Daniel Sandler5feceeb2013-03-22 18:29:23 -0700782 /**
783 * Activity Action: Show Notification listener settings.
784 * <p>
785 * In some cases, a matching Activity may not exist, so ensure you
786 * safeguard against this.
787 * <p>
788 * Input: Nothing.
789 * <p>
790 * Output: Nothing.
791 * @see android.service.notification.NotificationListenerService
Daniel Sandler5feceeb2013-03-22 18:29:23 -0700792 */
793 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
794 public static final String ACTION_NOTIFICATION_LISTENER_SETTINGS
Chris Wren8326a8a2014-10-22 14:13:32 -0400795 = "android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS";
Daniel Sandler5feceeb2013-03-22 18:29:23 -0700796
Alan Viverette69ce69b2013-08-29 12:23:48 -0700797 /**
John Spurlock7340fc82014-04-24 18:50:12 -0400798 * @hide
799 */
800 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
801 public static final String ACTION_CONDITION_PROVIDER_SETTINGS
802 = "android.settings.ACTION_CONDITION_PROVIDER_SETTINGS";
803
804 /**
Alan Viverette69ce69b2013-08-29 12:23:48 -0700805 * Activity Action: Show settings for video captioning.
806 * <p>
807 * In some cases, a matching Activity may not exist, so ensure you safeguard
808 * against this.
809 * <p>
810 * Input: Nothing.
811 * <p>
812 * Output: Nothing.
813 */
814 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
815 public static final String ACTION_CAPTIONING_SETTINGS = "android.settings.CAPTIONING_SETTINGS";
816
Svetoslav773f54d2013-09-03 14:01:43 -0700817 /**
818 * Activity Action: Show the top level print settings.
819 * <p>
820 * In some cases, a matching Activity may not exist, so ensure you
821 * safeguard against this.
822 * <p>
823 * Input: Nothing.
824 * <p>
825 * Output: Nothing.
826 */
827 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
828 public static final String ACTION_PRINT_SETTINGS =
829 "android.settings.ACTION_PRINT_SETTINGS";
830
John Spurlockde547002014-02-28 17:50:39 -0500831 /**
832 * Activity Action: Show Zen Mode configuration settings.
833 *
834 * @hide
835 */
836 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
837 public static final String ACTION_ZEN_MODE_SETTINGS = "android.settings.ZEN_MODE_SETTINGS";
838
Santos Cordona4c75242014-07-09 12:07:51 -0700839 /**
John Spurlockfc746f82015-04-03 13:47:14 -0400840 * Activity Action: Show Zen Mode priority configuration settings.
841 *
842 * @hide
843 */
844 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
845 public static final String ACTION_ZEN_MODE_PRIORITY_SETTINGS
846 = "android.settings.ZEN_MODE_PRIORITY_SETTINGS";
847
848 /**
John Spurlock7af10182015-04-03 15:10:31 -0400849 * Activity Action: Show Zen Mode automation configuration settings.
850 *
851 * @hide
852 */
853 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
854 public static final String ACTION_ZEN_MODE_AUTOMATION_SETTINGS
855 = "android.settings.ZEN_MODE_AUTOMATION_SETTINGS";
856
857 /**
Barnaby Jamesb3006d32015-04-02 17:49:54 -0700858 * Activity Action: Modify do not disturb mode settings.
859 * <p>
860 * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
861 * <p>
862 * This intent MUST be started using
863 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
864 * startVoiceActivity}.
865 * <p>
866 * Note: The Activity implementing this intent MUST verify that
867 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction}.
868 * returns true before modifying the setting.
869 * <p>
870 * Input: The optional {@link #EXTRA_DO_NOT_DISTURB_MODE_MINUTES} extra can be used to indicate
871 * how long the user wishes to avoid interruptions for. The optional
872 * {@link #EXTRA_DO_NOT_DISTURB_MODE_ENABLED} extra can be to indicate if the user is
873 * enabling or disabling do not disturb mode. If either extra is not included, the
874 * user maybe asked to provide the value.
875 * <p>
876 * Output: Nothing.
877 */
878 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
879 public static final String ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE =
880 "android.settings.VOICE_CONTROL_DO_NOT_DISTURB_MODE";
881
882 /**
John Spurlockb2278d62015-04-07 12:47:12 -0400883 * Activity Action: Show Zen Mode schedule rule configuration settings.
884 *
885 * @hide
886 */
887 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
888 public static final String ACTION_ZEN_MODE_SCHEDULE_RULE_SETTINGS
889 = "android.settings.ZEN_MODE_SCHEDULE_RULE_SETTINGS";
890
891 /**
Santos Cordona4c75242014-07-09 12:07:51 -0700892 * Activity Action: Show the regulatory information screen for the device.
893 * <p>
894 * In some cases, a matching Activity may not exist, so ensure you safeguard
895 * against this.
896 * <p>
897 * Input: Nothing.
898 * <p>
899 * Output: Nothing.
900 */
Jeff Sharkeydd77fda2014-04-16 17:23:08 -0700901 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
902 public static final String
903 ACTION_SHOW_REGULATORY_INFO = "android.settings.SHOW_REGULATORY_INFO";
904
Jerome Poichet7974cb32014-05-14 12:04:43 -0700905 /**
906 * Activity Action: Show Device Name Settings.
907 * <p>
908 * In some cases, a matching Activity may not exist, so ensure you safeguard
Tim Kilbourn87cd0dc2014-04-14 15:37:51 -0700909 * against this.
Jerome Poichet7974cb32014-05-14 12:04:43 -0700910 *
911 * @hide
912 */
913 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
914 public static final String DEVICE_NAME_SETTINGS = "android.settings.DEVICE_NAME";
915
Tim Kilbourn87cd0dc2014-04-14 15:37:51 -0700916 /**
917 * Activity Action: Show pairing settings.
918 * <p>
919 * In some cases, a matching Activity may not exist, so ensure you safeguard
920 * against this.
921 *
922 * @hide
923 */
924 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
925 public static final String ACTION_PAIRING_SETTINGS = "android.settings.PAIRING_SETTINGS";
926
John Spurlockf8f524c2014-06-10 14:47:29 -0400927 /**
928 * Activity Action: Show battery saver settings.
John Spurlock73466662014-10-30 13:42:05 -0400929 * <p>
930 * In some cases, a matching Activity may not exist, so ensure you safeguard
931 * against this.
John Spurlockf8f524c2014-06-10 14:47:29 -0400932 */
933 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
934 public static final String ACTION_BATTERY_SAVER_SETTINGS
935 = "android.settings.BATTERY_SAVER_SETTINGS";
936
Amith Yamasanieb7b94a2014-07-14 18:02:08 -0700937 /**
Barnaby Jamesb3006d32015-04-02 17:49:54 -0700938 * Activity Action: Modify Battery Saver mode setting using a voice command.
939 * <p>
940 * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
941 * <p>
942 * This intent MUST be started using
943 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
944 * startVoiceActivity}.
945 * <p>
946 * Note: The activity implementing this intent MUST verify that
947 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before
948 * modifying the setting.
949 * <p>
950 * Input: To tell which state batter saver mode should be set to, add the
951 * {@link #EXTRA_BATTERY_SAVER_MODE_ENABLED} extra to this Intent with the state specified.
952 * If the extra is not included, no changes will be made.
953 * <p>
954 * Output: Nothing.
955 */
956 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
957 public static final String ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE =
958 "android.settings.VOICE_CONTROL_BATTERY_SAVER_MODE";
959
960 /**
Amith Yamasanieb7b94a2014-07-14 18:02:08 -0700961 * Activity Action: Show Home selection settings. If there are multiple activities
962 * that can satisfy the {@link Intent#CATEGORY_HOME} intent, this screen allows you
963 * to pick your preferred activity.
964 */
965 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
966 public static final String ACTION_HOME_SETTINGS
967 = "android.settings.HOME_SETTINGS";
968
John Spurlock2b0e09c2014-07-27 13:27:47 -0400969 /**
970 * Activity Action: Show notification settings.
971 *
972 * @hide
973 */
974 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
975 public static final String ACTION_NOTIFICATION_SETTINGS
976 = "android.settings.NOTIFICATION_SETTINGS";
977
978 /**
979 * Activity Action: Show notification settings for a single app.
980 *
981 * @hide
982 */
983 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
984 public static final String ACTION_APP_NOTIFICATION_SETTINGS
985 = "android.settings.APP_NOTIFICATION_SETTINGS";
986
Chris Wrencd8f4f72014-08-27 18:48:13 -0400987 /**
988 * Activity Action: Show notification redaction settings.
989 *
990 * @hide
991 */
992 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
993 public static final String ACTION_APP_NOTIFICATION_REDACTION
994 = "android.settings.ACTION_APP_NOTIFICATION_REDACTION";
995
John Spurlock2b0e09c2014-07-27 13:27:47 -0400996 /** @hide */ public static final String EXTRA_APP_UID = "app_uid";
997 /** @hide */ public static final String EXTRA_APP_PACKAGE = "app_package";
998
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800999 // End of Intent actions for Settings
1000
Erikeebc8e22010-02-18 13:27:19 -08001001 /**
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001002 * @hide - Private call() method on SettingsProvider to read from 'system' table.
1003 */
1004 public static final String CALL_METHOD_GET_SYSTEM = "GET_system";
1005
1006 /**
1007 * @hide - Private call() method on SettingsProvider to read from 'secure' table.
1008 */
1009 public static final String CALL_METHOD_GET_SECURE = "GET_secure";
1010
1011 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001012 * @hide - Private call() method on SettingsProvider to read from 'global' table.
1013 */
1014 public static final String CALL_METHOD_GET_GLOBAL = "GET_global";
1015
1016 /**
1017 * @hide - User handle argument extra to the fast-path call()-based requests
1018 */
1019 public static final String CALL_METHOD_USER_KEY = "_user";
1020
1021 /** @hide - Private call() method to write to 'system' table */
1022 public static final String CALL_METHOD_PUT_SYSTEM = "PUT_system";
1023
1024 /** @hide - Private call() method to write to 'secure' table */
1025 public static final String CALL_METHOD_PUT_SECURE = "PUT_secure";
1026
1027 /** @hide - Private call() method to write to 'global' table */
1028 public static final String CALL_METHOD_PUT_GLOBAL= "PUT_global";
1029
1030 /**
Erikeebc8e22010-02-18 13:27:19 -08001031 * Activity Extra: Limit available options in launched activity based on the given authority.
1032 * <p>
1033 * This can be passed as an extra field in an Activity Intent with one or more syncable content
1034 * provider's authorities as a String[]. This field is used by some intents to alter the
1035 * behavior of the called activity.
1036 * <p>
1037 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types available based
1038 * on the authority given.
1039 */
Alon Albert50359c22013-02-26 14:47:48 -08001040 public static final String EXTRA_AUTHORITIES = "authorities";
1041
Alon Albertd35bf1f2013-04-18 14:26:51 -07001042 /**
1043 * Activity Extra: Limit available options in launched activity based on the given account
1044 * types.
1045 * <p>
1046 * This can be passed as an extra field in an Activity Intent with one or more account types
1047 * as a String[]. This field is used by some intents to alter the behavior of the called
1048 * activity.
1049 * <p>
1050 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types to the specified
1051 * list.
1052 */
Alon Albert50359c22013-02-26 14:47:48 -08001053 public static final String EXTRA_ACCOUNT_TYPES = "account_types";
Erikeebc8e22010-02-18 13:27:19 -08001054
Tadashi G. Takaoka25480202011-01-20 23:13:02 +09001055 public static final String EXTRA_INPUT_METHOD_ID = "input_method_id";
1056
Barnaby James48f35522014-07-16 14:27:39 -07001057 /**
Michael Wrightc93fbd12014-09-22 20:07:59 -07001058 * Activity Extra: The device identifier to act upon.
1059 * <p>
1060 * This can be passed as an extra field in an Activity Intent with a single
1061 * InputDeviceIdentifier. This field is used by some activities to jump straight into the
1062 * settings for the given device.
1063 * <p>
Dianne Hackbornad6a99b2014-11-18 10:11:10 -08001064 * Example: The {@link #ACTION_INPUT_METHOD_SETTINGS} intent opens the keyboard layout
1065 * dialog for the given device.
Michael Wrightc93fbd12014-09-22 20:07:59 -07001066 * @hide
1067 */
1068 public static final String EXTRA_INPUT_DEVICE_IDENTIFIER = "input_device_identifier";
1069
1070 /**
Barnaby James48f35522014-07-16 14:27:39 -07001071 * Activity Extra: Enable or disable Airplane Mode.
1072 * <p>
1073 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_AIRPLANE_MODE}
Barnaby Jamesb3006d32015-04-02 17:49:54 -07001074 * intent as a boolean to indicate if it should be enabled.
Barnaby James48f35522014-07-16 14:27:39 -07001075 */
1076 public static final String EXTRA_AIRPLANE_MODE_ENABLED = "airplane_mode_enabled";
1077
Barnaby Jamesb3006d32015-04-02 17:49:54 -07001078 /**
1079 * Activity Extra: Enable or disable Battery saver mode.
1080 * <p>
1081 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE}
1082 * intent as a boolean to indicate if it should be enabled.
1083 */
1084 public static final String EXTRA_BATTERY_SAVER_MODE_ENABLED =
1085 "android.settings.extra.battery_saver_mode_enabled";
1086
1087 /**
1088 * Activity Extra: Enable or disable Do Not Disturb mode.
1089 * <p>
1090 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE}
1091 * intent as a boolean to indicate if it should be enabled.
1092 */
1093 public static final String EXTRA_DO_NOT_DISTURB_MODE_ENABLED =
1094 "android.settings.extra.do_not_disturb_mode_enabled";
1095
1096 /**
1097 * Activity Extra: How many minutes to enable do not disturb mode for.
1098 * <p>
1099 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE}
1100 * intent to indicate how long do not disturb mode should be enabled for.
1101 */
1102 public static final String EXTRA_DO_NOT_DISTURB_MODE_MINUTES =
1103 "android.settings.extra.do_not_disturb_mode_minutes";
1104
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001105 private static final String JID_RESOURCE_PREFIX = "android";
1106
1107 public static final String AUTHORITY = "settings";
1108
1109 private static final String TAG = "Settings";
Christopher Tate06efb532012-08-24 15:29:27 -07001110 private static final boolean LOCAL_LOGV = false;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001111
David Christie3f7b6522013-08-06 19:19:08 -07001112 // Lock ensures that when enabling/disabling the master location switch, we don't end up
1113 // with a partial enable/disable state in multi-threaded situations.
1114 private static final Object mLocationSettingsLock = new Object();
1115
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001116 public static class SettingNotFoundException extends AndroidException {
1117 public SettingNotFoundException(String msg) {
1118 super(msg);
1119 }
1120 }
1121
1122 /**
1123 * Common base for tables of name/value settings.
1124 */
1125 public static class NameValueTable implements BaseColumns {
1126 public static final String NAME = "name";
1127 public static final String VALUE = "value";
1128
1129 protected static boolean putString(ContentResolver resolver, Uri uri,
1130 String name, String value) {
1131 // The database will take care of replacing duplicates.
1132 try {
1133 ContentValues values = new ContentValues();
1134 values.put(NAME, name);
1135 values.put(VALUE, value);
1136 resolver.insert(uri, values);
1137 return true;
1138 } catch (SQLException e) {
Dianne Hackborna33e3f72009-09-29 17:28:24 -07001139 Log.w(TAG, "Can't set key " + name + " in " + uri, e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001140 return false;
1141 }
1142 }
1143
1144 public static Uri getUriFor(Uri uri, String name) {
1145 return Uri.withAppendedPath(uri, name);
1146 }
1147 }
1148
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001149 // Thread-safe.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001150 private static class NameValueCache {
1151 private final String mVersionSystemProperty;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001152 private final Uri mUri;
1153
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001154 private static final String[] SELECT_VALUE =
1155 new String[] { Settings.NameValueTable.VALUE };
1156 private static final String NAME_EQ_PLACEHOLDER = "name=?";
1157
1158 // Must synchronize on 'this' to access mValues and mValuesVersion.
Dan Egnor799f7212009-11-24 16:24:44 -08001159 private final HashMap<String, String> mValues = new HashMap<String, String>();
1160 private long mValuesVersion = 0;
1161
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001162 // Initially null; set lazily and held forever. Synchronized on 'this'.
1163 private IContentProvider mContentProvider = null;
1164
1165 // The method we'll call (or null, to not use) on the provider
1166 // for the fast path of retrieving settings.
Christopher Tate06efb532012-08-24 15:29:27 -07001167 private final String mCallGetCommand;
1168 private final String mCallSetCommand;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001169
Christopher Tate06efb532012-08-24 15:29:27 -07001170 public NameValueCache(String versionSystemProperty, Uri uri,
1171 String getCommand, String setCommand) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001172 mVersionSystemProperty = versionSystemProperty;
1173 mUri = uri;
Christopher Tate06efb532012-08-24 15:29:27 -07001174 mCallGetCommand = getCommand;
1175 mCallSetCommand = setCommand;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001176 }
1177
Christopher Tate06efb532012-08-24 15:29:27 -07001178 private IContentProvider lazyGetProvider(ContentResolver cr) {
1179 IContentProvider cp = null;
1180 synchronized (this) {
1181 cp = mContentProvider;
1182 if (cp == null) {
1183 cp = mContentProvider = cr.acquireProvider(mUri.getAuthority());
1184 }
1185 }
1186 return cp;
1187 }
1188
1189 public boolean putStringForUser(ContentResolver cr, String name, String value,
1190 final int userHandle) {
1191 try {
1192 Bundle arg = new Bundle();
1193 arg.putString(Settings.NameValueTable.VALUE, value);
Christopher Tated5fe1472012-09-10 15:48:38 -07001194 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
Christopher Tate06efb532012-08-24 15:29:27 -07001195 IContentProvider cp = lazyGetProvider(cr);
Dianne Hackborn35654b62013-01-14 17:38:02 -08001196 cp.call(cr.getPackageName(), mCallSetCommand, name, arg);
Christopher Tate06efb532012-08-24 15:29:27 -07001197 } catch (RemoteException e) {
1198 Log.w(TAG, "Can't set key " + name + " in " + mUri, e);
1199 return false;
1200 }
1201 return true;
1202 }
1203
Christopher Tate06efb532012-08-24 15:29:27 -07001204 public String getStringForUser(ContentResolver cr, String name, final int userHandle) {
Christopher Tate78d2a662012-09-13 16:19:44 -07001205 final boolean isSelf = (userHandle == UserHandle.myUserId());
1206 if (isSelf) {
1207 long newValuesVersion = SystemProperties.getLong(mVersionSystemProperty, 0);
Dan Egnor799f7212009-11-24 16:24:44 -08001208
Christopher Tate78d2a662012-09-13 16:19:44 -07001209 // Our own user's settings data uses a client-side cache
1210 synchronized (this) {
1211 if (mValuesVersion != newValuesVersion) {
1212 if (LOCAL_LOGV || false) {
1213 Log.v(TAG, "invalidate [" + mUri.getLastPathSegment() + "]: current "
1214 + newValuesVersion + " != cached " + mValuesVersion);
1215 }
1216
1217 mValues.clear();
1218 mValuesVersion = newValuesVersion;
Dan Egnor799f7212009-11-24 16:24:44 -08001219 }
1220
Christopher Tate78d2a662012-09-13 16:19:44 -07001221 if (mValues.containsKey(name)) {
1222 return mValues.get(name); // Could be null, that's OK -- negative caching
1223 }
Dan Egnor799f7212009-11-24 16:24:44 -08001224 }
Christopher Tate78d2a662012-09-13 16:19:44 -07001225 } else {
1226 if (LOCAL_LOGV) Log.v(TAG, "get setting for user " + userHandle
1227 + " by user " + UserHandle.myUserId() + " so skipping cache");
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001228 }
Dan Egnor799f7212009-11-24 16:24:44 -08001229
Christopher Tate06efb532012-08-24 15:29:27 -07001230 IContentProvider cp = lazyGetProvider(cr);
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001231
1232 // Try the fast path first, not using query(). If this
1233 // fails (alternate Settings provider that doesn't support
1234 // this interface?) then we fall back to the query/table
1235 // interface.
Christopher Tate06efb532012-08-24 15:29:27 -07001236 if (mCallGetCommand != null) {
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001237 try {
Christopher Tate06efb532012-08-24 15:29:27 -07001238 Bundle args = null;
Christopher Tate5e08af02012-09-21 17:17:22 -07001239 if (!isSelf) {
Christopher Tate06efb532012-08-24 15:29:27 -07001240 args = new Bundle();
1241 args.putInt(CALL_METHOD_USER_KEY, userHandle);
1242 }
Dianne Hackborn35654b62013-01-14 17:38:02 -08001243 Bundle b = cp.call(cr.getPackageName(), mCallGetCommand, name, args);
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001244 if (b != null) {
1245 String value = b.getPairValue();
Christopher Tate78d2a662012-09-13 16:19:44 -07001246 // Don't update our cache for reads of other users' data
1247 if (isSelf) {
1248 synchronized (this) {
1249 mValues.put(name, value);
1250 }
1251 } else {
1252 if (LOCAL_LOGV) Log.i(TAG, "call-query of user " + userHandle
1253 + " by " + UserHandle.myUserId()
1254 + " so not updating cache");
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001255 }
1256 return value;
1257 }
1258 // If the response Bundle is null, we fall through
1259 // to the query interface below.
1260 } catch (RemoteException e) {
1261 // Not supported by the remote side? Fall through
1262 // to query().
1263 }
1264 }
1265
Dan Egnor799f7212009-11-24 16:24:44 -08001266 Cursor c = null;
1267 try {
Dianne Hackborn35654b62013-01-14 17:38:02 -08001268 c = cp.query(cr.getPackageName(), mUri, SELECT_VALUE, NAME_EQ_PLACEHOLDER,
Jeff Brown75ea64f2012-01-25 19:37:13 -08001269 new String[]{name}, null, null);
Dan Egnor799f7212009-11-24 16:24:44 -08001270 if (c == null) {
1271 Log.w(TAG, "Can't get key " + name + " from " + mUri);
1272 return null;
1273 }
1274
1275 String value = c.moveToNext() ? c.getString(0) : null;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001276 synchronized (this) {
Dan Egnor799f7212009-11-24 16:24:44 -08001277 mValues.put(name, value);
1278 }
1279 if (LOCAL_LOGV) {
1280 Log.v(TAG, "cache miss [" + mUri.getLastPathSegment() + "]: " +
1281 name + " = " + (value == null ? "(null)" : value));
1282 }
1283 return value;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001284 } catch (RemoteException e) {
Dan Egnor799f7212009-11-24 16:24:44 -08001285 Log.w(TAG, "Can't get key " + name + " from " + mUri, e);
1286 return null; // Return null, but don't cache it.
1287 } finally {
1288 if (c != null) c.close();
1289 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001290 }
1291 }
1292
1293 /**
1294 * System settings, containing miscellaneous system preferences. This
1295 * table holds simple name/value pairs. There are convenience
1296 * functions for accessing individual settings entries.
1297 */
1298 public static final class System extends NameValueTable {
1299 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_system_version";
1300
Svetoslav683914b2015-01-15 14:22:26 -08001301 /** @hide */
1302 public static interface Validator {
1303 public boolean validate(String value);
1304 }
1305
Dianne Hackborn139748f2012-09-24 11:36:57 -07001306 /**
1307 * The content:// style URL for this table
1308 */
1309 public static final Uri CONTENT_URI =
1310 Uri.parse("content://" + AUTHORITY + "/system");
1311
1312 private static final NameValueCache sNameValueCache = new NameValueCache(
1313 SYS_PROP_SETTING_VERSION,
1314 CONTENT_URI,
1315 CALL_METHOD_GET_SYSTEM,
1316 CALL_METHOD_PUT_SYSTEM);
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001317
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001318 private static final HashSet<String> MOVED_TO_SECURE;
1319 static {
1320 MOVED_TO_SECURE = new HashSet<String>(30);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001321 MOVED_TO_SECURE.add(Secure.ANDROID_ID);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001322 MOVED_TO_SECURE.add(Secure.HTTP_PROXY);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001323 MOVED_TO_SECURE.add(Secure.LOCATION_PROVIDERS_ALLOWED);
Danielle Millett925a7d82012-03-19 18:02:20 -04001324 MOVED_TO_SECURE.add(Secure.LOCK_BIOMETRIC_WEAK_FLAGS);
Amith Yamasani156c4352010-03-05 17:10:03 -08001325 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_ENABLED);
1326 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_VISIBLE);
1327 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001328 MOVED_TO_SECURE.add(Secure.LOGGING_ID);
1329 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_ENABLED);
1330 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_LAST_UPDATE);
1331 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_REDIRECT_URL);
1332 MOVED_TO_SECURE.add(Secure.SETTINGS_CLASSNAME);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001333 MOVED_TO_SECURE.add(Secure.USE_GOOGLE_MAIL);
1334 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
1335 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
1336 MOVED_TO_SECURE.add(Secure.WIFI_NUM_OPEN_NETWORKS_KEPT);
1337 MOVED_TO_SECURE.add(Secure.WIFI_ON);
1338 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE);
1339 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_AP_COUNT);
1340 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS);
1341 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED);
1342 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS);
1343 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT);
1344 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_MAX_AP_CHECKS);
1345 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ON);
1346 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_COUNT);
1347 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_DELAY_MS);
1348 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS);
Christopher Tateaa036a22014-05-19 16:33:27 -07001349
1350 // At one time in System, then Global, but now back in Secure
1351 MOVED_TO_SECURE.add(Secure.INSTALL_NON_MARKET_APPS);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001352 }
1353
Christopher Tate06efb532012-08-24 15:29:27 -07001354 private static final HashSet<String> MOVED_TO_GLOBAL;
Christopher Tate66488d62012-10-02 11:58:01 -07001355 private static final HashSet<String> MOVED_TO_SECURE_THEN_GLOBAL;
Christopher Tate06efb532012-08-24 15:29:27 -07001356 static {
1357 MOVED_TO_GLOBAL = new HashSet<String>();
Christopher Tate66488d62012-10-02 11:58:01 -07001358 MOVED_TO_SECURE_THEN_GLOBAL = new HashSet<String>();
1359
Christopher Tate92198742012-09-07 12:00:13 -07001360 // these were originally in system but migrated to secure in the past,
1361 // so are duplicated in the Secure.* namespace
Christopher Tate66488d62012-10-02 11:58:01 -07001362 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.ADB_ENABLED);
1363 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.BLUETOOTH_ON);
1364 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DATA_ROAMING);
1365 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DEVICE_PROVISIONED);
Christopher Tate66488d62012-10-02 11:58:01 -07001366 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.USB_MASS_STORAGE_ENABLED);
1367 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.HTTP_PROXY);
Christopher Tate06efb532012-08-24 15:29:27 -07001368
Christopher Tate92198742012-09-07 12:00:13 -07001369 // these are moving directly from system to global
Christopher Tate06efb532012-08-24 15:29:27 -07001370 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_ON);
1371 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_RADIOS);
1372 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS);
1373 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME);
1374 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME_ZONE);
1375 MOVED_TO_GLOBAL.add(Settings.Global.CAR_DOCK_SOUND);
1376 MOVED_TO_GLOBAL.add(Settings.Global.CAR_UNDOCK_SOUND);
1377 MOVED_TO_GLOBAL.add(Settings.Global.DESK_DOCK_SOUND);
1378 MOVED_TO_GLOBAL.add(Settings.Global.DESK_UNDOCK_SOUND);
1379 MOVED_TO_GLOBAL.add(Settings.Global.DOCK_SOUNDS_ENABLED);
1380 MOVED_TO_GLOBAL.add(Settings.Global.LOCK_SOUND);
1381 MOVED_TO_GLOBAL.add(Settings.Global.UNLOCK_SOUND);
1382 MOVED_TO_GLOBAL.add(Settings.Global.LOW_BATTERY_SOUND);
1383 MOVED_TO_GLOBAL.add(Settings.Global.POWER_SOUNDS_ENABLED);
1384 MOVED_TO_GLOBAL.add(Settings.Global.STAY_ON_WHILE_PLUGGED_IN);
1385 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SLEEP_POLICY);
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07001386 MOVED_TO_GLOBAL.add(Settings.Global.MODE_RINGER);
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001387 MOVED_TO_GLOBAL.add(Settings.Global.WINDOW_ANIMATION_SCALE);
1388 MOVED_TO_GLOBAL.add(Settings.Global.TRANSITION_ANIMATION_SCALE);
1389 MOVED_TO_GLOBAL.add(Settings.Global.ANIMATOR_DURATION_SCALE);
1390 MOVED_TO_GLOBAL.add(Settings.Global.FANCY_IME_ANIMATIONS);
1391 MOVED_TO_GLOBAL.add(Settings.Global.COMPATIBILITY_MODE);
1392 MOVED_TO_GLOBAL.add(Settings.Global.EMERGENCY_TONE);
1393 MOVED_TO_GLOBAL.add(Settings.Global.CALL_AUTO_RETRY);
1394 MOVED_TO_GLOBAL.add(Settings.Global.DEBUG_APP);
1395 MOVED_TO_GLOBAL.add(Settings.Global.WAIT_FOR_DEBUGGER);
1396 MOVED_TO_GLOBAL.add(Settings.Global.SHOW_PROCESSES);
1397 MOVED_TO_GLOBAL.add(Settings.Global.ALWAYS_FINISH_ACTIVITIES);
Geremy Condraa0735112013-03-26 21:49:26 -07001398 MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_CONTENT_URL);
1399 MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_METADATA_URL);
1400 MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_CONTENT_URL);
1401 MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_METADATA_URL);
1402 MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_CONTENT_URL);
1403 MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_METADATA_URL);
1404 MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_CONTENT_URL);
1405 MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_METADATA_URL);
Christopher Tate06efb532012-08-24 15:29:27 -07001406 }
1407
Svetoslav683914b2015-01-15 14:22:26 -08001408 private static final Validator sBooleanValidator =
1409 new DiscreteValueValidator(new String[] {"0", "1"});
1410
1411 private static final Validator sNonNegativeIntegerValidator = new Validator() {
1412 @Override
1413 public boolean validate(String value) {
1414 try {
1415 return Integer.parseInt(value) >= 0;
1416 } catch (NumberFormatException e) {
1417 return false;
1418 }
1419 }
1420 };
1421
Svetoslav683914b2015-01-15 14:22:26 -08001422 private static final Validator sUriValidator = new Validator() {
1423 @Override
1424 public boolean validate(String value) {
1425 try {
1426 Uri.decode(value);
1427 return true;
1428 } catch (IllegalArgumentException e) {
1429 return false;
1430 }
1431 }
1432 };
1433
1434 private static final Validator sLenientIpAddressValidator = new Validator() {
1435 private static final int MAX_IPV6_LENGTH = 45;
1436
1437 @Override
1438 public boolean validate(String value) {
1439 return value.length() <= MAX_IPV6_LENGTH;
1440 }
1441 };
1442
Christopher Tate66488d62012-10-02 11:58:01 -07001443 /** @hide */
Svetoslav683914b2015-01-15 14:22:26 -08001444 public static void getMovedToGlobalSettings(Set<String> outKeySet) {
Christopher Tate66488d62012-10-02 11:58:01 -07001445 outKeySet.addAll(MOVED_TO_GLOBAL);
1446 outKeySet.addAll(MOVED_TO_SECURE_THEN_GLOBAL);
1447 }
1448
1449 /** @hide */
Svetoslav683914b2015-01-15 14:22:26 -08001450 public static void getMovedToSecureSettings(Set<String> outKeySet) {
1451 outKeySet.addAll(MOVED_TO_SECURE);
1452 }
1453
1454 /** @hide */
Christopher Tate66488d62012-10-02 11:58:01 -07001455 public static void getNonLegacyMovedKeys(HashSet<String> outKeySet) {
1456 outKeySet.addAll(MOVED_TO_GLOBAL);
1457 }
1458
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001459 /**
1460 * Look up a name in the database.
1461 * @param resolver to access the database with
1462 * @param name to look up in the table
1463 * @return the corresponding value, or null if not present
1464 */
Dianne Hackborn139748f2012-09-24 11:36:57 -07001465 public static String getString(ContentResolver resolver, String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07001466 return getStringForUser(resolver, name, UserHandle.myUserId());
1467 }
1468
1469 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -07001470 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -07001471 int userHandle) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001472 if (MOVED_TO_SECURE.contains(name)) {
1473 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1474 + " to android.provider.Settings.Secure, returning read-only value.");
Christopher Tate06efb532012-08-24 15:29:27 -07001475 return Secure.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001476 }
Christopher Tate66488d62012-10-02 11:58:01 -07001477 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07001478 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1479 + " to android.provider.Settings.Global, returning read-only value.");
1480 return Global.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001481 }
Christopher Tate06efb532012-08-24 15:29:27 -07001482 return sNameValueCache.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001483 }
1484
1485 /**
1486 * Store a name/value pair into the database.
1487 * @param resolver to access the database with
1488 * @param name to store
1489 * @param value to associate with the name
1490 * @return true if the value was set, false on database errors
1491 */
1492 public static boolean putString(ContentResolver resolver, String name, String value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001493 return putStringForUser(resolver, name, value, UserHandle.myUserId());
1494 }
1495
1496 /** @hide */
1497 public static boolean putStringForUser(ContentResolver resolver, String name, String value,
1498 int userHandle) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001499 if (MOVED_TO_SECURE.contains(name)) {
1500 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1501 + " to android.provider.Settings.Secure, value is unchanged.");
1502 return false;
1503 }
Christopher Tate66488d62012-10-02 11:58:01 -07001504 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07001505 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1506 + " to android.provider.Settings.Global, value is unchanged.");
1507 return false;
1508 }
Christopher Tate06efb532012-08-24 15:29:27 -07001509 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001510 }
1511
1512 /**
1513 * Construct the content URI for a particular name/value pair,
1514 * useful for monitoring changes with a ContentObserver.
1515 * @param name to look up in the table
1516 * @return the corresponding content URI, or null if not present
1517 */
1518 public static Uri getUriFor(String name) {
1519 if (MOVED_TO_SECURE.contains(name)) {
1520 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1521 + " to android.provider.Settings.Secure, returning Secure URI.");
1522 return Secure.getUriFor(Secure.CONTENT_URI, name);
1523 }
Christopher Tate66488d62012-10-02 11:58:01 -07001524 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07001525 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1526 + " to android.provider.Settings.Global, returning read-only global URI.");
1527 return Global.getUriFor(Global.CONTENT_URI, name);
1528 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001529 return getUriFor(CONTENT_URI, name);
1530 }
1531
1532 /**
1533 * Convenience function for retrieving a single system settings value
1534 * as an integer. Note that internally setting values are always
1535 * stored as strings; this function converts the string to an integer
1536 * for you. The default value will be returned if the setting is
1537 * not defined or not an integer.
1538 *
1539 * @param cr The ContentResolver to access.
1540 * @param name The name of the setting to retrieve.
1541 * @param def Value to return if the setting is not defined.
1542 *
1543 * @return The setting's current value, or 'def' if it is not defined
1544 * or not a valid integer.
1545 */
1546 public static int getInt(ContentResolver cr, String name, int def) {
Christopher Tate06efb532012-08-24 15:29:27 -07001547 return getIntForUser(cr, name, def, UserHandle.myUserId());
1548 }
1549
1550 /** @hide */
1551 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
1552 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001553 try {
1554 return v != null ? Integer.parseInt(v) : def;
1555 } catch (NumberFormatException e) {
1556 return def;
1557 }
1558 }
1559
1560 /**
1561 * Convenience function for retrieving a single system settings value
1562 * as an integer. Note that internally setting values are always
1563 * stored as strings; this function converts the string to an integer
1564 * for you.
1565 * <p>
1566 * This version does not take a default value. If the setting has not
1567 * been set, or the string value is not a number,
1568 * it throws {@link SettingNotFoundException}.
1569 *
1570 * @param cr The ContentResolver to access.
1571 * @param name The name of the setting to retrieve.
1572 *
1573 * @throws SettingNotFoundException Thrown if a setting by the given
1574 * name can't be found or the setting value is not an integer.
1575 *
1576 * @return The setting's current value.
1577 */
1578 public static int getInt(ContentResolver cr, String name)
1579 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07001580 return getIntForUser(cr, name, UserHandle.myUserId());
1581 }
1582
1583 /** @hide */
1584 public static int getIntForUser(ContentResolver cr, String name, int userHandle)
1585 throws SettingNotFoundException {
1586 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001587 try {
1588 return Integer.parseInt(v);
1589 } catch (NumberFormatException e) {
1590 throw new SettingNotFoundException(name);
1591 }
1592 }
1593
1594 /**
1595 * Convenience function for updating a single settings value as an
1596 * integer. This will either create a new entry in the table if the
1597 * given name does not exist, or modify the value of the existing row
1598 * with that name. Note that internally setting values are always
1599 * stored as strings, so this function converts the given value to a
1600 * string before storing it.
1601 *
1602 * @param cr The ContentResolver to access.
1603 * @param name The name of the setting to modify.
1604 * @param value The new value for the setting.
1605 * @return true if the value was set, false on database errors
1606 */
1607 public static boolean putInt(ContentResolver cr, String name, int value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001608 return putIntForUser(cr, name, value, UserHandle.myUserId());
1609 }
1610
1611 /** @hide */
1612 public static boolean putIntForUser(ContentResolver cr, String name, int value,
1613 int userHandle) {
1614 return putStringForUser(cr, name, Integer.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001615 }
1616
1617 /**
1618 * Convenience function for retrieving a single system settings value
1619 * as a {@code long}. Note that internally setting values are always
1620 * stored as strings; this function converts the string to a {@code long}
1621 * for you. The default value will be returned if the setting is
1622 * not defined or not a {@code long}.
1623 *
1624 * @param cr The ContentResolver to access.
1625 * @param name The name of the setting to retrieve.
1626 * @param def Value to return if the setting is not defined.
1627 *
1628 * @return The setting's current value, or 'def' if it is not defined
1629 * or not a valid {@code long}.
1630 */
1631 public static long getLong(ContentResolver cr, String name, long def) {
Christopher Tate06efb532012-08-24 15:29:27 -07001632 return getLongForUser(cr, name, def, UserHandle.myUserId());
1633 }
1634
1635 /** @hide */
1636 public static long getLongForUser(ContentResolver cr, String name, long def,
1637 int userHandle) {
1638 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001639 long value;
1640 try {
1641 value = valString != null ? Long.parseLong(valString) : def;
1642 } catch (NumberFormatException e) {
1643 value = def;
1644 }
1645 return value;
1646 }
1647
1648 /**
1649 * Convenience function for retrieving a single system settings value
1650 * as a {@code long}. Note that internally setting values are always
1651 * stored as strings; this function converts the string to a {@code long}
1652 * for you.
1653 * <p>
1654 * This version does not take a default value. If the setting has not
1655 * been set, or the string value is not a number,
1656 * it throws {@link SettingNotFoundException}.
1657 *
1658 * @param cr The ContentResolver to access.
1659 * @param name The name of the setting to retrieve.
1660 *
1661 * @return The setting's current value.
1662 * @throws SettingNotFoundException Thrown if a setting by the given
1663 * name can't be found or the setting value is not an integer.
1664 */
1665 public static long getLong(ContentResolver cr, String name)
1666 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07001667 return getLongForUser(cr, name, UserHandle.myUserId());
1668 }
1669
1670 /** @hide */
1671 public static long getLongForUser(ContentResolver cr, String name, int userHandle)
1672 throws SettingNotFoundException {
1673 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001674 try {
1675 return Long.parseLong(valString);
1676 } catch (NumberFormatException e) {
1677 throw new SettingNotFoundException(name);
1678 }
1679 }
1680
1681 /**
1682 * Convenience function for updating a single settings value as a long
1683 * integer. This will either create a new entry in the table if the
1684 * given name does not exist, or modify the value of the existing row
1685 * with that name. Note that internally setting values are always
1686 * stored as strings, so this function converts the given value to a
1687 * string before storing it.
1688 *
1689 * @param cr The ContentResolver to access.
1690 * @param name The name of the setting to modify.
1691 * @param value The new value for the setting.
1692 * @return true if the value was set, false on database errors
1693 */
1694 public static boolean putLong(ContentResolver cr, String name, long value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001695 return putLongForUser(cr, name, value, UserHandle.myUserId());
1696 }
1697
1698 /** @hide */
1699 public static boolean putLongForUser(ContentResolver cr, String name, long value,
1700 int userHandle) {
1701 return putStringForUser(cr, name, Long.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001702 }
1703
1704 /**
1705 * Convenience function for retrieving a single system settings value
1706 * as a floating point number. Note that internally setting values are
1707 * always stored as strings; this function converts the string to an
1708 * float for you. The default value will be returned if the setting
1709 * is not defined or not a valid float.
1710 *
1711 * @param cr The ContentResolver to access.
1712 * @param name The name of the setting to retrieve.
1713 * @param def Value to return if the setting is not defined.
1714 *
1715 * @return The setting's current value, or 'def' if it is not defined
1716 * or not a valid float.
1717 */
1718 public static float getFloat(ContentResolver cr, String name, float def) {
Christopher Tate06efb532012-08-24 15:29:27 -07001719 return getFloatForUser(cr, name, def, UserHandle.myUserId());
1720 }
1721
1722 /** @hide */
1723 public static float getFloatForUser(ContentResolver cr, String name, float def,
1724 int userHandle) {
1725 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001726 try {
1727 return v != null ? Float.parseFloat(v) : def;
1728 } catch (NumberFormatException e) {
1729 return def;
1730 }
1731 }
1732
1733 /**
1734 * Convenience function for retrieving a single system settings value
1735 * as a float. Note that internally setting values are always
1736 * stored as strings; this function converts the string to a float
1737 * for you.
1738 * <p>
1739 * This version does not take a default value. If the setting has not
1740 * been set, or the string value is not a number,
1741 * it throws {@link SettingNotFoundException}.
1742 *
1743 * @param cr The ContentResolver to access.
1744 * @param name The name of the setting to retrieve.
1745 *
1746 * @throws SettingNotFoundException Thrown if a setting by the given
1747 * name can't be found or the setting value is not a float.
1748 *
1749 * @return The setting's current value.
1750 */
1751 public static float getFloat(ContentResolver cr, String name)
1752 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07001753 return getFloatForUser(cr, name, UserHandle.myUserId());
1754 }
1755
1756 /** @hide */
1757 public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
1758 throws SettingNotFoundException {
1759 String v = getStringForUser(cr, name, userHandle);
Brian Muramatsue1d46982010-12-06 17:34:20 -08001760 if (v == null) {
1761 throw new SettingNotFoundException(name);
1762 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001763 try {
1764 return Float.parseFloat(v);
1765 } catch (NumberFormatException e) {
1766 throw new SettingNotFoundException(name);
1767 }
1768 }
1769
1770 /**
1771 * Convenience function for updating a single settings value as a
1772 * floating point number. This will either create a new entry in the
1773 * table if the given name does not exist, or modify the value of the
1774 * existing row with that name. Note that internally setting values
1775 * are always stored as strings, so this function converts the given
1776 * value to a string before storing it.
1777 *
1778 * @param cr The ContentResolver to access.
1779 * @param name The name of the setting to modify.
1780 * @param value The new value for the setting.
1781 * @return true if the value was set, false on database errors
1782 */
1783 public static boolean putFloat(ContentResolver cr, String name, float value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001784 return putFloatForUser(cr, name, value, UserHandle.myUserId());
1785 }
1786
1787 /** @hide */
1788 public static boolean putFloatForUser(ContentResolver cr, String name, float value,
1789 int userHandle) {
1790 return putStringForUser(cr, name, Float.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001791 }
1792
1793 /**
1794 * Convenience function to read all of the current
1795 * configuration-related settings into a
1796 * {@link Configuration} object.
1797 *
1798 * @param cr The ContentResolver to access.
1799 * @param outConfig Where to place the configuration settings.
1800 */
1801 public static void getConfiguration(ContentResolver cr, Configuration outConfig) {
Christopher Tate06efb532012-08-24 15:29:27 -07001802 getConfigurationForUser(cr, outConfig, UserHandle.myUserId());
1803 }
1804
1805 /** @hide */
1806 public static void getConfigurationForUser(ContentResolver cr, Configuration outConfig,
1807 int userHandle) {
1808 outConfig.fontScale = Settings.System.getFloatForUser(
1809 cr, FONT_SCALE, outConfig.fontScale, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001810 if (outConfig.fontScale < 0) {
1811 outConfig.fontScale = 1;
1812 }
1813 }
1814
1815 /**
Dianne Hackborn31ca8542011-07-19 14:58:28 -07001816 * @hide Erase the fields in the Configuration that should be applied
1817 * by the settings.
1818 */
1819 public static void clearConfiguration(Configuration inoutConfig) {
1820 inoutConfig.fontScale = 0;
1821 }
Narayan Kamath6d632962011-08-24 11:51:37 +01001822
Dianne Hackborn31ca8542011-07-19 14:58:28 -07001823 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001824 * Convenience function to write a batch of configuration-related
1825 * settings from a {@link Configuration} object.
1826 *
1827 * @param cr The ContentResolver to access.
1828 * @param config The settings to write.
1829 * @return true if the values were set, false on database errors
1830 */
1831 public static boolean putConfiguration(ContentResolver cr, Configuration config) {
Christopher Tate06efb532012-08-24 15:29:27 -07001832 return putConfigurationForUser(cr, config, UserHandle.myUserId());
1833 }
1834
1835 /** @hide */
1836 public static boolean putConfigurationForUser(ContentResolver cr, Configuration config,
1837 int userHandle) {
1838 return Settings.System.putFloatForUser(cr, FONT_SCALE, config.fontScale, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001839 }
1840
Dianne Hackbornb8b11a02010-03-10 15:53:11 -08001841 /** @hide */
1842 public static boolean hasInterestingConfigurationChanges(int changes) {
1843 return (changes&ActivityInfo.CONFIG_FONT_SCALE) != 0;
1844 }
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07001845
Christopher Tate06efb532012-08-24 15:29:27 -07001846 /** @deprecated - Do not use */
1847 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001848 public static boolean getShowGTalkServiceStatus(ContentResolver cr) {
Christopher Tate06efb532012-08-24 15:29:27 -07001849 return getShowGTalkServiceStatusForUser(cr, UserHandle.myUserId());
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001850 }
1851
Christopher Tate06efb532012-08-24 15:29:27 -07001852 /**
1853 * @hide
1854 * @deprecated - Do not use
1855 */
1856 public static boolean getShowGTalkServiceStatusForUser(ContentResolver cr,
1857 int userHandle) {
1858 return getIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, 0, userHandle) != 0;
1859 }
1860
1861 /** @deprecated - Do not use */
1862 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001863 public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag) {
Christopher Tatec8c08382012-09-19 17:18:18 -07001864 setShowGTalkServiceStatusForUser(cr, flag, UserHandle.myUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07001865 }
1866
1867 /**
1868 * @hide
1869 * @deprecated - Do not use
1870 */
1871 @Deprecated
1872 public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean flag,
1873 int userHandle) {
1874 putIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, flag ? 1 : 0, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001875 }
1876
Svetoslav683914b2015-01-15 14:22:26 -08001877 private static final class DiscreteValueValidator implements Validator {
1878 private final String[] mValues;
1879
1880 public DiscreteValueValidator(String[] values) {
1881 mValues = values;
1882 }
1883
Svetoslav1b71ea92015-02-17 18:20:29 -08001884 @Override
Svetoslav683914b2015-01-15 14:22:26 -08001885 public boolean validate(String value) {
1886 return ArrayUtils.contains(mValues, value);
1887 }
1888 }
1889
1890 private static final class InclusiveIntegerRangeValidator implements Validator {
1891 private final int mMin;
1892 private final int mMax;
1893
1894 public InclusiveIntegerRangeValidator(int min, int max) {
1895 mMin = min;
1896 mMax = max;
1897 }
1898
Svetoslav1b71ea92015-02-17 18:20:29 -08001899 @Override
Svetoslav683914b2015-01-15 14:22:26 -08001900 public boolean validate(String value) {
1901 try {
1902 final int intValue = Integer.parseInt(value);
1903 return intValue >= mMin && intValue <= mMax;
1904 } catch (NumberFormatException e) {
1905 return false;
1906 }
1907 }
1908 }
1909
1910 private static final class InclusiveFloatRangeValidator implements Validator {
1911 private final float mMin;
1912 private final float mMax;
1913
1914 public InclusiveFloatRangeValidator(float min, float max) {
1915 mMin = min;
1916 mMax = max;
1917 }
1918
Svetoslav1b71ea92015-02-17 18:20:29 -08001919 @Override
Svetoslav683914b2015-01-15 14:22:26 -08001920 public boolean validate(String value) {
1921 try {
1922 final float floatValue = Float.parseFloat(value);
1923 return floatValue >= mMin && floatValue <= mMax;
1924 } catch (NumberFormatException e) {
1925 return false;
1926 }
1927 }
1928 }
1929
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001930 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001931 * @deprecated Use {@link android.provider.Settings.Global#STAY_ON_WHILE_PLUGGED_IN} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001932 */
Christopher Tate06efb532012-08-24 15:29:27 -07001933 @Deprecated
1934 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 -08001935
1936 /**
1937 * What happens when the user presses the end call button if they're not
1938 * on a call.<br/>
1939 * <b>Values:</b><br/>
1940 * 0 - The end button does nothing.<br/>
1941 * 1 - The end button goes to the home screen.<br/>
1942 * 2 - The end button puts the device to sleep and locks the keyguard.<br/>
1943 * 3 - The end button goes to the home screen. If the user is already on the
1944 * home screen, it puts the device to sleep.
1945 */
1946 public static final String END_BUTTON_BEHAVIOR = "end_button_behavior";
1947
Svetoslav683914b2015-01-15 14:22:26 -08001948 private static final Validator END_BUTTON_BEHAVIOR_VALIDATOR =
1949 new InclusiveIntegerRangeValidator(0, 3);
1950
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001951 /**
David Brown458e8062010-03-08 21:52:11 -08001952 * END_BUTTON_BEHAVIOR value for "go home".
1953 * @hide
1954 */
1955 public static final int END_BUTTON_BEHAVIOR_HOME = 0x1;
1956
1957 /**
1958 * END_BUTTON_BEHAVIOR value for "go to sleep".
1959 * @hide
1960 */
1961 public static final int END_BUTTON_BEHAVIOR_SLEEP = 0x2;
1962
1963 /**
1964 * END_BUTTON_BEHAVIOR default value.
1965 * @hide
1966 */
1967 public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_SLEEP;
1968
1969 /**
Joe Onorato9cdffa12011-04-06 18:27:27 -07001970 * Is advanced settings mode turned on. 0 == no, 1 == yes
1971 * @hide
1972 */
1973 public static final String ADVANCED_SETTINGS = "advanced_settings";
1974
Svetoslav683914b2015-01-15 14:22:26 -08001975 private static final Validator ADVANCED_SETTINGS_VALIDATOR = sBooleanValidator;
1976
Joe Onorato9cdffa12011-04-06 18:27:27 -07001977 /**
1978 * ADVANCED_SETTINGS default value.
1979 * @hide
1980 */
1981 public static final int ADVANCED_SETTINGS_DEFAULT = 0;
1982
1983 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001984 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001985 */
Christopher Tate06efb532012-08-24 15:29:27 -07001986 @Deprecated
1987 public static final String AIRPLANE_MODE_ON = Global.AIRPLANE_MODE_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001988
1989 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001990 * @deprecated Use {@link android.provider.Settings.Global#RADIO_BLUETOOTH} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001991 */
Christopher Tate06efb532012-08-24 15:29:27 -07001992 @Deprecated
1993 public static final String RADIO_BLUETOOTH = Global.RADIO_BLUETOOTH;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001994
1995 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001996 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIFI} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001997 */
Christopher Tate06efb532012-08-24 15:29:27 -07001998 @Deprecated
1999 public static final String RADIO_WIFI = Global.RADIO_WIFI;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002000
Robert Greenwalt8588e472011-11-08 10:12:25 -08002001 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002002 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIMAX} instead
Robert Greenwalt8588e472011-11-08 10:12:25 -08002003 * {@hide}
2004 */
Christopher Tate06efb532012-08-24 15:29:27 -07002005 @Deprecated
2006 public static final String RADIO_WIMAX = Global.RADIO_WIMAX;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002007
2008 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002009 * @deprecated Use {@link android.provider.Settings.Global#RADIO_CELL} instead
Nick Pelly8d32a012011-08-09 07:03:49 -07002010 */
Christopher Tate06efb532012-08-24 15:29:27 -07002011 @Deprecated
2012 public static final String RADIO_CELL = Global.RADIO_CELL;
Nick Pelly8d32a012011-08-09 07:03:49 -07002013
2014 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002015 * @deprecated Use {@link android.provider.Settings.Global#RADIO_NFC} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002016 */
Christopher Tate06efb532012-08-24 15:29:27 -07002017 @Deprecated
2018 public static final String RADIO_NFC = Global.RADIO_NFC;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002019
2020 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002021 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_RADIOS} instead
2022 */
2023 @Deprecated
2024 public static final String AIRPLANE_MODE_RADIOS = Global.AIRPLANE_MODE_RADIOS;
2025
2026 /**
2027 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_TOGGLEABLE_RADIOS} instead
Mike Lockwoodbd5ddf02009-07-29 21:37:14 -07002028 *
2029 * {@hide}
2030 */
Christopher Tate06efb532012-08-24 15:29:27 -07002031 @Deprecated
2032 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS =
2033 Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS;
Mike Lockwoodbd5ddf02009-07-29 21:37:14 -07002034
2035 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002036 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002037 */
Christopher Tate06efb532012-08-24 15:29:27 -07002038 @Deprecated
2039 public static final String WIFI_SLEEP_POLICY = Global.WIFI_SLEEP_POLICY;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002040
2041 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002042 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_DEFAULT} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002043 */
Christopher Tate06efb532012-08-24 15:29:27 -07002044 @Deprecated
2045 public static final int WIFI_SLEEP_POLICY_DEFAULT = Global.WIFI_SLEEP_POLICY_DEFAULT;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002046
2047 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002048 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002049 */
Christopher Tate06efb532012-08-24 15:29:27 -07002050 @Deprecated
2051 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED =
2052 Global.WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002053
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002054 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002055 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002056 */
Christopher Tate06efb532012-08-24 15:29:27 -07002057 @Deprecated
2058 public static final int WIFI_SLEEP_POLICY_NEVER = Global.WIFI_SLEEP_POLICY_NEVER;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002059
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07002060 /**
2061 * @deprecated Use {@link android.provider.Settings.Global#MODE_RINGER} instead
2062 */
2063 @Deprecated
2064 public static final String MODE_RINGER = Global.MODE_RINGER;
2065
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002066 /**
2067 * Whether to use static IP and other static network attributes.
2068 * <p>
2069 * Set to 1 for true and 0 for false.
Jeff Sharkey625239a2012-09-26 22:03:49 -07002070 *
2071 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002072 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002073 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002074 public static final String WIFI_USE_STATIC_IP = "wifi_use_static_ip";
2075
Svetoslav683914b2015-01-15 14:22:26 -08002076 private static final Validator WIFI_USE_STATIC_IP_VALIDATOR = sBooleanValidator;
2077
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002078 /**
2079 * The static IP address.
2080 * <p>
2081 * Example: "192.168.1.51"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002082 *
2083 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002084 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002085 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002086 public static final String WIFI_STATIC_IP = "wifi_static_ip";
2087
Svetoslav683914b2015-01-15 14:22:26 -08002088 private static final Validator WIFI_STATIC_IP_VALIDATOR = sLenientIpAddressValidator;
2089
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002090 /**
2091 * If using static IP, the gateway's IP address.
2092 * <p>
2093 * Example: "192.168.1.1"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002094 *
2095 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002096 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002097 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002098 public static final String WIFI_STATIC_GATEWAY = "wifi_static_gateway";
2099
Svetoslav683914b2015-01-15 14:22:26 -08002100 private static final Validator WIFI_STATIC_GATEWAY_VALIDATOR = sLenientIpAddressValidator;
2101
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002102 /**
2103 * If using static IP, the net mask.
2104 * <p>
2105 * Example: "255.255.255.0"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002106 *
2107 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002108 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002109 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002110 public static final String WIFI_STATIC_NETMASK = "wifi_static_netmask";
2111
Svetoslav683914b2015-01-15 14:22:26 -08002112 private static final Validator WIFI_STATIC_NETMASK_VALIDATOR = sLenientIpAddressValidator;
2113
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002114 /**
2115 * If using static IP, the primary DNS's IP address.
2116 * <p>
2117 * Example: "192.168.1.1"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002118 *
2119 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002120 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002121 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002122 public static final String WIFI_STATIC_DNS1 = "wifi_static_dns1";
2123
Svetoslav683914b2015-01-15 14:22:26 -08002124 private static final Validator WIFI_STATIC_DNS1_VALIDATOR = sLenientIpAddressValidator;
2125
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002126 /**
2127 * If using static IP, the secondary DNS's IP address.
2128 * <p>
2129 * Example: "192.168.1.2"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002130 *
2131 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002132 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002133 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002134 public static final String WIFI_STATIC_DNS2 = "wifi_static_dns2";
2135
Svetoslav683914b2015-01-15 14:22:26 -08002136 private static final Validator WIFI_STATIC_DNS2_VALIDATOR = sLenientIpAddressValidator;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002137
2138 /**
2139 * Determines whether remote devices may discover and/or connect to
2140 * this device.
2141 * <P>Type: INT</P>
2142 * 2 -- discoverable and connectable
2143 * 1 -- connectable but not discoverable
2144 * 0 -- neither connectable nor discoverable
2145 */
2146 public static final String BLUETOOTH_DISCOVERABILITY =
2147 "bluetooth_discoverability";
2148
Svetoslav683914b2015-01-15 14:22:26 -08002149 private static final Validator BLUETOOTH_DISCOVERABILITY_VALIDATOR =
2150 new InclusiveIntegerRangeValidator(0, 2);
2151
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002152 /**
2153 * Bluetooth discoverability timeout. If this value is nonzero, then
2154 * Bluetooth becomes discoverable for a certain number of seconds,
2155 * after which is becomes simply connectable. The value is in seconds.
2156 */
2157 public static final String BLUETOOTH_DISCOVERABILITY_TIMEOUT =
2158 "bluetooth_discoverability_timeout";
2159
Svetoslav683914b2015-01-15 14:22:26 -08002160 private static final Validator BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR =
2161 sNonNegativeIntegerValidator;
2162
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002163 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08002164 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_ENABLED}
2165 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002166 */
Amith Yamasani156c4352010-03-05 17:10:03 -08002167 @Deprecated
2168 public static final String LOCK_PATTERN_ENABLED = Secure.LOCK_PATTERN_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002169
2170 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08002171 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_VISIBLE}
2172 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002173 */
Amith Yamasani156c4352010-03-05 17:10:03 -08002174 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002175 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
2176
2177 /**
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07002178 * @deprecated Use
Amith Yamasani156c4352010-03-05 17:10:03 -08002179 * {@link android.provider.Settings.Secure#LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED}
2180 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002181 */
Amith Yamasani156c4352010-03-05 17:10:03 -08002182 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002183 public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED =
2184 "lock_pattern_tactile_feedback_enabled";
2185
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002186 /**
2187 * A formatted string of the next alarm that is set, or the empty string
2188 * if there is no alarm set.
Adrian Roosc42a1e12014-07-07 23:35:53 +02002189 *
2190 * @deprecated Use {@link android.app.AlarmManager#getNextAlarmClock()}.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002191 */
Adrian Roosc42a1e12014-07-07 23:35:53 +02002192 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002193 public static final String NEXT_ALARM_FORMATTED = "next_alarm_formatted";
2194
Svetoslav683914b2015-01-15 14:22:26 -08002195 private static final Validator NEXT_ALARM_FORMATTED_VALIDATOR = new Validator() {
2196 private static final int MAX_LENGTH = 1000;
Svetoslav1b71ea92015-02-17 18:20:29 -08002197
Svetoslav683914b2015-01-15 14:22:26 -08002198 @Override
2199 public boolean validate(String value) {
2200 // TODO: No idea what the correct format is.
Svetoslav64d6e9c2015-02-12 11:30:36 -08002201 return value == null || value.length() < MAX_LENGTH;
Svetoslav683914b2015-01-15 14:22:26 -08002202 }
2203 };
2204
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002205 /**
2206 * Scaling factor for fonts, float.
2207 */
2208 public static final String FONT_SCALE = "font_scale";
2209
Svetoslav683914b2015-01-15 14:22:26 -08002210 private static final Validator FONT_SCALE_VALIDATOR = new Validator() {
2211 @Override
2212 public boolean validate(String value) {
2213 try {
2214 return Float.parseFloat(value) >= 0;
2215 } catch (NumberFormatException e) {
2216 return false;
2217 }
2218 }
2219 };
2220
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002221 /**
2222 * Name of an application package to be debugged.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002223 *
2224 * @deprecated Use {@link Global#DEBUG_APP} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002225 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002226 @Deprecated
2227 public static final String DEBUG_APP = Global.DEBUG_APP;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002228
2229 /**
2230 * If 1, when launching DEBUG_APP it will wait for the debugger before
2231 * starting user code. If 0, it will run normally.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002232 *
2233 * @deprecated Use {@link Global#WAIT_FOR_DEBUGGER} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002234 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002235 @Deprecated
2236 public static final String WAIT_FOR_DEBUGGER = Global.WAIT_FOR_DEBUGGER;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002237
2238 /**
2239 * Whether or not to dim the screen. 0=no 1=yes
Jeff Brown96307042012-07-27 15:51:34 -07002240 * @deprecated This setting is no longer used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002241 */
Jeff Brown96307042012-07-27 15:51:34 -07002242 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002243 public static final String DIM_SCREEN = "dim_screen";
2244
Svetoslav683914b2015-01-15 14:22:26 -08002245 private static final Validator DIM_SCREEN_VALIDATOR = sBooleanValidator;
2246
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002247 /**
Jeff Brown05af6ad2014-09-30 20:54:30 -07002248 * The amount of time in milliseconds before the device goes to sleep or begins
2249 * to dream after a period of inactivity. This value is also known as the
2250 * user activity timeout period since the screen isn't necessarily turned off
2251 * when it expires.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002252 */
2253 public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout";
2254
Svetoslav683914b2015-01-15 14:22:26 -08002255 private static final Validator SCREEN_OFF_TIMEOUT_VALIDATOR = sNonNegativeIntegerValidator;
2256
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002257 /**
2258 * The screen backlight brightness between 0 and 255.
2259 */
2260 public static final String SCREEN_BRIGHTNESS = "screen_brightness";
2261
Svetoslav683914b2015-01-15 14:22:26 -08002262 private static final Validator SCREEN_BRIGHTNESS_VALIDATOR =
2263 new InclusiveIntegerRangeValidator(0, 255);
2264
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002265 /**
Dan Murphy951764b2009-08-27 14:59:03 -05002266 * Control whether to enable automatic brightness mode.
Dan Murphy951764b2009-08-27 14:59:03 -05002267 */
2268 public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode";
2269
Svetoslav683914b2015-01-15 14:22:26 -08002270 private static final Validator SCREEN_BRIGHTNESS_MODE_VALIDATOR = sBooleanValidator;
2271
Dan Murphy951764b2009-08-27 14:59:03 -05002272 /**
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08002273 * Adjustment to auto-brightness to make it generally more (>0.0 <1.0)
2274 * or less (<0.0 >-1.0) bright.
Dianne Hackborn518a3d82012-05-09 16:30:49 -07002275 * @hide
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08002276 */
2277 public static final String SCREEN_AUTO_BRIGHTNESS_ADJ = "screen_auto_brightness_adj";
2278
Svetoslav683914b2015-01-15 14:22:26 -08002279 private static final Validator SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR =
2280 new InclusiveFloatRangeValidator(-1, 1);
2281
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08002282 /**
Mike Lockwooddc3494e2009-10-14 21:17:09 -07002283 * SCREEN_BRIGHTNESS_MODE value for manual mode.
Mike Lockwooddc3494e2009-10-14 21:17:09 -07002284 */
2285 public static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0;
2286
2287 /**
Scott Main52bfc242012-02-09 10:09:14 -08002288 * SCREEN_BRIGHTNESS_MODE value for automatic mode.
Mike Lockwooddc3494e2009-10-14 21:17:09 -07002289 */
2290 public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1;
2291
2292 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002293 * Control whether the process CPU usage meter should be shown.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002294 *
2295 * @deprecated Use {@link Global#SHOW_PROCESSES} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002296 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002297 @Deprecated
2298 public static final String SHOW_PROCESSES = Global.SHOW_PROCESSES;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002299
2300 /**
2301 * If 1, the activity manager will aggressively finish activities and
2302 * processes as soon as they are no longer needed. If 0, the normal
2303 * extended lifetime is used.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002304 *
2305 * @deprecated Use {@link Global#ALWAYS_FINISH_ACTIVITIES} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002306 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002307 @Deprecated
2308 public static final String ALWAYS_FINISH_ACTIVITIES = Global.ALWAYS_FINISH_ACTIVITIES;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002309
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002310 /**
2311 * Determines which streams are affected by ringer mode changes. The
2312 * stream type's bit should be set to 1 if it should be muted when going
2313 * into an inaudible ringer mode.
2314 */
2315 public static final String MODE_RINGER_STREAMS_AFFECTED = "mode_ringer_streams_affected";
2316
Svetoslav683914b2015-01-15 14:22:26 -08002317 private static final Validator MODE_RINGER_STREAMS_AFFECTED_VALIDATOR =
2318 sNonNegativeIntegerValidator;
2319
2320 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002321 * Determines which streams are affected by mute. The
2322 * stream type's bit should be set to 1 if it should be muted when a mute request
2323 * is received.
2324 */
Svetoslav683914b2015-01-15 14:22:26 -08002325 public static final String MUTE_STREAMS_AFFECTED = "mute_streams_affected";
2326
2327 private static final Validator MUTE_STREAMS_AFFECTED_VALIDATOR =
2328 sNonNegativeIntegerValidator;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002329
2330 /**
2331 * Whether vibrate is on for different events. This is used internally,
2332 * changing this value will not change the vibrate. See AudioManager.
2333 */
2334 public static final String VIBRATE_ON = "vibrate_on";
2335
Svetoslav683914b2015-01-15 14:22:26 -08002336 private static final Validator VIBRATE_ON_VALIDATOR = sBooleanValidator;
2337
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002338 /**
Jeff Brown7f6c2312012-04-13 20:38:38 -07002339 * If 1, redirects the system vibrator to all currently attached input devices
2340 * that support vibration. If there are no such input devices, then the system
2341 * vibrator is used instead.
2342 * If 0, does not register the system vibrator.
2343 *
2344 * This setting is mainly intended to provide a compatibility mechanism for
2345 * applications that only know about the system vibrator and do not use the
2346 * input device vibrator API.
2347 *
2348 * @hide
2349 */
2350 public static final String VIBRATE_INPUT_DEVICES = "vibrate_input_devices";
2351
Svetoslav683914b2015-01-15 14:22:26 -08002352 private static final Validator VIBRATE_INPUT_DEVICES_VALIDATOR = sBooleanValidator;
2353
Jeff Brown7f6c2312012-04-13 20:38:38 -07002354 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002355 * Ringer volume. This is used internally, changing this value will not
2356 * change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002357 *
2358 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002359 */
2360 public static final String VOLUME_RING = "volume_ring";
2361
2362 /**
2363 * System/notifications volume. This is used internally, changing this
2364 * value will not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002365 *
2366 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002367 */
2368 public static final String VOLUME_SYSTEM = "volume_system";
2369
2370 /**
2371 * Voice call volume. This is used internally, changing this value will
2372 * not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002373 *
2374 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002375 */
2376 public static final String VOLUME_VOICE = "volume_voice";
2377
2378 /**
2379 * Music/media/gaming volume. This is used internally, changing this
2380 * value will not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002381 *
2382 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002383 */
2384 public static final String VOLUME_MUSIC = "volume_music";
2385
2386 /**
2387 * Alarm volume. This is used internally, changing this
2388 * value will not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002389 *
2390 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002391 */
2392 public static final String VOLUME_ALARM = "volume_alarm";
2393
2394 /**
2395 * Notification volume. This is used internally, changing this
2396 * value will not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002397 *
2398 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002399 */
2400 public static final String VOLUME_NOTIFICATION = "volume_notification";
2401
2402 /**
Eric Laurent484d2882009-12-08 09:05:45 -08002403 * Bluetooth Headset volume. This is used internally, changing this value will
2404 * not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002405 *
2406 * @removed Not used by anything since API 2.
Eric Laurent484d2882009-12-08 09:05:45 -08002407 */
2408 public static final String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco";
2409
2410 /**
Mike Lockwood8517e462011-10-25 14:47:19 -04002411 * Master volume (float in the range 0.0f to 1.0f).
Svetoslavdbbeeb32015-02-18 19:16:25 -08002412 *
Mike Lockwood8517e462011-10-25 14:47:19 -04002413 * @hide
2414 */
2415 public static final String VOLUME_MASTER = "volume_master";
2416
2417 /**
Justin Koh57978ed2012-04-03 17:37:58 -07002418 * Master volume mute (int 1 = mute, 0 = not muted).
2419 *
2420 * @hide
2421 */
2422 public static final String VOLUME_MASTER_MUTE = "volume_master_mute";
2423
Svetoslav683914b2015-01-15 14:22:26 -08002424 private static final Validator VOLUME_MASTER_MUTE_VALIDATOR = sBooleanValidator;
2425
Justin Koh57978ed2012-04-03 17:37:58 -07002426 /**
Julia Reynoldsb53453f2014-08-22 11:42:43 -04002427 * Microphone mute (int 1 = mute, 0 = not muted).
2428 *
2429 * @hide
2430 */
2431 public static final String MICROPHONE_MUTE = "microphone_mute";
2432
Svetoslav683914b2015-01-15 14:22:26 -08002433 private static final Validator MICROPHONE_MUTE_VALIDATOR = sBooleanValidator;
2434
Julia Reynoldsb53453f2014-08-22 11:42:43 -04002435 /**
Justin Koh57978ed2012-04-03 17:37:58 -07002436 * Whether the notifications should use the ring volume (value of 1) or
2437 * a separate notification volume (value of 0). In most cases, users
2438 * will have this enabled so the notification and ringer volumes will be
2439 * the same. However, power users can disable this and use the separate
2440 * notification volume control.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002441 * <p>
Justin Koh57978ed2012-04-03 17:37:58 -07002442 * Note: This is a one-off setting that will be removed in the future
2443 * when there is profile support. For this reason, it is kept hidden
2444 * from the public APIs.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002445 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002446 * @hide
Amith Yamasani42722bf2011-07-22 10:34:27 -07002447 * @deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002448 */
Gilles Debunnee90bed12011-08-30 14:28:27 -07002449 @Deprecated
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002450 public static final String NOTIFICATIONS_USE_RING_VOLUME =
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002451 "notifications_use_ring_volume";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002452
Svetoslav683914b2015-01-15 14:22:26 -08002453 private static final Validator NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR = sBooleanValidator;
2454
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002455 /**
Daniel Sandler6329bf72010-02-26 15:17:44 -05002456 * Whether silent mode should allow vibration feedback. This is used
2457 * internally in AudioService and the Sound settings activity to
2458 * coordinate decoupling of vibrate and silent modes. This setting
2459 * will likely be removed in a future release with support for
2460 * audio/vibe feedback profiles.
2461 *
Eric Laurentbffc3d12012-05-07 17:43:49 -07002462 * Not used anymore. On devices with vibrator, the user explicitly selects
2463 * silent or vibrate mode.
2464 * Kept for use by legacy database upgrade code in DatabaseHelper.
Daniel Sandler6329bf72010-02-26 15:17:44 -05002465 * @hide
2466 */
2467 public static final String VIBRATE_IN_SILENT = "vibrate_in_silent";
2468
Svetoslav683914b2015-01-15 14:22:26 -08002469 private static final Validator VIBRATE_IN_SILENT_VALIDATOR = sBooleanValidator;
2470
Daniel Sandler6329bf72010-02-26 15:17:44 -05002471 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002472 * The mapping of stream type (integer) to its setting.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002473 *
2474 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002475 */
2476 public static final String[] VOLUME_SETTINGS = {
2477 VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC,
Eric Laurent484d2882009-12-08 09:05:45 -08002478 VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002479 };
2480
2481 /**
2482 * Appended to various volume related settings to record the previous
2483 * values before they the settings were affected by a silent/vibrate
2484 * ringer mode change.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002485 *
2486 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002487 */
2488 public static final String APPEND_FOR_LAST_AUDIBLE = "_last_audible";
2489
2490 /**
2491 * Persistent store for the system-wide default ringtone URI.
2492 * <p>
2493 * If you need to play the default ringtone at any given time, it is recommended
2494 * you give {@link #DEFAULT_RINGTONE_URI} to the media player. It will resolve
2495 * to the set default ringtone at the time of playing.
2496 *
2497 * @see #DEFAULT_RINGTONE_URI
2498 */
2499 public static final String RINGTONE = "ringtone";
2500
Svetoslav683914b2015-01-15 14:22:26 -08002501 private static final Validator RINGTONE_VALIDATOR = sUriValidator;
2502
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002503 /**
2504 * A {@link Uri} that will point to the current default ringtone at any
2505 * given time.
2506 * <p>
2507 * If the current default ringtone is in the DRM provider and the caller
2508 * does not have permission, the exception will be a
2509 * FileNotFoundException.
2510 */
2511 public static final Uri DEFAULT_RINGTONE_URI = getUriFor(RINGTONE);
2512
2513 /**
2514 * Persistent store for the system-wide default notification sound.
2515 *
2516 * @see #RINGTONE
2517 * @see #DEFAULT_NOTIFICATION_URI
2518 */
2519 public static final String NOTIFICATION_SOUND = "notification_sound";
2520
Svetoslav683914b2015-01-15 14:22:26 -08002521 private static final Validator NOTIFICATION_SOUND_VALIDATOR = sUriValidator;
2522
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002523 /**
2524 * A {@link Uri} that will point to the current default notification
2525 * sound at any given time.
2526 *
2527 * @see #DEFAULT_RINGTONE_URI
2528 */
2529 public static final Uri DEFAULT_NOTIFICATION_URI = getUriFor(NOTIFICATION_SOUND);
2530
2531 /**
Patrick Scott3156bb002009-04-13 09:57:38 -07002532 * Persistent store for the system-wide default alarm alert.
2533 *
2534 * @see #RINGTONE
2535 * @see #DEFAULT_ALARM_ALERT_URI
2536 */
2537 public static final String ALARM_ALERT = "alarm_alert";
2538
Svetoslav683914b2015-01-15 14:22:26 -08002539 private static final Validator ALARM_ALERT_VALIDATOR = sUriValidator;
2540
Patrick Scott3156bb002009-04-13 09:57:38 -07002541 /**
2542 * A {@link Uri} that will point to the current default alarm alert at
2543 * any given time.
2544 *
2545 * @see #DEFAULT_ALARM_ALERT_URI
2546 */
2547 public static final Uri DEFAULT_ALARM_ALERT_URI = getUriFor(ALARM_ALERT);
2548
2549 /**
Jean-Michel Trivid589fea2011-04-15 11:28:10 -07002550 * Persistent store for the system default media button event receiver.
2551 *
2552 * @hide
2553 */
2554 public static final String MEDIA_BUTTON_RECEIVER = "media_button_receiver";
2555
Svetoslav683914b2015-01-15 14:22:26 -08002556 private static final Validator MEDIA_BUTTON_RECEIVER_VALIDATOR = new Validator() {
2557 @Override
2558 public boolean validate(String value) {
2559 try {
2560 ComponentName.unflattenFromString(value);
2561 return true;
2562 } catch (NullPointerException e) {
2563 return false;
2564 }
2565 }
2566 };
2567
Jean-Michel Trivid589fea2011-04-15 11:28:10 -07002568 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002569 * Setting to enable Auto Replace (AutoText) in text editors. 1 = On, 0 = Off
2570 */
2571 public static final String TEXT_AUTO_REPLACE = "auto_replace";
2572
Svetoslav683914b2015-01-15 14:22:26 -08002573 private static final Validator TEXT_AUTO_REPLACE_VALIDATOR = sBooleanValidator;
2574
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002575 /**
2576 * Setting to enable Auto Caps in text editors. 1 = On, 0 = Off
2577 */
2578 public static final String TEXT_AUTO_CAPS = "auto_caps";
2579
Svetoslav683914b2015-01-15 14:22:26 -08002580 private static final Validator TEXT_AUTO_CAPS_VALIDATOR = sBooleanValidator;
2581
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002582 /**
2583 * Setting to enable Auto Punctuate in text editors. 1 = On, 0 = Off. This
2584 * feature converts two spaces to a "." and space.
2585 */
2586 public static final String TEXT_AUTO_PUNCTUATE = "auto_punctuate";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002587
Svetoslav683914b2015-01-15 14:22:26 -08002588 private static final Validator TEXT_AUTO_PUNCTUATE_VALIDATOR = sBooleanValidator;
2589
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002590 /**
2591 * Setting to showing password characters in text editors. 1 = On, 0 = Off
2592 */
2593 public static final String TEXT_SHOW_PASSWORD = "show_password";
2594
Svetoslav683914b2015-01-15 14:22:26 -08002595 private static final Validator TEXT_SHOW_PASSWORD_VALIDATOR = sBooleanValidator;
2596
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002597 public static final String SHOW_GTALK_SERVICE_STATUS =
2598 "SHOW_GTALK_SERVICE_STATUS";
2599
Svetoslav683914b2015-01-15 14:22:26 -08002600 private static final Validator SHOW_GTALK_SERVICE_STATUS_VALIDATOR = sBooleanValidator;
2601
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002602 /**
2603 * Name of activity to use for wallpaper on the home screen.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002604 *
2605 * @deprecated Use {@link WallpaperManager} instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002606 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002607 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002608 public static final String WALLPAPER_ACTIVITY = "wallpaper_activity";
2609
Svetoslav683914b2015-01-15 14:22:26 -08002610 private static final Validator WALLPAPER_ACTIVITY_VALIDATOR = new Validator() {
2611 private static final int MAX_LENGTH = 1000;
2612
2613 @Override
2614 public boolean validate(String value) {
2615 if (value != null && value.length() > MAX_LENGTH) {
2616 return false;
2617 }
2618 return ComponentName.unflattenFromString(value) != null;
2619 }
2620 };
2621
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002622 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002623 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME}
2624 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002625 */
Christopher Tate06efb532012-08-24 15:29:27 -07002626 @Deprecated
2627 public static final String AUTO_TIME = Global.AUTO_TIME;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002628
2629 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002630 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME_ZONE}
2631 * instead
Amith Yamasaniad450be2010-09-16 16:47:00 -07002632 */
Christopher Tate06efb532012-08-24 15:29:27 -07002633 @Deprecated
2634 public static final String AUTO_TIME_ZONE = Global.AUTO_TIME_ZONE;
Amith Yamasaniad450be2010-09-16 16:47:00 -07002635
2636 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002637 * Display times as 12 or 24 hours
2638 * 12
2639 * 24
2640 */
2641 public static final String TIME_12_24 = "time_12_24";
2642
Svetoslav683914b2015-01-15 14:22:26 -08002643 /** @hide */
2644 public static final Validator TIME_12_24_VALIDATOR =
2645 new DiscreteValueValidator(new String[] {"12", "24"});
2646
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002647 /**
2648 * Date format string
2649 * mm/dd/yyyy
2650 * dd/mm/yyyy
2651 * yyyy/mm/dd
2652 */
2653 public static final String DATE_FORMAT = "date_format";
2654
Svetoslav683914b2015-01-15 14:22:26 -08002655 /** @hide */
2656 public static final Validator DATE_FORMAT_VALIDATOR = new Validator() {
2657 @Override
2658 public boolean validate(String value) {
2659 try {
2660 new SimpleDateFormat(value);
2661 return true;
2662 } catch (IllegalArgumentException e) {
2663 return false;
2664 }
2665 }
2666 };
2667
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002668 /**
2669 * Whether the setup wizard has been run before (on first boot), or if
2670 * it still needs to be run.
2671 *
2672 * nonzero = it has been run in the past
2673 * 0 = it has not been run in the past
2674 */
2675 public static final String SETUP_WIZARD_HAS_RUN = "setup_wizard_has_run";
2676
Svetoslav683914b2015-01-15 14:22:26 -08002677 /** @hide */
2678 public static final Validator SETUP_WIZARD_HAS_RUN_VALIDATOR = sBooleanValidator;
2679
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002680 /**
2681 * Scaling factor for normal window animations. Setting to 0 will disable window
2682 * animations.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002683 *
2684 * @deprecated Use {@link Global#WINDOW_ANIMATION_SCALE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002685 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002686 @Deprecated
2687 public static final String WINDOW_ANIMATION_SCALE = Global.WINDOW_ANIMATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002688
2689 /**
2690 * Scaling factor for activity transition animations. Setting to 0 will disable window
2691 * animations.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002692 *
2693 * @deprecated Use {@link Global#TRANSITION_ANIMATION_SCALE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002694 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002695 @Deprecated
2696 public static final String TRANSITION_ANIMATION_SCALE = Global.TRANSITION_ANIMATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002697
2698 /**
Chet Haasec38fa1f2012-02-01 16:37:46 -08002699 * Scaling factor for Animator-based animations. This affects both the start delay and
2700 * duration of all such animations. Setting to 0 will cause animations to end immediately.
2701 * The default value is 1.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002702 *
2703 * @deprecated Use {@link Global#ANIMATOR_DURATION_SCALE} instead
Chet Haasec38fa1f2012-02-01 16:37:46 -08002704 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002705 @Deprecated
2706 public static final String ANIMATOR_DURATION_SCALE = Global.ANIMATOR_DURATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002707
2708 /**
2709 * Control whether the accelerometer will be used to change screen
2710 * orientation. If 0, it will not be used unless explicitly requested
2711 * by the application; if 1, it will be used by default unless explicitly
2712 * disabled by the application.
2713 */
2714 public static final String ACCELEROMETER_ROTATION = "accelerometer_rotation";
2715
Svetoslav683914b2015-01-15 14:22:26 -08002716 /** @hide */
2717 public static final Validator ACCELEROMETER_ROTATION_VALIDATOR = sBooleanValidator;
2718
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002719 /**
Daniel Sandlerb73617d2010-08-17 00:41:00 -04002720 * Default screen rotation when no other policy applies.
2721 * When {@link #ACCELEROMETER_ROTATION} is zero and no on-screen Activity expresses a
2722 * preference, this rotation value will be used. Must be one of the
Brian Muramatsue1d46982010-12-06 17:34:20 -08002723 * {@link android.view.Surface#ROTATION_0 Surface rotation constants}.
Daniel Sandlerb73617d2010-08-17 00:41:00 -04002724 *
Dianne Hackborn16ec0802014-08-15 18:32:33 -07002725 * @see android.view.Display#getRotation
Daniel Sandlerb73617d2010-08-17 00:41:00 -04002726 */
2727 public static final String USER_ROTATION = "user_rotation";
2728
Svetoslav683914b2015-01-15 14:22:26 -08002729 /** @hide */
2730 public static final Validator USER_ROTATION_VALIDATOR =
2731 new InclusiveIntegerRangeValidator(0, 3);
2732
Daniel Sandlerb73617d2010-08-17 00:41:00 -04002733 /**
Jeff Brown207673cd2012-06-05 17:47:11 -07002734 * Control whether the rotation lock toggle in the System UI should be hidden.
2735 * Typically this is done for accessibility purposes to make it harder for
2736 * the user to accidentally toggle the rotation lock while the display rotation
2737 * has been locked for accessibility.
2738 *
2739 * If 0, then rotation lock toggle is not hidden for accessibility (although it may be
2740 * unavailable for other reasons). If 1, then the rotation lock toggle is hidden.
2741 *
2742 * @hide
2743 */
2744 public static final String HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY =
2745 "hide_rotation_lock_toggle_for_accessibility";
2746
Svetoslav683914b2015-01-15 14:22:26 -08002747 /** @hide */
2748 public static final Validator HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR =
2749 sBooleanValidator;
2750
Jeff Brown207673cd2012-06-05 17:47:11 -07002751 /**
Daisuke Miyakawa3c60eeb2012-05-08 12:08:25 -07002752 * Whether the phone vibrates when it is ringing due to an incoming call. This will
2753 * be used by Phone and Setting apps; it shouldn't affect other apps.
2754 * The value is boolean (1 or 0).
2755 *
2756 * Note: this is not same as "vibrate on ring", which had been available until ICS.
2757 * It was about AudioManager's setting and thus affected all the applications which
2758 * relied on the setting, while this is purely about the vibration setting for incoming
2759 * calls.
2760 *
2761 * @hide
2762 */
2763 public static final String VIBRATE_WHEN_RINGING = "vibrate_when_ringing";
2764
Svetoslav683914b2015-01-15 14:22:26 -08002765 /** @hide */
2766 public static final Validator VIBRATE_WHEN_RINGING_VALIDATOR = sBooleanValidator;
2767
Daisuke Miyakawa3c60eeb2012-05-08 12:08:25 -07002768 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002769 * Whether the audible DTMF tones are played by the dialer when dialing. The value is
2770 * boolean (1 or 0).
2771 */
2772 public static final String DTMF_TONE_WHEN_DIALING = "dtmf_tone";
2773
Svetoslav683914b2015-01-15 14:22:26 -08002774 /** @hide */
2775 public static final Validator DTMF_TONE_WHEN_DIALING_VALIDATOR = sBooleanValidator;
2776
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002777 /**
David Kraused0f67152009-06-13 18:01:13 -05002778 * CDMA only settings
2779 * DTMF tone type played by the dialer when dialing.
2780 * 0 = Normal
2781 * 1 = Long
2782 * @hide
2783 */
2784 public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type";
2785
Svetoslav683914b2015-01-15 14:22:26 -08002786 /** @hide */
2787 public static final Validator DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR = sBooleanValidator;
2788
David Kraused0f67152009-06-13 18:01:13 -05002789 /**
David Kraused0f67152009-06-13 18:01:13 -05002790 * Whether the hearing aid is enabled. The value is
2791 * boolean (1 or 0).
2792 * @hide
2793 */
2794 public static final String HEARING_AID = "hearing_aid";
2795
Svetoslav683914b2015-01-15 14:22:26 -08002796 /** @hide */
2797 public static final Validator HEARING_AID_VALIDATOR = sBooleanValidator;
2798
David Kraused0f67152009-06-13 18:01:13 -05002799 /**
2800 * CDMA only settings
2801 * TTY Mode
2802 * 0 = OFF
2803 * 1 = FULL
2804 * 2 = VCO
2805 * 3 = HCO
2806 * @hide
2807 */
2808 public static final String TTY_MODE = "tty_mode";
2809
Svetoslav683914b2015-01-15 14:22:26 -08002810 /** @hide */
2811 public static final Validator TTY_MODE_VALIDATOR = new InclusiveIntegerRangeValidator(0, 3);
2812
David Kraused0f67152009-06-13 18:01:13 -05002813 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002814 * Whether the sounds effects (key clicks, lid open ...) are enabled. The value is
2815 * boolean (1 or 0).
2816 */
2817 public static final String SOUND_EFFECTS_ENABLED = "sound_effects_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002818
Svetoslav683914b2015-01-15 14:22:26 -08002819 /** @hide */
2820 public static final Validator SOUND_EFFECTS_ENABLED_VALIDATOR = sBooleanValidator;
2821
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002822 /**
2823 * Whether the haptic feedback (long presses, ...) are enabled. The value is
2824 * boolean (1 or 0).
2825 */
2826 public static final String HAPTIC_FEEDBACK_ENABLED = "haptic_feedback_enabled";
Sanjay Jeyakumar21bf2412009-07-09 13:31:48 -07002827
Svetoslav683914b2015-01-15 14:22:26 -08002828 /** @hide */
2829 public static final Validator HAPTIC_FEEDBACK_ENABLED_VALIDATOR = sBooleanValidator;
2830
Mike LeBeau48603e72009-06-05 00:27:00 +01002831 /**
Bjorn Bringert24abb662010-09-21 12:21:18 +01002832 * @deprecated Each application that shows web suggestions should have its own
2833 * setting for this.
Mike LeBeau48603e72009-06-05 00:27:00 +01002834 */
Bjorn Bringert24abb662010-09-21 12:21:18 +01002835 @Deprecated
Mike LeBeau48603e72009-06-05 00:27:00 +01002836 public static final String SHOW_WEB_SUGGESTIONS = "show_web_suggestions";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002837
Svetoslav683914b2015-01-15 14:22:26 -08002838 /** @hide */
2839 public static final Validator SHOW_WEB_SUGGESTIONS_VALIDATOR = sBooleanValidator;
2840
-b master501eec92009-07-06 13:53:11 -07002841 /**
Amith Yamasaniae3ed702009-12-01 19:02:05 -08002842 * Whether the notification LED should repeatedly flash when a notification is
2843 * pending. The value is boolean (1 or 0).
2844 * @hide
2845 */
2846 public static final String NOTIFICATION_LIGHT_PULSE = "notification_light_pulse";
2847
Svetoslav683914b2015-01-15 14:22:26 -08002848 /** @hide */
2849 public static final Validator NOTIFICATION_LIGHT_PULSE_VALIDATOR = sBooleanValidator;
2850
Amith Yamasaniae3ed702009-12-01 19:02:05 -08002851 /**
Dianne Hackborn90d2db32010-02-11 22:19:06 -08002852 * Show pointer location on screen?
2853 * 0 = no
2854 * 1 = yes
2855 * @hide
2856 */
2857 public static final String POINTER_LOCATION = "pointer_location";
2858
Svetoslav683914b2015-01-15 14:22:26 -08002859 /** @hide */
2860 public static final Validator POINTER_LOCATION_VALIDATOR = sBooleanValidator;
2861
Dianne Hackborn90d2db32010-02-11 22:19:06 -08002862 /**
Jeff Browndaf4a122011-08-26 17:14:14 -07002863 * Show touch positions on screen?
2864 * 0 = no
2865 * 1 = yes
2866 * @hide
2867 */
2868 public static final String SHOW_TOUCHES = "show_touches";
2869
Svetoslav683914b2015-01-15 14:22:26 -08002870 /** @hide */
2871 public static final Validator SHOW_TOUCHES_VALIDATOR = sBooleanValidator;
2872
Jeff Browndaf4a122011-08-26 17:14:14 -07002873 /**
Dianne Hackborn16ec0802014-08-15 18:32:33 -07002874 * Log raw orientation data from
Jorim Jaggib10e33f2015-02-04 21:57:40 +01002875 * {@link com.android.server.policy.WindowOrientationListener} for use with the
Jeff Brown4519f072011-01-23 13:16:01 -08002876 * orientationplot.py tool.
2877 * 0 = no
2878 * 1 = yes
2879 * @hide
2880 */
2881 public static final String WINDOW_ORIENTATION_LISTENER_LOG =
2882 "window_orientation_listener_log";
2883
Svetoslav683914b2015-01-15 14:22:26 -08002884 /** @hide */
2885 public static final Validator WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR = sBooleanValidator;
2886
Jeff Brown4519f072011-01-23 13:16:01 -08002887 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002888 * @deprecated Use {@link android.provider.Settings.Global#POWER_SOUNDS_ENABLED}
2889 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002890 * @hide
2891 */
Christopher Tate06efb532012-08-24 15:29:27 -07002892 @Deprecated
2893 public static final String POWER_SOUNDS_ENABLED = Global.POWER_SOUNDS_ENABLED;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002894
2895 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002896 * @deprecated Use {@link android.provider.Settings.Global#DOCK_SOUNDS_ENABLED}
2897 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002898 * @hide
2899 */
Christopher Tate06efb532012-08-24 15:29:27 -07002900 @Deprecated
2901 public static final String DOCK_SOUNDS_ENABLED = Global.DOCK_SOUNDS_ENABLED;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002902
2903 /**
2904 * Whether to play sounds when the keyguard is shown and dismissed.
2905 * @hide
2906 */
2907 public static final String LOCKSCREEN_SOUNDS_ENABLED = "lockscreen_sounds_enabled";
2908
Svetoslav683914b2015-01-15 14:22:26 -08002909 /** @hide */
2910 public static final Validator LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR = sBooleanValidator;
2911
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002912 /**
Mike Lockwood7bef7392011-10-20 16:51:53 -04002913 * Whether the lockscreen should be completely disabled.
2914 * @hide
2915 */
2916 public static final String LOCKSCREEN_DISABLED = "lockscreen.disabled";
2917
Svetoslav683914b2015-01-15 14:22:26 -08002918 /** @hide */
2919 public static final Validator LOCKSCREEN_DISABLED_VALIDATOR = sBooleanValidator;
2920
Mike Lockwood7bef7392011-10-20 16:51:53 -04002921 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002922 * @deprecated Use {@link android.provider.Settings.Global#LOW_BATTERY_SOUND}
2923 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002924 * @hide
2925 */
Christopher Tate06efb532012-08-24 15:29:27 -07002926 @Deprecated
2927 public static final String LOW_BATTERY_SOUND = Global.LOW_BATTERY_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002928
2929 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002930 * @deprecated Use {@link android.provider.Settings.Global#DESK_DOCK_SOUND}
2931 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002932 * @hide
2933 */
Christopher Tate06efb532012-08-24 15:29:27 -07002934 @Deprecated
2935 public static final String DESK_DOCK_SOUND = Global.DESK_DOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002936
2937 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002938 * @deprecated Use {@link android.provider.Settings.Global#DESK_UNDOCK_SOUND}
2939 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002940 * @hide
2941 */
Christopher Tate06efb532012-08-24 15:29:27 -07002942 @Deprecated
2943 public static final String DESK_UNDOCK_SOUND = Global.DESK_UNDOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002944
2945 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002946 * @deprecated Use {@link android.provider.Settings.Global#CAR_DOCK_SOUND}
2947 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002948 * @hide
2949 */
Christopher Tate06efb532012-08-24 15:29:27 -07002950 @Deprecated
2951 public static final String CAR_DOCK_SOUND = Global.CAR_DOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002952
2953 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002954 * @deprecated Use {@link android.provider.Settings.Global#CAR_UNDOCK_SOUND}
2955 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002956 * @hide
2957 */
Christopher Tate06efb532012-08-24 15:29:27 -07002958 @Deprecated
2959 public static final String CAR_UNDOCK_SOUND = Global.CAR_UNDOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002960
2961 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002962 * @deprecated Use {@link android.provider.Settings.Global#LOCK_SOUND}
2963 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002964 * @hide
2965 */
Christopher Tate06efb532012-08-24 15:29:27 -07002966 @Deprecated
2967 public static final String LOCK_SOUND = Global.LOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002968
2969 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002970 * @deprecated Use {@link android.provider.Settings.Global#UNLOCK_SOUND}
2971 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002972 * @hide
2973 */
Christopher Tate06efb532012-08-24 15:29:27 -07002974 @Deprecated
2975 public static final String UNLOCK_SOUND = Global.UNLOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002976
2977 /**
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08002978 * Receive incoming SIP calls?
2979 * 0 = no
2980 * 1 = yes
2981 * @hide
2982 */
2983 public static final String SIP_RECEIVE_CALLS = "sip_receive_calls";
2984
Svetoslav683914b2015-01-15 14:22:26 -08002985 /** @hide */
2986 public static final Validator SIP_RECEIVE_CALLS_VALIDATOR = sBooleanValidator;
2987
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08002988 /**
2989 * Call Preference String.
2990 * "SIP_ALWAYS" : Always use SIP with network access
2991 * "SIP_ADDRESS_ONLY" : Only if destination is a SIP address
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08002992 * @hide
2993 */
2994 public static final String SIP_CALL_OPTIONS = "sip_call_options";
2995
Svetoslav683914b2015-01-15 14:22:26 -08002996 /** @hide */
2997 public static final Validator SIP_CALL_OPTIONS_VALIDATOR = new DiscreteValueValidator(
2998 new String[] {"SIP_ALWAYS", "SIP_ADDRESS_ONLY"});
2999
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003000 /**
3001 * One of the sip call options: Always use SIP with network access.
3002 * @hide
3003 */
3004 public static final String SIP_ALWAYS = "SIP_ALWAYS";
3005
Svetoslav683914b2015-01-15 14:22:26 -08003006 /** @hide */
3007 public static final Validator SIP_ALWAYS_VALIDATOR = sBooleanValidator;
3008
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003009 /**
3010 * One of the sip call options: Only if destination is a SIP address.
3011 * @hide
3012 */
3013 public static final String SIP_ADDRESS_ONLY = "SIP_ADDRESS_ONLY";
3014
Svetoslav683914b2015-01-15 14:22:26 -08003015 /** @hide */
3016 public static final Validator SIP_ADDRESS_ONLY_VALIDATOR = sBooleanValidator;
3017
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003018 /**
Tyler Gunn2c830a22014-09-02 08:39:35 -07003019 * @deprecated Use SIP_ALWAYS or SIP_ADDRESS_ONLY instead. Formerly used to indicate that
3020 * the user should be prompted each time a call is made whether it should be placed using
3021 * SIP. The {@link com.android.providers.settings.DatabaseHelper} replaces this with
3022 * SIP_ADDRESS_ONLY.
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003023 * @hide
3024 */
Tyler Gunn2c830a22014-09-02 08:39:35 -07003025 @Deprecated
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003026 public static final String SIP_ASK_ME_EACH_TIME = "SIP_ASK_ME_EACH_TIME";
3027
Svetoslav683914b2015-01-15 14:22:26 -08003028 /** @hide */
3029 public static final Validator SIP_ASK_ME_EACH_TIME_VALIDATOR = sBooleanValidator;
3030
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003031 /**
Jeff Brown1a84fd12011-06-02 01:26:32 -07003032 * Pointer speed setting.
3033 * This is an integer value in a range between -7 and +7, so there are 15 possible values.
3034 * -7 = slowest
3035 * 0 = default speed
3036 * +7 = fastest
3037 * @hide
3038 */
3039 public static final String POINTER_SPEED = "pointer_speed";
3040
Svetoslav683914b2015-01-15 14:22:26 -08003041 /** @hide */
3042 public static final Validator POINTER_SPEED_VALIDATOR =
3043 new InclusiveFloatRangeValidator(-7, 7);
3044
Jeff Brown1a84fd12011-06-02 01:26:32 -07003045 /**
Jason Monk56e09b42014-07-18 10:29:14 -04003046 * Whether lock-to-app will be triggered by long-press on recents.
3047 * @hide
3048 */
3049 public static final String LOCK_TO_APP_ENABLED = "lock_to_app_enabled";
3050
Svetoslav683914b2015-01-15 14:22:26 -08003051 /** @hide */
3052 public static final Validator LOCK_TO_APP_ENABLED_VALIDATOR = sBooleanValidator;
3053
Jason Monk56e09b42014-07-18 10:29:14 -04003054 /**
Daniel Sandler2fdb68b2013-10-03 00:12:11 -04003055 * I am the lolrus.
3056 * <p>
3057 * Nonzero values indicate that the user has a bukkit.
3058 * Backward-compatible with <code>PrefGetPreference(prefAllowEasterEggs)</code>.
3059 * @hide
3060 */
3061 public static final String EGG_MODE = "egg_mode";
3062
Svetoslav683914b2015-01-15 14:22:26 -08003063 /** @hide */
3064 public static final Validator EGG_MODE_VALIDATOR = sBooleanValidator;
3065
3066 /**
3067 * IMPORTANT: If you add a new public settings you also have to add it to
3068 * PUBLIC_SETTINGS below. If the new setting is hidden you have to add
3069 * it to PRIVATE_SETTINGS below. Also add a validator that can validate
3070 * the setting value. See an example above.
3071 */
3072
Daniel Sandler2fdb68b2013-10-03 00:12:11 -04003073 /**
-b master501eec92009-07-06 13:53:11 -07003074 * Settings to backup. This is here so that it's in the same place as the settings
3075 * keys and easy to update.
Svetoslav Ganova571a582011-09-20 18:32:20 -07003076 *
3077 * NOTE: Settings are backed up and restored in the order they appear
3078 * in this array. If you have one setting depending on another,
3079 * make sure that they are ordered appropriately.
3080 *
-b master501eec92009-07-06 13:53:11 -07003081 * @hide
3082 */
3083 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate66488d62012-10-02 11:58:01 -07003084 STAY_ON_WHILE_PLUGGED_IN, // moved to global
-b master501eec92009-07-06 13:53:11 -07003085 WIFI_USE_STATIC_IP,
3086 WIFI_STATIC_IP,
3087 WIFI_STATIC_GATEWAY,
3088 WIFI_STATIC_NETMASK,
3089 WIFI_STATIC_DNS1,
3090 WIFI_STATIC_DNS2,
3091 BLUETOOTH_DISCOVERABILITY,
3092 BLUETOOTH_DISCOVERABILITY_TIMEOUT,
3093 DIM_SCREEN,
3094 SCREEN_OFF_TIMEOUT,
3095 SCREEN_BRIGHTNESS,
Christopher Tate362aca62009-09-25 15:58:03 -07003096 SCREEN_BRIGHTNESS_MODE,
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08003097 SCREEN_AUTO_BRIGHTNESS_ADJ,
Jeff Brown7f6c2312012-04-13 20:38:38 -07003098 VIBRATE_INPUT_DEVICES,
Amith Yamasani8823c0a82009-07-07 14:30:17 -07003099 MODE_RINGER_STREAMS_AFFECTED,
-b master501eec92009-07-06 13:53:11 -07003100 TEXT_AUTO_REPLACE,
3101 TEXT_AUTO_CAPS,
3102 TEXT_AUTO_PUNCTUATE,
3103 TEXT_SHOW_PASSWORD,
Christopher Tate66488d62012-10-02 11:58:01 -07003104 AUTO_TIME, // moved to global
3105 AUTO_TIME_ZONE, // moved to global
-b master501eec92009-07-06 13:53:11 -07003106 TIME_12_24,
3107 DATE_FORMAT,
-b master501eec92009-07-06 13:53:11 -07003108 DTMF_TONE_WHEN_DIALING,
3109 DTMF_TONE_TYPE_WHEN_DIALING,
-b master501eec92009-07-06 13:53:11 -07003110 HEARING_AID,
3111 TTY_MODE,
3112 SOUND_EFFECTS_ENABLED,
3113 HAPTIC_FEEDBACK_ENABLED,
Christopher Tate66488d62012-10-02 11:58:01 -07003114 POWER_SOUNDS_ENABLED, // moved to global
3115 DOCK_SOUNDS_ENABLED, // moved to global
Christopher Tate14c2d792010-02-25 16:49:44 -08003116 LOCKSCREEN_SOUNDS_ENABLED,
Amith Yamasaniae3ed702009-12-01 19:02:05 -08003117 SHOW_WEB_SUGGESTIONS,
Mike Lockwoodeabe8bf2010-08-31 14:35:23 -04003118 NOTIFICATION_LIGHT_PULSE,
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003119 SIP_CALL_OPTIONS,
Nick Pelly038cabe2010-09-23 16:12:11 -07003120 SIP_RECEIVE_CALLS,
Jeff Brown1a84fd12011-06-02 01:26:32 -07003121 POINTER_SPEED,
Amith Yamasani622bf2222013-09-06 13:54:28 -07003122 VIBRATE_WHEN_RINGING,
3123 RINGTONE,
Jason Monk94cfd9d2014-10-31 13:18:21 -04003124 LOCK_TO_APP_ENABLED,
Amith Yamasani622bf2222013-09-06 13:54:28 -07003125 NOTIFICATION_SOUND
-b master501eec92009-07-06 13:53:11 -07003126 };
3127
Sailesh Nepal1bd78762014-02-11 22:32:21 -08003128 /**
Amith Yamasanib0ff3222015-03-04 09:56:14 -08003129 * These are all public system settings
Svetoslav683914b2015-01-15 14:22:26 -08003130 *
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07003131 * @hide
3132 */
Svetoslav683914b2015-01-15 14:22:26 -08003133 public static final Set<String> PUBLIC_SETTINGS = new ArraySet<>();
3134 static {
3135 PUBLIC_SETTINGS.add(END_BUTTON_BEHAVIOR);
3136 PUBLIC_SETTINGS.add(WIFI_USE_STATIC_IP);
3137 PUBLIC_SETTINGS.add(WIFI_STATIC_IP);
3138 PUBLIC_SETTINGS.add(WIFI_STATIC_GATEWAY);
3139 PUBLIC_SETTINGS.add(WIFI_STATIC_NETMASK);
3140 PUBLIC_SETTINGS.add(WIFI_STATIC_DNS1);
3141 PUBLIC_SETTINGS.add(WIFI_STATIC_DNS2);
3142 PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY);
3143 PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY_TIMEOUT);
3144 PUBLIC_SETTINGS.add(NEXT_ALARM_FORMATTED);
3145 PUBLIC_SETTINGS.add(FONT_SCALE);
3146 PUBLIC_SETTINGS.add(DIM_SCREEN);
3147 PUBLIC_SETTINGS.add(SCREEN_OFF_TIMEOUT);
3148 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS);
3149 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_MODE);
3150 PUBLIC_SETTINGS.add(MODE_RINGER_STREAMS_AFFECTED);
3151 PUBLIC_SETTINGS.add(MUTE_STREAMS_AFFECTED);
3152 PUBLIC_SETTINGS.add(VIBRATE_ON);
3153 PUBLIC_SETTINGS.add(VOLUME_RING);
3154 PUBLIC_SETTINGS.add(VOLUME_SYSTEM);
3155 PUBLIC_SETTINGS.add(VOLUME_VOICE);
3156 PUBLIC_SETTINGS.add(VOLUME_MUSIC);
3157 PUBLIC_SETTINGS.add(VOLUME_ALARM);
3158 PUBLIC_SETTINGS.add(VOLUME_NOTIFICATION);
3159 PUBLIC_SETTINGS.add(VOLUME_BLUETOOTH_SCO);
3160 PUBLIC_SETTINGS.add(RINGTONE);
3161 PUBLIC_SETTINGS.add(NOTIFICATION_SOUND);
3162 PUBLIC_SETTINGS.add(ALARM_ALERT);
3163 PUBLIC_SETTINGS.add(TEXT_AUTO_REPLACE);
3164 PUBLIC_SETTINGS.add(TEXT_AUTO_CAPS);
3165 PUBLIC_SETTINGS.add(TEXT_AUTO_PUNCTUATE);
3166 PUBLIC_SETTINGS.add(TEXT_SHOW_PASSWORD);
3167 PUBLIC_SETTINGS.add(SHOW_GTALK_SERVICE_STATUS);
3168 PUBLIC_SETTINGS.add(WALLPAPER_ACTIVITY);
3169 PUBLIC_SETTINGS.add(TIME_12_24);
3170 PUBLIC_SETTINGS.add(DATE_FORMAT);
3171 PUBLIC_SETTINGS.add(SETUP_WIZARD_HAS_RUN);
3172 PUBLIC_SETTINGS.add(ACCELEROMETER_ROTATION);
3173 PUBLIC_SETTINGS.add(USER_ROTATION);
3174 PUBLIC_SETTINGS.add(DTMF_TONE_WHEN_DIALING);
3175 PUBLIC_SETTINGS.add(SOUND_EFFECTS_ENABLED);
3176 PUBLIC_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED);
3177 PUBLIC_SETTINGS.add(SHOW_WEB_SUGGESTIONS);
3178 }
3179
3180 /**
3181 * These are all hidden system settings.
3182 *
3183 * @hide
3184 */
3185 public static final Set<String> PRIVATE_SETTINGS = new ArraySet<>();
3186 static {
3187 PRIVATE_SETTINGS.add(WIFI_USE_STATIC_IP);
3188 PRIVATE_SETTINGS.add(END_BUTTON_BEHAVIOR);
3189 PRIVATE_SETTINGS.add(ADVANCED_SETTINGS);
3190 PRIVATE_SETTINGS.add(SCREEN_AUTO_BRIGHTNESS_ADJ);
3191 PRIVATE_SETTINGS.add(VIBRATE_INPUT_DEVICES);
3192 PRIVATE_SETTINGS.add(VOLUME_MASTER);
3193 PRIVATE_SETTINGS.add(VOLUME_MASTER_MUTE);
3194 PRIVATE_SETTINGS.add(MICROPHONE_MUTE);
3195 PRIVATE_SETTINGS.add(NOTIFICATIONS_USE_RING_VOLUME);
3196 PRIVATE_SETTINGS.add(VIBRATE_IN_SILENT);
3197 PRIVATE_SETTINGS.add(MEDIA_BUTTON_RECEIVER);
3198 PRIVATE_SETTINGS.add(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY);
3199 PRIVATE_SETTINGS.add(VIBRATE_WHEN_RINGING);
3200 PRIVATE_SETTINGS.add(DTMF_TONE_TYPE_WHEN_DIALING);
3201 PRIVATE_SETTINGS.add(HEARING_AID);
3202 PRIVATE_SETTINGS.add(TTY_MODE);
3203 PRIVATE_SETTINGS.add(NOTIFICATION_LIGHT_PULSE);
3204 PRIVATE_SETTINGS.add(POINTER_LOCATION);
3205 PRIVATE_SETTINGS.add(SHOW_TOUCHES);
3206 PRIVATE_SETTINGS.add(WINDOW_ORIENTATION_LISTENER_LOG);
3207 PRIVATE_SETTINGS.add(POWER_SOUNDS_ENABLED);
3208 PRIVATE_SETTINGS.add(DOCK_SOUNDS_ENABLED);
3209 PRIVATE_SETTINGS.add(LOCKSCREEN_SOUNDS_ENABLED);
3210 PRIVATE_SETTINGS.add(LOCKSCREEN_DISABLED);
3211 PRIVATE_SETTINGS.add(LOW_BATTERY_SOUND);
3212 PRIVATE_SETTINGS.add(DESK_DOCK_SOUND);
3213 PRIVATE_SETTINGS.add(DESK_UNDOCK_SOUND);
3214 PRIVATE_SETTINGS.add(CAR_DOCK_SOUND);
3215 PRIVATE_SETTINGS.add(CAR_UNDOCK_SOUND);
3216 PRIVATE_SETTINGS.add(LOCK_SOUND);
3217 PRIVATE_SETTINGS.add(UNLOCK_SOUND);
3218 PRIVATE_SETTINGS.add(SIP_RECEIVE_CALLS);
3219 PRIVATE_SETTINGS.add(SIP_CALL_OPTIONS);
3220 PRIVATE_SETTINGS.add(SIP_ALWAYS);
3221 PRIVATE_SETTINGS.add(SIP_ADDRESS_ONLY);
3222 PRIVATE_SETTINGS.add(SIP_ASK_ME_EACH_TIME);
3223 PRIVATE_SETTINGS.add(POINTER_SPEED);
3224 PRIVATE_SETTINGS.add(LOCK_TO_APP_ENABLED);
3225 PRIVATE_SETTINGS.add(EGG_MODE);
3226 }
3227
3228 /**
Amith Yamasanib0ff3222015-03-04 09:56:14 -08003229 * These are all public system settings
Svetoslav683914b2015-01-15 14:22:26 -08003230 *
3231 * @hide
3232 */
3233 public static final Map<String, Validator> VALIDATORS = new ArrayMap<>();
3234 static {
3235 VALIDATORS.put(END_BUTTON_BEHAVIOR,END_BUTTON_BEHAVIOR_VALIDATOR);
3236 VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR);
3237 VALIDATORS.put(BLUETOOTH_DISCOVERABILITY, BLUETOOTH_DISCOVERABILITY_VALIDATOR);
3238 VALIDATORS.put(BLUETOOTH_DISCOVERABILITY_TIMEOUT,
3239 BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR);
3240 VALIDATORS.put(NEXT_ALARM_FORMATTED, NEXT_ALARM_FORMATTED_VALIDATOR);
3241 VALIDATORS.put(FONT_SCALE, FONT_SCALE_VALIDATOR);
3242 VALIDATORS.put(DIM_SCREEN, DIM_SCREEN_VALIDATOR);
3243 VALIDATORS.put(SCREEN_OFF_TIMEOUT, SCREEN_OFF_TIMEOUT_VALIDATOR);
3244 VALIDATORS.put(SCREEN_BRIGHTNESS, SCREEN_BRIGHTNESS_VALIDATOR);
3245 VALIDATORS.put(SCREEN_BRIGHTNESS_MODE, SCREEN_BRIGHTNESS_MODE_VALIDATOR);
3246 VALIDATORS.put(MODE_RINGER_STREAMS_AFFECTED, MODE_RINGER_STREAMS_AFFECTED_VALIDATOR);
3247 VALIDATORS.put(MUTE_STREAMS_AFFECTED, MUTE_STREAMS_AFFECTED_VALIDATOR);
3248 VALIDATORS.put(VIBRATE_ON, VIBRATE_ON_VALIDATOR);
Svetoslav683914b2015-01-15 14:22:26 -08003249 VALIDATORS.put(RINGTONE, RINGTONE_VALIDATOR);
3250 VALIDATORS.put(NOTIFICATION_SOUND, NOTIFICATION_SOUND_VALIDATOR);
3251 VALIDATORS.put(ALARM_ALERT, ALARM_ALERT_VALIDATOR);
3252 VALIDATORS.put(TEXT_AUTO_REPLACE, TEXT_AUTO_REPLACE_VALIDATOR);
3253 VALIDATORS.put(TEXT_AUTO_CAPS, TEXT_AUTO_CAPS_VALIDATOR);
3254 VALIDATORS.put(TEXT_AUTO_PUNCTUATE, TEXT_AUTO_PUNCTUATE_VALIDATOR);
3255 VALIDATORS.put(TEXT_SHOW_PASSWORD, TEXT_SHOW_PASSWORD_VALIDATOR);
3256 VALIDATORS.put(SHOW_GTALK_SERVICE_STATUS, SHOW_GTALK_SERVICE_STATUS_VALIDATOR);
3257 VALIDATORS.put(WALLPAPER_ACTIVITY, WALLPAPER_ACTIVITY_VALIDATOR);
3258 VALIDATORS.put(TIME_12_24, TIME_12_24_VALIDATOR);
3259 VALIDATORS.put(DATE_FORMAT, DATE_FORMAT_VALIDATOR);
3260 VALIDATORS.put(SETUP_WIZARD_HAS_RUN, SETUP_WIZARD_HAS_RUN_VALIDATOR);
3261 VALIDATORS.put(ACCELEROMETER_ROTATION, ACCELEROMETER_ROTATION_VALIDATOR);
3262 VALIDATORS.put(USER_ROTATION, USER_ROTATION_VALIDATOR);
3263 VALIDATORS.put(DTMF_TONE_WHEN_DIALING, DTMF_TONE_WHEN_DIALING_VALIDATOR);
3264 VALIDATORS.put(SOUND_EFFECTS_ENABLED, SOUND_EFFECTS_ENABLED_VALIDATOR);
3265 VALIDATORS.put(HAPTIC_FEEDBACK_ENABLED, HAPTIC_FEEDBACK_ENABLED_VALIDATOR);
3266 VALIDATORS.put(SHOW_WEB_SUGGESTIONS, SHOW_WEB_SUGGESTIONS_VALIDATOR);
3267 VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR);
3268 VALIDATORS.put(END_BUTTON_BEHAVIOR, END_BUTTON_BEHAVIOR_VALIDATOR);
3269 VALIDATORS.put(ADVANCED_SETTINGS, ADVANCED_SETTINGS_VALIDATOR);
3270 VALIDATORS.put(SCREEN_AUTO_BRIGHTNESS_ADJ, SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR);
3271 VALIDATORS.put(VIBRATE_INPUT_DEVICES, VIBRATE_INPUT_DEVICES_VALIDATOR);
Svetoslav683914b2015-01-15 14:22:26 -08003272 VALIDATORS.put(VOLUME_MASTER_MUTE, VOLUME_MASTER_MUTE_VALIDATOR);
3273 VALIDATORS.put(MICROPHONE_MUTE, MICROPHONE_MUTE_VALIDATOR);
3274 VALIDATORS.put(NOTIFICATIONS_USE_RING_VOLUME, NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR);
3275 VALIDATORS.put(VIBRATE_IN_SILENT, VIBRATE_IN_SILENT_VALIDATOR);
3276 VALIDATORS.put(MEDIA_BUTTON_RECEIVER, MEDIA_BUTTON_RECEIVER_VALIDATOR);
3277 VALIDATORS.put(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY,
3278 HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR);
3279 VALIDATORS.put(VIBRATE_WHEN_RINGING, VIBRATE_WHEN_RINGING_VALIDATOR);
3280 VALIDATORS.put(DTMF_TONE_TYPE_WHEN_DIALING, DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR);
3281 VALIDATORS.put(HEARING_AID, HEARING_AID_VALIDATOR);
3282 VALIDATORS.put(TTY_MODE, TTY_MODE_VALIDATOR);
3283 VALIDATORS.put(NOTIFICATION_LIGHT_PULSE, NOTIFICATION_LIGHT_PULSE_VALIDATOR);
3284 VALIDATORS.put(POINTER_LOCATION, POINTER_LOCATION_VALIDATOR);
3285 VALIDATORS.put(SHOW_TOUCHES, SHOW_TOUCHES_VALIDATOR);
3286 VALIDATORS.put(WINDOW_ORIENTATION_LISTENER_LOG,
3287 WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR);
3288 VALIDATORS.put(LOCKSCREEN_SOUNDS_ENABLED, LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR);
3289 VALIDATORS.put(LOCKSCREEN_DISABLED, LOCKSCREEN_DISABLED_VALIDATOR);
3290 VALIDATORS.put(SIP_RECEIVE_CALLS, SIP_RECEIVE_CALLS_VALIDATOR);
3291 VALIDATORS.put(SIP_CALL_OPTIONS, SIP_CALL_OPTIONS_VALIDATOR);
3292 VALIDATORS.put(SIP_ALWAYS, SIP_ALWAYS_VALIDATOR);
3293 VALIDATORS.put(SIP_ADDRESS_ONLY, SIP_ADDRESS_ONLY_VALIDATOR);
3294 VALIDATORS.put(SIP_ASK_ME_EACH_TIME, SIP_ASK_ME_EACH_TIME_VALIDATOR);
3295 VALIDATORS.put(POINTER_SPEED, POINTER_SPEED_VALIDATOR);
3296 VALIDATORS.put(LOCK_TO_APP_ENABLED, LOCK_TO_APP_ENABLED_VALIDATOR);
3297 VALIDATORS.put(EGG_MODE, EGG_MODE_VALIDATOR);
3298 VALIDATORS.put(WIFI_STATIC_IP, WIFI_STATIC_IP_VALIDATOR);
3299 VALIDATORS.put(WIFI_STATIC_GATEWAY, WIFI_STATIC_GATEWAY_VALIDATOR);
3300 VALIDATORS.put(WIFI_STATIC_NETMASK, WIFI_STATIC_NETMASK_VALIDATOR);
3301 VALIDATORS.put(WIFI_STATIC_DNS1, WIFI_STATIC_DNS1_VALIDATOR);
3302 VALIDATORS.put(WIFI_STATIC_DNS2, WIFI_STATIC_DNS2_VALIDATOR);
3303 }
3304
3305 /**
3306 * These entries are considered common between the personal and the managed profile,
3307 * since the managed profile doesn't get to change them.
3308 */
3309 private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>();
3310 static {
3311 CLONE_TO_MANAGED_PROFILE.add(DATE_FORMAT);
3312 CLONE_TO_MANAGED_PROFILE.add(HAPTIC_FEEDBACK_ENABLED);
3313 CLONE_TO_MANAGED_PROFILE.add(SOUND_EFFECTS_ENABLED);
3314 CLONE_TO_MANAGED_PROFILE.add(TEXT_SHOW_PASSWORD);
3315 CLONE_TO_MANAGED_PROFILE.add(TIME_12_24);
3316 }
3317
3318 /** @hide */
3319 public static void getCloneToManagedProfileSettings(Set<String> outKeySet) {
3320 outKeySet.addAll(CLONE_TO_MANAGED_PROFILE);
3321 }
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07003322
3323 /**
Sailesh Nepal1bd78762014-02-11 22:32:21 -08003324 * When to use Wi-Fi calling
3325 *
3326 * @see android.telephony.TelephonyManager.WifiCallingChoices
3327 * @hide
3328 */
3329 public static final String WHEN_TO_MAKE_WIFI_CALLS = "when_to_make_wifi_calls";
3330
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003331 // Settings moved to Settings.Secure
3332
3333 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003334 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003335 * instead
3336 */
3337 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003338 public static final String ADB_ENABLED = Global.ADB_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003339
3340 /**
3341 * @deprecated Use {@link android.provider.Settings.Secure#ANDROID_ID} instead
3342 */
3343 @Deprecated
3344 public static final String ANDROID_ID = Secure.ANDROID_ID;
3345
3346 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003347 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003348 */
3349 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003350 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003351
3352 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003353 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003354 */
3355 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003356 public static final String DATA_ROAMING = Global.DATA_ROAMING;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003357
3358 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003359 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003360 */
3361 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003362 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003363
3364 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07003365 * @deprecated Use {@link android.provider.Settings.Global#HTTP_PROXY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003366 */
3367 @Deprecated
Jeff Sharkey625239a2012-09-26 22:03:49 -07003368 public static final String HTTP_PROXY = Global.HTTP_PROXY;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003369
3370 /**
Christopher Tateaa036a22014-05-19 16:33:27 -07003371 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003372 */
3373 @Deprecated
Christopher Tateaa036a22014-05-19 16:33:27 -07003374 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003375
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003376 /**
3377 * @deprecated Use {@link android.provider.Settings.Secure#LOCATION_PROVIDERS_ALLOWED}
3378 * instead
3379 */
3380 @Deprecated
3381 public static final String LOCATION_PROVIDERS_ALLOWED = Secure.LOCATION_PROVIDERS_ALLOWED;
3382
3383 /**
3384 * @deprecated Use {@link android.provider.Settings.Secure#LOGGING_ID} instead
3385 */
3386 @Deprecated
3387 public static final String LOGGING_ID = Secure.LOGGING_ID;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003388
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003389 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003390 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003391 */
3392 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003393 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003394
3395 /**
3396 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_ENABLED}
3397 * instead
3398 */
3399 @Deprecated
3400 public static final String PARENTAL_CONTROL_ENABLED = Secure.PARENTAL_CONTROL_ENABLED;
3401
3402 /**
3403 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_LAST_UPDATE}
3404 * instead
3405 */
3406 @Deprecated
3407 public static final String PARENTAL_CONTROL_LAST_UPDATE = Secure.PARENTAL_CONTROL_LAST_UPDATE;
3408
3409 /**
3410 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_REDIRECT_URL}
3411 * instead
3412 */
3413 @Deprecated
3414 public static final String PARENTAL_CONTROL_REDIRECT_URL =
3415 Secure.PARENTAL_CONTROL_REDIRECT_URL;
3416
3417 /**
3418 * @deprecated Use {@link android.provider.Settings.Secure#SETTINGS_CLASSNAME} instead
3419 */
3420 @Deprecated
3421 public static final String SETTINGS_CLASSNAME = Secure.SETTINGS_CLASSNAME;
3422
3423 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003424 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003425 */
3426 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003427 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003428
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003429 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003430 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003431 */
3432 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003433 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003434
Dianne Hackborn4a51c202009-08-21 15:14:02 -07003435 /**
3436 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07003437 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
Dianne Hackborn4a51c202009-08-21 15:14:02 -07003438 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003439 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003440 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 -08003441
Dianne Hackborn4a51c202009-08-21 15:14:02 -07003442 /**
3443 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07003444 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
Dianne Hackborn4a51c202009-08-21 15:14:02 -07003445 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003446 @Deprecated
3447 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
Christopher Tate06efb532012-08-24 15:29:27 -07003448 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003449
3450 /**
3451 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07003452 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003453 */
3454 @Deprecated
3455 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
Christopher Tate06efb532012-08-24 15:29:27 -07003456 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003457
3458 /**
3459 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07003460 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003461 */
3462 @Deprecated
3463 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
Christopher Tate06efb532012-08-24 15:29:27 -07003464 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003465
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003466 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003467 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003468 * instead
3469 */
3470 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003471 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 -08003472
3473 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003474 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003475 */
3476 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003477 public static final String WIFI_ON = Global.WIFI_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003478
3479 /**
3480 * @deprecated Use
3481 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE}
3482 * instead
3483 */
3484 @Deprecated
3485 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
3486 Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE;
3487
3488 /**
3489 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_AP_COUNT} instead
3490 */
3491 @Deprecated
3492 public static final String WIFI_WATCHDOG_AP_COUNT = Secure.WIFI_WATCHDOG_AP_COUNT;
3493
3494 /**
3495 * @deprecated Use
3496 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS} instead
3497 */
3498 @Deprecated
3499 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
3500 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003501
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003502 /**
3503 * @deprecated Use
3504 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED} instead
3505 */
3506 @Deprecated
3507 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
3508 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED;
3509
3510 /**
3511 * @deprecated Use
3512 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS}
3513 * instead
3514 */
3515 @Deprecated
3516 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
3517 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS;
3518
3519 /**
3520 * @deprecated Use
3521 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT} instead
3522 */
3523 @Deprecated
3524 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
3525 Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT;
3526
3527 /**
3528 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_MAX_AP_CHECKS}
3529 * instead
3530 */
3531 @Deprecated
3532 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = Secure.WIFI_WATCHDOG_MAX_AP_CHECKS;
3533
3534 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003535 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003536 */
3537 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003538 public static final String WIFI_WATCHDOG_ON = Global.WIFI_WATCHDOG_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003539
3540 /**
3541 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_COUNT} instead
3542 */
3543 @Deprecated
3544 public static final String WIFI_WATCHDOG_PING_COUNT = Secure.WIFI_WATCHDOG_PING_COUNT;
3545
3546 /**
3547 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_DELAY_MS}
3548 * instead
3549 */
3550 @Deprecated
3551 public static final String WIFI_WATCHDOG_PING_DELAY_MS = Secure.WIFI_WATCHDOG_PING_DELAY_MS;
3552
3553 /**
3554 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_TIMEOUT_MS}
3555 * instead
3556 */
3557 @Deprecated
3558 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS =
3559 Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS;
3560 }
3561
3562 /**
3563 * Secure system settings, containing system preferences that applications
3564 * can read but are not allowed to write. These are for preferences that
3565 * the user must explicitly modify through the system UI or specialized
3566 * APIs for those values, not modified directly by applications.
3567 */
3568 public static final class Secure extends NameValueTable {
3569 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_secure_version";
3570
Dianne Hackborn139748f2012-09-24 11:36:57 -07003571 /**
3572 * The content:// style URL for this table
3573 */
3574 public static final Uri CONTENT_URI =
3575 Uri.parse("content://" + AUTHORITY + "/secure");
3576
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08003577 // Populated lazily, guarded by class object:
Dianne Hackborn139748f2012-09-24 11:36:57 -07003578 private static final NameValueCache sNameValueCache = new NameValueCache(
3579 SYS_PROP_SETTING_VERSION,
3580 CONTENT_URI,
3581 CALL_METHOD_GET_SECURE,
3582 CALL_METHOD_PUT_SECURE);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003583
Amith Yamasani52c489c2012-03-28 11:42:42 -07003584 private static ILockSettings sLockSettings = null;
3585
Amith Yamasani7ab8c4a2012-04-06 09:27:12 -07003586 private static boolean sIsSystemProcess;
Amith Yamasani52c489c2012-03-28 11:42:42 -07003587 private static final HashSet<String> MOVED_TO_LOCK_SETTINGS;
Christopher Tate06efb532012-08-24 15:29:27 -07003588 private static final HashSet<String> MOVED_TO_GLOBAL;
Amith Yamasani52c489c2012-03-28 11:42:42 -07003589 static {
3590 MOVED_TO_LOCK_SETTINGS = new HashSet<String>(3);
3591 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_ENABLED);
3592 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_VISIBLE);
3593 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
Christopher Tate06efb532012-08-24 15:29:27 -07003594
3595 MOVED_TO_GLOBAL = new HashSet<String>();
3596 MOVED_TO_GLOBAL.add(Settings.Global.ADB_ENABLED);
3597 MOVED_TO_GLOBAL.add(Settings.Global.ASSISTED_GPS_ENABLED);
3598 MOVED_TO_GLOBAL.add(Settings.Global.BLUETOOTH_ON);
Christopher Tate58f41ec2013-01-11 15:40:36 -08003599 MOVED_TO_GLOBAL.add(Settings.Global.BUGREPORT_IN_POWER_MENU);
Christopher Tate06efb532012-08-24 15:29:27 -07003600 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_CELL_BROADCAST_SMS);
3601 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_ROAMING_MODE);
3602 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_SUBSCRIPTION_MODE);
3603 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_MOBILE);
3604 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_WIFI);
3605 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ROAMING);
3606 MOVED_TO_GLOBAL.add(Settings.Global.DEVELOPMENT_SETTINGS_ENABLED);
3607 MOVED_TO_GLOBAL.add(Settings.Global.DEVICE_PROVISIONED);
3608 MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_DENSITY_FORCED);
3609 MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_SIZE_FORCED);
3610 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_MAX_BYTES_OVER_MOBILE);
3611 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE);
Christopher Tate06efb532012-08-24 15:29:27 -07003612 MOVED_TO_GLOBAL.add(Settings.Global.MOBILE_DATA);
3613 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_BUCKET_DURATION);
3614 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_DELETE_AGE);
3615 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_PERSIST_BYTES);
3616 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_ROTATE_AGE);
3617 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_ENABLED);
3618 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_GLOBAL_ALERT_BYTES);
3619 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_POLL_INTERVAL);
Christopher Tate06efb532012-08-24 15:29:27 -07003620 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_SAMPLE_ENABLED);
3621 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_TIME_CACHE_MAX_AGE);
3622 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_BUCKET_DURATION);
3623 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_DELETE_AGE);
3624 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_PERSIST_BYTES);
3625 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_ROTATE_AGE);
3626 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_BUCKET_DURATION);
3627 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_DELETE_AGE);
3628 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_PERSIST_BYTES);
3629 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_ROTATE_AGE);
3630 MOVED_TO_GLOBAL.add(Settings.Global.NETWORK_PREFERENCE);
3631 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_DIFF);
3632 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_SPACING);
3633 MOVED_TO_GLOBAL.add(Settings.Global.NTP_SERVER);
3634 MOVED_TO_GLOBAL.add(Settings.Global.NTP_TIMEOUT);
3635 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_ERROR_POLL_COUNT);
3636 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_LONG_POLL_INTERVAL_MS);
3637 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT);
3638 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_POLL_INTERVAL_MS);
3639 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_TRIGGER_PACKET_COUNT);
3640 MOVED_TO_GLOBAL.add(Settings.Global.SAMPLING_PROFILER_MS);
3641 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DATA_SERVICE_URL);
3642 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_REDIR_HOST);
3643 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_TARGET_URL);
3644 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_APN);
3645 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_REQUIRED);
3646 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_SUPPORTED);
Christopher Tate06efb532012-08-24 15:29:27 -07003647 MOVED_TO_GLOBAL.add(Settings.Global.USB_MASS_STORAGE_ENABLED);
3648 MOVED_TO_GLOBAL.add(Settings.Global.USE_GOOGLE_MAIL);
Robert Greenwalt3ea0c992013-10-03 21:13:49 +00003649 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_COUNTRY_CODE);
Christopher Tate06efb532012-08-24 15:29:27 -07003650 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FRAMEWORK_SCAN_INTERVAL_MS);
3651 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FREQUENCY_BAND);
3652 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_IDLE_MS);
3653 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MAX_DHCP_RETRY_COUNT);
3654 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS);
3655 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
3656 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
3657 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NUM_OPEN_NETWORKS_KEPT);
3658 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ON);
3659 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_P2P_DEVICE_NAME);
3660 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SAVED_STATE);
3661 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUPPLICANT_SCAN_INTERVAL_MS);
3662 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUSPEND_OPTIMIZATIONS_ENABLED);
vandwalle7c3606c2014-03-31 19:12:07 -07003663 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ENHANCED_AUTO_JOIN);
3664 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORK_SHOW_RSSI);
Christopher Tate06efb532012-08-24 15:29:27 -07003665 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_ON);
3666 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED);
Christopher Tate06efb532012-08-24 15:29:27 -07003667 MOVED_TO_GLOBAL.add(Settings.Global.WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON);
Christopher Tatec868b642012-09-12 17:41:04 -07003668 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_ENABLE);
3669 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_TIMEOUT);
3670 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_DEFAULT_RESPONSE);
3671 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS);
3672 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS);
3673 MOVED_TO_GLOBAL.add(Settings.Global.GPRS_REGISTER_CHECK_PERIOD_MS);
Christopher Tate06efb532012-08-24 15:29:27 -07003674 MOVED_TO_GLOBAL.add(Settings.Global.WTF_IS_FATAL);
Jeff Sharkey625239a2012-09-26 22:03:49 -07003675 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_DURATION_THRESHOLD);
3676 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_THRESHOLD);
3677 MOVED_TO_GLOBAL.add(Settings.Global.SEND_ACTION_APP_ERROR);
3678 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_AGE_SECONDS);
3679 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_MAX_FILES);
3680 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_KB);
3681 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_PERCENT);
3682 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_RESERVE_PERCENT);
3683 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_TAG_PREFIX);
3684 MOVED_TO_GLOBAL.add(Settings.Global.ERROR_LOGCAT_PREFIX);
3685 MOVED_TO_GLOBAL.add(Settings.Global.SYS_FREE_STORAGE_LOG_INTERVAL);
3686 MOVED_TO_GLOBAL.add(Settings.Global.DISK_FREE_CHANGE_REPORTING_THRESHOLD);
3687 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_PERCENTAGE);
3688 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_MAX_BYTES);
3689 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_FULL_THRESHOLD_BYTES);
3690 MOVED_TO_GLOBAL.add(Settings.Global.SYNC_MAX_RETRY_DELAY_IN_SECONDS);
3691 MOVED_TO_GLOBAL.add(Settings.Global.CONNECTIVITY_CHANGE_DELAY);
3692 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED);
3693 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_SERVER);
3694 MOVED_TO_GLOBAL.add(Settings.Global.NSD_ON);
3695 MOVED_TO_GLOBAL.add(Settings.Global.SET_INSTALL_LOCATION);
3696 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_INSTALL_LOCATION);
3697 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_UP_DELAY);
3698 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_DOWN_DELAY);
3699 MOVED_TO_GLOBAL.add(Settings.Global.READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT);
3700 MOVED_TO_GLOBAL.add(Settings.Global.HTTP_PROXY);
3701 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_HOST);
3702 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_PORT);
3703 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST);
3704 MOVED_TO_GLOBAL.add(Settings.Global.SET_GLOBAL_HTTP_PROXY);
3705 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_DNS_SERVER);
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003706 MOVED_TO_GLOBAL.add(Settings.Global.PREFERRED_NETWORK_MODE);
Hui Shu22671772014-10-01 21:41:07 +00003707 MOVED_TO_GLOBAL.add(Settings.Global.WEBVIEW_DATA_REDUCTION_PROXY_KEY);
Christopher Tate06efb532012-08-24 15:29:27 -07003708 }
3709
Christopher Tate66488d62012-10-02 11:58:01 -07003710 /** @hide */
Svetoslav683914b2015-01-15 14:22:26 -08003711 public static void getMovedToGlobalSettings(Set<String> outKeySet) {
Christopher Tate66488d62012-10-02 11:58:01 -07003712 outKeySet.addAll(MOVED_TO_GLOBAL);
3713 }
3714
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003715 /**
3716 * Look up a name in the database.
3717 * @param resolver to access the database with
3718 * @param name to look up in the table
3719 * @return the corresponding value, or null if not present
3720 */
Dianne Hackborn139748f2012-09-24 11:36:57 -07003721 public static String getString(ContentResolver resolver, String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07003722 return getStringForUser(resolver, name, UserHandle.myUserId());
3723 }
3724
3725 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -07003726 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -07003727 int userHandle) {
3728 if (MOVED_TO_GLOBAL.contains(name)) {
3729 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
3730 + " to android.provider.Settings.Global.");
3731 return Global.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003732 }
Amith Yamasani52c489c2012-03-28 11:42:42 -07003733
Dianne Hackborn139748f2012-09-24 11:36:57 -07003734 if (MOVED_TO_LOCK_SETTINGS.contains(name)) {
3735 synchronized (Secure.class) {
3736 if (sLockSettings == null) {
3737 sLockSettings = ILockSettings.Stub.asInterface(
3738 (IBinder) ServiceManager.getService("lock_settings"));
3739 sIsSystemProcess = Process.myUid() == Process.SYSTEM_UID;
3740 }
3741 }
3742 if (sLockSettings != null && !sIsSystemProcess) {
3743 try {
3744 return sLockSettings.getString(name, "0", userHandle);
3745 } catch (RemoteException re) {
3746 // Fall through
3747 }
Amith Yamasani52c489c2012-03-28 11:42:42 -07003748 }
3749 }
3750
Christopher Tate06efb532012-08-24 15:29:27 -07003751 return sNameValueCache.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003752 }
3753
3754 /**
3755 * Store a name/value pair into the database.
3756 * @param resolver to access the database with
3757 * @param name to store
3758 * @param value to associate with the name
3759 * @return true if the value was set, false on database errors
3760 */
Christopher Tate06efb532012-08-24 15:29:27 -07003761 public static boolean putString(ContentResolver resolver, String name, String value) {
3762 return putStringForUser(resolver, name, value, UserHandle.myUserId());
3763 }
3764
3765 /** @hide */
3766 public static boolean putStringForUser(ContentResolver resolver, String name, String value,
3767 int userHandle) {
Julia Reynolds82735bc2014-09-04 16:43:30 -04003768 if (LOCATION_MODE.equals(name)) {
3769 // HACK ALERT: temporary hack to work around b/10491283.
3770 // TODO: once b/10491283 fixed, remove this hack
3771 return setLocationModeForUser(resolver, Integer.parseInt(value), userHandle);
3772 }
Christopher Tate06efb532012-08-24 15:29:27 -07003773 if (MOVED_TO_GLOBAL.contains(name)) {
3774 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
3775 + " to android.provider.Settings.Global");
3776 return Global.putStringForUser(resolver, name, value, userHandle);
3777 }
Christopher Tate06efb532012-08-24 15:29:27 -07003778 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003779 }
3780
3781 /**
3782 * Construct the content URI for a particular name/value pair,
3783 * useful for monitoring changes with a ContentObserver.
3784 * @param name to look up in the table
3785 * @return the corresponding content URI, or null if not present
3786 */
3787 public static Uri getUriFor(String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07003788 if (MOVED_TO_GLOBAL.contains(name)) {
3789 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
3790 + " to android.provider.Settings.Global, returning global URI.");
3791 return Global.getUriFor(Global.CONTENT_URI, name);
3792 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003793 return getUriFor(CONTENT_URI, name);
3794 }
3795
3796 /**
3797 * Convenience function for retrieving a single secure settings value
3798 * as an integer. Note that internally setting values are always
3799 * stored as strings; this function converts the string to an integer
3800 * for you. The default value will be returned if the setting is
3801 * not defined or not an integer.
3802 *
3803 * @param cr The ContentResolver to access.
3804 * @param name The name of the setting to retrieve.
3805 * @param def Value to return if the setting is not defined.
3806 *
3807 * @return The setting's current value, or 'def' if it is not defined
3808 * or not a valid integer.
3809 */
3810 public static int getInt(ContentResolver cr, String name, int def) {
Christopher Tate06efb532012-08-24 15:29:27 -07003811 return getIntForUser(cr, name, def, UserHandle.myUserId());
3812 }
3813
3814 /** @hide */
3815 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
Tom O'Neill7f6f4572013-08-27 10:53:15 -07003816 if (LOCATION_MODE.equals(name)) {
3817 // HACK ALERT: temporary hack to work around b/10491283.
3818 // TODO: once b/10491283 fixed, remove this hack
3819 return getLocationModeForUser(cr, userHandle);
3820 }
Christopher Tate06efb532012-08-24 15:29:27 -07003821 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003822 try {
3823 return v != null ? Integer.parseInt(v) : def;
3824 } catch (NumberFormatException e) {
3825 return def;
3826 }
3827 }
3828
3829 /**
3830 * Convenience function for retrieving a single secure settings value
3831 * as an integer. Note that internally setting values are always
3832 * stored as strings; this function converts the string to an integer
3833 * for you.
3834 * <p>
3835 * This version does not take a default value. If the setting has not
3836 * been set, or the string value is not a number,
3837 * it throws {@link SettingNotFoundException}.
3838 *
3839 * @param cr The ContentResolver to access.
3840 * @param name The name of the setting to retrieve.
3841 *
3842 * @throws SettingNotFoundException Thrown if a setting by the given
3843 * name can't be found or the setting value is not an integer.
3844 *
3845 * @return The setting's current value.
3846 */
3847 public static int getInt(ContentResolver cr, String name)
3848 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07003849 return getIntForUser(cr, name, UserHandle.myUserId());
3850 }
3851
3852 /** @hide */
3853 public static int getIntForUser(ContentResolver cr, String name, int userHandle)
3854 throws SettingNotFoundException {
Tom O'Neill7f6f4572013-08-27 10:53:15 -07003855 if (LOCATION_MODE.equals(name)) {
3856 // HACK ALERT: temporary hack to work around b/10491283.
3857 // TODO: once b/10491283 fixed, remove this hack
3858 return getLocationModeForUser(cr, userHandle);
3859 }
Christopher Tate06efb532012-08-24 15:29:27 -07003860 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003861 try {
3862 return Integer.parseInt(v);
3863 } catch (NumberFormatException e) {
3864 throw new SettingNotFoundException(name);
3865 }
3866 }
3867
3868 /**
3869 * Convenience function for updating a single settings value as an
3870 * integer. This will either create a new entry in the table if the
3871 * given name does not exist, or modify the value of the existing row
3872 * with that name. Note that internally setting values are always
3873 * stored as strings, so this function converts the given value to a
3874 * string before storing it.
3875 *
3876 * @param cr The ContentResolver to access.
3877 * @param name The name of the setting to modify.
3878 * @param value The new value for the setting.
3879 * @return true if the value was set, false on database errors
3880 */
3881 public static boolean putInt(ContentResolver cr, String name, int value) {
Christopher Tate06efb532012-08-24 15:29:27 -07003882 return putIntForUser(cr, name, value, UserHandle.myUserId());
3883 }
3884
3885 /** @hide */
3886 public static boolean putIntForUser(ContentResolver cr, String name, int value,
3887 int userHandle) {
3888 return putStringForUser(cr, name, Integer.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003889 }
3890
3891 /**
3892 * Convenience function for retrieving a single secure settings value
3893 * as a {@code long}. Note that internally setting values are always
3894 * stored as strings; this function converts the string to a {@code long}
3895 * for you. The default value will be returned if the setting is
3896 * not defined or not a {@code long}.
3897 *
3898 * @param cr The ContentResolver to access.
3899 * @param name The name of the setting to retrieve.
3900 * @param def Value to return if the setting is not defined.
3901 *
3902 * @return The setting's current value, or 'def' if it is not defined
3903 * or not a valid {@code long}.
3904 */
3905 public static long getLong(ContentResolver cr, String name, long def) {
Christopher Tate06efb532012-08-24 15:29:27 -07003906 return getLongForUser(cr, name, def, UserHandle.myUserId());
3907 }
3908
3909 /** @hide */
3910 public static long getLongForUser(ContentResolver cr, String name, long def,
3911 int userHandle) {
3912 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003913 long value;
3914 try {
3915 value = valString != null ? Long.parseLong(valString) : def;
3916 } catch (NumberFormatException e) {
3917 value = def;
3918 }
3919 return value;
3920 }
3921
3922 /**
3923 * Convenience function for retrieving a single secure settings value
3924 * as a {@code long}. Note that internally setting values are always
3925 * stored as strings; this function converts the string to a {@code long}
3926 * for you.
3927 * <p>
3928 * This version does not take a default value. If the setting has not
3929 * been set, or the string value is not a number,
3930 * it throws {@link SettingNotFoundException}.
3931 *
3932 * @param cr The ContentResolver to access.
3933 * @param name The name of the setting to retrieve.
3934 *
3935 * @return The setting's current value.
3936 * @throws SettingNotFoundException Thrown if a setting by the given
3937 * name can't be found or the setting value is not an integer.
3938 */
3939 public static long getLong(ContentResolver cr, String name)
3940 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07003941 return getLongForUser(cr, name, UserHandle.myUserId());
3942 }
3943
3944 /** @hide */
3945 public static long getLongForUser(ContentResolver cr, String name, int userHandle)
3946 throws SettingNotFoundException {
3947 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003948 try {
3949 return Long.parseLong(valString);
3950 } catch (NumberFormatException e) {
3951 throw new SettingNotFoundException(name);
3952 }
3953 }
3954
3955 /**
3956 * Convenience function for updating a secure settings value as a long
3957 * integer. This will either create a new entry in the table if the
3958 * given name does not exist, or modify the value of the existing row
3959 * with that name. Note that internally setting values are always
3960 * stored as strings, so this function converts the given value to a
3961 * string before storing it.
3962 *
3963 * @param cr The ContentResolver to access.
3964 * @param name The name of the setting to modify.
3965 * @param value The new value for the setting.
3966 * @return true if the value was set, false on database errors
3967 */
3968 public static boolean putLong(ContentResolver cr, String name, long value) {
Christopher Tate06efb532012-08-24 15:29:27 -07003969 return putLongForUser(cr, name, value, UserHandle.myUserId());
3970 }
3971
3972 /** @hide */
3973 public static boolean putLongForUser(ContentResolver cr, String name, long value,
3974 int userHandle) {
3975 return putStringForUser(cr, name, Long.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003976 }
3977
3978 /**
3979 * Convenience function for retrieving a single secure settings value
3980 * as a floating point number. Note that internally setting values are
3981 * always stored as strings; this function converts the string to an
3982 * float for you. The default value will be returned if the setting
3983 * is not defined or not a valid float.
3984 *
3985 * @param cr The ContentResolver to access.
3986 * @param name The name of the setting to retrieve.
3987 * @param def Value to return if the setting is not defined.
3988 *
3989 * @return The setting's current value, or 'def' if it is not defined
3990 * or not a valid float.
3991 */
3992 public static float getFloat(ContentResolver cr, String name, float def) {
Christopher Tate06efb532012-08-24 15:29:27 -07003993 return getFloatForUser(cr, name, def, UserHandle.myUserId());
3994 }
3995
3996 /** @hide */
3997 public static float getFloatForUser(ContentResolver cr, String name, float def,
3998 int userHandle) {
3999 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004000 try {
4001 return v != null ? Float.parseFloat(v) : def;
4002 } catch (NumberFormatException e) {
4003 return def;
4004 }
4005 }
4006
4007 /**
4008 * Convenience function for retrieving a single secure settings value
4009 * as a float. Note that internally setting values are always
4010 * stored as strings; this function converts the string to a float
4011 * for you.
4012 * <p>
4013 * This version does not take a default value. If the setting has not
4014 * been set, or the string value is not a number,
4015 * it throws {@link SettingNotFoundException}.
4016 *
4017 * @param cr The ContentResolver to access.
4018 * @param name The name of the setting to retrieve.
4019 *
4020 * @throws SettingNotFoundException Thrown if a setting by the given
4021 * name can't be found or the setting value is not a float.
4022 *
4023 * @return The setting's current value.
4024 */
4025 public static float getFloat(ContentResolver cr, String name)
4026 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07004027 return getFloatForUser(cr, name, UserHandle.myUserId());
4028 }
4029
4030 /** @hide */
4031 public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
4032 throws SettingNotFoundException {
4033 String v = getStringForUser(cr, name, userHandle);
Brian Muramatsue1d46982010-12-06 17:34:20 -08004034 if (v == null) {
4035 throw new SettingNotFoundException(name);
4036 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004037 try {
4038 return Float.parseFloat(v);
4039 } catch (NumberFormatException e) {
4040 throw new SettingNotFoundException(name);
4041 }
4042 }
4043
4044 /**
4045 * Convenience function for updating a single settings value as a
4046 * floating point number. This will either create a new entry in the
4047 * table if the given name does not exist, or modify the value of the
4048 * existing row with that name. Note that internally setting values
4049 * are always stored as strings, so this function converts the given
4050 * value to a string before storing it.
4051 *
4052 * @param cr The ContentResolver to access.
4053 * @param name The name of the setting to modify.
4054 * @param value The new value for the setting.
4055 * @return true if the value was set, false on database errors
4056 */
4057 public static boolean putFloat(ContentResolver cr, String name, float value) {
Christopher Tate06efb532012-08-24 15:29:27 -07004058 return putFloatForUser(cr, name, value, UserHandle.myUserId());
4059 }
4060
4061 /** @hide */
4062 public static boolean putFloatForUser(ContentResolver cr, String name, float value,
4063 int userHandle) {
4064 return putStringForUser(cr, name, Float.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004065 }
4066
4067 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004068 * @deprecated Use {@link android.provider.Settings.Global#DEVELOPMENT_SETTINGS_ENABLED}
4069 * instead
Dianne Hackborn895f99e2012-02-02 11:49:12 -08004070 */
Christopher Tate06efb532012-08-24 15:29:27 -07004071 @Deprecated
4072 public static final String DEVELOPMENT_SETTINGS_ENABLED =
4073 Global.DEVELOPMENT_SETTINGS_ENABLED;
Dianne Hackborn895f99e2012-02-02 11:49:12 -08004074
4075 /**
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07004076 * When the user has enable the option to have a "bug report" command
4077 * in the power menu.
Christopher Tate58f41ec2013-01-11 15:40:36 -08004078 * @deprecated Use {@link android.provider.Settings.Global#BUGREPORT_IN_POWER_MENU} instead
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07004079 * @hide
4080 */
Christopher Tate58f41ec2013-01-11 15:40:36 -08004081 @Deprecated
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07004082 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
4083
4084 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004085 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004086 */
Christopher Tate06efb532012-08-24 15:29:27 -07004087 @Deprecated
4088 public static final String ADB_ENABLED = Global.ADB_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004089
4090 /**
4091 * Setting to allow mock locations and location provider status to be injected into the
4092 * LocationManager service for testing purposes during application development. These
4093 * locations and status values override actual location and status information generated
4094 * by network, gps, or other location providers.
4095 */
4096 public static final String ALLOW_MOCK_LOCATION = "mock_location";
4097
4098 /**
Doug Zongkerd8893db2010-01-26 12:29:44 -08004099 * A 64-bit number (as a hex string) that is randomly
Scott Main44895332013-11-12 09:23:13 -08004100 * generated when the user first sets up the device and should remain
4101 * constant for the lifetime of the user's device. The value may
4102 * change if a factory reset is performed on the device.
4103 * <p class="note"><strong>Note:</strong> When a device has <a
4104 * href="{@docRoot}about/versions/android-4.2.html#MultipleUsers">multiple users</a>
4105 * (available on certain devices running Android 4.2 or higher), each user appears as a
4106 * completely separate device, so the {@code ANDROID_ID} value is unique to each
4107 * user.</p>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004108 */
4109 public static final String ANDROID_ID = "android_id";
4110
4111 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004112 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004113 */
Christopher Tate06efb532012-08-24 15:29:27 -07004114 @Deprecated
4115 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004116
4117 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004118 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004119 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07004120 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07004121 public static final String DATA_ROAMING = Global.DATA_ROAMING;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004122
4123 /**
4124 * Setting to record the input method used by default, holding the ID
4125 * of the desired method.
4126 */
4127 public static final String DEFAULT_INPUT_METHOD = "default_input_method";
4128
4129 /**
satokab751aa2010-09-14 19:17:36 +09004130 * Setting to record the input method subtype used by default, holding the ID
4131 * of the desired method.
4132 */
4133 public static final String SELECTED_INPUT_METHOD_SUBTYPE =
4134 "selected_input_method_subtype";
4135
4136 /**
satok723a27e2010-11-11 14:58:11 +09004137 * Setting to record the history of input method subtype, holding the pair of ID of IME
4138 * and its last used subtype.
4139 * @hide
4140 */
4141 public static final String INPUT_METHODS_SUBTYPE_HISTORY =
4142 "input_methods_subtype_history";
4143
4144 /**
satok5c58dfc2010-12-14 21:54:47 +09004145 * Setting to record the visibility of input method selector
4146 */
4147 public static final String INPUT_METHOD_SELECTOR_VISIBILITY =
4148 "input_method_selector_visibility";
4149
4150 /**
Dianne Hackborn91097de2014-04-04 18:02:06 -07004151 * The currently selected voice interaction service flattened ComponentName.
4152 * @hide
4153 */
4154 public static final String VOICE_INTERACTION_SERVICE = "voice_interaction_service";
4155
4156 /**
Zhihai Xuaf5971e2013-06-10 20:28:31 -07004157 * bluetooth HCI snoop log configuration
4158 * @hide
4159 */
4160 public static final String BLUETOOTH_HCI_LOG =
4161 "bluetooth_hci_log";
4162
4163 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004164 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004165 */
Christopher Tate06efb532012-08-24 15:29:27 -07004166 @Deprecated
4167 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004168
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004169 /**
Russell Brennerde6ae442012-09-26 20:53:10 -07004170 * Whether the current user has been set up via setup wizard (0 = false, 1 = true)
4171 * @hide
4172 */
4173 public static final String USER_SETUP_COMPLETE = "user_setup_complete";
4174
4175 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004176 * List of input methods that are currently enabled. This is a string
4177 * containing the IDs of all enabled input methods, each ID separated
4178 * by ':'.
4179 */
4180 public static final String ENABLED_INPUT_METHODS = "enabled_input_methods";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004181
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004182 /**
Amith Yamasanie861ec12010-03-24 21:39:27 -07004183 * List of system input methods that are currently disabled. This is a string
4184 * containing the IDs of all disabled input methods, each ID separated
4185 * by ':'.
4186 * @hide
4187 */
4188 public static final String DISABLED_SYSTEM_INPUT_METHODS = "disabled_system_input_methods";
4189
4190 /**
Michael Wright7b5a96b2014-08-09 19:28:42 -07004191 * Whether to show the IME when a hard keyboard is connected. This is a boolean that
4192 * determines if the IME should be shown when a hard keyboard is attached.
4193 * @hide
4194 */
4195 public static final String SHOW_IME_WITH_HARD_KEYBOARD = "show_ime_with_hard_keyboard";
4196
4197 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07004198 * Host name and port for global http proxy. Uses ':' seperator for
4199 * between host and port.
4200 *
4201 * @deprecated Use {@link Global#HTTP_PROXY}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004202 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07004203 @Deprecated
4204 public static final String HTTP_PROXY = Global.HTTP_PROXY;
Robert Greenwalte90aa5e2010-09-01 11:34:05 -07004205
4206 /**
Christopher Tateaa036a22014-05-19 16:33:27 -07004207 * Whether applications can be installed for this user via the system's
4208 * {@link Intent#ACTION_INSTALL_PACKAGE} mechanism.
4209 *
4210 * <p>1 = permit app installation via the system package installer intent
4211 * <p>0 = do not allow use of the package installer
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004212 */
Christopher Tateaa036a22014-05-19 16:33:27 -07004213 public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004214
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004215 /**
Tom O'Neill923c0dc2014-03-03 11:07:55 -08004216 * Comma-separated list of location providers that activities may access. Do not rely on
4217 * this value being present in settings.db or on ContentObserver notifications on the
4218 * corresponding Uri.
Tom O'Neilla324ac72013-08-26 14:40:23 -07004219 *
Tom O'Neill923c0dc2014-03-03 11:07:55 -08004220 * @deprecated use {@link #LOCATION_MODE} and
4221 * {@link LocationManager#MODE_CHANGED_ACTION} (or
4222 * {@link LocationManager#PROVIDERS_CHANGED_ACTION})
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004223 */
Tom O'Neilla324ac72013-08-26 14:40:23 -07004224 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004225 public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004226
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004227 /**
Tom O'Neill7f6f4572013-08-27 10:53:15 -07004228 * The degree of location access enabled by the user.
Tom O'Neill923c0dc2014-03-03 11:07:55 -08004229 * <p>
Tom O'Neill7f6f4572013-08-27 10:53:15 -07004230 * When used with {@link #putInt(ContentResolver, String, int)}, must be one of {@link
4231 * #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY}, {@link
4232 * #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}. When used with {@link
4233 * #getInt(ContentResolver, String)}, the caller must gracefully handle additional location
4234 * modes that might be added in the future.
Tom O'Neill923c0dc2014-03-03 11:07:55 -08004235 * <p>
4236 * Note: do not rely on this value being present in settings.db or on ContentObserver
4237 * notifications for the corresponding Uri. Use {@link LocationManager#MODE_CHANGED_ACTION}
4238 * to receive changes in this value.
Tom O'Neilla324ac72013-08-26 14:40:23 -07004239 */
4240 public static final String LOCATION_MODE = "location_mode";
4241
4242 /**
Tom O'Neill7f6f4572013-08-27 10:53:15 -07004243 * Location access disabled.
Tom O'Neill1f48b782013-08-19 18:14:56 -07004244 */
4245 public static final int LOCATION_MODE_OFF = 0;
4246 /**
4247 * Network Location Provider disabled, but GPS and other sensors enabled.
4248 */
4249 public static final int LOCATION_MODE_SENSORS_ONLY = 1;
4250 /**
Tom O'Neilld5759432013-09-11 11:03:03 -07004251 * Reduced power usage, such as limiting the number of GPS updates per hour. Requests
4252 * with {@link android.location.Criteria#POWER_HIGH} may be downgraded to
4253 * {@link android.location.Criteria#POWER_MEDIUM}.
Tom O'Neill1f48b782013-08-19 18:14:56 -07004254 */
4255 public static final int LOCATION_MODE_BATTERY_SAVING = 2;
4256 /**
4257 * Best-effort location computation allowed.
4258 */
4259 public static final int LOCATION_MODE_HIGH_ACCURACY = 3;
4260
4261 /**
Danielle Millett925a7d82012-03-19 18:02:20 -04004262 * A flag containing settings used for biometric weak
4263 * @hide
4264 */
Adrian Roos230635e2015-01-07 20:50:29 +01004265 @Deprecated
Danielle Millett925a7d82012-03-19 18:02:20 -04004266 public static final String LOCK_BIOMETRIC_WEAK_FLAGS =
4267 "lock_biometric_weak_flags";
4268
4269 /**
Jason Monk94cfd9d2014-10-31 13:18:21 -04004270 * Whether lock-to-app will lock the keyguard when exiting.
4271 * @hide
4272 */
4273 public static final String LOCK_TO_APP_EXIT_LOCKED = "lock_to_app_exit_locked";
4274
4275 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08004276 * Whether autolock is enabled (0 = false, 1 = true)
Adrian Roos9dd16eb2015-01-08 16:20:49 +01004277 *
4278 * @deprecated Use {@link android.app.KeyguardManager} to determine the state and security
4279 * level of the keyguard.
Amith Yamasani156c4352010-03-05 17:10:03 -08004280 */
Adrian Roos9dd16eb2015-01-08 16:20:49 +01004281 @Deprecated
Amith Yamasani156c4352010-03-05 17:10:03 -08004282 public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock";
4283
4284 /**
4285 * Whether lock pattern is visible as user enters (0 = false, 1 = true)
4286 */
4287 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
4288
4289 /**
Jeff Sharkey5ed9d682012-10-10 14:28:27 -07004290 * Whether lock pattern will vibrate as user enters (0 = false, 1 =
4291 * true)
4292 *
4293 * @deprecated Starting in {@link VERSION_CODES#JELLY_BEAN_MR1} the
4294 * lockscreen uses
4295 * {@link Settings.System#HAPTIC_FEEDBACK_ENABLED}.
Amith Yamasani156c4352010-03-05 17:10:03 -08004296 */
Jeff Sharkey5ed9d682012-10-10 14:28:27 -07004297 @Deprecated
4298 public static final String
4299 LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = "lock_pattern_tactile_feedback_enabled";
Amith Yamasani156c4352010-03-05 17:10:03 -08004300
4301 /**
Jim Millerbc4603b2010-08-30 21:21:34 -07004302 * This preference allows the device to be locked given time after screen goes off,
4303 * subject to current DeviceAdmin policy limits.
4304 * @hide
4305 */
4306 public static final String LOCK_SCREEN_LOCK_AFTER_TIMEOUT = "lock_screen_lock_after_timeout";
4307
4308
4309 /**
John Spurlock5f050e52012-10-27 10:44:19 -04004310 * This preference contains the string that shows for owner info on LockScreen.
Jim Miller253a5ef2010-10-13 20:57:29 -07004311 * @hide
Jim Miller187ec582013-04-15 18:27:54 -07004312 * @deprecated
Jim Miller253a5ef2010-10-13 20:57:29 -07004313 */
4314 public static final String LOCK_SCREEN_OWNER_INFO = "lock_screen_owner_info";
4315
4316 /**
John Spurlock5f050e52012-10-27 10:44:19 -04004317 * Ids of the user-selected appwidgets on the lockscreen (comma-delimited).
Jim Millerf229e4d2012-09-12 20:32:50 -07004318 * @hide
4319 */
Adrian Roos230635e2015-01-07 20:50:29 +01004320 @Deprecated
Michael Jurkaaa2859a2012-10-24 12:46:49 -07004321 public static final String LOCK_SCREEN_APPWIDGET_IDS =
4322 "lock_screen_appwidget_ids";
Jim Millerf229e4d2012-09-12 20:32:50 -07004323
4324 /**
Jim Miller08fa40c2014-04-29 18:18:47 -07004325 * List of enrolled fingerprint identifiers (comma-delimited).
4326 * @hide
4327 */
4328 public static final String USER_FINGERPRINT_IDS = "user_fingerprint_ids";
4329
4330 /**
Jim Miller51117262012-11-04 17:58:09 -08004331 * Id of the appwidget shown on the lock screen when appwidgets are disabled.
4332 * @hide
4333 */
Adrian Roos230635e2015-01-07 20:50:29 +01004334 @Deprecated
Jim Miller51117262012-11-04 17:58:09 -08004335 public static final String LOCK_SCREEN_FALLBACK_APPWIDGET_ID =
4336 "lock_screen_fallback_appwidget_id";
4337
4338 /**
John Spurlock5f050e52012-10-27 10:44:19 -04004339 * Index of the lockscreen appwidget to restore, -1 if none.
4340 * @hide
4341 */
Adrian Roos230635e2015-01-07 20:50:29 +01004342 @Deprecated
John Spurlock5f050e52012-10-27 10:44:19 -04004343 public static final String LOCK_SCREEN_STICKY_APPWIDGET =
4344 "lock_screen_sticky_appwidget";
4345
4346 /**
4347 * This preference enables showing the owner info on LockScreen.
Jim Miller253a5ef2010-10-13 20:57:29 -07004348 * @hide
Jim Miller187ec582013-04-15 18:27:54 -07004349 * @deprecated
Jim Miller253a5ef2010-10-13 20:57:29 -07004350 */
4351 public static final String LOCK_SCREEN_OWNER_INFO_ENABLED =
4352 "lock_screen_owner_info_enabled";
4353
4354 /**
Dan Sandler5d7c3cc2014-02-18 17:35:15 -05004355 * When set by a user, allows notifications to be shown atop a securely locked screen
4356 * in their full "private" form (same as when the device is unlocked).
Dan Sandlerfd16d562014-02-13 18:43:31 -08004357 * @hide
4358 */
4359 public static final String LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS =
4360 "lock_screen_allow_private_notifications";
4361
4362 /**
Chris Wrencd8f4f72014-08-27 18:48:13 -04004363 * Set by the system to track if the user needs to see the call to action for
4364 * the lockscreen notification policy.
4365 * @hide
4366 */
4367 public static final String SHOW_NOTE_ABOUT_NOTIFICATION_HIDING =
4368 "show_note_about_notification_hiding";
4369
4370 /**
Adrian Roos3870d452014-09-05 18:22:28 +02004371 * Set to 1 by the system after trust agents have been initialized.
4372 * @hide
4373 */
4374 public static final String TRUST_AGENTS_INITIALIZED =
4375 "trust_agents_initialized";
4376
4377 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004378 * The Logging ID (a unique 64-bit value) as a hex string.
4379 * Used as a pseudonymous identifier for logging.
4380 * @deprecated This identifier is poorly initialized and has
4381 * many collisions. It should not be used.
4382 */
4383 @Deprecated
4384 public static final String LOGGING_ID = "logging_id";
4385
4386 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004387 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004388 */
Christopher Tate06efb532012-08-24 15:29:27 -07004389 @Deprecated
4390 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004391
4392 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08004393 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004394 */
4395 public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004396
4397 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08004398 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004399 */
4400 public static final String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004401
4402 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08004403 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004404 */
4405 public static final String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004406
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004407 /**
4408 * Settings classname to launch when Settings is clicked from All
4409 * Applications. Needed because of user testing between the old
4410 * and new Settings apps.
4411 */
4412 // TODO: 881807
4413 public static final String SETTINGS_CLASSNAME = "settings_classname";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004414
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004415 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004416 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004417 */
Christopher Tate06efb532012-08-24 15:29:27 -07004418 @Deprecated
4419 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004420
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004421 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004422 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004423 */
Christopher Tate06efb532012-08-24 15:29:27 -07004424 @Deprecated
4425 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004426
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004427 /**
svetoslavganov75986cf2009-05-14 22:28:01 -07004428 * If accessibility is enabled.
4429 */
4430 public static final String ACCESSIBILITY_ENABLED = "accessibility_enabled";
4431
4432 /**
Svetoslav Ganov00aabf72011-07-21 11:35:03 -07004433 * If touch exploration is enabled.
Svetoslav Ganov35bfede2011-07-14 17:57:06 -07004434 */
Svetoslav Ganov00aabf72011-07-21 11:35:03 -07004435 public static final String TOUCH_EXPLORATION_ENABLED = "touch_exploration_enabled";
Svetoslav Ganov35bfede2011-07-14 17:57:06 -07004436
4437 /**
svetoslavganov75986cf2009-05-14 22:28:01 -07004438 * List of the enabled accessibility providers.
4439 */
4440 public static final String ENABLED_ACCESSIBILITY_SERVICES =
4441 "enabled_accessibility_services";
4442
4443 /**
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07004444 * List of the accessibility services to which the user has granted
Svetoslav Ganov9a4c5cd2012-05-30 14:06:32 -07004445 * permission to put the device into touch exploration mode.
4446 *
4447 * @hide
4448 */
4449 public static final String TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES =
4450 "touch_exploration_granted_accessibility_services";
4451
4452 /**
Svetoslav Ganov55f937a2011-12-05 11:42:07 -08004453 * Whether to speak passwords while in accessibility mode.
4454 */
4455 public static final String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password";
4456
4457 /**
Chris Craikcce47eb2014-07-16 15:12:15 -07004458 * Whether to draw text with high contrast while in accessibility mode.
4459 *
4460 * @hide
4461 */
4462 public static final String ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED =
4463 "high_text_contrast_enabled";
4464
4465 /**
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08004466 * If injection of accessibility enhancing JavaScript screen-reader
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07004467 * is enabled.
4468 * <p>
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08004469 * Note: The JavaScript based screen-reader is served by the
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07004470 * Google infrastructure and enable users with disabilities to
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07004471 * efficiently navigate in and explore web content.
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07004472 * </p>
4473 * <p>
4474 * This property represents a boolean value.
4475 * </p>
4476 * @hide
4477 */
4478 public static final String ACCESSIBILITY_SCRIPT_INJECTION =
4479 "accessibility_script_injection";
4480
4481 /**
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08004482 * The URL for the injected JavaScript based screen-reader used
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07004483 * for providing accessibility of content in WebView.
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08004484 * <p>
4485 * Note: The JavaScript based screen-reader is served by the
4486 * Google infrastructure and enable users with disabilities to
4487 * efficiently navigate in and explore web content.
4488 * </p>
4489 * <p>
4490 * This property represents a string value.
4491 * </p>
4492 * @hide
4493 */
4494 public static final String ACCESSIBILITY_SCREEN_READER_URL =
4495 "accessibility_script_injection_url";
4496
4497 /**
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07004498 * Key bindings for navigation in built-in accessibility support for web content.
4499 * <p>
4500 * Note: These key bindings are for the built-in accessibility navigation for
4501 * web content which is used as a fall back solution if JavaScript in a WebView
4502 * is not enabled or the user has not opted-in script injection from Google.
4503 * </p>
4504 * <p>
4505 * The bindings are separated by semi-colon. A binding is a mapping from
4506 * a key to a sequence of actions (for more details look at
4507 * android.webkit.AccessibilityInjector). A key is represented as the hexademical
4508 * string representation of an integer obtained from a meta state (optional) shifted
4509 * sixteen times left and bitwise ored with a key code. An action is represented
4510 * as a hexademical string representation of an integer where the first two digits
4511 * are navigation action index, the second, the third, and the fourth digit pairs
4512 * represent the action arguments. The separate actions in a binding are colon
4513 * separated. The key and the action sequence it maps to are separated by equals.
4514 * </p>
4515 * <p>
4516 * For example, the binding below maps the DPAD right button to traverse the
4517 * current navigation axis once without firing an accessibility event and to
4518 * perform the same traversal again but to fire an event:
4519 * <code>
4520 * 0x16=0x01000100:0x01000101;
4521 * </code>
4522 * </p>
4523 * <p>
4524 * The goal of this binding is to enable dynamic rebinding of keys to
4525 * navigation actions for web content without requiring a framework change.
4526 * </p>
4527 * <p>
4528 * This property represents a string value.
4529 * </p>
4530 * @hide
4531 */
4532 public static final String ACCESSIBILITY_WEB_CONTENT_KEY_BINDINGS =
4533 "accessibility_web_content_key_bindings";
4534
4535 /**
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07004536 * Setting that specifies whether the display magnification is enabled.
4537 * Display magnifications allows the user to zoom in the display content
4538 * and is targeted to low vision users. The current magnification scale
4539 * is controlled by {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}.
4540 *
4541 * @hide
4542 */
4543 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED =
4544 "accessibility_display_magnification_enabled";
4545
4546 /**
4547 * Setting that specifies what the display magnification scale is.
4548 * Display magnifications allows the user to zoom in the display
4549 * content and is targeted to low vision users. Whether a display
4550 * magnification is performed is controlled by
4551 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED}
4552 *
4553 * @hide
4554 */
4555 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE =
4556 "accessibility_display_magnification_scale";
4557
4558 /**
4559 * Setting that specifies whether the display magnification should be
4560 * automatically updated. If this fearture is enabled the system will
4561 * exit magnification mode or pan the viewport when a context change
4562 * occurs. For example, on staring a new activity or rotating the screen,
4563 * the system may zoom out so the user can see the new context he is in.
4564 * Another example is on showing a window that is not visible in the
4565 * magnified viewport the system may pan the viewport to make the window
4566 * the has popped up so the user knows that the context has changed.
4567 * Whether a screen magnification is performed is controlled by
4568 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED}
4569 *
4570 * @hide
4571 */
4572 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE =
4573 "accessibility_display_magnification_auto_update";
4574
4575 /**
Alan Viveretteef793802013-07-23 14:15:28 -07004576 * Setting that specifies whether timed text (captions) should be
4577 * displayed in video content. Text display properties are controlled by
4578 * the following settings:
4579 * <ul>
4580 * <li>{@link #ACCESSIBILITY_CAPTIONING_LOCALE}
4581 * <li>{@link #ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR}
4582 * <li>{@link #ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR}
4583 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_COLOR}
4584 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_TYPE}
4585 * <li>{@link #ACCESSIBILITY_CAPTIONING_TYPEFACE}
Alan Viverette69ce69b2013-08-29 12:23:48 -07004586 * <li>{@link #ACCESSIBILITY_CAPTIONING_FONT_SCALE}
Alan Viveretteef793802013-07-23 14:15:28 -07004587 * </ul>
4588 *
4589 * @hide
4590 */
4591 public static final String ACCESSIBILITY_CAPTIONING_ENABLED =
4592 "accessibility_captioning_enabled";
4593
4594 /**
4595 * Setting that specifies the language for captions as a locale string,
4596 * e.g. en_US.
4597 *
4598 * @see java.util.Locale#toString
4599 * @hide
4600 */
4601 public static final String ACCESSIBILITY_CAPTIONING_LOCALE =
4602 "accessibility_captioning_locale";
4603
4604 /**
Alan Viverette43a1e3d2013-08-02 16:45:03 -07004605 * Integer property that specifies the preset style for captions, one
4606 * of:
4607 * <ul>
Alan Viverette69ce69b2013-08-29 12:23:48 -07004608 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESET_CUSTOM}
4609 * <li>a valid index of {@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESETS}
Alan Viverette43a1e3d2013-08-02 16:45:03 -07004610 * </ul>
4611 *
4612 * @see java.util.Locale#toString
4613 * @hide
4614 */
4615 public static final String ACCESSIBILITY_CAPTIONING_PRESET =
4616 "accessibility_captioning_preset";
4617
4618 /**
Alan Viveretteef793802013-07-23 14:15:28 -07004619 * Integer property that specifes the background color for captions as a
4620 * packed 32-bit color.
4621 *
4622 * @see android.graphics.Color#argb
4623 * @hide
4624 */
4625 public static final String ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR =
4626 "accessibility_captioning_background_color";
4627
4628 /**
4629 * Integer property that specifes the foreground color for captions as a
4630 * packed 32-bit color.
4631 *
4632 * @see android.graphics.Color#argb
4633 * @hide
4634 */
4635 public static final String ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR =
4636 "accessibility_captioning_foreground_color";
4637
4638 /**
4639 * Integer property that specifes the edge type for captions, one of:
4640 * <ul>
Alan Viverette69ce69b2013-08-29 12:23:48 -07004641 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_NONE}
4642 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_OUTLINE}
4643 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_DROP_SHADOW}
Alan Viveretteef793802013-07-23 14:15:28 -07004644 * </ul>
4645 *
4646 * @see #ACCESSIBILITY_CAPTIONING_EDGE_COLOR
4647 * @hide
4648 */
4649 public static final String ACCESSIBILITY_CAPTIONING_EDGE_TYPE =
4650 "accessibility_captioning_edge_type";
4651
4652 /**
4653 * Integer property that specifes the edge color for captions as a
4654 * packed 32-bit color.
4655 *
4656 * @see #ACCESSIBILITY_CAPTIONING_EDGE_TYPE
4657 * @see android.graphics.Color#argb
4658 * @hide
4659 */
4660 public static final String ACCESSIBILITY_CAPTIONING_EDGE_COLOR =
4661 "accessibility_captioning_edge_color";
4662
4663 /**
Alan Viverette55d70622013-12-11 15:22:14 -08004664 * Integer property that specifes the window color for captions as a
4665 * packed 32-bit color.
4666 *
4667 * @see android.graphics.Color#argb
4668 * @hide
4669 */
4670 public static final String ACCESSIBILITY_CAPTIONING_WINDOW_COLOR =
4671 "accessibility_captioning_window_color";
4672
4673 /**
Alan Viveretteef793802013-07-23 14:15:28 -07004674 * String property that specifies the typeface for captions, one of:
4675 * <ul>
4676 * <li>DEFAULT
4677 * <li>MONOSPACE
4678 * <li>SANS_SERIF
4679 * <li>SERIF
4680 * </ul>
4681 *
4682 * @see android.graphics.Typeface
4683 * @hide
4684 */
4685 public static final String ACCESSIBILITY_CAPTIONING_TYPEFACE =
4686 "accessibility_captioning_typeface";
4687
4688 /**
Alan Viverette69ce69b2013-08-29 12:23:48 -07004689 * Floating point property that specifies font scaling for captions.
Alan Viveretteef793802013-07-23 14:15:28 -07004690 *
4691 * @hide
4692 */
Alan Viverette69ce69b2013-08-29 12:23:48 -07004693 public static final String ACCESSIBILITY_CAPTIONING_FONT_SCALE =
4694 "accessibility_captioning_font_scale";
Alan Viveretteef793802013-07-23 14:15:28 -07004695
4696 /**
Alan Viverette410d4e32013-09-30 15:37:38 -07004697 * Setting that specifies whether display color inversion is enabled.
Alan Viverette410d4e32013-09-30 15:37:38 -07004698 */
4699 public static final String ACCESSIBILITY_DISPLAY_INVERSION_ENABLED =
4700 "accessibility_display_inversion_enabled";
4701
4702 /**
Alan Viverette410d4e32013-09-30 15:37:38 -07004703 * Setting that specifies whether display color space adjustment is
4704 * enabled.
4705 *
4706 * @hide
4707 */
4708 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED =
4709 "accessibility_display_daltonizer_enabled";
4710
4711 /**
4712 * Integer property that specifies the type of color space adjustment to
4713 * perform. Valid values are defined in AccessibilityManager.
4714 *
4715 * @hide
4716 */
4717 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER =
4718 "accessibility_display_daltonizer";
4719
4720 /**
Svetoslav Ganov54d068e2011-03-02 12:58:40 -08004721 * The timout for considering a press to be a long press in milliseconds.
4722 * @hide
4723 */
4724 public static final String LONG_PRESS_TIMEOUT = "long_press_timeout";
4725
4726 /**
Svetoslav Ganov6bd20bc2013-09-02 15:24:45 -07004727 * List of the enabled print services.
Svetoslav Ganov4b9a4d12013-06-11 15:20:06 -07004728 * @hide
4729 */
4730 public static final String ENABLED_PRINT_SERVICES =
4731 "enabled_print_services";
4732
4733 /**
Svetoslav Ganov6bd20bc2013-09-02 15:24:45 -07004734 * List of the system print services we enabled on first boot. On
4735 * first boot we enable all system, i.e. bundled print services,
4736 * once, so they work out-of-the-box.
4737 * @hide
4738 */
4739 public static final String ENABLED_ON_FIRST_BOOT_SYSTEM_PRINT_SERVICES =
4740 "enabled_on_first_boot_system_print_services";
4741
4742 /**
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07004743 * Setting to always use the default text-to-speech settings regardless
4744 * of the application settings.
4745 * 1 = override application settings,
4746 * 0 = use application settings (if specified).
Narayan Kamath6d632962011-08-24 11:51:37 +01004747 *
4748 * @deprecated The value of this setting is no longer respected by
4749 * the framework text to speech APIs as of the Ice Cream Sandwich release.
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07004750 */
Narayan Kamath6d632962011-08-24 11:51:37 +01004751 @Deprecated
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07004752 public static final String TTS_USE_DEFAULTS = "tts_use_defaults";
4753
4754 /**
4755 * Default text-to-speech engine speech rate. 100 = 1x
4756 */
4757 public static final String TTS_DEFAULT_RATE = "tts_default_rate";
4758
4759 /**
4760 * Default text-to-speech engine pitch. 100 = 1x
4761 */
4762 public static final String TTS_DEFAULT_PITCH = "tts_default_pitch";
4763
4764 /**
4765 * Default text-to-speech engine.
4766 */
4767 public static final String TTS_DEFAULT_SYNTH = "tts_default_synth";
4768
4769 /**
Jean-Michel Trivif4782672009-06-09 16:22:48 -07004770 * Default text-to-speech language.
Narayan Kamath6d632962011-08-24 11:51:37 +01004771 *
4772 * @deprecated this setting is no longer in use, as of the Ice Cream
4773 * Sandwich release. Apps should never need to read this setting directly,
4774 * instead can query the TextToSpeech framework classes for the default
4775 * locale. {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivif4782672009-06-09 16:22:48 -07004776 */
Narayan Kamath6d632962011-08-24 11:51:37 +01004777 @Deprecated
Jean-Michel Trivif4782672009-06-09 16:22:48 -07004778 public static final String TTS_DEFAULT_LANG = "tts_default_lang";
4779
4780 /**
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07004781 * Default text-to-speech country.
Narayan Kamath6d632962011-08-24 11:51:37 +01004782 *
4783 * @deprecated this setting is no longer in use, as of the Ice Cream
4784 * Sandwich release. Apps should never need to read this setting directly,
4785 * instead can query the TextToSpeech framework classes for the default
4786 * locale. {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07004787 */
Narayan Kamath6d632962011-08-24 11:51:37 +01004788 @Deprecated
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07004789 public static final String TTS_DEFAULT_COUNTRY = "tts_default_country";
4790
4791 /**
4792 * Default text-to-speech locale variant.
Narayan Kamath6d632962011-08-24 11:51:37 +01004793 *
4794 * @deprecated this setting is no longer in use, as of the Ice Cream
4795 * Sandwich release. Apps should never need to read this setting directly,
4796 * instead can query the TextToSpeech framework classes for the
4797 * locale that is in use {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07004798 */
Narayan Kamath6d632962011-08-24 11:51:37 +01004799 @Deprecated
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07004800 public static final String TTS_DEFAULT_VARIANT = "tts_default_variant";
4801
4802 /**
Narayan Kamathe5b8c4d2011-08-22 15:37:47 +01004803 * Stores the default tts locales on a per engine basis. Stored as
4804 * a comma seperated list of values, each value being of the form
4805 * {@code engine_name:locale} for example,
Narayan Kamath6d632962011-08-24 11:51:37 +01004806 * {@code com.foo.ttsengine:eng-USA,com.bar.ttsengine:esp-ESP}. This
4807 * supersedes {@link #TTS_DEFAULT_LANG}, {@link #TTS_DEFAULT_COUNTRY} and
4808 * {@link #TTS_DEFAULT_VARIANT}. Apps should never need to read this
4809 * setting directly, and can query the TextToSpeech framework classes
4810 * for the locale that is in use.
Narayan Kamathe5b8c4d2011-08-22 15:37:47 +01004811 *
4812 * @hide
4813 */
4814 public static final String TTS_DEFAULT_LOCALE = "tts_default_locale";
4815
4816 /**
Charles Chenceffa152010-03-16 21:18:10 -07004817 * Space delimited list of plugin packages that are enabled.
4818 */
4819 public static final String TTS_ENABLED_PLUGINS = "tts_enabled_plugins";
4820
4821 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004822 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON}
4823 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004824 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004825 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004826 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004827 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004828
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004829 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004830 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY}
4831 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004832 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004833 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004834 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004835 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004836
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004837 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004838 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
4839 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004840 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004841 @Deprecated
4842 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT =
4843 Global.WIFI_NUM_OPEN_NETWORKS_KEPT;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004844
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004845 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004846 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON}
4847 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004848 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004849 @Deprecated
4850 public static final String WIFI_ON = Global.WIFI_ON;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004851
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004852 /**
4853 * The acceptable packet loss percentage (range 0 - 100) before trying
4854 * another AP on the same network.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004855 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004856 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004857 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004858 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
4859 "wifi_watchdog_acceptable_packet_loss_percentage";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004860
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004861 /**
4862 * The number of access points required for a network in order for the
4863 * watchdog to monitor it.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004864 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004865 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004866 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004867 public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004868
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004869 /**
4870 * The delay between background checks.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004871 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004872 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004873 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004874 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
4875 "wifi_watchdog_background_check_delay_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004876
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004877 /**
4878 * Whether the Wi-Fi watchdog is enabled for background checking even
4879 * after it thinks the user has connected to a good access point.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004880 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004881 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004882 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004883 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
4884 "wifi_watchdog_background_check_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004885
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004886 /**
4887 * The timeout for a background ping
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004888 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004889 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004890 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004891 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
4892 "wifi_watchdog_background_check_timeout_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004893
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004894 /**
4895 * The number of initial pings to perform that *may* be ignored if they
4896 * fail. Again, if these fail, they will *not* be used in packet loss
4897 * calculation. For example, one network always seemed to time out for
4898 * the first couple pings, so this is set to 3 by default.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004899 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004900 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004901 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004902 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
4903 "wifi_watchdog_initial_ignored_ping_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004904
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004905 /**
4906 * The maximum number of access points (per network) to attempt to test.
4907 * If this number is reached, the watchdog will no longer monitor the
4908 * initial connection state for the network. This is a safeguard for
4909 * networks containing multiple APs whose DNS does not respond to pings.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004910 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004911 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004912 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004913 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = "wifi_watchdog_max_ap_checks";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004914
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004915 /**
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07004916 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004917 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07004918 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004919 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
4920
4921 /**
4922 * A comma-separated list of SSIDs for which the Wi-Fi watchdog should be enabled.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004923 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004924 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004925 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004926 public static final String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list";
4927
4928 /**
4929 * The number of pings to test if an access point is a good connection.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004930 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004931 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004932 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004933 public static final String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004934
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004935 /**
4936 * The delay between pings.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004937 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004938 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004939 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004940 public static final String WIFI_WATCHDOG_PING_DELAY_MS = "wifi_watchdog_ping_delay_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004941
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004942 /**
4943 * The timeout per ping.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004944 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004945 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004946 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004947 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004948
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004949 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004950 * @deprecated Use
4951 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004952 */
Christopher Tate06efb532012-08-24 15:29:27 -07004953 @Deprecated
4954 public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004955
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004956 /**
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004957 * @deprecated Use
4958 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004959 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07004960 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004961 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004962 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004963
4964 /**
Jeremy Joslin79294842014-12-03 17:15:28 -08004965 * The number of milliseconds to hold on to a PendingIntent based request. This delay gives
4966 * the receivers of the PendingIntent an opportunity to make a new network request before
4967 * the Network satisfying the request is potentially removed.
4968 *
4969 * @hide
4970 */
4971 public static final String CONNECTIVITY_RELEASE_PENDING_INTENT_DELAY_MS =
4972 "connectivity_release_pending_intent_delay_ms";
4973
4974 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07004975 * Whether background data usage is allowed.
4976 *
4977 * @deprecated As of {@link VERSION_CODES#ICE_CREAM_SANDWICH},
4978 * availability of background data depends on several
4979 * combined factors. When background data is unavailable,
4980 * {@link ConnectivityManager#getActiveNetworkInfo()} will
4981 * now appear disconnected.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004982 */
Jeff Sharkey3a844fc2011-08-16 14:37:57 -07004983 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004984 public static final String BACKGROUND_DATA = "background_data";
Wink Saville04e71b32009-04-02 11:00:54 -07004985
4986 /**
Bjorn Bringert98bfa392010-03-24 10:59:48 +00004987 * Origins for which browsers should allow geolocation by default.
4988 * The value is a space-separated list of origins.
4989 */
4990 public static final String ALLOWED_GEOLOCATION_ORIGINS
4991 = "allowed_geolocation_origins";
4992
4993 /**
Wink Savillee9b06d72009-05-18 21:47:50 -07004994 * The preferred TTY mode 0 = TTy Off, CDMA default
4995 * 1 = TTY Full
4996 * 2 = TTY HCO
4997 * 3 = TTY VCO
4998 * @hide
4999 */
5000 public static final String PREFERRED_TTY_MODE =
5001 "preferred_tty_mode";
5002
Wink Saville04e71b32009-04-02 11:00:54 -07005003 /**
Wink Saville04e71b32009-04-02 11:00:54 -07005004 * Whether the enhanced voice privacy mode is enabled.
5005 * 0 = normal voice privacy
5006 * 1 = enhanced voice privacy
5007 * @hide
5008 */
5009 public static final String ENHANCED_VOICE_PRIVACY_ENABLED = "enhanced_voice_privacy_enabled";
5010
5011 /**
5012 * Whether the TTY mode mode is enabled.
5013 * 0 = disabled
5014 * 1 = enabled
5015 * @hide
5016 */
5017 public static final String TTY_MODE_ENABLED = "tty_mode_enabled";
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005018
5019 /**
Christopher Tate8031a3d2009-07-06 16:36:05 -07005020 * Controls whether settings backup is enabled.
Dianne Hackborncf098292009-07-01 19:55:20 -07005021 * Type: int ( 0 = disabled, 1 = enabled )
5022 * @hide
5023 */
5024 public static final String BACKUP_ENABLED = "backup_enabled";
5025
5026 /**
Christopher Tatecce9da52010-02-03 15:11:15 -08005027 * Controls whether application data is automatically restored from backup
5028 * at install time.
5029 * Type: int ( 0 = disabled, 1 = enabled )
5030 * @hide
5031 */
5032 public static final String BACKUP_AUTO_RESTORE = "backup_auto_restore";
5033
5034 /**
Christopher Tate8031a3d2009-07-06 16:36:05 -07005035 * Indicates whether settings backup has been fully provisioned.
5036 * Type: int ( 0 = unprovisioned, 1 = fully provisioned )
5037 * @hide
5038 */
5039 public static final String BACKUP_PROVISIONED = "backup_provisioned";
5040
5041 /**
Dianne Hackborncf098292009-07-01 19:55:20 -07005042 * Component of the transport to use for backup/restore.
5043 * @hide
5044 */
5045 public static final String BACKUP_TRANSPORT = "backup_transport";
Sanjay Jeyakumar21bf2412009-07-09 13:31:48 -07005046
Dianne Hackbornd7cd29d2009-07-01 11:22:45 -07005047 /**
5048 * Version for which the setup wizard was last shown. Bumped for
5049 * each release when there is new setup information to show.
5050 * @hide
5051 */
5052 public static final String LAST_SETUP_SHOWN = "last_setup_shown";
Dianne Hackborncf098292009-07-01 19:55:20 -07005053
5054 /**
Doug Zongker43866e02010-01-07 12:09:54 -08005055 * The interval in milliseconds after which Wi-Fi is considered idle.
5056 * When idle, it is possible for the device to be switched from Wi-Fi to
5057 * the mobile data network.
5058 * @hide
Jeff Brownbf6f6f92012-09-25 15:03:20 -07005059 * @deprecated Use {@link android.provider.Settings.Global#WIFI_IDLE_MS}
5060 * instead.
Doug Zongker43866e02010-01-07 12:09:54 -08005061 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07005062 @Deprecated
5063 public static final String WIFI_IDLE_MS = Global.WIFI_IDLE_MS;
Doug Zongker43866e02010-01-07 12:09:54 -08005064
5065 /**
Narayan Kamathee69ff42011-06-28 12:07:18 +01005066 * The global search provider chosen by the user (if multiple global
5067 * search providers are installed). This will be the provider returned
5068 * by {@link SearchManager#getGlobalSearchActivity()} if it's still
5069 * installed. This setting is stored as a flattened component name as
5070 * per {@link ComponentName#flattenToString()}.
5071 *
5072 * @hide
5073 */
5074 public static final String SEARCH_GLOBAL_SEARCH_ACTIVITY =
5075 "search_global_search_activity";
5076
5077 /**
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08005078 * The number of promoted sources in GlobalSearch.
5079 * @hide
5080 */
5081 public static final String SEARCH_NUM_PROMOTED_SOURCES = "search_num_promoted_sources";
5082 /**
5083 * The maximum number of suggestions returned by GlobalSearch.
5084 * @hide
5085 */
5086 public static final String SEARCH_MAX_RESULTS_TO_DISPLAY = "search_max_results_to_display";
5087 /**
5088 * The number of suggestions GlobalSearch will ask each non-web search source for.
5089 * @hide
5090 */
5091 public static final String SEARCH_MAX_RESULTS_PER_SOURCE = "search_max_results_per_source";
5092 /**
5093 * The number of suggestions the GlobalSearch will ask the web search source for.
5094 * @hide
5095 */
5096 public static final String SEARCH_WEB_RESULTS_OVERRIDE_LIMIT =
5097 "search_web_results_override_limit";
5098 /**
5099 * The number of milliseconds that GlobalSearch will wait for suggestions from
5100 * promoted sources before continuing with all other sources.
5101 * @hide
5102 */
5103 public static final String SEARCH_PROMOTED_SOURCE_DEADLINE_MILLIS =
5104 "search_promoted_source_deadline_millis";
5105 /**
5106 * The number of milliseconds before GlobalSearch aborts search suggesiton queries.
5107 * @hide
5108 */
5109 public static final String SEARCH_SOURCE_TIMEOUT_MILLIS = "search_source_timeout_millis";
5110 /**
5111 * The maximum number of milliseconds that GlobalSearch shows the previous results
5112 * after receiving a new query.
5113 * @hide
5114 */
5115 public static final String SEARCH_PREFILL_MILLIS = "search_prefill_millis";
5116 /**
5117 * The maximum age of log data used for shortcuts in GlobalSearch.
5118 * @hide
5119 */
5120 public static final String SEARCH_MAX_STAT_AGE_MILLIS = "search_max_stat_age_millis";
5121 /**
5122 * The maximum age of log data used for source ranking in GlobalSearch.
5123 * @hide
5124 */
5125 public static final String SEARCH_MAX_SOURCE_EVENT_AGE_MILLIS =
5126 "search_max_source_event_age_millis";
5127 /**
5128 * The minimum number of impressions needed to rank a source in GlobalSearch.
5129 * @hide
5130 */
5131 public static final String SEARCH_MIN_IMPRESSIONS_FOR_SOURCE_RANKING =
5132 "search_min_impressions_for_source_ranking";
5133 /**
5134 * The minimum number of clicks needed to rank a source in GlobalSearch.
5135 * @hide
5136 */
5137 public static final String SEARCH_MIN_CLICKS_FOR_SOURCE_RANKING =
5138 "search_min_clicks_for_source_ranking";
5139 /**
5140 * The maximum number of shortcuts shown by GlobalSearch.
5141 * @hide
5142 */
5143 public static final String SEARCH_MAX_SHORTCUTS_RETURNED = "search_max_shortcuts_returned";
5144 /**
5145 * The size of the core thread pool for suggestion queries in GlobalSearch.
5146 * @hide
5147 */
5148 public static final String SEARCH_QUERY_THREAD_CORE_POOL_SIZE =
5149 "search_query_thread_core_pool_size";
5150 /**
5151 * The maximum size of the thread pool for suggestion queries in GlobalSearch.
5152 * @hide
5153 */
5154 public static final String SEARCH_QUERY_THREAD_MAX_POOL_SIZE =
5155 "search_query_thread_max_pool_size";
5156 /**
5157 * The size of the core thread pool for shortcut refreshing in GlobalSearch.
5158 * @hide
5159 */
5160 public static final String SEARCH_SHORTCUT_REFRESH_CORE_POOL_SIZE =
5161 "search_shortcut_refresh_core_pool_size";
5162 /**
5163 * The maximum size of the thread pool for shortcut refreshing in GlobalSearch.
5164 * @hide
5165 */
5166 public static final String SEARCH_SHORTCUT_REFRESH_MAX_POOL_SIZE =
5167 "search_shortcut_refresh_max_pool_size";
5168 /**
5169 * The maximun time that excess threads in the GlobalSeach thread pools will
5170 * wait before terminating.
5171 * @hide
5172 */
5173 public static final String SEARCH_THREAD_KEEPALIVE_SECONDS =
5174 "search_thread_keepalive_seconds";
5175 /**
5176 * The maximum number of concurrent suggestion queries to each source.
5177 * @hide
5178 */
5179 public static final String SEARCH_PER_SOURCE_CONCURRENT_QUERY_LIMIT =
5180 "search_per_source_concurrent_query_limit";
5181
San Mehat87734d32010-01-08 12:53:06 -08005182 /**
5183 * Whether or not alert sounds are played on MountService events. (0 = false, 1 = true)
5184 * @hide
5185 */
5186 public static final String MOUNT_PLAY_NOTIFICATION_SND = "mount_play_not_snd";
5187
5188 /**
5189 * Whether or not UMS auto-starts on UMS host detection. (0 = false, 1 = true)
5190 * @hide
5191 */
5192 public static final String MOUNT_UMS_AUTOSTART = "mount_ums_autostart";
5193
5194 /**
5195 * Whether or not a notification is displayed on UMS host detection. (0 = false, 1 = true)
5196 * @hide
5197 */
5198 public static final String MOUNT_UMS_PROMPT = "mount_ums_prompt";
5199
5200 /**
5201 * Whether or not a notification is displayed while UMS is enabled. (0 = false, 1 = true)
5202 * @hide
5203 */
5204 public static final String MOUNT_UMS_NOTIFY_ENABLED = "mount_ums_notify_enabled";
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08005205
Dan Egnor42471dd2010-01-07 17:25:22 -08005206 /**
5207 * If nonzero, ANRs in invisible background processes bring up a dialog.
5208 * Otherwise, the process will be silently killed.
5209 * @hide
5210 */
5211 public static final String ANR_SHOW_BACKGROUND = "anr_show_background";
Erikeebc8e22010-02-18 13:27:19 -08005212
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08005213 /**
5214 * The {@link ComponentName} string of the service to be used as the voice recognition
5215 * service.
Erikeebc8e22010-02-18 13:27:19 -08005216 *
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08005217 * @hide
5218 */
5219 public static final String VOICE_RECOGNITION_SERVICE = "voice_recognition_service";
Dan Egnor42471dd2010-01-07 17:25:22 -08005220
William Luh623a4282013-06-24 12:14:18 -07005221 /**
5222 * Stores whether an user has consented to have apps verified through PAM.
5223 * The value is boolean (1 or 0).
5224 *
5225 * @hide
5226 */
5227 public static final String PACKAGE_VERIFIER_USER_CONSENT =
5228 "package_verifier_user_consent";
satok988323c2011-06-22 16:38:13 +09005229
5230 /**
satokada8c4e2011-08-23 14:56:56 +09005231 * The {@link ComponentName} string of the selected spell checker service which is
5232 * one of the services managed by the text service manager.
5233 *
5234 * @hide
5235 */
5236 public static final String SELECTED_SPELL_CHECKER = "selected_spell_checker";
5237
5238 /**
5239 * The {@link ComponentName} string of the selected subtype of the selected spell checker
satok988323c2011-06-22 16:38:13 +09005240 * service which is one of the services managed by the text service manager.
5241 *
5242 * @hide
5243 */
satokada8c4e2011-08-23 14:56:56 +09005244 public static final String SELECTED_SPELL_CHECKER_SUBTYPE =
5245 "selected_spell_checker_subtype";
satok988323c2011-06-22 16:38:13 +09005246
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08005247 /**
satoka33c4fc2011-08-25 16:50:11 +09005248 * The {@link ComponentName} string whether spell checker is enabled or not.
5249 *
5250 * @hide
5251 */
5252 public static final String SPELL_CHECKER_ENABLED = "spell_checker_enabled";
5253
5254 /**
David Brown458e8062010-03-08 21:52:11 -08005255 * What happens when the user presses the Power button while in-call
5256 * and the screen is on.<br/>
5257 * <b>Values:</b><br/>
5258 * 1 - The Power button turns off the screen and locks the device. (Default behavior)<br/>
5259 * 2 - The Power button hangs up the current call.<br/>
5260 *
5261 * @hide
5262 */
5263 public static final String INCALL_POWER_BUTTON_BEHAVIOR = "incall_power_button_behavior";
5264
5265 /**
5266 * INCALL_POWER_BUTTON_BEHAVIOR value for "turn off screen".
5267 * @hide
5268 */
5269 public static final int INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF = 0x1;
5270
5271 /**
5272 * INCALL_POWER_BUTTON_BEHAVIOR value for "hang up".
5273 * @hide
5274 */
5275 public static final int INCALL_POWER_BUTTON_BEHAVIOR_HANGUP = 0x2;
5276
5277 /**
5278 * INCALL_POWER_BUTTON_BEHAVIOR default value.
5279 * @hide
5280 */
5281 public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT =
5282 INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF;
5283
5284 /**
Jeff Browna20dda42014-05-27 20:57:24 -07005285 * Whether the device should wake when the wake gesture sensor detects motion.
5286 * @hide
5287 */
5288 public static final String WAKE_GESTURE_ENABLED = "wake_gesture_enabled";
5289
5290 /**
John Spurlocka4215ce2014-08-04 14:50:38 -04005291 * Whether the device should doze if configured.
5292 * @hide
5293 */
5294 public static final String DOZE_ENABLED = "doze_enabled";
5295
5296 /**
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07005297 * The current night mode that has been selected by the user. Owned
5298 * and controlled by UiModeManagerService. Constants are as per
5299 * UiModeManager.
5300 * @hide
5301 */
5302 public static final String UI_NIGHT_MODE = "ui_night_mode";
Suchi Amalapurapu40e47252010-04-07 16:15:50 -07005303
5304 /**
John Spurlock1a868b72012-08-22 09:56:51 -04005305 * Whether screensavers are enabled.
Daniel Sandler0601eb72011-04-13 01:01:32 -04005306 * @hide
5307 */
Daniel Sandler2d545362011-11-17 10:38:37 -08005308 public static final String SCREENSAVER_ENABLED = "screensaver_enabled";
Daniel Sandler0601eb72011-04-13 01:01:32 -04005309
5310 /**
John Spurlock1a868b72012-08-22 09:56:51 -04005311 * The user's chosen screensaver components.
Daniel Sandler2d545362011-11-17 10:38:37 -08005312 *
John Spurlock1a868b72012-08-22 09:56:51 -04005313 * These will be launched by the PhoneWindowManager after a timeout when not on
Daniel Sandler2d545362011-11-17 10:38:37 -08005314 * battery, or upon dock insertion (if SCREENSAVER_ACTIVATE_ON_DOCK is set to 1).
Daniel Sandler0601eb72011-04-13 01:01:32 -04005315 * @hide
5316 */
John Spurlock1a868b72012-08-22 09:56:51 -04005317 public static final String SCREENSAVER_COMPONENTS = "screensaver_components";
Daniel Sandler2d545362011-11-17 10:38:37 -08005318
5319 /**
John Spurlock1a868b72012-08-22 09:56:51 -04005320 * If screensavers are enabled, whether the screensaver should be automatically launched
5321 * when the device is inserted into a (desk) dock.
Daniel Sandler2d545362011-11-17 10:38:37 -08005322 * @hide
5323 */
5324 public static final String SCREENSAVER_ACTIVATE_ON_DOCK = "screensaver_activate_on_dock";
Daniel Sandler0601eb72011-04-13 01:01:32 -04005325
John Spurlock1a868b72012-08-22 09:56:51 -04005326 /**
5327 * If screensavers are enabled, whether the screensaver should be automatically launched
5328 * when the screen times out when not on battery.
5329 * @hide
5330 */
5331 public static final String SCREENSAVER_ACTIVATE_ON_SLEEP = "screensaver_activate_on_sleep";
5332
5333 /**
5334 * If screensavers are enabled, the default screensaver component.
5335 * @hide
5336 */
5337 public static final String SCREENSAVER_DEFAULT_COMPONENT = "screensaver_default_component";
5338
Daniel Sandler0601eb72011-04-13 01:01:32 -04005339 /**
Martijn Coenena7397882013-07-30 20:07:47 -07005340 * The default NFC payment component
5341 * @hide
5342 */
5343 public static final String NFC_PAYMENT_DEFAULT_COMPONENT = "nfc_payment_default_component";
5344
5345 /**
Martijn Coenen2f6f3a012014-04-25 17:00:21 -07005346 * Whether NFC payment is handled by the foreground application or a default.
5347 * @hide
5348 */
5349 public static final String NFC_PAYMENT_FOREGROUND = "nfc_payment_foreground";
5350
5351 /**
David Braunf5d83192013-09-16 13:43:51 -07005352 * Specifies the package name currently configured to be the primary sms application
5353 * @hide
5354 */
5355 public static final String SMS_DEFAULT_APPLICATION = "sms_default_application";
5356
5357 /**
Adrian Roos943eb862015-03-26 12:31:16 -07005358 * Specifies the package name currently configured to be the emergency assistance application
5359 *
5360 * @see android.telephony.TelephonyManager#ACTION_EMERGENCY_ASSISTANCE
5361 *
5362 * @hide
5363 */
5364 public static final String EMERGENCY_ASSISTANCE_APPLICATION = "emergency_assistance_application";
5365
5366 /**
Chris Wren8326a8a2014-10-22 14:13:32 -04005367 * Names of the packages that the current user has explicitly allowed to
5368 * see all of the user's notifications, separated by ':'.
Daniel Sandler4b749ef2013-03-18 21:53:04 -04005369 *
5370 * @hide
5371 */
5372 public static final String ENABLED_NOTIFICATION_LISTENERS = "enabled_notification_listeners";
5373
John Spurlock7340fc82014-04-24 18:50:12 -04005374 /**
5375 * @hide
5376 */
5377 public static final String ENABLED_CONDITION_PROVIDERS = "enabled_condition_providers";
5378
John Spurlock5c454122013-06-17 07:35:46 -04005379 /** @hide */
5380 public static final String BAR_SERVICE_COMPONENT = "bar_service_component";
5381
John Spurlockd67ec252013-09-05 11:31:54 -04005382 /** @hide */
John Spurlockcdb57ae2015-02-11 19:04:11 -05005383 public static final String VOLUME_CONTROLLER_SERVICE_COMPONENT
5384 = "volume_controller_service_component";
5385
5386 /** @hide */
John Spurlockf1a36642013-10-12 17:50:42 -04005387 public static final String IMMERSIVE_MODE_CONFIRMATIONS = "immersive_mode_confirmations";
John Spurlockd67ec252013-09-05 11:31:54 -04005388
Yorke Lee647f8f32013-05-07 10:49:44 -07005389 /**
Svetoslavf43e8512013-09-30 17:33:05 -07005390 * This is the query URI for finding a print service to install.
5391 *
5392 * @hide
5393 */
5394 public static final String PRINT_SERVICE_SEARCH_URI = "print_service_search_uri";
5395
5396 /**
5397 * This is the query URI for finding a NFC payment service to install.
5398 *
5399 * @hide
5400 */
5401 public static final String PAYMENT_SERVICE_SEARCH_URI = "payment_service_search_uri";
5402
5403 /**
Amith Yamasani1e9c2182014-06-11 17:25:51 -07005404 * If enabled, apps should try to skip any introductory hints on first launch. This might
Amith Yamasani0c416392014-06-13 15:54:39 -07005405 * apply to users that are already familiar with the environment or temporary users.
Amith Yamasani1e9c2182014-06-11 17:25:51 -07005406 * <p>
5407 * Type : int (0 to show hints, 1 to skip showing hints)
Amith Yamasani1e9c2182014-06-11 17:25:51 -07005408 */
5409 public static final String SKIP_FIRST_USE_HINTS = "skip_first_use_hints";
5410
5411 /**
John Spurlockaa5ee4d2014-07-25 13:05:12 -04005412 * Persisted playback time after a user confirmation of an unsafe volume level.
5413 *
5414 * @hide
5415 */
5416 public static final String UNSAFE_VOLUME_MUSIC_ACTIVE_MS = "unsafe_volume_music_active_ms";
5417
5418 /**
Dan Sandler52e5701e2014-07-22 23:14:54 -04005419 * This preference enables notification display on the lockscreen.
5420 * @hide
5421 */
5422 public static final String LOCK_SCREEN_SHOW_NOTIFICATIONS =
5423 "lock_screen_show_notifications";
5424
5425 /**
Dongwon Kang4d933a02014-08-07 22:51:47 -07005426 * List of TV inputs that are currently hidden. This is a string
Jaewan Kimf0e530e2014-08-22 00:43:31 +09005427 * containing the IDs of all hidden TV inputs. Each ID is encoded by
5428 * {@link android.net.Uri#encode(String)} and separated by ':'.
Dongwon Kang4d933a02014-08-07 22:51:47 -07005429 * @hide
5430 */
5431 public static final String TV_INPUT_HIDDEN_INPUTS = "tv_input_hidden_inputs";
5432
5433 /**
5434 * List of custom TV input labels. This is a string containing <TV input id, custom name>
Jaewan Kimf0e530e2014-08-22 00:43:31 +09005435 * pairs. TV input id and custom name are encoded by {@link android.net.Uri#encode(String)}
5436 * and separated by ','. Each pair is separated by ':'.
Dongwon Kang4d933a02014-08-07 22:51:47 -07005437 * @hide
5438 */
5439 public static final String TV_INPUT_CUSTOM_LABELS = "tv_input_custom_labels";
5440
5441 /**
Glenn Kasten34cc4db2014-08-13 10:56:38 -07005442 * Whether automatic routing of system audio to USB audio peripheral is disabled.
5443 * The value is boolean (1 or 0), where 1 means automatic routing is disabled,
5444 * and 0 means automatic routing is enabled.
5445 *
5446 * @hide
5447 */
5448 public static final String USB_AUDIO_AUTOMATIC_ROUTING_DISABLED =
5449 "usb_audio_automatic_routing_disabled";
5450
5451 /**
Jeff Brown05af6ad2014-09-30 20:54:30 -07005452 * The timeout in milliseconds before the device fully goes to sleep after
5453 * a period of inactivity. This value sets an upper bound on how long the device
5454 * will stay awake or dreaming without user activity. It should generally
Dianne Hackbornad6a99b2014-11-18 10:11:10 -08005455 * be longer than {@link Settings.System#SCREEN_OFF_TIMEOUT} as otherwise the device
Jeff Brown05af6ad2014-09-30 20:54:30 -07005456 * will sleep before it ever has a chance to dream.
5457 * <p>
5458 * Use -1 to disable this timeout.
5459 * </p>
5460 *
5461 * @hide
5462 */
5463 public static final String SLEEP_TIMEOUT = "sleep_timeout";
5464
5465 /**
Amith Yamasanib0ff3222015-03-04 09:56:14 -08005466 * Duration in milliseconds that an app should be inactive before it is considered idle.
5467 * <p/>Type: Long
5468 * @hide
5469 */
5470 public static final String APP_IDLE_DURATION = "app_idle_duration";
5471
5472 /**
Svetoslav Ganova571a582011-09-20 18:32:20 -07005473 * This are the settings to be backed up.
5474 *
5475 * NOTE: Settings are backed up and restored in the order they appear
5476 * in this array. If you have one setting depending on another,
5477 * make sure that they are ordered appropriately.
5478 *
-b master501eec92009-07-06 13:53:11 -07005479 * @hide
5480 */
5481 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate58f41ec2013-01-11 15:40:36 -08005482 BUGREPORT_IN_POWER_MENU, // moved to global
Amith Yamasani8823c0a82009-07-07 14:30:17 -07005483 ALLOW_MOCK_LOCATION,
-b master501eec92009-07-06 13:53:11 -07005484 PARENTAL_CONTROL_ENABLED,
5485 PARENTAL_CONTROL_REDIRECT_URL,
Christopher Tate66488d62012-10-02 11:58:01 -07005486 USB_MASS_STORAGE_ENABLED, // moved to global
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07005487 ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED,
5488 ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE,
5489 ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE,
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07005490 ACCESSIBILITY_SCRIPT_INJECTION,
Christopher Tate14c2d792010-02-25 16:49:44 -08005491 BACKUP_AUTO_RESTORE,
-b master501eec92009-07-06 13:53:11 -07005492 ENABLED_ACCESSIBILITY_SERVICES,
Christopher Tate6597e342015-02-17 12:15:25 -08005493 ENABLED_NOTIFICATION_LISTENERS,
Christopher Tate7b9a28c2015-03-18 13:06:16 -07005494 ENABLED_INPUT_METHODS,
Svetoslav Ganov9a4c5cd2012-05-30 14:06:32 -07005495 TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES,
Svetoslav Ganova28a16d2011-07-28 11:24:21 -07005496 TOUCH_EXPLORATION_ENABLED,
Svetoslav Ganova571a582011-09-20 18:32:20 -07005497 ACCESSIBILITY_ENABLED,
Svetoslav Ganov55f937a2011-12-05 11:42:07 -08005498 ACCESSIBILITY_SPEAK_PASSWORD,
Chris Craikcce47eb2014-07-16 15:12:15 -07005499 ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED,
Alan Viveretteef793802013-07-23 14:15:28 -07005500 ACCESSIBILITY_CAPTIONING_ENABLED,
5501 ACCESSIBILITY_CAPTIONING_LOCALE,
5502 ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR,
5503 ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR,
5504 ACCESSIBILITY_CAPTIONING_EDGE_TYPE,
5505 ACCESSIBILITY_CAPTIONING_EDGE_COLOR,
5506 ACCESSIBILITY_CAPTIONING_TYPEFACE,
Alan Viverette69ce69b2013-08-29 12:23:48 -07005507 ACCESSIBILITY_CAPTIONING_FONT_SCALE,
-b master501eec92009-07-06 13:53:11 -07005508 TTS_USE_DEFAULTS,
5509 TTS_DEFAULT_RATE,
5510 TTS_DEFAULT_PITCH,
5511 TTS_DEFAULT_SYNTH,
5512 TTS_DEFAULT_LANG,
5513 TTS_DEFAULT_COUNTRY,
Charles Chenceffa152010-03-16 21:18:10 -07005514 TTS_ENABLED_PLUGINS,
Narayan Kamath6d632962011-08-24 11:51:37 +01005515 TTS_DEFAULT_LOCALE,
Christopher Tate66488d62012-10-02 11:58:01 -07005516 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, // moved to global
5517 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, // moved to global
5518 WIFI_NUM_OPEN_NETWORKS_KEPT, // moved to global
Christopher Tate06cbadd2015-03-16 18:29:42 -07005519 SELECTED_SPELL_CHECKER,
5520 SELECTED_SPELL_CHECKER_SUBTYPE,
5521 SPELL_CHECKER_ENABLED,
San Mehat87734d32010-01-08 12:53:06 -08005522 MOUNT_PLAY_NOTIFICATION_SND,
5523 MOUNT_UMS_AUTOSTART,
5524 MOUNT_UMS_PROMPT,
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07005525 MOUNT_UMS_NOTIFY_ENABLED,
Jeff Brown05af6ad2014-09-30 20:54:30 -07005526 UI_NIGHT_MODE,
5527 SLEEP_TIMEOUT
-b master501eec92009-07-06 13:53:11 -07005528 };
5529
5530 /**
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07005531 * These entries are considered common between the personal and the managed profile,
5532 * since the managed profile doesn't get to change them.
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07005533 */
Svetoslav683914b2015-01-15 14:22:26 -08005534 private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>();
Amith Yamasanib0ff3222015-03-04 09:56:14 -08005535
Svetoslav683914b2015-01-15 14:22:26 -08005536 static {
5537 CLONE_TO_MANAGED_PROFILE.add(ACCESSIBILITY_ENABLED);
5538 CLONE_TO_MANAGED_PROFILE.add(ALLOW_MOCK_LOCATION);
5539 CLONE_TO_MANAGED_PROFILE.add(ALLOWED_GEOLOCATION_ORIGINS);
5540 CLONE_TO_MANAGED_PROFILE.add(DEFAULT_INPUT_METHOD);
5541 CLONE_TO_MANAGED_PROFILE.add(ENABLED_ACCESSIBILITY_SERVICES);
5542 CLONE_TO_MANAGED_PROFILE.add(ENABLED_INPUT_METHODS);
5543 CLONE_TO_MANAGED_PROFILE.add(LOCATION_MODE);
5544 CLONE_TO_MANAGED_PROFILE.add(LOCATION_PROVIDERS_ALLOWED);
5545 CLONE_TO_MANAGED_PROFILE.add(LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS);
5546 CLONE_TO_MANAGED_PROFILE.add(SELECTED_INPUT_METHOD_SUBTYPE);
5547 CLONE_TO_MANAGED_PROFILE.add(SELECTED_SPELL_CHECKER);
5548 CLONE_TO_MANAGED_PROFILE.add(SELECTED_SPELL_CHECKER_SUBTYPE);
5549 }
5550
5551 /** @hide */
5552 public static void getCloneToManagedProfileSettings(Set<String> outKeySet) {
5553 outKeySet.addAll(CLONE_TO_MANAGED_PROFILE);
5554 }
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07005555
5556 /**
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005557 * Helper method for determining if a location provider is enabled.
Tom O'Neilld5759432013-09-11 11:03:03 -07005558 *
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005559 * @param cr the content resolver to use
5560 * @param provider the location provider to query
5561 * @return true if the provider is enabled
Tom O'Neilld5759432013-09-11 11:03:03 -07005562 *
5563 * @deprecated use {@link #LOCATION_MODE} or
5564 * {@link LocationManager#isProviderEnabled(String)}
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005565 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07005566 @Deprecated
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005567 public static final boolean isLocationProviderEnabled(ContentResolver cr, String provider) {
Victoria Leaseb711d572012-10-02 13:14:11 -07005568 return isLocationProviderEnabledForUser(cr, provider, UserHandle.myUserId());
5569 }
5570
5571 /**
5572 * Helper method for determining if a location provider is enabled.
5573 * @param cr the content resolver to use
5574 * @param provider the location provider to query
5575 * @param userId the userId to query
5576 * @return true if the provider is enabled
Tom O'Neilld5759432013-09-11 11:03:03 -07005577 * @deprecated use {@link #LOCATION_MODE} or
5578 * {@link LocationManager#isProviderEnabled(String)}
Victoria Leaseb711d572012-10-02 13:14:11 -07005579 * @hide
5580 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07005581 @Deprecated
Victoria Leaseb711d572012-10-02 13:14:11 -07005582 public static final boolean isLocationProviderEnabledForUser(ContentResolver cr, String provider, int userId) {
5583 String allowedProviders = Settings.Secure.getStringForUser(cr,
5584 LOCATION_PROVIDERS_ALLOWED, userId);
Brad Fitzpatrick11fe1812010-09-10 16:07:52 -07005585 return TextUtils.delimitedStringContains(allowedProviders, ',', provider);
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005586 }
5587
5588 /**
5589 * Thread-safe method for enabling or disabling a single location provider.
5590 * @param cr the content resolver to use
5591 * @param provider the location provider to enable or disable
5592 * @param enabled true if the provider should be enabled
Tom O'Neilla324ac72013-08-26 14:40:23 -07005593 * @deprecated use {@link #putInt(ContentResolver, String, int)} and {@link #LOCATION_MODE}
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005594 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07005595 @Deprecated
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005596 public static final void setLocationProviderEnabled(ContentResolver cr,
5597 String provider, boolean enabled) {
Victoria Leaseb711d572012-10-02 13:14:11 -07005598 setLocationProviderEnabledForUser(cr, provider, enabled, UserHandle.myUserId());
5599 }
5600
5601 /**
5602 * Thread-safe method for enabling or disabling a single location provider.
Tom O'Neilla324ac72013-08-26 14:40:23 -07005603 *
Victoria Leaseb711d572012-10-02 13:14:11 -07005604 * @param cr the content resolver to use
5605 * @param provider the location provider to enable or disable
5606 * @param enabled true if the provider should be enabled
5607 * @param userId the userId for which to enable/disable providers
Tom O'Neilla324ac72013-08-26 14:40:23 -07005608 * @return true if the value was set, false on database errors
5609 * @deprecated use {@link #putIntForUser(ContentResolver, String, int, int)} and
5610 * {@link #LOCATION_MODE}
Victoria Leaseb711d572012-10-02 13:14:11 -07005611 * @hide
5612 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07005613 @Deprecated
Tom O'Neilla324ac72013-08-26 14:40:23 -07005614 public static final boolean setLocationProviderEnabledForUser(ContentResolver cr,
Victoria Leaseb711d572012-10-02 13:14:11 -07005615 String provider, boolean enabled, int userId) {
David Christie3f7b6522013-08-06 19:19:08 -07005616 synchronized (mLocationSettingsLock) {
5617 // to ensure thread safety, we write the provider name with a '+' or '-'
5618 // and let the SettingsProvider handle it rather than reading and modifying
5619 // the list of enabled providers.
5620 if (enabled) {
5621 provider = "+" + provider;
5622 } else {
5623 provider = "-" + provider;
5624 }
Tom O'Neilla324ac72013-08-26 14:40:23 -07005625 return putStringForUser(cr, Settings.Secure.LOCATION_PROVIDERS_ALLOWED, provider,
David Christie3f7b6522013-08-06 19:19:08 -07005626 userId);
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005627 }
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005628 }
Tom O'Neill1f48b782013-08-19 18:14:56 -07005629
5630 /**
5631 * Thread-safe method for setting the location mode to one of
5632 * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY},
5633 * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}.
5634 *
Tom O'Neill1f48b782013-08-19 18:14:56 -07005635 * @param cr the content resolver to use
5636 * @param mode such as {@link #LOCATION_MODE_HIGH_ACCURACY}
5637 * @param userId the userId for which to change mode
Tom O'Neilla324ac72013-08-26 14:40:23 -07005638 * @return true if the value was set, false on database errors
Tom O'Neill1f48b782013-08-19 18:14:56 -07005639 *
5640 * @throws IllegalArgumentException if mode is not one of the supported values
5641 */
Tom O'Neill7f6f4572013-08-27 10:53:15 -07005642 private static final boolean setLocationModeForUser(ContentResolver cr, int mode,
5643 int userId) {
Tom O'Neill1f48b782013-08-19 18:14:56 -07005644 synchronized (mLocationSettingsLock) {
5645 boolean gps = false;
5646 boolean network = false;
5647 switch (mode) {
5648 case LOCATION_MODE_OFF:
5649 break;
5650 case LOCATION_MODE_SENSORS_ONLY:
5651 gps = true;
5652 break;
5653 case LOCATION_MODE_BATTERY_SAVING:
5654 network = true;
5655 break;
5656 case LOCATION_MODE_HIGH_ACCURACY:
5657 gps = true;
5658 network = true;
5659 break;
5660 default:
5661 throw new IllegalArgumentException("Invalid location mode: " + mode);
5662 }
Tom O'Neill7731a992014-10-09 11:30:49 -07005663 // Note it's important that we set the NLP mode first. The Google implementation
5664 // of NLP clears its NLP consent setting any time it receives a
5665 // LocationManager.PROVIDERS_CHANGED_ACTION broadcast and NLP is disabled. Also,
5666 // it shows an NLP consent dialog any time it receives the broadcast, NLP is
5667 // enabled, and the NLP consent is not set. If 1) we were to enable GPS first,
5668 // 2) a setup wizard has its own NLP consent UI that sets the NLP consent setting,
5669 // and 3) the receiver happened to complete before we enabled NLP, then the Google
5670 // NLP would detect the attempt to enable NLP and show a redundant NLP consent
5671 // dialog. Then the people who wrote the setup wizard would be sad.
Tom O'Neilla324ac72013-08-26 14:40:23 -07005672 boolean nlpSuccess = Settings.Secure.setLocationProviderEnabledForUser(
Tom O'Neill1f48b782013-08-19 18:14:56 -07005673 cr, LocationManager.NETWORK_PROVIDER, network, userId);
Tom O'Neill7731a992014-10-09 11:30:49 -07005674 boolean gpsSuccess = Settings.Secure.setLocationProviderEnabledForUser(
5675 cr, LocationManager.GPS_PROVIDER, gps, userId);
Tom O'Neilla324ac72013-08-26 14:40:23 -07005676 return gpsSuccess && nlpSuccess;
Tom O'Neill1f48b782013-08-19 18:14:56 -07005677 }
5678 }
5679
5680 /**
Tom O'Neill1f48b782013-08-19 18:14:56 -07005681 * Thread-safe method for reading the location mode, returns one of
5682 * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY},
5683 * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}.
5684 *
5685 * @param cr the content resolver to use
5686 * @param userId the userId for which to read the mode
5687 * @return the location mode
5688 */
Tom O'Neill7f6f4572013-08-27 10:53:15 -07005689 private static final int getLocationModeForUser(ContentResolver cr, int userId) {
Tom O'Neill1f48b782013-08-19 18:14:56 -07005690 synchronized (mLocationSettingsLock) {
5691 boolean gpsEnabled = Settings.Secure.isLocationProviderEnabledForUser(
5692 cr, LocationManager.GPS_PROVIDER, userId);
5693 boolean networkEnabled = Settings.Secure.isLocationProviderEnabledForUser(
5694 cr, LocationManager.NETWORK_PROVIDER, userId);
5695 if (gpsEnabled && networkEnabled) {
5696 return LOCATION_MODE_HIGH_ACCURACY;
5697 } else if (gpsEnabled) {
5698 return LOCATION_MODE_SENSORS_ONLY;
5699 } else if (networkEnabled) {
5700 return LOCATION_MODE_BATTERY_SAVING;
5701 } else {
5702 return LOCATION_MODE_OFF;
5703 }
5704 }
5705 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005706 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005707
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005708 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005709 * Global system settings, containing preferences that always apply identically
5710 * to all defined users. Applications can read these but are not allowed to write;
5711 * like the "Secure" settings, these are for preferences that the user must
5712 * explicitly modify through the system UI or specialized APIs for those values.
5713 */
5714 public static final class Global extends NameValueTable {
5715 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_global_version";
5716
5717 /**
5718 * The content:// style URL for global secure settings items. Not public.
5719 */
5720 public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/global");
5721
5722 /**
Amith Yamasani23a0f052014-07-25 12:26:53 -07005723 * Whether users are allowed to add more users or guest from lockscreen.
5724 * <p>
5725 * Type: int
5726 * @hide
5727 */
5728 public static final String ADD_USERS_WHEN_LOCKED = "add_users_when_locked";
5729
5730 /**
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07005731 * Setting whether the global gesture for enabling accessibility is enabled.
5732 * If this gesture is enabled the user will be able to perfrom it to enable
5733 * the accessibility state without visiting the settings app.
5734 * @hide
5735 */
5736 public static final String ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED =
5737 "enable_accessibility_global_gesture_enabled";
5738
5739 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005740 * Whether Airplane Mode is on.
5741 */
5742 public static final String AIRPLANE_MODE_ON = "airplane_mode_on";
5743
5744 /**
Bryce Lee584a4452014-10-21 15:55:55 -07005745 * Whether Theater Mode is on.
5746 * {@hide}
5747 */
Bryce Leecdfebd62015-02-02 08:19:11 -08005748 @SystemApi
Bryce Lee584a4452014-10-21 15:55:55 -07005749 public static final String THEATER_MODE_ON = "theater_mode_on";
5750
5751 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005752 * Constant for use in AIRPLANE_MODE_RADIOS to specify Bluetooth radio.
5753 */
5754 public static final String RADIO_BLUETOOTH = "bluetooth";
5755
5756 /**
5757 * Constant for use in AIRPLANE_MODE_RADIOS to specify Wi-Fi radio.
5758 */
5759 public static final String RADIO_WIFI = "wifi";
5760
5761 /**
5762 * {@hide}
5763 */
5764 public static final String RADIO_WIMAX = "wimax";
5765 /**
5766 * Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio.
5767 */
5768 public static final String RADIO_CELL = "cell";
5769
5770 /**
5771 * Constant for use in AIRPLANE_MODE_RADIOS to specify NFC radio.
5772 */
5773 public static final String RADIO_NFC = "nfc";
5774
5775 /**
5776 * A comma separated list of radios that need to be disabled when airplane mode
5777 * is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are
5778 * included in the comma separated list.
5779 */
5780 public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios";
5781
5782 /**
5783 * A comma separated list of radios that should to be disabled when airplane mode
5784 * is on, but can be manually reenabled by the user. For example, if RADIO_WIFI is
5785 * added to both AIRPLANE_MODE_RADIOS and AIRPLANE_MODE_TOGGLEABLE_RADIOS, then Wifi
5786 * will be turned off when entering airplane mode, but the user will be able to reenable
5787 * Wifi in the Settings app.
5788 *
5789 * {@hide}
5790 */
5791 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios";
5792
5793 /**
5794 * The policy for deciding when Wi-Fi should go to sleep (which will in
5795 * turn switch to using the mobile data as an Internet connection).
5796 * <p>
5797 * Set to one of {@link #WIFI_SLEEP_POLICY_DEFAULT},
5798 * {@link #WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED}, or
5799 * {@link #WIFI_SLEEP_POLICY_NEVER}.
5800 */
5801 public static final String WIFI_SLEEP_POLICY = "wifi_sleep_policy";
5802
5803 /**
5804 * Value for {@link #WIFI_SLEEP_POLICY} to use the default Wi-Fi sleep
5805 * policy, which is to sleep shortly after the turning off
5806 * according to the {@link #STAY_ON_WHILE_PLUGGED_IN} setting.
5807 */
5808 public static final int WIFI_SLEEP_POLICY_DEFAULT = 0;
5809
5810 /**
5811 * Value for {@link #WIFI_SLEEP_POLICY} to use the default policy when
5812 * the device is on battery, and never go to sleep when the device is
5813 * plugged in.
5814 */
5815 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1;
5816
5817 /**
5818 * Value for {@link #WIFI_SLEEP_POLICY} to never go to sleep.
5819 */
5820 public static final int WIFI_SLEEP_POLICY_NEVER = 2;
5821
5822 /**
5823 * Value to specify if the user prefers the date, time and time zone
5824 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
5825 */
5826 public static final String AUTO_TIME = "auto_time";
5827
5828 /**
5829 * Value to specify if the user prefers the time zone
5830 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
5831 */
5832 public static final String AUTO_TIME_ZONE = "auto_time_zone";
5833
5834 /**
5835 * URI for the car dock "in" event sound.
5836 * @hide
5837 */
5838 public static final String CAR_DOCK_SOUND = "car_dock_sound";
5839
5840 /**
5841 * URI for the car dock "out" event sound.
5842 * @hide
5843 */
5844 public static final String CAR_UNDOCK_SOUND = "car_undock_sound";
5845
5846 /**
5847 * URI for the desk dock "in" event sound.
5848 * @hide
5849 */
5850 public static final String DESK_DOCK_SOUND = "desk_dock_sound";
5851
5852 /**
5853 * URI for the desk dock "out" event sound.
5854 * @hide
5855 */
5856 public static final String DESK_UNDOCK_SOUND = "desk_undock_sound";
5857
5858 /**
5859 * Whether to play a sound for dock events.
5860 * @hide
5861 */
5862 public static final String DOCK_SOUNDS_ENABLED = "dock_sounds_enabled";
5863
5864 /**
5865 * URI for the "device locked" (keyguard shown) sound.
5866 * @hide
5867 */
5868 public static final String LOCK_SOUND = "lock_sound";
5869
5870 /**
5871 * URI for the "device unlocked" sound.
5872 * @hide
5873 */
5874 public static final String UNLOCK_SOUND = "unlock_sound";
5875
5876 /**
Adrian Roos49e057d2014-08-13 17:14:51 +02005877 * URI for the "device is trusted" sound, which is played when the device enters the trusted
5878 * state without unlocking.
5879 * @hide
5880 */
5881 public static final String TRUSTED_SOUND = "trusted_sound";
5882
5883 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005884 * URI for the low battery sound file.
5885 * @hide
5886 */
5887 public static final String LOW_BATTERY_SOUND = "low_battery_sound";
5888
5889 /**
5890 * Whether to play a sound for low-battery alerts.
5891 * @hide
5892 */
5893 public static final String POWER_SOUNDS_ENABLED = "power_sounds_enabled";
5894
5895 /**
Jeff Brown84e27562012-12-07 13:56:34 -08005896 * URI for the "wireless charging started" sound.
5897 * @hide
5898 */
5899 public static final String WIRELESS_CHARGING_STARTED_SOUND =
5900 "wireless_charging_started_sound";
5901
5902 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005903 * Whether we keep the device on while the device is plugged in.
5904 * Supported values are:
5905 * <ul>
5906 * <li>{@code 0} to never stay on while plugged in</li>
5907 * <li>{@link BatteryManager#BATTERY_PLUGGED_AC} to stay on for AC charger</li>
5908 * <li>{@link BatteryManager#BATTERY_PLUGGED_USB} to stay on for USB charger</li>
5909 * <li>{@link BatteryManager#BATTERY_PLUGGED_WIRELESS} to stay on for wireless charger</li>
5910 * </ul>
5911 * These values can be OR-ed together.
5912 */
5913 public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in";
5914
5915 /**
Christopher Tate58f41ec2013-01-11 15:40:36 -08005916 * When the user has enable the option to have a "bug report" command
5917 * in the power menu.
5918 * @hide
5919 */
5920 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
5921
5922 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005923 * Whether ADB is enabled.
5924 */
5925 public static final String ADB_ENABLED = "adb_enabled";
5926
5927 /**
Jon Miranda836c0a82014-08-11 12:32:26 -07005928 * Whether Views are allowed to save their attribute data.
5929 * @hide
5930 */
5931 public static final String DEBUG_VIEW_ATTRIBUTES = "debug_view_attributes";
5932
5933 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005934 * Whether assisted GPS should be enabled or not.
5935 * @hide
5936 */
5937 public static final String ASSISTED_GPS_ENABLED = "assisted_gps_enabled";
5938
5939 /**
5940 * Whether bluetooth is enabled/disabled
5941 * 0=disabled. 1=enabled.
5942 */
5943 public static final String BLUETOOTH_ON = "bluetooth_on";
5944
5945 /**
5946 * CDMA Cell Broadcast SMS
5947 * 0 = CDMA Cell Broadcast SMS disabled
5948 * 1 = CDMA Cell Broadcast SMS enabled
5949 * @hide
5950 */
5951 public static final String CDMA_CELL_BROADCAST_SMS =
5952 "cdma_cell_broadcast_sms";
5953
5954 /**
5955 * The CDMA roaming mode 0 = Home Networks, CDMA default
5956 * 1 = Roaming on Affiliated networks
5957 * 2 = Roaming on any networks
5958 * @hide
5959 */
5960 public static final String CDMA_ROAMING_MODE = "roaming_settings";
5961
5962 /**
5963 * The CDMA subscription mode 0 = RUIM/SIM (default)
5964 * 1 = NV
5965 * @hide
5966 */
5967 public static final String CDMA_SUBSCRIPTION_MODE = "subscription_mode";
5968
5969 /** Inactivity timeout to track mobile data activity.
5970 *
5971 * If set to a positive integer, it indicates the inactivity timeout value in seconds to
5972 * infer the data activity of mobile network. After a period of no activity on mobile
5973 * networks with length specified by the timeout, an {@code ACTION_DATA_ACTIVITY_CHANGE}
5974 * intent is fired to indicate a transition of network status from "active" to "idle". Any
5975 * subsequent activity on mobile networks triggers the firing of {@code
5976 * ACTION_DATA_ACTIVITY_CHANGE} intent indicating transition from "idle" to "active".
5977 *
5978 * Network activity refers to transmitting or receiving data on the network interfaces.
5979 *
5980 * Tracking is disabled if set to zero or negative value.
5981 *
5982 * @hide
5983 */
5984 public static final String DATA_ACTIVITY_TIMEOUT_MOBILE = "data_activity_timeout_mobile";
5985
5986 /** Timeout to tracking Wifi data activity. Same as {@code DATA_ACTIVITY_TIMEOUT_MOBILE}
5987 * but for Wifi network.
5988 * @hide
5989 */
5990 public static final String DATA_ACTIVITY_TIMEOUT_WIFI = "data_activity_timeout_wifi";
5991
5992 /**
5993 * Whether or not data roaming is enabled. (0 = false, 1 = true)
5994 */
5995 public static final String DATA_ROAMING = "data_roaming";
5996
5997 /**
Wink Saville75c1e692013-03-20 17:06:50 -07005998 * The value passed to a Mobile DataConnection via bringUp which defines the
5999 * number of retries to preform when setting up the initial connection. The default
6000 * value defined in DataConnectionTrackerBase#DEFAULT_MDC_INITIAL_RETRY is currently 1.
6001 * @hide
6002 */
6003 public static final String MDC_INITIAL_MAX_RETRY = "mdc_initial_max_retry";
6004
6005 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006006 * Whether user has enabled development settings.
6007 */
6008 public static final String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled";
6009
6010 /**
6011 * Whether the device has been provisioned (0 = false, 1 = true)
6012 */
6013 public static final String DEVICE_PROVISIONED = "device_provisioned";
6014
6015 /**
6016 * The saved value for WindowManagerService.setForcedDisplayDensity().
6017 * One integer in dpi. If unset, then use the real display density.
6018 * @hide
6019 */
6020 public static final String DISPLAY_DENSITY_FORCED = "display_density_forced";
6021
6022 /**
6023 * The saved value for WindowManagerService.setForcedDisplaySize().
6024 * Two integers separated by a comma. If unset, then use the real display size.
6025 * @hide
6026 */
6027 public static final String DISPLAY_SIZE_FORCED = "display_size_forced";
6028
6029 /**
6030 * The maximum size, in bytes, of a download that the download manager will transfer over
6031 * a non-wifi connection.
6032 * @hide
6033 */
6034 public static final String DOWNLOAD_MAX_BYTES_OVER_MOBILE =
6035 "download_manager_max_bytes_over_mobile";
6036
6037 /**
6038 * The recommended maximum size, in bytes, of a download that the download manager should
6039 * transfer over a non-wifi connection. Over this size, the use will be warned, but will
6040 * have the option to start the download over the mobile connection anyway.
6041 * @hide
6042 */
6043 public static final String DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE =
6044 "download_manager_recommended_max_bytes_over_mobile";
6045
6046 /**
Christopher Tateaa036a22014-05-19 16:33:27 -07006047 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
Christopher Tate06efb532012-08-24 15:29:27 -07006048 */
Christopher Tateaa036a22014-05-19 16:33:27 -07006049 @Deprecated
6050 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
Christopher Tate06efb532012-08-24 15:29:27 -07006051
6052 /**
Jinsuk Kimb3d91772014-07-10 12:48:54 +09006053 * Whether HDMI control shall be enabled. If disabled, no CEC/MHL command will be
6054 * sent or processed. (0 = false, 1 = true)
6055 * @hide
6056 */
6057 public static final String HDMI_CONTROL_ENABLED = "hdmi_control_enabled";
6058
6059 /**
6060 * Whether HDMI system audio is enabled. If enabled, TV internal speaker is muted,
6061 * and the output is redirected to AV Receiver connected via
6062 * {@Global#HDMI_SYSTEM_AUDIO_OUTPUT}.
6063 * @hide
6064 */
6065 public static final String HDMI_SYSTEM_AUDIO_ENABLED = "hdmi_system_audio_enabled";
6066
6067 /**
Jinsuk Kimb3d91772014-07-10 12:48:54 +09006068 * Whether TV will automatically turn on upon reception of the CEC command
6069 * &lt;Text View On&gt; or &lt;Image View On&gt;. (0 = false, 1 = true)
6070 * @hide
6071 */
6072 public static final String HDMI_CONTROL_AUTO_WAKEUP_ENABLED =
6073 "hdmi_control_auto_wakeup_enabled";
6074
6075 /**
6076 * Whether TV will also turn off other CEC devices when it goes to standby mode.
6077 * (0 = false, 1 = true)
6078 * @hide
6079 */
6080 public static final String HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED =
6081 "hdmi_control_auto_device_off_enabled";
6082
6083 /**
Lorenzo Colitti06d7e532015-03-16 23:46:24 +09006084 * Whether to use the DHCP client from Lollipop and earlier instead of the newer Android DHCP
6085 * client.
6086 * (0 = false, 1 = true)
6087 * @hide
6088 */
6089 public static final String LEGACY_DHCP_CLIENT = "legacy_dhcp_client";
6090
6091 /**
Jinsuk Kimb3d91772014-07-10 12:48:54 +09006092 * Whether TV will switch to MHL port when a mobile device is plugged in.
6093 * (0 = false, 1 = true)
6094 * @hide
6095 */
6096 public static final String MHL_INPUT_SWITCHING_ENABLED = "mhl_input_switching_enabled";
6097
6098 /**
6099 * Whether TV will charge the mobile device connected at MHL port. (0 = false, 1 = true)
6100 * @hide
6101 */
6102 public static final String MHL_POWER_CHARGE_ENABLED = "mhl_power_charge_enabled";
6103
6104 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006105 * Whether mobile data connections are allowed by the user. See
6106 * ConnectivityManager for more info.
6107 * @hide
6108 */
6109 public static final String MOBILE_DATA = "mobile_data";
6110
6111 /** {@hide} */
6112 public static final String NETSTATS_ENABLED = "netstats_enabled";
6113 /** {@hide} */
6114 public static final String NETSTATS_POLL_INTERVAL = "netstats_poll_interval";
6115 /** {@hide} */
6116 public static final String NETSTATS_TIME_CACHE_MAX_AGE = "netstats_time_cache_max_age";
6117 /** {@hide} */
6118 public static final String NETSTATS_GLOBAL_ALERT_BYTES = "netstats_global_alert_bytes";
6119 /** {@hide} */
6120 public static final String NETSTATS_SAMPLE_ENABLED = "netstats_sample_enabled";
Christopher Tate06efb532012-08-24 15:29:27 -07006121
6122 /** {@hide} */
6123 public static final String NETSTATS_DEV_BUCKET_DURATION = "netstats_dev_bucket_duration";
6124 /** {@hide} */
6125 public static final String NETSTATS_DEV_PERSIST_BYTES = "netstats_dev_persist_bytes";
6126 /** {@hide} */
6127 public static final String NETSTATS_DEV_ROTATE_AGE = "netstats_dev_rotate_age";
6128 /** {@hide} */
6129 public static final String NETSTATS_DEV_DELETE_AGE = "netstats_dev_delete_age";
6130
6131 /** {@hide} */
6132 public static final String NETSTATS_UID_BUCKET_DURATION = "netstats_uid_bucket_duration";
6133 /** {@hide} */
6134 public static final String NETSTATS_UID_PERSIST_BYTES = "netstats_uid_persist_bytes";
6135 /** {@hide} */
6136 public static final String NETSTATS_UID_ROTATE_AGE = "netstats_uid_rotate_age";
6137 /** {@hide} */
6138 public static final String NETSTATS_UID_DELETE_AGE = "netstats_uid_delete_age";
6139
6140 /** {@hide} */
6141 public static final String NETSTATS_UID_TAG_BUCKET_DURATION = "netstats_uid_tag_bucket_duration";
6142 /** {@hide} */
6143 public static final String NETSTATS_UID_TAG_PERSIST_BYTES = "netstats_uid_tag_persist_bytes";
6144 /** {@hide} */
6145 public static final String NETSTATS_UID_TAG_ROTATE_AGE = "netstats_uid_tag_rotate_age";
6146 /** {@hide} */
6147 public static final String NETSTATS_UID_TAG_DELETE_AGE = "netstats_uid_tag_delete_age";
6148
6149 /**
6150 * User preference for which network(s) should be used. Only the
6151 * connectivity service should touch this.
6152 */
6153 public static final String NETWORK_PREFERENCE = "network_preference";
6154
6155 /**
Jeff Davidsondd6fd1e2014-04-14 15:14:30 -07006156 * Which package name to use for network scoring. If null, or if the package is not a valid
6157 * scorer app, external network scores will neither be requested nor accepted.
6158 * @hide
6159 */
6160 public static final String NETWORK_SCORER_APP = "network_scorer_app";
6161
6162 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006163 * If the NITZ_UPDATE_DIFF time is exceeded then an automatic adjustment
6164 * to SystemClock will be allowed even if NITZ_UPDATE_SPACING has not been
6165 * exceeded.
6166 * @hide
6167 */
6168 public static final String NITZ_UPDATE_DIFF = "nitz_update_diff";
6169
6170 /**
6171 * The length of time in milli-seconds that automatic small adjustments to
6172 * SystemClock are ignored if NITZ_UPDATE_DIFF is not exceeded.
6173 * @hide
6174 */
6175 public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing";
6176
6177 /** Preferred NTP server. {@hide} */
6178 public static final String NTP_SERVER = "ntp_server";
6179 /** Timeout in milliseconds to wait for NTP server. {@hide} */
6180 public static final String NTP_TIMEOUT = "ntp_timeout";
6181
6182 /**
rich cannings4d8fc792012-09-07 14:43:43 -07006183 * Whether the package manager should send package verification broadcasts for verifiers to
6184 * review apps prior to installation.
6185 * 1 = request apps to be verified prior to installation, if a verifier exists.
6186 * 0 = do not verify apps before installation
rich cannings4e5753f2012-09-19 16:03:56 -07006187 * @hide
rich cannings4d8fc792012-09-07 14:43:43 -07006188 */
6189 public static final String PACKAGE_VERIFIER_ENABLE = "package_verifier_enable";
6190
6191 /** Timeout for package verification.
rich cannings4e5753f2012-09-19 16:03:56 -07006192 * @hide */
rich cannings4d8fc792012-09-07 14:43:43 -07006193 public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout";
6194
6195 /** Default response code for package verification.
rich cannings4e5753f2012-09-19 16:03:56 -07006196 * @hide */
rich cannings4d8fc792012-09-07 14:43:43 -07006197 public static final String PACKAGE_VERIFIER_DEFAULT_RESPONSE = "verifier_default_response";
6198
rich cannings4e5753f2012-09-19 16:03:56 -07006199 /**
6200 * Show package verification setting in the Settings app.
rich canningse6686b32012-09-16 14:02:20 -07006201 * 1 = show (default)
6202 * 0 = hide
rich cannings4e5753f2012-09-19 16:03:56 -07006203 * @hide
rich canningse6686b32012-09-16 14:02:20 -07006204 */
6205 public static final String PACKAGE_VERIFIER_SETTING_VISIBLE = "verifier_setting_visible";
6206
rich cannings4d8fc792012-09-07 14:43:43 -07006207 /**
Fabrice Di Meglio1c1b4712014-11-19 17:12:32 -08006208 * Run package verification on apps installed through ADB/ADT/USB
rich cannings4e5753f2012-09-19 16:03:56 -07006209 * 1 = perform package verification on ADB installs (default)
6210 * 0 = bypass package verification on ADB installs
6211 * @hide
6212 */
6213 public static final String PACKAGE_VERIFIER_INCLUDE_ADB = "verifier_verify_adb_installs";
6214
6215 /**
Christopher Tate7265abe2014-11-21 13:54:45 -08006216 * Time since last fstrim (milliseconds) after which we force one to happen
6217 * during device startup. If unset, the default is 3 days.
6218 * @hide
6219 */
6220 public static final String FSTRIM_MANDATORY_INTERVAL = "fstrim_mandatory_interval";
6221
6222 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006223 * The interval in milliseconds at which to check packet counts on the
6224 * mobile data interface when screen is on, to detect possible data
6225 * connection problems.
6226 * @hide
6227 */
6228 public static final String PDP_WATCHDOG_POLL_INTERVAL_MS =
6229 "pdp_watchdog_poll_interval_ms";
6230
6231 /**
6232 * The interval in milliseconds at which to check packet counts on the
6233 * mobile data interface when screen is off, to detect possible data
6234 * connection problems.
6235 * @hide
6236 */
6237 public static final String PDP_WATCHDOG_LONG_POLL_INTERVAL_MS =
6238 "pdp_watchdog_long_poll_interval_ms";
6239
6240 /**
6241 * The interval in milliseconds at which to check packet counts on the
6242 * mobile data interface after {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT}
6243 * outgoing packets has been reached without incoming packets.
6244 * @hide
6245 */
6246 public static final String PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS =
6247 "pdp_watchdog_error_poll_interval_ms";
6248
6249 /**
6250 * The number of outgoing packets sent without seeing an incoming packet
6251 * that triggers a countdown (of {@link #PDP_WATCHDOG_ERROR_POLL_COUNT}
6252 * device is logged to the event log
6253 * @hide
6254 */
6255 public static final String PDP_WATCHDOG_TRIGGER_PACKET_COUNT =
6256 "pdp_watchdog_trigger_packet_count";
6257
6258 /**
6259 * The number of polls to perform (at {@link #PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS})
6260 * after hitting {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} before
6261 * attempting data connection recovery.
6262 * @hide
6263 */
6264 public static final String PDP_WATCHDOG_ERROR_POLL_COUNT =
6265 "pdp_watchdog_error_poll_count";
6266
6267 /**
6268 * The number of failed PDP reset attempts before moving to something more
6269 * drastic: re-registering to the network.
6270 * @hide
6271 */
6272 public static final String PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT =
6273 "pdp_watchdog_max_pdp_reset_fail_count";
6274
6275 /**
6276 * A positive value indicates how often the SamplingProfiler
6277 * should take snapshots. Zero value means SamplingProfiler
6278 * is disabled.
6279 *
6280 * @hide
6281 */
6282 public static final String SAMPLING_PROFILER_MS = "sampling_profiler_ms";
6283
6284 /**
6285 * URL to open browser on to allow user to manage a prepay account
6286 * @hide
6287 */
6288 public static final String SETUP_PREPAID_DATA_SERVICE_URL =
6289 "setup_prepaid_data_service_url";
6290
6291 /**
6292 * URL to attempt a GET on to see if this is a prepay device
6293 * @hide
6294 */
6295 public static final String SETUP_PREPAID_DETECTION_TARGET_URL =
6296 "setup_prepaid_detection_target_url";
6297
6298 /**
6299 * Host to check for a redirect to after an attempt to GET
6300 * SETUP_PREPAID_DETECTION_TARGET_URL. (If we redirected there,
6301 * this is a prepaid device with zero balance.)
6302 * @hide
6303 */
6304 public static final String SETUP_PREPAID_DETECTION_REDIR_HOST =
6305 "setup_prepaid_detection_redir_host";
6306
6307 /**
Jake Hamby76a61422012-09-06 17:40:21 -07006308 * The interval in milliseconds at which to check the number of SMS sent out without asking
6309 * for use permit, to limit the un-authorized SMS usage.
6310 *
6311 * @hide
6312 */
6313 public static final String SMS_OUTGOING_CHECK_INTERVAL_MS =
6314 "sms_outgoing_check_interval_ms";
6315
6316 /**
6317 * The number of outgoing SMS sent without asking for user permit (of {@link
6318 * #SMS_OUTGOING_CHECK_INTERVAL_MS}
6319 *
6320 * @hide
6321 */
6322 public static final String SMS_OUTGOING_CHECK_MAX_COUNT =
6323 "sms_outgoing_check_max_count";
6324
6325 /**
6326 * Used to disable SMS short code confirmation - defaults to true.
Robert Greenwalt026efcc2012-09-24 10:03:21 -07006327 * True indcates we will do the check, etc. Set to false to disable.
Jake Hamby76a61422012-09-06 17:40:21 -07006328 * @see com.android.internal.telephony.SmsUsageMonitor
6329 * @hide
6330 */
6331 public static final String SMS_SHORT_CODE_CONFIRMATION = "sms_short_code_confirmation";
6332
Robert Greenwalt026efcc2012-09-24 10:03:21 -07006333 /**
6334 * Used to select which country we use to determine premium sms codes.
6335 * One of com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_SIM,
6336 * com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_NETWORK,
6337 * or com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_BOTH.
6338 * @hide
6339 */
6340 public static final String SMS_SHORT_CODE_RULE = "sms_short_code_rule";
6341
Jake Hamby76a61422012-09-06 17:40:21 -07006342 /**
JP Abgrall32d1ac4d2014-02-21 12:05:20 -08006343 * Used to select TCP's default initial receiver window size in segments - defaults to a build config value
6344 * @hide
6345 */
6346 public static final String TCP_DEFAULT_INIT_RWND = "tcp_default_init_rwnd";
6347
6348 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006349 * Used to disable Tethering on a device - defaults to true
6350 * @hide
6351 */
6352 public static final String TETHER_SUPPORTED = "tether_supported";
6353
6354 /**
6355 * Used to require DUN APN on the device or not - defaults to a build config value
6356 * which defaults to false
6357 * @hide
6358 */
6359 public static final String TETHER_DUN_REQUIRED = "tether_dun_required";
6360
6361 /**
6362 * Used to hold a gservices-provisioned apn value for DUN. If set, or the
6363 * corresponding build config values are set it will override the APN DB
6364 * values.
6365 * Consists of a comma seperated list of strings:
6366 * "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type"
6367 * note that empty fields can be ommitted: "name,apn,,,,,,,,,310,260,,DUN"
6368 * @hide
6369 */
6370 public static final String TETHER_DUN_APN = "tether_dun_apn";
6371
6372 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006373 * USB Mass Storage Enabled
6374 */
6375 public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled";
6376
6377 /**
6378 * If this setting is set (to anything), then all references
6379 * to Gmail on the device must change to Google Mail.
6380 */
6381 public static final String USE_GOOGLE_MAIL = "use_google_mail";
6382
Hui Shu22671772014-10-01 21:41:07 +00006383 /**
6384 * Webview Data reduction proxy key.
6385 * @hide
6386 */
6387 public static final String WEBVIEW_DATA_REDUCTION_PROXY_KEY =
6388 "webview_data_reduction_proxy_key";
6389
Christopher Tate06efb532012-08-24 15:29:27 -07006390 /**
Jeff Brown89d55462012-09-19 11:33:42 -07006391 * Whether Wifi display is enabled/disabled
6392 * 0=disabled. 1=enabled.
6393 * @hide
6394 */
6395 public static final String WIFI_DISPLAY_ON = "wifi_display_on";
6396
6397 /**
Chong Zhang1f3ecaa2013-05-03 15:55:36 -07006398 * Whether Wifi display certification mode is enabled/disabled
6399 * 0=disabled. 1=enabled.
6400 * @hide
6401 */
6402 public static final String WIFI_DISPLAY_CERTIFICATION_ON =
6403 "wifi_display_certification_on";
6404
6405 /**
Chong Zhange38af812013-08-29 17:25:17 -07006406 * WPS Configuration method used by Wifi display, this setting only
6407 * takes effect when WIFI_DISPLAY_CERTIFICATION_ON is 1 (enabled).
6408 *
6409 * Possible values are:
6410 *
6411 * WpsInfo.INVALID: use default WPS method chosen by framework
6412 * WpsInfo.PBC : use Push button
6413 * WpsInfo.KEYPAD : use Keypad
6414 * WpsInfo.DISPLAY: use Display
6415 * @hide
6416 */
6417 public static final String WIFI_DISPLAY_WPS_CONFIG =
6418 "wifi_display_wps_config";
6419
6420 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006421 * Whether to notify the user of open networks.
6422 * <p>
6423 * If not connected and the scan results have an open network, we will
6424 * put this notification up. If we attempt to connect to a network or
6425 * the open network(s) disappear, we remove the notification. When we
6426 * show the notification, we will not show it again for
6427 * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time.
6428 */
6429 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
6430 "wifi_networks_available_notification_on";
6431 /**
6432 * {@hide}
6433 */
6434 public static final String WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON =
6435 "wimax_networks_available_notification_on";
6436
6437 /**
6438 * Delay (in seconds) before repeating the Wi-Fi networks available notification.
6439 * Connecting to a network will reset the timer.
6440 */
6441 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
6442 "wifi_networks_available_repeat_delay";
6443
6444 /**
Robert Greenwalt3ea0c992013-10-03 21:13:49 +00006445 * 802.11 country code in ISO 3166 format
6446 * @hide
6447 */
6448 public static final String WIFI_COUNTRY_CODE = "wifi_country_code";
6449
6450 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006451 * The interval in milliseconds to issue wake up scans when wifi needs
6452 * to connect. This is necessary to connect to an access point when
6453 * device is on the move and the screen is off.
6454 * @hide
6455 */
6456 public static final String WIFI_FRAMEWORK_SCAN_INTERVAL_MS =
6457 "wifi_framework_scan_interval_ms";
6458
6459 /**
6460 * The interval in milliseconds after which Wi-Fi is considered idle.
6461 * When idle, it is possible for the device to be switched from Wi-Fi to
6462 * the mobile data network.
6463 * @hide
6464 */
6465 public static final String WIFI_IDLE_MS = "wifi_idle_ms";
6466
6467 /**
6468 * When the number of open networks exceeds this number, the
6469 * least-recently-used excess networks will be removed.
6470 */
6471 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept";
6472
6473 /**
6474 * Whether the Wi-Fi should be on. Only the Wi-Fi service should touch this.
6475 */
6476 public static final String WIFI_ON = "wifi_on";
6477
6478 /**
Irfan Sheriff11aefad2013-03-06 07:57:41 -08006479 * Setting to allow scans to be enabled even wifi is turned off for connectivity.
6480 * @hide
6481 */
6482 public static final String WIFI_SCAN_ALWAYS_AVAILABLE =
6483 "wifi_scan_always_enabled";
6484
6485 /**
Wei Wangd91f1932015-03-19 15:09:56 -07006486 * Settings to allow BLE scans to be enabled even when Bluetooth is turned off for
6487 * connectivity.
6488 * @hide
6489 */
6490 public static final String BLE_SCAN_ALWAYS_AVAILABLE =
6491 "ble_scan_always_enabled";
6492
6493 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006494 * Used to save the Wifi_ON state prior to tethering.
6495 * This state will be checked to restore Wifi after
6496 * the user turns off tethering.
6497 *
6498 * @hide
6499 */
6500 public static final String WIFI_SAVED_STATE = "wifi_saved_state";
6501
6502 /**
6503 * The interval in milliseconds to scan as used by the wifi supplicant
6504 * @hide
6505 */
6506 public static final String WIFI_SUPPLICANT_SCAN_INTERVAL_MS =
6507 "wifi_supplicant_scan_interval_ms";
6508
vandwalle7c3606c2014-03-31 19:12:07 -07006509 /**
6510 * whether frameworks handles wifi auto-join
6511 * @hide
6512 */
6513 public static final String WIFI_ENHANCED_AUTO_JOIN =
6514 "wifi_enhanced_auto_join";
6515
6516 /**
6517 * whether settings show RSSI
6518 * @hide
6519 */
6520 public static final String WIFI_NETWORK_SHOW_RSSI =
6521 "wifi_network_show_rssi";
6522
6523 /**
Irfan Sheriff3809f502012-09-17 16:04:57 -07006524 * The interval in milliseconds to scan at supplicant when p2p is connected
6525 * @hide
6526 */
6527 public static final String WIFI_SCAN_INTERVAL_WHEN_P2P_CONNECTED_MS =
6528 "wifi_scan_interval_p2p_connected_ms";
6529
6530 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006531 * Whether the Wi-Fi watchdog is enabled.
6532 */
6533 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
6534
6535 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006536 * Setting to turn off poor network avoidance on Wi-Fi. Feature is enabled by default and
6537 * the setting needs to be set to 0 to disable it.
6538 * @hide
6539 */
6540 public static final String WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED =
6541 "wifi_watchdog_poor_network_test_enabled";
6542
6543 /**
6544 * Setting to turn on suspend optimizations at screen off on Wi-Fi. Enabled by default and
6545 * needs to be set to 0 to disable it.
6546 * @hide
6547 */
6548 public static final String WIFI_SUSPEND_OPTIMIZATIONS_ENABLED =
6549 "wifi_suspend_optimizations_enabled";
6550
6551 /**
6552 * The maximum number of times we will retry a connection to an access
6553 * point for which we have failed in acquiring an IP address from DHCP.
6554 * A value of N means that we will make N+1 connection attempts in all.
6555 */
6556 public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count";
6557
6558 /**
6559 * Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile
6560 * data connectivity to be established after a disconnect from Wi-Fi.
6561 */
6562 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
6563 "wifi_mobile_data_transition_wakelock_timeout_ms";
6564
6565 /**
6566 * The operational wifi frequency band
6567 * Set to one of {@link WifiManager#WIFI_FREQUENCY_BAND_AUTO},
6568 * {@link WifiManager#WIFI_FREQUENCY_BAND_5GHZ} or
6569 * {@link WifiManager#WIFI_FREQUENCY_BAND_2GHZ}
6570 *
6571 * @hide
6572 */
6573 public static final String WIFI_FREQUENCY_BAND = "wifi_frequency_band";
6574
6575 /**
6576 * The Wi-Fi peer-to-peer device name
6577 * @hide
6578 */
6579 public static final String WIFI_P2P_DEVICE_NAME = "wifi_p2p_device_name";
6580
6581 /**
Robert Greenwaltc12783a2013-05-16 12:48:20 -07006582 * The min time between wifi disable and wifi enable
6583 * @hide
6584 */
6585 public static final String WIFI_REENABLE_DELAY_MS = "wifi_reenable_delay";
6586
6587 /**
Jeff Davidsona20ca67d2014-12-16 11:48:54 -08006588 * Timeout for ephemeral networks when all known BSSIDs go out of range. We will disconnect
6589 * from an ephemeral network if there is no BSSID for that network with a non-null score that
6590 * has been seen in this time period.
6591 *
6592 * If this is less than or equal to zero, we use a more conservative behavior and only check
6593 * for a non-null score from the currently connected or target BSSID.
6594 * @hide
6595 */
6596 public static final String WIFI_EPHEMERAL_OUT_OF_RANGE_TIMEOUT_MS =
6597 "wifi_ephemeral_out_of_range_timeout_ms";
6598
6599 /**
Christopher Tatec868b642012-09-12 17:41:04 -07006600 * The number of milliseconds to delay when checking for data stalls during
6601 * non-aggressive detection. (screen is turned off.)
6602 * @hide
6603 */
6604 public static final String DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS =
6605 "data_stall_alarm_non_aggressive_delay_in_ms";
6606
6607 /**
6608 * The number of milliseconds to delay when checking for data stalls during
6609 * aggressive detection. (screen on or suspected data stall)
6610 * @hide
6611 */
6612 public static final String DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS =
6613 "data_stall_alarm_aggressive_delay_in_ms";
6614
6615 /**
Wink Savillece1e3792013-09-03 16:41:44 -07006616 * The number of milliseconds to allow the provisioning apn to remain active
6617 * @hide
6618 */
6619 public static final String PROVISIONING_APN_ALARM_DELAY_IN_MS =
6620 "provisioning_apn_alarm_delay_in_ms";
6621
6622 /**
Christopher Tatec868b642012-09-12 17:41:04 -07006623 * The interval in milliseconds at which to check gprs registration
6624 * after the first registration mismatch of gprs and voice service,
6625 * to detect possible data network registration problems.
6626 *
6627 * @hide
6628 */
6629 public static final String GPRS_REGISTER_CHECK_PERIOD_MS =
6630 "gprs_register_check_period_ms";
6631
6632 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006633 * Nonzero causes Log.wtf() to crash.
6634 * @hide
6635 */
6636 public static final String WTF_IS_FATAL = "wtf_is_fatal";
6637
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07006638 /**
6639 * Ringer mode. This is used internally, changing this value will not
6640 * change the ringer mode. See AudioManager.
6641 */
6642 public static final String MODE_RINGER = "mode_ringer";
Christopher Tate06efb532012-08-24 15:29:27 -07006643
Jeff Brownd4935962012-09-25 13:27:20 -07006644 /**
6645 * Overlay display devices setting.
6646 * The associated value is a specially formatted string that describes the
6647 * size and density of simulated secondary display devices.
6648 * <p>
6649 * Format: {width}x{height}/{dpi};...
6650 * </p><p>
6651 * Example:
6652 * <ul>
6653 * <li><code>1280x720/213</code>: make one overlay that is 1280x720 at 213dpi.</li>
6654 * <li><code>1920x1080/320;1280x720/213</code>: make two overlays, the first
6655 * at 1080p and the second at 720p.</li>
6656 * <li>If the value is empty, then no overlay display devices are created.</li>
6657 * </ul></p>
6658 *
6659 * @hide
6660 */
6661 public static final String OVERLAY_DISPLAY_DEVICES = "overlay_display_devices";
Christopher Tate06efb532012-08-24 15:29:27 -07006662
Jeff Sharkey625239a2012-09-26 22:03:49 -07006663 /**
6664 * Threshold values for the duration and level of a discharge cycle,
6665 * under which we log discharge cycle info.
6666 *
6667 * @hide
6668 */
6669 public static final String
6670 BATTERY_DISCHARGE_DURATION_THRESHOLD = "battery_discharge_duration_threshold";
6671
6672 /** @hide */
6673 public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold";
6674
6675 /**
6676 * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR
6677 * intents on application crashes and ANRs. If this is disabled, the
6678 * crash/ANR dialog will never display the "Report" button.
6679 * <p>
6680 * Type: int (0 = disallow, 1 = allow)
6681 *
6682 * @hide
6683 */
6684 public static final String SEND_ACTION_APP_ERROR = "send_action_app_error";
6685
6686 /**
6687 * Maximum age of entries kept by {@link DropBoxManager}.
6688 *
6689 * @hide
6690 */
6691 public static final String DROPBOX_AGE_SECONDS = "dropbox_age_seconds";
6692
6693 /**
6694 * Maximum number of entry files which {@link DropBoxManager} will keep
6695 * around.
6696 *
6697 * @hide
6698 */
6699 public static final String DROPBOX_MAX_FILES = "dropbox_max_files";
6700
6701 /**
6702 * Maximum amount of disk space used by {@link DropBoxManager} no matter
6703 * what.
6704 *
6705 * @hide
6706 */
6707 public static final String DROPBOX_QUOTA_KB = "dropbox_quota_kb";
6708
6709 /**
6710 * Percent of free disk (excluding reserve) which {@link DropBoxManager}
6711 * will use.
6712 *
6713 * @hide
6714 */
6715 public static final String DROPBOX_QUOTA_PERCENT = "dropbox_quota_percent";
6716
6717 /**
6718 * Percent of total disk which {@link DropBoxManager} will never dip
6719 * into.
6720 *
6721 * @hide
6722 */
6723 public static final String DROPBOX_RESERVE_PERCENT = "dropbox_reserve_percent";
6724
6725 /**
6726 * Prefix for per-tag dropbox disable/enable settings.
6727 *
6728 * @hide
6729 */
6730 public static final String DROPBOX_TAG_PREFIX = "dropbox:";
6731
6732 /**
6733 * Lines of logcat to include with system crash/ANR/etc. reports, as a
6734 * prefix of the dropbox tag of the report type. For example,
6735 * "logcat_for_system_server_anr" controls the lines of logcat captured
6736 * with system server ANR reports. 0 to disable.
6737 *
6738 * @hide
6739 */
6740 public static final String ERROR_LOGCAT_PREFIX = "logcat_for_";
6741
6742 /**
6743 * The interval in minutes after which the amount of free storage left
6744 * on the device is logged to the event log
6745 *
6746 * @hide
6747 */
6748 public static final String SYS_FREE_STORAGE_LOG_INTERVAL = "sys_free_storage_log_interval";
6749
6750 /**
6751 * Threshold for the amount of change in disk free space required to
6752 * report the amount of free space. Used to prevent spamming the logs
6753 * when the disk free space isn't changing frequently.
6754 *
6755 * @hide
6756 */
6757 public static final String
6758 DISK_FREE_CHANGE_REPORTING_THRESHOLD = "disk_free_change_reporting_threshold";
6759
6760 /**
6761 * Minimum percentage of free storage on the device that is used to
6762 * determine if the device is running low on storage. The default is 10.
6763 * <p>
6764 * Say this value is set to 10, the device is considered running low on
6765 * storage if 90% or more of the device storage is filled up.
6766 *
6767 * @hide
6768 */
6769 public static final String
6770 SYS_STORAGE_THRESHOLD_PERCENTAGE = "sys_storage_threshold_percentage";
6771
6772 /**
6773 * Maximum byte size of the low storage threshold. This is to ensure
6774 * that {@link #SYS_STORAGE_THRESHOLD_PERCENTAGE} does not result in an
6775 * overly large threshold for large storage devices. Currently this must
6776 * be less than 2GB. This default is 500MB.
6777 *
6778 * @hide
6779 */
6780 public static final String
6781 SYS_STORAGE_THRESHOLD_MAX_BYTES = "sys_storage_threshold_max_bytes";
6782
6783 /**
6784 * Minimum bytes of free storage on the device before the data partition
6785 * is considered full. By default, 1 MB is reserved to avoid system-wide
6786 * SQLite disk full exceptions.
6787 *
6788 * @hide
6789 */
6790 public static final String
6791 SYS_STORAGE_FULL_THRESHOLD_BYTES = "sys_storage_full_threshold_bytes";
6792
6793 /**
6794 * The maximum reconnect delay for short network outages or when the
6795 * network is suspended due to phone use.
6796 *
6797 * @hide
6798 */
6799 public static final String
6800 SYNC_MAX_RETRY_DELAY_IN_SECONDS = "sync_max_retry_delay_in_seconds";
6801
6802 /**
6803 * The number of milliseconds to delay before sending out
Erik Kline8f29dcf2014-12-08 16:25:20 +09006804 * {@link ConnectivityManager#CONNECTIVITY_ACTION} broadcasts. Ignored.
Jeff Sharkey625239a2012-09-26 22:03:49 -07006805 *
6806 * @hide
6807 */
6808 public static final String CONNECTIVITY_CHANGE_DELAY = "connectivity_change_delay";
6809
Vinit Deshapnde1f12cb52013-08-21 13:09:01 -07006810
6811 /**
6812 * Network sampling interval, in seconds. We'll generate link information
6813 * about bytes/packets sent and error rates based on data sampled in this interval
6814 *
6815 * @hide
6816 */
6817
6818 public static final String CONNECTIVITY_SAMPLING_INTERVAL_IN_SECONDS =
6819 "connectivity_sampling_interval_in_seconds";
6820
Jeff Sharkey625239a2012-09-26 22:03:49 -07006821 /**
Jason Monk602b2322013-07-03 17:04:33 -04006822 * The series of successively longer delays used in retrying to download PAC file.
6823 * Last delay is used between successful PAC downloads.
6824 *
6825 * @hide
6826 */
6827 public static final String PAC_CHANGE_DELAY = "pac_change_delay";
6828
6829 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07006830 * Setting to turn off captive portal detection. Feature is enabled by
6831 * default and the setting needs to be set to 0 to disable it.
6832 *
6833 * @hide
6834 */
6835 public static final String
6836 CAPTIVE_PORTAL_DETECTION_ENABLED = "captive_portal_detection_enabled";
6837
6838 /**
6839 * The server used for captive portal detection upon a new conection. A
6840 * 204 response code from the server is used for validation.
6841 *
6842 * @hide
6843 */
6844 public static final String CAPTIVE_PORTAL_SERVER = "captive_portal_server";
6845
6846 /**
6847 * Whether network service discovery is enabled.
6848 *
6849 * @hide
6850 */
6851 public static final String NSD_ON = "nsd_on";
6852
6853 /**
6854 * Let user pick default install location.
6855 *
6856 * @hide
6857 */
6858 public static final String SET_INSTALL_LOCATION = "set_install_location";
6859
6860 /**
6861 * Default install location value.
6862 * 0 = auto, let system decide
6863 * 1 = internal
6864 * 2 = sdcard
6865 * @hide
6866 */
6867 public static final String DEFAULT_INSTALL_LOCATION = "default_install_location";
6868
6869 /**
6870 * ms during which to consume extra events related to Inet connection
6871 * condition after a transtion to fully-connected
6872 *
6873 * @hide
6874 */
6875 public static final String
6876 INET_CONDITION_DEBOUNCE_UP_DELAY = "inet_condition_debounce_up_delay";
6877
6878 /**
6879 * ms during which to consume extra events related to Inet connection
6880 * condtion after a transtion to partly-connected
6881 *
6882 * @hide
6883 */
6884 public static final String
6885 INET_CONDITION_DEBOUNCE_DOWN_DELAY = "inet_condition_debounce_down_delay";
6886
6887 /** {@hide} */
6888 public static final String
6889 READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT = "read_external_storage_enforced_default";
6890
6891 /**
6892 * Host name and port for global http proxy. Uses ':' seperator for
6893 * between host and port.
6894 */
6895 public static final String HTTP_PROXY = "http_proxy";
6896
6897 /**
6898 * Host name for global http proxy. Set via ConnectivityManager.
6899 *
6900 * @hide
6901 */
6902 public static final String GLOBAL_HTTP_PROXY_HOST = "global_http_proxy_host";
6903
6904 /**
6905 * Integer host port for global http proxy. Set via ConnectivityManager.
6906 *
6907 * @hide
6908 */
6909 public static final String GLOBAL_HTTP_PROXY_PORT = "global_http_proxy_port";
6910
6911 /**
6912 * Exclusion list for global proxy. This string contains a list of
6913 * comma-separated domains where the global proxy does not apply.
6914 * Domains should be listed in a comma- separated list. Example of
6915 * acceptable formats: ".domain1.com,my.domain2.com" Use
6916 * ConnectivityManager to set/get.
6917 *
6918 * @hide
6919 */
6920 public static final String
6921 GLOBAL_HTTP_PROXY_EXCLUSION_LIST = "global_http_proxy_exclusion_list";
6922
6923 /**
Jason Monk602b2322013-07-03 17:04:33 -04006924 * The location PAC File for the proxy.
6925 * @hide
6926 */
6927 public static final String
6928 GLOBAL_HTTP_PROXY_PAC = "global_proxy_pac_url";
6929
6930 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07006931 * Enables the UI setting to allow the user to specify the global HTTP
6932 * proxy and associated exclusion list.
6933 *
6934 * @hide
6935 */
6936 public static final String SET_GLOBAL_HTTP_PROXY = "set_global_http_proxy";
6937
6938 /**
6939 * Setting for default DNS in case nobody suggests one
6940 *
6941 * @hide
6942 */
6943 public static final String DEFAULT_DNS_SERVER = "default_dns_server";
6944
Jeff Sharkey0ac10282012-10-01 12:50:22 -07006945 /** {@hide} */
6946 public static final String
6947 BLUETOOTH_HEADSET_PRIORITY_PREFIX = "bluetooth_headset_priority_";
6948 /** {@hide} */
6949 public static final String
6950 BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX = "bluetooth_a2dp_sink_priority_";
6951 /** {@hide} */
6952 public static final String
6953 BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX = "bluetooth_input_device_priority_";
Kim Schulz0d376052013-08-22 11:18:02 +02006954 /** {@hide} */
6955 public static final String
6956 BLUETOOTH_MAP_PRIORITY_PREFIX = "bluetooth_map_priority_";
Jeff Sharkey0ac10282012-10-01 12:50:22 -07006957
6958 /**
6959 * Get the key that retrieves a bluetooth headset's priority.
6960 * @hide
6961 */
6962 public static final String getBluetoothHeadsetPriorityKey(String address) {
Elliott Hughescb64d432013-08-02 10:00:44 -07006963 return BLUETOOTH_HEADSET_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
Jeff Sharkey0ac10282012-10-01 12:50:22 -07006964 }
6965
6966 /**
6967 * Get the key that retrieves a bluetooth a2dp sink's priority.
6968 * @hide
6969 */
6970 public static final String getBluetoothA2dpSinkPriorityKey(String address) {
Elliott Hughescb64d432013-08-02 10:00:44 -07006971 return BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
Jeff Sharkey0ac10282012-10-01 12:50:22 -07006972 }
6973
6974 /**
6975 * Get the key that retrieves a bluetooth Input Device's priority.
6976 * @hide
6977 */
6978 public static final String getBluetoothInputDevicePriorityKey(String address) {
Elliott Hughescb64d432013-08-02 10:00:44 -07006979 return BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
Jeff Sharkey0ac10282012-10-01 12:50:22 -07006980 }
6981
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07006982 /**
Kim Schulz0d376052013-08-22 11:18:02 +02006983 * Get the key that retrieves a bluetooth map priority.
6984 * @hide
6985 */
6986 public static final String getBluetoothMapPriorityKey(String address) {
6987 return BLUETOOTH_MAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
6988 }
6989 /**
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07006990 * Scaling factor for normal window animations. Setting to 0 will
6991 * disable window animations.
6992 */
6993 public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale";
6994
6995 /**
6996 * Scaling factor for activity transition animations. Setting to 0 will
6997 * disable window animations.
6998 */
6999 public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale";
7000
7001 /**
7002 * Scaling factor for Animator-based animations. This affects both the
7003 * start delay and duration of all such animations. Setting to 0 will
7004 * cause animations to end immediately. The default value is 1.
7005 */
7006 public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale";
7007
7008 /**
7009 * Scaling factor for normal window animations. Setting to 0 will
7010 * disable window animations.
7011 *
7012 * @hide
7013 */
7014 public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations";
7015
7016 /**
7017 * If 0, the compatibility mode is off for all applications.
7018 * If 1, older applications run under compatibility mode.
7019 * TODO: remove this settings before code freeze (bug/1907571)
7020 * @hide
7021 */
7022 public static final String COMPATIBILITY_MODE = "compatibility_mode";
7023
7024 /**
7025 * CDMA only settings
7026 * Emergency Tone 0 = Off
7027 * 1 = Alert
7028 * 2 = Vibrate
7029 * @hide
7030 */
7031 public static final String EMERGENCY_TONE = "emergency_tone";
7032
7033 /**
7034 * CDMA only settings
7035 * Whether the auto retry is enabled. The value is
7036 * boolean (1 or 0).
7037 * @hide
7038 */
7039 public static final String CALL_AUTO_RETRY = "call_auto_retry";
7040
7041 /**
Sungmin Choie099ab12014-06-09 14:45:51 +09007042 * See RIL_PreferredNetworkType in ril.h
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07007043 * @hide
7044 */
7045 public static final String PREFERRED_NETWORK_MODE =
7046 "preferred_network_mode";
7047
7048 /**
Junda Liubbdc1c02014-11-07 11:18:02 -08007049 * Setting to 1 will hide carrier network settings.
7050 * Default is 0.
7051 * @hide
7052 */
7053 public static final String HIDE_CARRIER_NETWORK_SETTINGS =
7054 "hide_carrier_network_settings";
7055
7056 /**
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07007057 * Name of an application package to be debugged.
7058 */
7059 public static final String DEBUG_APP = "debug_app";
7060
7061 /**
7062 * If 1, when launching DEBUG_APP it will wait for the debugger before
7063 * starting user code. If 0, it will run normally.
7064 */
7065 public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger";
7066
7067 /**
7068 * Control whether the process CPU usage meter should be shown.
7069 */
7070 public static final String SHOW_PROCESSES = "show_processes";
7071
7072 /**
Ruchi Kandoi62b8a492014-04-17 18:01:40 -07007073 * If 1 low power mode is enabled.
7074 * @hide
7075 */
7076 public static final String LOW_POWER_MODE = "low_power";
7077
John Spurlockf8f524c2014-06-10 14:47:29 -04007078 /**
7079 * Battery level [1-99] at which low power mode automatically turns on.
Dianne Hackborn14272302014-06-10 23:13:02 -07007080 * If 0, it will not automatically turn on.
John Spurlockf8f524c2014-06-10 14:47:29 -04007081 * @hide
7082 */
7083 public static final String LOW_POWER_MODE_TRIGGER_LEVEL = "low_power_trigger_level";
7084
Ruchi Kandoi62b8a492014-04-17 18:01:40 -07007085 /**
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07007086 * If 1, the activity manager will aggressively finish activities and
7087 * processes as soon as they are no longer needed. If 0, the normal
7088 * extended lifetime is used.
7089 */
Dianne Hackborn89ad4562014-08-24 16:45:38 -07007090 public static final String ALWAYS_FINISH_ACTIVITIES = "always_finish_activities";
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07007091
Christopher Tate66488d62012-10-02 11:58:01 -07007092 /**
Eric Laurent7ee1e4f2012-10-26 18:11:21 -07007093 * Use Dock audio output for media:
7094 * 0 = disabled
7095 * 1 = enabled
7096 * @hide
7097 */
7098 public static final String DOCK_AUDIO_MEDIA_ENABLED = "dock_audio_media_enabled";
7099
7100 /**
Eric Laurent05274f32012-11-29 12:48:18 -08007101 * Persisted safe headphone volume management state by AudioService
7102 * @hide
7103 */
7104 public static final String AUDIO_SAFE_VOLUME_STATE = "audio_safe_volume_state";
7105
7106 /**
Geremy Condraa0735112013-03-26 21:49:26 -07007107 * URL for tzinfo (time zone) updates
7108 * @hide
7109 */
7110 public static final String TZINFO_UPDATE_CONTENT_URL = "tzinfo_content_url";
7111
7112 /**
7113 * URL for tzinfo (time zone) update metadata
7114 * @hide
7115 */
7116 public static final String TZINFO_UPDATE_METADATA_URL = "tzinfo_metadata_url";
7117
7118 /**
7119 * URL for selinux (mandatory access control) updates
7120 * @hide
7121 */
7122 public static final String SELINUX_UPDATE_CONTENT_URL = "selinux_content_url";
7123
7124 /**
7125 * URL for selinux (mandatory access control) update metadata
7126 * @hide
7127 */
7128 public static final String SELINUX_UPDATE_METADATA_URL = "selinux_metadata_url";
7129
7130 /**
7131 * URL for sms short code updates
7132 * @hide
7133 */
7134 public static final String SMS_SHORT_CODES_UPDATE_CONTENT_URL =
7135 "sms_short_codes_content_url";
7136
7137 /**
7138 * URL for sms short code update metadata
7139 * @hide
7140 */
7141 public static final String SMS_SHORT_CODES_UPDATE_METADATA_URL =
7142 "sms_short_codes_metadata_url";
7143
7144 /**
7145 * URL for cert pinlist updates
7146 * @hide
7147 */
7148 public static final String CERT_PIN_UPDATE_CONTENT_URL = "cert_pin_content_url";
7149
7150 /**
7151 * URL for cert pinlist updates
7152 * @hide
7153 */
7154 public static final String CERT_PIN_UPDATE_METADATA_URL = "cert_pin_metadata_url";
7155
Geremy Condra757ee522013-03-29 16:39:45 -07007156 /**
Ben Gruver633dc9b2013-04-04 12:05:49 -07007157 * URL for intent firewall updates
7158 * @hide
7159 */
7160 public static final String INTENT_FIREWALL_UPDATE_CONTENT_URL =
7161 "intent_firewall_content_url";
7162
7163 /**
7164 * URL for intent firewall update metadata
7165 * @hide
7166 */
7167 public static final String INTENT_FIREWALL_UPDATE_METADATA_URL =
7168 "intent_firewall_metadata_url";
7169
7170 /**
Geremy Condra4e7f7e82013-03-26 21:09:01 -07007171 * SELinux enforcement status. If 0, permissive; if 1, enforcing.
7172 * @hide
7173 */
7174 public static final String SELINUX_STATUS = "selinux_status";
7175
Geremy Condraa0735112013-03-26 21:49:26 -07007176 /**
Amith Yamasanid8415f42013-08-07 20:15:10 -07007177 * Developer setting to force RTL layout.
7178 * @hide
7179 */
7180 public static final String DEVELOPMENT_FORCE_RTL = "debug.force_rtl";
7181
7182 /**
Daniel Sandlerdea64622013-09-23 16:05:57 -04007183 * Milliseconds after screen-off after which low battery sounds will be silenced.
7184 *
7185 * If zero, battery sounds will always play.
7186 * Defaults to @integer/def_low_battery_sound_timeout in SettingsProvider.
7187 *
7188 * @hide
7189 */
7190 public static final String LOW_BATTERY_SOUND_TIMEOUT = "low_battery_sound_timeout";
7191
7192 /**
Evan Charltoncc7b0432014-01-14 14:47:11 -08007193 * Milliseconds to wait before bouncing Wi-Fi after settings is restored. Note that after
Dianne Hackborna3fb40d2014-08-12 15:06:50 -07007194 * the caller is done with this, they should call {@link ContentResolver#delete} to
Evan Charltoncc7b0432014-01-14 14:47:11 -08007195 * clean up any value that they may have written.
7196 *
7197 * @hide
7198 */
7199 public static final String WIFI_BOUNCE_DELAY_OVERRIDE_MS = "wifi_bounce_delay_override_ms";
7200
John Spurlockc6d1c602014-01-17 15:22:06 -05007201 /**
7202 * Defines global runtime overrides to window policy.
7203 *
Jorim Jaggib10e33f2015-02-04 21:57:40 +01007204 * See {@link com.android.server.policy.PolicyControl} for value format.
John Spurlockc6d1c602014-01-17 15:22:06 -05007205 *
7206 * @hide
7207 */
7208 public static final String POLICY_CONTROL = "policy_control";
Evan Charltoncc7b0432014-01-14 14:47:11 -08007209
7210 /**
John Spurlockae641c92014-06-30 18:11:40 -04007211 * Defines global zen mode. ZEN_MODE_OFF, ZEN_MODE_IMPORTANT_INTERRUPTIONS,
7212 * or ZEN_MODE_NO_INTERRUPTIONS.
John Spurlocke677d712014-02-13 12:52:19 -05007213 *
7214 * @hide
7215 */
7216 public static final String ZEN_MODE = "zen_mode";
7217
7218 /** @hide */ public static final int ZEN_MODE_OFF = 0;
John Spurlockae641c92014-06-30 18:11:40 -04007219 /** @hide */ public static final int ZEN_MODE_IMPORTANT_INTERRUPTIONS = 1;
7220 /** @hide */ public static final int ZEN_MODE_NO_INTERRUPTIONS = 2;
John Spurlock4f1163c2015-04-02 17:41:21 -04007221 /** @hide */ public static final int ZEN_MODE_ALARMS = 3;
John Spurlocke677d712014-02-13 12:52:19 -05007222
7223 /** @hide */ public static String zenModeToString(int mode) {
John Spurlockae641c92014-06-30 18:11:40 -04007224 if (mode == ZEN_MODE_IMPORTANT_INTERRUPTIONS) return "ZEN_MODE_IMPORTANT_INTERRUPTIONS";
John Spurlock4f1163c2015-04-02 17:41:21 -04007225 if (mode == ZEN_MODE_ALARMS) return "ZEN_MODE_ALARMS";
John Spurlockae641c92014-06-30 18:11:40 -04007226 if (mode == ZEN_MODE_NO_INTERRUPTIONS) return "ZEN_MODE_NO_INTERRUPTIONS";
7227 return "ZEN_MODE_OFF";
John Spurlocke677d712014-02-13 12:52:19 -05007228 }
7229
John Spurlockb2278d62015-04-07 12:47:12 -04007230 /** @hide */ public static boolean isValidZenMode(int value) {
7231 switch (value) {
7232 case Global.ZEN_MODE_OFF:
7233 case Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS:
7234 case Global.ZEN_MODE_ALARMS:
7235 case Global.ZEN_MODE_NO_INTERRUPTIONS:
7236 return true;
7237 default:
7238 return false;
7239 }
7240 }
7241
John Spurlocke677d712014-02-13 12:52:19 -05007242 /**
John Spurlock056c5192014-04-20 21:52:01 -04007243 * Opaque value, changes when persisted zen mode configuration changes.
7244 *
7245 * @hide
7246 */
7247 public static final String ZEN_MODE_CONFIG_ETAG = "zen_mode_config_etag";
7248
7249 /**
Chris Wren7bd241232014-02-28 16:25:05 -05007250 * Defines global heads up toggle. One of HEADS_UP_OFF, HEADS_UP_ON.
7251 *
7252 * @hide
7253 */
Chris Wren10d82df2014-03-01 10:34:51 -05007254 public static final String HEADS_UP_NOTIFICATIONS_ENABLED =
7255 "heads_up_notifications_enabled";
Chris Wren7bd241232014-02-28 16:25:05 -05007256
7257 /** @hide */ public static final int HEADS_UP_OFF = 0;
7258 /** @hide */ public static final int HEADS_UP_ON = 1;
7259
7260 /**
Jerome Poichet147b4d72014-05-12 18:13:27 -07007261 * The name of the device
7262 *
7263 * @hide
7264 */
7265 public static final String DEVICE_NAME = "device_name";
7266
7267 /**
Amith Yamasani1e9c2182014-06-11 17:25:51 -07007268 * Whether it should be possible to create a guest user on the device.
7269 * <p>
7270 * Type: int (0 for disabled, 1 for enabled)
7271 * @hide
7272 */
7273 public static final String GUEST_USER_ENABLED = "guest_user_enabled";
7274
7275 /**
Jeff Davidson56f9f732014-08-14 16:47:23 -07007276 * Whether the NetworkScoringService has been first initialized.
7277 * <p>
7278 * Type: int (0 for false, 1 for true)
7279 * @hide
7280 */
7281 public static final String NETWORK_SCORING_PROVISIONED = "network_scoring_provisioned";
7282
7283 /**
Jim Miller6848dc82014-10-13 18:51:53 -07007284 * Whether the user wants to be prompted for password to decrypt the device on boot.
7285 * This only matters if the storage is encrypted.
7286 * <p>
7287 * Type: int (0 for false, 1 for true)
7288 * @hide
7289 */
7290 public static final String REQUIRE_PASSWORD_TO_DECRYPT = "require_password_to_decrypt";
7291
7292 /**
Libin.Tang@motorola.com0499bb52014-10-10 14:55:57 -05007293 * Whether the Volte/VT is enabled
7294 * <p>
7295 * Type: int (0 for false, 1 for true)
7296 * @hide
7297 */
Etan Cohene41a9cf2014-10-22 10:50:46 -07007298 public static final String ENHANCED_4G_MODE_ENABLED = "volte_vt_enabled";
Libin.Tang@motorola.com0499bb52014-10-10 14:55:57 -05007299
7300 /**
Etan Cohen9c8f21b2014-12-23 15:02:19 -08007301 * Whether WFC is enabled
7302 * <p>
7303 * Type: int (0 for false, 1 for true)
7304 *
7305 * @hide
7306 */
7307 public static final String WFC_IMS_ENABLED = "wfc_ims_enabled";
7308
7309 /**
7310 * WFC Mode.
7311 * <p>
7312 * Type: int - 2=Wi-Fi preferred, 1=Cellular preferred, 0=Wi-Fi only
7313 *
7314 * @hide
7315 */
7316 public static final String WFC_IMS_MODE = "wfc_ims_mode";
7317
7318 /**
7319 * Whether WFC roaming is enabled
7320 * <p>
7321 * Type: int (0 for false, 1 for true)
7322 *
7323 * @hide
7324 */
7325 public static final String WFC_IMS_ROAMING_ENABLED = "wfc_ims_roaming_enabled";
7326
7327 /**
Etan Cohen7ab0ad12014-11-24 11:18:01 -08007328 * Global override to disable VoLTE (independent of user setting)
7329 * <p>
7330 * Type: int (1 for disable VoLTE, 0 to use user configuration)
7331 * @hide
7332 */
7333 public static final String VOLTE_FEATURE_DISABLED = "volte_feature_disabled";
7334
7335 /**
Amit Mahajan4fea0922014-11-18 12:56:28 -08007336 * Whether user can enable/disable LTE as a preferred network. A carrier might control
7337 * this via gservices, OMA-DM, carrier app, etc.
7338 * <p>
7339 * Type: int (0 for false, 1 for true)
7340 * @hide
7341 */
7342 public static final String LTE_SERVICE_FORCED = "lte_service_forced";
7343
7344 /**
Christopher Tate66488d62012-10-02 11:58:01 -07007345 * Settings to backup. This is here so that it's in the same place as the settings
7346 * keys and easy to update.
7347 *
7348 * These keys may be mentioned in the SETTINGS_TO_BACKUP arrays in System
7349 * and Secure as well. This is because those tables drive both backup and
7350 * restore, and restore needs to properly whitelist keys that used to live
7351 * in those namespaces. The keys will only actually be backed up / restored
7352 * if they are also mentioned in this table (Global.SETTINGS_TO_BACKUP).
7353 *
7354 * NOTE: Settings are backed up and restored in the order they appear
7355 * in this array. If you have one setting depending on another,
7356 * make sure that they are ordered appropriately.
7357 *
7358 * @hide
7359 */
7360 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate58f41ec2013-01-11 15:40:36 -08007361 BUGREPORT_IN_POWER_MENU,
Christopher Tate66488d62012-10-02 11:58:01 -07007362 STAY_ON_WHILE_PLUGGED_IN,
Christopher Tate66488d62012-10-02 11:58:01 -07007363 AUTO_TIME,
7364 AUTO_TIME_ZONE,
7365 POWER_SOUNDS_ENABLED,
7366 DOCK_SOUNDS_ENABLED,
7367 USB_MASS_STORAGE_ENABLED,
7368 ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED,
7369 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
7370 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY,
Christopher Tate16eb7cd2012-10-09 15:26:30 -07007371 WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED,
Christopher Tate66488d62012-10-02 11:58:01 -07007372 WIFI_NUM_OPEN_NETWORKS_KEPT,
7373 EMERGENCY_TONE,
7374 CALL_AUTO_RETRY,
Amith Yamasani94005242014-10-31 11:35:13 -07007375 DOCK_AUDIO_MEDIA_ENABLED,
7376 LOW_POWER_MODE_TRIGGER_LEVEL
Christopher Tate66488d62012-10-02 11:58:01 -07007377 };
7378
Christopher Tate06efb532012-08-24 15:29:27 -07007379 // Populated lazily, guarded by class object:
Dianne Hackborn139748f2012-09-24 11:36:57 -07007380 private static NameValueCache sNameValueCache = new NameValueCache(
7381 SYS_PROP_SETTING_VERSION,
7382 CONTENT_URI,
7383 CALL_METHOD_GET_GLOBAL,
7384 CALL_METHOD_PUT_GLOBAL);
Christopher Tate06efb532012-08-24 15:29:27 -07007385
Christopher Tateaa036a22014-05-19 16:33:27 -07007386 // Certain settings have been moved from global to the per-user secure namespace
7387 private static final HashSet<String> MOVED_TO_SECURE;
7388 static {
7389 MOVED_TO_SECURE = new HashSet<String>(1);
7390 MOVED_TO_SECURE.add(Settings.Global.INSTALL_NON_MARKET_APPS);
7391 }
7392
Svetoslav683914b2015-01-15 14:22:26 -08007393 /** @hide */
7394 public static void getMovedToSecureSettings(Set<String> outKeySet) {
7395 outKeySet.addAll(MOVED_TO_SECURE);
7396 }
7397
Christopher Tate06efb532012-08-24 15:29:27 -07007398 /**
7399 * Look up a name in the database.
7400 * @param resolver to access the database with
7401 * @param name to look up in the table
7402 * @return the corresponding value, or null if not present
7403 */
Dianne Hackborn139748f2012-09-24 11:36:57 -07007404 public static String getString(ContentResolver resolver, String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07007405 return getStringForUser(resolver, name, UserHandle.myUserId());
7406 }
7407
7408 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -07007409 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -07007410 int userHandle) {
Christopher Tateaa036a22014-05-19 16:33:27 -07007411 if (MOVED_TO_SECURE.contains(name)) {
7412 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
7413 + " to android.provider.Settings.Secure, returning read-only value.");
7414 return Secure.getStringForUser(resolver, name, userHandle);
7415 }
Christopher Tate06efb532012-08-24 15:29:27 -07007416 return sNameValueCache.getStringForUser(resolver, name, userHandle);
7417 }
7418
7419 /**
7420 * Store a name/value pair into the database.
7421 * @param resolver to access the database with
7422 * @param name to store
7423 * @param value to associate with the name
7424 * @return true if the value was set, false on database errors
7425 */
7426 public static boolean putString(ContentResolver resolver,
7427 String name, String value) {
7428 return putStringForUser(resolver, name, value, UserHandle.myUserId());
7429 }
7430
7431 /** @hide */
7432 public static boolean putStringForUser(ContentResolver resolver,
7433 String name, String value, int userHandle) {
Christopher Tate06efb532012-08-24 15:29:27 -07007434 if (LOCAL_LOGV) {
7435 Log.v(TAG, "Global.putString(name=" + name + ", value=" + value
7436 + " for " + userHandle);
7437 }
Christopher Tateaa036a22014-05-19 16:33:27 -07007438 // Global and Secure have the same access policy so we can forward writes
7439 if (MOVED_TO_SECURE.contains(name)) {
7440 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
7441 + " to android.provider.Settings.Secure, value is unchanged.");
7442 return Secure.putStringForUser(resolver, name, value, userHandle);
7443 }
Christopher Tate06efb532012-08-24 15:29:27 -07007444 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
7445 }
7446
7447 /**
7448 * Construct the content URI for a particular name/value pair,
7449 * useful for monitoring changes with a ContentObserver.
7450 * @param name to look up in the table
7451 * @return the corresponding content URI, or null if not present
7452 */
7453 public static Uri getUriFor(String name) {
7454 return getUriFor(CONTENT_URI, name);
7455 }
7456
7457 /**
7458 * Convenience function for retrieving a single secure settings value
7459 * as an integer. Note that internally setting values are always
7460 * stored as strings; this function converts the string to an integer
7461 * for you. The default value will be returned if the setting is
7462 * not defined or not an integer.
7463 *
7464 * @param cr The ContentResolver to access.
7465 * @param name The name of the setting to retrieve.
7466 * @param def Value to return if the setting is not defined.
7467 *
7468 * @return The setting's current value, or 'def' if it is not defined
7469 * or not a valid integer.
7470 */
7471 public static int getInt(ContentResolver cr, String name, int def) {
7472 String v = getString(cr, name);
7473 try {
7474 return v != null ? Integer.parseInt(v) : def;
7475 } catch (NumberFormatException e) {
7476 return def;
7477 }
7478 }
7479
7480 /**
7481 * Convenience function for retrieving a single secure settings value
7482 * as an integer. Note that internally setting values are always
7483 * stored as strings; this function converts the string to an integer
7484 * for you.
7485 * <p>
7486 * This version does not take a default value. If the setting has not
7487 * been set, or the string value is not a number,
7488 * it throws {@link SettingNotFoundException}.
7489 *
7490 * @param cr The ContentResolver to access.
7491 * @param name The name of the setting to retrieve.
7492 *
7493 * @throws SettingNotFoundException Thrown if a setting by the given
7494 * name can't be found or the setting value is not an integer.
7495 *
7496 * @return The setting's current value.
7497 */
7498 public static int getInt(ContentResolver cr, String name)
7499 throws SettingNotFoundException {
7500 String v = getString(cr, name);
7501 try {
7502 return Integer.parseInt(v);
7503 } catch (NumberFormatException e) {
7504 throw new SettingNotFoundException(name);
7505 }
7506 }
7507
7508 /**
7509 * Convenience function for updating a single settings value as an
7510 * integer. This will either create a new entry in the table if the
7511 * given name does not exist, or modify the value of the existing row
7512 * with that name. Note that internally setting values are always
7513 * stored as strings, so this function converts the given value to a
7514 * string before storing it.
7515 *
7516 * @param cr The ContentResolver to access.
7517 * @param name The name of the setting to modify.
7518 * @param value The new value for the setting.
7519 * @return true if the value was set, false on database errors
7520 */
7521 public static boolean putInt(ContentResolver cr, String name, int value) {
7522 return putString(cr, name, Integer.toString(value));
7523 }
7524
7525 /**
7526 * Convenience function for retrieving a single secure settings value
7527 * as a {@code long}. Note that internally setting values are always
7528 * stored as strings; this function converts the string to a {@code long}
7529 * for you. The default value will be returned if the setting is
7530 * not defined or not a {@code long}.
7531 *
7532 * @param cr The ContentResolver to access.
7533 * @param name The name of the setting to retrieve.
7534 * @param def Value to return if the setting is not defined.
7535 *
7536 * @return The setting's current value, or 'def' if it is not defined
7537 * or not a valid {@code long}.
7538 */
7539 public static long getLong(ContentResolver cr, String name, long def) {
7540 String valString = getString(cr, name);
7541 long value;
7542 try {
7543 value = valString != null ? Long.parseLong(valString) : def;
7544 } catch (NumberFormatException e) {
7545 value = def;
7546 }
7547 return value;
7548 }
7549
7550 /**
7551 * Convenience function for retrieving a single secure settings value
7552 * as a {@code long}. Note that internally setting values are always
7553 * stored as strings; this function converts the string to a {@code long}
7554 * for you.
7555 * <p>
7556 * This version does not take a default value. If the setting has not
7557 * been set, or the string value is not a number,
7558 * it throws {@link SettingNotFoundException}.
7559 *
7560 * @param cr The ContentResolver to access.
7561 * @param name The name of the setting to retrieve.
7562 *
7563 * @return The setting's current value.
7564 * @throws SettingNotFoundException Thrown if a setting by the given
7565 * name can't be found or the setting value is not an integer.
7566 */
7567 public static long getLong(ContentResolver cr, String name)
7568 throws SettingNotFoundException {
7569 String valString = getString(cr, name);
7570 try {
7571 return Long.parseLong(valString);
7572 } catch (NumberFormatException e) {
7573 throw new SettingNotFoundException(name);
7574 }
7575 }
7576
7577 /**
7578 * Convenience function for updating a secure settings value as a long
7579 * integer. This will either create a new entry in the table if the
7580 * given name does not exist, or modify the value of the existing row
7581 * with that name. Note that internally setting values are always
7582 * stored as strings, so this function converts the given value to a
7583 * string before storing it.
7584 *
7585 * @param cr The ContentResolver to access.
7586 * @param name The name of the setting to modify.
7587 * @param value The new value for the setting.
7588 * @return true if the value was set, false on database errors
7589 */
7590 public static boolean putLong(ContentResolver cr, String name, long value) {
7591 return putString(cr, name, Long.toString(value));
7592 }
7593
7594 /**
7595 * Convenience function for retrieving a single secure settings value
7596 * as a floating point number. Note that internally setting values are
7597 * always stored as strings; this function converts the string to an
7598 * float for you. The default value will be returned if the setting
7599 * is not defined or not a valid float.
7600 *
7601 * @param cr The ContentResolver to access.
7602 * @param name The name of the setting to retrieve.
7603 * @param def Value to return if the setting is not defined.
7604 *
7605 * @return The setting's current value, or 'def' if it is not defined
7606 * or not a valid float.
7607 */
7608 public static float getFloat(ContentResolver cr, String name, float def) {
7609 String v = getString(cr, name);
7610 try {
7611 return v != null ? Float.parseFloat(v) : def;
7612 } catch (NumberFormatException e) {
7613 return def;
7614 }
7615 }
7616
7617 /**
7618 * Convenience function for retrieving a single secure settings value
7619 * as a float. Note that internally setting values are always
7620 * stored as strings; this function converts the string to a float
7621 * for you.
7622 * <p>
7623 * This version does not take a default value. If the setting has not
7624 * been set, or the string value is not a number,
7625 * it throws {@link SettingNotFoundException}.
7626 *
7627 * @param cr The ContentResolver to access.
7628 * @param name The name of the setting to retrieve.
7629 *
7630 * @throws SettingNotFoundException Thrown if a setting by the given
7631 * name can't be found or the setting value is not a float.
7632 *
7633 * @return The setting's current value.
7634 */
7635 public static float getFloat(ContentResolver cr, String name)
7636 throws SettingNotFoundException {
7637 String v = getString(cr, name);
7638 if (v == null) {
7639 throw new SettingNotFoundException(name);
7640 }
7641 try {
7642 return Float.parseFloat(v);
7643 } catch (NumberFormatException e) {
7644 throw new SettingNotFoundException(name);
7645 }
7646 }
7647
7648 /**
7649 * Convenience function for updating a single settings value as a
7650 * floating point number. This will either create a new entry in the
7651 * table if the given name does not exist, or modify the value of the
7652 * existing row with that name. Note that internally setting values
7653 * are always stored as strings, so this function converts the given
7654 * value to a string before storing it.
7655 *
7656 * @param cr The ContentResolver to access.
7657 * @param name The name of the setting to modify.
7658 * @param value The new value for the setting.
7659 * @return true if the value was set, false on database errors
7660 */
7661 public static boolean putFloat(ContentResolver cr, String name, float value) {
7662 return putString(cr, name, Float.toString(value));
7663 }
Wink Savillefb40dd42014-06-12 17:02:31 -07007664
7665
7666 /**
7667 * Subscription to be used for voice call on a multi sim device. The supported values
7668 * are 0 = SUB1, 1 = SUB2 and etc.
7669 * @hide
7670 */
7671 public static final String MULTI_SIM_VOICE_CALL_SUBSCRIPTION = "multi_sim_voice_call";
7672
7673 /**
7674 * Used to provide option to user to select subscription during dial.
7675 * The supported values are 0 = disable or 1 = enable prompt.
7676 * @hide
7677 */
7678 public static final String MULTI_SIM_VOICE_PROMPT = "multi_sim_voice_prompt";
7679
7680 /**
7681 * Subscription to be used for data call on a multi sim device. The supported values
7682 * are 0 = SUB1, 1 = SUB2 and etc.
7683 * @hide
7684 */
7685 public static final String MULTI_SIM_DATA_CALL_SUBSCRIPTION = "multi_sim_data_call";
7686
7687 /**
7688 * Subscription to be used for SMS on a multi sim device. The supported values
7689 * are 0 = SUB1, 1 = SUB2 and etc.
7690 * @hide
7691 */
7692 public static final String MULTI_SIM_SMS_SUBSCRIPTION = "multi_sim_sms";
7693
7694 /**
7695 * Used to provide option to user to select subscription during send SMS.
7696 * The value 1 - enable, 0 - disable
7697 * @hide
7698 */
7699 public static final String MULTI_SIM_SMS_PROMPT = "multi_sim_sms_prompt";
7700
7701
7702
7703 /** User preferred subscriptions setting.
7704 * This holds the details of the user selected subscription from the card and
7705 * the activation status. Each settings string have the coma separated values
7706 * iccId,appType,appId,activationStatus,3gppIndex,3gpp2Index
7707 * @hide
7708 */
7709 public static final String[] MULTI_SIM_USER_PREFERRED_SUBS = {"user_preferred_sub1",
7710 "user_preferred_sub2","user_preferred_sub3"};
Zheng Fub218ff42015-04-13 16:31:16 -07007711
7712 /**
7713 * Whether to enable new contacts aggregator or not.
7714 * The value 1 - enable, 0 - disable
7715 * @hide
7716 */
7717 public static final String NEW_CONTACT_AGGREGATOR = "new_contact_aggregator";
Christopher Tate06efb532012-08-24 15:29:27 -07007718 }
7719
7720 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007721 * User-defined bookmarks and shortcuts. The target of each bookmark is an
7722 * Intent URL, allowing it to be either a web page or a particular
7723 * application activity.
7724 *
7725 * @hide
7726 */
7727 public static final class Bookmarks implements BaseColumns
7728 {
7729 private static final String TAG = "Bookmarks";
7730
7731 /**
7732 * The content:// style URL for this table
7733 */
7734 public static final Uri CONTENT_URI =
7735 Uri.parse("content://" + AUTHORITY + "/bookmarks");
7736
7737 /**
7738 * The row ID.
7739 * <p>Type: INTEGER</p>
7740 */
7741 public static final String ID = "_id";
7742
7743 /**
7744 * Descriptive name of the bookmark that can be displayed to the user.
7745 * If this is empty, the title should be resolved at display time (use
7746 * {@link #getTitle(Context, Cursor)} any time you want to display the
7747 * title of a bookmark.)
7748 * <P>
7749 * Type: TEXT
7750 * </P>
7751 */
7752 public static final String TITLE = "title";
7753
7754 /**
7755 * Arbitrary string (displayed to the user) that allows bookmarks to be
7756 * organized into categories. There are some special names for
7757 * standard folders, which all start with '@'. The label displayed for
7758 * the folder changes with the locale (via {@link #getLabelForFolder}) but
7759 * the folder name does not change so you can consistently query for
7760 * the folder regardless of the current locale.
7761 *
7762 * <P>Type: TEXT</P>
7763 *
7764 */
7765 public static final String FOLDER = "folder";
7766
7767 /**
7768 * The Intent URL of the bookmark, describing what it points to. This
7769 * value is given to {@link android.content.Intent#getIntent} to create
7770 * an Intent that can be launched.
7771 * <P>Type: TEXT</P>
7772 */
7773 public static final String INTENT = "intent";
7774
7775 /**
7776 * Optional shortcut character associated with this bookmark.
7777 * <P>Type: INTEGER</P>
7778 */
7779 public static final String SHORTCUT = "shortcut";
7780
7781 /**
7782 * The order in which the bookmark should be displayed
7783 * <P>Type: INTEGER</P>
7784 */
7785 public static final String ORDERING = "ordering";
7786
7787 private static final String[] sIntentProjection = { INTENT };
7788 private static final String[] sShortcutProjection = { ID, SHORTCUT };
7789 private static final String sShortcutSelection = SHORTCUT + "=?";
7790
7791 /**
7792 * Convenience function to retrieve the bookmarked Intent for a
7793 * particular shortcut key.
7794 *
7795 * @param cr The ContentResolver to query.
7796 * @param shortcut The shortcut key.
7797 *
7798 * @return Intent The bookmarked URL, or null if there is no bookmark
7799 * matching the given shortcut.
7800 */
7801 public static Intent getIntentForShortcut(ContentResolver cr, char shortcut)
7802 {
7803 Intent intent = null;
7804
7805 Cursor c = cr.query(CONTENT_URI,
7806 sIntentProjection, sShortcutSelection,
7807 new String[] { String.valueOf((int) shortcut) }, ORDERING);
7808 // Keep trying until we find a valid shortcut
7809 try {
7810 while (intent == null && c.moveToNext()) {
7811 try {
7812 String intentURI = c.getString(c.getColumnIndexOrThrow(INTENT));
Christian Mehlmauera34d2c92010-05-25 19:04:20 +02007813 intent = Intent.parseUri(intentURI, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007814 } catch (java.net.URISyntaxException e) {
7815 // The stored URL is bad... ignore it.
7816 } catch (IllegalArgumentException e) {
7817 // Column not found
Dianne Hackborna33e3f72009-09-29 17:28:24 -07007818 Log.w(TAG, "Intent column not found", e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007819 }
7820 }
7821 } finally {
7822 if (c != null) c.close();
7823 }
7824
7825 return intent;
7826 }
7827
7828 /**
7829 * Add a new bookmark to the system.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07007830 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007831 * @param cr The ContentResolver to query.
7832 * @param intent The desired target of the bookmark.
7833 * @param title Bookmark title that is shown to the user; null if none
7834 * or it should be resolved to the intent's title.
7835 * @param folder Folder in which to place the bookmark; null if none.
7836 * @param shortcut Shortcut that will invoke the bookmark; 0 if none. If
7837 * this is non-zero and there is an existing bookmark entry
7838 * with this same shortcut, then that existing shortcut is
7839 * cleared (the bookmark is not removed).
7840 * @return The unique content URL for the new bookmark entry.
7841 */
7842 public static Uri add(ContentResolver cr,
7843 Intent intent,
7844 String title,
7845 String folder,
7846 char shortcut,
7847 int ordering)
7848 {
7849 // If a shortcut is supplied, and it is already defined for
7850 // another bookmark, then remove the old definition.
7851 if (shortcut != 0) {
Jeff Hamilton7cd51ef2010-05-12 17:30:27 -05007852 cr.delete(CONTENT_URI, sShortcutSelection,
7853 new String[] { String.valueOf((int) shortcut) });
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007854 }
7855
7856 ContentValues values = new ContentValues();
7857 if (title != null) values.put(TITLE, title);
7858 if (folder != null) values.put(FOLDER, folder);
Jean-Baptiste Queru3b9f0a32010-06-21 13:46:59 -07007859 values.put(INTENT, intent.toUri(0));
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007860 if (shortcut != 0) values.put(SHORTCUT, (int) shortcut);
7861 values.put(ORDERING, ordering);
7862 return cr.insert(CONTENT_URI, values);
7863 }
7864
7865 /**
7866 * Return the folder name as it should be displayed to the user. This
7867 * takes care of localizing special folders.
7868 *
7869 * @param r Resources object for current locale; only need access to
7870 * system resources.
7871 * @param folder The value found in the {@link #FOLDER} column.
7872 *
7873 * @return CharSequence The label for this folder that should be shown
7874 * to the user.
7875 */
7876 public static CharSequence getLabelForFolder(Resources r, String folder) {
7877 return folder;
7878 }
7879
7880 /**
7881 * Return the title as it should be displayed to the user. This takes
7882 * care of localizing bookmarks that point to activities.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07007883 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007884 * @param context A context.
7885 * @param cursor A cursor pointing to the row whose title should be
7886 * returned. The cursor must contain at least the {@link #TITLE}
7887 * and {@link #INTENT} columns.
7888 * @return A title that is localized and can be displayed to the user,
7889 * or the empty string if one could not be found.
7890 */
7891 public static CharSequence getTitle(Context context, Cursor cursor) {
7892 int titleColumn = cursor.getColumnIndex(TITLE);
7893 int intentColumn = cursor.getColumnIndex(INTENT);
7894 if (titleColumn == -1 || intentColumn == -1) {
7895 throw new IllegalArgumentException(
7896 "The cursor must contain the TITLE and INTENT columns.");
7897 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07007898
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007899 String title = cursor.getString(titleColumn);
7900 if (!TextUtils.isEmpty(title)) {
7901 return title;
7902 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07007903
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007904 String intentUri = cursor.getString(intentColumn);
7905 if (TextUtils.isEmpty(intentUri)) {
7906 return "";
7907 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07007908
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007909 Intent intent;
7910 try {
Christian Mehlmauera34d2c92010-05-25 19:04:20 +02007911 intent = Intent.parseUri(intentUri, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007912 } catch (URISyntaxException e) {
7913 return "";
7914 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07007915
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007916 PackageManager packageManager = context.getPackageManager();
7917 ResolveInfo info = packageManager.resolveActivity(intent, 0);
7918 return info != null ? info.loadLabel(packageManager) : "";
7919 }
7920 }
7921
7922 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007923 * Returns the device ID that we should use when connecting to the mobile gtalk server.
7924 * This is a string like "android-0x1242", where the hex string is the Android ID obtained
7925 * from the GoogleLoginService.
7926 *
7927 * @param androidId The Android ID for this device.
7928 * @return The device ID that should be used when connecting to the mobile gtalk server.
7929 * @hide
7930 */
7931 public static String getGTalkDeviceId(long androidId) {
7932 return "android-" + Long.toHexString(androidId);
7933 }
7934}