blob: 7c3c11be5b797fb6c1970637d19ce5088dc7bd63 [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 /**
Jason Monk6f909782015-04-17 14:30:25 -0400192 * Activity Category: Show application settings related to usage access.
193 * <p>
194 * An activity that provides a user interface for adjusting usage access related
195 * preferences for its containing application. Optional but recommended for apps that
196 * use {@link android.Manifest.permission#PACKAGE_USAGE_STATS}.
197 * <p>
198 * The activity may define meta-data to describe what usage access is
199 * used for within their app with {@link #METADATA_USAGE_ACCESS_REASON}, which
200 * will be displayed in Settings.
201 * <p>
202 * Input: Nothing.
203 * <p>
204 * Output: Nothing.
205 */
206 @SdkConstant(SdkConstantType.INTENT_CATEGORY)
207 public static final String INTENT_CATEGORY_USAGE_ACCESS_CONFIG =
208 "android.intent.category.USAGE_ACCESS_CONFIG";
209
210 /**
211 * Metadata key: Reason for needing usage access.
212 * <p>
213 * A key for metadata attached to an activity that receives action
214 * {@link #INTENT_CATEGORY_USAGE_ACCESS_CONFIG}, shown to the
215 * user as description of how the app uses usage access.
216 * <p>
217 */
218 public static final String METADATA_USAGE_ACCESS_REASON =
219 "android.settings.metadata.USAGE_ACCESS_REASON";
220
221 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800222 * Activity Action: Show settings to allow configuration of security and
223 * location privacy.
224 * <p>
225 * In some cases, a matching Activity may not exist, so ensure you
226 * safeguard against this.
227 * <p>
228 * Input: Nothing.
229 * <p>
230 * Output: Nothing.
231 */
232 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
233 public static final String ACTION_SECURITY_SETTINGS =
234 "android.settings.SECURITY_SETTINGS";
235
236 /**
Maggie Benthall0469f412013-09-05 15:30:26 -0400237 * Activity Action: Show trusted credentials settings, opening to the user tab,
238 * to allow management of installed credentials.
239 * <p>
240 * In some cases, a matching Activity may not exist, so ensure you
241 * safeguard against this.
242 * <p>
243 * Input: Nothing.
244 * <p>
245 * Output: Nothing.
246 * @hide
247 */
248 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
249 public static final String ACTION_TRUSTED_CREDENTIALS_USER =
250 "com.android.settings.TRUSTED_CREDENTIALS_USER";
251
252 /**
253 * Activity Action: Show dialog explaining that an installed CA cert may enable
254 * monitoring of encrypted network traffic.
255 * <p>
256 * In some cases, a matching Activity may not exist, so ensure you
257 * safeguard against this.
258 * <p>
259 * Input: Nothing.
260 * <p>
261 * Output: Nothing.
262 * @hide
263 */
264 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
265 public static final String ACTION_MONITORING_CERT_INFO =
266 "com.android.settings.MONITORING_CERT_INFO";
267
268 /**
Amith Yamasanic15255a2009-09-23 15:33:19 -0700269 * Activity Action: Show settings to allow configuration of privacy options.
270 * <p>
271 * In some cases, a matching Activity may not exist, so ensure you
272 * safeguard 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_PRIVACY_SETTINGS =
280 "android.settings.PRIVACY_SETTINGS";
281
282 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800283 * Activity Action: Show settings to allow configuration of Wi-Fi.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800284 * <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 */
293 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
294 public static final String ACTION_WIFI_SETTINGS =
295 "android.settings.WIFI_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700296
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800297 /**
298 * Activity Action: Show settings to allow configuration of a static IP
299 * address for Wi-Fi.
300 * <p>
301 * In some cases, a matching Activity may not exist, so ensure you safeguard
302 * against this.
303 * <p>
304 * Input: Nothing.
305 * <p>
306 * Output: Nothing.
307 */
308 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
309 public static final String ACTION_WIFI_IP_SETTINGS =
310 "android.settings.WIFI_IP_SETTINGS";
311
312 /**
313 * Activity Action: Show settings to allow configuration of Bluetooth.
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_BLUETOOTH_SETTINGS =
324 "android.settings.BLUETOOTH_SETTINGS";
325
326 /**
Jeff Brownc05c1ae2015-05-05 13:46:30 -0700327 * Activity Action: Show settings to allow configuration of cast endpoints.
Jeff Brown1a937b02014-07-01 22:13:04 -0700328 * <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_CAST_SETTINGS =
338 "android.settings.CAST_SETTINGS";
339
340 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800341 * Activity Action: Show settings to allow configuration of date and time.
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_DATE_SETTINGS =
352 "android.settings.DATE_SETTINGS";
353
354 /**
355 * Activity Action: Show settings to allow configuration of sound and volume.
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_SOUND_SETTINGS =
366 "android.settings.SOUND_SETTINGS";
367
368 /**
369 * Activity Action: Show settings to allow configuration of display.
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_DISPLAY_SETTINGS =
380 "android.settings.DISPLAY_SETTINGS";
381
382 /**
383 * Activity Action: Show settings to allow configuration of locale.
384 * <p>
385 * In some cases, a matching Activity may not exist, so ensure you
386 * safeguard against this.
387 * <p>
388 * Input: Nothing.
389 * <p>
390 * Output: Nothing.
391 */
392 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
393 public static final String ACTION_LOCALE_SETTINGS =
394 "android.settings.LOCALE_SETTINGS";
395
396 /**
397 * Activity Action: Show settings to configure input methods, in particular
398 * allowing the user to enable input methods.
399 * <p>
400 * In some cases, a matching Activity may not exist, so ensure you
401 * safeguard against this.
402 * <p>
403 * Input: Nothing.
404 * <p>
405 * Output: Nothing.
406 */
407 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
Dianne Hackborna3fb40d2014-08-12 15:06:50 -0700408 public static final String ACTION_VOICE_INPUT_SETTINGS =
409 "android.settings.VOICE_INPUT_SETTINGS";
410
411 /**
412 * Activity Action: Show settings to configure input methods, in particular
413 * allowing the user to enable input methods.
414 * <p>
415 * In some cases, a matching Activity may not exist, so ensure you
416 * safeguard against this.
417 * <p>
418 * Input: Nothing.
419 * <p>
420 * Output: Nothing.
421 */
422 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800423 public static final String ACTION_INPUT_METHOD_SETTINGS =
424 "android.settings.INPUT_METHOD_SETTINGS";
425
426 /**
Tadashi G. Takaokaf49688f2011-01-20 17:56:13 +0900427 * Activity Action: Show settings to enable/disable input method subtypes.
satok86417ea2010-10-27 14:11:03 +0900428 * <p>
429 * In some cases, a matching Activity may not exist, so ensure you
430 * safeguard against this.
431 * <p>
Tadashi G. Takaoka25480202011-01-20 23:13:02 +0900432 * To tell which input method's subtypes are displayed in the settings, add
433 * {@link #EXTRA_INPUT_METHOD_ID} extra to this Intent with the input method id.
434 * If there is no extra in this Intent, subtypes from all installed input methods
435 * will be displayed in the settings.
436 *
437 * @see android.view.inputmethod.InputMethodInfo#getId
438 * <p>
satok86417ea2010-10-27 14:11:03 +0900439 * Input: Nothing.
440 * <p>
441 * Output: Nothing.
442 */
443 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
Tadashi G. Takaokaf49688f2011-01-20 17:56:13 +0900444 public static final String ACTION_INPUT_METHOD_SUBTYPE_SETTINGS =
445 "android.settings.INPUT_METHOD_SUBTYPE_SETTINGS";
satok86417ea2010-10-27 14:11:03 +0900446
447 /**
satok7cfc0ed2011-06-20 21:29:36 +0900448 * Activity Action: Show a dialog to select input method.
449 * <p>
450 * In some cases, a matching Activity may not exist, so ensure you
451 * safeguard against this.
452 * <p>
453 * Input: Nothing.
454 * <p>
455 * Output: Nothing.
456 * @hide
457 */
458 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
459 public static final String ACTION_SHOW_INPUT_METHOD_PICKER =
460 "android.settings.SHOW_INPUT_METHOD_PICKER";
461
462 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800463 * Activity Action: Show settings to manage the user input dictionary.
464 * <p>
Chet Haasee8222dd2013-09-05 07:44:18 -0700465 * Starting with {@link android.os.Build.VERSION_CODES#KITKAT},
Satoshi Kataoka2aa2bc52013-07-30 14:25:11 +0900466 * it is guaranteed there will always be an appropriate implementation for this Intent action.
467 * 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 -0800468 * <p>
469 * Input: Nothing.
470 * <p>
471 * Output: Nothing.
472 */
473 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
474 public static final String ACTION_USER_DICTIONARY_SETTINGS =
475 "android.settings.USER_DICTIONARY_SETTINGS";
476
477 /**
Gilles Debunnee90bed12011-08-30 14:28:27 -0700478 * Activity Action: Adds a word to the user dictionary.
479 * <p>
480 * In some cases, a matching Activity may not exist, so ensure you
481 * safeguard against this.
482 * <p>
483 * Input: An extra with key <code>word</code> that contains the word
484 * that should be added to the dictionary.
485 * <p>
486 * Output: Nothing.
487 *
488 * @hide
489 */
490 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
491 public static final String ACTION_USER_DICTIONARY_INSERT =
492 "com.android.settings.USER_DICTIONARY_INSERT";
493
494 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800495 * Activity Action: Show settings to allow configuration of application-related settings.
496 * <p>
497 * In some cases, a matching Activity may not exist, so ensure you
498 * safeguard against this.
499 * <p>
500 * Input: Nothing.
501 * <p>
502 * Output: Nothing.
503 */
504 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
505 public static final String ACTION_APPLICATION_SETTINGS =
506 "android.settings.APPLICATION_SETTINGS";
507
508 /**
509 * Activity Action: Show settings to allow configuration of application
Dianne Hackborn8d866e52012-10-10 18:39:45 -0700510 * development-related settings. As of
511 * {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1} this action is
512 * a required part of the platform.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800513 * <p>
514 * Input: Nothing.
515 * <p>
516 * Output: Nothing.
517 */
518 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
519 public static final String ACTION_APPLICATION_DEVELOPMENT_SETTINGS =
520 "android.settings.APPLICATION_DEVELOPMENT_SETTINGS";
521
522 /**
523 * Activity Action: Show settings to allow configuration of quick launch shortcuts.
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_QUICK_LAUNCH_SETTINGS =
534 "android.settings.QUICK_LAUNCH_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700535
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800536 /**
537 * Activity Action: Show settings to manage installed 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_APPLICATIONS_SETTINGS =
548 "android.settings.MANAGE_APPLICATIONS_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700549
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800550 /**
Winson Chung44e8ff92010-09-27 14:36:52 -0700551 * Activity Action: Show settings to manage all applications.
552 * <p>
553 * In some cases, a matching Activity may not exist, so ensure you
554 * safeguard against this.
555 * <p>
556 * Input: Nothing.
557 * <p>
558 * Output: Nothing.
559 */
560 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
561 public static final String ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS =
562 "android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS";
563
564 /**
Dianne Hackbornb7bb3b32010-06-06 22:47:50 -0700565 * Activity Action: Show screen of details about a particular application.
566 * <p>
567 * In some cases, a matching Activity may not exist, so ensure you
568 * safeguard against this.
569 * <p>
570 * Input: The Intent's data URI specifies the application package name
571 * to be shown, with the "package" scheme. That is "package:com.my.app".
572 * <p>
573 * Output: Nothing.
574 */
575 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
576 public static final String ACTION_APPLICATION_DETAILS_SETTINGS =
577 "android.settings.APPLICATION_DETAILS_SETTINGS";
578
579 /**
Dianne Hackborn35654b62013-01-14 17:38:02 -0800580 * @hide
581 * Activity Action: Show the "app ops" settings screen.
582 * <p>
583 * Input: Nothing.
584 * <p>
585 * Output: Nothing.
586 */
587 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
588 public static final String ACTION_APP_OPS_SETTINGS =
589 "android.settings.APP_OPS_SETTINGS";
590
591 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800592 * Activity Action: Show settings for system update functionality.
593 * <p>
594 * In some cases, a matching Activity may not exist, so ensure you
595 * safeguard against this.
596 * <p>
597 * Input: Nothing.
598 * <p>
599 * Output: Nothing.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700600 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800601 * @hide
602 */
603 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
604 public static final String ACTION_SYSTEM_UPDATE_SETTINGS =
605 "android.settings.SYSTEM_UPDATE_SETTINGS";
606
607 /**
608 * Activity Action: Show settings to allow configuration of sync settings.
609 * <p>
610 * In some cases, a matching Activity may not exist, so ensure you
611 * safeguard against this.
612 * <p>
Erikeebc8e22010-02-18 13:27:19 -0800613 * The account types available to add via the add account button may be restricted by adding an
614 * {@link #EXTRA_AUTHORITIES} extra to this Intent with one or more syncable content provider's
615 * authorities. Only account types which can sync with that content provider will be offered to
616 * the user.
617 * <p>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800618 * Input: Nothing.
619 * <p>
620 * Output: Nothing.
621 */
622 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
623 public static final String ACTION_SYNC_SETTINGS =
624 "android.settings.SYNC_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700625
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800626 /**
Erikeebc8e22010-02-18 13:27:19 -0800627 * Activity Action: Show add account screen for creating a new account.
628 * <p>
629 * In some cases, a matching Activity may not exist, so ensure you
630 * safeguard against this.
631 * <p>
632 * The account types available to add may be restricted by adding an {@link #EXTRA_AUTHORITIES}
633 * extra to the Intent with one or more syncable content provider's authorities. Only account
634 * types which can sync with that content provider will be offered to the user.
635 * <p>
Alon Albert50359c22013-02-26 14:47:48 -0800636 * Account types can also be filtered by adding an {@link #EXTRA_ACCOUNT_TYPES} extra to the
637 * Intent with one or more account types.
638 * <p>
Erikeebc8e22010-02-18 13:27:19 -0800639 * Input: Nothing.
640 * <p>
641 * Output: Nothing.
642 */
643 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
644 public static final String ACTION_ADD_ACCOUNT =
645 "android.settings.ADD_ACCOUNT_SETTINGS";
646
647 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800648 * Activity Action: Show settings for selecting the network operator.
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_NETWORK_OPERATOR_SETTINGS =
659 "android.settings.NETWORK_OPERATOR_SETTINGS";
660
661 /**
662 * Activity Action: Show settings for selection of 2G/3G.
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_DATA_ROAMING_SETTINGS =
673 "android.settings.DATA_ROAMING_SETTINGS";
674
675 /**
676 * Activity Action: Show settings for internal storage.
677 * <p>
678 * In some cases, a matching Activity may not exist, so ensure you
679 * safeguard against this.
680 * <p>
681 * Input: Nothing.
682 * <p>
683 * Output: Nothing.
684 */
685 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
686 public static final String ACTION_INTERNAL_STORAGE_SETTINGS =
687 "android.settings.INTERNAL_STORAGE_SETTINGS";
688 /**
689 * Activity Action: Show settings for memory card storage.
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_MEMORY_CARD_SETTINGS =
700 "android.settings.MEMORY_CARD_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700701
Justin Mattsonef340352010-01-13 21:05:46 -0800702 /**
703 * Activity Action: Show settings for global search.
704 * <p>
705 * In some cases, a matching Activity may not exist, so ensure you
706 * safeguard against this.
707 * <p>
708 * Input: Nothing.
709 * <p>
710 * Output: Nothing
711 */
712 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
713 public static final String ACTION_SEARCH_SETTINGS =
714 "android.search.action.SEARCH_SETTINGS";
715
Daniel Sandler9d8b8762010-01-22 20:50:15 -0500716 /**
717 * Activity Action: Show general device information settings (serial
718 * number, software version, phone number, etc.).
719 * <p>
720 * In some cases, a matching Activity may not exist, so ensure you
721 * safeguard against this.
722 * <p>
723 * Input: Nothing.
724 * <p>
725 * Output: Nothing
726 */
727 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
728 public static final String ACTION_DEVICE_INFO_SETTINGS =
729 "android.settings.DEVICE_INFO_SETTINGS";
730
Martijn Coenen9b3c83f2011-07-28 11:21:39 -0500731 /**
Nick Pellycccf01d2011-10-31 14:49:40 -0700732 * Activity Action: Show NFC settings.
733 * <p>
734 * This shows UI that allows NFC to be turned on or off.
Martijn Coenen9b3c83f2011-07-28 11:21:39 -0500735 * <p>
736 * In some cases, a matching Activity may not exist, so ensure you
737 * safeguard against this.
738 * <p>
739 * Input: Nothing.
740 * <p>
741 * Output: Nothing
Nick Pellycccf01d2011-10-31 14:49:40 -0700742 * @see android.nfc.NfcAdapter#isEnabled()
743 */
744 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
745 public static final String ACTION_NFC_SETTINGS = "android.settings.NFC_SETTINGS";
746
747 /**
748 * Activity Action: Show NFC Sharing settings.
749 * <p>
750 * This shows UI that allows NDEF Push (Android Beam) to be turned on or
751 * off.
752 * <p>
753 * In some cases, a matching Activity may not exist, so ensure you
754 * safeguard against this.
755 * <p>
756 * Input: Nothing.
757 * <p>
758 * Output: Nothing
759 * @see android.nfc.NfcAdapter#isNdefPushEnabled()
Martijn Coenen9b3c83f2011-07-28 11:21:39 -0500760 */
761 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
762 public static final String ACTION_NFCSHARING_SETTINGS =
763 "android.settings.NFCSHARING_SETTINGS";
764
Daniel Sandlerc08cd022012-11-27 22:47:37 -0500765 /**
Martijn Coenen62c196a2013-08-09 13:43:34 -0700766 * Activity Action: Show NFC Tap & Pay settings
767 * <p>
768 * This shows UI that allows the user to configure Tap&Pay
769 * 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 */
778 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
779 public static final String ACTION_NFC_PAYMENT_SETTINGS =
780 "android.settings.NFC_PAYMENT_SETTINGS";
781
782 /**
Daniel Sandlerc08cd022012-11-27 22:47:37 -0500783 * Activity Action: Show Daydream 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.dreams.DreamService
Daniel Sandlerc08cd022012-11-27 22:47:37 -0500792 */
793 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
794 public static final String ACTION_DREAM_SETTINGS = "android.settings.DREAM_SETTINGS";
795
Daniel Sandler5feceeb2013-03-22 18:29:23 -0700796 /**
797 * Activity Action: Show Notification listener settings.
798 * <p>
799 * In some cases, a matching Activity may not exist, so ensure you
800 * safeguard against this.
801 * <p>
802 * Input: Nothing.
803 * <p>
804 * Output: Nothing.
805 * @see android.service.notification.NotificationListenerService
Daniel Sandler5feceeb2013-03-22 18:29:23 -0700806 */
807 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
808 public static final String ACTION_NOTIFICATION_LISTENER_SETTINGS
Chris Wren8326a8a2014-10-22 14:13:32 -0400809 = "android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS";
Daniel Sandler5feceeb2013-03-22 18:29:23 -0700810
Alan Viverette69ce69b2013-08-29 12:23:48 -0700811 /**
John Spurlock7340fc82014-04-24 18:50:12 -0400812 * @hide
813 */
814 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
815 public static final String ACTION_CONDITION_PROVIDER_SETTINGS
816 = "android.settings.ACTION_CONDITION_PROVIDER_SETTINGS";
817
818 /**
Alan Viverette69ce69b2013-08-29 12:23:48 -0700819 * Activity Action: Show settings for video captioning.
820 * <p>
821 * In some cases, a matching Activity may not exist, so ensure you safeguard
822 * against this.
823 * <p>
824 * Input: Nothing.
825 * <p>
826 * Output: Nothing.
827 */
828 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
829 public static final String ACTION_CAPTIONING_SETTINGS = "android.settings.CAPTIONING_SETTINGS";
830
Svetoslav773f54d2013-09-03 14:01:43 -0700831 /**
832 * Activity Action: Show the top level print settings.
833 * <p>
834 * In some cases, a matching Activity may not exist, so ensure you
835 * safeguard against this.
836 * <p>
837 * Input: Nothing.
838 * <p>
839 * Output: Nothing.
840 */
841 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
842 public static final String ACTION_PRINT_SETTINGS =
843 "android.settings.ACTION_PRINT_SETTINGS";
844
John Spurlockde547002014-02-28 17:50:39 -0500845 /**
846 * Activity Action: Show Zen Mode configuration settings.
847 *
848 * @hide
849 */
850 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
851 public static final String ACTION_ZEN_MODE_SETTINGS = "android.settings.ZEN_MODE_SETTINGS";
852
Santos Cordona4c75242014-07-09 12:07:51 -0700853 /**
John Spurlockfc746f82015-04-03 13:47:14 -0400854 * Activity Action: Show Zen Mode priority configuration settings.
855 *
856 * @hide
857 */
858 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
859 public static final String ACTION_ZEN_MODE_PRIORITY_SETTINGS
860 = "android.settings.ZEN_MODE_PRIORITY_SETTINGS";
861
862 /**
John Spurlock7af10182015-04-03 15:10:31 -0400863 * Activity Action: Show Zen Mode automation configuration settings.
864 *
865 * @hide
866 */
867 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
868 public static final String ACTION_ZEN_MODE_AUTOMATION_SETTINGS
869 = "android.settings.ZEN_MODE_AUTOMATION_SETTINGS";
870
871 /**
Barnaby Jamesb3006d32015-04-02 17:49:54 -0700872 * Activity Action: Modify do not disturb mode settings.
873 * <p>
874 * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
875 * <p>
876 * This intent MUST be started using
877 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
878 * startVoiceActivity}.
879 * <p>
880 * Note: The Activity implementing this intent MUST verify that
881 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction}.
882 * returns true before modifying the setting.
883 * <p>
884 * Input: The optional {@link #EXTRA_DO_NOT_DISTURB_MODE_MINUTES} extra can be used to indicate
885 * how long the user wishes to avoid interruptions for. The optional
886 * {@link #EXTRA_DO_NOT_DISTURB_MODE_ENABLED} extra can be to indicate if the user is
887 * enabling or disabling do not disturb mode. If either extra is not included, the
888 * user maybe asked to provide the value.
889 * <p>
890 * Output: Nothing.
891 */
892 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
893 public static final String ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE =
894 "android.settings.VOICE_CONTROL_DO_NOT_DISTURB_MODE";
895
896 /**
John Spurlockb2278d62015-04-07 12:47:12 -0400897 * Activity Action: Show Zen Mode schedule rule configuration settings.
898 *
899 * @hide
900 */
901 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
902 public static final String ACTION_ZEN_MODE_SCHEDULE_RULE_SETTINGS
903 = "android.settings.ZEN_MODE_SCHEDULE_RULE_SETTINGS";
904
905 /**
John Spurlockd60258f2015-04-30 09:30:52 -0400906 * Activity Action: Show Zen Mode event rule configuration settings.
907 *
908 * @hide
909 */
910 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
911 public static final String ACTION_ZEN_MODE_EVENT_RULE_SETTINGS
912 = "android.settings.ZEN_MODE_EVENT_RULE_SETTINGS";
913
914 /**
John Spurlock39581cc2015-04-10 11:59:01 -0400915 * Activity Action: Show Zen Mode external rule configuration settings.
916 *
917 * @hide
918 */
919 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
920 public static final String ACTION_ZEN_MODE_EXTERNAL_RULE_SETTINGS
921 = "android.settings.ZEN_MODE_EXTERNAL_RULE_SETTINGS";
922
923 /**
Santos Cordona4c75242014-07-09 12:07:51 -0700924 * Activity Action: Show the regulatory information screen for the device.
925 * <p>
926 * In some cases, a matching Activity may not exist, so ensure you safeguard
927 * against this.
928 * <p>
929 * Input: Nothing.
930 * <p>
931 * Output: Nothing.
932 */
Jeff Sharkeydd77fda2014-04-16 17:23:08 -0700933 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
934 public static final String
935 ACTION_SHOW_REGULATORY_INFO = "android.settings.SHOW_REGULATORY_INFO";
936
Jerome Poichet7974cb32014-05-14 12:04:43 -0700937 /**
938 * Activity Action: Show Device Name Settings.
939 * <p>
940 * In some cases, a matching Activity may not exist, so ensure you safeguard
Tim Kilbourn87cd0dc2014-04-14 15:37:51 -0700941 * against this.
Jerome Poichet7974cb32014-05-14 12:04:43 -0700942 *
943 * @hide
944 */
945 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
946 public static final String DEVICE_NAME_SETTINGS = "android.settings.DEVICE_NAME";
947
Tim Kilbourn87cd0dc2014-04-14 15:37:51 -0700948 /**
949 * Activity Action: Show pairing settings.
950 * <p>
951 * In some cases, a matching Activity may not exist, so ensure you safeguard
952 * against this.
953 *
954 * @hide
955 */
956 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
957 public static final String ACTION_PAIRING_SETTINGS = "android.settings.PAIRING_SETTINGS";
958
John Spurlockf8f524c2014-06-10 14:47:29 -0400959 /**
960 * Activity Action: Show battery saver settings.
John Spurlock73466662014-10-30 13:42:05 -0400961 * <p>
962 * In some cases, a matching Activity may not exist, so ensure you safeguard
963 * against this.
John Spurlockf8f524c2014-06-10 14:47:29 -0400964 */
965 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
966 public static final String ACTION_BATTERY_SAVER_SETTINGS
967 = "android.settings.BATTERY_SAVER_SETTINGS";
968
Amith Yamasanieb7b94a2014-07-14 18:02:08 -0700969 /**
Barnaby Jamesb3006d32015-04-02 17:49:54 -0700970 * Activity Action: Modify Battery Saver mode setting using a voice command.
971 * <p>
972 * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
973 * <p>
974 * This intent MUST be started using
975 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
976 * startVoiceActivity}.
977 * <p>
978 * Note: The activity implementing this intent MUST verify that
979 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before
980 * modifying the setting.
981 * <p>
982 * Input: To tell which state batter saver mode should be set to, add the
983 * {@link #EXTRA_BATTERY_SAVER_MODE_ENABLED} extra to this Intent with the state specified.
984 * If the extra is not included, no changes will be made.
985 * <p>
986 * Output: Nothing.
987 */
988 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
989 public static final String ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE =
990 "android.settings.VOICE_CONTROL_BATTERY_SAVER_MODE";
991
992 /**
Amith Yamasanieb7b94a2014-07-14 18:02:08 -0700993 * Activity Action: Show Home selection settings. If there are multiple activities
994 * that can satisfy the {@link Intent#CATEGORY_HOME} intent, this screen allows you
995 * to pick your preferred activity.
996 */
997 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
998 public static final String ACTION_HOME_SETTINGS
999 = "android.settings.HOME_SETTINGS";
1000
John Spurlock2b0e09c2014-07-27 13:27:47 -04001001 /**
1002 * Activity Action: Show notification settings.
1003 *
1004 * @hide
1005 */
1006 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1007 public static final String ACTION_NOTIFICATION_SETTINGS
1008 = "android.settings.NOTIFICATION_SETTINGS";
1009
1010 /**
1011 * Activity Action: Show notification settings for a single app.
1012 *
1013 * @hide
1014 */
1015 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1016 public static final String ACTION_APP_NOTIFICATION_SETTINGS
1017 = "android.settings.APP_NOTIFICATION_SETTINGS";
1018
Chris Wrencd8f4f72014-08-27 18:48:13 -04001019 /**
1020 * Activity Action: Show notification redaction settings.
1021 *
1022 * @hide
1023 */
1024 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1025 public static final String ACTION_APP_NOTIFICATION_REDACTION
1026 = "android.settings.ACTION_APP_NOTIFICATION_REDACTION";
1027
John Spurlock2b0e09c2014-07-27 13:27:47 -04001028 /** @hide */ public static final String EXTRA_APP_UID = "app_uid";
1029 /** @hide */ public static final String EXTRA_APP_PACKAGE = "app_package";
1030
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001031 // End of Intent actions for Settings
1032
Erikeebc8e22010-02-18 13:27:19 -08001033 /**
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001034 * @hide - Private call() method on SettingsProvider to read from 'system' table.
1035 */
1036 public static final String CALL_METHOD_GET_SYSTEM = "GET_system";
1037
1038 /**
1039 * @hide - Private call() method on SettingsProvider to read from 'secure' table.
1040 */
1041 public static final String CALL_METHOD_GET_SECURE = "GET_secure";
1042
1043 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001044 * @hide - Private call() method on SettingsProvider to read from 'global' table.
1045 */
1046 public static final String CALL_METHOD_GET_GLOBAL = "GET_global";
1047
1048 /**
1049 * @hide - User handle argument extra to the fast-path call()-based requests
1050 */
1051 public static final String CALL_METHOD_USER_KEY = "_user";
1052
1053 /** @hide - Private call() method to write to 'system' table */
1054 public static final String CALL_METHOD_PUT_SYSTEM = "PUT_system";
1055
1056 /** @hide - Private call() method to write to 'secure' table */
1057 public static final String CALL_METHOD_PUT_SECURE = "PUT_secure";
1058
1059 /** @hide - Private call() method to write to 'global' table */
1060 public static final String CALL_METHOD_PUT_GLOBAL= "PUT_global";
1061
1062 /**
Erikeebc8e22010-02-18 13:27:19 -08001063 * Activity Extra: Limit available options in launched activity based on the given authority.
1064 * <p>
1065 * This can be passed as an extra field in an Activity Intent with one or more syncable content
1066 * provider's authorities as a String[]. This field is used by some intents to alter the
1067 * behavior of the called activity.
1068 * <p>
1069 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types available based
1070 * on the authority given.
1071 */
Alon Albert50359c22013-02-26 14:47:48 -08001072 public static final String EXTRA_AUTHORITIES = "authorities";
1073
Alon Albertd35bf1f2013-04-18 14:26:51 -07001074 /**
1075 * Activity Extra: Limit available options in launched activity based on the given account
1076 * types.
1077 * <p>
1078 * This can be passed as an extra field in an Activity Intent with one or more account types
1079 * as a String[]. This field is used by some intents to alter the behavior of the called
1080 * activity.
1081 * <p>
1082 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types to the specified
1083 * list.
1084 */
Alon Albert50359c22013-02-26 14:47:48 -08001085 public static final String EXTRA_ACCOUNT_TYPES = "account_types";
Erikeebc8e22010-02-18 13:27:19 -08001086
Tadashi G. Takaoka25480202011-01-20 23:13:02 +09001087 public static final String EXTRA_INPUT_METHOD_ID = "input_method_id";
1088
Barnaby James48f35522014-07-16 14:27:39 -07001089 /**
Michael Wrightc93fbd12014-09-22 20:07:59 -07001090 * Activity Extra: The device identifier to act upon.
1091 * <p>
1092 * This can be passed as an extra field in an Activity Intent with a single
1093 * InputDeviceIdentifier. This field is used by some activities to jump straight into the
1094 * settings for the given device.
1095 * <p>
Dianne Hackbornad6a99b2014-11-18 10:11:10 -08001096 * Example: The {@link #ACTION_INPUT_METHOD_SETTINGS} intent opens the keyboard layout
1097 * dialog for the given device.
Michael Wrightc93fbd12014-09-22 20:07:59 -07001098 * @hide
1099 */
1100 public static final String EXTRA_INPUT_DEVICE_IDENTIFIER = "input_device_identifier";
1101
1102 /**
Barnaby James48f35522014-07-16 14:27:39 -07001103 * Activity Extra: Enable or disable Airplane Mode.
1104 * <p>
1105 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_AIRPLANE_MODE}
Barnaby Jamesb3006d32015-04-02 17:49:54 -07001106 * intent as a boolean to indicate if it should be enabled.
Barnaby James48f35522014-07-16 14:27:39 -07001107 */
1108 public static final String EXTRA_AIRPLANE_MODE_ENABLED = "airplane_mode_enabled";
1109
Barnaby Jamesb3006d32015-04-02 17:49:54 -07001110 /**
1111 * Activity Extra: Enable or disable Battery saver mode.
1112 * <p>
1113 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE}
1114 * intent as a boolean to indicate if it should be enabled.
1115 */
1116 public static final String EXTRA_BATTERY_SAVER_MODE_ENABLED =
1117 "android.settings.extra.battery_saver_mode_enabled";
1118
1119 /**
1120 * Activity Extra: Enable or disable Do Not Disturb mode.
1121 * <p>
1122 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE}
1123 * intent as a boolean to indicate if it should be enabled.
1124 */
1125 public static final String EXTRA_DO_NOT_DISTURB_MODE_ENABLED =
1126 "android.settings.extra.do_not_disturb_mode_enabled";
1127
1128 /**
1129 * Activity Extra: How many minutes to enable do not disturb mode for.
1130 * <p>
1131 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE}
1132 * intent to indicate how long do not disturb mode should be enabled for.
1133 */
1134 public static final String EXTRA_DO_NOT_DISTURB_MODE_MINUTES =
1135 "android.settings.extra.do_not_disturb_mode_minutes";
1136
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001137 private static final String JID_RESOURCE_PREFIX = "android";
1138
1139 public static final String AUTHORITY = "settings";
1140
1141 private static final String TAG = "Settings";
Christopher Tate06efb532012-08-24 15:29:27 -07001142 private static final boolean LOCAL_LOGV = false;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001143
David Christie3f7b6522013-08-06 19:19:08 -07001144 // Lock ensures that when enabling/disabling the master location switch, we don't end up
1145 // with a partial enable/disable state in multi-threaded situations.
1146 private static final Object mLocationSettingsLock = new Object();
1147
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001148 public static class SettingNotFoundException extends AndroidException {
1149 public SettingNotFoundException(String msg) {
1150 super(msg);
1151 }
1152 }
1153
1154 /**
1155 * Common base for tables of name/value settings.
1156 */
1157 public static class NameValueTable implements BaseColumns {
1158 public static final String NAME = "name";
1159 public static final String VALUE = "value";
1160
1161 protected static boolean putString(ContentResolver resolver, Uri uri,
1162 String name, String value) {
1163 // The database will take care of replacing duplicates.
1164 try {
1165 ContentValues values = new ContentValues();
1166 values.put(NAME, name);
1167 values.put(VALUE, value);
1168 resolver.insert(uri, values);
1169 return true;
1170 } catch (SQLException e) {
Dianne Hackborna33e3f72009-09-29 17:28:24 -07001171 Log.w(TAG, "Can't set key " + name + " in " + uri, e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001172 return false;
1173 }
1174 }
1175
1176 public static Uri getUriFor(Uri uri, String name) {
1177 return Uri.withAppendedPath(uri, name);
1178 }
1179 }
1180
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001181 // Thread-safe.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001182 private static class NameValueCache {
1183 private final String mVersionSystemProperty;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001184 private final Uri mUri;
1185
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001186 private static final String[] SELECT_VALUE =
1187 new String[] { Settings.NameValueTable.VALUE };
1188 private static final String NAME_EQ_PLACEHOLDER = "name=?";
1189
1190 // Must synchronize on 'this' to access mValues and mValuesVersion.
Dan Egnor799f7212009-11-24 16:24:44 -08001191 private final HashMap<String, String> mValues = new HashMap<String, String>();
1192 private long mValuesVersion = 0;
1193
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001194 // Initially null; set lazily and held forever. Synchronized on 'this'.
1195 private IContentProvider mContentProvider = null;
1196
1197 // The method we'll call (or null, to not use) on the provider
1198 // for the fast path of retrieving settings.
Christopher Tate06efb532012-08-24 15:29:27 -07001199 private final String mCallGetCommand;
1200 private final String mCallSetCommand;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001201
Christopher Tate06efb532012-08-24 15:29:27 -07001202 public NameValueCache(String versionSystemProperty, Uri uri,
1203 String getCommand, String setCommand) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001204 mVersionSystemProperty = versionSystemProperty;
1205 mUri = uri;
Christopher Tate06efb532012-08-24 15:29:27 -07001206 mCallGetCommand = getCommand;
1207 mCallSetCommand = setCommand;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001208 }
1209
Christopher Tate06efb532012-08-24 15:29:27 -07001210 private IContentProvider lazyGetProvider(ContentResolver cr) {
1211 IContentProvider cp = null;
1212 synchronized (this) {
1213 cp = mContentProvider;
1214 if (cp == null) {
1215 cp = mContentProvider = cr.acquireProvider(mUri.getAuthority());
1216 }
1217 }
1218 return cp;
1219 }
1220
1221 public boolean putStringForUser(ContentResolver cr, String name, String value,
1222 final int userHandle) {
1223 try {
1224 Bundle arg = new Bundle();
1225 arg.putString(Settings.NameValueTable.VALUE, value);
Christopher Tated5fe1472012-09-10 15:48:38 -07001226 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
Christopher Tate06efb532012-08-24 15:29:27 -07001227 IContentProvider cp = lazyGetProvider(cr);
Dianne Hackborn35654b62013-01-14 17:38:02 -08001228 cp.call(cr.getPackageName(), mCallSetCommand, name, arg);
Christopher Tate06efb532012-08-24 15:29:27 -07001229 } catch (RemoteException e) {
1230 Log.w(TAG, "Can't set key " + name + " in " + mUri, e);
1231 return false;
1232 }
1233 return true;
1234 }
1235
Christopher Tate06efb532012-08-24 15:29:27 -07001236 public String getStringForUser(ContentResolver cr, String name, final int userHandle) {
Christopher Tate78d2a662012-09-13 16:19:44 -07001237 final boolean isSelf = (userHandle == UserHandle.myUserId());
1238 if (isSelf) {
1239 long newValuesVersion = SystemProperties.getLong(mVersionSystemProperty, 0);
Dan Egnor799f7212009-11-24 16:24:44 -08001240
Christopher Tate78d2a662012-09-13 16:19:44 -07001241 // Our own user's settings data uses a client-side cache
1242 synchronized (this) {
1243 if (mValuesVersion != newValuesVersion) {
1244 if (LOCAL_LOGV || false) {
1245 Log.v(TAG, "invalidate [" + mUri.getLastPathSegment() + "]: current "
1246 + newValuesVersion + " != cached " + mValuesVersion);
1247 }
1248
1249 mValues.clear();
1250 mValuesVersion = newValuesVersion;
Dan Egnor799f7212009-11-24 16:24:44 -08001251 }
1252
Christopher Tate78d2a662012-09-13 16:19:44 -07001253 if (mValues.containsKey(name)) {
1254 return mValues.get(name); // Could be null, that's OK -- negative caching
1255 }
Dan Egnor799f7212009-11-24 16:24:44 -08001256 }
Christopher Tate78d2a662012-09-13 16:19:44 -07001257 } else {
1258 if (LOCAL_LOGV) Log.v(TAG, "get setting for user " + userHandle
1259 + " by user " + UserHandle.myUserId() + " so skipping cache");
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001260 }
Dan Egnor799f7212009-11-24 16:24:44 -08001261
Christopher Tate06efb532012-08-24 15:29:27 -07001262 IContentProvider cp = lazyGetProvider(cr);
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001263
1264 // Try the fast path first, not using query(). If this
1265 // fails (alternate Settings provider that doesn't support
1266 // this interface?) then we fall back to the query/table
1267 // interface.
Christopher Tate06efb532012-08-24 15:29:27 -07001268 if (mCallGetCommand != null) {
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001269 try {
Christopher Tate06efb532012-08-24 15:29:27 -07001270 Bundle args = null;
Christopher Tate5e08af02012-09-21 17:17:22 -07001271 if (!isSelf) {
Christopher Tate06efb532012-08-24 15:29:27 -07001272 args = new Bundle();
1273 args.putInt(CALL_METHOD_USER_KEY, userHandle);
1274 }
Dianne Hackborn35654b62013-01-14 17:38:02 -08001275 Bundle b = cp.call(cr.getPackageName(), mCallGetCommand, name, args);
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001276 if (b != null) {
1277 String value = b.getPairValue();
Christopher Tate78d2a662012-09-13 16:19:44 -07001278 // Don't update our cache for reads of other users' data
1279 if (isSelf) {
1280 synchronized (this) {
1281 mValues.put(name, value);
1282 }
1283 } else {
1284 if (LOCAL_LOGV) Log.i(TAG, "call-query of user " + userHandle
1285 + " by " + UserHandle.myUserId()
1286 + " so not updating cache");
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001287 }
1288 return value;
1289 }
1290 // If the response Bundle is null, we fall through
1291 // to the query interface below.
1292 } catch (RemoteException e) {
1293 // Not supported by the remote side? Fall through
1294 // to query().
1295 }
1296 }
1297
Dan Egnor799f7212009-11-24 16:24:44 -08001298 Cursor c = null;
1299 try {
Dianne Hackborn35654b62013-01-14 17:38:02 -08001300 c = cp.query(cr.getPackageName(), mUri, SELECT_VALUE, NAME_EQ_PLACEHOLDER,
Jeff Brown75ea64f2012-01-25 19:37:13 -08001301 new String[]{name}, null, null);
Dan Egnor799f7212009-11-24 16:24:44 -08001302 if (c == null) {
1303 Log.w(TAG, "Can't get key " + name + " from " + mUri);
1304 return null;
1305 }
1306
1307 String value = c.moveToNext() ? c.getString(0) : null;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001308 synchronized (this) {
Dan Egnor799f7212009-11-24 16:24:44 -08001309 mValues.put(name, value);
1310 }
1311 if (LOCAL_LOGV) {
1312 Log.v(TAG, "cache miss [" + mUri.getLastPathSegment() + "]: " +
1313 name + " = " + (value == null ? "(null)" : value));
1314 }
1315 return value;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001316 } catch (RemoteException e) {
Dan Egnor799f7212009-11-24 16:24:44 -08001317 Log.w(TAG, "Can't get key " + name + " from " + mUri, e);
1318 return null; // Return null, but don't cache it.
1319 } finally {
1320 if (c != null) c.close();
1321 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001322 }
1323 }
1324
1325 /**
1326 * System settings, containing miscellaneous system preferences. This
1327 * table holds simple name/value pairs. There are convenience
1328 * functions for accessing individual settings entries.
1329 */
1330 public static final class System extends NameValueTable {
1331 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_system_version";
1332
Svetoslav683914b2015-01-15 14:22:26 -08001333 /** @hide */
1334 public static interface Validator {
1335 public boolean validate(String value);
1336 }
1337
Dianne Hackborn139748f2012-09-24 11:36:57 -07001338 /**
1339 * The content:// style URL for this table
1340 */
1341 public static final Uri CONTENT_URI =
1342 Uri.parse("content://" + AUTHORITY + "/system");
1343
1344 private static final NameValueCache sNameValueCache = new NameValueCache(
1345 SYS_PROP_SETTING_VERSION,
1346 CONTENT_URI,
1347 CALL_METHOD_GET_SYSTEM,
1348 CALL_METHOD_PUT_SYSTEM);
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001349
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001350 private static final HashSet<String> MOVED_TO_SECURE;
1351 static {
1352 MOVED_TO_SECURE = new HashSet<String>(30);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001353 MOVED_TO_SECURE.add(Secure.ANDROID_ID);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001354 MOVED_TO_SECURE.add(Secure.HTTP_PROXY);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001355 MOVED_TO_SECURE.add(Secure.LOCATION_PROVIDERS_ALLOWED);
Danielle Millett925a7d82012-03-19 18:02:20 -04001356 MOVED_TO_SECURE.add(Secure.LOCK_BIOMETRIC_WEAK_FLAGS);
Amith Yamasani156c4352010-03-05 17:10:03 -08001357 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_ENABLED);
1358 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_VISIBLE);
1359 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001360 MOVED_TO_SECURE.add(Secure.LOGGING_ID);
1361 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_ENABLED);
1362 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_LAST_UPDATE);
1363 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_REDIRECT_URL);
1364 MOVED_TO_SECURE.add(Secure.SETTINGS_CLASSNAME);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001365 MOVED_TO_SECURE.add(Secure.USE_GOOGLE_MAIL);
1366 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
1367 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
1368 MOVED_TO_SECURE.add(Secure.WIFI_NUM_OPEN_NETWORKS_KEPT);
1369 MOVED_TO_SECURE.add(Secure.WIFI_ON);
1370 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE);
1371 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_AP_COUNT);
1372 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS);
1373 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED);
1374 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS);
1375 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT);
1376 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_MAX_AP_CHECKS);
1377 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ON);
1378 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_COUNT);
1379 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_DELAY_MS);
1380 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS);
Christopher Tateaa036a22014-05-19 16:33:27 -07001381
1382 // At one time in System, then Global, but now back in Secure
1383 MOVED_TO_SECURE.add(Secure.INSTALL_NON_MARKET_APPS);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001384 }
1385
Christopher Tate06efb532012-08-24 15:29:27 -07001386 private static final HashSet<String> MOVED_TO_GLOBAL;
Christopher Tate66488d62012-10-02 11:58:01 -07001387 private static final HashSet<String> MOVED_TO_SECURE_THEN_GLOBAL;
Christopher Tate06efb532012-08-24 15:29:27 -07001388 static {
1389 MOVED_TO_GLOBAL = new HashSet<String>();
Christopher Tate66488d62012-10-02 11:58:01 -07001390 MOVED_TO_SECURE_THEN_GLOBAL = new HashSet<String>();
1391
Christopher Tate92198742012-09-07 12:00:13 -07001392 // these were originally in system but migrated to secure in the past,
1393 // so are duplicated in the Secure.* namespace
Christopher Tate66488d62012-10-02 11:58:01 -07001394 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.ADB_ENABLED);
1395 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.BLUETOOTH_ON);
1396 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DATA_ROAMING);
1397 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DEVICE_PROVISIONED);
Christopher Tate66488d62012-10-02 11:58:01 -07001398 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.USB_MASS_STORAGE_ENABLED);
1399 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.HTTP_PROXY);
Christopher Tate06efb532012-08-24 15:29:27 -07001400
Christopher Tate92198742012-09-07 12:00:13 -07001401 // these are moving directly from system to global
Christopher Tate06efb532012-08-24 15:29:27 -07001402 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_ON);
1403 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_RADIOS);
1404 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS);
1405 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME);
1406 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME_ZONE);
1407 MOVED_TO_GLOBAL.add(Settings.Global.CAR_DOCK_SOUND);
1408 MOVED_TO_GLOBAL.add(Settings.Global.CAR_UNDOCK_SOUND);
1409 MOVED_TO_GLOBAL.add(Settings.Global.DESK_DOCK_SOUND);
1410 MOVED_TO_GLOBAL.add(Settings.Global.DESK_UNDOCK_SOUND);
1411 MOVED_TO_GLOBAL.add(Settings.Global.DOCK_SOUNDS_ENABLED);
1412 MOVED_TO_GLOBAL.add(Settings.Global.LOCK_SOUND);
1413 MOVED_TO_GLOBAL.add(Settings.Global.UNLOCK_SOUND);
1414 MOVED_TO_GLOBAL.add(Settings.Global.LOW_BATTERY_SOUND);
1415 MOVED_TO_GLOBAL.add(Settings.Global.POWER_SOUNDS_ENABLED);
1416 MOVED_TO_GLOBAL.add(Settings.Global.STAY_ON_WHILE_PLUGGED_IN);
1417 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SLEEP_POLICY);
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07001418 MOVED_TO_GLOBAL.add(Settings.Global.MODE_RINGER);
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001419 MOVED_TO_GLOBAL.add(Settings.Global.WINDOW_ANIMATION_SCALE);
1420 MOVED_TO_GLOBAL.add(Settings.Global.TRANSITION_ANIMATION_SCALE);
1421 MOVED_TO_GLOBAL.add(Settings.Global.ANIMATOR_DURATION_SCALE);
1422 MOVED_TO_GLOBAL.add(Settings.Global.FANCY_IME_ANIMATIONS);
1423 MOVED_TO_GLOBAL.add(Settings.Global.COMPATIBILITY_MODE);
1424 MOVED_TO_GLOBAL.add(Settings.Global.EMERGENCY_TONE);
1425 MOVED_TO_GLOBAL.add(Settings.Global.CALL_AUTO_RETRY);
1426 MOVED_TO_GLOBAL.add(Settings.Global.DEBUG_APP);
1427 MOVED_TO_GLOBAL.add(Settings.Global.WAIT_FOR_DEBUGGER);
1428 MOVED_TO_GLOBAL.add(Settings.Global.SHOW_PROCESSES);
1429 MOVED_TO_GLOBAL.add(Settings.Global.ALWAYS_FINISH_ACTIVITIES);
Geremy Condraa0735112013-03-26 21:49:26 -07001430 MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_CONTENT_URL);
1431 MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_METADATA_URL);
1432 MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_CONTENT_URL);
1433 MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_METADATA_URL);
1434 MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_CONTENT_URL);
1435 MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_METADATA_URL);
1436 MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_CONTENT_URL);
1437 MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_METADATA_URL);
Christopher Tate06efb532012-08-24 15:29:27 -07001438 }
1439
Svetoslav683914b2015-01-15 14:22:26 -08001440 private static final Validator sBooleanValidator =
1441 new DiscreteValueValidator(new String[] {"0", "1"});
1442
1443 private static final Validator sNonNegativeIntegerValidator = new Validator() {
1444 @Override
1445 public boolean validate(String value) {
1446 try {
1447 return Integer.parseInt(value) >= 0;
1448 } catch (NumberFormatException e) {
1449 return false;
1450 }
1451 }
1452 };
1453
Svetoslav683914b2015-01-15 14:22:26 -08001454 private static final Validator sUriValidator = new Validator() {
1455 @Override
1456 public boolean validate(String value) {
1457 try {
1458 Uri.decode(value);
1459 return true;
1460 } catch (IllegalArgumentException e) {
1461 return false;
1462 }
1463 }
1464 };
1465
1466 private static final Validator sLenientIpAddressValidator = new Validator() {
1467 private static final int MAX_IPV6_LENGTH = 45;
1468
1469 @Override
1470 public boolean validate(String value) {
1471 return value.length() <= MAX_IPV6_LENGTH;
1472 }
1473 };
1474
Christopher Tate66488d62012-10-02 11:58:01 -07001475 /** @hide */
Svetoslav683914b2015-01-15 14:22:26 -08001476 public static void getMovedToGlobalSettings(Set<String> outKeySet) {
Christopher Tate66488d62012-10-02 11:58:01 -07001477 outKeySet.addAll(MOVED_TO_GLOBAL);
1478 outKeySet.addAll(MOVED_TO_SECURE_THEN_GLOBAL);
1479 }
1480
1481 /** @hide */
Svetoslav683914b2015-01-15 14:22:26 -08001482 public static void getMovedToSecureSettings(Set<String> outKeySet) {
1483 outKeySet.addAll(MOVED_TO_SECURE);
1484 }
1485
1486 /** @hide */
Christopher Tate66488d62012-10-02 11:58:01 -07001487 public static void getNonLegacyMovedKeys(HashSet<String> outKeySet) {
1488 outKeySet.addAll(MOVED_TO_GLOBAL);
1489 }
1490
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001491 /**
1492 * Look up a name in the database.
1493 * @param resolver to access the database with
1494 * @param name to look up in the table
1495 * @return the corresponding value, or null if not present
1496 */
Dianne Hackborn139748f2012-09-24 11:36:57 -07001497 public static String getString(ContentResolver resolver, String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07001498 return getStringForUser(resolver, name, UserHandle.myUserId());
1499 }
1500
1501 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -07001502 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -07001503 int userHandle) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001504 if (MOVED_TO_SECURE.contains(name)) {
1505 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1506 + " to android.provider.Settings.Secure, returning read-only value.");
Christopher Tate06efb532012-08-24 15:29:27 -07001507 return Secure.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001508 }
Christopher Tate66488d62012-10-02 11:58:01 -07001509 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07001510 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1511 + " to android.provider.Settings.Global, returning read-only value.");
1512 return Global.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001513 }
Christopher Tate06efb532012-08-24 15:29:27 -07001514 return sNameValueCache.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001515 }
1516
1517 /**
1518 * Store a name/value pair into the database.
1519 * @param resolver to access the database with
1520 * @param name to store
1521 * @param value to associate with the name
1522 * @return true if the value was set, false on database errors
1523 */
1524 public static boolean putString(ContentResolver resolver, String name, String value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001525 return putStringForUser(resolver, name, value, UserHandle.myUserId());
1526 }
1527
1528 /** @hide */
1529 public static boolean putStringForUser(ContentResolver resolver, String name, String value,
1530 int userHandle) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001531 if (MOVED_TO_SECURE.contains(name)) {
1532 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1533 + " to android.provider.Settings.Secure, value is unchanged.");
1534 return false;
1535 }
Christopher Tate66488d62012-10-02 11:58:01 -07001536 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07001537 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1538 + " to android.provider.Settings.Global, value is unchanged.");
1539 return false;
1540 }
Christopher Tate06efb532012-08-24 15:29:27 -07001541 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001542 }
1543
1544 /**
1545 * Construct the content URI for a particular name/value pair,
1546 * useful for monitoring changes with a ContentObserver.
1547 * @param name to look up in the table
1548 * @return the corresponding content URI, or null if not present
1549 */
1550 public static Uri getUriFor(String name) {
1551 if (MOVED_TO_SECURE.contains(name)) {
1552 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1553 + " to android.provider.Settings.Secure, returning Secure URI.");
1554 return Secure.getUriFor(Secure.CONTENT_URI, name);
1555 }
Christopher Tate66488d62012-10-02 11:58:01 -07001556 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07001557 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1558 + " to android.provider.Settings.Global, returning read-only global URI.");
1559 return Global.getUriFor(Global.CONTENT_URI, name);
1560 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001561 return getUriFor(CONTENT_URI, name);
1562 }
1563
1564 /**
1565 * Convenience function for retrieving a single system settings value
1566 * as an integer. Note that internally setting values are always
1567 * stored as strings; this function converts the string to an integer
1568 * for you. The default value will be returned if the setting is
1569 * not defined or not an integer.
1570 *
1571 * @param cr The ContentResolver to access.
1572 * @param name The name of the setting to retrieve.
1573 * @param def Value to return if the setting is not defined.
1574 *
1575 * @return The setting's current value, or 'def' if it is not defined
1576 * or not a valid integer.
1577 */
1578 public static int getInt(ContentResolver cr, String name, int def) {
Christopher Tate06efb532012-08-24 15:29:27 -07001579 return getIntForUser(cr, name, def, UserHandle.myUserId());
1580 }
1581
1582 /** @hide */
1583 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
1584 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001585 try {
1586 return v != null ? Integer.parseInt(v) : def;
1587 } catch (NumberFormatException e) {
1588 return def;
1589 }
1590 }
1591
1592 /**
1593 * Convenience function for retrieving a single system settings value
1594 * as an integer. Note that internally setting values are always
1595 * stored as strings; this function converts the string to an integer
1596 * for you.
1597 * <p>
1598 * This version does not take a default value. If the setting has not
1599 * been set, or the string value is not a number,
1600 * it throws {@link SettingNotFoundException}.
1601 *
1602 * @param cr The ContentResolver to access.
1603 * @param name The name of the setting to retrieve.
1604 *
1605 * @throws SettingNotFoundException Thrown if a setting by the given
1606 * name can't be found or the setting value is not an integer.
1607 *
1608 * @return The setting's current value.
1609 */
1610 public static int getInt(ContentResolver cr, String name)
1611 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07001612 return getIntForUser(cr, name, UserHandle.myUserId());
1613 }
1614
1615 /** @hide */
1616 public static int getIntForUser(ContentResolver cr, String name, int userHandle)
1617 throws SettingNotFoundException {
1618 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001619 try {
1620 return Integer.parseInt(v);
1621 } catch (NumberFormatException e) {
1622 throw new SettingNotFoundException(name);
1623 }
1624 }
1625
1626 /**
1627 * Convenience function for updating a single settings value as an
1628 * integer. This will either create a new entry in the table if the
1629 * given name does not exist, or modify the value of the existing row
1630 * with that name. Note that internally setting values are always
1631 * stored as strings, so this function converts the given value to a
1632 * string before storing it.
1633 *
1634 * @param cr The ContentResolver to access.
1635 * @param name The name of the setting to modify.
1636 * @param value The new value for the setting.
1637 * @return true if the value was set, false on database errors
1638 */
1639 public static boolean putInt(ContentResolver cr, String name, int value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001640 return putIntForUser(cr, name, value, UserHandle.myUserId());
1641 }
1642
1643 /** @hide */
1644 public static boolean putIntForUser(ContentResolver cr, String name, int value,
1645 int userHandle) {
1646 return putStringForUser(cr, name, Integer.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001647 }
1648
1649 /**
1650 * Convenience function for retrieving a single system settings value
1651 * as a {@code long}. Note that internally setting values are always
1652 * stored as strings; this function converts the string to a {@code long}
1653 * for you. The default value will be returned if the setting is
1654 * not defined or not a {@code long}.
1655 *
1656 * @param cr The ContentResolver to access.
1657 * @param name The name of the setting to retrieve.
1658 * @param def Value to return if the setting is not defined.
1659 *
1660 * @return The setting's current value, or 'def' if it is not defined
1661 * or not a valid {@code long}.
1662 */
1663 public static long getLong(ContentResolver cr, String name, long def) {
Christopher Tate06efb532012-08-24 15:29:27 -07001664 return getLongForUser(cr, name, def, UserHandle.myUserId());
1665 }
1666
1667 /** @hide */
1668 public static long getLongForUser(ContentResolver cr, String name, long def,
1669 int userHandle) {
1670 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001671 long value;
1672 try {
1673 value = valString != null ? Long.parseLong(valString) : def;
1674 } catch (NumberFormatException e) {
1675 value = def;
1676 }
1677 return value;
1678 }
1679
1680 /**
1681 * Convenience function for retrieving a single system settings value
1682 * as a {@code long}. Note that internally setting values are always
1683 * stored as strings; this function converts the string to a {@code long}
1684 * for you.
1685 * <p>
1686 * This version does not take a default value. If the setting has not
1687 * been set, or the string value is not a number,
1688 * it throws {@link SettingNotFoundException}.
1689 *
1690 * @param cr The ContentResolver to access.
1691 * @param name The name of the setting to retrieve.
1692 *
1693 * @return The setting's current value.
1694 * @throws SettingNotFoundException Thrown if a setting by the given
1695 * name can't be found or the setting value is not an integer.
1696 */
1697 public static long getLong(ContentResolver cr, String name)
1698 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07001699 return getLongForUser(cr, name, UserHandle.myUserId());
1700 }
1701
1702 /** @hide */
1703 public static long getLongForUser(ContentResolver cr, String name, int userHandle)
1704 throws SettingNotFoundException {
1705 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001706 try {
1707 return Long.parseLong(valString);
1708 } catch (NumberFormatException e) {
1709 throw new SettingNotFoundException(name);
1710 }
1711 }
1712
1713 /**
1714 * Convenience function for updating a single settings value as a long
1715 * integer. This will either create a new entry in the table if the
1716 * given name does not exist, or modify the value of the existing row
1717 * with that name. Note that internally setting values are always
1718 * stored as strings, so this function converts the given value to a
1719 * string before storing it.
1720 *
1721 * @param cr The ContentResolver to access.
1722 * @param name The name of the setting to modify.
1723 * @param value The new value for the setting.
1724 * @return true if the value was set, false on database errors
1725 */
1726 public static boolean putLong(ContentResolver cr, String name, long value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001727 return putLongForUser(cr, name, value, UserHandle.myUserId());
1728 }
1729
1730 /** @hide */
1731 public static boolean putLongForUser(ContentResolver cr, String name, long value,
1732 int userHandle) {
1733 return putStringForUser(cr, name, Long.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001734 }
1735
1736 /**
1737 * Convenience function for retrieving a single system settings value
1738 * as a floating point number. Note that internally setting values are
1739 * always stored as strings; this function converts the string to an
1740 * float for you. The default value will be returned if the setting
1741 * is not defined or not a valid float.
1742 *
1743 * @param cr The ContentResolver to access.
1744 * @param name The name of the setting to retrieve.
1745 * @param def Value to return if the setting is not defined.
1746 *
1747 * @return The setting's current value, or 'def' if it is not defined
1748 * or not a valid float.
1749 */
1750 public static float getFloat(ContentResolver cr, String name, float def) {
Christopher Tate06efb532012-08-24 15:29:27 -07001751 return getFloatForUser(cr, name, def, UserHandle.myUserId());
1752 }
1753
1754 /** @hide */
1755 public static float getFloatForUser(ContentResolver cr, String name, float def,
1756 int userHandle) {
1757 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001758 try {
1759 return v != null ? Float.parseFloat(v) : def;
1760 } catch (NumberFormatException e) {
1761 return def;
1762 }
1763 }
1764
1765 /**
1766 * Convenience function for retrieving a single system settings value
1767 * as a float. Note that internally setting values are always
1768 * stored as strings; this function converts the string to a float
1769 * for you.
1770 * <p>
1771 * This version does not take a default value. If the setting has not
1772 * been set, or the string value is not a number,
1773 * it throws {@link SettingNotFoundException}.
1774 *
1775 * @param cr The ContentResolver to access.
1776 * @param name The name of the setting to retrieve.
1777 *
1778 * @throws SettingNotFoundException Thrown if a setting by the given
1779 * name can't be found or the setting value is not a float.
1780 *
1781 * @return The setting's current value.
1782 */
1783 public static float getFloat(ContentResolver cr, String name)
1784 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07001785 return getFloatForUser(cr, name, UserHandle.myUserId());
1786 }
1787
1788 /** @hide */
1789 public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
1790 throws SettingNotFoundException {
1791 String v = getStringForUser(cr, name, userHandle);
Brian Muramatsue1d46982010-12-06 17:34:20 -08001792 if (v == null) {
1793 throw new SettingNotFoundException(name);
1794 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001795 try {
1796 return Float.parseFloat(v);
1797 } catch (NumberFormatException e) {
1798 throw new SettingNotFoundException(name);
1799 }
1800 }
1801
1802 /**
1803 * Convenience function for updating a single settings value as a
1804 * floating point number. This will either create a new entry in the
1805 * table if the given name does not exist, or modify the value of the
1806 * existing row with that name. Note that internally setting values
1807 * are always stored as strings, so this function converts the given
1808 * value to a string before storing it.
1809 *
1810 * @param cr The ContentResolver to access.
1811 * @param name The name of the setting to modify.
1812 * @param value The new value for the setting.
1813 * @return true if the value was set, false on database errors
1814 */
1815 public static boolean putFloat(ContentResolver cr, String name, float value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001816 return putFloatForUser(cr, name, value, UserHandle.myUserId());
1817 }
1818
1819 /** @hide */
1820 public static boolean putFloatForUser(ContentResolver cr, String name, float value,
1821 int userHandle) {
1822 return putStringForUser(cr, name, Float.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001823 }
1824
1825 /**
1826 * Convenience function to read all of the current
1827 * configuration-related settings into a
1828 * {@link Configuration} object.
1829 *
1830 * @param cr The ContentResolver to access.
1831 * @param outConfig Where to place the configuration settings.
1832 */
1833 public static void getConfiguration(ContentResolver cr, Configuration outConfig) {
Christopher Tate06efb532012-08-24 15:29:27 -07001834 getConfigurationForUser(cr, outConfig, UserHandle.myUserId());
1835 }
1836
1837 /** @hide */
1838 public static void getConfigurationForUser(ContentResolver cr, Configuration outConfig,
1839 int userHandle) {
1840 outConfig.fontScale = Settings.System.getFloatForUser(
1841 cr, FONT_SCALE, outConfig.fontScale, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001842 if (outConfig.fontScale < 0) {
1843 outConfig.fontScale = 1;
1844 }
1845 }
1846
1847 /**
Dianne Hackborn31ca8542011-07-19 14:58:28 -07001848 * @hide Erase the fields in the Configuration that should be applied
1849 * by the settings.
1850 */
1851 public static void clearConfiguration(Configuration inoutConfig) {
1852 inoutConfig.fontScale = 0;
1853 }
Narayan Kamath6d632962011-08-24 11:51:37 +01001854
Dianne Hackborn31ca8542011-07-19 14:58:28 -07001855 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001856 * Convenience function to write a batch of configuration-related
1857 * settings from a {@link Configuration} object.
1858 *
1859 * @param cr The ContentResolver to access.
1860 * @param config The settings to write.
1861 * @return true if the values were set, false on database errors
1862 */
1863 public static boolean putConfiguration(ContentResolver cr, Configuration config) {
Christopher Tate06efb532012-08-24 15:29:27 -07001864 return putConfigurationForUser(cr, config, UserHandle.myUserId());
1865 }
1866
1867 /** @hide */
1868 public static boolean putConfigurationForUser(ContentResolver cr, Configuration config,
1869 int userHandle) {
1870 return Settings.System.putFloatForUser(cr, FONT_SCALE, config.fontScale, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001871 }
1872
Dianne Hackbornb8b11a02010-03-10 15:53:11 -08001873 /** @hide */
1874 public static boolean hasInterestingConfigurationChanges(int changes) {
1875 return (changes&ActivityInfo.CONFIG_FONT_SCALE) != 0;
1876 }
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07001877
Christopher Tate06efb532012-08-24 15:29:27 -07001878 /** @deprecated - Do not use */
1879 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001880 public static boolean getShowGTalkServiceStatus(ContentResolver cr) {
Christopher Tate06efb532012-08-24 15:29:27 -07001881 return getShowGTalkServiceStatusForUser(cr, UserHandle.myUserId());
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001882 }
1883
Christopher Tate06efb532012-08-24 15:29:27 -07001884 /**
1885 * @hide
1886 * @deprecated - Do not use
1887 */
1888 public static boolean getShowGTalkServiceStatusForUser(ContentResolver cr,
1889 int userHandle) {
1890 return getIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, 0, userHandle) != 0;
1891 }
1892
1893 /** @deprecated - Do not use */
1894 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001895 public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag) {
Christopher Tatec8c08382012-09-19 17:18:18 -07001896 setShowGTalkServiceStatusForUser(cr, flag, UserHandle.myUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07001897 }
1898
1899 /**
1900 * @hide
1901 * @deprecated - Do not use
1902 */
1903 @Deprecated
1904 public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean flag,
1905 int userHandle) {
1906 putIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, flag ? 1 : 0, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001907 }
1908
Svetoslav683914b2015-01-15 14:22:26 -08001909 private static final class DiscreteValueValidator implements Validator {
1910 private final String[] mValues;
1911
1912 public DiscreteValueValidator(String[] values) {
1913 mValues = values;
1914 }
1915
Svetoslav1b71ea92015-02-17 18:20:29 -08001916 @Override
Svetoslav683914b2015-01-15 14:22:26 -08001917 public boolean validate(String value) {
1918 return ArrayUtils.contains(mValues, value);
1919 }
1920 }
1921
1922 private static final class InclusiveIntegerRangeValidator implements Validator {
1923 private final int mMin;
1924 private final int mMax;
1925
1926 public InclusiveIntegerRangeValidator(int min, int max) {
1927 mMin = min;
1928 mMax = max;
1929 }
1930
Svetoslav1b71ea92015-02-17 18:20:29 -08001931 @Override
Svetoslav683914b2015-01-15 14:22:26 -08001932 public boolean validate(String value) {
1933 try {
1934 final int intValue = Integer.parseInt(value);
1935 return intValue >= mMin && intValue <= mMax;
1936 } catch (NumberFormatException e) {
1937 return false;
1938 }
1939 }
1940 }
1941
1942 private static final class InclusiveFloatRangeValidator implements Validator {
1943 private final float mMin;
1944 private final float mMax;
1945
1946 public InclusiveFloatRangeValidator(float min, float max) {
1947 mMin = min;
1948 mMax = max;
1949 }
1950
Svetoslav1b71ea92015-02-17 18:20:29 -08001951 @Override
Svetoslav683914b2015-01-15 14:22:26 -08001952 public boolean validate(String value) {
1953 try {
1954 final float floatValue = Float.parseFloat(value);
1955 return floatValue >= mMin && floatValue <= mMax;
1956 } catch (NumberFormatException e) {
1957 return false;
1958 }
1959 }
1960 }
1961
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001962 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001963 * @deprecated Use {@link android.provider.Settings.Global#STAY_ON_WHILE_PLUGGED_IN} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001964 */
Christopher Tate06efb532012-08-24 15:29:27 -07001965 @Deprecated
1966 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 -08001967
1968 /**
1969 * What happens when the user presses the end call button if they're not
1970 * on a call.<br/>
1971 * <b>Values:</b><br/>
1972 * 0 - The end button does nothing.<br/>
1973 * 1 - The end button goes to the home screen.<br/>
1974 * 2 - The end button puts the device to sleep and locks the keyguard.<br/>
1975 * 3 - The end button goes to the home screen. If the user is already on the
1976 * home screen, it puts the device to sleep.
1977 */
1978 public static final String END_BUTTON_BEHAVIOR = "end_button_behavior";
1979
Svetoslav683914b2015-01-15 14:22:26 -08001980 private static final Validator END_BUTTON_BEHAVIOR_VALIDATOR =
1981 new InclusiveIntegerRangeValidator(0, 3);
1982
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001983 /**
David Brown458e8062010-03-08 21:52:11 -08001984 * END_BUTTON_BEHAVIOR value for "go home".
1985 * @hide
1986 */
1987 public static final int END_BUTTON_BEHAVIOR_HOME = 0x1;
1988
1989 /**
1990 * END_BUTTON_BEHAVIOR value for "go to sleep".
1991 * @hide
1992 */
1993 public static final int END_BUTTON_BEHAVIOR_SLEEP = 0x2;
1994
1995 /**
1996 * END_BUTTON_BEHAVIOR default value.
1997 * @hide
1998 */
1999 public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_SLEEP;
2000
2001 /**
Joe Onorato9cdffa12011-04-06 18:27:27 -07002002 * Is advanced settings mode turned on. 0 == no, 1 == yes
2003 * @hide
2004 */
2005 public static final String ADVANCED_SETTINGS = "advanced_settings";
2006
Svetoslav683914b2015-01-15 14:22:26 -08002007 private static final Validator ADVANCED_SETTINGS_VALIDATOR = sBooleanValidator;
2008
Joe Onorato9cdffa12011-04-06 18:27:27 -07002009 /**
2010 * ADVANCED_SETTINGS default value.
2011 * @hide
2012 */
2013 public static final int ADVANCED_SETTINGS_DEFAULT = 0;
2014
2015 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002016 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002017 */
Christopher Tate06efb532012-08-24 15:29:27 -07002018 @Deprecated
2019 public static final String AIRPLANE_MODE_ON = Global.AIRPLANE_MODE_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002020
2021 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002022 * @deprecated Use {@link android.provider.Settings.Global#RADIO_BLUETOOTH} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002023 */
Christopher Tate06efb532012-08-24 15:29:27 -07002024 @Deprecated
2025 public static final String RADIO_BLUETOOTH = Global.RADIO_BLUETOOTH;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002026
2027 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002028 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIFI} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002029 */
Christopher Tate06efb532012-08-24 15:29:27 -07002030 @Deprecated
2031 public static final String RADIO_WIFI = Global.RADIO_WIFI;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002032
Robert Greenwalt8588e472011-11-08 10:12:25 -08002033 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002034 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIMAX} instead
Robert Greenwalt8588e472011-11-08 10:12:25 -08002035 * {@hide}
2036 */
Christopher Tate06efb532012-08-24 15:29:27 -07002037 @Deprecated
2038 public static final String RADIO_WIMAX = Global.RADIO_WIMAX;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002039
2040 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002041 * @deprecated Use {@link android.provider.Settings.Global#RADIO_CELL} instead
Nick Pelly8d32a012011-08-09 07:03:49 -07002042 */
Christopher Tate06efb532012-08-24 15:29:27 -07002043 @Deprecated
2044 public static final String RADIO_CELL = Global.RADIO_CELL;
Nick Pelly8d32a012011-08-09 07:03:49 -07002045
2046 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002047 * @deprecated Use {@link android.provider.Settings.Global#RADIO_NFC} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002048 */
Christopher Tate06efb532012-08-24 15:29:27 -07002049 @Deprecated
2050 public static final String RADIO_NFC = Global.RADIO_NFC;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002051
2052 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002053 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_RADIOS} instead
2054 */
2055 @Deprecated
2056 public static final String AIRPLANE_MODE_RADIOS = Global.AIRPLANE_MODE_RADIOS;
2057
2058 /**
2059 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_TOGGLEABLE_RADIOS} instead
Mike Lockwoodbd5ddf02009-07-29 21:37:14 -07002060 *
2061 * {@hide}
2062 */
Christopher Tate06efb532012-08-24 15:29:27 -07002063 @Deprecated
2064 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS =
2065 Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS;
Mike Lockwoodbd5ddf02009-07-29 21:37:14 -07002066
2067 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002068 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002069 */
Christopher Tate06efb532012-08-24 15:29:27 -07002070 @Deprecated
2071 public static final String WIFI_SLEEP_POLICY = Global.WIFI_SLEEP_POLICY;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002072
2073 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002074 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_DEFAULT} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002075 */
Christopher Tate06efb532012-08-24 15:29:27 -07002076 @Deprecated
2077 public static final int WIFI_SLEEP_POLICY_DEFAULT = Global.WIFI_SLEEP_POLICY_DEFAULT;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002078
2079 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002080 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002081 */
Christopher Tate06efb532012-08-24 15:29:27 -07002082 @Deprecated
2083 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED =
2084 Global.WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002085
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002086 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002087 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002088 */
Christopher Tate06efb532012-08-24 15:29:27 -07002089 @Deprecated
2090 public static final int WIFI_SLEEP_POLICY_NEVER = Global.WIFI_SLEEP_POLICY_NEVER;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002091
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07002092 /**
2093 * @deprecated Use {@link android.provider.Settings.Global#MODE_RINGER} instead
2094 */
2095 @Deprecated
2096 public static final String MODE_RINGER = Global.MODE_RINGER;
2097
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002098 /**
2099 * Whether to use static IP and other static network attributes.
2100 * <p>
2101 * Set to 1 for true and 0 for false.
Jeff Sharkey625239a2012-09-26 22:03:49 -07002102 *
2103 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002104 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002105 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002106 public static final String WIFI_USE_STATIC_IP = "wifi_use_static_ip";
2107
Svetoslav683914b2015-01-15 14:22:26 -08002108 private static final Validator WIFI_USE_STATIC_IP_VALIDATOR = sBooleanValidator;
2109
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002110 /**
2111 * The static IP address.
2112 * <p>
2113 * Example: "192.168.1.51"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002114 *
2115 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002116 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002117 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002118 public static final String WIFI_STATIC_IP = "wifi_static_ip";
2119
Svetoslav683914b2015-01-15 14:22:26 -08002120 private static final Validator WIFI_STATIC_IP_VALIDATOR = sLenientIpAddressValidator;
2121
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002122 /**
2123 * If using static IP, the gateway's IP address.
2124 * <p>
2125 * Example: "192.168.1.1"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002126 *
2127 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002128 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002129 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002130 public static final String WIFI_STATIC_GATEWAY = "wifi_static_gateway";
2131
Svetoslav683914b2015-01-15 14:22:26 -08002132 private static final Validator WIFI_STATIC_GATEWAY_VALIDATOR = sLenientIpAddressValidator;
2133
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002134 /**
2135 * If using static IP, the net mask.
2136 * <p>
2137 * Example: "255.255.255.0"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002138 *
2139 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002140 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002141 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002142 public static final String WIFI_STATIC_NETMASK = "wifi_static_netmask";
2143
Svetoslav683914b2015-01-15 14:22:26 -08002144 private static final Validator WIFI_STATIC_NETMASK_VALIDATOR = sLenientIpAddressValidator;
2145
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002146 /**
2147 * If using static IP, the primary DNS's IP address.
2148 * <p>
2149 * Example: "192.168.1.1"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002150 *
2151 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002152 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002153 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002154 public static final String WIFI_STATIC_DNS1 = "wifi_static_dns1";
2155
Svetoslav683914b2015-01-15 14:22:26 -08002156 private static final Validator WIFI_STATIC_DNS1_VALIDATOR = sLenientIpAddressValidator;
2157
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002158 /**
2159 * If using static IP, the secondary DNS's IP address.
2160 * <p>
2161 * Example: "192.168.1.2"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002162 *
2163 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002164 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002165 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002166 public static final String WIFI_STATIC_DNS2 = "wifi_static_dns2";
2167
Svetoslav683914b2015-01-15 14:22:26 -08002168 private static final Validator WIFI_STATIC_DNS2_VALIDATOR = sLenientIpAddressValidator;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002169
2170 /**
2171 * Determines whether remote devices may discover and/or connect to
2172 * this device.
2173 * <P>Type: INT</P>
2174 * 2 -- discoverable and connectable
2175 * 1 -- connectable but not discoverable
2176 * 0 -- neither connectable nor discoverable
2177 */
2178 public static final String BLUETOOTH_DISCOVERABILITY =
2179 "bluetooth_discoverability";
2180
Svetoslav683914b2015-01-15 14:22:26 -08002181 private static final Validator BLUETOOTH_DISCOVERABILITY_VALIDATOR =
2182 new InclusiveIntegerRangeValidator(0, 2);
2183
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002184 /**
2185 * Bluetooth discoverability timeout. If this value is nonzero, then
2186 * Bluetooth becomes discoverable for a certain number of seconds,
2187 * after which is becomes simply connectable. The value is in seconds.
2188 */
2189 public static final String BLUETOOTH_DISCOVERABILITY_TIMEOUT =
2190 "bluetooth_discoverability_timeout";
2191
Svetoslav683914b2015-01-15 14:22:26 -08002192 private static final Validator BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR =
2193 sNonNegativeIntegerValidator;
2194
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002195 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08002196 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_ENABLED}
2197 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002198 */
Amith Yamasani156c4352010-03-05 17:10:03 -08002199 @Deprecated
2200 public static final String LOCK_PATTERN_ENABLED = Secure.LOCK_PATTERN_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002201
2202 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08002203 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_VISIBLE}
2204 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002205 */
Amith Yamasani156c4352010-03-05 17:10:03 -08002206 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002207 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
2208
2209 /**
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07002210 * @deprecated Use
Amith Yamasani156c4352010-03-05 17:10:03 -08002211 * {@link android.provider.Settings.Secure#LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED}
2212 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002213 */
Amith Yamasani156c4352010-03-05 17:10:03 -08002214 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002215 public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED =
2216 "lock_pattern_tactile_feedback_enabled";
2217
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002218 /**
2219 * A formatted string of the next alarm that is set, or the empty string
2220 * if there is no alarm set.
Adrian Roosc42a1e12014-07-07 23:35:53 +02002221 *
2222 * @deprecated Use {@link android.app.AlarmManager#getNextAlarmClock()}.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002223 */
Adrian Roosc42a1e12014-07-07 23:35:53 +02002224 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002225 public static final String NEXT_ALARM_FORMATTED = "next_alarm_formatted";
2226
Svetoslav683914b2015-01-15 14:22:26 -08002227 private static final Validator NEXT_ALARM_FORMATTED_VALIDATOR = new Validator() {
2228 private static final int MAX_LENGTH = 1000;
Svetoslav1b71ea92015-02-17 18:20:29 -08002229
Svetoslav683914b2015-01-15 14:22:26 -08002230 @Override
2231 public boolean validate(String value) {
2232 // TODO: No idea what the correct format is.
Svetoslav64d6e9c2015-02-12 11:30:36 -08002233 return value == null || value.length() < MAX_LENGTH;
Svetoslav683914b2015-01-15 14:22:26 -08002234 }
2235 };
2236
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002237 /**
2238 * Scaling factor for fonts, float.
2239 */
2240 public static final String FONT_SCALE = "font_scale";
2241
Svetoslav683914b2015-01-15 14:22:26 -08002242 private static final Validator FONT_SCALE_VALIDATOR = new Validator() {
2243 @Override
2244 public boolean validate(String value) {
2245 try {
2246 return Float.parseFloat(value) >= 0;
2247 } catch (NumberFormatException e) {
2248 return false;
2249 }
2250 }
2251 };
2252
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002253 /**
2254 * Name of an application package to be debugged.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002255 *
2256 * @deprecated Use {@link Global#DEBUG_APP} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002257 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002258 @Deprecated
2259 public static final String DEBUG_APP = Global.DEBUG_APP;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002260
2261 /**
2262 * If 1, when launching DEBUG_APP it will wait for the debugger before
2263 * starting user code. If 0, it will run normally.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002264 *
2265 * @deprecated Use {@link Global#WAIT_FOR_DEBUGGER} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002266 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002267 @Deprecated
2268 public static final String WAIT_FOR_DEBUGGER = Global.WAIT_FOR_DEBUGGER;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002269
2270 /**
2271 * Whether or not to dim the screen. 0=no 1=yes
Jeff Brown96307042012-07-27 15:51:34 -07002272 * @deprecated This setting is no longer used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002273 */
Jeff Brown96307042012-07-27 15:51:34 -07002274 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002275 public static final String DIM_SCREEN = "dim_screen";
2276
Svetoslav683914b2015-01-15 14:22:26 -08002277 private static final Validator DIM_SCREEN_VALIDATOR = sBooleanValidator;
2278
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002279 /**
Jeff Brown05af6ad2014-09-30 20:54:30 -07002280 * The amount of time in milliseconds before the device goes to sleep or begins
2281 * to dream after a period of inactivity. This value is also known as the
2282 * user activity timeout period since the screen isn't necessarily turned off
2283 * when it expires.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002284 */
2285 public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout";
2286
Svetoslav683914b2015-01-15 14:22:26 -08002287 private static final Validator SCREEN_OFF_TIMEOUT_VALIDATOR = sNonNegativeIntegerValidator;
2288
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002289 /**
2290 * The screen backlight brightness between 0 and 255.
2291 */
2292 public static final String SCREEN_BRIGHTNESS = "screen_brightness";
2293
Svetoslav683914b2015-01-15 14:22:26 -08002294 private static final Validator SCREEN_BRIGHTNESS_VALIDATOR =
2295 new InclusiveIntegerRangeValidator(0, 255);
2296
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002297 /**
Dan Murphy951764b2009-08-27 14:59:03 -05002298 * Control whether to enable automatic brightness mode.
Dan Murphy951764b2009-08-27 14:59:03 -05002299 */
2300 public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode";
2301
Svetoslav683914b2015-01-15 14:22:26 -08002302 private static final Validator SCREEN_BRIGHTNESS_MODE_VALIDATOR = sBooleanValidator;
2303
Dan Murphy951764b2009-08-27 14:59:03 -05002304 /**
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08002305 * Adjustment to auto-brightness to make it generally more (>0.0 <1.0)
2306 * or less (<0.0 >-1.0) bright.
Dianne Hackborn518a3d82012-05-09 16:30:49 -07002307 * @hide
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08002308 */
2309 public static final String SCREEN_AUTO_BRIGHTNESS_ADJ = "screen_auto_brightness_adj";
2310
Svetoslav683914b2015-01-15 14:22:26 -08002311 private static final Validator SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR =
2312 new InclusiveFloatRangeValidator(-1, 1);
2313
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08002314 /**
Mike Lockwooddc3494e2009-10-14 21:17:09 -07002315 * SCREEN_BRIGHTNESS_MODE value for manual mode.
Mike Lockwooddc3494e2009-10-14 21:17:09 -07002316 */
2317 public static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0;
2318
2319 /**
Scott Main52bfc242012-02-09 10:09:14 -08002320 * SCREEN_BRIGHTNESS_MODE value for automatic mode.
Mike Lockwooddc3494e2009-10-14 21:17:09 -07002321 */
2322 public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1;
2323
2324 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002325 * Control whether the process CPU usage meter should be shown.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002326 *
2327 * @deprecated Use {@link Global#SHOW_PROCESSES} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002328 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002329 @Deprecated
2330 public static final String SHOW_PROCESSES = Global.SHOW_PROCESSES;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002331
2332 /**
2333 * If 1, the activity manager will aggressively finish activities and
2334 * processes as soon as they are no longer needed. If 0, the normal
2335 * extended lifetime is used.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002336 *
2337 * @deprecated Use {@link Global#ALWAYS_FINISH_ACTIVITIES} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002338 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002339 @Deprecated
2340 public static final String ALWAYS_FINISH_ACTIVITIES = Global.ALWAYS_FINISH_ACTIVITIES;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002341
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002342 /**
2343 * Determines which streams are affected by ringer mode changes. The
2344 * stream type's bit should be set to 1 if it should be muted when going
2345 * into an inaudible ringer mode.
2346 */
2347 public static final String MODE_RINGER_STREAMS_AFFECTED = "mode_ringer_streams_affected";
2348
Svetoslav683914b2015-01-15 14:22:26 -08002349 private static final Validator MODE_RINGER_STREAMS_AFFECTED_VALIDATOR =
2350 sNonNegativeIntegerValidator;
2351
2352 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002353 * Determines which streams are affected by mute. The
2354 * stream type's bit should be set to 1 if it should be muted when a mute request
2355 * is received.
2356 */
Svetoslav683914b2015-01-15 14:22:26 -08002357 public static final String MUTE_STREAMS_AFFECTED = "mute_streams_affected";
2358
2359 private static final Validator MUTE_STREAMS_AFFECTED_VALIDATOR =
2360 sNonNegativeIntegerValidator;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002361
2362 /**
2363 * Whether vibrate is on for different events. This is used internally,
2364 * changing this value will not change the vibrate. See AudioManager.
2365 */
2366 public static final String VIBRATE_ON = "vibrate_on";
2367
Svetoslav683914b2015-01-15 14:22:26 -08002368 private static final Validator VIBRATE_ON_VALIDATOR = sBooleanValidator;
2369
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002370 /**
Jeff Brown7f6c2312012-04-13 20:38:38 -07002371 * If 1, redirects the system vibrator to all currently attached input devices
2372 * that support vibration. If there are no such input devices, then the system
2373 * vibrator is used instead.
2374 * If 0, does not register the system vibrator.
2375 *
2376 * This setting is mainly intended to provide a compatibility mechanism for
2377 * applications that only know about the system vibrator and do not use the
2378 * input device vibrator API.
2379 *
2380 * @hide
2381 */
2382 public static final String VIBRATE_INPUT_DEVICES = "vibrate_input_devices";
2383
Svetoslav683914b2015-01-15 14:22:26 -08002384 private static final Validator VIBRATE_INPUT_DEVICES_VALIDATOR = sBooleanValidator;
2385
Jeff Brown7f6c2312012-04-13 20:38:38 -07002386 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002387 * Ringer volume. This is used internally, changing this value will not
2388 * 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_RING = "volume_ring";
2393
2394 /**
2395 * System/notifications 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_SYSTEM = "volume_system";
2401
2402 /**
2403 * Voice call 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.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002407 */
2408 public static final String VOLUME_VOICE = "volume_voice";
2409
2410 /**
2411 * Music/media/gaming volume. This is used internally, changing this
2412 * value will not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002413 *
2414 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002415 */
2416 public static final String VOLUME_MUSIC = "volume_music";
2417
2418 /**
2419 * Alarm volume. This is used internally, changing this
2420 * value will not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002421 *
2422 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002423 */
2424 public static final String VOLUME_ALARM = "volume_alarm";
2425
2426 /**
2427 * Notification volume. This is used internally, changing this
2428 * value will not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002429 *
2430 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002431 */
2432 public static final String VOLUME_NOTIFICATION = "volume_notification";
2433
2434 /**
Eric Laurent484d2882009-12-08 09:05:45 -08002435 * Bluetooth Headset volume. This is used internally, changing this value will
2436 * not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002437 *
2438 * @removed Not used by anything since API 2.
Eric Laurent484d2882009-12-08 09:05:45 -08002439 */
2440 public static final String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco";
2441
2442 /**
Mike Lockwood8517e462011-10-25 14:47:19 -04002443 * Master volume (float in the range 0.0f to 1.0f).
Svetoslavdbbeeb32015-02-18 19:16:25 -08002444 *
Mike Lockwood8517e462011-10-25 14:47:19 -04002445 * @hide
2446 */
2447 public static final String VOLUME_MASTER = "volume_master";
2448
2449 /**
Justin Koh57978ed2012-04-03 17:37:58 -07002450 * Master volume mute (int 1 = mute, 0 = not muted).
2451 *
2452 * @hide
2453 */
2454 public static final String VOLUME_MASTER_MUTE = "volume_master_mute";
2455
Svetoslav683914b2015-01-15 14:22:26 -08002456 private static final Validator VOLUME_MASTER_MUTE_VALIDATOR = sBooleanValidator;
2457
Justin Koh57978ed2012-04-03 17:37:58 -07002458 /**
Julia Reynoldsb53453f2014-08-22 11:42:43 -04002459 * Microphone mute (int 1 = mute, 0 = not muted).
2460 *
2461 * @hide
2462 */
2463 public static final String MICROPHONE_MUTE = "microphone_mute";
2464
Svetoslav683914b2015-01-15 14:22:26 -08002465 private static final Validator MICROPHONE_MUTE_VALIDATOR = sBooleanValidator;
2466
Julia Reynoldsb53453f2014-08-22 11:42:43 -04002467 /**
Justin Koh57978ed2012-04-03 17:37:58 -07002468 * Whether the notifications should use the ring volume (value of 1) or
2469 * a separate notification volume (value of 0). In most cases, users
2470 * will have this enabled so the notification and ringer volumes will be
2471 * the same. However, power users can disable this and use the separate
2472 * notification volume control.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002473 * <p>
Justin Koh57978ed2012-04-03 17:37:58 -07002474 * Note: This is a one-off setting that will be removed in the future
2475 * when there is profile support. For this reason, it is kept hidden
2476 * from the public APIs.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002477 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002478 * @hide
Amith Yamasani42722bf2011-07-22 10:34:27 -07002479 * @deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002480 */
Gilles Debunnee90bed12011-08-30 14:28:27 -07002481 @Deprecated
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002482 public static final String NOTIFICATIONS_USE_RING_VOLUME =
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002483 "notifications_use_ring_volume";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002484
Svetoslav683914b2015-01-15 14:22:26 -08002485 private static final Validator NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR = sBooleanValidator;
2486
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002487 /**
Daniel Sandler6329bf72010-02-26 15:17:44 -05002488 * Whether silent mode should allow vibration feedback. This is used
2489 * internally in AudioService and the Sound settings activity to
2490 * coordinate decoupling of vibrate and silent modes. This setting
2491 * will likely be removed in a future release with support for
2492 * audio/vibe feedback profiles.
2493 *
Eric Laurentbffc3d12012-05-07 17:43:49 -07002494 * Not used anymore. On devices with vibrator, the user explicitly selects
2495 * silent or vibrate mode.
2496 * Kept for use by legacy database upgrade code in DatabaseHelper.
Daniel Sandler6329bf72010-02-26 15:17:44 -05002497 * @hide
2498 */
2499 public static final String VIBRATE_IN_SILENT = "vibrate_in_silent";
2500
Svetoslav683914b2015-01-15 14:22:26 -08002501 private static final Validator VIBRATE_IN_SILENT_VALIDATOR = sBooleanValidator;
2502
Daniel Sandler6329bf72010-02-26 15:17:44 -05002503 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002504 * The mapping of stream type (integer) to its setting.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002505 *
2506 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002507 */
2508 public static final String[] VOLUME_SETTINGS = {
2509 VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC,
Eric Laurent484d2882009-12-08 09:05:45 -08002510 VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002511 };
2512
2513 /**
2514 * Appended to various volume related settings to record the previous
2515 * values before they the settings were affected by a silent/vibrate
2516 * ringer mode change.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002517 *
2518 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002519 */
2520 public static final String APPEND_FOR_LAST_AUDIBLE = "_last_audible";
2521
2522 /**
2523 * Persistent store for the system-wide default ringtone URI.
2524 * <p>
2525 * If you need to play the default ringtone at any given time, it is recommended
2526 * you give {@link #DEFAULT_RINGTONE_URI} to the media player. It will resolve
2527 * to the set default ringtone at the time of playing.
2528 *
2529 * @see #DEFAULT_RINGTONE_URI
2530 */
2531 public static final String RINGTONE = "ringtone";
2532
Svetoslav683914b2015-01-15 14:22:26 -08002533 private static final Validator RINGTONE_VALIDATOR = sUriValidator;
2534
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002535 /**
2536 * A {@link Uri} that will point to the current default ringtone at any
2537 * given time.
2538 * <p>
2539 * If the current default ringtone is in the DRM provider and the caller
2540 * does not have permission, the exception will be a
2541 * FileNotFoundException.
2542 */
2543 public static final Uri DEFAULT_RINGTONE_URI = getUriFor(RINGTONE);
2544
2545 /**
2546 * Persistent store for the system-wide default notification sound.
2547 *
2548 * @see #RINGTONE
2549 * @see #DEFAULT_NOTIFICATION_URI
2550 */
2551 public static final String NOTIFICATION_SOUND = "notification_sound";
2552
Svetoslav683914b2015-01-15 14:22:26 -08002553 private static final Validator NOTIFICATION_SOUND_VALIDATOR = sUriValidator;
2554
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002555 /**
2556 * A {@link Uri} that will point to the current default notification
2557 * sound at any given time.
2558 *
2559 * @see #DEFAULT_RINGTONE_URI
2560 */
2561 public static final Uri DEFAULT_NOTIFICATION_URI = getUriFor(NOTIFICATION_SOUND);
2562
2563 /**
Patrick Scott3156bb002009-04-13 09:57:38 -07002564 * Persistent store for the system-wide default alarm alert.
2565 *
2566 * @see #RINGTONE
2567 * @see #DEFAULT_ALARM_ALERT_URI
2568 */
2569 public static final String ALARM_ALERT = "alarm_alert";
2570
Svetoslav683914b2015-01-15 14:22:26 -08002571 private static final Validator ALARM_ALERT_VALIDATOR = sUriValidator;
2572
Patrick Scott3156bb002009-04-13 09:57:38 -07002573 /**
2574 * A {@link Uri} that will point to the current default alarm alert at
2575 * any given time.
2576 *
2577 * @see #DEFAULT_ALARM_ALERT_URI
2578 */
2579 public static final Uri DEFAULT_ALARM_ALERT_URI = getUriFor(ALARM_ALERT);
2580
2581 /**
Jean-Michel Trivid589fea2011-04-15 11:28:10 -07002582 * Persistent store for the system default media button event receiver.
2583 *
2584 * @hide
2585 */
2586 public static final String MEDIA_BUTTON_RECEIVER = "media_button_receiver";
2587
Svetoslav683914b2015-01-15 14:22:26 -08002588 private static final Validator MEDIA_BUTTON_RECEIVER_VALIDATOR = new Validator() {
2589 @Override
2590 public boolean validate(String value) {
2591 try {
2592 ComponentName.unflattenFromString(value);
2593 return true;
2594 } catch (NullPointerException e) {
2595 return false;
2596 }
2597 }
2598 };
2599
Jean-Michel Trivid589fea2011-04-15 11:28:10 -07002600 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002601 * Setting to enable Auto Replace (AutoText) in text editors. 1 = On, 0 = Off
2602 */
2603 public static final String TEXT_AUTO_REPLACE = "auto_replace";
2604
Svetoslav683914b2015-01-15 14:22:26 -08002605 private static final Validator TEXT_AUTO_REPLACE_VALIDATOR = sBooleanValidator;
2606
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002607 /**
2608 * Setting to enable Auto Caps in text editors. 1 = On, 0 = Off
2609 */
2610 public static final String TEXT_AUTO_CAPS = "auto_caps";
2611
Svetoslav683914b2015-01-15 14:22:26 -08002612 private static final Validator TEXT_AUTO_CAPS_VALIDATOR = sBooleanValidator;
2613
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002614 /**
2615 * Setting to enable Auto Punctuate in text editors. 1 = On, 0 = Off. This
2616 * feature converts two spaces to a "." and space.
2617 */
2618 public static final String TEXT_AUTO_PUNCTUATE = "auto_punctuate";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002619
Svetoslav683914b2015-01-15 14:22:26 -08002620 private static final Validator TEXT_AUTO_PUNCTUATE_VALIDATOR = sBooleanValidator;
2621
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002622 /**
2623 * Setting to showing password characters in text editors. 1 = On, 0 = Off
2624 */
2625 public static final String TEXT_SHOW_PASSWORD = "show_password";
2626
Svetoslav683914b2015-01-15 14:22:26 -08002627 private static final Validator TEXT_SHOW_PASSWORD_VALIDATOR = sBooleanValidator;
2628
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002629 public static final String SHOW_GTALK_SERVICE_STATUS =
2630 "SHOW_GTALK_SERVICE_STATUS";
2631
Svetoslav683914b2015-01-15 14:22:26 -08002632 private static final Validator SHOW_GTALK_SERVICE_STATUS_VALIDATOR = sBooleanValidator;
2633
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002634 /**
2635 * Name of activity to use for wallpaper on the home screen.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002636 *
2637 * @deprecated Use {@link WallpaperManager} instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002638 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002639 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002640 public static final String WALLPAPER_ACTIVITY = "wallpaper_activity";
2641
Svetoslav683914b2015-01-15 14:22:26 -08002642 private static final Validator WALLPAPER_ACTIVITY_VALIDATOR = new Validator() {
2643 private static final int MAX_LENGTH = 1000;
2644
2645 @Override
2646 public boolean validate(String value) {
2647 if (value != null && value.length() > MAX_LENGTH) {
2648 return false;
2649 }
2650 return ComponentName.unflattenFromString(value) != null;
2651 }
2652 };
2653
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002654 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002655 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME}
2656 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002657 */
Christopher Tate06efb532012-08-24 15:29:27 -07002658 @Deprecated
2659 public static final String AUTO_TIME = Global.AUTO_TIME;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002660
2661 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002662 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME_ZONE}
2663 * instead
Amith Yamasaniad450be2010-09-16 16:47:00 -07002664 */
Christopher Tate06efb532012-08-24 15:29:27 -07002665 @Deprecated
2666 public static final String AUTO_TIME_ZONE = Global.AUTO_TIME_ZONE;
Amith Yamasaniad450be2010-09-16 16:47:00 -07002667
2668 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002669 * Display times as 12 or 24 hours
2670 * 12
2671 * 24
2672 */
2673 public static final String TIME_12_24 = "time_12_24";
2674
Svetoslav683914b2015-01-15 14:22:26 -08002675 /** @hide */
2676 public static final Validator TIME_12_24_VALIDATOR =
2677 new DiscreteValueValidator(new String[] {"12", "24"});
2678
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002679 /**
2680 * Date format string
2681 * mm/dd/yyyy
2682 * dd/mm/yyyy
2683 * yyyy/mm/dd
2684 */
2685 public static final String DATE_FORMAT = "date_format";
2686
Svetoslav683914b2015-01-15 14:22:26 -08002687 /** @hide */
2688 public static final Validator DATE_FORMAT_VALIDATOR = new Validator() {
2689 @Override
2690 public boolean validate(String value) {
2691 try {
2692 new SimpleDateFormat(value);
2693 return true;
2694 } catch (IllegalArgumentException e) {
2695 return false;
2696 }
2697 }
2698 };
2699
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002700 /**
2701 * Whether the setup wizard has been run before (on first boot), or if
2702 * it still needs to be run.
2703 *
2704 * nonzero = it has been run in the past
2705 * 0 = it has not been run in the past
2706 */
2707 public static final String SETUP_WIZARD_HAS_RUN = "setup_wizard_has_run";
2708
Svetoslav683914b2015-01-15 14:22:26 -08002709 /** @hide */
2710 public static final Validator SETUP_WIZARD_HAS_RUN_VALIDATOR = sBooleanValidator;
2711
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002712 /**
2713 * Scaling factor for normal window animations. Setting to 0 will disable window
2714 * animations.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002715 *
2716 * @deprecated Use {@link Global#WINDOW_ANIMATION_SCALE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002717 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002718 @Deprecated
2719 public static final String WINDOW_ANIMATION_SCALE = Global.WINDOW_ANIMATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002720
2721 /**
2722 * Scaling factor for activity transition animations. Setting to 0 will disable window
2723 * animations.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002724 *
2725 * @deprecated Use {@link Global#TRANSITION_ANIMATION_SCALE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002726 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002727 @Deprecated
2728 public static final String TRANSITION_ANIMATION_SCALE = Global.TRANSITION_ANIMATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002729
2730 /**
Chet Haasec38fa1f2012-02-01 16:37:46 -08002731 * Scaling factor for Animator-based animations. This affects both the start delay and
2732 * duration of all such animations. Setting to 0 will cause animations to end immediately.
2733 * The default value is 1.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002734 *
2735 * @deprecated Use {@link Global#ANIMATOR_DURATION_SCALE} instead
Chet Haasec38fa1f2012-02-01 16:37:46 -08002736 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002737 @Deprecated
2738 public static final String ANIMATOR_DURATION_SCALE = Global.ANIMATOR_DURATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002739
2740 /**
2741 * Control whether the accelerometer will be used to change screen
2742 * orientation. If 0, it will not be used unless explicitly requested
2743 * by the application; if 1, it will be used by default unless explicitly
2744 * disabled by the application.
2745 */
2746 public static final String ACCELEROMETER_ROTATION = "accelerometer_rotation";
2747
Svetoslav683914b2015-01-15 14:22:26 -08002748 /** @hide */
2749 public static final Validator ACCELEROMETER_ROTATION_VALIDATOR = sBooleanValidator;
2750
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002751 /**
Daniel Sandlerb73617d2010-08-17 00:41:00 -04002752 * Default screen rotation when no other policy applies.
2753 * When {@link #ACCELEROMETER_ROTATION} is zero and no on-screen Activity expresses a
2754 * preference, this rotation value will be used. Must be one of the
Brian Muramatsue1d46982010-12-06 17:34:20 -08002755 * {@link android.view.Surface#ROTATION_0 Surface rotation constants}.
Daniel Sandlerb73617d2010-08-17 00:41:00 -04002756 *
Dianne Hackborn16ec0802014-08-15 18:32:33 -07002757 * @see android.view.Display#getRotation
Daniel Sandlerb73617d2010-08-17 00:41:00 -04002758 */
2759 public static final String USER_ROTATION = "user_rotation";
2760
Svetoslav683914b2015-01-15 14:22:26 -08002761 /** @hide */
2762 public static final Validator USER_ROTATION_VALIDATOR =
2763 new InclusiveIntegerRangeValidator(0, 3);
2764
Daniel Sandlerb73617d2010-08-17 00:41:00 -04002765 /**
Jeff Brown207673cd2012-06-05 17:47:11 -07002766 * Control whether the rotation lock toggle in the System UI should be hidden.
2767 * Typically this is done for accessibility purposes to make it harder for
2768 * the user to accidentally toggle the rotation lock while the display rotation
2769 * has been locked for accessibility.
2770 *
2771 * If 0, then rotation lock toggle is not hidden for accessibility (although it may be
2772 * unavailable for other reasons). If 1, then the rotation lock toggle is hidden.
2773 *
2774 * @hide
2775 */
2776 public static final String HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY =
2777 "hide_rotation_lock_toggle_for_accessibility";
2778
Svetoslav683914b2015-01-15 14:22:26 -08002779 /** @hide */
2780 public static final Validator HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR =
2781 sBooleanValidator;
2782
Jeff Brown207673cd2012-06-05 17:47:11 -07002783 /**
Daisuke Miyakawa3c60eeb2012-05-08 12:08:25 -07002784 * Whether the phone vibrates when it is ringing due to an incoming call. This will
2785 * be used by Phone and Setting apps; it shouldn't affect other apps.
2786 * The value is boolean (1 or 0).
2787 *
2788 * Note: this is not same as "vibrate on ring", which had been available until ICS.
2789 * It was about AudioManager's setting and thus affected all the applications which
2790 * relied on the setting, while this is purely about the vibration setting for incoming
2791 * calls.
Daisuke Miyakawa3c60eeb2012-05-08 12:08:25 -07002792 */
2793 public static final String VIBRATE_WHEN_RINGING = "vibrate_when_ringing";
2794
Svetoslav683914b2015-01-15 14:22:26 -08002795 /** @hide */
2796 public static final Validator VIBRATE_WHEN_RINGING_VALIDATOR = sBooleanValidator;
2797
Daisuke Miyakawa3c60eeb2012-05-08 12:08:25 -07002798 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002799 * Whether the audible DTMF tones are played by the dialer when dialing. The value is
2800 * boolean (1 or 0).
2801 */
2802 public static final String DTMF_TONE_WHEN_DIALING = "dtmf_tone";
2803
Svetoslav683914b2015-01-15 14:22:26 -08002804 /** @hide */
2805 public static final Validator DTMF_TONE_WHEN_DIALING_VALIDATOR = sBooleanValidator;
2806
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002807 /**
David Kraused0f67152009-06-13 18:01:13 -05002808 * CDMA only settings
2809 * DTMF tone type played by the dialer when dialing.
2810 * 0 = Normal
2811 * 1 = Long
David Kraused0f67152009-06-13 18:01:13 -05002812 */
2813 public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type";
2814
Svetoslav683914b2015-01-15 14:22:26 -08002815 /** @hide */
2816 public static final Validator DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR = sBooleanValidator;
2817
David Kraused0f67152009-06-13 18:01:13 -05002818 /**
David Kraused0f67152009-06-13 18:01:13 -05002819 * Whether the hearing aid is enabled. The value is
2820 * boolean (1 or 0).
2821 * @hide
2822 */
2823 public static final String HEARING_AID = "hearing_aid";
2824
Svetoslav683914b2015-01-15 14:22:26 -08002825 /** @hide */
2826 public static final Validator HEARING_AID_VALIDATOR = sBooleanValidator;
2827
David Kraused0f67152009-06-13 18:01:13 -05002828 /**
2829 * CDMA only settings
2830 * TTY Mode
2831 * 0 = OFF
2832 * 1 = FULL
2833 * 2 = VCO
2834 * 3 = HCO
2835 * @hide
2836 */
2837 public static final String TTY_MODE = "tty_mode";
2838
Svetoslav683914b2015-01-15 14:22:26 -08002839 /** @hide */
2840 public static final Validator TTY_MODE_VALIDATOR = new InclusiveIntegerRangeValidator(0, 3);
2841
David Kraused0f67152009-06-13 18:01:13 -05002842 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002843 * Whether the sounds effects (key clicks, lid open ...) are enabled. The value is
2844 * boolean (1 or 0).
2845 */
2846 public static final String SOUND_EFFECTS_ENABLED = "sound_effects_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002847
Svetoslav683914b2015-01-15 14:22:26 -08002848 /** @hide */
2849 public static final Validator SOUND_EFFECTS_ENABLED_VALIDATOR = sBooleanValidator;
2850
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002851 /**
2852 * Whether the haptic feedback (long presses, ...) are enabled. The value is
2853 * boolean (1 or 0).
2854 */
2855 public static final String HAPTIC_FEEDBACK_ENABLED = "haptic_feedback_enabled";
Sanjay Jeyakumar21bf2412009-07-09 13:31:48 -07002856
Svetoslav683914b2015-01-15 14:22:26 -08002857 /** @hide */
2858 public static final Validator HAPTIC_FEEDBACK_ENABLED_VALIDATOR = sBooleanValidator;
2859
Mike LeBeau48603e72009-06-05 00:27:00 +01002860 /**
Bjorn Bringert24abb662010-09-21 12:21:18 +01002861 * @deprecated Each application that shows web suggestions should have its own
2862 * setting for this.
Mike LeBeau48603e72009-06-05 00:27:00 +01002863 */
Bjorn Bringert24abb662010-09-21 12:21:18 +01002864 @Deprecated
Mike LeBeau48603e72009-06-05 00:27:00 +01002865 public static final String SHOW_WEB_SUGGESTIONS = "show_web_suggestions";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002866
Svetoslav683914b2015-01-15 14:22:26 -08002867 /** @hide */
2868 public static final Validator SHOW_WEB_SUGGESTIONS_VALIDATOR = sBooleanValidator;
2869
-b master501eec92009-07-06 13:53:11 -07002870 /**
Amith Yamasaniae3ed702009-12-01 19:02:05 -08002871 * Whether the notification LED should repeatedly flash when a notification is
2872 * pending. The value is boolean (1 or 0).
2873 * @hide
2874 */
2875 public static final String NOTIFICATION_LIGHT_PULSE = "notification_light_pulse";
2876
Svetoslav683914b2015-01-15 14:22:26 -08002877 /** @hide */
2878 public static final Validator NOTIFICATION_LIGHT_PULSE_VALIDATOR = sBooleanValidator;
2879
Amith Yamasaniae3ed702009-12-01 19:02:05 -08002880 /**
Dianne Hackborn90d2db32010-02-11 22:19:06 -08002881 * Show pointer location on screen?
2882 * 0 = no
2883 * 1 = yes
2884 * @hide
2885 */
2886 public static final String POINTER_LOCATION = "pointer_location";
2887
Svetoslav683914b2015-01-15 14:22:26 -08002888 /** @hide */
2889 public static final Validator POINTER_LOCATION_VALIDATOR = sBooleanValidator;
2890
Dianne Hackborn90d2db32010-02-11 22:19:06 -08002891 /**
Jeff Browndaf4a122011-08-26 17:14:14 -07002892 * Show touch positions on screen?
2893 * 0 = no
2894 * 1 = yes
2895 * @hide
2896 */
2897 public static final String SHOW_TOUCHES = "show_touches";
2898
Svetoslav683914b2015-01-15 14:22:26 -08002899 /** @hide */
2900 public static final Validator SHOW_TOUCHES_VALIDATOR = sBooleanValidator;
2901
Jeff Browndaf4a122011-08-26 17:14:14 -07002902 /**
Dianne Hackborn16ec0802014-08-15 18:32:33 -07002903 * Log raw orientation data from
Jorim Jaggib10e33f2015-02-04 21:57:40 +01002904 * {@link com.android.server.policy.WindowOrientationListener} for use with the
Jeff Brown4519f072011-01-23 13:16:01 -08002905 * orientationplot.py tool.
2906 * 0 = no
2907 * 1 = yes
2908 * @hide
2909 */
2910 public static final String WINDOW_ORIENTATION_LISTENER_LOG =
2911 "window_orientation_listener_log";
2912
Svetoslav683914b2015-01-15 14:22:26 -08002913 /** @hide */
2914 public static final Validator WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR = sBooleanValidator;
2915
Jeff Brown4519f072011-01-23 13:16:01 -08002916 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002917 * @deprecated Use {@link android.provider.Settings.Global#POWER_SOUNDS_ENABLED}
2918 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002919 * @hide
2920 */
Christopher Tate06efb532012-08-24 15:29:27 -07002921 @Deprecated
2922 public static final String POWER_SOUNDS_ENABLED = Global.POWER_SOUNDS_ENABLED;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002923
2924 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002925 * @deprecated Use {@link android.provider.Settings.Global#DOCK_SOUNDS_ENABLED}
2926 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002927 * @hide
2928 */
Christopher Tate06efb532012-08-24 15:29:27 -07002929 @Deprecated
2930 public static final String DOCK_SOUNDS_ENABLED = Global.DOCK_SOUNDS_ENABLED;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002931
2932 /**
2933 * Whether to play sounds when the keyguard is shown and dismissed.
2934 * @hide
2935 */
2936 public static final String LOCKSCREEN_SOUNDS_ENABLED = "lockscreen_sounds_enabled";
2937
Svetoslav683914b2015-01-15 14:22:26 -08002938 /** @hide */
2939 public static final Validator LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR = sBooleanValidator;
2940
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002941 /**
Mike Lockwood7bef7392011-10-20 16:51:53 -04002942 * Whether the lockscreen should be completely disabled.
2943 * @hide
2944 */
2945 public static final String LOCKSCREEN_DISABLED = "lockscreen.disabled";
2946
Svetoslav683914b2015-01-15 14:22:26 -08002947 /** @hide */
2948 public static final Validator LOCKSCREEN_DISABLED_VALIDATOR = sBooleanValidator;
2949
Mike Lockwood7bef7392011-10-20 16:51:53 -04002950 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002951 * @deprecated Use {@link android.provider.Settings.Global#LOW_BATTERY_SOUND}
2952 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002953 * @hide
2954 */
Christopher Tate06efb532012-08-24 15:29:27 -07002955 @Deprecated
2956 public static final String LOW_BATTERY_SOUND = Global.LOW_BATTERY_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002957
2958 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002959 * @deprecated Use {@link android.provider.Settings.Global#DESK_DOCK_SOUND}
2960 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002961 * @hide
2962 */
Christopher Tate06efb532012-08-24 15:29:27 -07002963 @Deprecated
2964 public static final String DESK_DOCK_SOUND = Global.DESK_DOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002965
2966 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002967 * @deprecated Use {@link android.provider.Settings.Global#DESK_UNDOCK_SOUND}
2968 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002969 * @hide
2970 */
Christopher Tate06efb532012-08-24 15:29:27 -07002971 @Deprecated
2972 public static final String DESK_UNDOCK_SOUND = Global.DESK_UNDOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002973
2974 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002975 * @deprecated Use {@link android.provider.Settings.Global#CAR_DOCK_SOUND}
2976 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002977 * @hide
2978 */
Christopher Tate06efb532012-08-24 15:29:27 -07002979 @Deprecated
2980 public static final String CAR_DOCK_SOUND = Global.CAR_DOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002981
2982 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002983 * @deprecated Use {@link android.provider.Settings.Global#CAR_UNDOCK_SOUND}
2984 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002985 * @hide
2986 */
Christopher Tate06efb532012-08-24 15:29:27 -07002987 @Deprecated
2988 public static final String CAR_UNDOCK_SOUND = Global.CAR_UNDOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002989
2990 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002991 * @deprecated Use {@link android.provider.Settings.Global#LOCK_SOUND}
2992 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002993 * @hide
2994 */
Christopher Tate06efb532012-08-24 15:29:27 -07002995 @Deprecated
2996 public static final String LOCK_SOUND = Global.LOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002997
2998 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002999 * @deprecated Use {@link android.provider.Settings.Global#UNLOCK_SOUND}
3000 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003001 * @hide
3002 */
Christopher Tate06efb532012-08-24 15:29:27 -07003003 @Deprecated
3004 public static final String UNLOCK_SOUND = Global.UNLOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003005
3006 /**
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003007 * Receive incoming SIP calls?
3008 * 0 = no
3009 * 1 = yes
3010 * @hide
3011 */
3012 public static final String SIP_RECEIVE_CALLS = "sip_receive_calls";
3013
Svetoslav683914b2015-01-15 14:22:26 -08003014 /** @hide */
3015 public static final Validator SIP_RECEIVE_CALLS_VALIDATOR = sBooleanValidator;
3016
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003017 /**
3018 * Call Preference String.
3019 * "SIP_ALWAYS" : Always use SIP with network access
3020 * "SIP_ADDRESS_ONLY" : Only if destination is a SIP address
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003021 * @hide
3022 */
3023 public static final String SIP_CALL_OPTIONS = "sip_call_options";
3024
Svetoslav683914b2015-01-15 14:22:26 -08003025 /** @hide */
3026 public static final Validator SIP_CALL_OPTIONS_VALIDATOR = new DiscreteValueValidator(
3027 new String[] {"SIP_ALWAYS", "SIP_ADDRESS_ONLY"});
3028
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003029 /**
3030 * One of the sip call options: Always use SIP with network access.
3031 * @hide
3032 */
3033 public static final String SIP_ALWAYS = "SIP_ALWAYS";
3034
Svetoslav683914b2015-01-15 14:22:26 -08003035 /** @hide */
3036 public static final Validator SIP_ALWAYS_VALIDATOR = sBooleanValidator;
3037
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003038 /**
3039 * One of the sip call options: Only if destination is a SIP address.
3040 * @hide
3041 */
3042 public static final String SIP_ADDRESS_ONLY = "SIP_ADDRESS_ONLY";
3043
Svetoslav683914b2015-01-15 14:22:26 -08003044 /** @hide */
3045 public static final Validator SIP_ADDRESS_ONLY_VALIDATOR = sBooleanValidator;
3046
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003047 /**
Tyler Gunn2c830a22014-09-02 08:39:35 -07003048 * @deprecated Use SIP_ALWAYS or SIP_ADDRESS_ONLY instead. Formerly used to indicate that
3049 * the user should be prompted each time a call is made whether it should be placed using
3050 * SIP. The {@link com.android.providers.settings.DatabaseHelper} replaces this with
3051 * SIP_ADDRESS_ONLY.
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003052 * @hide
3053 */
Tyler Gunn2c830a22014-09-02 08:39:35 -07003054 @Deprecated
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003055 public static final String SIP_ASK_ME_EACH_TIME = "SIP_ASK_ME_EACH_TIME";
3056
Svetoslav683914b2015-01-15 14:22:26 -08003057 /** @hide */
3058 public static final Validator SIP_ASK_ME_EACH_TIME_VALIDATOR = sBooleanValidator;
3059
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003060 /**
Jeff Brown1a84fd12011-06-02 01:26:32 -07003061 * Pointer speed setting.
3062 * This is an integer value in a range between -7 and +7, so there are 15 possible values.
3063 * -7 = slowest
3064 * 0 = default speed
3065 * +7 = fastest
3066 * @hide
3067 */
3068 public static final String POINTER_SPEED = "pointer_speed";
3069
Svetoslav683914b2015-01-15 14:22:26 -08003070 /** @hide */
3071 public static final Validator POINTER_SPEED_VALIDATOR =
3072 new InclusiveFloatRangeValidator(-7, 7);
3073
Jeff Brown1a84fd12011-06-02 01:26:32 -07003074 /**
Jason Monk56e09b42014-07-18 10:29:14 -04003075 * Whether lock-to-app will be triggered by long-press on recents.
3076 * @hide
3077 */
3078 public static final String LOCK_TO_APP_ENABLED = "lock_to_app_enabled";
3079
Svetoslav683914b2015-01-15 14:22:26 -08003080 /** @hide */
3081 public static final Validator LOCK_TO_APP_ENABLED_VALIDATOR = sBooleanValidator;
3082
Jason Monk56e09b42014-07-18 10:29:14 -04003083 /**
Daniel Sandler2fdb68b2013-10-03 00:12:11 -04003084 * I am the lolrus.
3085 * <p>
3086 * Nonzero values indicate that the user has a bukkit.
3087 * Backward-compatible with <code>PrefGetPreference(prefAllowEasterEggs)</code>.
3088 * @hide
3089 */
3090 public static final String EGG_MODE = "egg_mode";
3091
Svetoslav683914b2015-01-15 14:22:26 -08003092 /** @hide */
3093 public static final Validator EGG_MODE_VALIDATOR = sBooleanValidator;
3094
3095 /**
3096 * IMPORTANT: If you add a new public settings you also have to add it to
3097 * PUBLIC_SETTINGS below. If the new setting is hidden you have to add
3098 * it to PRIVATE_SETTINGS below. Also add a validator that can validate
3099 * the setting value. See an example above.
3100 */
3101
Daniel Sandler2fdb68b2013-10-03 00:12:11 -04003102 /**
-b master501eec92009-07-06 13:53:11 -07003103 * Settings to backup. This is here so that it's in the same place as the settings
3104 * keys and easy to update.
Svetoslav Ganova571a582011-09-20 18:32:20 -07003105 *
3106 * NOTE: Settings are backed up and restored in the order they appear
3107 * in this array. If you have one setting depending on another,
3108 * make sure that they are ordered appropriately.
3109 *
-b master501eec92009-07-06 13:53:11 -07003110 * @hide
3111 */
3112 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate66488d62012-10-02 11:58:01 -07003113 STAY_ON_WHILE_PLUGGED_IN, // moved to global
-b master501eec92009-07-06 13:53:11 -07003114 WIFI_USE_STATIC_IP,
3115 WIFI_STATIC_IP,
3116 WIFI_STATIC_GATEWAY,
3117 WIFI_STATIC_NETMASK,
3118 WIFI_STATIC_DNS1,
3119 WIFI_STATIC_DNS2,
3120 BLUETOOTH_DISCOVERABILITY,
3121 BLUETOOTH_DISCOVERABILITY_TIMEOUT,
3122 DIM_SCREEN,
3123 SCREEN_OFF_TIMEOUT,
3124 SCREEN_BRIGHTNESS,
Christopher Tate362aca62009-09-25 15:58:03 -07003125 SCREEN_BRIGHTNESS_MODE,
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08003126 SCREEN_AUTO_BRIGHTNESS_ADJ,
Jeff Brown7f6c2312012-04-13 20:38:38 -07003127 VIBRATE_INPUT_DEVICES,
Amith Yamasani8823c0a82009-07-07 14:30:17 -07003128 MODE_RINGER_STREAMS_AFFECTED,
-b master501eec92009-07-06 13:53:11 -07003129 TEXT_AUTO_REPLACE,
3130 TEXT_AUTO_CAPS,
3131 TEXT_AUTO_PUNCTUATE,
3132 TEXT_SHOW_PASSWORD,
Christopher Tate66488d62012-10-02 11:58:01 -07003133 AUTO_TIME, // moved to global
3134 AUTO_TIME_ZONE, // moved to global
-b master501eec92009-07-06 13:53:11 -07003135 TIME_12_24,
3136 DATE_FORMAT,
-b master501eec92009-07-06 13:53:11 -07003137 DTMF_TONE_WHEN_DIALING,
3138 DTMF_TONE_TYPE_WHEN_DIALING,
-b master501eec92009-07-06 13:53:11 -07003139 HEARING_AID,
3140 TTY_MODE,
3141 SOUND_EFFECTS_ENABLED,
3142 HAPTIC_FEEDBACK_ENABLED,
Christopher Tate66488d62012-10-02 11:58:01 -07003143 POWER_SOUNDS_ENABLED, // moved to global
3144 DOCK_SOUNDS_ENABLED, // moved to global
Christopher Tate14c2d792010-02-25 16:49:44 -08003145 LOCKSCREEN_SOUNDS_ENABLED,
Amith Yamasaniae3ed702009-12-01 19:02:05 -08003146 SHOW_WEB_SUGGESTIONS,
Mike Lockwoodeabe8bf2010-08-31 14:35:23 -04003147 NOTIFICATION_LIGHT_PULSE,
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003148 SIP_CALL_OPTIONS,
Nick Pelly038cabe2010-09-23 16:12:11 -07003149 SIP_RECEIVE_CALLS,
Jeff Brown1a84fd12011-06-02 01:26:32 -07003150 POINTER_SPEED,
Amith Yamasani622bf2222013-09-06 13:54:28 -07003151 VIBRATE_WHEN_RINGING,
3152 RINGTONE,
Jason Monk94cfd9d2014-10-31 13:18:21 -04003153 LOCK_TO_APP_ENABLED,
Amith Yamasani622bf2222013-09-06 13:54:28 -07003154 NOTIFICATION_SOUND
-b master501eec92009-07-06 13:53:11 -07003155 };
3156
Sailesh Nepal1bd78762014-02-11 22:32:21 -08003157 /**
Amith Yamasanib0ff3222015-03-04 09:56:14 -08003158 * These are all public system settings
Svetoslav683914b2015-01-15 14:22:26 -08003159 *
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07003160 * @hide
3161 */
Svetoslav683914b2015-01-15 14:22:26 -08003162 public static final Set<String> PUBLIC_SETTINGS = new ArraySet<>();
3163 static {
3164 PUBLIC_SETTINGS.add(END_BUTTON_BEHAVIOR);
3165 PUBLIC_SETTINGS.add(WIFI_USE_STATIC_IP);
3166 PUBLIC_SETTINGS.add(WIFI_STATIC_IP);
3167 PUBLIC_SETTINGS.add(WIFI_STATIC_GATEWAY);
3168 PUBLIC_SETTINGS.add(WIFI_STATIC_NETMASK);
3169 PUBLIC_SETTINGS.add(WIFI_STATIC_DNS1);
3170 PUBLIC_SETTINGS.add(WIFI_STATIC_DNS2);
3171 PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY);
3172 PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY_TIMEOUT);
3173 PUBLIC_SETTINGS.add(NEXT_ALARM_FORMATTED);
3174 PUBLIC_SETTINGS.add(FONT_SCALE);
3175 PUBLIC_SETTINGS.add(DIM_SCREEN);
3176 PUBLIC_SETTINGS.add(SCREEN_OFF_TIMEOUT);
3177 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS);
3178 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_MODE);
3179 PUBLIC_SETTINGS.add(MODE_RINGER_STREAMS_AFFECTED);
3180 PUBLIC_SETTINGS.add(MUTE_STREAMS_AFFECTED);
3181 PUBLIC_SETTINGS.add(VIBRATE_ON);
3182 PUBLIC_SETTINGS.add(VOLUME_RING);
3183 PUBLIC_SETTINGS.add(VOLUME_SYSTEM);
3184 PUBLIC_SETTINGS.add(VOLUME_VOICE);
3185 PUBLIC_SETTINGS.add(VOLUME_MUSIC);
3186 PUBLIC_SETTINGS.add(VOLUME_ALARM);
3187 PUBLIC_SETTINGS.add(VOLUME_NOTIFICATION);
3188 PUBLIC_SETTINGS.add(VOLUME_BLUETOOTH_SCO);
3189 PUBLIC_SETTINGS.add(RINGTONE);
3190 PUBLIC_SETTINGS.add(NOTIFICATION_SOUND);
3191 PUBLIC_SETTINGS.add(ALARM_ALERT);
3192 PUBLIC_SETTINGS.add(TEXT_AUTO_REPLACE);
3193 PUBLIC_SETTINGS.add(TEXT_AUTO_CAPS);
3194 PUBLIC_SETTINGS.add(TEXT_AUTO_PUNCTUATE);
3195 PUBLIC_SETTINGS.add(TEXT_SHOW_PASSWORD);
3196 PUBLIC_SETTINGS.add(SHOW_GTALK_SERVICE_STATUS);
3197 PUBLIC_SETTINGS.add(WALLPAPER_ACTIVITY);
3198 PUBLIC_SETTINGS.add(TIME_12_24);
3199 PUBLIC_SETTINGS.add(DATE_FORMAT);
3200 PUBLIC_SETTINGS.add(SETUP_WIZARD_HAS_RUN);
3201 PUBLIC_SETTINGS.add(ACCELEROMETER_ROTATION);
3202 PUBLIC_SETTINGS.add(USER_ROTATION);
3203 PUBLIC_SETTINGS.add(DTMF_TONE_WHEN_DIALING);
3204 PUBLIC_SETTINGS.add(SOUND_EFFECTS_ENABLED);
3205 PUBLIC_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED);
3206 PUBLIC_SETTINGS.add(SHOW_WEB_SUGGESTIONS);
3207 }
3208
3209 /**
3210 * These are all hidden system settings.
3211 *
3212 * @hide
3213 */
3214 public static final Set<String> PRIVATE_SETTINGS = new ArraySet<>();
3215 static {
3216 PRIVATE_SETTINGS.add(WIFI_USE_STATIC_IP);
3217 PRIVATE_SETTINGS.add(END_BUTTON_BEHAVIOR);
3218 PRIVATE_SETTINGS.add(ADVANCED_SETTINGS);
3219 PRIVATE_SETTINGS.add(SCREEN_AUTO_BRIGHTNESS_ADJ);
3220 PRIVATE_SETTINGS.add(VIBRATE_INPUT_DEVICES);
3221 PRIVATE_SETTINGS.add(VOLUME_MASTER);
3222 PRIVATE_SETTINGS.add(VOLUME_MASTER_MUTE);
3223 PRIVATE_SETTINGS.add(MICROPHONE_MUTE);
3224 PRIVATE_SETTINGS.add(NOTIFICATIONS_USE_RING_VOLUME);
3225 PRIVATE_SETTINGS.add(VIBRATE_IN_SILENT);
3226 PRIVATE_SETTINGS.add(MEDIA_BUTTON_RECEIVER);
3227 PRIVATE_SETTINGS.add(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY);
3228 PRIVATE_SETTINGS.add(VIBRATE_WHEN_RINGING);
3229 PRIVATE_SETTINGS.add(DTMF_TONE_TYPE_WHEN_DIALING);
3230 PRIVATE_SETTINGS.add(HEARING_AID);
3231 PRIVATE_SETTINGS.add(TTY_MODE);
3232 PRIVATE_SETTINGS.add(NOTIFICATION_LIGHT_PULSE);
3233 PRIVATE_SETTINGS.add(POINTER_LOCATION);
3234 PRIVATE_SETTINGS.add(SHOW_TOUCHES);
3235 PRIVATE_SETTINGS.add(WINDOW_ORIENTATION_LISTENER_LOG);
3236 PRIVATE_SETTINGS.add(POWER_SOUNDS_ENABLED);
3237 PRIVATE_SETTINGS.add(DOCK_SOUNDS_ENABLED);
3238 PRIVATE_SETTINGS.add(LOCKSCREEN_SOUNDS_ENABLED);
3239 PRIVATE_SETTINGS.add(LOCKSCREEN_DISABLED);
3240 PRIVATE_SETTINGS.add(LOW_BATTERY_SOUND);
3241 PRIVATE_SETTINGS.add(DESK_DOCK_SOUND);
3242 PRIVATE_SETTINGS.add(DESK_UNDOCK_SOUND);
3243 PRIVATE_SETTINGS.add(CAR_DOCK_SOUND);
3244 PRIVATE_SETTINGS.add(CAR_UNDOCK_SOUND);
3245 PRIVATE_SETTINGS.add(LOCK_SOUND);
3246 PRIVATE_SETTINGS.add(UNLOCK_SOUND);
3247 PRIVATE_SETTINGS.add(SIP_RECEIVE_CALLS);
3248 PRIVATE_SETTINGS.add(SIP_CALL_OPTIONS);
3249 PRIVATE_SETTINGS.add(SIP_ALWAYS);
3250 PRIVATE_SETTINGS.add(SIP_ADDRESS_ONLY);
3251 PRIVATE_SETTINGS.add(SIP_ASK_ME_EACH_TIME);
3252 PRIVATE_SETTINGS.add(POINTER_SPEED);
3253 PRIVATE_SETTINGS.add(LOCK_TO_APP_ENABLED);
3254 PRIVATE_SETTINGS.add(EGG_MODE);
3255 }
3256
3257 /**
Amith Yamasanib0ff3222015-03-04 09:56:14 -08003258 * These are all public system settings
Svetoslav683914b2015-01-15 14:22:26 -08003259 *
3260 * @hide
3261 */
3262 public static final Map<String, Validator> VALIDATORS = new ArrayMap<>();
3263 static {
3264 VALIDATORS.put(END_BUTTON_BEHAVIOR,END_BUTTON_BEHAVIOR_VALIDATOR);
3265 VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR);
3266 VALIDATORS.put(BLUETOOTH_DISCOVERABILITY, BLUETOOTH_DISCOVERABILITY_VALIDATOR);
3267 VALIDATORS.put(BLUETOOTH_DISCOVERABILITY_TIMEOUT,
3268 BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR);
3269 VALIDATORS.put(NEXT_ALARM_FORMATTED, NEXT_ALARM_FORMATTED_VALIDATOR);
3270 VALIDATORS.put(FONT_SCALE, FONT_SCALE_VALIDATOR);
3271 VALIDATORS.put(DIM_SCREEN, DIM_SCREEN_VALIDATOR);
3272 VALIDATORS.put(SCREEN_OFF_TIMEOUT, SCREEN_OFF_TIMEOUT_VALIDATOR);
3273 VALIDATORS.put(SCREEN_BRIGHTNESS, SCREEN_BRIGHTNESS_VALIDATOR);
3274 VALIDATORS.put(SCREEN_BRIGHTNESS_MODE, SCREEN_BRIGHTNESS_MODE_VALIDATOR);
3275 VALIDATORS.put(MODE_RINGER_STREAMS_AFFECTED, MODE_RINGER_STREAMS_AFFECTED_VALIDATOR);
3276 VALIDATORS.put(MUTE_STREAMS_AFFECTED, MUTE_STREAMS_AFFECTED_VALIDATOR);
3277 VALIDATORS.put(VIBRATE_ON, VIBRATE_ON_VALIDATOR);
Svetoslav683914b2015-01-15 14:22:26 -08003278 VALIDATORS.put(RINGTONE, RINGTONE_VALIDATOR);
3279 VALIDATORS.put(NOTIFICATION_SOUND, NOTIFICATION_SOUND_VALIDATOR);
3280 VALIDATORS.put(ALARM_ALERT, ALARM_ALERT_VALIDATOR);
3281 VALIDATORS.put(TEXT_AUTO_REPLACE, TEXT_AUTO_REPLACE_VALIDATOR);
3282 VALIDATORS.put(TEXT_AUTO_CAPS, TEXT_AUTO_CAPS_VALIDATOR);
3283 VALIDATORS.put(TEXT_AUTO_PUNCTUATE, TEXT_AUTO_PUNCTUATE_VALIDATOR);
3284 VALIDATORS.put(TEXT_SHOW_PASSWORD, TEXT_SHOW_PASSWORD_VALIDATOR);
3285 VALIDATORS.put(SHOW_GTALK_SERVICE_STATUS, SHOW_GTALK_SERVICE_STATUS_VALIDATOR);
3286 VALIDATORS.put(WALLPAPER_ACTIVITY, WALLPAPER_ACTIVITY_VALIDATOR);
3287 VALIDATORS.put(TIME_12_24, TIME_12_24_VALIDATOR);
3288 VALIDATORS.put(DATE_FORMAT, DATE_FORMAT_VALIDATOR);
3289 VALIDATORS.put(SETUP_WIZARD_HAS_RUN, SETUP_WIZARD_HAS_RUN_VALIDATOR);
3290 VALIDATORS.put(ACCELEROMETER_ROTATION, ACCELEROMETER_ROTATION_VALIDATOR);
3291 VALIDATORS.put(USER_ROTATION, USER_ROTATION_VALIDATOR);
3292 VALIDATORS.put(DTMF_TONE_WHEN_DIALING, DTMF_TONE_WHEN_DIALING_VALIDATOR);
3293 VALIDATORS.put(SOUND_EFFECTS_ENABLED, SOUND_EFFECTS_ENABLED_VALIDATOR);
3294 VALIDATORS.put(HAPTIC_FEEDBACK_ENABLED, HAPTIC_FEEDBACK_ENABLED_VALIDATOR);
3295 VALIDATORS.put(SHOW_WEB_SUGGESTIONS, SHOW_WEB_SUGGESTIONS_VALIDATOR);
3296 VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR);
3297 VALIDATORS.put(END_BUTTON_BEHAVIOR, END_BUTTON_BEHAVIOR_VALIDATOR);
3298 VALIDATORS.put(ADVANCED_SETTINGS, ADVANCED_SETTINGS_VALIDATOR);
3299 VALIDATORS.put(SCREEN_AUTO_BRIGHTNESS_ADJ, SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR);
3300 VALIDATORS.put(VIBRATE_INPUT_DEVICES, VIBRATE_INPUT_DEVICES_VALIDATOR);
Svetoslav683914b2015-01-15 14:22:26 -08003301 VALIDATORS.put(VOLUME_MASTER_MUTE, VOLUME_MASTER_MUTE_VALIDATOR);
3302 VALIDATORS.put(MICROPHONE_MUTE, MICROPHONE_MUTE_VALIDATOR);
3303 VALIDATORS.put(NOTIFICATIONS_USE_RING_VOLUME, NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR);
3304 VALIDATORS.put(VIBRATE_IN_SILENT, VIBRATE_IN_SILENT_VALIDATOR);
3305 VALIDATORS.put(MEDIA_BUTTON_RECEIVER, MEDIA_BUTTON_RECEIVER_VALIDATOR);
3306 VALIDATORS.put(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY,
3307 HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR);
3308 VALIDATORS.put(VIBRATE_WHEN_RINGING, VIBRATE_WHEN_RINGING_VALIDATOR);
3309 VALIDATORS.put(DTMF_TONE_TYPE_WHEN_DIALING, DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR);
3310 VALIDATORS.put(HEARING_AID, HEARING_AID_VALIDATOR);
3311 VALIDATORS.put(TTY_MODE, TTY_MODE_VALIDATOR);
3312 VALIDATORS.put(NOTIFICATION_LIGHT_PULSE, NOTIFICATION_LIGHT_PULSE_VALIDATOR);
3313 VALIDATORS.put(POINTER_LOCATION, POINTER_LOCATION_VALIDATOR);
3314 VALIDATORS.put(SHOW_TOUCHES, SHOW_TOUCHES_VALIDATOR);
3315 VALIDATORS.put(WINDOW_ORIENTATION_LISTENER_LOG,
3316 WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR);
3317 VALIDATORS.put(LOCKSCREEN_SOUNDS_ENABLED, LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR);
3318 VALIDATORS.put(LOCKSCREEN_DISABLED, LOCKSCREEN_DISABLED_VALIDATOR);
3319 VALIDATORS.put(SIP_RECEIVE_CALLS, SIP_RECEIVE_CALLS_VALIDATOR);
3320 VALIDATORS.put(SIP_CALL_OPTIONS, SIP_CALL_OPTIONS_VALIDATOR);
3321 VALIDATORS.put(SIP_ALWAYS, SIP_ALWAYS_VALIDATOR);
3322 VALIDATORS.put(SIP_ADDRESS_ONLY, SIP_ADDRESS_ONLY_VALIDATOR);
3323 VALIDATORS.put(SIP_ASK_ME_EACH_TIME, SIP_ASK_ME_EACH_TIME_VALIDATOR);
3324 VALIDATORS.put(POINTER_SPEED, POINTER_SPEED_VALIDATOR);
3325 VALIDATORS.put(LOCK_TO_APP_ENABLED, LOCK_TO_APP_ENABLED_VALIDATOR);
3326 VALIDATORS.put(EGG_MODE, EGG_MODE_VALIDATOR);
3327 VALIDATORS.put(WIFI_STATIC_IP, WIFI_STATIC_IP_VALIDATOR);
3328 VALIDATORS.put(WIFI_STATIC_GATEWAY, WIFI_STATIC_GATEWAY_VALIDATOR);
3329 VALIDATORS.put(WIFI_STATIC_NETMASK, WIFI_STATIC_NETMASK_VALIDATOR);
3330 VALIDATORS.put(WIFI_STATIC_DNS1, WIFI_STATIC_DNS1_VALIDATOR);
3331 VALIDATORS.put(WIFI_STATIC_DNS2, WIFI_STATIC_DNS2_VALIDATOR);
3332 }
3333
3334 /**
3335 * These entries are considered common between the personal and the managed profile,
3336 * since the managed profile doesn't get to change them.
3337 */
3338 private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>();
3339 static {
3340 CLONE_TO_MANAGED_PROFILE.add(DATE_FORMAT);
3341 CLONE_TO_MANAGED_PROFILE.add(HAPTIC_FEEDBACK_ENABLED);
3342 CLONE_TO_MANAGED_PROFILE.add(SOUND_EFFECTS_ENABLED);
3343 CLONE_TO_MANAGED_PROFILE.add(TEXT_SHOW_PASSWORD);
3344 CLONE_TO_MANAGED_PROFILE.add(TIME_12_24);
3345 }
3346
3347 /** @hide */
3348 public static void getCloneToManagedProfileSettings(Set<String> outKeySet) {
3349 outKeySet.addAll(CLONE_TO_MANAGED_PROFILE);
3350 }
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07003351
3352 /**
Sailesh Nepal1bd78762014-02-11 22:32:21 -08003353 * When to use Wi-Fi calling
3354 *
3355 * @see android.telephony.TelephonyManager.WifiCallingChoices
3356 * @hide
3357 */
3358 public static final String WHEN_TO_MAKE_WIFI_CALLS = "when_to_make_wifi_calls";
3359
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003360 // Settings moved to Settings.Secure
3361
3362 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003363 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003364 * instead
3365 */
3366 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003367 public static final String ADB_ENABLED = Global.ADB_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003368
3369 /**
3370 * @deprecated Use {@link android.provider.Settings.Secure#ANDROID_ID} instead
3371 */
3372 @Deprecated
3373 public static final String ANDROID_ID = Secure.ANDROID_ID;
3374
3375 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003376 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003377 */
3378 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003379 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003380
3381 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003382 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003383 */
3384 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003385 public static final String DATA_ROAMING = Global.DATA_ROAMING;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003386
3387 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003388 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003389 */
3390 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003391 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003392
3393 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07003394 * @deprecated Use {@link android.provider.Settings.Global#HTTP_PROXY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003395 */
3396 @Deprecated
Jeff Sharkey625239a2012-09-26 22:03:49 -07003397 public static final String HTTP_PROXY = Global.HTTP_PROXY;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003398
3399 /**
Christopher Tateaa036a22014-05-19 16:33:27 -07003400 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003401 */
3402 @Deprecated
Christopher Tateaa036a22014-05-19 16:33:27 -07003403 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003404
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003405 /**
3406 * @deprecated Use {@link android.provider.Settings.Secure#LOCATION_PROVIDERS_ALLOWED}
3407 * instead
3408 */
3409 @Deprecated
3410 public static final String LOCATION_PROVIDERS_ALLOWED = Secure.LOCATION_PROVIDERS_ALLOWED;
3411
3412 /**
3413 * @deprecated Use {@link android.provider.Settings.Secure#LOGGING_ID} instead
3414 */
3415 @Deprecated
3416 public static final String LOGGING_ID = Secure.LOGGING_ID;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003417
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003418 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003419 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003420 */
3421 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003422 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003423
3424 /**
3425 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_ENABLED}
3426 * instead
3427 */
3428 @Deprecated
3429 public static final String PARENTAL_CONTROL_ENABLED = Secure.PARENTAL_CONTROL_ENABLED;
3430
3431 /**
3432 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_LAST_UPDATE}
3433 * instead
3434 */
3435 @Deprecated
3436 public static final String PARENTAL_CONTROL_LAST_UPDATE = Secure.PARENTAL_CONTROL_LAST_UPDATE;
3437
3438 /**
3439 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_REDIRECT_URL}
3440 * instead
3441 */
3442 @Deprecated
3443 public static final String PARENTAL_CONTROL_REDIRECT_URL =
3444 Secure.PARENTAL_CONTROL_REDIRECT_URL;
3445
3446 /**
3447 * @deprecated Use {@link android.provider.Settings.Secure#SETTINGS_CLASSNAME} instead
3448 */
3449 @Deprecated
3450 public static final String SETTINGS_CLASSNAME = Secure.SETTINGS_CLASSNAME;
3451
3452 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003453 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003454 */
3455 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003456 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003457
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003458 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003459 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003460 */
3461 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003462 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003463
Dianne Hackborn4a51c202009-08-21 15:14:02 -07003464 /**
3465 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07003466 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
Dianne Hackborn4a51c202009-08-21 15:14:02 -07003467 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003468 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003469 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 -08003470
Dianne Hackborn4a51c202009-08-21 15:14:02 -07003471 /**
3472 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07003473 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
Dianne Hackborn4a51c202009-08-21 15:14:02 -07003474 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003475 @Deprecated
3476 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
Christopher Tate06efb532012-08-24 15:29:27 -07003477 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003478
3479 /**
3480 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07003481 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003482 */
3483 @Deprecated
3484 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
Christopher Tate06efb532012-08-24 15:29:27 -07003485 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003486
3487 /**
3488 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07003489 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003490 */
3491 @Deprecated
3492 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
Christopher Tate06efb532012-08-24 15:29:27 -07003493 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003494
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003495 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003496 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003497 * instead
3498 */
3499 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003500 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 -08003501
3502 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003503 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003504 */
3505 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003506 public static final String WIFI_ON = Global.WIFI_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003507
3508 /**
3509 * @deprecated Use
3510 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE}
3511 * instead
3512 */
3513 @Deprecated
3514 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
3515 Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE;
3516
3517 /**
3518 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_AP_COUNT} instead
3519 */
3520 @Deprecated
3521 public static final String WIFI_WATCHDOG_AP_COUNT = Secure.WIFI_WATCHDOG_AP_COUNT;
3522
3523 /**
3524 * @deprecated Use
3525 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS} instead
3526 */
3527 @Deprecated
3528 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
3529 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003530
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003531 /**
3532 * @deprecated Use
3533 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED} instead
3534 */
3535 @Deprecated
3536 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
3537 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED;
3538
3539 /**
3540 * @deprecated Use
3541 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS}
3542 * instead
3543 */
3544 @Deprecated
3545 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
3546 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS;
3547
3548 /**
3549 * @deprecated Use
3550 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT} instead
3551 */
3552 @Deprecated
3553 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
3554 Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT;
3555
3556 /**
3557 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_MAX_AP_CHECKS}
3558 * instead
3559 */
3560 @Deprecated
3561 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = Secure.WIFI_WATCHDOG_MAX_AP_CHECKS;
3562
3563 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003564 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003565 */
3566 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003567 public static final String WIFI_WATCHDOG_ON = Global.WIFI_WATCHDOG_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003568
3569 /**
3570 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_COUNT} instead
3571 */
3572 @Deprecated
3573 public static final String WIFI_WATCHDOG_PING_COUNT = Secure.WIFI_WATCHDOG_PING_COUNT;
3574
3575 /**
3576 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_DELAY_MS}
3577 * instead
3578 */
3579 @Deprecated
3580 public static final String WIFI_WATCHDOG_PING_DELAY_MS = Secure.WIFI_WATCHDOG_PING_DELAY_MS;
3581
3582 /**
3583 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_TIMEOUT_MS}
3584 * instead
3585 */
3586 @Deprecated
3587 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS =
3588 Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS;
3589 }
3590
3591 /**
3592 * Secure system settings, containing system preferences that applications
3593 * can read but are not allowed to write. These are for preferences that
3594 * the user must explicitly modify through the system UI or specialized
3595 * APIs for those values, not modified directly by applications.
3596 */
3597 public static final class Secure extends NameValueTable {
3598 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_secure_version";
3599
Dianne Hackborn139748f2012-09-24 11:36:57 -07003600 /**
3601 * The content:// style URL for this table
3602 */
3603 public static final Uri CONTENT_URI =
3604 Uri.parse("content://" + AUTHORITY + "/secure");
3605
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08003606 // Populated lazily, guarded by class object:
Dianne Hackborn139748f2012-09-24 11:36:57 -07003607 private static final NameValueCache sNameValueCache = new NameValueCache(
3608 SYS_PROP_SETTING_VERSION,
3609 CONTENT_URI,
3610 CALL_METHOD_GET_SECURE,
3611 CALL_METHOD_PUT_SECURE);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003612
Amith Yamasani52c489c2012-03-28 11:42:42 -07003613 private static ILockSettings sLockSettings = null;
3614
Amith Yamasani7ab8c4a2012-04-06 09:27:12 -07003615 private static boolean sIsSystemProcess;
Amith Yamasani52c489c2012-03-28 11:42:42 -07003616 private static final HashSet<String> MOVED_TO_LOCK_SETTINGS;
Christopher Tate06efb532012-08-24 15:29:27 -07003617 private static final HashSet<String> MOVED_TO_GLOBAL;
Amith Yamasani52c489c2012-03-28 11:42:42 -07003618 static {
3619 MOVED_TO_LOCK_SETTINGS = new HashSet<String>(3);
3620 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_ENABLED);
3621 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_VISIBLE);
3622 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
Christopher Tate06efb532012-08-24 15:29:27 -07003623
3624 MOVED_TO_GLOBAL = new HashSet<String>();
3625 MOVED_TO_GLOBAL.add(Settings.Global.ADB_ENABLED);
3626 MOVED_TO_GLOBAL.add(Settings.Global.ASSISTED_GPS_ENABLED);
3627 MOVED_TO_GLOBAL.add(Settings.Global.BLUETOOTH_ON);
Christopher Tate58f41ec2013-01-11 15:40:36 -08003628 MOVED_TO_GLOBAL.add(Settings.Global.BUGREPORT_IN_POWER_MENU);
Christopher Tate06efb532012-08-24 15:29:27 -07003629 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_CELL_BROADCAST_SMS);
3630 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_ROAMING_MODE);
3631 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_SUBSCRIPTION_MODE);
3632 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_MOBILE);
3633 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_WIFI);
3634 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ROAMING);
3635 MOVED_TO_GLOBAL.add(Settings.Global.DEVELOPMENT_SETTINGS_ENABLED);
3636 MOVED_TO_GLOBAL.add(Settings.Global.DEVICE_PROVISIONED);
3637 MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_DENSITY_FORCED);
3638 MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_SIZE_FORCED);
3639 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_MAX_BYTES_OVER_MOBILE);
3640 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE);
Christopher Tate06efb532012-08-24 15:29:27 -07003641 MOVED_TO_GLOBAL.add(Settings.Global.MOBILE_DATA);
3642 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_BUCKET_DURATION);
3643 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_DELETE_AGE);
3644 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_PERSIST_BYTES);
3645 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_ROTATE_AGE);
3646 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_ENABLED);
3647 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_GLOBAL_ALERT_BYTES);
3648 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_POLL_INTERVAL);
Christopher Tate06efb532012-08-24 15:29:27 -07003649 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_SAMPLE_ENABLED);
3650 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_TIME_CACHE_MAX_AGE);
3651 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_BUCKET_DURATION);
3652 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_DELETE_AGE);
3653 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_PERSIST_BYTES);
3654 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_ROTATE_AGE);
3655 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_BUCKET_DURATION);
3656 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_DELETE_AGE);
3657 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_PERSIST_BYTES);
3658 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_ROTATE_AGE);
3659 MOVED_TO_GLOBAL.add(Settings.Global.NETWORK_PREFERENCE);
3660 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_DIFF);
3661 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_SPACING);
3662 MOVED_TO_GLOBAL.add(Settings.Global.NTP_SERVER);
3663 MOVED_TO_GLOBAL.add(Settings.Global.NTP_TIMEOUT);
3664 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_ERROR_POLL_COUNT);
3665 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_LONG_POLL_INTERVAL_MS);
3666 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT);
3667 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_POLL_INTERVAL_MS);
3668 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_TRIGGER_PACKET_COUNT);
3669 MOVED_TO_GLOBAL.add(Settings.Global.SAMPLING_PROFILER_MS);
3670 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DATA_SERVICE_URL);
3671 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_REDIR_HOST);
3672 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_TARGET_URL);
3673 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_APN);
3674 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_REQUIRED);
3675 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_SUPPORTED);
Christopher Tate06efb532012-08-24 15:29:27 -07003676 MOVED_TO_GLOBAL.add(Settings.Global.USB_MASS_STORAGE_ENABLED);
3677 MOVED_TO_GLOBAL.add(Settings.Global.USE_GOOGLE_MAIL);
Robert Greenwalt3ea0c992013-10-03 21:13:49 +00003678 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_COUNTRY_CODE);
Christopher Tate06efb532012-08-24 15:29:27 -07003679 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FRAMEWORK_SCAN_INTERVAL_MS);
3680 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FREQUENCY_BAND);
3681 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_IDLE_MS);
3682 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MAX_DHCP_RETRY_COUNT);
3683 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS);
3684 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
3685 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
3686 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NUM_OPEN_NETWORKS_KEPT);
3687 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ON);
3688 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_P2P_DEVICE_NAME);
3689 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SAVED_STATE);
3690 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUPPLICANT_SCAN_INTERVAL_MS);
3691 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUSPEND_OPTIMIZATIONS_ENABLED);
vandwalle7c3606c2014-03-31 19:12:07 -07003692 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ENHANCED_AUTO_JOIN);
3693 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORK_SHOW_RSSI);
Christopher Tate06efb532012-08-24 15:29:27 -07003694 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_ON);
3695 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED);
Christopher Tate06efb532012-08-24 15:29:27 -07003696 MOVED_TO_GLOBAL.add(Settings.Global.WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON);
Christopher Tatec868b642012-09-12 17:41:04 -07003697 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_ENABLE);
3698 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_TIMEOUT);
3699 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_DEFAULT_RESPONSE);
3700 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS);
3701 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS);
3702 MOVED_TO_GLOBAL.add(Settings.Global.GPRS_REGISTER_CHECK_PERIOD_MS);
Christopher Tate06efb532012-08-24 15:29:27 -07003703 MOVED_TO_GLOBAL.add(Settings.Global.WTF_IS_FATAL);
Jeff Sharkey625239a2012-09-26 22:03:49 -07003704 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_DURATION_THRESHOLD);
3705 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_THRESHOLD);
3706 MOVED_TO_GLOBAL.add(Settings.Global.SEND_ACTION_APP_ERROR);
3707 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_AGE_SECONDS);
3708 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_MAX_FILES);
3709 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_KB);
3710 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_PERCENT);
3711 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_RESERVE_PERCENT);
3712 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_TAG_PREFIX);
3713 MOVED_TO_GLOBAL.add(Settings.Global.ERROR_LOGCAT_PREFIX);
3714 MOVED_TO_GLOBAL.add(Settings.Global.SYS_FREE_STORAGE_LOG_INTERVAL);
3715 MOVED_TO_GLOBAL.add(Settings.Global.DISK_FREE_CHANGE_REPORTING_THRESHOLD);
3716 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_PERCENTAGE);
3717 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_MAX_BYTES);
3718 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_FULL_THRESHOLD_BYTES);
3719 MOVED_TO_GLOBAL.add(Settings.Global.SYNC_MAX_RETRY_DELAY_IN_SECONDS);
3720 MOVED_TO_GLOBAL.add(Settings.Global.CONNECTIVITY_CHANGE_DELAY);
3721 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED);
3722 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_SERVER);
3723 MOVED_TO_GLOBAL.add(Settings.Global.NSD_ON);
3724 MOVED_TO_GLOBAL.add(Settings.Global.SET_INSTALL_LOCATION);
3725 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_INSTALL_LOCATION);
3726 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_UP_DELAY);
3727 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_DOWN_DELAY);
3728 MOVED_TO_GLOBAL.add(Settings.Global.READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT);
3729 MOVED_TO_GLOBAL.add(Settings.Global.HTTP_PROXY);
3730 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_HOST);
3731 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_PORT);
3732 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST);
3733 MOVED_TO_GLOBAL.add(Settings.Global.SET_GLOBAL_HTTP_PROXY);
3734 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_DNS_SERVER);
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003735 MOVED_TO_GLOBAL.add(Settings.Global.PREFERRED_NETWORK_MODE);
Hui Shu22671772014-10-01 21:41:07 +00003736 MOVED_TO_GLOBAL.add(Settings.Global.WEBVIEW_DATA_REDUCTION_PROXY_KEY);
Christopher Tate06efb532012-08-24 15:29:27 -07003737 }
3738
Christopher Tate66488d62012-10-02 11:58:01 -07003739 /** @hide */
Svetoslav683914b2015-01-15 14:22:26 -08003740 public static void getMovedToGlobalSettings(Set<String> outKeySet) {
Christopher Tate66488d62012-10-02 11:58:01 -07003741 outKeySet.addAll(MOVED_TO_GLOBAL);
3742 }
3743
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003744 /**
3745 * Look up a name in the database.
3746 * @param resolver to access the database with
3747 * @param name to look up in the table
3748 * @return the corresponding value, or null if not present
3749 */
Dianne Hackborn139748f2012-09-24 11:36:57 -07003750 public static String getString(ContentResolver resolver, String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07003751 return getStringForUser(resolver, name, UserHandle.myUserId());
3752 }
3753
3754 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -07003755 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -07003756 int userHandle) {
3757 if (MOVED_TO_GLOBAL.contains(name)) {
3758 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
3759 + " to android.provider.Settings.Global.");
3760 return Global.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003761 }
Amith Yamasani52c489c2012-03-28 11:42:42 -07003762
Dianne Hackborn139748f2012-09-24 11:36:57 -07003763 if (MOVED_TO_LOCK_SETTINGS.contains(name)) {
3764 synchronized (Secure.class) {
3765 if (sLockSettings == null) {
3766 sLockSettings = ILockSettings.Stub.asInterface(
3767 (IBinder) ServiceManager.getService("lock_settings"));
3768 sIsSystemProcess = Process.myUid() == Process.SYSTEM_UID;
3769 }
3770 }
3771 if (sLockSettings != null && !sIsSystemProcess) {
3772 try {
3773 return sLockSettings.getString(name, "0", userHandle);
3774 } catch (RemoteException re) {
3775 // Fall through
3776 }
Amith Yamasani52c489c2012-03-28 11:42:42 -07003777 }
3778 }
3779
Christopher Tate06efb532012-08-24 15:29:27 -07003780 return sNameValueCache.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003781 }
3782
3783 /**
3784 * Store a name/value pair into the database.
3785 * @param resolver to access the database with
3786 * @param name to store
3787 * @param value to associate with the name
3788 * @return true if the value was set, false on database errors
3789 */
Christopher Tate06efb532012-08-24 15:29:27 -07003790 public static boolean putString(ContentResolver resolver, String name, String value) {
3791 return putStringForUser(resolver, name, value, UserHandle.myUserId());
3792 }
3793
3794 /** @hide */
3795 public static boolean putStringForUser(ContentResolver resolver, String name, String value,
3796 int userHandle) {
Julia Reynolds82735bc2014-09-04 16:43:30 -04003797 if (LOCATION_MODE.equals(name)) {
3798 // HACK ALERT: temporary hack to work around b/10491283.
3799 // TODO: once b/10491283 fixed, remove this hack
3800 return setLocationModeForUser(resolver, Integer.parseInt(value), userHandle);
3801 }
Christopher Tate06efb532012-08-24 15:29:27 -07003802 if (MOVED_TO_GLOBAL.contains(name)) {
3803 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
3804 + " to android.provider.Settings.Global");
3805 return Global.putStringForUser(resolver, name, value, userHandle);
3806 }
Christopher Tate06efb532012-08-24 15:29:27 -07003807 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003808 }
3809
3810 /**
3811 * Construct the content URI for a particular name/value pair,
3812 * useful for monitoring changes with a ContentObserver.
3813 * @param name to look up in the table
3814 * @return the corresponding content URI, or null if not present
3815 */
3816 public static Uri getUriFor(String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07003817 if (MOVED_TO_GLOBAL.contains(name)) {
3818 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
3819 + " to android.provider.Settings.Global, returning global URI.");
3820 return Global.getUriFor(Global.CONTENT_URI, name);
3821 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003822 return getUriFor(CONTENT_URI, name);
3823 }
3824
3825 /**
3826 * Convenience function for retrieving a single secure settings value
3827 * as an integer. Note that internally setting values are always
3828 * stored as strings; this function converts the string to an integer
3829 * for you. The default value will be returned if the setting is
3830 * not defined or not an integer.
3831 *
3832 * @param cr The ContentResolver to access.
3833 * @param name The name of the setting to retrieve.
3834 * @param def Value to return if the setting is not defined.
3835 *
3836 * @return The setting's current value, or 'def' if it is not defined
3837 * or not a valid integer.
3838 */
3839 public static int getInt(ContentResolver cr, String name, int def) {
Christopher Tate06efb532012-08-24 15:29:27 -07003840 return getIntForUser(cr, name, def, UserHandle.myUserId());
3841 }
3842
3843 /** @hide */
3844 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
Tom O'Neill7f6f4572013-08-27 10:53:15 -07003845 if (LOCATION_MODE.equals(name)) {
3846 // HACK ALERT: temporary hack to work around b/10491283.
3847 // TODO: once b/10491283 fixed, remove this hack
3848 return getLocationModeForUser(cr, userHandle);
3849 }
Christopher Tate06efb532012-08-24 15:29:27 -07003850 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003851 try {
3852 return v != null ? Integer.parseInt(v) : def;
3853 } catch (NumberFormatException e) {
3854 return def;
3855 }
3856 }
3857
3858 /**
3859 * Convenience function for retrieving a single secure settings value
3860 * as an integer. Note that internally setting values are always
3861 * stored as strings; this function converts the string to an integer
3862 * for you.
3863 * <p>
3864 * This version does not take a default value. If the setting has not
3865 * been set, or the string value is not a number,
3866 * it throws {@link SettingNotFoundException}.
3867 *
3868 * @param cr The ContentResolver to access.
3869 * @param name The name of the setting to retrieve.
3870 *
3871 * @throws SettingNotFoundException Thrown if a setting by the given
3872 * name can't be found or the setting value is not an integer.
3873 *
3874 * @return The setting's current value.
3875 */
3876 public static int getInt(ContentResolver cr, String name)
3877 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07003878 return getIntForUser(cr, name, UserHandle.myUserId());
3879 }
3880
3881 /** @hide */
3882 public static int getIntForUser(ContentResolver cr, String name, int userHandle)
3883 throws SettingNotFoundException {
Tom O'Neill7f6f4572013-08-27 10:53:15 -07003884 if (LOCATION_MODE.equals(name)) {
3885 // HACK ALERT: temporary hack to work around b/10491283.
3886 // TODO: once b/10491283 fixed, remove this hack
3887 return getLocationModeForUser(cr, userHandle);
3888 }
Christopher Tate06efb532012-08-24 15:29:27 -07003889 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003890 try {
3891 return Integer.parseInt(v);
3892 } catch (NumberFormatException e) {
3893 throw new SettingNotFoundException(name);
3894 }
3895 }
3896
3897 /**
3898 * Convenience function for updating a single settings value as an
3899 * integer. This will either create a new entry in the table if the
3900 * given name does not exist, or modify the value of the existing row
3901 * with that name. Note that internally setting values are always
3902 * stored as strings, so this function converts the given value to a
3903 * string before storing it.
3904 *
3905 * @param cr The ContentResolver to access.
3906 * @param name The name of the setting to modify.
3907 * @param value The new value for the setting.
3908 * @return true if the value was set, false on database errors
3909 */
3910 public static boolean putInt(ContentResolver cr, String name, int value) {
Christopher Tate06efb532012-08-24 15:29:27 -07003911 return putIntForUser(cr, name, value, UserHandle.myUserId());
3912 }
3913
3914 /** @hide */
3915 public static boolean putIntForUser(ContentResolver cr, String name, int value,
3916 int userHandle) {
3917 return putStringForUser(cr, name, Integer.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003918 }
3919
3920 /**
3921 * Convenience function for retrieving a single secure settings value
3922 * as a {@code long}. Note that internally setting values are always
3923 * stored as strings; this function converts the string to a {@code long}
3924 * for you. The default value will be returned if the setting is
3925 * not defined or not a {@code long}.
3926 *
3927 * @param cr The ContentResolver to access.
3928 * @param name The name of the setting to retrieve.
3929 * @param def Value to return if the setting is not defined.
3930 *
3931 * @return The setting's current value, or 'def' if it is not defined
3932 * or not a valid {@code long}.
3933 */
3934 public static long getLong(ContentResolver cr, String name, long def) {
Christopher Tate06efb532012-08-24 15:29:27 -07003935 return getLongForUser(cr, name, def, UserHandle.myUserId());
3936 }
3937
3938 /** @hide */
3939 public static long getLongForUser(ContentResolver cr, String name, long def,
3940 int userHandle) {
3941 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003942 long value;
3943 try {
3944 value = valString != null ? Long.parseLong(valString) : def;
3945 } catch (NumberFormatException e) {
3946 value = def;
3947 }
3948 return value;
3949 }
3950
3951 /**
3952 * Convenience function for retrieving a single secure settings value
3953 * as a {@code long}. Note that internally setting values are always
3954 * stored as strings; this function converts the string to a {@code long}
3955 * for you.
3956 * <p>
3957 * This version does not take a default value. If the setting has not
3958 * been set, or the string value is not a number,
3959 * it throws {@link SettingNotFoundException}.
3960 *
3961 * @param cr The ContentResolver to access.
3962 * @param name The name of the setting to retrieve.
3963 *
3964 * @return The setting's current value.
3965 * @throws SettingNotFoundException Thrown if a setting by the given
3966 * name can't be found or the setting value is not an integer.
3967 */
3968 public static long getLong(ContentResolver cr, String name)
3969 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07003970 return getLongForUser(cr, name, UserHandle.myUserId());
3971 }
3972
3973 /** @hide */
3974 public static long getLongForUser(ContentResolver cr, String name, int userHandle)
3975 throws SettingNotFoundException {
3976 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003977 try {
3978 return Long.parseLong(valString);
3979 } catch (NumberFormatException e) {
3980 throw new SettingNotFoundException(name);
3981 }
3982 }
3983
3984 /**
3985 * Convenience function for updating a secure settings value as a long
3986 * integer. This will either create a new entry in the table if the
3987 * given name does not exist, or modify the value of the existing row
3988 * with that name. Note that internally setting values are always
3989 * stored as strings, so this function converts the given value to a
3990 * string before storing it.
3991 *
3992 * @param cr The ContentResolver to access.
3993 * @param name The name of the setting to modify.
3994 * @param value The new value for the setting.
3995 * @return true if the value was set, false on database errors
3996 */
3997 public static boolean putLong(ContentResolver cr, String name, long value) {
Christopher Tate06efb532012-08-24 15:29:27 -07003998 return putLongForUser(cr, name, value, UserHandle.myUserId());
3999 }
4000
4001 /** @hide */
4002 public static boolean putLongForUser(ContentResolver cr, String name, long value,
4003 int userHandle) {
4004 return putStringForUser(cr, name, Long.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004005 }
4006
4007 /**
4008 * Convenience function for retrieving a single secure settings value
4009 * as a floating point number. Note that internally setting values are
4010 * always stored as strings; this function converts the string to an
4011 * float for you. The default value will be returned if the setting
4012 * is not defined or not a valid float.
4013 *
4014 * @param cr The ContentResolver to access.
4015 * @param name The name of the setting to retrieve.
4016 * @param def Value to return if the setting is not defined.
4017 *
4018 * @return The setting's current value, or 'def' if it is not defined
4019 * or not a valid float.
4020 */
4021 public static float getFloat(ContentResolver cr, String name, float def) {
Christopher Tate06efb532012-08-24 15:29:27 -07004022 return getFloatForUser(cr, name, def, UserHandle.myUserId());
4023 }
4024
4025 /** @hide */
4026 public static float getFloatForUser(ContentResolver cr, String name, float def,
4027 int userHandle) {
4028 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004029 try {
4030 return v != null ? Float.parseFloat(v) : def;
4031 } catch (NumberFormatException e) {
4032 return def;
4033 }
4034 }
4035
4036 /**
4037 * Convenience function for retrieving a single secure settings value
4038 * as a float. Note that internally setting values are always
4039 * stored as strings; this function converts the string to a float
4040 * for you.
4041 * <p>
4042 * This version does not take a default value. If the setting has not
4043 * been set, or the string value is not a number,
4044 * it throws {@link SettingNotFoundException}.
4045 *
4046 * @param cr The ContentResolver to access.
4047 * @param name The name of the setting to retrieve.
4048 *
4049 * @throws SettingNotFoundException Thrown if a setting by the given
4050 * name can't be found or the setting value is not a float.
4051 *
4052 * @return The setting's current value.
4053 */
4054 public static float getFloat(ContentResolver cr, String name)
4055 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07004056 return getFloatForUser(cr, name, UserHandle.myUserId());
4057 }
4058
4059 /** @hide */
4060 public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
4061 throws SettingNotFoundException {
4062 String v = getStringForUser(cr, name, userHandle);
Brian Muramatsue1d46982010-12-06 17:34:20 -08004063 if (v == null) {
4064 throw new SettingNotFoundException(name);
4065 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004066 try {
4067 return Float.parseFloat(v);
4068 } catch (NumberFormatException e) {
4069 throw new SettingNotFoundException(name);
4070 }
4071 }
4072
4073 /**
4074 * Convenience function for updating a single settings value as a
4075 * floating point number. This will either create a new entry in the
4076 * table if the given name does not exist, or modify the value of the
4077 * existing row with that name. Note that internally setting values
4078 * are always stored as strings, so this function converts the given
4079 * value to a string before storing it.
4080 *
4081 * @param cr The ContentResolver to access.
4082 * @param name The name of the setting to modify.
4083 * @param value The new value for the setting.
4084 * @return true if the value was set, false on database errors
4085 */
4086 public static boolean putFloat(ContentResolver cr, String name, float value) {
Christopher Tate06efb532012-08-24 15:29:27 -07004087 return putFloatForUser(cr, name, value, UserHandle.myUserId());
4088 }
4089
4090 /** @hide */
4091 public static boolean putFloatForUser(ContentResolver cr, String name, float value,
4092 int userHandle) {
4093 return putStringForUser(cr, name, Float.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004094 }
4095
4096 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004097 * @deprecated Use {@link android.provider.Settings.Global#DEVELOPMENT_SETTINGS_ENABLED}
4098 * instead
Dianne Hackborn895f99e2012-02-02 11:49:12 -08004099 */
Christopher Tate06efb532012-08-24 15:29:27 -07004100 @Deprecated
4101 public static final String DEVELOPMENT_SETTINGS_ENABLED =
4102 Global.DEVELOPMENT_SETTINGS_ENABLED;
Dianne Hackborn895f99e2012-02-02 11:49:12 -08004103
4104 /**
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07004105 * When the user has enable the option to have a "bug report" command
4106 * in the power menu.
Christopher Tate58f41ec2013-01-11 15:40:36 -08004107 * @deprecated Use {@link android.provider.Settings.Global#BUGREPORT_IN_POWER_MENU} instead
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07004108 * @hide
4109 */
Christopher Tate58f41ec2013-01-11 15:40:36 -08004110 @Deprecated
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07004111 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
4112
4113 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004114 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004115 */
Christopher Tate06efb532012-08-24 15:29:27 -07004116 @Deprecated
4117 public static final String ADB_ENABLED = Global.ADB_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004118
4119 /**
4120 * Setting to allow mock locations and location provider status to be injected into the
4121 * LocationManager service for testing purposes during application development. These
4122 * locations and status values override actual location and status information generated
4123 * by network, gps, or other location providers.
4124 */
4125 public static final String ALLOW_MOCK_LOCATION = "mock_location";
4126
4127 /**
Doug Zongkerd8893db2010-01-26 12:29:44 -08004128 * A 64-bit number (as a hex string) that is randomly
Scott Main44895332013-11-12 09:23:13 -08004129 * generated when the user first sets up the device and should remain
4130 * constant for the lifetime of the user's device. The value may
4131 * change if a factory reset is performed on the device.
4132 * <p class="note"><strong>Note:</strong> When a device has <a
4133 * href="{@docRoot}about/versions/android-4.2.html#MultipleUsers">multiple users</a>
4134 * (available on certain devices running Android 4.2 or higher), each user appears as a
4135 * completely separate device, so the {@code ANDROID_ID} value is unique to each
4136 * user.</p>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004137 */
4138 public static final String ANDROID_ID = "android_id";
4139
4140 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004141 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004142 */
Christopher Tate06efb532012-08-24 15:29:27 -07004143 @Deprecated
4144 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004145
4146 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004147 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004148 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07004149 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07004150 public static final String DATA_ROAMING = Global.DATA_ROAMING;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004151
4152 /**
4153 * Setting to record the input method used by default, holding the ID
4154 * of the desired method.
4155 */
4156 public static final String DEFAULT_INPUT_METHOD = "default_input_method";
4157
4158 /**
satokab751aa2010-09-14 19:17:36 +09004159 * Setting to record the input method subtype used by default, holding the ID
4160 * of the desired method.
4161 */
4162 public static final String SELECTED_INPUT_METHOD_SUBTYPE =
4163 "selected_input_method_subtype";
4164
4165 /**
satok723a27e2010-11-11 14:58:11 +09004166 * Setting to record the history of input method subtype, holding the pair of ID of IME
4167 * and its last used subtype.
4168 * @hide
4169 */
4170 public static final String INPUT_METHODS_SUBTYPE_HISTORY =
4171 "input_methods_subtype_history";
4172
4173 /**
satok5c58dfc2010-12-14 21:54:47 +09004174 * Setting to record the visibility of input method selector
4175 */
4176 public static final String INPUT_METHOD_SELECTOR_VISIBILITY =
4177 "input_method_selector_visibility";
4178
4179 /**
Dianne Hackborn91097de2014-04-04 18:02:06 -07004180 * The currently selected voice interaction service flattened ComponentName.
4181 * @hide
4182 */
4183 public static final String VOICE_INTERACTION_SERVICE = "voice_interaction_service";
4184
4185 /**
Zhihai Xuaf5971e2013-06-10 20:28:31 -07004186 * bluetooth HCI snoop log configuration
4187 * @hide
4188 */
4189 public static final String BLUETOOTH_HCI_LOG =
4190 "bluetooth_hci_log";
4191
4192 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004193 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004194 */
Christopher Tate06efb532012-08-24 15:29:27 -07004195 @Deprecated
4196 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004197
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004198 /**
Russell Brennerde6ae442012-09-26 20:53:10 -07004199 * Whether the current user has been set up via setup wizard (0 = false, 1 = true)
4200 * @hide
4201 */
4202 public static final String USER_SETUP_COMPLETE = "user_setup_complete";
4203
4204 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004205 * List of input methods that are currently enabled. This is a string
4206 * containing the IDs of all enabled input methods, each ID separated
4207 * by ':'.
4208 */
4209 public static final String ENABLED_INPUT_METHODS = "enabled_input_methods";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004210
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004211 /**
Amith Yamasanie861ec12010-03-24 21:39:27 -07004212 * List of system input methods that are currently disabled. This is a string
4213 * containing the IDs of all disabled input methods, each ID separated
4214 * by ':'.
4215 * @hide
4216 */
4217 public static final String DISABLED_SYSTEM_INPUT_METHODS = "disabled_system_input_methods";
4218
4219 /**
Michael Wright7b5a96b2014-08-09 19:28:42 -07004220 * Whether to show the IME when a hard keyboard is connected. This is a boolean that
4221 * determines if the IME should be shown when a hard keyboard is attached.
4222 * @hide
4223 */
4224 public static final String SHOW_IME_WITH_HARD_KEYBOARD = "show_ime_with_hard_keyboard";
4225
4226 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07004227 * Host name and port for global http proxy. Uses ':' seperator for
4228 * between host and port.
4229 *
4230 * @deprecated Use {@link Global#HTTP_PROXY}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004231 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07004232 @Deprecated
4233 public static final String HTTP_PROXY = Global.HTTP_PROXY;
Robert Greenwalte90aa5e2010-09-01 11:34:05 -07004234
4235 /**
Christopher Tateaa036a22014-05-19 16:33:27 -07004236 * Whether applications can be installed for this user via the system's
4237 * {@link Intent#ACTION_INSTALL_PACKAGE} mechanism.
4238 *
4239 * <p>1 = permit app installation via the system package installer intent
4240 * <p>0 = do not allow use of the package installer
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004241 */
Christopher Tateaa036a22014-05-19 16:33:27 -07004242 public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004243
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004244 /**
Tom O'Neill923c0dc2014-03-03 11:07:55 -08004245 * Comma-separated list of location providers that activities may access. Do not rely on
4246 * this value being present in settings.db or on ContentObserver notifications on the
4247 * corresponding Uri.
Tom O'Neilla324ac72013-08-26 14:40:23 -07004248 *
Tom O'Neill923c0dc2014-03-03 11:07:55 -08004249 * @deprecated use {@link #LOCATION_MODE} and
4250 * {@link LocationManager#MODE_CHANGED_ACTION} (or
4251 * {@link LocationManager#PROVIDERS_CHANGED_ACTION})
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004252 */
Tom O'Neilla324ac72013-08-26 14:40:23 -07004253 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004254 public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004255
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004256 /**
Tom O'Neill7f6f4572013-08-27 10:53:15 -07004257 * The degree of location access enabled by the user.
Tom O'Neill923c0dc2014-03-03 11:07:55 -08004258 * <p>
Tom O'Neill7f6f4572013-08-27 10:53:15 -07004259 * When used with {@link #putInt(ContentResolver, String, int)}, must be one of {@link
4260 * #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY}, {@link
4261 * #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}. When used with {@link
4262 * #getInt(ContentResolver, String)}, the caller must gracefully handle additional location
4263 * modes that might be added in the future.
Tom O'Neill923c0dc2014-03-03 11:07:55 -08004264 * <p>
4265 * Note: do not rely on this value being present in settings.db or on ContentObserver
4266 * notifications for the corresponding Uri. Use {@link LocationManager#MODE_CHANGED_ACTION}
4267 * to receive changes in this value.
Tom O'Neilla324ac72013-08-26 14:40:23 -07004268 */
4269 public static final String LOCATION_MODE = "location_mode";
4270
4271 /**
Tom O'Neill7f6f4572013-08-27 10:53:15 -07004272 * Location access disabled.
Tom O'Neill1f48b782013-08-19 18:14:56 -07004273 */
4274 public static final int LOCATION_MODE_OFF = 0;
4275 /**
4276 * Network Location Provider disabled, but GPS and other sensors enabled.
4277 */
4278 public static final int LOCATION_MODE_SENSORS_ONLY = 1;
4279 /**
Tom O'Neilld5759432013-09-11 11:03:03 -07004280 * Reduced power usage, such as limiting the number of GPS updates per hour. Requests
4281 * with {@link android.location.Criteria#POWER_HIGH} may be downgraded to
4282 * {@link android.location.Criteria#POWER_MEDIUM}.
Tom O'Neill1f48b782013-08-19 18:14:56 -07004283 */
4284 public static final int LOCATION_MODE_BATTERY_SAVING = 2;
4285 /**
4286 * Best-effort location computation allowed.
4287 */
4288 public static final int LOCATION_MODE_HIGH_ACCURACY = 3;
4289
4290 /**
Danielle Millett925a7d82012-03-19 18:02:20 -04004291 * A flag containing settings used for biometric weak
4292 * @hide
4293 */
Adrian Roos230635e2015-01-07 20:50:29 +01004294 @Deprecated
Danielle Millett925a7d82012-03-19 18:02:20 -04004295 public static final String LOCK_BIOMETRIC_WEAK_FLAGS =
4296 "lock_biometric_weak_flags";
4297
4298 /**
Jason Monk94cfd9d2014-10-31 13:18:21 -04004299 * Whether lock-to-app will lock the keyguard when exiting.
4300 * @hide
4301 */
4302 public static final String LOCK_TO_APP_EXIT_LOCKED = "lock_to_app_exit_locked";
4303
4304 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08004305 * Whether autolock is enabled (0 = false, 1 = true)
Adrian Roos9dd16eb2015-01-08 16:20:49 +01004306 *
4307 * @deprecated Use {@link android.app.KeyguardManager} to determine the state and security
4308 * level of the keyguard.
Amith Yamasani156c4352010-03-05 17:10:03 -08004309 */
Adrian Roos9dd16eb2015-01-08 16:20:49 +01004310 @Deprecated
Amith Yamasani156c4352010-03-05 17:10:03 -08004311 public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock";
4312
4313 /**
4314 * Whether lock pattern is visible as user enters (0 = false, 1 = true)
4315 */
4316 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
4317
4318 /**
Jeff Sharkey5ed9d682012-10-10 14:28:27 -07004319 * Whether lock pattern will vibrate as user enters (0 = false, 1 =
4320 * true)
4321 *
4322 * @deprecated Starting in {@link VERSION_CODES#JELLY_BEAN_MR1} the
4323 * lockscreen uses
4324 * {@link Settings.System#HAPTIC_FEEDBACK_ENABLED}.
Amith Yamasani156c4352010-03-05 17:10:03 -08004325 */
Jeff Sharkey5ed9d682012-10-10 14:28:27 -07004326 @Deprecated
4327 public static final String
4328 LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = "lock_pattern_tactile_feedback_enabled";
Amith Yamasani156c4352010-03-05 17:10:03 -08004329
4330 /**
Jim Millerbc4603b2010-08-30 21:21:34 -07004331 * This preference allows the device to be locked given time after screen goes off,
4332 * subject to current DeviceAdmin policy limits.
4333 * @hide
4334 */
4335 public static final String LOCK_SCREEN_LOCK_AFTER_TIMEOUT = "lock_screen_lock_after_timeout";
4336
4337
4338 /**
John Spurlock5f050e52012-10-27 10:44:19 -04004339 * This preference contains the string that shows for owner info on LockScreen.
Jim Miller253a5ef2010-10-13 20:57:29 -07004340 * @hide
Jim Miller187ec582013-04-15 18:27:54 -07004341 * @deprecated
Jim Miller253a5ef2010-10-13 20:57:29 -07004342 */
4343 public static final String LOCK_SCREEN_OWNER_INFO = "lock_screen_owner_info";
4344
4345 /**
John Spurlock5f050e52012-10-27 10:44:19 -04004346 * Ids of the user-selected appwidgets on the lockscreen (comma-delimited).
Jim Millerf229e4d2012-09-12 20:32:50 -07004347 * @hide
4348 */
Adrian Roos230635e2015-01-07 20:50:29 +01004349 @Deprecated
Michael Jurkaaa2859a2012-10-24 12:46:49 -07004350 public static final String LOCK_SCREEN_APPWIDGET_IDS =
4351 "lock_screen_appwidget_ids";
Jim Millerf229e4d2012-09-12 20:32:50 -07004352
4353 /**
Jim Miller08fa40c2014-04-29 18:18:47 -07004354 * List of enrolled fingerprint identifiers (comma-delimited).
4355 * @hide
4356 */
4357 public static final String USER_FINGERPRINT_IDS = "user_fingerprint_ids";
4358
4359 /**
Jim Miller51117262012-11-04 17:58:09 -08004360 * Id of the appwidget shown on the lock screen when appwidgets are disabled.
4361 * @hide
4362 */
Adrian Roos230635e2015-01-07 20:50:29 +01004363 @Deprecated
Jim Miller51117262012-11-04 17:58:09 -08004364 public static final String LOCK_SCREEN_FALLBACK_APPWIDGET_ID =
4365 "lock_screen_fallback_appwidget_id";
4366
4367 /**
John Spurlock5f050e52012-10-27 10:44:19 -04004368 * Index of the lockscreen appwidget to restore, -1 if none.
4369 * @hide
4370 */
Adrian Roos230635e2015-01-07 20:50:29 +01004371 @Deprecated
John Spurlock5f050e52012-10-27 10:44:19 -04004372 public static final String LOCK_SCREEN_STICKY_APPWIDGET =
4373 "lock_screen_sticky_appwidget";
4374
4375 /**
4376 * This preference enables showing the owner info on LockScreen.
Jim Miller253a5ef2010-10-13 20:57:29 -07004377 * @hide
Jim Miller187ec582013-04-15 18:27:54 -07004378 * @deprecated
Jim Miller253a5ef2010-10-13 20:57:29 -07004379 */
4380 public static final String LOCK_SCREEN_OWNER_INFO_ENABLED =
4381 "lock_screen_owner_info_enabled";
4382
4383 /**
Dan Sandler5d7c3cc2014-02-18 17:35:15 -05004384 * When set by a user, allows notifications to be shown atop a securely locked screen
4385 * in their full "private" form (same as when the device is unlocked).
Dan Sandlerfd16d562014-02-13 18:43:31 -08004386 * @hide
4387 */
4388 public static final String LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS =
4389 "lock_screen_allow_private_notifications";
4390
4391 /**
Chris Wrencd8f4f72014-08-27 18:48:13 -04004392 * Set by the system to track if the user needs to see the call to action for
4393 * the lockscreen notification policy.
4394 * @hide
4395 */
4396 public static final String SHOW_NOTE_ABOUT_NOTIFICATION_HIDING =
4397 "show_note_about_notification_hiding";
4398
4399 /**
Adrian Roos3870d452014-09-05 18:22:28 +02004400 * Set to 1 by the system after trust agents have been initialized.
4401 * @hide
4402 */
4403 public static final String TRUST_AGENTS_INITIALIZED =
4404 "trust_agents_initialized";
4405
4406 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004407 * The Logging ID (a unique 64-bit value) as a hex string.
4408 * Used as a pseudonymous identifier for logging.
4409 * @deprecated This identifier is poorly initialized and has
4410 * many collisions. It should not be used.
4411 */
4412 @Deprecated
4413 public static final String LOGGING_ID = "logging_id";
4414
4415 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004416 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} 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 NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004420
4421 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08004422 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004423 */
4424 public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004425
4426 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08004427 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004428 */
4429 public static final String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004430
4431 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08004432 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004433 */
4434 public static final String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004435
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004436 /**
4437 * Settings classname to launch when Settings is clicked from All
4438 * Applications. Needed because of user testing between the old
4439 * and new Settings apps.
4440 */
4441 // TODO: 881807
4442 public static final String SETTINGS_CLASSNAME = "settings_classname";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004443
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004444 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004445 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004446 */
Christopher Tate06efb532012-08-24 15:29:27 -07004447 @Deprecated
4448 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004449
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004450 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004451 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004452 */
Christopher Tate06efb532012-08-24 15:29:27 -07004453 @Deprecated
4454 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004455
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004456 /**
svetoslavganov75986cf2009-05-14 22:28:01 -07004457 * If accessibility is enabled.
4458 */
4459 public static final String ACCESSIBILITY_ENABLED = "accessibility_enabled";
4460
4461 /**
Svetoslav Ganov00aabf72011-07-21 11:35:03 -07004462 * If touch exploration is enabled.
Svetoslav Ganov35bfede2011-07-14 17:57:06 -07004463 */
Svetoslav Ganov00aabf72011-07-21 11:35:03 -07004464 public static final String TOUCH_EXPLORATION_ENABLED = "touch_exploration_enabled";
Svetoslav Ganov35bfede2011-07-14 17:57:06 -07004465
4466 /**
svetoslavganov75986cf2009-05-14 22:28:01 -07004467 * List of the enabled accessibility providers.
4468 */
4469 public static final String ENABLED_ACCESSIBILITY_SERVICES =
4470 "enabled_accessibility_services";
4471
4472 /**
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07004473 * List of the accessibility services to which the user has granted
Svetoslav Ganov9a4c5cd2012-05-30 14:06:32 -07004474 * permission to put the device into touch exploration mode.
4475 *
4476 * @hide
4477 */
4478 public static final String TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES =
4479 "touch_exploration_granted_accessibility_services";
4480
4481 /**
Svetoslav Ganov55f937a2011-12-05 11:42:07 -08004482 * Whether to speak passwords while in accessibility mode.
4483 */
4484 public static final String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password";
4485
4486 /**
Chris Craikcce47eb2014-07-16 15:12:15 -07004487 * Whether to draw text with high contrast while in accessibility mode.
4488 *
4489 * @hide
4490 */
4491 public static final String ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED =
4492 "high_text_contrast_enabled";
4493
4494 /**
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08004495 * If injection of accessibility enhancing JavaScript screen-reader
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07004496 * is enabled.
4497 * <p>
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08004498 * Note: The JavaScript based screen-reader is served by the
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07004499 * Google infrastructure and enable users with disabilities to
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07004500 * efficiently navigate in and explore web content.
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07004501 * </p>
4502 * <p>
4503 * This property represents a boolean value.
4504 * </p>
4505 * @hide
4506 */
4507 public static final String ACCESSIBILITY_SCRIPT_INJECTION =
4508 "accessibility_script_injection";
4509
4510 /**
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08004511 * The URL for the injected JavaScript based screen-reader used
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07004512 * for providing accessibility of content in WebView.
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08004513 * <p>
4514 * Note: The JavaScript based screen-reader is served by the
4515 * Google infrastructure and enable users with disabilities to
4516 * efficiently navigate in and explore web content.
4517 * </p>
4518 * <p>
4519 * This property represents a string value.
4520 * </p>
4521 * @hide
4522 */
4523 public static final String ACCESSIBILITY_SCREEN_READER_URL =
4524 "accessibility_script_injection_url";
4525
4526 /**
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07004527 * Key bindings for navigation in built-in accessibility support for web content.
4528 * <p>
4529 * Note: These key bindings are for the built-in accessibility navigation for
4530 * web content which is used as a fall back solution if JavaScript in a WebView
4531 * is not enabled or the user has not opted-in script injection from Google.
4532 * </p>
4533 * <p>
4534 * The bindings are separated by semi-colon. A binding is a mapping from
4535 * a key to a sequence of actions (for more details look at
4536 * android.webkit.AccessibilityInjector). A key is represented as the hexademical
4537 * string representation of an integer obtained from a meta state (optional) shifted
4538 * sixteen times left and bitwise ored with a key code. An action is represented
4539 * as a hexademical string representation of an integer where the first two digits
4540 * are navigation action index, the second, the third, and the fourth digit pairs
4541 * represent the action arguments. The separate actions in a binding are colon
4542 * separated. The key and the action sequence it maps to are separated by equals.
4543 * </p>
4544 * <p>
4545 * For example, the binding below maps the DPAD right button to traverse the
4546 * current navigation axis once without firing an accessibility event and to
4547 * perform the same traversal again but to fire an event:
4548 * <code>
4549 * 0x16=0x01000100:0x01000101;
4550 * </code>
4551 * </p>
4552 * <p>
4553 * The goal of this binding is to enable dynamic rebinding of keys to
4554 * navigation actions for web content without requiring a framework change.
4555 * </p>
4556 * <p>
4557 * This property represents a string value.
4558 * </p>
4559 * @hide
4560 */
4561 public static final String ACCESSIBILITY_WEB_CONTENT_KEY_BINDINGS =
4562 "accessibility_web_content_key_bindings";
4563
4564 /**
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07004565 * Setting that specifies whether the display magnification is enabled.
4566 * Display magnifications allows the user to zoom in the display content
4567 * and is targeted to low vision users. The current magnification scale
4568 * is controlled by {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}.
4569 *
4570 * @hide
4571 */
4572 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED =
4573 "accessibility_display_magnification_enabled";
4574
4575 /**
4576 * Setting that specifies what the display magnification scale is.
4577 * Display magnifications allows the user to zoom in the display
4578 * content and is targeted to low vision users. Whether a display
4579 * magnification is performed is controlled by
4580 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED}
4581 *
4582 * @hide
4583 */
4584 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE =
4585 "accessibility_display_magnification_scale";
4586
4587 /**
4588 * Setting that specifies whether the display magnification should be
4589 * automatically updated. If this fearture is enabled the system will
4590 * exit magnification mode or pan the viewport when a context change
4591 * occurs. For example, on staring a new activity or rotating the screen,
4592 * the system may zoom out so the user can see the new context he is in.
4593 * Another example is on showing a window that is not visible in the
4594 * magnified viewport the system may pan the viewport to make the window
4595 * the has popped up so the user knows that the context has changed.
4596 * Whether a screen magnification is performed is controlled by
4597 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED}
4598 *
4599 * @hide
4600 */
4601 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE =
4602 "accessibility_display_magnification_auto_update";
4603
4604 /**
Alan Viveretteef793802013-07-23 14:15:28 -07004605 * Setting that specifies whether timed text (captions) should be
4606 * displayed in video content. Text display properties are controlled by
4607 * the following settings:
4608 * <ul>
4609 * <li>{@link #ACCESSIBILITY_CAPTIONING_LOCALE}
4610 * <li>{@link #ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR}
4611 * <li>{@link #ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR}
4612 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_COLOR}
4613 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_TYPE}
4614 * <li>{@link #ACCESSIBILITY_CAPTIONING_TYPEFACE}
Alan Viverette69ce69b2013-08-29 12:23:48 -07004615 * <li>{@link #ACCESSIBILITY_CAPTIONING_FONT_SCALE}
Alan Viveretteef793802013-07-23 14:15:28 -07004616 * </ul>
4617 *
4618 * @hide
4619 */
4620 public static final String ACCESSIBILITY_CAPTIONING_ENABLED =
4621 "accessibility_captioning_enabled";
4622
4623 /**
4624 * Setting that specifies the language for captions as a locale string,
4625 * e.g. en_US.
4626 *
4627 * @see java.util.Locale#toString
4628 * @hide
4629 */
4630 public static final String ACCESSIBILITY_CAPTIONING_LOCALE =
4631 "accessibility_captioning_locale";
4632
4633 /**
Alan Viverette43a1e3d2013-08-02 16:45:03 -07004634 * Integer property that specifies the preset style for captions, one
4635 * of:
4636 * <ul>
Alan Viverette69ce69b2013-08-29 12:23:48 -07004637 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESET_CUSTOM}
4638 * <li>a valid index of {@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESETS}
Alan Viverette43a1e3d2013-08-02 16:45:03 -07004639 * </ul>
4640 *
4641 * @see java.util.Locale#toString
4642 * @hide
4643 */
4644 public static final String ACCESSIBILITY_CAPTIONING_PRESET =
4645 "accessibility_captioning_preset";
4646
4647 /**
Alan Viveretteef793802013-07-23 14:15:28 -07004648 * Integer property that specifes the background color for captions as a
4649 * packed 32-bit color.
4650 *
4651 * @see android.graphics.Color#argb
4652 * @hide
4653 */
4654 public static final String ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR =
4655 "accessibility_captioning_background_color";
4656
4657 /**
4658 * Integer property that specifes the foreground color for captions as a
4659 * packed 32-bit color.
4660 *
4661 * @see android.graphics.Color#argb
4662 * @hide
4663 */
4664 public static final String ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR =
4665 "accessibility_captioning_foreground_color";
4666
4667 /**
4668 * Integer property that specifes the edge type for captions, one of:
4669 * <ul>
Alan Viverette69ce69b2013-08-29 12:23:48 -07004670 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_NONE}
4671 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_OUTLINE}
4672 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_DROP_SHADOW}
Alan Viveretteef793802013-07-23 14:15:28 -07004673 * </ul>
4674 *
4675 * @see #ACCESSIBILITY_CAPTIONING_EDGE_COLOR
4676 * @hide
4677 */
4678 public static final String ACCESSIBILITY_CAPTIONING_EDGE_TYPE =
4679 "accessibility_captioning_edge_type";
4680
4681 /**
4682 * Integer property that specifes the edge color for captions as a
4683 * packed 32-bit color.
4684 *
4685 * @see #ACCESSIBILITY_CAPTIONING_EDGE_TYPE
4686 * @see android.graphics.Color#argb
4687 * @hide
4688 */
4689 public static final String ACCESSIBILITY_CAPTIONING_EDGE_COLOR =
4690 "accessibility_captioning_edge_color";
4691
4692 /**
Alan Viverette55d70622013-12-11 15:22:14 -08004693 * Integer property that specifes the window color for captions as a
4694 * packed 32-bit color.
4695 *
4696 * @see android.graphics.Color#argb
4697 * @hide
4698 */
4699 public static final String ACCESSIBILITY_CAPTIONING_WINDOW_COLOR =
4700 "accessibility_captioning_window_color";
4701
4702 /**
Alan Viveretteef793802013-07-23 14:15:28 -07004703 * String property that specifies the typeface for captions, one of:
4704 * <ul>
4705 * <li>DEFAULT
4706 * <li>MONOSPACE
4707 * <li>SANS_SERIF
4708 * <li>SERIF
4709 * </ul>
4710 *
4711 * @see android.graphics.Typeface
4712 * @hide
4713 */
4714 public static final String ACCESSIBILITY_CAPTIONING_TYPEFACE =
4715 "accessibility_captioning_typeface";
4716
4717 /**
Alan Viverette69ce69b2013-08-29 12:23:48 -07004718 * Floating point property that specifies font scaling for captions.
Alan Viveretteef793802013-07-23 14:15:28 -07004719 *
4720 * @hide
4721 */
Alan Viverette69ce69b2013-08-29 12:23:48 -07004722 public static final String ACCESSIBILITY_CAPTIONING_FONT_SCALE =
4723 "accessibility_captioning_font_scale";
Alan Viveretteef793802013-07-23 14:15:28 -07004724
4725 /**
Alan Viverette410d4e32013-09-30 15:37:38 -07004726 * Setting that specifies whether display color inversion is enabled.
Alan Viverette410d4e32013-09-30 15:37:38 -07004727 */
4728 public static final String ACCESSIBILITY_DISPLAY_INVERSION_ENABLED =
4729 "accessibility_display_inversion_enabled";
4730
4731 /**
Alan Viverette410d4e32013-09-30 15:37:38 -07004732 * Setting that specifies whether display color space adjustment is
4733 * enabled.
4734 *
4735 * @hide
4736 */
4737 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED =
4738 "accessibility_display_daltonizer_enabled";
4739
4740 /**
4741 * Integer property that specifies the type of color space adjustment to
4742 * perform. Valid values are defined in AccessibilityManager.
4743 *
4744 * @hide
4745 */
4746 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER =
4747 "accessibility_display_daltonizer";
4748
4749 /**
Svetoslav Ganov54d068e2011-03-02 12:58:40 -08004750 * The timout for considering a press to be a long press in milliseconds.
4751 * @hide
4752 */
4753 public static final String LONG_PRESS_TIMEOUT = "long_press_timeout";
4754
4755 /**
Svetoslav Ganov6bd20bc2013-09-02 15:24:45 -07004756 * List of the enabled print services.
Svetoslav Ganov4b9a4d12013-06-11 15:20:06 -07004757 * @hide
4758 */
4759 public static final String ENABLED_PRINT_SERVICES =
4760 "enabled_print_services";
4761
4762 /**
Svetoslav Ganov6bd20bc2013-09-02 15:24:45 -07004763 * List of the system print services we enabled on first boot. On
4764 * first boot we enable all system, i.e. bundled print services,
4765 * once, so they work out-of-the-box.
4766 * @hide
4767 */
4768 public static final String ENABLED_ON_FIRST_BOOT_SYSTEM_PRINT_SERVICES =
4769 "enabled_on_first_boot_system_print_services";
4770
4771 /**
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07004772 * Setting to always use the default text-to-speech settings regardless
4773 * of the application settings.
4774 * 1 = override application settings,
4775 * 0 = use application settings (if specified).
Narayan Kamath6d632962011-08-24 11:51:37 +01004776 *
4777 * @deprecated The value of this setting is no longer respected by
4778 * the framework text to speech APIs as of the Ice Cream Sandwich release.
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07004779 */
Narayan Kamath6d632962011-08-24 11:51:37 +01004780 @Deprecated
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07004781 public static final String TTS_USE_DEFAULTS = "tts_use_defaults";
4782
4783 /**
4784 * Default text-to-speech engine speech rate. 100 = 1x
4785 */
4786 public static final String TTS_DEFAULT_RATE = "tts_default_rate";
4787
4788 /**
4789 * Default text-to-speech engine pitch. 100 = 1x
4790 */
4791 public static final String TTS_DEFAULT_PITCH = "tts_default_pitch";
4792
4793 /**
4794 * Default text-to-speech engine.
4795 */
4796 public static final String TTS_DEFAULT_SYNTH = "tts_default_synth";
4797
4798 /**
Jean-Michel Trivif4782672009-06-09 16:22:48 -07004799 * Default text-to-speech language.
Narayan Kamath6d632962011-08-24 11:51:37 +01004800 *
4801 * @deprecated this setting is no longer in use, as of the Ice Cream
4802 * Sandwich release. Apps should never need to read this setting directly,
4803 * instead can query the TextToSpeech framework classes for the default
4804 * locale. {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivif4782672009-06-09 16:22:48 -07004805 */
Narayan Kamath6d632962011-08-24 11:51:37 +01004806 @Deprecated
Jean-Michel Trivif4782672009-06-09 16:22:48 -07004807 public static final String TTS_DEFAULT_LANG = "tts_default_lang";
4808
4809 /**
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07004810 * Default text-to-speech country.
Narayan Kamath6d632962011-08-24 11:51:37 +01004811 *
4812 * @deprecated this setting is no longer in use, as of the Ice Cream
4813 * Sandwich release. Apps should never need to read this setting directly,
4814 * instead can query the TextToSpeech framework classes for the default
4815 * locale. {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07004816 */
Narayan Kamath6d632962011-08-24 11:51:37 +01004817 @Deprecated
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07004818 public static final String TTS_DEFAULT_COUNTRY = "tts_default_country";
4819
4820 /**
4821 * Default text-to-speech locale variant.
Narayan Kamath6d632962011-08-24 11:51:37 +01004822 *
4823 * @deprecated this setting is no longer in use, as of the Ice Cream
4824 * Sandwich release. Apps should never need to read this setting directly,
4825 * instead can query the TextToSpeech framework classes for the
4826 * locale that is in use {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07004827 */
Narayan Kamath6d632962011-08-24 11:51:37 +01004828 @Deprecated
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07004829 public static final String TTS_DEFAULT_VARIANT = "tts_default_variant";
4830
4831 /**
Narayan Kamathe5b8c4d2011-08-22 15:37:47 +01004832 * Stores the default tts locales on a per engine basis. Stored as
4833 * a comma seperated list of values, each value being of the form
4834 * {@code engine_name:locale} for example,
Narayan Kamath6d632962011-08-24 11:51:37 +01004835 * {@code com.foo.ttsengine:eng-USA,com.bar.ttsengine:esp-ESP}. This
4836 * supersedes {@link #TTS_DEFAULT_LANG}, {@link #TTS_DEFAULT_COUNTRY} and
4837 * {@link #TTS_DEFAULT_VARIANT}. Apps should never need to read this
4838 * setting directly, and can query the TextToSpeech framework classes
4839 * for the locale that is in use.
Narayan Kamathe5b8c4d2011-08-22 15:37:47 +01004840 *
4841 * @hide
4842 */
4843 public static final String TTS_DEFAULT_LOCALE = "tts_default_locale";
4844
4845 /**
Charles Chenceffa152010-03-16 21:18:10 -07004846 * Space delimited list of plugin packages that are enabled.
4847 */
4848 public static final String TTS_ENABLED_PLUGINS = "tts_enabled_plugins";
4849
4850 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004851 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON}
4852 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004853 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004854 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004855 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004856 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004857
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004858 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004859 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY}
4860 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004861 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004862 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004863 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004864 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004865
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004866 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004867 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
4868 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004869 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004870 @Deprecated
4871 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT =
4872 Global.WIFI_NUM_OPEN_NETWORKS_KEPT;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004873
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004874 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004875 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON}
4876 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004877 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004878 @Deprecated
4879 public static final String WIFI_ON = Global.WIFI_ON;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004880
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004881 /**
4882 * The acceptable packet loss percentage (range 0 - 100) before trying
4883 * another AP on the same network.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004884 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004885 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004886 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004887 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
4888 "wifi_watchdog_acceptable_packet_loss_percentage";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004889
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004890 /**
4891 * The number of access points required for a network in order for the
4892 * watchdog to monitor it.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004893 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004894 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004895 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004896 public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004897
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004898 /**
4899 * The delay between background checks.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004900 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004901 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004902 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004903 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
4904 "wifi_watchdog_background_check_delay_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004905
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004906 /**
4907 * Whether the Wi-Fi watchdog is enabled for background checking even
4908 * after it thinks the user has connected to a good access point.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004909 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004910 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004911 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004912 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
4913 "wifi_watchdog_background_check_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004914
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004915 /**
4916 * The timeout for a background ping
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004917 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004918 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004919 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004920 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
4921 "wifi_watchdog_background_check_timeout_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004922
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004923 /**
4924 * The number of initial pings to perform that *may* be ignored if they
4925 * fail. Again, if these fail, they will *not* be used in packet loss
4926 * calculation. For example, one network always seemed to time out for
4927 * the first couple pings, so this is set to 3 by default.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004928 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004929 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004930 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004931 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
4932 "wifi_watchdog_initial_ignored_ping_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004933
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004934 /**
4935 * The maximum number of access points (per network) to attempt to test.
4936 * If this number is reached, the watchdog will no longer monitor the
4937 * initial connection state for the network. This is a safeguard for
4938 * networks containing multiple APs whose DNS does not respond to pings.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004939 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004940 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004941 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004942 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = "wifi_watchdog_max_ap_checks";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004943
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004944 /**
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07004945 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004946 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07004947 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004948 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
4949
4950 /**
4951 * A comma-separated list of SSIDs for which the Wi-Fi watchdog should be enabled.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004952 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004953 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004954 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004955 public static final String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list";
4956
4957 /**
4958 * The number of pings to test if an access point is a good connection.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004959 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004960 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004961 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004962 public static final String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004963
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004964 /**
4965 * The delay between pings.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004966 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004967 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004968 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004969 public static final String WIFI_WATCHDOG_PING_DELAY_MS = "wifi_watchdog_ping_delay_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004970
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004971 /**
4972 * The timeout per ping.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004973 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004974 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004975 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004976 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004977
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004978 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004979 * @deprecated Use
4980 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004981 */
Christopher Tate06efb532012-08-24 15:29:27 -07004982 @Deprecated
4983 public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004984
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004985 /**
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004986 * @deprecated Use
4987 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004988 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07004989 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004990 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004991 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004992
4993 /**
Jeremy Joslin79294842014-12-03 17:15:28 -08004994 * The number of milliseconds to hold on to a PendingIntent based request. This delay gives
4995 * the receivers of the PendingIntent an opportunity to make a new network request before
4996 * the Network satisfying the request is potentially removed.
4997 *
4998 * @hide
4999 */
5000 public static final String CONNECTIVITY_RELEASE_PENDING_INTENT_DELAY_MS =
5001 "connectivity_release_pending_intent_delay_ms";
5002
5003 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07005004 * Whether background data usage is allowed.
5005 *
5006 * @deprecated As of {@link VERSION_CODES#ICE_CREAM_SANDWICH},
5007 * availability of background data depends on several
5008 * combined factors. When background data is unavailable,
5009 * {@link ConnectivityManager#getActiveNetworkInfo()} will
5010 * now appear disconnected.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005011 */
Jeff Sharkey3a844fc2011-08-16 14:37:57 -07005012 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005013 public static final String BACKGROUND_DATA = "background_data";
Wink Saville04e71b32009-04-02 11:00:54 -07005014
5015 /**
Bjorn Bringert98bfa392010-03-24 10:59:48 +00005016 * Origins for which browsers should allow geolocation by default.
5017 * The value is a space-separated list of origins.
5018 */
5019 public static final String ALLOWED_GEOLOCATION_ORIGINS
5020 = "allowed_geolocation_origins";
5021
5022 /**
Wink Savillee9b06d72009-05-18 21:47:50 -07005023 * The preferred TTY mode 0 = TTy Off, CDMA default
5024 * 1 = TTY Full
5025 * 2 = TTY HCO
5026 * 3 = TTY VCO
5027 * @hide
5028 */
5029 public static final String PREFERRED_TTY_MODE =
5030 "preferred_tty_mode";
5031
Wink Saville04e71b32009-04-02 11:00:54 -07005032 /**
Wink Saville04e71b32009-04-02 11:00:54 -07005033 * Whether the enhanced voice privacy mode is enabled.
5034 * 0 = normal voice privacy
5035 * 1 = enhanced voice privacy
5036 * @hide
5037 */
5038 public static final String ENHANCED_VOICE_PRIVACY_ENABLED = "enhanced_voice_privacy_enabled";
5039
5040 /**
5041 * Whether the TTY mode mode is enabled.
5042 * 0 = disabled
5043 * 1 = enabled
5044 * @hide
5045 */
5046 public static final String TTY_MODE_ENABLED = "tty_mode_enabled";
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005047
5048 /**
Christopher Tate8031a3d2009-07-06 16:36:05 -07005049 * Controls whether settings backup is enabled.
Dianne Hackborncf098292009-07-01 19:55:20 -07005050 * Type: int ( 0 = disabled, 1 = enabled )
5051 * @hide
5052 */
5053 public static final String BACKUP_ENABLED = "backup_enabled";
5054
5055 /**
Christopher Tatecce9da52010-02-03 15:11:15 -08005056 * Controls whether application data is automatically restored from backup
5057 * at install time.
5058 * Type: int ( 0 = disabled, 1 = enabled )
5059 * @hide
5060 */
5061 public static final String BACKUP_AUTO_RESTORE = "backup_auto_restore";
5062
5063 /**
Christopher Tate8031a3d2009-07-06 16:36:05 -07005064 * Indicates whether settings backup has been fully provisioned.
5065 * Type: int ( 0 = unprovisioned, 1 = fully provisioned )
5066 * @hide
5067 */
5068 public static final String BACKUP_PROVISIONED = "backup_provisioned";
5069
5070 /**
Dianne Hackborncf098292009-07-01 19:55:20 -07005071 * Component of the transport to use for backup/restore.
5072 * @hide
5073 */
5074 public static final String BACKUP_TRANSPORT = "backup_transport";
Sanjay Jeyakumar21bf2412009-07-09 13:31:48 -07005075
Dianne Hackbornd7cd29d2009-07-01 11:22:45 -07005076 /**
5077 * Version for which the setup wizard was last shown. Bumped for
5078 * each release when there is new setup information to show.
5079 * @hide
5080 */
5081 public static final String LAST_SETUP_SHOWN = "last_setup_shown";
Dianne Hackborncf098292009-07-01 19:55:20 -07005082
5083 /**
Doug Zongker43866e02010-01-07 12:09:54 -08005084 * The interval in milliseconds after which Wi-Fi is considered idle.
5085 * When idle, it is possible for the device to be switched from Wi-Fi to
5086 * the mobile data network.
5087 * @hide
Jeff Brownbf6f6f92012-09-25 15:03:20 -07005088 * @deprecated Use {@link android.provider.Settings.Global#WIFI_IDLE_MS}
5089 * instead.
Doug Zongker43866e02010-01-07 12:09:54 -08005090 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07005091 @Deprecated
5092 public static final String WIFI_IDLE_MS = Global.WIFI_IDLE_MS;
Doug Zongker43866e02010-01-07 12:09:54 -08005093
5094 /**
Narayan Kamathee69ff42011-06-28 12:07:18 +01005095 * The global search provider chosen by the user (if multiple global
5096 * search providers are installed). This will be the provider returned
5097 * by {@link SearchManager#getGlobalSearchActivity()} if it's still
5098 * installed. This setting is stored as a flattened component name as
5099 * per {@link ComponentName#flattenToString()}.
5100 *
5101 * @hide
5102 */
5103 public static final String SEARCH_GLOBAL_SEARCH_ACTIVITY =
5104 "search_global_search_activity";
5105
5106 /**
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08005107 * The number of promoted sources in GlobalSearch.
5108 * @hide
5109 */
5110 public static final String SEARCH_NUM_PROMOTED_SOURCES = "search_num_promoted_sources";
5111 /**
5112 * The maximum number of suggestions returned by GlobalSearch.
5113 * @hide
5114 */
5115 public static final String SEARCH_MAX_RESULTS_TO_DISPLAY = "search_max_results_to_display";
5116 /**
5117 * The number of suggestions GlobalSearch will ask each non-web search source for.
5118 * @hide
5119 */
5120 public static final String SEARCH_MAX_RESULTS_PER_SOURCE = "search_max_results_per_source";
5121 /**
5122 * The number of suggestions the GlobalSearch will ask the web search source for.
5123 * @hide
5124 */
5125 public static final String SEARCH_WEB_RESULTS_OVERRIDE_LIMIT =
5126 "search_web_results_override_limit";
5127 /**
5128 * The number of milliseconds that GlobalSearch will wait for suggestions from
5129 * promoted sources before continuing with all other sources.
5130 * @hide
5131 */
5132 public static final String SEARCH_PROMOTED_SOURCE_DEADLINE_MILLIS =
5133 "search_promoted_source_deadline_millis";
5134 /**
5135 * The number of milliseconds before GlobalSearch aborts search suggesiton queries.
5136 * @hide
5137 */
5138 public static final String SEARCH_SOURCE_TIMEOUT_MILLIS = "search_source_timeout_millis";
5139 /**
5140 * The maximum number of milliseconds that GlobalSearch shows the previous results
5141 * after receiving a new query.
5142 * @hide
5143 */
5144 public static final String SEARCH_PREFILL_MILLIS = "search_prefill_millis";
5145 /**
5146 * The maximum age of log data used for shortcuts in GlobalSearch.
5147 * @hide
5148 */
5149 public static final String SEARCH_MAX_STAT_AGE_MILLIS = "search_max_stat_age_millis";
5150 /**
5151 * The maximum age of log data used for source ranking in GlobalSearch.
5152 * @hide
5153 */
5154 public static final String SEARCH_MAX_SOURCE_EVENT_AGE_MILLIS =
5155 "search_max_source_event_age_millis";
5156 /**
5157 * The minimum number of impressions needed to rank a source in GlobalSearch.
5158 * @hide
5159 */
5160 public static final String SEARCH_MIN_IMPRESSIONS_FOR_SOURCE_RANKING =
5161 "search_min_impressions_for_source_ranking";
5162 /**
5163 * The minimum number of clicks needed to rank a source in GlobalSearch.
5164 * @hide
5165 */
5166 public static final String SEARCH_MIN_CLICKS_FOR_SOURCE_RANKING =
5167 "search_min_clicks_for_source_ranking";
5168 /**
5169 * The maximum number of shortcuts shown by GlobalSearch.
5170 * @hide
5171 */
5172 public static final String SEARCH_MAX_SHORTCUTS_RETURNED = "search_max_shortcuts_returned";
5173 /**
5174 * The size of the core thread pool for suggestion queries in GlobalSearch.
5175 * @hide
5176 */
5177 public static final String SEARCH_QUERY_THREAD_CORE_POOL_SIZE =
5178 "search_query_thread_core_pool_size";
5179 /**
5180 * The maximum size of the thread pool for suggestion queries in GlobalSearch.
5181 * @hide
5182 */
5183 public static final String SEARCH_QUERY_THREAD_MAX_POOL_SIZE =
5184 "search_query_thread_max_pool_size";
5185 /**
5186 * The size of the core thread pool for shortcut refreshing in GlobalSearch.
5187 * @hide
5188 */
5189 public static final String SEARCH_SHORTCUT_REFRESH_CORE_POOL_SIZE =
5190 "search_shortcut_refresh_core_pool_size";
5191 /**
5192 * The maximum size of the thread pool for shortcut refreshing in GlobalSearch.
5193 * @hide
5194 */
5195 public static final String SEARCH_SHORTCUT_REFRESH_MAX_POOL_SIZE =
5196 "search_shortcut_refresh_max_pool_size";
5197 /**
5198 * The maximun time that excess threads in the GlobalSeach thread pools will
5199 * wait before terminating.
5200 * @hide
5201 */
5202 public static final String SEARCH_THREAD_KEEPALIVE_SECONDS =
5203 "search_thread_keepalive_seconds";
5204 /**
5205 * The maximum number of concurrent suggestion queries to each source.
5206 * @hide
5207 */
5208 public static final String SEARCH_PER_SOURCE_CONCURRENT_QUERY_LIMIT =
5209 "search_per_source_concurrent_query_limit";
5210
San Mehat87734d32010-01-08 12:53:06 -08005211 /**
5212 * Whether or not alert sounds are played on MountService events. (0 = false, 1 = true)
5213 * @hide
5214 */
5215 public static final String MOUNT_PLAY_NOTIFICATION_SND = "mount_play_not_snd";
5216
5217 /**
5218 * Whether or not UMS auto-starts on UMS host detection. (0 = false, 1 = true)
5219 * @hide
5220 */
5221 public static final String MOUNT_UMS_AUTOSTART = "mount_ums_autostart";
5222
5223 /**
5224 * Whether or not a notification is displayed on UMS host detection. (0 = false, 1 = true)
5225 * @hide
5226 */
5227 public static final String MOUNT_UMS_PROMPT = "mount_ums_prompt";
5228
5229 /**
5230 * Whether or not a notification is displayed while UMS is enabled. (0 = false, 1 = true)
5231 * @hide
5232 */
5233 public static final String MOUNT_UMS_NOTIFY_ENABLED = "mount_ums_notify_enabled";
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08005234
Dan Egnor42471dd2010-01-07 17:25:22 -08005235 /**
5236 * If nonzero, ANRs in invisible background processes bring up a dialog.
5237 * Otherwise, the process will be silently killed.
5238 * @hide
5239 */
5240 public static final String ANR_SHOW_BACKGROUND = "anr_show_background";
Erikeebc8e22010-02-18 13:27:19 -08005241
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08005242 /**
5243 * The {@link ComponentName} string of the service to be used as the voice recognition
5244 * service.
Erikeebc8e22010-02-18 13:27:19 -08005245 *
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08005246 * @hide
5247 */
5248 public static final String VOICE_RECOGNITION_SERVICE = "voice_recognition_service";
Dan Egnor42471dd2010-01-07 17:25:22 -08005249
William Luh623a4282013-06-24 12:14:18 -07005250 /**
5251 * Stores whether an user has consented to have apps verified through PAM.
5252 * The value is boolean (1 or 0).
5253 *
5254 * @hide
5255 */
5256 public static final String PACKAGE_VERIFIER_USER_CONSENT =
5257 "package_verifier_user_consent";
satok988323c2011-06-22 16:38:13 +09005258
5259 /**
satokada8c4e2011-08-23 14:56:56 +09005260 * The {@link ComponentName} string of the selected spell checker service which is
5261 * one of the services managed by the text service manager.
5262 *
5263 * @hide
5264 */
5265 public static final String SELECTED_SPELL_CHECKER = "selected_spell_checker";
5266
5267 /**
5268 * The {@link ComponentName} string of the selected subtype of the selected spell checker
satok988323c2011-06-22 16:38:13 +09005269 * service which is one of the services managed by the text service manager.
5270 *
5271 * @hide
5272 */
satokada8c4e2011-08-23 14:56:56 +09005273 public static final String SELECTED_SPELL_CHECKER_SUBTYPE =
5274 "selected_spell_checker_subtype";
satok988323c2011-06-22 16:38:13 +09005275
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08005276 /**
satoka33c4fc2011-08-25 16:50:11 +09005277 * The {@link ComponentName} string whether spell checker is enabled or not.
5278 *
5279 * @hide
5280 */
5281 public static final String SPELL_CHECKER_ENABLED = "spell_checker_enabled";
5282
5283 /**
David Brown458e8062010-03-08 21:52:11 -08005284 * What happens when the user presses the Power button while in-call
5285 * and the screen is on.<br/>
5286 * <b>Values:</b><br/>
5287 * 1 - The Power button turns off the screen and locks the device. (Default behavior)<br/>
5288 * 2 - The Power button hangs up the current call.<br/>
5289 *
5290 * @hide
5291 */
5292 public static final String INCALL_POWER_BUTTON_BEHAVIOR = "incall_power_button_behavior";
5293
5294 /**
5295 * INCALL_POWER_BUTTON_BEHAVIOR value for "turn off screen".
5296 * @hide
5297 */
5298 public static final int INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF = 0x1;
5299
5300 /**
5301 * INCALL_POWER_BUTTON_BEHAVIOR value for "hang up".
5302 * @hide
5303 */
5304 public static final int INCALL_POWER_BUTTON_BEHAVIOR_HANGUP = 0x2;
5305
5306 /**
5307 * INCALL_POWER_BUTTON_BEHAVIOR default value.
5308 * @hide
5309 */
5310 public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT =
5311 INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF;
5312
5313 /**
Jeff Browna20dda42014-05-27 20:57:24 -07005314 * Whether the device should wake when the wake gesture sensor detects motion.
5315 * @hide
5316 */
5317 public static final String WAKE_GESTURE_ENABLED = "wake_gesture_enabled";
5318
5319 /**
John Spurlocka4215ce2014-08-04 14:50:38 -04005320 * Whether the device should doze if configured.
5321 * @hide
5322 */
5323 public static final String DOZE_ENABLED = "doze_enabled";
5324
5325 /**
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07005326 * The current night mode that has been selected by the user. Owned
5327 * and controlled by UiModeManagerService. Constants are as per
5328 * UiModeManager.
5329 * @hide
5330 */
5331 public static final String UI_NIGHT_MODE = "ui_night_mode";
Suchi Amalapurapu40e47252010-04-07 16:15:50 -07005332
5333 /**
John Spurlock1a868b72012-08-22 09:56:51 -04005334 * Whether screensavers are enabled.
Daniel Sandler0601eb72011-04-13 01:01:32 -04005335 * @hide
5336 */
Daniel Sandler2d545362011-11-17 10:38:37 -08005337 public static final String SCREENSAVER_ENABLED = "screensaver_enabled";
Daniel Sandler0601eb72011-04-13 01:01:32 -04005338
5339 /**
John Spurlock1a868b72012-08-22 09:56:51 -04005340 * The user's chosen screensaver components.
Daniel Sandler2d545362011-11-17 10:38:37 -08005341 *
John Spurlock1a868b72012-08-22 09:56:51 -04005342 * These will be launched by the PhoneWindowManager after a timeout when not on
Daniel Sandler2d545362011-11-17 10:38:37 -08005343 * battery, or upon dock insertion (if SCREENSAVER_ACTIVATE_ON_DOCK is set to 1).
Daniel Sandler0601eb72011-04-13 01:01:32 -04005344 * @hide
5345 */
John Spurlock1a868b72012-08-22 09:56:51 -04005346 public static final String SCREENSAVER_COMPONENTS = "screensaver_components";
Daniel Sandler2d545362011-11-17 10:38:37 -08005347
5348 /**
John Spurlock1a868b72012-08-22 09:56:51 -04005349 * If screensavers are enabled, whether the screensaver should be automatically launched
5350 * when the device is inserted into a (desk) dock.
Daniel Sandler2d545362011-11-17 10:38:37 -08005351 * @hide
5352 */
5353 public static final String SCREENSAVER_ACTIVATE_ON_DOCK = "screensaver_activate_on_dock";
Daniel Sandler0601eb72011-04-13 01:01:32 -04005354
John Spurlock1a868b72012-08-22 09:56:51 -04005355 /**
5356 * If screensavers are enabled, whether the screensaver should be automatically launched
5357 * when the screen times out when not on battery.
5358 * @hide
5359 */
5360 public static final String SCREENSAVER_ACTIVATE_ON_SLEEP = "screensaver_activate_on_sleep";
5361
5362 /**
5363 * If screensavers are enabled, the default screensaver component.
5364 * @hide
5365 */
5366 public static final String SCREENSAVER_DEFAULT_COMPONENT = "screensaver_default_component";
5367
Daniel Sandler0601eb72011-04-13 01:01:32 -04005368 /**
Martijn Coenena7397882013-07-30 20:07:47 -07005369 * The default NFC payment component
5370 * @hide
5371 */
5372 public static final String NFC_PAYMENT_DEFAULT_COMPONENT = "nfc_payment_default_component";
5373
5374 /**
Martijn Coenen2f6f3a012014-04-25 17:00:21 -07005375 * Whether NFC payment is handled by the foreground application or a default.
5376 * @hide
5377 */
5378 public static final String NFC_PAYMENT_FOREGROUND = "nfc_payment_foreground";
5379
5380 /**
David Braunf5d83192013-09-16 13:43:51 -07005381 * Specifies the package name currently configured to be the primary sms application
5382 * @hide
5383 */
5384 public static final String SMS_DEFAULT_APPLICATION = "sms_default_application";
5385
5386 /**
Yorke Lee014de022015-04-21 17:15:47 -07005387 * Specifies the package name currently configured to be the default dialer application
5388 * @hide
5389 */
5390 public static final String DIALER_DEFAULT_APPLICATION = "dialer_default_application";
5391
5392 /**
Adrian Roos943eb862015-03-26 12:31:16 -07005393 * Specifies the package name currently configured to be the emergency assistance application
5394 *
5395 * @see android.telephony.TelephonyManager#ACTION_EMERGENCY_ASSISTANCE
5396 *
5397 * @hide
5398 */
5399 public static final String EMERGENCY_ASSISTANCE_APPLICATION = "emergency_assistance_application";
5400
5401 /**
Chris Wren8326a8a2014-10-22 14:13:32 -04005402 * Names of the packages that the current user has explicitly allowed to
5403 * see all of the user's notifications, separated by ':'.
Daniel Sandler4b749ef2013-03-18 21:53:04 -04005404 *
5405 * @hide
5406 */
5407 public static final String ENABLED_NOTIFICATION_LISTENERS = "enabled_notification_listeners";
5408
John Spurlock7340fc82014-04-24 18:50:12 -04005409 /**
5410 * @hide
5411 */
5412 public static final String ENABLED_CONDITION_PROVIDERS = "enabled_condition_providers";
5413
John Spurlock5c454122013-06-17 07:35:46 -04005414 /** @hide */
5415 public static final String BAR_SERVICE_COMPONENT = "bar_service_component";
5416
John Spurlockd67ec252013-09-05 11:31:54 -04005417 /** @hide */
John Spurlockcdb57ae2015-02-11 19:04:11 -05005418 public static final String VOLUME_CONTROLLER_SERVICE_COMPONENT
5419 = "volume_controller_service_component";
5420
5421 /** @hide */
John Spurlockf1a36642013-10-12 17:50:42 -04005422 public static final String IMMERSIVE_MODE_CONFIRMATIONS = "immersive_mode_confirmations";
John Spurlockd67ec252013-09-05 11:31:54 -04005423
Yorke Lee647f8f32013-05-07 10:49:44 -07005424 /**
Svetoslavf43e8512013-09-30 17:33:05 -07005425 * This is the query URI for finding a print service to install.
5426 *
5427 * @hide
5428 */
5429 public static final String PRINT_SERVICE_SEARCH_URI = "print_service_search_uri";
5430
5431 /**
5432 * This is the query URI for finding a NFC payment service to install.
5433 *
5434 * @hide
5435 */
5436 public static final String PAYMENT_SERVICE_SEARCH_URI = "payment_service_search_uri";
5437
5438 /**
Amith Yamasani1e9c2182014-06-11 17:25:51 -07005439 * If enabled, apps should try to skip any introductory hints on first launch. This might
Amith Yamasani0c416392014-06-13 15:54:39 -07005440 * apply to users that are already familiar with the environment or temporary users.
Amith Yamasani1e9c2182014-06-11 17:25:51 -07005441 * <p>
5442 * Type : int (0 to show hints, 1 to skip showing hints)
Amith Yamasani1e9c2182014-06-11 17:25:51 -07005443 */
5444 public static final String SKIP_FIRST_USE_HINTS = "skip_first_use_hints";
5445
5446 /**
John Spurlockaa5ee4d2014-07-25 13:05:12 -04005447 * Persisted playback time after a user confirmation of an unsafe volume level.
5448 *
5449 * @hide
5450 */
5451 public static final String UNSAFE_VOLUME_MUSIC_ACTIVE_MS = "unsafe_volume_music_active_ms";
5452
5453 /**
Dan Sandler52e5701e2014-07-22 23:14:54 -04005454 * This preference enables notification display on the lockscreen.
5455 * @hide
5456 */
5457 public static final String LOCK_SCREEN_SHOW_NOTIFICATIONS =
5458 "lock_screen_show_notifications";
5459
5460 /**
Dongwon Kang4d933a02014-08-07 22:51:47 -07005461 * List of TV inputs that are currently hidden. This is a string
Jaewan Kimf0e530e2014-08-22 00:43:31 +09005462 * containing the IDs of all hidden TV inputs. Each ID is encoded by
5463 * {@link android.net.Uri#encode(String)} and separated by ':'.
Dongwon Kang4d933a02014-08-07 22:51:47 -07005464 * @hide
5465 */
5466 public static final String TV_INPUT_HIDDEN_INPUTS = "tv_input_hidden_inputs";
5467
5468 /**
5469 * List of custom TV input labels. This is a string containing <TV input id, custom name>
Jaewan Kimf0e530e2014-08-22 00:43:31 +09005470 * pairs. TV input id and custom name are encoded by {@link android.net.Uri#encode(String)}
5471 * and separated by ','. Each pair is separated by ':'.
Dongwon Kang4d933a02014-08-07 22:51:47 -07005472 * @hide
5473 */
5474 public static final String TV_INPUT_CUSTOM_LABELS = "tv_input_custom_labels";
5475
5476 /**
Glenn Kasten34cc4db2014-08-13 10:56:38 -07005477 * Whether automatic routing of system audio to USB audio peripheral is disabled.
5478 * The value is boolean (1 or 0), where 1 means automatic routing is disabled,
5479 * and 0 means automatic routing is enabled.
5480 *
5481 * @hide
5482 */
5483 public static final String USB_AUDIO_AUTOMATIC_ROUTING_DISABLED =
5484 "usb_audio_automatic_routing_disabled";
5485
5486 /**
Jeff Brown05af6ad2014-09-30 20:54:30 -07005487 * The timeout in milliseconds before the device fully goes to sleep after
5488 * a period of inactivity. This value sets an upper bound on how long the device
5489 * will stay awake or dreaming without user activity. It should generally
Dianne Hackbornad6a99b2014-11-18 10:11:10 -08005490 * be longer than {@link Settings.System#SCREEN_OFF_TIMEOUT} as otherwise the device
Jeff Brown05af6ad2014-09-30 20:54:30 -07005491 * will sleep before it ever has a chance to dream.
5492 * <p>
5493 * Use -1 to disable this timeout.
5494 * </p>
5495 *
5496 * @hide
5497 */
5498 public static final String SLEEP_TIMEOUT = "sleep_timeout";
5499
5500 /**
Amith Yamasanib0ff3222015-03-04 09:56:14 -08005501 * Duration in milliseconds that an app should be inactive before it is considered idle.
5502 * <p/>Type: Long
5503 * @hide
5504 */
5505 public static final String APP_IDLE_DURATION = "app_idle_duration";
5506
5507 /**
Svetoslav Ganova571a582011-09-20 18:32:20 -07005508 * This are the settings to be backed up.
5509 *
5510 * NOTE: Settings are backed up and restored in the order they appear
5511 * in this array. If you have one setting depending on another,
5512 * make sure that they are ordered appropriately.
5513 *
-b master501eec92009-07-06 13:53:11 -07005514 * @hide
5515 */
5516 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate58f41ec2013-01-11 15:40:36 -08005517 BUGREPORT_IN_POWER_MENU, // moved to global
Amith Yamasani8823c0a82009-07-07 14:30:17 -07005518 ALLOW_MOCK_LOCATION,
-b master501eec92009-07-06 13:53:11 -07005519 PARENTAL_CONTROL_ENABLED,
5520 PARENTAL_CONTROL_REDIRECT_URL,
Christopher Tate66488d62012-10-02 11:58:01 -07005521 USB_MASS_STORAGE_ENABLED, // moved to global
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07005522 ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED,
5523 ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE,
5524 ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE,
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07005525 ACCESSIBILITY_SCRIPT_INJECTION,
Christopher Tate14c2d792010-02-25 16:49:44 -08005526 BACKUP_AUTO_RESTORE,
-b master501eec92009-07-06 13:53:11 -07005527 ENABLED_ACCESSIBILITY_SERVICES,
Christopher Tate6597e342015-02-17 12:15:25 -08005528 ENABLED_NOTIFICATION_LISTENERS,
Christopher Tate7b9a28c2015-03-18 13:06:16 -07005529 ENABLED_INPUT_METHODS,
Svetoslav Ganov9a4c5cd2012-05-30 14:06:32 -07005530 TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES,
Svetoslav Ganova28a16d2011-07-28 11:24:21 -07005531 TOUCH_EXPLORATION_ENABLED,
Svetoslav Ganova571a582011-09-20 18:32:20 -07005532 ACCESSIBILITY_ENABLED,
Svetoslav Ganov55f937a2011-12-05 11:42:07 -08005533 ACCESSIBILITY_SPEAK_PASSWORD,
Chris Craikcce47eb2014-07-16 15:12:15 -07005534 ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED,
Alan Viveretteef793802013-07-23 14:15:28 -07005535 ACCESSIBILITY_CAPTIONING_ENABLED,
5536 ACCESSIBILITY_CAPTIONING_LOCALE,
5537 ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR,
5538 ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR,
5539 ACCESSIBILITY_CAPTIONING_EDGE_TYPE,
5540 ACCESSIBILITY_CAPTIONING_EDGE_COLOR,
5541 ACCESSIBILITY_CAPTIONING_TYPEFACE,
Alan Viverette69ce69b2013-08-29 12:23:48 -07005542 ACCESSIBILITY_CAPTIONING_FONT_SCALE,
-b master501eec92009-07-06 13:53:11 -07005543 TTS_USE_DEFAULTS,
5544 TTS_DEFAULT_RATE,
5545 TTS_DEFAULT_PITCH,
5546 TTS_DEFAULT_SYNTH,
5547 TTS_DEFAULT_LANG,
5548 TTS_DEFAULT_COUNTRY,
Charles Chenceffa152010-03-16 21:18:10 -07005549 TTS_ENABLED_PLUGINS,
Narayan Kamath6d632962011-08-24 11:51:37 +01005550 TTS_DEFAULT_LOCALE,
Christopher Tate66488d62012-10-02 11:58:01 -07005551 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, // moved to global
5552 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, // moved to global
5553 WIFI_NUM_OPEN_NETWORKS_KEPT, // moved to global
Christopher Tate06cbadd2015-03-16 18:29:42 -07005554 SELECTED_SPELL_CHECKER,
5555 SELECTED_SPELL_CHECKER_SUBTYPE,
5556 SPELL_CHECKER_ENABLED,
San Mehat87734d32010-01-08 12:53:06 -08005557 MOUNT_PLAY_NOTIFICATION_SND,
5558 MOUNT_UMS_AUTOSTART,
5559 MOUNT_UMS_PROMPT,
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07005560 MOUNT_UMS_NOTIFY_ENABLED,
Jeff Brown05af6ad2014-09-30 20:54:30 -07005561 UI_NIGHT_MODE,
5562 SLEEP_TIMEOUT
-b master501eec92009-07-06 13:53:11 -07005563 };
5564
5565 /**
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07005566 * These entries are considered common between the personal and the managed profile,
5567 * since the managed profile doesn't get to change them.
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07005568 */
Svetoslav683914b2015-01-15 14:22:26 -08005569 private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>();
Amith Yamasanib0ff3222015-03-04 09:56:14 -08005570
Svetoslav683914b2015-01-15 14:22:26 -08005571 static {
5572 CLONE_TO_MANAGED_PROFILE.add(ACCESSIBILITY_ENABLED);
5573 CLONE_TO_MANAGED_PROFILE.add(ALLOW_MOCK_LOCATION);
5574 CLONE_TO_MANAGED_PROFILE.add(ALLOWED_GEOLOCATION_ORIGINS);
5575 CLONE_TO_MANAGED_PROFILE.add(DEFAULT_INPUT_METHOD);
5576 CLONE_TO_MANAGED_PROFILE.add(ENABLED_ACCESSIBILITY_SERVICES);
5577 CLONE_TO_MANAGED_PROFILE.add(ENABLED_INPUT_METHODS);
5578 CLONE_TO_MANAGED_PROFILE.add(LOCATION_MODE);
5579 CLONE_TO_MANAGED_PROFILE.add(LOCATION_PROVIDERS_ALLOWED);
5580 CLONE_TO_MANAGED_PROFILE.add(LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS);
5581 CLONE_TO_MANAGED_PROFILE.add(SELECTED_INPUT_METHOD_SUBTYPE);
5582 CLONE_TO_MANAGED_PROFILE.add(SELECTED_SPELL_CHECKER);
5583 CLONE_TO_MANAGED_PROFILE.add(SELECTED_SPELL_CHECKER_SUBTYPE);
5584 }
5585
5586 /** @hide */
5587 public static void getCloneToManagedProfileSettings(Set<String> outKeySet) {
5588 outKeySet.addAll(CLONE_TO_MANAGED_PROFILE);
5589 }
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07005590
5591 /**
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005592 * Helper method for determining if a location provider is enabled.
Tom O'Neilld5759432013-09-11 11:03:03 -07005593 *
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005594 * @param cr the content resolver to use
5595 * @param provider the location provider to query
5596 * @return true if the provider is enabled
Tom O'Neilld5759432013-09-11 11:03:03 -07005597 *
5598 * @deprecated use {@link #LOCATION_MODE} or
5599 * {@link LocationManager#isProviderEnabled(String)}
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005600 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07005601 @Deprecated
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005602 public static final boolean isLocationProviderEnabled(ContentResolver cr, String provider) {
Victoria Leaseb711d572012-10-02 13:14:11 -07005603 return isLocationProviderEnabledForUser(cr, provider, UserHandle.myUserId());
5604 }
5605
5606 /**
5607 * Helper method for determining if a location provider is enabled.
5608 * @param cr the content resolver to use
5609 * @param provider the location provider to query
5610 * @param userId the userId to query
5611 * @return true if the provider is enabled
Tom O'Neilld5759432013-09-11 11:03:03 -07005612 * @deprecated use {@link #LOCATION_MODE} or
5613 * {@link LocationManager#isProviderEnabled(String)}
Victoria Leaseb711d572012-10-02 13:14:11 -07005614 * @hide
5615 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07005616 @Deprecated
Victoria Leaseb711d572012-10-02 13:14:11 -07005617 public static final boolean isLocationProviderEnabledForUser(ContentResolver cr, String provider, int userId) {
5618 String allowedProviders = Settings.Secure.getStringForUser(cr,
5619 LOCATION_PROVIDERS_ALLOWED, userId);
Brad Fitzpatrick11fe1812010-09-10 16:07:52 -07005620 return TextUtils.delimitedStringContains(allowedProviders, ',', provider);
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005621 }
5622
5623 /**
5624 * Thread-safe method for enabling or disabling a single location provider.
5625 * @param cr the content resolver to use
5626 * @param provider the location provider to enable or disable
5627 * @param enabled true if the provider should be enabled
Tom O'Neilla324ac72013-08-26 14:40:23 -07005628 * @deprecated use {@link #putInt(ContentResolver, String, int)} and {@link #LOCATION_MODE}
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005629 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07005630 @Deprecated
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005631 public static final void setLocationProviderEnabled(ContentResolver cr,
5632 String provider, boolean enabled) {
Victoria Leaseb711d572012-10-02 13:14:11 -07005633 setLocationProviderEnabledForUser(cr, provider, enabled, UserHandle.myUserId());
5634 }
5635
5636 /**
5637 * Thread-safe method for enabling or disabling a single location provider.
Tom O'Neilla324ac72013-08-26 14:40:23 -07005638 *
Victoria Leaseb711d572012-10-02 13:14:11 -07005639 * @param cr the content resolver to use
5640 * @param provider the location provider to enable or disable
5641 * @param enabled true if the provider should be enabled
5642 * @param userId the userId for which to enable/disable providers
Tom O'Neilla324ac72013-08-26 14:40:23 -07005643 * @return true if the value was set, false on database errors
5644 * @deprecated use {@link #putIntForUser(ContentResolver, String, int, int)} and
5645 * {@link #LOCATION_MODE}
Victoria Leaseb711d572012-10-02 13:14:11 -07005646 * @hide
5647 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07005648 @Deprecated
Tom O'Neilla324ac72013-08-26 14:40:23 -07005649 public static final boolean setLocationProviderEnabledForUser(ContentResolver cr,
Victoria Leaseb711d572012-10-02 13:14:11 -07005650 String provider, boolean enabled, int userId) {
David Christie3f7b6522013-08-06 19:19:08 -07005651 synchronized (mLocationSettingsLock) {
5652 // to ensure thread safety, we write the provider name with a '+' or '-'
5653 // and let the SettingsProvider handle it rather than reading and modifying
5654 // the list of enabled providers.
5655 if (enabled) {
5656 provider = "+" + provider;
5657 } else {
5658 provider = "-" + provider;
5659 }
Tom O'Neilla324ac72013-08-26 14:40:23 -07005660 return putStringForUser(cr, Settings.Secure.LOCATION_PROVIDERS_ALLOWED, provider,
David Christie3f7b6522013-08-06 19:19:08 -07005661 userId);
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005662 }
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005663 }
Tom O'Neill1f48b782013-08-19 18:14:56 -07005664
5665 /**
5666 * Thread-safe method for setting the location mode to one of
5667 * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY},
5668 * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}.
5669 *
Tom O'Neill1f48b782013-08-19 18:14:56 -07005670 * @param cr the content resolver to use
5671 * @param mode such as {@link #LOCATION_MODE_HIGH_ACCURACY}
5672 * @param userId the userId for which to change mode
Tom O'Neilla324ac72013-08-26 14:40:23 -07005673 * @return true if the value was set, false on database errors
Tom O'Neill1f48b782013-08-19 18:14:56 -07005674 *
5675 * @throws IllegalArgumentException if mode is not one of the supported values
5676 */
Tom O'Neill7f6f4572013-08-27 10:53:15 -07005677 private static final boolean setLocationModeForUser(ContentResolver cr, int mode,
5678 int userId) {
Tom O'Neill1f48b782013-08-19 18:14:56 -07005679 synchronized (mLocationSettingsLock) {
5680 boolean gps = false;
5681 boolean network = false;
5682 switch (mode) {
5683 case LOCATION_MODE_OFF:
5684 break;
5685 case LOCATION_MODE_SENSORS_ONLY:
5686 gps = true;
5687 break;
5688 case LOCATION_MODE_BATTERY_SAVING:
5689 network = true;
5690 break;
5691 case LOCATION_MODE_HIGH_ACCURACY:
5692 gps = true;
5693 network = true;
5694 break;
5695 default:
5696 throw new IllegalArgumentException("Invalid location mode: " + mode);
5697 }
Tom O'Neill7731a992014-10-09 11:30:49 -07005698 // Note it's important that we set the NLP mode first. The Google implementation
5699 // of NLP clears its NLP consent setting any time it receives a
5700 // LocationManager.PROVIDERS_CHANGED_ACTION broadcast and NLP is disabled. Also,
5701 // it shows an NLP consent dialog any time it receives the broadcast, NLP is
5702 // enabled, and the NLP consent is not set. If 1) we were to enable GPS first,
5703 // 2) a setup wizard has its own NLP consent UI that sets the NLP consent setting,
5704 // and 3) the receiver happened to complete before we enabled NLP, then the Google
5705 // NLP would detect the attempt to enable NLP and show a redundant NLP consent
5706 // dialog. Then the people who wrote the setup wizard would be sad.
Tom O'Neilla324ac72013-08-26 14:40:23 -07005707 boolean nlpSuccess = Settings.Secure.setLocationProviderEnabledForUser(
Tom O'Neill1f48b782013-08-19 18:14:56 -07005708 cr, LocationManager.NETWORK_PROVIDER, network, userId);
Tom O'Neill7731a992014-10-09 11:30:49 -07005709 boolean gpsSuccess = Settings.Secure.setLocationProviderEnabledForUser(
5710 cr, LocationManager.GPS_PROVIDER, gps, userId);
Tom O'Neilla324ac72013-08-26 14:40:23 -07005711 return gpsSuccess && nlpSuccess;
Tom O'Neill1f48b782013-08-19 18:14:56 -07005712 }
5713 }
5714
5715 /**
Tom O'Neill1f48b782013-08-19 18:14:56 -07005716 * Thread-safe method for reading the location mode, returns one of
5717 * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY},
5718 * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}.
5719 *
5720 * @param cr the content resolver to use
5721 * @param userId the userId for which to read the mode
5722 * @return the location mode
5723 */
Tom O'Neill7f6f4572013-08-27 10:53:15 -07005724 private static final int getLocationModeForUser(ContentResolver cr, int userId) {
Tom O'Neill1f48b782013-08-19 18:14:56 -07005725 synchronized (mLocationSettingsLock) {
5726 boolean gpsEnabled = Settings.Secure.isLocationProviderEnabledForUser(
5727 cr, LocationManager.GPS_PROVIDER, userId);
5728 boolean networkEnabled = Settings.Secure.isLocationProviderEnabledForUser(
5729 cr, LocationManager.NETWORK_PROVIDER, userId);
5730 if (gpsEnabled && networkEnabled) {
5731 return LOCATION_MODE_HIGH_ACCURACY;
5732 } else if (gpsEnabled) {
5733 return LOCATION_MODE_SENSORS_ONLY;
5734 } else if (networkEnabled) {
5735 return LOCATION_MODE_BATTERY_SAVING;
5736 } else {
5737 return LOCATION_MODE_OFF;
5738 }
5739 }
5740 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005741 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005742
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005743 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005744 * Global system settings, containing preferences that always apply identically
5745 * to all defined users. Applications can read these but are not allowed to write;
5746 * like the "Secure" settings, these are for preferences that the user must
5747 * explicitly modify through the system UI or specialized APIs for those values.
5748 */
5749 public static final class Global extends NameValueTable {
5750 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_global_version";
5751
5752 /**
5753 * The content:// style URL for global secure settings items. Not public.
5754 */
5755 public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/global");
5756
5757 /**
Amith Yamasani23a0f052014-07-25 12:26:53 -07005758 * Whether users are allowed to add more users or guest from lockscreen.
5759 * <p>
5760 * Type: int
5761 * @hide
5762 */
5763 public static final String ADD_USERS_WHEN_LOCKED = "add_users_when_locked";
5764
5765 /**
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07005766 * Setting whether the global gesture for enabling accessibility is enabled.
5767 * If this gesture is enabled the user will be able to perfrom it to enable
5768 * the accessibility state without visiting the settings app.
5769 * @hide
5770 */
5771 public static final String ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED =
5772 "enable_accessibility_global_gesture_enabled";
5773
5774 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005775 * Whether Airplane Mode is on.
5776 */
5777 public static final String AIRPLANE_MODE_ON = "airplane_mode_on";
5778
5779 /**
Bryce Lee584a4452014-10-21 15:55:55 -07005780 * Whether Theater Mode is on.
5781 * {@hide}
5782 */
Bryce Leecdfebd62015-02-02 08:19:11 -08005783 @SystemApi
Bryce Lee584a4452014-10-21 15:55:55 -07005784 public static final String THEATER_MODE_ON = "theater_mode_on";
5785
5786 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005787 * Constant for use in AIRPLANE_MODE_RADIOS to specify Bluetooth radio.
5788 */
5789 public static final String RADIO_BLUETOOTH = "bluetooth";
5790
5791 /**
5792 * Constant for use in AIRPLANE_MODE_RADIOS to specify Wi-Fi radio.
5793 */
5794 public static final String RADIO_WIFI = "wifi";
5795
5796 /**
5797 * {@hide}
5798 */
5799 public static final String RADIO_WIMAX = "wimax";
5800 /**
5801 * Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio.
5802 */
5803 public static final String RADIO_CELL = "cell";
5804
5805 /**
5806 * Constant for use in AIRPLANE_MODE_RADIOS to specify NFC radio.
5807 */
5808 public static final String RADIO_NFC = "nfc";
5809
5810 /**
5811 * A comma separated list of radios that need to be disabled when airplane mode
5812 * is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are
5813 * included in the comma separated list.
5814 */
5815 public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios";
5816
5817 /**
5818 * A comma separated list of radios that should to be disabled when airplane mode
5819 * is on, but can be manually reenabled by the user. For example, if RADIO_WIFI is
5820 * added to both AIRPLANE_MODE_RADIOS and AIRPLANE_MODE_TOGGLEABLE_RADIOS, then Wifi
5821 * will be turned off when entering airplane mode, but the user will be able to reenable
5822 * Wifi in the Settings app.
5823 *
5824 * {@hide}
5825 */
5826 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios";
5827
5828 /**
5829 * The policy for deciding when Wi-Fi should go to sleep (which will in
5830 * turn switch to using the mobile data as an Internet connection).
5831 * <p>
5832 * Set to one of {@link #WIFI_SLEEP_POLICY_DEFAULT},
5833 * {@link #WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED}, or
5834 * {@link #WIFI_SLEEP_POLICY_NEVER}.
5835 */
5836 public static final String WIFI_SLEEP_POLICY = "wifi_sleep_policy";
5837
5838 /**
5839 * Value for {@link #WIFI_SLEEP_POLICY} to use the default Wi-Fi sleep
5840 * policy, which is to sleep shortly after the turning off
5841 * according to the {@link #STAY_ON_WHILE_PLUGGED_IN} setting.
5842 */
5843 public static final int WIFI_SLEEP_POLICY_DEFAULT = 0;
5844
5845 /**
5846 * Value for {@link #WIFI_SLEEP_POLICY} to use the default policy when
5847 * the device is on battery, and never go to sleep when the device is
5848 * plugged in.
5849 */
5850 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1;
5851
5852 /**
5853 * Value for {@link #WIFI_SLEEP_POLICY} to never go to sleep.
5854 */
5855 public static final int WIFI_SLEEP_POLICY_NEVER = 2;
5856
5857 /**
5858 * Value to specify if the user prefers the date, time and time zone
5859 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
5860 */
5861 public static final String AUTO_TIME = "auto_time";
5862
5863 /**
5864 * Value to specify if the user prefers the time zone
5865 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
5866 */
5867 public static final String AUTO_TIME_ZONE = "auto_time_zone";
5868
5869 /**
5870 * URI for the car dock "in" event sound.
5871 * @hide
5872 */
5873 public static final String CAR_DOCK_SOUND = "car_dock_sound";
5874
5875 /**
5876 * URI for the car dock "out" event sound.
5877 * @hide
5878 */
5879 public static final String CAR_UNDOCK_SOUND = "car_undock_sound";
5880
5881 /**
5882 * URI for the desk dock "in" event sound.
5883 * @hide
5884 */
5885 public static final String DESK_DOCK_SOUND = "desk_dock_sound";
5886
5887 /**
5888 * URI for the desk dock "out" event sound.
5889 * @hide
5890 */
5891 public static final String DESK_UNDOCK_SOUND = "desk_undock_sound";
5892
5893 /**
5894 * Whether to play a sound for dock events.
5895 * @hide
5896 */
5897 public static final String DOCK_SOUNDS_ENABLED = "dock_sounds_enabled";
5898
5899 /**
5900 * URI for the "device locked" (keyguard shown) sound.
5901 * @hide
5902 */
5903 public static final String LOCK_SOUND = "lock_sound";
5904
5905 /**
5906 * URI for the "device unlocked" sound.
5907 * @hide
5908 */
5909 public static final String UNLOCK_SOUND = "unlock_sound";
5910
5911 /**
Adrian Roos49e057d2014-08-13 17:14:51 +02005912 * URI for the "device is trusted" sound, which is played when the device enters the trusted
5913 * state without unlocking.
5914 * @hide
5915 */
5916 public static final String TRUSTED_SOUND = "trusted_sound";
5917
5918 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005919 * URI for the low battery sound file.
5920 * @hide
5921 */
5922 public static final String LOW_BATTERY_SOUND = "low_battery_sound";
5923
5924 /**
5925 * Whether to play a sound for low-battery alerts.
5926 * @hide
5927 */
5928 public static final String POWER_SOUNDS_ENABLED = "power_sounds_enabled";
5929
5930 /**
Jeff Brown84e27562012-12-07 13:56:34 -08005931 * URI for the "wireless charging started" sound.
5932 * @hide
5933 */
5934 public static final String WIRELESS_CHARGING_STARTED_SOUND =
5935 "wireless_charging_started_sound";
5936
5937 /**
John Spurlock51a871d2015-05-06 17:41:30 -04005938 * Whether to play a sound for charging events.
5939 * @hide
5940 */
5941 public static final String CHARGING_SOUNDS_ENABLED = "charging_sounds_enabled";
5942
5943 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005944 * Whether we keep the device on while the device is plugged in.
5945 * Supported values are:
5946 * <ul>
5947 * <li>{@code 0} to never stay on while plugged in</li>
5948 * <li>{@link BatteryManager#BATTERY_PLUGGED_AC} to stay on for AC charger</li>
5949 * <li>{@link BatteryManager#BATTERY_PLUGGED_USB} to stay on for USB charger</li>
5950 * <li>{@link BatteryManager#BATTERY_PLUGGED_WIRELESS} to stay on for wireless charger</li>
5951 * </ul>
5952 * These values can be OR-ed together.
5953 */
5954 public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in";
5955
5956 /**
Christopher Tate58f41ec2013-01-11 15:40:36 -08005957 * When the user has enable the option to have a "bug report" command
5958 * in the power menu.
5959 * @hide
5960 */
5961 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
5962
5963 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005964 * Whether ADB is enabled.
5965 */
5966 public static final String ADB_ENABLED = "adb_enabled";
5967
5968 /**
Jon Miranda836c0a82014-08-11 12:32:26 -07005969 * Whether Views are allowed to save their attribute data.
5970 * @hide
5971 */
5972 public static final String DEBUG_VIEW_ATTRIBUTES = "debug_view_attributes";
5973
5974 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005975 * Whether assisted GPS should be enabled or not.
5976 * @hide
5977 */
5978 public static final String ASSISTED_GPS_ENABLED = "assisted_gps_enabled";
5979
5980 /**
5981 * Whether bluetooth is enabled/disabled
5982 * 0=disabled. 1=enabled.
5983 */
5984 public static final String BLUETOOTH_ON = "bluetooth_on";
5985
5986 /**
5987 * CDMA Cell Broadcast SMS
5988 * 0 = CDMA Cell Broadcast SMS disabled
5989 * 1 = CDMA Cell Broadcast SMS enabled
5990 * @hide
5991 */
5992 public static final String CDMA_CELL_BROADCAST_SMS =
5993 "cdma_cell_broadcast_sms";
5994
5995 /**
5996 * The CDMA roaming mode 0 = Home Networks, CDMA default
5997 * 1 = Roaming on Affiliated networks
5998 * 2 = Roaming on any networks
5999 * @hide
6000 */
6001 public static final String CDMA_ROAMING_MODE = "roaming_settings";
6002
6003 /**
6004 * The CDMA subscription mode 0 = RUIM/SIM (default)
6005 * 1 = NV
6006 * @hide
6007 */
6008 public static final String CDMA_SUBSCRIPTION_MODE = "subscription_mode";
6009
6010 /** Inactivity timeout to track mobile data activity.
6011 *
6012 * If set to a positive integer, it indicates the inactivity timeout value in seconds to
6013 * infer the data activity of mobile network. After a period of no activity on mobile
6014 * networks with length specified by the timeout, an {@code ACTION_DATA_ACTIVITY_CHANGE}
6015 * intent is fired to indicate a transition of network status from "active" to "idle". Any
6016 * subsequent activity on mobile networks triggers the firing of {@code
6017 * ACTION_DATA_ACTIVITY_CHANGE} intent indicating transition from "idle" to "active".
6018 *
6019 * Network activity refers to transmitting or receiving data on the network interfaces.
6020 *
6021 * Tracking is disabled if set to zero or negative value.
6022 *
6023 * @hide
6024 */
6025 public static final String DATA_ACTIVITY_TIMEOUT_MOBILE = "data_activity_timeout_mobile";
6026
6027 /** Timeout to tracking Wifi data activity. Same as {@code DATA_ACTIVITY_TIMEOUT_MOBILE}
6028 * but for Wifi network.
6029 * @hide
6030 */
6031 public static final String DATA_ACTIVITY_TIMEOUT_WIFI = "data_activity_timeout_wifi";
6032
6033 /**
6034 * Whether or not data roaming is enabled. (0 = false, 1 = true)
6035 */
6036 public static final String DATA_ROAMING = "data_roaming";
6037
6038 /**
Wink Saville75c1e692013-03-20 17:06:50 -07006039 * The value passed to a Mobile DataConnection via bringUp which defines the
6040 * number of retries to preform when setting up the initial connection. The default
6041 * value defined in DataConnectionTrackerBase#DEFAULT_MDC_INITIAL_RETRY is currently 1.
6042 * @hide
6043 */
6044 public static final String MDC_INITIAL_MAX_RETRY = "mdc_initial_max_retry";
6045
6046 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006047 * Whether user has enabled development settings.
6048 */
6049 public static final String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled";
6050
6051 /**
6052 * Whether the device has been provisioned (0 = false, 1 = true)
6053 */
6054 public static final String DEVICE_PROVISIONED = "device_provisioned";
6055
6056 /**
6057 * The saved value for WindowManagerService.setForcedDisplayDensity().
6058 * One integer in dpi. If unset, then use the real display density.
6059 * @hide
6060 */
6061 public static final String DISPLAY_DENSITY_FORCED = "display_density_forced";
6062
6063 /**
6064 * The saved value for WindowManagerService.setForcedDisplaySize().
6065 * Two integers separated by a comma. If unset, then use the real display size.
6066 * @hide
6067 */
6068 public static final String DISPLAY_SIZE_FORCED = "display_size_forced";
6069
6070 /**
Jeff Brownd46747a2015-04-15 19:02:36 -07006071 * The saved value for WindowManagerService.setForcedDisplayScalingMode().
6072 * 0 or unset if scaling is automatic, 1 if scaling is disabled.
6073 * @hide
6074 */
6075 public static final String DISPLAY_SCALING_FORCE = "display_scaling_force";
6076
6077 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006078 * The maximum size, in bytes, of a download that the download manager will transfer over
6079 * a non-wifi connection.
6080 * @hide
6081 */
6082 public static final String DOWNLOAD_MAX_BYTES_OVER_MOBILE =
6083 "download_manager_max_bytes_over_mobile";
6084
6085 /**
6086 * The recommended maximum size, in bytes, of a download that the download manager should
6087 * transfer over a non-wifi connection. Over this size, the use will be warned, but will
6088 * have the option to start the download over the mobile connection anyway.
6089 * @hide
6090 */
6091 public static final String DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE =
6092 "download_manager_recommended_max_bytes_over_mobile";
6093
6094 /**
Christopher Tateaa036a22014-05-19 16:33:27 -07006095 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
Christopher Tate06efb532012-08-24 15:29:27 -07006096 */
Christopher Tateaa036a22014-05-19 16:33:27 -07006097 @Deprecated
6098 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
Christopher Tate06efb532012-08-24 15:29:27 -07006099
6100 /**
Jinsuk Kimb3d91772014-07-10 12:48:54 +09006101 * Whether HDMI control shall be enabled. If disabled, no CEC/MHL command will be
6102 * sent or processed. (0 = false, 1 = true)
6103 * @hide
6104 */
6105 public static final String HDMI_CONTROL_ENABLED = "hdmi_control_enabled";
6106
6107 /**
6108 * Whether HDMI system audio is enabled. If enabled, TV internal speaker is muted,
6109 * and the output is redirected to AV Receiver connected via
6110 * {@Global#HDMI_SYSTEM_AUDIO_OUTPUT}.
6111 * @hide
6112 */
6113 public static final String HDMI_SYSTEM_AUDIO_ENABLED = "hdmi_system_audio_enabled";
6114
6115 /**
Jinsuk Kimb3d91772014-07-10 12:48:54 +09006116 * Whether TV will automatically turn on upon reception of the CEC command
6117 * &lt;Text View On&gt; or &lt;Image View On&gt;. (0 = false, 1 = true)
6118 * @hide
6119 */
6120 public static final String HDMI_CONTROL_AUTO_WAKEUP_ENABLED =
6121 "hdmi_control_auto_wakeup_enabled";
6122
6123 /**
6124 * Whether TV will also turn off other CEC devices when it goes to standby mode.
6125 * (0 = false, 1 = true)
6126 * @hide
6127 */
6128 public static final String HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED =
6129 "hdmi_control_auto_device_off_enabled";
6130
6131 /**
Lorenzo Colitti06d7e532015-03-16 23:46:24 +09006132 * Whether to use the DHCP client from Lollipop and earlier instead of the newer Android DHCP
6133 * client.
6134 * (0 = false, 1 = true)
6135 * @hide
6136 */
6137 public static final String LEGACY_DHCP_CLIENT = "legacy_dhcp_client";
6138
6139 /**
Jinsuk Kimb3d91772014-07-10 12:48:54 +09006140 * Whether TV will switch to MHL port when a mobile device is plugged in.
6141 * (0 = false, 1 = true)
6142 * @hide
6143 */
6144 public static final String MHL_INPUT_SWITCHING_ENABLED = "mhl_input_switching_enabled";
6145
6146 /**
6147 * Whether TV will charge the mobile device connected at MHL port. (0 = false, 1 = true)
6148 * @hide
6149 */
6150 public static final String MHL_POWER_CHARGE_ENABLED = "mhl_power_charge_enabled";
6151
6152 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006153 * Whether mobile data connections are allowed by the user. See
6154 * ConnectivityManager for more info.
6155 * @hide
6156 */
6157 public static final String MOBILE_DATA = "mobile_data";
6158
Erik Klineda4bfa82015-04-30 12:58:40 +09006159 /**
6160 * Whether the mobile data connection should remain active even when higher
6161 * priority networks like WiFi are active, to help make network switching faster.
6162 *
6163 * See ConnectivityService for more info.
6164 *
6165 * (0 = disabled, 1 = enabled)
6166 * @hide
6167 */
6168 public static final String MOBILE_DATA_ALWAYS_ON = "mobile_data_always_on";
6169
Christopher Tate06efb532012-08-24 15:29:27 -07006170 /** {@hide} */
6171 public static final String NETSTATS_ENABLED = "netstats_enabled";
6172 /** {@hide} */
6173 public static final String NETSTATS_POLL_INTERVAL = "netstats_poll_interval";
6174 /** {@hide} */
6175 public static final String NETSTATS_TIME_CACHE_MAX_AGE = "netstats_time_cache_max_age";
6176 /** {@hide} */
6177 public static final String NETSTATS_GLOBAL_ALERT_BYTES = "netstats_global_alert_bytes";
6178 /** {@hide} */
6179 public static final String NETSTATS_SAMPLE_ENABLED = "netstats_sample_enabled";
Christopher Tate06efb532012-08-24 15:29:27 -07006180
6181 /** {@hide} */
6182 public static final String NETSTATS_DEV_BUCKET_DURATION = "netstats_dev_bucket_duration";
6183 /** {@hide} */
6184 public static final String NETSTATS_DEV_PERSIST_BYTES = "netstats_dev_persist_bytes";
6185 /** {@hide} */
6186 public static final String NETSTATS_DEV_ROTATE_AGE = "netstats_dev_rotate_age";
6187 /** {@hide} */
6188 public static final String NETSTATS_DEV_DELETE_AGE = "netstats_dev_delete_age";
6189
6190 /** {@hide} */
6191 public static final String NETSTATS_UID_BUCKET_DURATION = "netstats_uid_bucket_duration";
6192 /** {@hide} */
6193 public static final String NETSTATS_UID_PERSIST_BYTES = "netstats_uid_persist_bytes";
6194 /** {@hide} */
6195 public static final String NETSTATS_UID_ROTATE_AGE = "netstats_uid_rotate_age";
6196 /** {@hide} */
6197 public static final String NETSTATS_UID_DELETE_AGE = "netstats_uid_delete_age";
6198
6199 /** {@hide} */
6200 public static final String NETSTATS_UID_TAG_BUCKET_DURATION = "netstats_uid_tag_bucket_duration";
6201 /** {@hide} */
6202 public static final String NETSTATS_UID_TAG_PERSIST_BYTES = "netstats_uid_tag_persist_bytes";
6203 /** {@hide} */
6204 public static final String NETSTATS_UID_TAG_ROTATE_AGE = "netstats_uid_tag_rotate_age";
6205 /** {@hide} */
6206 public static final String NETSTATS_UID_TAG_DELETE_AGE = "netstats_uid_tag_delete_age";
6207
6208 /**
6209 * User preference for which network(s) should be used. Only the
6210 * connectivity service should touch this.
6211 */
6212 public static final String NETWORK_PREFERENCE = "network_preference";
6213
6214 /**
Jeff Davidsondd6fd1e2014-04-14 15:14:30 -07006215 * Which package name to use for network scoring. If null, or if the package is not a valid
6216 * scorer app, external network scores will neither be requested nor accepted.
6217 * @hide
6218 */
6219 public static final String NETWORK_SCORER_APP = "network_scorer_app";
6220
6221 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006222 * If the NITZ_UPDATE_DIFF time is exceeded then an automatic adjustment
6223 * to SystemClock will be allowed even if NITZ_UPDATE_SPACING has not been
6224 * exceeded.
6225 * @hide
6226 */
6227 public static final String NITZ_UPDATE_DIFF = "nitz_update_diff";
6228
6229 /**
6230 * The length of time in milli-seconds that automatic small adjustments to
6231 * SystemClock are ignored if NITZ_UPDATE_DIFF is not exceeded.
6232 * @hide
6233 */
6234 public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing";
6235
6236 /** Preferred NTP server. {@hide} */
6237 public static final String NTP_SERVER = "ntp_server";
6238 /** Timeout in milliseconds to wait for NTP server. {@hide} */
6239 public static final String NTP_TIMEOUT = "ntp_timeout";
6240
6241 /**
rich cannings4d8fc792012-09-07 14:43:43 -07006242 * Whether the package manager should send package verification broadcasts for verifiers to
6243 * review apps prior to installation.
6244 * 1 = request apps to be verified prior to installation, if a verifier exists.
6245 * 0 = do not verify apps before installation
rich cannings4e5753f2012-09-19 16:03:56 -07006246 * @hide
rich cannings4d8fc792012-09-07 14:43:43 -07006247 */
6248 public static final String PACKAGE_VERIFIER_ENABLE = "package_verifier_enable";
6249
6250 /** Timeout for package verification.
rich cannings4e5753f2012-09-19 16:03:56 -07006251 * @hide */
rich cannings4d8fc792012-09-07 14:43:43 -07006252 public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout";
6253
6254 /** Default response code for package verification.
rich cannings4e5753f2012-09-19 16:03:56 -07006255 * @hide */
rich cannings4d8fc792012-09-07 14:43:43 -07006256 public static final String PACKAGE_VERIFIER_DEFAULT_RESPONSE = "verifier_default_response";
6257
rich cannings4e5753f2012-09-19 16:03:56 -07006258 /**
6259 * Show package verification setting in the Settings app.
rich canningse6686b32012-09-16 14:02:20 -07006260 * 1 = show (default)
6261 * 0 = hide
rich cannings4e5753f2012-09-19 16:03:56 -07006262 * @hide
rich canningse6686b32012-09-16 14:02:20 -07006263 */
6264 public static final String PACKAGE_VERIFIER_SETTING_VISIBLE = "verifier_setting_visible";
6265
rich cannings4d8fc792012-09-07 14:43:43 -07006266 /**
Fabrice Di Meglio1c1b4712014-11-19 17:12:32 -08006267 * Run package verification on apps installed through ADB/ADT/USB
rich cannings4e5753f2012-09-19 16:03:56 -07006268 * 1 = perform package verification on ADB installs (default)
6269 * 0 = bypass package verification on ADB installs
6270 * @hide
6271 */
6272 public static final String PACKAGE_VERIFIER_INCLUDE_ADB = "verifier_verify_adb_installs";
6273
6274 /**
Christopher Tate7265abe2014-11-21 13:54:45 -08006275 * Time since last fstrim (milliseconds) after which we force one to happen
6276 * during device startup. If unset, the default is 3 days.
6277 * @hide
6278 */
6279 public static final String FSTRIM_MANDATORY_INTERVAL = "fstrim_mandatory_interval";
6280
6281 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006282 * The interval in milliseconds at which to check packet counts on the
6283 * mobile data interface when screen is on, to detect possible data
6284 * connection problems.
6285 * @hide
6286 */
6287 public static final String PDP_WATCHDOG_POLL_INTERVAL_MS =
6288 "pdp_watchdog_poll_interval_ms";
6289
6290 /**
6291 * The interval in milliseconds at which to check packet counts on the
6292 * mobile data interface when screen is off, to detect possible data
6293 * connection problems.
6294 * @hide
6295 */
6296 public static final String PDP_WATCHDOG_LONG_POLL_INTERVAL_MS =
6297 "pdp_watchdog_long_poll_interval_ms";
6298
6299 /**
6300 * The interval in milliseconds at which to check packet counts on the
6301 * mobile data interface after {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT}
6302 * outgoing packets has been reached without incoming packets.
6303 * @hide
6304 */
6305 public static final String PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS =
6306 "pdp_watchdog_error_poll_interval_ms";
6307
6308 /**
6309 * The number of outgoing packets sent without seeing an incoming packet
6310 * that triggers a countdown (of {@link #PDP_WATCHDOG_ERROR_POLL_COUNT}
6311 * device is logged to the event log
6312 * @hide
6313 */
6314 public static final String PDP_WATCHDOG_TRIGGER_PACKET_COUNT =
6315 "pdp_watchdog_trigger_packet_count";
6316
6317 /**
6318 * The number of polls to perform (at {@link #PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS})
6319 * after hitting {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} before
6320 * attempting data connection recovery.
6321 * @hide
6322 */
6323 public static final String PDP_WATCHDOG_ERROR_POLL_COUNT =
6324 "pdp_watchdog_error_poll_count";
6325
6326 /**
6327 * The number of failed PDP reset attempts before moving to something more
6328 * drastic: re-registering to the network.
6329 * @hide
6330 */
6331 public static final String PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT =
6332 "pdp_watchdog_max_pdp_reset_fail_count";
6333
6334 /**
6335 * A positive value indicates how often the SamplingProfiler
6336 * should take snapshots. Zero value means SamplingProfiler
6337 * is disabled.
6338 *
6339 * @hide
6340 */
6341 public static final String SAMPLING_PROFILER_MS = "sampling_profiler_ms";
6342
6343 /**
6344 * URL to open browser on to allow user to manage a prepay account
6345 * @hide
6346 */
6347 public static final String SETUP_PREPAID_DATA_SERVICE_URL =
6348 "setup_prepaid_data_service_url";
6349
6350 /**
6351 * URL to attempt a GET on to see if this is a prepay device
6352 * @hide
6353 */
6354 public static final String SETUP_PREPAID_DETECTION_TARGET_URL =
6355 "setup_prepaid_detection_target_url";
6356
6357 /**
6358 * Host to check for a redirect to after an attempt to GET
6359 * SETUP_PREPAID_DETECTION_TARGET_URL. (If we redirected there,
6360 * this is a prepaid device with zero balance.)
6361 * @hide
6362 */
6363 public static final String SETUP_PREPAID_DETECTION_REDIR_HOST =
6364 "setup_prepaid_detection_redir_host";
6365
6366 /**
Jake Hamby76a61422012-09-06 17:40:21 -07006367 * The interval in milliseconds at which to check the number of SMS sent out without asking
6368 * for use permit, to limit the un-authorized SMS usage.
6369 *
6370 * @hide
6371 */
6372 public static final String SMS_OUTGOING_CHECK_INTERVAL_MS =
6373 "sms_outgoing_check_interval_ms";
6374
6375 /**
6376 * The number of outgoing SMS sent without asking for user permit (of {@link
6377 * #SMS_OUTGOING_CHECK_INTERVAL_MS}
6378 *
6379 * @hide
6380 */
6381 public static final String SMS_OUTGOING_CHECK_MAX_COUNT =
6382 "sms_outgoing_check_max_count";
6383
6384 /**
6385 * Used to disable SMS short code confirmation - defaults to true.
Robert Greenwalt026efcc2012-09-24 10:03:21 -07006386 * True indcates we will do the check, etc. Set to false to disable.
Jake Hamby76a61422012-09-06 17:40:21 -07006387 * @see com.android.internal.telephony.SmsUsageMonitor
6388 * @hide
6389 */
6390 public static final String SMS_SHORT_CODE_CONFIRMATION = "sms_short_code_confirmation";
6391
Robert Greenwalt026efcc2012-09-24 10:03:21 -07006392 /**
6393 * Used to select which country we use to determine premium sms codes.
6394 * One of com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_SIM,
6395 * com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_NETWORK,
6396 * or com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_BOTH.
6397 * @hide
6398 */
6399 public static final String SMS_SHORT_CODE_RULE = "sms_short_code_rule";
6400
Jake Hamby76a61422012-09-06 17:40:21 -07006401 /**
JP Abgrall32d1ac4d2014-02-21 12:05:20 -08006402 * Used to select TCP's default initial receiver window size in segments - defaults to a build config value
6403 * @hide
6404 */
6405 public static final String TCP_DEFAULT_INIT_RWND = "tcp_default_init_rwnd";
6406
6407 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006408 * Used to disable Tethering on a device - defaults to true
6409 * @hide
6410 */
6411 public static final String TETHER_SUPPORTED = "tether_supported";
6412
6413 /**
6414 * Used to require DUN APN on the device or not - defaults to a build config value
6415 * which defaults to false
6416 * @hide
6417 */
6418 public static final String TETHER_DUN_REQUIRED = "tether_dun_required";
6419
6420 /**
6421 * Used to hold a gservices-provisioned apn value for DUN. If set, or the
6422 * corresponding build config values are set it will override the APN DB
6423 * values.
6424 * Consists of a comma seperated list of strings:
6425 * "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type"
6426 * note that empty fields can be ommitted: "name,apn,,,,,,,,,310,260,,DUN"
6427 * @hide
6428 */
6429 public static final String TETHER_DUN_APN = "tether_dun_apn";
6430
6431 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006432 * USB Mass Storage Enabled
6433 */
6434 public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled";
6435
6436 /**
6437 * If this setting is set (to anything), then all references
6438 * to Gmail on the device must change to Google Mail.
6439 */
6440 public static final String USE_GOOGLE_MAIL = "use_google_mail";
6441
Hui Shu22671772014-10-01 21:41:07 +00006442 /**
6443 * Webview Data reduction proxy key.
6444 * @hide
6445 */
6446 public static final String WEBVIEW_DATA_REDUCTION_PROXY_KEY =
6447 "webview_data_reduction_proxy_key";
6448
Christopher Tate06efb532012-08-24 15:29:27 -07006449 /**
Jeff Brown89d55462012-09-19 11:33:42 -07006450 * Whether Wifi display is enabled/disabled
6451 * 0=disabled. 1=enabled.
6452 * @hide
6453 */
6454 public static final String WIFI_DISPLAY_ON = "wifi_display_on";
6455
6456 /**
Chong Zhang1f3ecaa2013-05-03 15:55:36 -07006457 * Whether Wifi display certification mode is enabled/disabled
6458 * 0=disabled. 1=enabled.
6459 * @hide
6460 */
6461 public static final String WIFI_DISPLAY_CERTIFICATION_ON =
6462 "wifi_display_certification_on";
6463
6464 /**
Chong Zhange38af812013-08-29 17:25:17 -07006465 * WPS Configuration method used by Wifi display, this setting only
6466 * takes effect when WIFI_DISPLAY_CERTIFICATION_ON is 1 (enabled).
6467 *
6468 * Possible values are:
6469 *
6470 * WpsInfo.INVALID: use default WPS method chosen by framework
6471 * WpsInfo.PBC : use Push button
6472 * WpsInfo.KEYPAD : use Keypad
6473 * WpsInfo.DISPLAY: use Display
6474 * @hide
6475 */
6476 public static final String WIFI_DISPLAY_WPS_CONFIG =
6477 "wifi_display_wps_config";
6478
6479 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006480 * Whether to notify the user of open networks.
6481 * <p>
6482 * If not connected and the scan results have an open network, we will
6483 * put this notification up. If we attempt to connect to a network or
6484 * the open network(s) disappear, we remove the notification. When we
6485 * show the notification, we will not show it again for
6486 * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time.
6487 */
6488 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
6489 "wifi_networks_available_notification_on";
6490 /**
6491 * {@hide}
6492 */
6493 public static final String WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON =
6494 "wimax_networks_available_notification_on";
6495
6496 /**
6497 * Delay (in seconds) before repeating the Wi-Fi networks available notification.
6498 * Connecting to a network will reset the timer.
6499 */
6500 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
6501 "wifi_networks_available_repeat_delay";
6502
6503 /**
Robert Greenwalt3ea0c992013-10-03 21:13:49 +00006504 * 802.11 country code in ISO 3166 format
6505 * @hide
6506 */
6507 public static final String WIFI_COUNTRY_CODE = "wifi_country_code";
6508
6509 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006510 * The interval in milliseconds to issue wake up scans when wifi needs
6511 * to connect. This is necessary to connect to an access point when
6512 * device is on the move and the screen is off.
6513 * @hide
6514 */
6515 public static final String WIFI_FRAMEWORK_SCAN_INTERVAL_MS =
6516 "wifi_framework_scan_interval_ms";
6517
6518 /**
6519 * The interval in milliseconds after which Wi-Fi is considered idle.
6520 * When idle, it is possible for the device to be switched from Wi-Fi to
6521 * the mobile data network.
6522 * @hide
6523 */
6524 public static final String WIFI_IDLE_MS = "wifi_idle_ms";
6525
6526 /**
6527 * When the number of open networks exceeds this number, the
6528 * least-recently-used excess networks will be removed.
6529 */
6530 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept";
6531
6532 /**
6533 * Whether the Wi-Fi should be on. Only the Wi-Fi service should touch this.
6534 */
6535 public static final String WIFI_ON = "wifi_on";
6536
6537 /**
Irfan Sheriff11aefad2013-03-06 07:57:41 -08006538 * Setting to allow scans to be enabled even wifi is turned off for connectivity.
6539 * @hide
6540 */
6541 public static final String WIFI_SCAN_ALWAYS_AVAILABLE =
6542 "wifi_scan_always_enabled";
6543
6544 /**
Wei Wangd91f1932015-03-19 15:09:56 -07006545 * Settings to allow BLE scans to be enabled even when Bluetooth is turned off for
6546 * connectivity.
6547 * @hide
6548 */
6549 public static final String BLE_SCAN_ALWAYS_AVAILABLE =
6550 "ble_scan_always_enabled";
6551
6552 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006553 * Used to save the Wifi_ON state prior to tethering.
6554 * This state will be checked to restore Wifi after
6555 * the user turns off tethering.
6556 *
6557 * @hide
6558 */
6559 public static final String WIFI_SAVED_STATE = "wifi_saved_state";
6560
6561 /**
6562 * The interval in milliseconds to scan as used by the wifi supplicant
6563 * @hide
6564 */
6565 public static final String WIFI_SUPPLICANT_SCAN_INTERVAL_MS =
6566 "wifi_supplicant_scan_interval_ms";
6567
vandwalle7c3606c2014-03-31 19:12:07 -07006568 /**
6569 * whether frameworks handles wifi auto-join
6570 * @hide
6571 */
6572 public static final String WIFI_ENHANCED_AUTO_JOIN =
6573 "wifi_enhanced_auto_join";
6574
6575 /**
6576 * whether settings show RSSI
6577 * @hide
6578 */
6579 public static final String WIFI_NETWORK_SHOW_RSSI =
6580 "wifi_network_show_rssi";
6581
6582 /**
Irfan Sheriff3809f502012-09-17 16:04:57 -07006583 * The interval in milliseconds to scan at supplicant when p2p is connected
6584 * @hide
6585 */
6586 public static final String WIFI_SCAN_INTERVAL_WHEN_P2P_CONNECTED_MS =
6587 "wifi_scan_interval_p2p_connected_ms";
6588
6589 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006590 * Whether the Wi-Fi watchdog is enabled.
6591 */
6592 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
6593
6594 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006595 * Setting to turn off poor network avoidance on Wi-Fi. Feature is enabled by default and
6596 * the setting needs to be set to 0 to disable it.
6597 * @hide
6598 */
6599 public static final String WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED =
6600 "wifi_watchdog_poor_network_test_enabled";
6601
6602 /**
6603 * Setting to turn on suspend optimizations at screen off on Wi-Fi. Enabled by default and
6604 * needs to be set to 0 to disable it.
6605 * @hide
6606 */
6607 public static final String WIFI_SUSPEND_OPTIMIZATIONS_ENABLED =
6608 "wifi_suspend_optimizations_enabled";
6609
6610 /**
6611 * The maximum number of times we will retry a connection to an access
6612 * point for which we have failed in acquiring an IP address from DHCP.
6613 * A value of N means that we will make N+1 connection attempts in all.
6614 */
6615 public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count";
6616
6617 /**
6618 * Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile
6619 * data connectivity to be established after a disconnect from Wi-Fi.
6620 */
6621 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
6622 "wifi_mobile_data_transition_wakelock_timeout_ms";
6623
6624 /**
6625 * The operational wifi frequency band
6626 * Set to one of {@link WifiManager#WIFI_FREQUENCY_BAND_AUTO},
6627 * {@link WifiManager#WIFI_FREQUENCY_BAND_5GHZ} or
6628 * {@link WifiManager#WIFI_FREQUENCY_BAND_2GHZ}
6629 *
6630 * @hide
6631 */
6632 public static final String WIFI_FREQUENCY_BAND = "wifi_frequency_band";
6633
6634 /**
6635 * The Wi-Fi peer-to-peer device name
6636 * @hide
6637 */
6638 public static final String WIFI_P2P_DEVICE_NAME = "wifi_p2p_device_name";
6639
6640 /**
Robert Greenwaltc12783a2013-05-16 12:48:20 -07006641 * The min time between wifi disable and wifi enable
6642 * @hide
6643 */
6644 public static final String WIFI_REENABLE_DELAY_MS = "wifi_reenable_delay";
6645
6646 /**
Jeff Davidsona20ca67d2014-12-16 11:48:54 -08006647 * Timeout for ephemeral networks when all known BSSIDs go out of range. We will disconnect
6648 * from an ephemeral network if there is no BSSID for that network with a non-null score that
6649 * has been seen in this time period.
6650 *
6651 * If this is less than or equal to zero, we use a more conservative behavior and only check
6652 * for a non-null score from the currently connected or target BSSID.
6653 * @hide
6654 */
6655 public static final String WIFI_EPHEMERAL_OUT_OF_RANGE_TIMEOUT_MS =
6656 "wifi_ephemeral_out_of_range_timeout_ms";
6657
6658 /**
Christopher Tatec868b642012-09-12 17:41:04 -07006659 * The number of milliseconds to delay when checking for data stalls during
6660 * non-aggressive detection. (screen is turned off.)
6661 * @hide
6662 */
6663 public static final String DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS =
6664 "data_stall_alarm_non_aggressive_delay_in_ms";
6665
6666 /**
6667 * The number of milliseconds to delay when checking for data stalls during
6668 * aggressive detection. (screen on or suspected data stall)
6669 * @hide
6670 */
6671 public static final String DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS =
6672 "data_stall_alarm_aggressive_delay_in_ms";
6673
6674 /**
Wink Savillece1e3792013-09-03 16:41:44 -07006675 * The number of milliseconds to allow the provisioning apn to remain active
6676 * @hide
6677 */
6678 public static final String PROVISIONING_APN_ALARM_DELAY_IN_MS =
6679 "provisioning_apn_alarm_delay_in_ms";
6680
6681 /**
Christopher Tatec868b642012-09-12 17:41:04 -07006682 * The interval in milliseconds at which to check gprs registration
6683 * after the first registration mismatch of gprs and voice service,
6684 * to detect possible data network registration problems.
6685 *
6686 * @hide
6687 */
6688 public static final String GPRS_REGISTER_CHECK_PERIOD_MS =
6689 "gprs_register_check_period_ms";
6690
6691 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006692 * Nonzero causes Log.wtf() to crash.
6693 * @hide
6694 */
6695 public static final String WTF_IS_FATAL = "wtf_is_fatal";
6696
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07006697 /**
6698 * Ringer mode. This is used internally, changing this value will not
6699 * change the ringer mode. See AudioManager.
6700 */
6701 public static final String MODE_RINGER = "mode_ringer";
Christopher Tate06efb532012-08-24 15:29:27 -07006702
Jeff Brownd4935962012-09-25 13:27:20 -07006703 /**
6704 * Overlay display devices setting.
6705 * The associated value is a specially formatted string that describes the
6706 * size and density of simulated secondary display devices.
6707 * <p>
6708 * Format: {width}x{height}/{dpi};...
6709 * </p><p>
6710 * Example:
6711 * <ul>
6712 * <li><code>1280x720/213</code>: make one overlay that is 1280x720 at 213dpi.</li>
6713 * <li><code>1920x1080/320;1280x720/213</code>: make two overlays, the first
6714 * at 1080p and the second at 720p.</li>
6715 * <li>If the value is empty, then no overlay display devices are created.</li>
6716 * </ul></p>
6717 *
6718 * @hide
6719 */
6720 public static final String OVERLAY_DISPLAY_DEVICES = "overlay_display_devices";
Christopher Tate06efb532012-08-24 15:29:27 -07006721
Jeff Sharkey625239a2012-09-26 22:03:49 -07006722 /**
6723 * Threshold values for the duration and level of a discharge cycle,
6724 * under which we log discharge cycle info.
6725 *
6726 * @hide
6727 */
6728 public static final String
6729 BATTERY_DISCHARGE_DURATION_THRESHOLD = "battery_discharge_duration_threshold";
6730
6731 /** @hide */
6732 public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold";
6733
6734 /**
6735 * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR
6736 * intents on application crashes and ANRs. If this is disabled, the
6737 * crash/ANR dialog will never display the "Report" button.
6738 * <p>
6739 * Type: int (0 = disallow, 1 = allow)
6740 *
6741 * @hide
6742 */
6743 public static final String SEND_ACTION_APP_ERROR = "send_action_app_error";
6744
6745 /**
6746 * Maximum age of entries kept by {@link DropBoxManager}.
6747 *
6748 * @hide
6749 */
6750 public static final String DROPBOX_AGE_SECONDS = "dropbox_age_seconds";
6751
6752 /**
6753 * Maximum number of entry files which {@link DropBoxManager} will keep
6754 * around.
6755 *
6756 * @hide
6757 */
6758 public static final String DROPBOX_MAX_FILES = "dropbox_max_files";
6759
6760 /**
6761 * Maximum amount of disk space used by {@link DropBoxManager} no matter
6762 * what.
6763 *
6764 * @hide
6765 */
6766 public static final String DROPBOX_QUOTA_KB = "dropbox_quota_kb";
6767
6768 /**
6769 * Percent of free disk (excluding reserve) which {@link DropBoxManager}
6770 * will use.
6771 *
6772 * @hide
6773 */
6774 public static final String DROPBOX_QUOTA_PERCENT = "dropbox_quota_percent";
6775
6776 /**
6777 * Percent of total disk which {@link DropBoxManager} will never dip
6778 * into.
6779 *
6780 * @hide
6781 */
6782 public static final String DROPBOX_RESERVE_PERCENT = "dropbox_reserve_percent";
6783
6784 /**
6785 * Prefix for per-tag dropbox disable/enable settings.
6786 *
6787 * @hide
6788 */
6789 public static final String DROPBOX_TAG_PREFIX = "dropbox:";
6790
6791 /**
6792 * Lines of logcat to include with system crash/ANR/etc. reports, as a
6793 * prefix of the dropbox tag of the report type. For example,
6794 * "logcat_for_system_server_anr" controls the lines of logcat captured
6795 * with system server ANR reports. 0 to disable.
6796 *
6797 * @hide
6798 */
6799 public static final String ERROR_LOGCAT_PREFIX = "logcat_for_";
6800
6801 /**
6802 * The interval in minutes after which the amount of free storage left
6803 * on the device is logged to the event log
6804 *
6805 * @hide
6806 */
6807 public static final String SYS_FREE_STORAGE_LOG_INTERVAL = "sys_free_storage_log_interval";
6808
6809 /**
6810 * Threshold for the amount of change in disk free space required to
6811 * report the amount of free space. Used to prevent spamming the logs
6812 * when the disk free space isn't changing frequently.
6813 *
6814 * @hide
6815 */
6816 public static final String
6817 DISK_FREE_CHANGE_REPORTING_THRESHOLD = "disk_free_change_reporting_threshold";
6818
6819 /**
6820 * Minimum percentage of free storage on the device that is used to
6821 * determine if the device is running low on storage. The default is 10.
6822 * <p>
6823 * Say this value is set to 10, the device is considered running low on
6824 * storage if 90% or more of the device storage is filled up.
6825 *
6826 * @hide
6827 */
6828 public static final String
6829 SYS_STORAGE_THRESHOLD_PERCENTAGE = "sys_storage_threshold_percentage";
6830
6831 /**
6832 * Maximum byte size of the low storage threshold. This is to ensure
6833 * that {@link #SYS_STORAGE_THRESHOLD_PERCENTAGE} does not result in an
6834 * overly large threshold for large storage devices. Currently this must
6835 * be less than 2GB. This default is 500MB.
6836 *
6837 * @hide
6838 */
6839 public static final String
6840 SYS_STORAGE_THRESHOLD_MAX_BYTES = "sys_storage_threshold_max_bytes";
6841
6842 /**
6843 * Minimum bytes of free storage on the device before the data partition
6844 * is considered full. By default, 1 MB is reserved to avoid system-wide
6845 * SQLite disk full exceptions.
6846 *
6847 * @hide
6848 */
6849 public static final String
6850 SYS_STORAGE_FULL_THRESHOLD_BYTES = "sys_storage_full_threshold_bytes";
6851
6852 /**
6853 * The maximum reconnect delay for short network outages or when the
6854 * network is suspended due to phone use.
6855 *
6856 * @hide
6857 */
6858 public static final String
6859 SYNC_MAX_RETRY_DELAY_IN_SECONDS = "sync_max_retry_delay_in_seconds";
6860
6861 /**
6862 * The number of milliseconds to delay before sending out
Erik Kline8f29dcf2014-12-08 16:25:20 +09006863 * {@link ConnectivityManager#CONNECTIVITY_ACTION} broadcasts. Ignored.
Jeff Sharkey625239a2012-09-26 22:03:49 -07006864 *
6865 * @hide
6866 */
6867 public static final String CONNECTIVITY_CHANGE_DELAY = "connectivity_change_delay";
6868
Vinit Deshapnde1f12cb52013-08-21 13:09:01 -07006869
6870 /**
6871 * Network sampling interval, in seconds. We'll generate link information
6872 * about bytes/packets sent and error rates based on data sampled in this interval
6873 *
6874 * @hide
6875 */
6876
6877 public static final String CONNECTIVITY_SAMPLING_INTERVAL_IN_SECONDS =
6878 "connectivity_sampling_interval_in_seconds";
6879
Jeff Sharkey625239a2012-09-26 22:03:49 -07006880 /**
Jason Monk602b2322013-07-03 17:04:33 -04006881 * The series of successively longer delays used in retrying to download PAC file.
6882 * Last delay is used between successful PAC downloads.
6883 *
6884 * @hide
6885 */
6886 public static final String PAC_CHANGE_DELAY = "pac_change_delay";
6887
6888 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07006889 * Setting to turn off captive portal detection. Feature is enabled by
6890 * default and the setting needs to be set to 0 to disable it.
6891 *
6892 * @hide
6893 */
6894 public static final String
6895 CAPTIVE_PORTAL_DETECTION_ENABLED = "captive_portal_detection_enabled";
6896
6897 /**
6898 * The server used for captive portal detection upon a new conection. A
6899 * 204 response code from the server is used for validation.
6900 *
6901 * @hide
6902 */
6903 public static final String CAPTIVE_PORTAL_SERVER = "captive_portal_server";
6904
6905 /**
6906 * Whether network service discovery is enabled.
6907 *
6908 * @hide
6909 */
6910 public static final String NSD_ON = "nsd_on";
6911
6912 /**
6913 * Let user pick default install location.
6914 *
6915 * @hide
6916 */
6917 public static final String SET_INSTALL_LOCATION = "set_install_location";
6918
6919 /**
6920 * Default install location value.
6921 * 0 = auto, let system decide
6922 * 1 = internal
6923 * 2 = sdcard
6924 * @hide
6925 */
6926 public static final String DEFAULT_INSTALL_LOCATION = "default_install_location";
6927
6928 /**
6929 * ms during which to consume extra events related to Inet connection
6930 * condition after a transtion to fully-connected
6931 *
6932 * @hide
6933 */
6934 public static final String
6935 INET_CONDITION_DEBOUNCE_UP_DELAY = "inet_condition_debounce_up_delay";
6936
6937 /**
6938 * ms during which to consume extra events related to Inet connection
6939 * condtion after a transtion to partly-connected
6940 *
6941 * @hide
6942 */
6943 public static final String
6944 INET_CONDITION_DEBOUNCE_DOWN_DELAY = "inet_condition_debounce_down_delay";
6945
6946 /** {@hide} */
6947 public static final String
6948 READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT = "read_external_storage_enforced_default";
6949
6950 /**
6951 * Host name and port for global http proxy. Uses ':' seperator for
6952 * between host and port.
6953 */
6954 public static final String HTTP_PROXY = "http_proxy";
6955
6956 /**
6957 * Host name for global http proxy. Set via ConnectivityManager.
6958 *
6959 * @hide
6960 */
6961 public static final String GLOBAL_HTTP_PROXY_HOST = "global_http_proxy_host";
6962
6963 /**
6964 * Integer host port for global http proxy. Set via ConnectivityManager.
6965 *
6966 * @hide
6967 */
6968 public static final String GLOBAL_HTTP_PROXY_PORT = "global_http_proxy_port";
6969
6970 /**
6971 * Exclusion list for global proxy. This string contains a list of
6972 * comma-separated domains where the global proxy does not apply.
6973 * Domains should be listed in a comma- separated list. Example of
6974 * acceptable formats: ".domain1.com,my.domain2.com" Use
6975 * ConnectivityManager to set/get.
6976 *
6977 * @hide
6978 */
6979 public static final String
6980 GLOBAL_HTTP_PROXY_EXCLUSION_LIST = "global_http_proxy_exclusion_list";
6981
6982 /**
Jason Monk602b2322013-07-03 17:04:33 -04006983 * The location PAC File for the proxy.
6984 * @hide
6985 */
6986 public static final String
6987 GLOBAL_HTTP_PROXY_PAC = "global_proxy_pac_url";
6988
6989 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07006990 * Enables the UI setting to allow the user to specify the global HTTP
6991 * proxy and associated exclusion list.
6992 *
6993 * @hide
6994 */
6995 public static final String SET_GLOBAL_HTTP_PROXY = "set_global_http_proxy";
6996
6997 /**
6998 * Setting for default DNS in case nobody suggests one
6999 *
7000 * @hide
7001 */
7002 public static final String DEFAULT_DNS_SERVER = "default_dns_server";
7003
Jeff Sharkey0ac10282012-10-01 12:50:22 -07007004 /** {@hide} */
7005 public static final String
7006 BLUETOOTH_HEADSET_PRIORITY_PREFIX = "bluetooth_headset_priority_";
7007 /** {@hide} */
7008 public static final String
7009 BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX = "bluetooth_a2dp_sink_priority_";
7010 /** {@hide} */
7011 public static final String
7012 BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX = "bluetooth_input_device_priority_";
Kim Schulz0d376052013-08-22 11:18:02 +02007013 /** {@hide} */
7014 public static final String
7015 BLUETOOTH_MAP_PRIORITY_PREFIX = "bluetooth_map_priority_";
Casper Bonde2a5f6082015-03-19 10:36:45 +01007016 /** {@hide} */
7017 public static final String
7018 BLUETOOTH_SAP_PRIORITY_PREFIX = "bluetooth_sap_priority_";
Jeff Sharkey0ac10282012-10-01 12:50:22 -07007019
7020 /**
7021 * Get the key that retrieves a bluetooth headset's priority.
7022 * @hide
7023 */
7024 public static final String getBluetoothHeadsetPriorityKey(String address) {
Elliott Hughescb64d432013-08-02 10:00:44 -07007025 return BLUETOOTH_HEADSET_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
Jeff Sharkey0ac10282012-10-01 12:50:22 -07007026 }
7027
7028 /**
7029 * Get the key that retrieves a bluetooth a2dp sink's priority.
7030 * @hide
7031 */
7032 public static final String getBluetoothA2dpSinkPriorityKey(String address) {
Elliott Hughescb64d432013-08-02 10:00:44 -07007033 return BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
Jeff Sharkey0ac10282012-10-01 12:50:22 -07007034 }
7035
7036 /**
7037 * Get the key that retrieves a bluetooth Input Device's priority.
7038 * @hide
7039 */
7040 public static final String getBluetoothInputDevicePriorityKey(String address) {
Elliott Hughescb64d432013-08-02 10:00:44 -07007041 return BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
Jeff Sharkey0ac10282012-10-01 12:50:22 -07007042 }
7043
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07007044 /**
Kim Schulz0d376052013-08-22 11:18:02 +02007045 * Get the key that retrieves a bluetooth map priority.
7046 * @hide
7047 */
7048 public static final String getBluetoothMapPriorityKey(String address) {
7049 return BLUETOOTH_MAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
7050 }
Casper Bonde2a5f6082015-03-19 10:36:45 +01007051
7052 /**
7053 * Get the key that retrieves a bluetooth map priority.
7054 * @hide
7055 */
7056 public static final String getBluetoothSapPriorityKey(String address) {
7057 return BLUETOOTH_SAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
7058 }
7059
Kim Schulz0d376052013-08-22 11:18:02 +02007060 /**
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07007061 * Scaling factor for normal window animations. Setting to 0 will
7062 * disable window animations.
7063 */
7064 public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale";
7065
7066 /**
7067 * Scaling factor for activity transition animations. Setting to 0 will
7068 * disable window animations.
7069 */
7070 public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale";
7071
7072 /**
7073 * Scaling factor for Animator-based animations. This affects both the
7074 * start delay and duration of all such animations. Setting to 0 will
7075 * cause animations to end immediately. The default value is 1.
7076 */
7077 public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale";
7078
7079 /**
7080 * Scaling factor for normal window animations. Setting to 0 will
7081 * disable window animations.
7082 *
7083 * @hide
7084 */
7085 public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations";
7086
7087 /**
7088 * If 0, the compatibility mode is off for all applications.
7089 * If 1, older applications run under compatibility mode.
7090 * TODO: remove this settings before code freeze (bug/1907571)
7091 * @hide
7092 */
7093 public static final String COMPATIBILITY_MODE = "compatibility_mode";
7094
7095 /**
7096 * CDMA only settings
7097 * Emergency Tone 0 = Off
7098 * 1 = Alert
7099 * 2 = Vibrate
7100 * @hide
7101 */
7102 public static final String EMERGENCY_TONE = "emergency_tone";
7103
7104 /**
7105 * CDMA only settings
7106 * Whether the auto retry is enabled. The value is
7107 * boolean (1 or 0).
7108 * @hide
7109 */
7110 public static final String CALL_AUTO_RETRY = "call_auto_retry";
7111
7112 /**
Sungmin Choie099ab12014-06-09 14:45:51 +09007113 * See RIL_PreferredNetworkType in ril.h
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07007114 * @hide
7115 */
7116 public static final String PREFERRED_NETWORK_MODE =
7117 "preferred_network_mode";
7118
7119 /**
Junda Liubbdc1c02014-11-07 11:18:02 -08007120 * Setting to 1 will hide carrier network settings.
7121 * Default is 0.
Junda Liubbdc1c02014-11-07 11:18:02 -08007122 */
7123 public static final String HIDE_CARRIER_NETWORK_SETTINGS =
7124 "hide_carrier_network_settings";
7125
7126 /**
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07007127 * Name of an application package to be debugged.
7128 */
7129 public static final String DEBUG_APP = "debug_app";
7130
7131 /**
7132 * If 1, when launching DEBUG_APP it will wait for the debugger before
7133 * starting user code. If 0, it will run normally.
7134 */
7135 public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger";
7136
7137 /**
7138 * Control whether the process CPU usage meter should be shown.
7139 */
7140 public static final String SHOW_PROCESSES = "show_processes";
7141
7142 /**
Ruchi Kandoi62b8a492014-04-17 18:01:40 -07007143 * If 1 low power mode is enabled.
7144 * @hide
7145 */
7146 public static final String LOW_POWER_MODE = "low_power";
7147
John Spurlockf8f524c2014-06-10 14:47:29 -04007148 /**
7149 * Battery level [1-99] at which low power mode automatically turns on.
Dianne Hackborn14272302014-06-10 23:13:02 -07007150 * If 0, it will not automatically turn on.
John Spurlockf8f524c2014-06-10 14:47:29 -04007151 * @hide
7152 */
7153 public static final String LOW_POWER_MODE_TRIGGER_LEVEL = "low_power_trigger_level";
7154
Ruchi Kandoi62b8a492014-04-17 18:01:40 -07007155 /**
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07007156 * If 1, the activity manager will aggressively finish activities and
7157 * processes as soon as they are no longer needed. If 0, the normal
7158 * extended lifetime is used.
7159 */
Dianne Hackborn89ad4562014-08-24 16:45:38 -07007160 public static final String ALWAYS_FINISH_ACTIVITIES = "always_finish_activities";
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07007161
Christopher Tate66488d62012-10-02 11:58:01 -07007162 /**
Eric Laurent7ee1e4f2012-10-26 18:11:21 -07007163 * Use Dock audio output for media:
7164 * 0 = disabled
7165 * 1 = enabled
7166 * @hide
7167 */
7168 public static final String DOCK_AUDIO_MEDIA_ENABLED = "dock_audio_media_enabled";
7169
7170 /**
Eric Laurent05274f32012-11-29 12:48:18 -08007171 * Persisted safe headphone volume management state by AudioService
7172 * @hide
7173 */
7174 public static final String AUDIO_SAFE_VOLUME_STATE = "audio_safe_volume_state";
7175
7176 /**
Geremy Condraa0735112013-03-26 21:49:26 -07007177 * URL for tzinfo (time zone) updates
7178 * @hide
7179 */
7180 public static final String TZINFO_UPDATE_CONTENT_URL = "tzinfo_content_url";
7181
7182 /**
7183 * URL for tzinfo (time zone) update metadata
7184 * @hide
7185 */
7186 public static final String TZINFO_UPDATE_METADATA_URL = "tzinfo_metadata_url";
7187
7188 /**
7189 * URL for selinux (mandatory access control) updates
7190 * @hide
7191 */
7192 public static final String SELINUX_UPDATE_CONTENT_URL = "selinux_content_url";
7193
7194 /**
7195 * URL for selinux (mandatory access control) update metadata
7196 * @hide
7197 */
7198 public static final String SELINUX_UPDATE_METADATA_URL = "selinux_metadata_url";
7199
7200 /**
7201 * URL for sms short code updates
7202 * @hide
7203 */
7204 public static final String SMS_SHORT_CODES_UPDATE_CONTENT_URL =
7205 "sms_short_codes_content_url";
7206
7207 /**
7208 * URL for sms short code update metadata
7209 * @hide
7210 */
7211 public static final String SMS_SHORT_CODES_UPDATE_METADATA_URL =
7212 "sms_short_codes_metadata_url";
7213
7214 /**
7215 * URL for cert pinlist updates
7216 * @hide
7217 */
7218 public static final String CERT_PIN_UPDATE_CONTENT_URL = "cert_pin_content_url";
7219
7220 /**
7221 * URL for cert pinlist updates
7222 * @hide
7223 */
7224 public static final String CERT_PIN_UPDATE_METADATA_URL = "cert_pin_metadata_url";
7225
Geremy Condra757ee522013-03-29 16:39:45 -07007226 /**
Ben Gruver633dc9b2013-04-04 12:05:49 -07007227 * URL for intent firewall updates
7228 * @hide
7229 */
7230 public static final String INTENT_FIREWALL_UPDATE_CONTENT_URL =
7231 "intent_firewall_content_url";
7232
7233 /**
7234 * URL for intent firewall update metadata
7235 * @hide
7236 */
7237 public static final String INTENT_FIREWALL_UPDATE_METADATA_URL =
7238 "intent_firewall_metadata_url";
7239
7240 /**
Geremy Condra4e7f7e82013-03-26 21:09:01 -07007241 * SELinux enforcement status. If 0, permissive; if 1, enforcing.
7242 * @hide
7243 */
7244 public static final String SELINUX_STATUS = "selinux_status";
7245
Geremy Condraa0735112013-03-26 21:49:26 -07007246 /**
Amith Yamasanid8415f42013-08-07 20:15:10 -07007247 * Developer setting to force RTL layout.
7248 * @hide
7249 */
7250 public static final String DEVELOPMENT_FORCE_RTL = "debug.force_rtl";
7251
7252 /**
Daniel Sandlerdea64622013-09-23 16:05:57 -04007253 * Milliseconds after screen-off after which low battery sounds will be silenced.
7254 *
7255 * If zero, battery sounds will always play.
7256 * Defaults to @integer/def_low_battery_sound_timeout in SettingsProvider.
7257 *
7258 * @hide
7259 */
7260 public static final String LOW_BATTERY_SOUND_TIMEOUT = "low_battery_sound_timeout";
7261
7262 /**
Evan Charltoncc7b0432014-01-14 14:47:11 -08007263 * Milliseconds to wait before bouncing Wi-Fi after settings is restored. Note that after
Dianne Hackborna3fb40d2014-08-12 15:06:50 -07007264 * the caller is done with this, they should call {@link ContentResolver#delete} to
Evan Charltoncc7b0432014-01-14 14:47:11 -08007265 * clean up any value that they may have written.
7266 *
7267 * @hide
7268 */
7269 public static final String WIFI_BOUNCE_DELAY_OVERRIDE_MS = "wifi_bounce_delay_override_ms";
7270
John Spurlockc6d1c602014-01-17 15:22:06 -05007271 /**
7272 * Defines global runtime overrides to window policy.
7273 *
Jorim Jaggib10e33f2015-02-04 21:57:40 +01007274 * See {@link com.android.server.policy.PolicyControl} for value format.
John Spurlockc6d1c602014-01-17 15:22:06 -05007275 *
7276 * @hide
7277 */
7278 public static final String POLICY_CONTROL = "policy_control";
Evan Charltoncc7b0432014-01-14 14:47:11 -08007279
7280 /**
John Spurlockae641c92014-06-30 18:11:40 -04007281 * Defines global zen mode. ZEN_MODE_OFF, ZEN_MODE_IMPORTANT_INTERRUPTIONS,
7282 * or ZEN_MODE_NO_INTERRUPTIONS.
John Spurlocke677d712014-02-13 12:52:19 -05007283 *
7284 * @hide
7285 */
7286 public static final String ZEN_MODE = "zen_mode";
7287
7288 /** @hide */ public static final int ZEN_MODE_OFF = 0;
John Spurlockae641c92014-06-30 18:11:40 -04007289 /** @hide */ public static final int ZEN_MODE_IMPORTANT_INTERRUPTIONS = 1;
7290 /** @hide */ public static final int ZEN_MODE_NO_INTERRUPTIONS = 2;
John Spurlock4f1163c2015-04-02 17:41:21 -04007291 /** @hide */ public static final int ZEN_MODE_ALARMS = 3;
John Spurlocke677d712014-02-13 12:52:19 -05007292
7293 /** @hide */ public static String zenModeToString(int mode) {
John Spurlockae641c92014-06-30 18:11:40 -04007294 if (mode == ZEN_MODE_IMPORTANT_INTERRUPTIONS) return "ZEN_MODE_IMPORTANT_INTERRUPTIONS";
John Spurlock4f1163c2015-04-02 17:41:21 -04007295 if (mode == ZEN_MODE_ALARMS) return "ZEN_MODE_ALARMS";
John Spurlockae641c92014-06-30 18:11:40 -04007296 if (mode == ZEN_MODE_NO_INTERRUPTIONS) return "ZEN_MODE_NO_INTERRUPTIONS";
7297 return "ZEN_MODE_OFF";
John Spurlocke677d712014-02-13 12:52:19 -05007298 }
7299
John Spurlockb2278d62015-04-07 12:47:12 -04007300 /** @hide */ public static boolean isValidZenMode(int value) {
7301 switch (value) {
7302 case Global.ZEN_MODE_OFF:
7303 case Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS:
7304 case Global.ZEN_MODE_ALARMS:
7305 case Global.ZEN_MODE_NO_INTERRUPTIONS:
7306 return true;
7307 default:
7308 return false;
7309 }
7310 }
7311
John Spurlocke677d712014-02-13 12:52:19 -05007312 /**
John Spurlock056c5192014-04-20 21:52:01 -04007313 * Opaque value, changes when persisted zen mode configuration changes.
7314 *
7315 * @hide
7316 */
7317 public static final String ZEN_MODE_CONFIG_ETAG = "zen_mode_config_etag";
7318
7319 /**
Chris Wren7bd241232014-02-28 16:25:05 -05007320 * Defines global heads up toggle. One of HEADS_UP_OFF, HEADS_UP_ON.
7321 *
7322 * @hide
7323 */
Chris Wren10d82df2014-03-01 10:34:51 -05007324 public static final String HEADS_UP_NOTIFICATIONS_ENABLED =
7325 "heads_up_notifications_enabled";
Chris Wren7bd241232014-02-28 16:25:05 -05007326
7327 /** @hide */ public static final int HEADS_UP_OFF = 0;
7328 /** @hide */ public static final int HEADS_UP_ON = 1;
7329
7330 /**
Jerome Poichet147b4d72014-05-12 18:13:27 -07007331 * The name of the device
7332 *
7333 * @hide
7334 */
7335 public static final String DEVICE_NAME = "device_name";
7336
7337 /**
Amith Yamasani1e9c2182014-06-11 17:25:51 -07007338 * Whether it should be possible to create a guest user on the device.
7339 * <p>
7340 * Type: int (0 for disabled, 1 for enabled)
7341 * @hide
7342 */
7343 public static final String GUEST_USER_ENABLED = "guest_user_enabled";
7344
7345 /**
Jeff Davidson56f9f732014-08-14 16:47:23 -07007346 * Whether the NetworkScoringService has been first initialized.
7347 * <p>
7348 * Type: int (0 for false, 1 for true)
7349 * @hide
7350 */
7351 public static final String NETWORK_SCORING_PROVISIONED = "network_scoring_provisioned";
7352
7353 /**
Jim Miller6848dc82014-10-13 18:51:53 -07007354 * Whether the user wants to be prompted for password to decrypt the device on boot.
7355 * This only matters if the storage is encrypted.
7356 * <p>
7357 * Type: int (0 for false, 1 for true)
7358 * @hide
7359 */
7360 public static final String REQUIRE_PASSWORD_TO_DECRYPT = "require_password_to_decrypt";
7361
7362 /**
Libin.Tang@motorola.com0499bb52014-10-10 14:55:57 -05007363 * Whether the Volte/VT is enabled
7364 * <p>
7365 * Type: int (0 for false, 1 for true)
7366 * @hide
7367 */
Etan Cohene41a9cf2014-10-22 10:50:46 -07007368 public static final String ENHANCED_4G_MODE_ENABLED = "volte_vt_enabled";
Libin.Tang@motorola.com0499bb52014-10-10 14:55:57 -05007369
7370 /**
Etan Cohen9c8f21b2014-12-23 15:02:19 -08007371 * Whether WFC is enabled
7372 * <p>
7373 * Type: int (0 for false, 1 for true)
7374 *
7375 * @hide
7376 */
7377 public static final String WFC_IMS_ENABLED = "wfc_ims_enabled";
7378
7379 /**
7380 * WFC Mode.
7381 * <p>
7382 * Type: int - 2=Wi-Fi preferred, 1=Cellular preferred, 0=Wi-Fi only
7383 *
7384 * @hide
7385 */
7386 public static final String WFC_IMS_MODE = "wfc_ims_mode";
7387
7388 /**
7389 * Whether WFC roaming is enabled
7390 * <p>
7391 * Type: int (0 for false, 1 for true)
7392 *
7393 * @hide
7394 */
7395 public static final String WFC_IMS_ROAMING_ENABLED = "wfc_ims_roaming_enabled";
7396
7397 /**
Etan Cohen7ab0ad12014-11-24 11:18:01 -08007398 * Global override to disable VoLTE (independent of user setting)
7399 * <p>
7400 * Type: int (1 for disable VoLTE, 0 to use user configuration)
7401 * @hide
7402 */
7403 public static final String VOLTE_FEATURE_DISABLED = "volte_feature_disabled";
7404
7405 /**
Amit Mahajan4fea0922014-11-18 12:56:28 -08007406 * Whether user can enable/disable LTE as a preferred network. A carrier might control
7407 * this via gservices, OMA-DM, carrier app, etc.
7408 * <p>
7409 * Type: int (0 for false, 1 for true)
7410 * @hide
7411 */
7412 public static final String LTE_SERVICE_FORCED = "lte_service_forced";
7413
7414 /**
Christopher Tate66488d62012-10-02 11:58:01 -07007415 * Settings to backup. This is here so that it's in the same place as the settings
7416 * keys and easy to update.
7417 *
7418 * These keys may be mentioned in the SETTINGS_TO_BACKUP arrays in System
7419 * and Secure as well. This is because those tables drive both backup and
7420 * restore, and restore needs to properly whitelist keys that used to live
7421 * in those namespaces. The keys will only actually be backed up / restored
7422 * if they are also mentioned in this table (Global.SETTINGS_TO_BACKUP).
7423 *
7424 * NOTE: Settings are backed up and restored in the order they appear
7425 * in this array. If you have one setting depending on another,
7426 * make sure that they are ordered appropriately.
7427 *
7428 * @hide
7429 */
7430 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate58f41ec2013-01-11 15:40:36 -08007431 BUGREPORT_IN_POWER_MENU,
Christopher Tate66488d62012-10-02 11:58:01 -07007432 STAY_ON_WHILE_PLUGGED_IN,
Christopher Tate66488d62012-10-02 11:58:01 -07007433 AUTO_TIME,
7434 AUTO_TIME_ZONE,
7435 POWER_SOUNDS_ENABLED,
7436 DOCK_SOUNDS_ENABLED,
7437 USB_MASS_STORAGE_ENABLED,
7438 ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED,
7439 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
7440 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY,
Christopher Tate16eb7cd2012-10-09 15:26:30 -07007441 WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED,
Christopher Tate66488d62012-10-02 11:58:01 -07007442 WIFI_NUM_OPEN_NETWORKS_KEPT,
7443 EMERGENCY_TONE,
7444 CALL_AUTO_RETRY,
Amith Yamasani94005242014-10-31 11:35:13 -07007445 DOCK_AUDIO_MEDIA_ENABLED,
7446 LOW_POWER_MODE_TRIGGER_LEVEL
Christopher Tate66488d62012-10-02 11:58:01 -07007447 };
7448
Christopher Tate06efb532012-08-24 15:29:27 -07007449 // Populated lazily, guarded by class object:
Dianne Hackborn139748f2012-09-24 11:36:57 -07007450 private static NameValueCache sNameValueCache = new NameValueCache(
7451 SYS_PROP_SETTING_VERSION,
7452 CONTENT_URI,
7453 CALL_METHOD_GET_GLOBAL,
7454 CALL_METHOD_PUT_GLOBAL);
Christopher Tate06efb532012-08-24 15:29:27 -07007455
Christopher Tateaa036a22014-05-19 16:33:27 -07007456 // Certain settings have been moved from global to the per-user secure namespace
7457 private static final HashSet<String> MOVED_TO_SECURE;
7458 static {
7459 MOVED_TO_SECURE = new HashSet<String>(1);
7460 MOVED_TO_SECURE.add(Settings.Global.INSTALL_NON_MARKET_APPS);
7461 }
7462
Svetoslav683914b2015-01-15 14:22:26 -08007463 /** @hide */
7464 public static void getMovedToSecureSettings(Set<String> outKeySet) {
7465 outKeySet.addAll(MOVED_TO_SECURE);
7466 }
7467
Christopher Tate06efb532012-08-24 15:29:27 -07007468 /**
7469 * Look up a name in the database.
7470 * @param resolver to access the database with
7471 * @param name to look up in the table
7472 * @return the corresponding value, or null if not present
7473 */
Dianne Hackborn139748f2012-09-24 11:36:57 -07007474 public static String getString(ContentResolver resolver, String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07007475 return getStringForUser(resolver, name, UserHandle.myUserId());
7476 }
7477
7478 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -07007479 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -07007480 int userHandle) {
Christopher Tateaa036a22014-05-19 16:33:27 -07007481 if (MOVED_TO_SECURE.contains(name)) {
7482 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
7483 + " to android.provider.Settings.Secure, returning read-only value.");
7484 return Secure.getStringForUser(resolver, name, userHandle);
7485 }
Christopher Tate06efb532012-08-24 15:29:27 -07007486 return sNameValueCache.getStringForUser(resolver, name, userHandle);
7487 }
7488
7489 /**
7490 * Store a name/value pair into the database.
7491 * @param resolver to access the database with
7492 * @param name to store
7493 * @param value to associate with the name
7494 * @return true if the value was set, false on database errors
7495 */
7496 public static boolean putString(ContentResolver resolver,
7497 String name, String value) {
7498 return putStringForUser(resolver, name, value, UserHandle.myUserId());
7499 }
7500
7501 /** @hide */
7502 public static boolean putStringForUser(ContentResolver resolver,
7503 String name, String value, int userHandle) {
Christopher Tate06efb532012-08-24 15:29:27 -07007504 if (LOCAL_LOGV) {
7505 Log.v(TAG, "Global.putString(name=" + name + ", value=" + value
7506 + " for " + userHandle);
7507 }
Christopher Tateaa036a22014-05-19 16:33:27 -07007508 // Global and Secure have the same access policy so we can forward writes
7509 if (MOVED_TO_SECURE.contains(name)) {
7510 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
7511 + " to android.provider.Settings.Secure, value is unchanged.");
7512 return Secure.putStringForUser(resolver, name, value, userHandle);
7513 }
Christopher Tate06efb532012-08-24 15:29:27 -07007514 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
7515 }
7516
7517 /**
7518 * Construct the content URI for a particular name/value pair,
7519 * useful for monitoring changes with a ContentObserver.
7520 * @param name to look up in the table
7521 * @return the corresponding content URI, or null if not present
7522 */
7523 public static Uri getUriFor(String name) {
7524 return getUriFor(CONTENT_URI, name);
7525 }
7526
7527 /**
7528 * Convenience function for retrieving a single secure settings value
7529 * as an integer. Note that internally setting values are always
7530 * stored as strings; this function converts the string to an integer
7531 * for you. The default value will be returned if the setting is
7532 * not defined or not an integer.
7533 *
7534 * @param cr The ContentResolver to access.
7535 * @param name The name of the setting to retrieve.
7536 * @param def Value to return if the setting is not defined.
7537 *
7538 * @return The setting's current value, or 'def' if it is not defined
7539 * or not a valid integer.
7540 */
7541 public static int getInt(ContentResolver cr, String name, int def) {
7542 String v = getString(cr, name);
7543 try {
7544 return v != null ? Integer.parseInt(v) : def;
7545 } catch (NumberFormatException e) {
7546 return def;
7547 }
7548 }
7549
7550 /**
7551 * Convenience function for retrieving a single secure settings value
7552 * as an integer. Note that internally setting values are always
7553 * stored as strings; this function converts the string to an integer
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 * @throws SettingNotFoundException Thrown if a setting by the given
7564 * name can't be found or the setting value is not an integer.
7565 *
7566 * @return The setting's current value.
7567 */
7568 public static int getInt(ContentResolver cr, String name)
7569 throws SettingNotFoundException {
7570 String v = getString(cr, name);
7571 try {
7572 return Integer.parseInt(v);
7573 } catch (NumberFormatException e) {
7574 throw new SettingNotFoundException(name);
7575 }
7576 }
7577
7578 /**
7579 * Convenience function for updating a single settings value as an
7580 * integer. This will either create a new entry in the table if the
7581 * given name does not exist, or modify the value of the existing row
7582 * with that name. Note that internally setting values are always
7583 * stored as strings, so this function converts the given value to a
7584 * string before storing it.
7585 *
7586 * @param cr The ContentResolver to access.
7587 * @param name The name of the setting to modify.
7588 * @param value The new value for the setting.
7589 * @return true if the value was set, false on database errors
7590 */
7591 public static boolean putInt(ContentResolver cr, String name, int value) {
7592 return putString(cr, name, Integer.toString(value));
7593 }
7594
7595 /**
7596 * Convenience function for retrieving a single secure settings value
7597 * as a {@code long}. Note that internally setting values are always
7598 * stored as strings; this function converts the string to a {@code long}
7599 * for you. The default value will be returned if the setting is
7600 * not defined or not a {@code long}.
7601 *
7602 * @param cr The ContentResolver to access.
7603 * @param name The name of the setting to retrieve.
7604 * @param def Value to return if the setting is not defined.
7605 *
7606 * @return The setting's current value, or 'def' if it is not defined
7607 * or not a valid {@code long}.
7608 */
7609 public static long getLong(ContentResolver cr, String name, long def) {
7610 String valString = getString(cr, name);
7611 long value;
7612 try {
7613 value = valString != null ? Long.parseLong(valString) : def;
7614 } catch (NumberFormatException e) {
7615 value = def;
7616 }
7617 return value;
7618 }
7619
7620 /**
7621 * Convenience function for retrieving a single secure settings value
7622 * as a {@code long}. Note that internally setting values are always
7623 * stored as strings; this function converts the string to a {@code long}
7624 * for you.
7625 * <p>
7626 * This version does not take a default value. If the setting has not
7627 * been set, or the string value is not a number,
7628 * it throws {@link SettingNotFoundException}.
7629 *
7630 * @param cr The ContentResolver to access.
7631 * @param name The name of the setting to retrieve.
7632 *
7633 * @return The setting's current value.
7634 * @throws SettingNotFoundException Thrown if a setting by the given
7635 * name can't be found or the setting value is not an integer.
7636 */
7637 public static long getLong(ContentResolver cr, String name)
7638 throws SettingNotFoundException {
7639 String valString = getString(cr, name);
7640 try {
7641 return Long.parseLong(valString);
7642 } catch (NumberFormatException e) {
7643 throw new SettingNotFoundException(name);
7644 }
7645 }
7646
7647 /**
7648 * Convenience function for updating a secure settings value as a long
7649 * integer. This will either create a new entry in the table if the
7650 * given name does not exist, or modify the value of the existing row
7651 * with that name. Note that internally setting values are always
7652 * stored as strings, so this function converts the given value to a
7653 * string before storing it.
7654 *
7655 * @param cr The ContentResolver to access.
7656 * @param name The name of the setting to modify.
7657 * @param value The new value for the setting.
7658 * @return true if the value was set, false on database errors
7659 */
7660 public static boolean putLong(ContentResolver cr, String name, long value) {
7661 return putString(cr, name, Long.toString(value));
7662 }
7663
7664 /**
7665 * Convenience function for retrieving a single secure settings value
7666 * as a floating point number. Note that internally setting values are
7667 * always stored as strings; this function converts the string to an
7668 * float for you. The default value will be returned if the setting
7669 * is not defined or not a valid float.
7670 *
7671 * @param cr The ContentResolver to access.
7672 * @param name The name of the setting to retrieve.
7673 * @param def Value to return if the setting is not defined.
7674 *
7675 * @return The setting's current value, or 'def' if it is not defined
7676 * or not a valid float.
7677 */
7678 public static float getFloat(ContentResolver cr, String name, float def) {
7679 String v = getString(cr, name);
7680 try {
7681 return v != null ? Float.parseFloat(v) : def;
7682 } catch (NumberFormatException e) {
7683 return def;
7684 }
7685 }
7686
7687 /**
7688 * Convenience function for retrieving a single secure settings value
7689 * as a float. Note that internally setting values are always
7690 * stored as strings; this function converts the string to a float
7691 * for you.
7692 * <p>
7693 * This version does not take a default value. If the setting has not
7694 * been set, or the string value is not a number,
7695 * it throws {@link SettingNotFoundException}.
7696 *
7697 * @param cr The ContentResolver to access.
7698 * @param name The name of the setting to retrieve.
7699 *
7700 * @throws SettingNotFoundException Thrown if a setting by the given
7701 * name can't be found or the setting value is not a float.
7702 *
7703 * @return The setting's current value.
7704 */
7705 public static float getFloat(ContentResolver cr, String name)
7706 throws SettingNotFoundException {
7707 String v = getString(cr, name);
7708 if (v == null) {
7709 throw new SettingNotFoundException(name);
7710 }
7711 try {
7712 return Float.parseFloat(v);
7713 } catch (NumberFormatException e) {
7714 throw new SettingNotFoundException(name);
7715 }
7716 }
7717
7718 /**
7719 * Convenience function for updating a single settings value as a
7720 * floating point number. This will either create a new entry in the
7721 * table if the given name does not exist, or modify the value of the
7722 * existing row with that name. Note that internally setting values
7723 * are always stored as strings, so this function converts the given
7724 * value to a string before storing it.
7725 *
7726 * @param cr The ContentResolver to access.
7727 * @param name The name of the setting to modify.
7728 * @param value The new value for the setting.
7729 * @return true if the value was set, false on database errors
7730 */
7731 public static boolean putFloat(ContentResolver cr, String name, float value) {
7732 return putString(cr, name, Float.toString(value));
7733 }
Wink Savillefb40dd42014-06-12 17:02:31 -07007734
7735
7736 /**
7737 * Subscription to be used for voice call on a multi sim device. The supported values
7738 * are 0 = SUB1, 1 = SUB2 and etc.
7739 * @hide
7740 */
7741 public static final String MULTI_SIM_VOICE_CALL_SUBSCRIPTION = "multi_sim_voice_call";
7742
7743 /**
7744 * Used to provide option to user to select subscription during dial.
7745 * The supported values are 0 = disable or 1 = enable prompt.
7746 * @hide
7747 */
7748 public static final String MULTI_SIM_VOICE_PROMPT = "multi_sim_voice_prompt";
7749
7750 /**
7751 * Subscription to be used for data call on a multi sim device. The supported values
7752 * are 0 = SUB1, 1 = SUB2 and etc.
7753 * @hide
7754 */
7755 public static final String MULTI_SIM_DATA_CALL_SUBSCRIPTION = "multi_sim_data_call";
7756
7757 /**
7758 * Subscription to be used for SMS on a multi sim device. The supported values
7759 * are 0 = SUB1, 1 = SUB2 and etc.
7760 * @hide
7761 */
7762 public static final String MULTI_SIM_SMS_SUBSCRIPTION = "multi_sim_sms";
7763
7764 /**
7765 * Used to provide option to user to select subscription during send SMS.
7766 * The value 1 - enable, 0 - disable
7767 * @hide
7768 */
7769 public static final String MULTI_SIM_SMS_PROMPT = "multi_sim_sms_prompt";
7770
7771
7772
7773 /** User preferred subscriptions setting.
7774 * This holds the details of the user selected subscription from the card and
7775 * the activation status. Each settings string have the coma separated values
7776 * iccId,appType,appId,activationStatus,3gppIndex,3gpp2Index
7777 * @hide
7778 */
7779 public static final String[] MULTI_SIM_USER_PREFERRED_SUBS = {"user_preferred_sub1",
7780 "user_preferred_sub2","user_preferred_sub3"};
Zheng Fub218ff42015-04-13 16:31:16 -07007781
7782 /**
7783 * Whether to enable new contacts aggregator or not.
7784 * The value 1 - enable, 0 - disable
7785 * @hide
7786 */
7787 public static final String NEW_CONTACT_AGGREGATOR = "new_contact_aggregator";
Zheng Fu31ce78c2015-04-15 16:57:53 -07007788
7789 /**
7790 * Whether to enable contacts metadata syncing or not
7791 * The value 1 - enable, 0 - disable
7792 * @hide
7793 */
7794 public static final String CONTACT_METADATA_SYNC = "contact_metadata_sync";
Christopher Tate06efb532012-08-24 15:29:27 -07007795 }
7796
7797 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007798 * User-defined bookmarks and shortcuts. The target of each bookmark is an
7799 * Intent URL, allowing it to be either a web page or a particular
7800 * application activity.
7801 *
7802 * @hide
7803 */
7804 public static final class Bookmarks implements BaseColumns
7805 {
7806 private static final String TAG = "Bookmarks";
7807
7808 /**
7809 * The content:// style URL for this table
7810 */
7811 public static final Uri CONTENT_URI =
7812 Uri.parse("content://" + AUTHORITY + "/bookmarks");
7813
7814 /**
7815 * The row ID.
7816 * <p>Type: INTEGER</p>
7817 */
7818 public static final String ID = "_id";
7819
7820 /**
7821 * Descriptive name of the bookmark that can be displayed to the user.
7822 * If this is empty, the title should be resolved at display time (use
7823 * {@link #getTitle(Context, Cursor)} any time you want to display the
7824 * title of a bookmark.)
7825 * <P>
7826 * Type: TEXT
7827 * </P>
7828 */
7829 public static final String TITLE = "title";
7830
7831 /**
7832 * Arbitrary string (displayed to the user) that allows bookmarks to be
7833 * organized into categories. There are some special names for
7834 * standard folders, which all start with '@'. The label displayed for
7835 * the folder changes with the locale (via {@link #getLabelForFolder}) but
7836 * the folder name does not change so you can consistently query for
7837 * the folder regardless of the current locale.
7838 *
7839 * <P>Type: TEXT</P>
7840 *
7841 */
7842 public static final String FOLDER = "folder";
7843
7844 /**
7845 * The Intent URL of the bookmark, describing what it points to. This
7846 * value is given to {@link android.content.Intent#getIntent} to create
7847 * an Intent that can be launched.
7848 * <P>Type: TEXT</P>
7849 */
7850 public static final String INTENT = "intent";
7851
7852 /**
7853 * Optional shortcut character associated with this bookmark.
7854 * <P>Type: INTEGER</P>
7855 */
7856 public static final String SHORTCUT = "shortcut";
7857
7858 /**
7859 * The order in which the bookmark should be displayed
7860 * <P>Type: INTEGER</P>
7861 */
7862 public static final String ORDERING = "ordering";
7863
7864 private static final String[] sIntentProjection = { INTENT };
7865 private static final String[] sShortcutProjection = { ID, SHORTCUT };
7866 private static final String sShortcutSelection = SHORTCUT + "=?";
7867
7868 /**
7869 * Convenience function to retrieve the bookmarked Intent for a
7870 * particular shortcut key.
7871 *
7872 * @param cr The ContentResolver to query.
7873 * @param shortcut The shortcut key.
7874 *
7875 * @return Intent The bookmarked URL, or null if there is no bookmark
7876 * matching the given shortcut.
7877 */
7878 public static Intent getIntentForShortcut(ContentResolver cr, char shortcut)
7879 {
7880 Intent intent = null;
7881
7882 Cursor c = cr.query(CONTENT_URI,
7883 sIntentProjection, sShortcutSelection,
7884 new String[] { String.valueOf((int) shortcut) }, ORDERING);
7885 // Keep trying until we find a valid shortcut
7886 try {
7887 while (intent == null && c.moveToNext()) {
7888 try {
7889 String intentURI = c.getString(c.getColumnIndexOrThrow(INTENT));
Christian Mehlmauera34d2c92010-05-25 19:04:20 +02007890 intent = Intent.parseUri(intentURI, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007891 } catch (java.net.URISyntaxException e) {
7892 // The stored URL is bad... ignore it.
7893 } catch (IllegalArgumentException e) {
7894 // Column not found
Dianne Hackborna33e3f72009-09-29 17:28:24 -07007895 Log.w(TAG, "Intent column not found", e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007896 }
7897 }
7898 } finally {
7899 if (c != null) c.close();
7900 }
7901
7902 return intent;
7903 }
7904
7905 /**
7906 * Add a new bookmark to the system.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07007907 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007908 * @param cr The ContentResolver to query.
7909 * @param intent The desired target of the bookmark.
7910 * @param title Bookmark title that is shown to the user; null if none
7911 * or it should be resolved to the intent's title.
7912 * @param folder Folder in which to place the bookmark; null if none.
7913 * @param shortcut Shortcut that will invoke the bookmark; 0 if none. If
7914 * this is non-zero and there is an existing bookmark entry
7915 * with this same shortcut, then that existing shortcut is
7916 * cleared (the bookmark is not removed).
7917 * @return The unique content URL for the new bookmark entry.
7918 */
7919 public static Uri add(ContentResolver cr,
7920 Intent intent,
7921 String title,
7922 String folder,
7923 char shortcut,
7924 int ordering)
7925 {
7926 // If a shortcut is supplied, and it is already defined for
7927 // another bookmark, then remove the old definition.
7928 if (shortcut != 0) {
Jeff Hamilton7cd51ef2010-05-12 17:30:27 -05007929 cr.delete(CONTENT_URI, sShortcutSelection,
7930 new String[] { String.valueOf((int) shortcut) });
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007931 }
7932
7933 ContentValues values = new ContentValues();
7934 if (title != null) values.put(TITLE, title);
7935 if (folder != null) values.put(FOLDER, folder);
Jean-Baptiste Queru3b9f0a32010-06-21 13:46:59 -07007936 values.put(INTENT, intent.toUri(0));
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007937 if (shortcut != 0) values.put(SHORTCUT, (int) shortcut);
7938 values.put(ORDERING, ordering);
7939 return cr.insert(CONTENT_URI, values);
7940 }
7941
7942 /**
7943 * Return the folder name as it should be displayed to the user. This
7944 * takes care of localizing special folders.
7945 *
7946 * @param r Resources object for current locale; only need access to
7947 * system resources.
7948 * @param folder The value found in the {@link #FOLDER} column.
7949 *
7950 * @return CharSequence The label for this folder that should be shown
7951 * to the user.
7952 */
7953 public static CharSequence getLabelForFolder(Resources r, String folder) {
7954 return folder;
7955 }
7956
7957 /**
7958 * Return the title as it should be displayed to the user. This takes
7959 * care of localizing bookmarks that point to activities.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07007960 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007961 * @param context A context.
7962 * @param cursor A cursor pointing to the row whose title should be
7963 * returned. The cursor must contain at least the {@link #TITLE}
7964 * and {@link #INTENT} columns.
7965 * @return A title that is localized and can be displayed to the user,
7966 * or the empty string if one could not be found.
7967 */
7968 public static CharSequence getTitle(Context context, Cursor cursor) {
7969 int titleColumn = cursor.getColumnIndex(TITLE);
7970 int intentColumn = cursor.getColumnIndex(INTENT);
7971 if (titleColumn == -1 || intentColumn == -1) {
7972 throw new IllegalArgumentException(
7973 "The cursor must contain the TITLE and INTENT columns.");
7974 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07007975
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007976 String title = cursor.getString(titleColumn);
7977 if (!TextUtils.isEmpty(title)) {
7978 return title;
7979 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07007980
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007981 String intentUri = cursor.getString(intentColumn);
7982 if (TextUtils.isEmpty(intentUri)) {
7983 return "";
7984 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07007985
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007986 Intent intent;
7987 try {
Christian Mehlmauera34d2c92010-05-25 19:04:20 +02007988 intent = Intent.parseUri(intentUri, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007989 } catch (URISyntaxException e) {
7990 return "";
7991 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07007992
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007993 PackageManager packageManager = context.getPackageManager();
7994 ResolveInfo info = packageManager.resolveActivity(intent, 0);
7995 return info != null ? info.loadLabel(packageManager) : "";
7996 }
7997 }
7998
7999 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008000 * Returns the device ID that we should use when connecting to the mobile gtalk server.
8001 * This is a string like "android-0x1242", where the hex string is the Android ID obtained
8002 * from the GoogleLoginService.
8003 *
8004 * @param androidId The Android ID for this device.
8005 * @return The device ID that should be used when connecting to the mobile gtalk server.
8006 * @hide
8007 */
8008 public static String getGTalkDeviceId(long androidId) {
8009 return "android-" + Long.toHexString(androidId);
8010 }
8011}