blob: 37645b591e5e13b0b3d581af62fb4a0d82b6ba75 [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 Spurlock80774932015-05-07 17:38:50 -0400812 * Activity Action: Show Do Not Disturb access settings.
813 * <p>
814 * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
815 * <p>
816 * Input: Nothing.
817 * <p>
818 * Output: Nothing.
819 */
820 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
821 public static final String ACTION_ZEN_ACCESS_SETTINGS = "android.settings.ZEN_ACCESS_SETTINGS";
822
823 /**
John Spurlock7340fc82014-04-24 18:50:12 -0400824 * @hide
825 */
826 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
827 public static final String ACTION_CONDITION_PROVIDER_SETTINGS
828 = "android.settings.ACTION_CONDITION_PROVIDER_SETTINGS";
829
830 /**
Alan Viverette69ce69b2013-08-29 12:23:48 -0700831 * Activity Action: Show settings for video captioning.
832 * <p>
833 * In some cases, a matching Activity may not exist, so ensure you safeguard
834 * against this.
835 * <p>
836 * Input: Nothing.
837 * <p>
838 * Output: Nothing.
839 */
840 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
841 public static final String ACTION_CAPTIONING_SETTINGS = "android.settings.CAPTIONING_SETTINGS";
842
Svetoslav773f54d2013-09-03 14:01:43 -0700843 /**
844 * Activity Action: Show the top level print settings.
845 * <p>
846 * In some cases, a matching Activity may not exist, so ensure you
847 * safeguard against this.
848 * <p>
849 * Input: Nothing.
850 * <p>
851 * Output: Nothing.
852 */
853 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
854 public static final String ACTION_PRINT_SETTINGS =
855 "android.settings.ACTION_PRINT_SETTINGS";
856
John Spurlockde547002014-02-28 17:50:39 -0500857 /**
858 * Activity Action: Show Zen Mode configuration settings.
859 *
860 * @hide
861 */
862 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
863 public static final String ACTION_ZEN_MODE_SETTINGS = "android.settings.ZEN_MODE_SETTINGS";
864
Santos Cordona4c75242014-07-09 12:07:51 -0700865 /**
John Spurlockfc746f82015-04-03 13:47:14 -0400866 * Activity Action: Show Zen Mode priority configuration settings.
867 *
868 * @hide
869 */
870 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
871 public static final String ACTION_ZEN_MODE_PRIORITY_SETTINGS
872 = "android.settings.ZEN_MODE_PRIORITY_SETTINGS";
873
874 /**
John Spurlock7af10182015-04-03 15:10:31 -0400875 * Activity Action: Show Zen Mode automation configuration settings.
876 *
877 * @hide
878 */
879 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
880 public static final String ACTION_ZEN_MODE_AUTOMATION_SETTINGS
881 = "android.settings.ZEN_MODE_AUTOMATION_SETTINGS";
882
883 /**
Barnaby Jamesb3006d32015-04-02 17:49:54 -0700884 * Activity Action: Modify do not disturb mode settings.
885 * <p>
886 * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
887 * <p>
888 * This intent MUST be started using
889 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
890 * startVoiceActivity}.
891 * <p>
892 * Note: The Activity implementing this intent MUST verify that
893 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction}.
894 * returns true before modifying the setting.
895 * <p>
896 * Input: The optional {@link #EXTRA_DO_NOT_DISTURB_MODE_MINUTES} extra can be used to indicate
897 * how long the user wishes to avoid interruptions for. The optional
898 * {@link #EXTRA_DO_NOT_DISTURB_MODE_ENABLED} extra can be to indicate if the user is
899 * enabling or disabling do not disturb mode. If either extra is not included, the
900 * user maybe asked to provide the value.
901 * <p>
902 * Output: Nothing.
903 */
904 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
905 public static final String ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE =
906 "android.settings.VOICE_CONTROL_DO_NOT_DISTURB_MODE";
907
908 /**
John Spurlockb2278d62015-04-07 12:47:12 -0400909 * Activity Action: Show Zen Mode schedule rule configuration settings.
910 *
911 * @hide
912 */
913 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
914 public static final String ACTION_ZEN_MODE_SCHEDULE_RULE_SETTINGS
915 = "android.settings.ZEN_MODE_SCHEDULE_RULE_SETTINGS";
916
917 /**
John Spurlockd60258f2015-04-30 09:30:52 -0400918 * Activity Action: Show Zen Mode event rule configuration settings.
919 *
920 * @hide
921 */
922 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
923 public static final String ACTION_ZEN_MODE_EVENT_RULE_SETTINGS
924 = "android.settings.ZEN_MODE_EVENT_RULE_SETTINGS";
925
926 /**
John Spurlock39581cc2015-04-10 11:59:01 -0400927 * Activity Action: Show Zen Mode external rule configuration settings.
928 *
929 * @hide
930 */
931 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
932 public static final String ACTION_ZEN_MODE_EXTERNAL_RULE_SETTINGS
933 = "android.settings.ZEN_MODE_EXTERNAL_RULE_SETTINGS";
934
935 /**
Santos Cordona4c75242014-07-09 12:07:51 -0700936 * Activity Action: Show the regulatory information screen for the device.
937 * <p>
938 * In some cases, a matching Activity may not exist, so ensure you safeguard
939 * against this.
940 * <p>
941 * Input: Nothing.
942 * <p>
943 * Output: Nothing.
944 */
Jeff Sharkeydd77fda2014-04-16 17:23:08 -0700945 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
946 public static final String
947 ACTION_SHOW_REGULATORY_INFO = "android.settings.SHOW_REGULATORY_INFO";
948
Jerome Poichet7974cb32014-05-14 12:04:43 -0700949 /**
950 * Activity Action: Show Device Name Settings.
951 * <p>
952 * In some cases, a matching Activity may not exist, so ensure you safeguard
Tim Kilbourn87cd0dc2014-04-14 15:37:51 -0700953 * against this.
Jerome Poichet7974cb32014-05-14 12:04:43 -0700954 *
955 * @hide
956 */
957 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
958 public static final String DEVICE_NAME_SETTINGS = "android.settings.DEVICE_NAME";
959
Tim Kilbourn87cd0dc2014-04-14 15:37:51 -0700960 /**
961 * Activity Action: Show pairing settings.
962 * <p>
963 * In some cases, a matching Activity may not exist, so ensure you safeguard
964 * against this.
965 *
966 * @hide
967 */
968 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
969 public static final String ACTION_PAIRING_SETTINGS = "android.settings.PAIRING_SETTINGS";
970
John Spurlockf8f524c2014-06-10 14:47:29 -0400971 /**
972 * Activity Action: Show battery saver settings.
John Spurlock73466662014-10-30 13:42:05 -0400973 * <p>
974 * In some cases, a matching Activity may not exist, so ensure you safeguard
975 * against this.
John Spurlockf8f524c2014-06-10 14:47:29 -0400976 */
977 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
978 public static final String ACTION_BATTERY_SAVER_SETTINGS
979 = "android.settings.BATTERY_SAVER_SETTINGS";
980
Amith Yamasanieb7b94a2014-07-14 18:02:08 -0700981 /**
Barnaby Jamesb3006d32015-04-02 17:49:54 -0700982 * Activity Action: Modify Battery Saver mode setting using a voice command.
983 * <p>
984 * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
985 * <p>
986 * This intent MUST be started using
987 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
988 * startVoiceActivity}.
989 * <p>
990 * Note: The activity implementing this intent MUST verify that
991 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before
992 * modifying the setting.
993 * <p>
994 * Input: To tell which state batter saver mode should be set to, add the
995 * {@link #EXTRA_BATTERY_SAVER_MODE_ENABLED} extra to this Intent with the state specified.
996 * If the extra is not included, no changes will be made.
997 * <p>
998 * Output: Nothing.
999 */
1000 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1001 public static final String ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE =
1002 "android.settings.VOICE_CONTROL_BATTERY_SAVER_MODE";
1003
1004 /**
Amith Yamasanieb7b94a2014-07-14 18:02:08 -07001005 * Activity Action: Show Home selection settings. If there are multiple activities
1006 * that can satisfy the {@link Intent#CATEGORY_HOME} intent, this screen allows you
1007 * to pick your preferred activity.
1008 */
1009 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1010 public static final String ACTION_HOME_SETTINGS
1011 = "android.settings.HOME_SETTINGS";
1012
John Spurlock2b0e09c2014-07-27 13:27:47 -04001013 /**
1014 * Activity Action: Show notification settings.
1015 *
1016 * @hide
1017 */
1018 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1019 public static final String ACTION_NOTIFICATION_SETTINGS
1020 = "android.settings.NOTIFICATION_SETTINGS";
1021
1022 /**
1023 * Activity Action: Show notification settings for a single app.
1024 *
1025 * @hide
1026 */
1027 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1028 public static final String ACTION_APP_NOTIFICATION_SETTINGS
1029 = "android.settings.APP_NOTIFICATION_SETTINGS";
1030
Chris Wrencd8f4f72014-08-27 18:48:13 -04001031 /**
1032 * Activity Action: Show notification redaction settings.
1033 *
1034 * @hide
1035 */
1036 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1037 public static final String ACTION_APP_NOTIFICATION_REDACTION
1038 = "android.settings.ACTION_APP_NOTIFICATION_REDACTION";
1039
John Spurlock2b0e09c2014-07-27 13:27:47 -04001040 /** @hide */ public static final String EXTRA_APP_UID = "app_uid";
1041 /** @hide */ public static final String EXTRA_APP_PACKAGE = "app_package";
1042
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001043 // End of Intent actions for Settings
1044
Erikeebc8e22010-02-18 13:27:19 -08001045 /**
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001046 * @hide - Private call() method on SettingsProvider to read from 'system' table.
1047 */
1048 public static final String CALL_METHOD_GET_SYSTEM = "GET_system";
1049
1050 /**
1051 * @hide - Private call() method on SettingsProvider to read from 'secure' table.
1052 */
1053 public static final String CALL_METHOD_GET_SECURE = "GET_secure";
1054
1055 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001056 * @hide - Private call() method on SettingsProvider to read from 'global' table.
1057 */
1058 public static final String CALL_METHOD_GET_GLOBAL = "GET_global";
1059
1060 /**
1061 * @hide - User handle argument extra to the fast-path call()-based requests
1062 */
1063 public static final String CALL_METHOD_USER_KEY = "_user";
1064
1065 /** @hide - Private call() method to write to 'system' table */
1066 public static final String CALL_METHOD_PUT_SYSTEM = "PUT_system";
1067
1068 /** @hide - Private call() method to write to 'secure' table */
1069 public static final String CALL_METHOD_PUT_SECURE = "PUT_secure";
1070
1071 /** @hide - Private call() method to write to 'global' table */
1072 public static final String CALL_METHOD_PUT_GLOBAL= "PUT_global";
1073
1074 /**
Erikeebc8e22010-02-18 13:27:19 -08001075 * Activity Extra: Limit available options in launched activity based on the given authority.
1076 * <p>
1077 * This can be passed as an extra field in an Activity Intent with one or more syncable content
1078 * provider's authorities as a String[]. This field is used by some intents to alter the
1079 * behavior of the called activity.
1080 * <p>
1081 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types available based
1082 * on the authority given.
1083 */
Alon Albert50359c22013-02-26 14:47:48 -08001084 public static final String EXTRA_AUTHORITIES = "authorities";
1085
Alon Albertd35bf1f2013-04-18 14:26:51 -07001086 /**
1087 * Activity Extra: Limit available options in launched activity based on the given account
1088 * types.
1089 * <p>
1090 * This can be passed as an extra field in an Activity Intent with one or more account types
1091 * as a String[]. This field is used by some intents to alter the behavior of the called
1092 * activity.
1093 * <p>
1094 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types to the specified
1095 * list.
1096 */
Alon Albert50359c22013-02-26 14:47:48 -08001097 public static final String EXTRA_ACCOUNT_TYPES = "account_types";
Erikeebc8e22010-02-18 13:27:19 -08001098
Tadashi G. Takaoka25480202011-01-20 23:13:02 +09001099 public static final String EXTRA_INPUT_METHOD_ID = "input_method_id";
1100
Barnaby James48f35522014-07-16 14:27:39 -07001101 /**
Michael Wrightc93fbd12014-09-22 20:07:59 -07001102 * Activity Extra: The device identifier to act upon.
1103 * <p>
1104 * This can be passed as an extra field in an Activity Intent with a single
1105 * InputDeviceIdentifier. This field is used by some activities to jump straight into the
1106 * settings for the given device.
1107 * <p>
Dianne Hackbornad6a99b2014-11-18 10:11:10 -08001108 * Example: The {@link #ACTION_INPUT_METHOD_SETTINGS} intent opens the keyboard layout
1109 * dialog for the given device.
Michael Wrightc93fbd12014-09-22 20:07:59 -07001110 * @hide
1111 */
1112 public static final String EXTRA_INPUT_DEVICE_IDENTIFIER = "input_device_identifier";
1113
1114 /**
Barnaby James48f35522014-07-16 14:27:39 -07001115 * Activity Extra: Enable or disable Airplane Mode.
1116 * <p>
1117 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_AIRPLANE_MODE}
Barnaby Jamesb3006d32015-04-02 17:49:54 -07001118 * intent as a boolean to indicate if it should be enabled.
Barnaby James48f35522014-07-16 14:27:39 -07001119 */
1120 public static final String EXTRA_AIRPLANE_MODE_ENABLED = "airplane_mode_enabled";
1121
Barnaby Jamesb3006d32015-04-02 17:49:54 -07001122 /**
1123 * Activity Extra: Enable or disable Battery saver mode.
1124 * <p>
1125 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE}
1126 * intent as a boolean to indicate if it should be enabled.
1127 */
1128 public static final String EXTRA_BATTERY_SAVER_MODE_ENABLED =
1129 "android.settings.extra.battery_saver_mode_enabled";
1130
1131 /**
1132 * Activity Extra: Enable or disable Do Not Disturb mode.
1133 * <p>
1134 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE}
1135 * intent as a boolean to indicate if it should be enabled.
1136 */
1137 public static final String EXTRA_DO_NOT_DISTURB_MODE_ENABLED =
1138 "android.settings.extra.do_not_disturb_mode_enabled";
1139
1140 /**
1141 * Activity Extra: How many minutes to enable do not disturb mode for.
1142 * <p>
1143 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE}
1144 * intent to indicate how long do not disturb mode should be enabled for.
1145 */
1146 public static final String EXTRA_DO_NOT_DISTURB_MODE_MINUTES =
1147 "android.settings.extra.do_not_disturb_mode_minutes";
1148
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001149 private static final String JID_RESOURCE_PREFIX = "android";
1150
1151 public static final String AUTHORITY = "settings";
1152
1153 private static final String TAG = "Settings";
Christopher Tate06efb532012-08-24 15:29:27 -07001154 private static final boolean LOCAL_LOGV = false;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001155
David Christie3f7b6522013-08-06 19:19:08 -07001156 // Lock ensures that when enabling/disabling the master location switch, we don't end up
1157 // with a partial enable/disable state in multi-threaded situations.
1158 private static final Object mLocationSettingsLock = new Object();
1159
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001160 public static class SettingNotFoundException extends AndroidException {
1161 public SettingNotFoundException(String msg) {
1162 super(msg);
1163 }
1164 }
1165
1166 /**
1167 * Common base for tables of name/value settings.
1168 */
1169 public static class NameValueTable implements BaseColumns {
1170 public static final String NAME = "name";
1171 public static final String VALUE = "value";
1172
1173 protected static boolean putString(ContentResolver resolver, Uri uri,
1174 String name, String value) {
1175 // The database will take care of replacing duplicates.
1176 try {
1177 ContentValues values = new ContentValues();
1178 values.put(NAME, name);
1179 values.put(VALUE, value);
1180 resolver.insert(uri, values);
1181 return true;
1182 } catch (SQLException e) {
Dianne Hackborna33e3f72009-09-29 17:28:24 -07001183 Log.w(TAG, "Can't set key " + name + " in " + uri, e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001184 return false;
1185 }
1186 }
1187
1188 public static Uri getUriFor(Uri uri, String name) {
1189 return Uri.withAppendedPath(uri, name);
1190 }
1191 }
1192
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001193 // Thread-safe.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001194 private static class NameValueCache {
1195 private final String mVersionSystemProperty;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001196 private final Uri mUri;
1197
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001198 private static final String[] SELECT_VALUE =
1199 new String[] { Settings.NameValueTable.VALUE };
1200 private static final String NAME_EQ_PLACEHOLDER = "name=?";
1201
1202 // Must synchronize on 'this' to access mValues and mValuesVersion.
Dan Egnor799f7212009-11-24 16:24:44 -08001203 private final HashMap<String, String> mValues = new HashMap<String, String>();
1204 private long mValuesVersion = 0;
1205
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001206 // Initially null; set lazily and held forever. Synchronized on 'this'.
1207 private IContentProvider mContentProvider = null;
1208
1209 // The method we'll call (or null, to not use) on the provider
1210 // for the fast path of retrieving settings.
Christopher Tate06efb532012-08-24 15:29:27 -07001211 private final String mCallGetCommand;
1212 private final String mCallSetCommand;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001213
Christopher Tate06efb532012-08-24 15:29:27 -07001214 public NameValueCache(String versionSystemProperty, Uri uri,
1215 String getCommand, String setCommand) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001216 mVersionSystemProperty = versionSystemProperty;
1217 mUri = uri;
Christopher Tate06efb532012-08-24 15:29:27 -07001218 mCallGetCommand = getCommand;
1219 mCallSetCommand = setCommand;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001220 }
1221
Christopher Tate06efb532012-08-24 15:29:27 -07001222 private IContentProvider lazyGetProvider(ContentResolver cr) {
1223 IContentProvider cp = null;
1224 synchronized (this) {
1225 cp = mContentProvider;
1226 if (cp == null) {
1227 cp = mContentProvider = cr.acquireProvider(mUri.getAuthority());
1228 }
1229 }
1230 return cp;
1231 }
1232
1233 public boolean putStringForUser(ContentResolver cr, String name, String value,
1234 final int userHandle) {
1235 try {
1236 Bundle arg = new Bundle();
1237 arg.putString(Settings.NameValueTable.VALUE, value);
Christopher Tated5fe1472012-09-10 15:48:38 -07001238 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
Christopher Tate06efb532012-08-24 15:29:27 -07001239 IContentProvider cp = lazyGetProvider(cr);
Dianne Hackborn35654b62013-01-14 17:38:02 -08001240 cp.call(cr.getPackageName(), mCallSetCommand, name, arg);
Christopher Tate06efb532012-08-24 15:29:27 -07001241 } catch (RemoteException e) {
1242 Log.w(TAG, "Can't set key " + name + " in " + mUri, e);
1243 return false;
1244 }
1245 return true;
1246 }
1247
Christopher Tate06efb532012-08-24 15:29:27 -07001248 public String getStringForUser(ContentResolver cr, String name, final int userHandle) {
Christopher Tate78d2a662012-09-13 16:19:44 -07001249 final boolean isSelf = (userHandle == UserHandle.myUserId());
1250 if (isSelf) {
1251 long newValuesVersion = SystemProperties.getLong(mVersionSystemProperty, 0);
Dan Egnor799f7212009-11-24 16:24:44 -08001252
Christopher Tate78d2a662012-09-13 16:19:44 -07001253 // Our own user's settings data uses a client-side cache
1254 synchronized (this) {
1255 if (mValuesVersion != newValuesVersion) {
1256 if (LOCAL_LOGV || false) {
1257 Log.v(TAG, "invalidate [" + mUri.getLastPathSegment() + "]: current "
1258 + newValuesVersion + " != cached " + mValuesVersion);
1259 }
1260
1261 mValues.clear();
1262 mValuesVersion = newValuesVersion;
Dan Egnor799f7212009-11-24 16:24:44 -08001263 }
1264
Christopher Tate78d2a662012-09-13 16:19:44 -07001265 if (mValues.containsKey(name)) {
1266 return mValues.get(name); // Could be null, that's OK -- negative caching
1267 }
Dan Egnor799f7212009-11-24 16:24:44 -08001268 }
Christopher Tate78d2a662012-09-13 16:19:44 -07001269 } else {
1270 if (LOCAL_LOGV) Log.v(TAG, "get setting for user " + userHandle
1271 + " by user " + UserHandle.myUserId() + " so skipping cache");
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001272 }
Dan Egnor799f7212009-11-24 16:24:44 -08001273
Christopher Tate06efb532012-08-24 15:29:27 -07001274 IContentProvider cp = lazyGetProvider(cr);
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001275
1276 // Try the fast path first, not using query(). If this
1277 // fails (alternate Settings provider that doesn't support
1278 // this interface?) then we fall back to the query/table
1279 // interface.
Christopher Tate06efb532012-08-24 15:29:27 -07001280 if (mCallGetCommand != null) {
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001281 try {
Christopher Tate06efb532012-08-24 15:29:27 -07001282 Bundle args = null;
Christopher Tate5e08af02012-09-21 17:17:22 -07001283 if (!isSelf) {
Christopher Tate06efb532012-08-24 15:29:27 -07001284 args = new Bundle();
1285 args.putInt(CALL_METHOD_USER_KEY, userHandle);
1286 }
Dianne Hackborn35654b62013-01-14 17:38:02 -08001287 Bundle b = cp.call(cr.getPackageName(), mCallGetCommand, name, args);
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001288 if (b != null) {
1289 String value = b.getPairValue();
Christopher Tate78d2a662012-09-13 16:19:44 -07001290 // Don't update our cache for reads of other users' data
1291 if (isSelf) {
1292 synchronized (this) {
1293 mValues.put(name, value);
1294 }
1295 } else {
1296 if (LOCAL_LOGV) Log.i(TAG, "call-query of user " + userHandle
1297 + " by " + UserHandle.myUserId()
1298 + " so not updating cache");
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001299 }
1300 return value;
1301 }
1302 // If the response Bundle is null, we fall through
1303 // to the query interface below.
1304 } catch (RemoteException e) {
1305 // Not supported by the remote side? Fall through
1306 // to query().
1307 }
1308 }
1309
Dan Egnor799f7212009-11-24 16:24:44 -08001310 Cursor c = null;
1311 try {
Dianne Hackborn35654b62013-01-14 17:38:02 -08001312 c = cp.query(cr.getPackageName(), mUri, SELECT_VALUE, NAME_EQ_PLACEHOLDER,
Jeff Brown75ea64f2012-01-25 19:37:13 -08001313 new String[]{name}, null, null);
Dan Egnor799f7212009-11-24 16:24:44 -08001314 if (c == null) {
1315 Log.w(TAG, "Can't get key " + name + " from " + mUri);
1316 return null;
1317 }
1318
1319 String value = c.moveToNext() ? c.getString(0) : null;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001320 synchronized (this) {
Dan Egnor799f7212009-11-24 16:24:44 -08001321 mValues.put(name, value);
1322 }
1323 if (LOCAL_LOGV) {
1324 Log.v(TAG, "cache miss [" + mUri.getLastPathSegment() + "]: " +
1325 name + " = " + (value == null ? "(null)" : value));
1326 }
1327 return value;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001328 } catch (RemoteException e) {
Dan Egnor799f7212009-11-24 16:24:44 -08001329 Log.w(TAG, "Can't get key " + name + " from " + mUri, e);
1330 return null; // Return null, but don't cache it.
1331 } finally {
1332 if (c != null) c.close();
1333 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001334 }
1335 }
1336
1337 /**
1338 * System settings, containing miscellaneous system preferences. This
1339 * table holds simple name/value pairs. There are convenience
1340 * functions for accessing individual settings entries.
1341 */
1342 public static final class System extends NameValueTable {
1343 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_system_version";
1344
Svetoslav683914b2015-01-15 14:22:26 -08001345 /** @hide */
1346 public static interface Validator {
1347 public boolean validate(String value);
1348 }
1349
Dianne Hackborn139748f2012-09-24 11:36:57 -07001350 /**
1351 * The content:// style URL for this table
1352 */
1353 public static final Uri CONTENT_URI =
1354 Uri.parse("content://" + AUTHORITY + "/system");
1355
1356 private static final NameValueCache sNameValueCache = new NameValueCache(
1357 SYS_PROP_SETTING_VERSION,
1358 CONTENT_URI,
1359 CALL_METHOD_GET_SYSTEM,
1360 CALL_METHOD_PUT_SYSTEM);
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001361
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001362 private static final HashSet<String> MOVED_TO_SECURE;
1363 static {
1364 MOVED_TO_SECURE = new HashSet<String>(30);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001365 MOVED_TO_SECURE.add(Secure.ANDROID_ID);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001366 MOVED_TO_SECURE.add(Secure.HTTP_PROXY);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001367 MOVED_TO_SECURE.add(Secure.LOCATION_PROVIDERS_ALLOWED);
Danielle Millett925a7d82012-03-19 18:02:20 -04001368 MOVED_TO_SECURE.add(Secure.LOCK_BIOMETRIC_WEAK_FLAGS);
Amith Yamasani156c4352010-03-05 17:10:03 -08001369 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_ENABLED);
1370 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_VISIBLE);
1371 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001372 MOVED_TO_SECURE.add(Secure.LOGGING_ID);
1373 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_ENABLED);
1374 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_LAST_UPDATE);
1375 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_REDIRECT_URL);
1376 MOVED_TO_SECURE.add(Secure.SETTINGS_CLASSNAME);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001377 MOVED_TO_SECURE.add(Secure.USE_GOOGLE_MAIL);
1378 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
1379 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
1380 MOVED_TO_SECURE.add(Secure.WIFI_NUM_OPEN_NETWORKS_KEPT);
1381 MOVED_TO_SECURE.add(Secure.WIFI_ON);
1382 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE);
1383 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_AP_COUNT);
1384 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS);
1385 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED);
1386 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS);
1387 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT);
1388 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_MAX_AP_CHECKS);
1389 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ON);
1390 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_COUNT);
1391 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_DELAY_MS);
1392 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS);
Christopher Tateaa036a22014-05-19 16:33:27 -07001393
1394 // At one time in System, then Global, but now back in Secure
1395 MOVED_TO_SECURE.add(Secure.INSTALL_NON_MARKET_APPS);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001396 }
1397
Christopher Tate06efb532012-08-24 15:29:27 -07001398 private static final HashSet<String> MOVED_TO_GLOBAL;
Christopher Tate66488d62012-10-02 11:58:01 -07001399 private static final HashSet<String> MOVED_TO_SECURE_THEN_GLOBAL;
Christopher Tate06efb532012-08-24 15:29:27 -07001400 static {
1401 MOVED_TO_GLOBAL = new HashSet<String>();
Christopher Tate66488d62012-10-02 11:58:01 -07001402 MOVED_TO_SECURE_THEN_GLOBAL = new HashSet<String>();
1403
Christopher Tate92198742012-09-07 12:00:13 -07001404 // these were originally in system but migrated to secure in the past,
1405 // so are duplicated in the Secure.* namespace
Christopher Tate66488d62012-10-02 11:58:01 -07001406 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.ADB_ENABLED);
1407 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.BLUETOOTH_ON);
1408 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DATA_ROAMING);
1409 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DEVICE_PROVISIONED);
Christopher Tate66488d62012-10-02 11:58:01 -07001410 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.USB_MASS_STORAGE_ENABLED);
1411 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.HTTP_PROXY);
Christopher Tate06efb532012-08-24 15:29:27 -07001412
Christopher Tate92198742012-09-07 12:00:13 -07001413 // these are moving directly from system to global
Christopher Tate06efb532012-08-24 15:29:27 -07001414 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_ON);
1415 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_RADIOS);
1416 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS);
1417 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME);
1418 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME_ZONE);
1419 MOVED_TO_GLOBAL.add(Settings.Global.CAR_DOCK_SOUND);
1420 MOVED_TO_GLOBAL.add(Settings.Global.CAR_UNDOCK_SOUND);
1421 MOVED_TO_GLOBAL.add(Settings.Global.DESK_DOCK_SOUND);
1422 MOVED_TO_GLOBAL.add(Settings.Global.DESK_UNDOCK_SOUND);
1423 MOVED_TO_GLOBAL.add(Settings.Global.DOCK_SOUNDS_ENABLED);
1424 MOVED_TO_GLOBAL.add(Settings.Global.LOCK_SOUND);
1425 MOVED_TO_GLOBAL.add(Settings.Global.UNLOCK_SOUND);
1426 MOVED_TO_GLOBAL.add(Settings.Global.LOW_BATTERY_SOUND);
1427 MOVED_TO_GLOBAL.add(Settings.Global.POWER_SOUNDS_ENABLED);
1428 MOVED_TO_GLOBAL.add(Settings.Global.STAY_ON_WHILE_PLUGGED_IN);
1429 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SLEEP_POLICY);
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07001430 MOVED_TO_GLOBAL.add(Settings.Global.MODE_RINGER);
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001431 MOVED_TO_GLOBAL.add(Settings.Global.WINDOW_ANIMATION_SCALE);
1432 MOVED_TO_GLOBAL.add(Settings.Global.TRANSITION_ANIMATION_SCALE);
1433 MOVED_TO_GLOBAL.add(Settings.Global.ANIMATOR_DURATION_SCALE);
1434 MOVED_TO_GLOBAL.add(Settings.Global.FANCY_IME_ANIMATIONS);
1435 MOVED_TO_GLOBAL.add(Settings.Global.COMPATIBILITY_MODE);
1436 MOVED_TO_GLOBAL.add(Settings.Global.EMERGENCY_TONE);
1437 MOVED_TO_GLOBAL.add(Settings.Global.CALL_AUTO_RETRY);
1438 MOVED_TO_GLOBAL.add(Settings.Global.DEBUG_APP);
1439 MOVED_TO_GLOBAL.add(Settings.Global.WAIT_FOR_DEBUGGER);
1440 MOVED_TO_GLOBAL.add(Settings.Global.SHOW_PROCESSES);
1441 MOVED_TO_GLOBAL.add(Settings.Global.ALWAYS_FINISH_ACTIVITIES);
Geremy Condraa0735112013-03-26 21:49:26 -07001442 MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_CONTENT_URL);
1443 MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_METADATA_URL);
1444 MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_CONTENT_URL);
1445 MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_METADATA_URL);
1446 MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_CONTENT_URL);
1447 MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_METADATA_URL);
1448 MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_CONTENT_URL);
1449 MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_METADATA_URL);
Christopher Tate06efb532012-08-24 15:29:27 -07001450 }
1451
Svetoslav683914b2015-01-15 14:22:26 -08001452 private static final Validator sBooleanValidator =
1453 new DiscreteValueValidator(new String[] {"0", "1"});
1454
1455 private static final Validator sNonNegativeIntegerValidator = new Validator() {
1456 @Override
1457 public boolean validate(String value) {
1458 try {
1459 return Integer.parseInt(value) >= 0;
1460 } catch (NumberFormatException e) {
1461 return false;
1462 }
1463 }
1464 };
1465
Svetoslav683914b2015-01-15 14:22:26 -08001466 private static final Validator sUriValidator = new Validator() {
1467 @Override
1468 public boolean validate(String value) {
1469 try {
1470 Uri.decode(value);
1471 return true;
1472 } catch (IllegalArgumentException e) {
1473 return false;
1474 }
1475 }
1476 };
1477
1478 private static final Validator sLenientIpAddressValidator = new Validator() {
1479 private static final int MAX_IPV6_LENGTH = 45;
1480
1481 @Override
1482 public boolean validate(String value) {
1483 return value.length() <= MAX_IPV6_LENGTH;
1484 }
1485 };
1486
Christopher Tate66488d62012-10-02 11:58:01 -07001487 /** @hide */
Svetoslav683914b2015-01-15 14:22:26 -08001488 public static void getMovedToGlobalSettings(Set<String> outKeySet) {
Christopher Tate66488d62012-10-02 11:58:01 -07001489 outKeySet.addAll(MOVED_TO_GLOBAL);
1490 outKeySet.addAll(MOVED_TO_SECURE_THEN_GLOBAL);
1491 }
1492
1493 /** @hide */
Svetoslav683914b2015-01-15 14:22:26 -08001494 public static void getMovedToSecureSettings(Set<String> outKeySet) {
1495 outKeySet.addAll(MOVED_TO_SECURE);
1496 }
1497
1498 /** @hide */
Christopher Tate66488d62012-10-02 11:58:01 -07001499 public static void getNonLegacyMovedKeys(HashSet<String> outKeySet) {
1500 outKeySet.addAll(MOVED_TO_GLOBAL);
1501 }
1502
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001503 /**
1504 * Look up a name in the database.
1505 * @param resolver to access the database with
1506 * @param name to look up in the table
1507 * @return the corresponding value, or null if not present
1508 */
Dianne Hackborn139748f2012-09-24 11:36:57 -07001509 public static String getString(ContentResolver resolver, String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07001510 return getStringForUser(resolver, name, UserHandle.myUserId());
1511 }
1512
1513 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -07001514 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -07001515 int userHandle) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001516 if (MOVED_TO_SECURE.contains(name)) {
1517 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1518 + " to android.provider.Settings.Secure, returning read-only value.");
Christopher Tate06efb532012-08-24 15:29:27 -07001519 return Secure.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001520 }
Christopher Tate66488d62012-10-02 11:58:01 -07001521 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07001522 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1523 + " to android.provider.Settings.Global, returning read-only value.");
1524 return Global.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001525 }
Christopher Tate06efb532012-08-24 15:29:27 -07001526 return sNameValueCache.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001527 }
1528
1529 /**
1530 * Store a name/value pair into the database.
1531 * @param resolver to access the database with
1532 * @param name to store
1533 * @param value to associate with the name
1534 * @return true if the value was set, false on database errors
1535 */
1536 public static boolean putString(ContentResolver resolver, String name, String value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001537 return putStringForUser(resolver, name, value, UserHandle.myUserId());
1538 }
1539
1540 /** @hide */
1541 public static boolean putStringForUser(ContentResolver resolver, String name, String value,
1542 int userHandle) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001543 if (MOVED_TO_SECURE.contains(name)) {
1544 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1545 + " to android.provider.Settings.Secure, value is unchanged.");
1546 return false;
1547 }
Christopher Tate66488d62012-10-02 11:58:01 -07001548 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07001549 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1550 + " to android.provider.Settings.Global, value is unchanged.");
1551 return false;
1552 }
Christopher Tate06efb532012-08-24 15:29:27 -07001553 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001554 }
1555
1556 /**
1557 * Construct the content URI for a particular name/value pair,
1558 * useful for monitoring changes with a ContentObserver.
1559 * @param name to look up in the table
1560 * @return the corresponding content URI, or null if not present
1561 */
1562 public static Uri getUriFor(String name) {
1563 if (MOVED_TO_SECURE.contains(name)) {
1564 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1565 + " to android.provider.Settings.Secure, returning Secure URI.");
1566 return Secure.getUriFor(Secure.CONTENT_URI, name);
1567 }
Christopher Tate66488d62012-10-02 11:58:01 -07001568 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07001569 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1570 + " to android.provider.Settings.Global, returning read-only global URI.");
1571 return Global.getUriFor(Global.CONTENT_URI, name);
1572 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001573 return getUriFor(CONTENT_URI, name);
1574 }
1575
1576 /**
1577 * Convenience function for retrieving a single system settings value
1578 * as an integer. Note that internally setting values are always
1579 * stored as strings; this function converts the string to an integer
1580 * for you. The default value will be returned if the setting is
1581 * not defined or not an integer.
1582 *
1583 * @param cr The ContentResolver to access.
1584 * @param name The name of the setting to retrieve.
1585 * @param def Value to return if the setting is not defined.
1586 *
1587 * @return The setting's current value, or 'def' if it is not defined
1588 * or not a valid integer.
1589 */
1590 public static int getInt(ContentResolver cr, String name, int def) {
Christopher Tate06efb532012-08-24 15:29:27 -07001591 return getIntForUser(cr, name, def, UserHandle.myUserId());
1592 }
1593
1594 /** @hide */
1595 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
1596 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001597 try {
1598 return v != null ? Integer.parseInt(v) : def;
1599 } catch (NumberFormatException e) {
1600 return def;
1601 }
1602 }
1603
1604 /**
1605 * Convenience function for retrieving a single system settings value
1606 * as an integer. Note that internally setting values are always
1607 * stored as strings; this function converts the string to an integer
1608 * for you.
1609 * <p>
1610 * This version does not take a default value. If the setting has not
1611 * been set, or the string value is not a number,
1612 * it throws {@link SettingNotFoundException}.
1613 *
1614 * @param cr The ContentResolver to access.
1615 * @param name The name of the setting to retrieve.
1616 *
1617 * @throws SettingNotFoundException Thrown if a setting by the given
1618 * name can't be found or the setting value is not an integer.
1619 *
1620 * @return The setting's current value.
1621 */
1622 public static int getInt(ContentResolver cr, String name)
1623 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07001624 return getIntForUser(cr, name, UserHandle.myUserId());
1625 }
1626
1627 /** @hide */
1628 public static int getIntForUser(ContentResolver cr, String name, int userHandle)
1629 throws SettingNotFoundException {
1630 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001631 try {
1632 return Integer.parseInt(v);
1633 } catch (NumberFormatException e) {
1634 throw new SettingNotFoundException(name);
1635 }
1636 }
1637
1638 /**
1639 * Convenience function for updating a single settings value as an
1640 * integer. This will either create a new entry in the table if the
1641 * given name does not exist, or modify the value of the existing row
1642 * with that name. Note that internally setting values are always
1643 * stored as strings, so this function converts the given value to a
1644 * string before storing it.
1645 *
1646 * @param cr The ContentResolver to access.
1647 * @param name The name of the setting to modify.
1648 * @param value The new value for the setting.
1649 * @return true if the value was set, false on database errors
1650 */
1651 public static boolean putInt(ContentResolver cr, String name, int value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001652 return putIntForUser(cr, name, value, UserHandle.myUserId());
1653 }
1654
1655 /** @hide */
1656 public static boolean putIntForUser(ContentResolver cr, String name, int value,
1657 int userHandle) {
1658 return putStringForUser(cr, name, Integer.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001659 }
1660
1661 /**
1662 * Convenience function for retrieving a single system settings value
1663 * as a {@code long}. Note that internally setting values are always
1664 * stored as strings; this function converts the string to a {@code long}
1665 * for you. The default value will be returned if the setting is
1666 * not defined or not a {@code long}.
1667 *
1668 * @param cr The ContentResolver to access.
1669 * @param name The name of the setting to retrieve.
1670 * @param def Value to return if the setting is not defined.
1671 *
1672 * @return The setting's current value, or 'def' if it is not defined
1673 * or not a valid {@code long}.
1674 */
1675 public static long getLong(ContentResolver cr, String name, long def) {
Christopher Tate06efb532012-08-24 15:29:27 -07001676 return getLongForUser(cr, name, def, UserHandle.myUserId());
1677 }
1678
1679 /** @hide */
1680 public static long getLongForUser(ContentResolver cr, String name, long def,
1681 int userHandle) {
1682 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001683 long value;
1684 try {
1685 value = valString != null ? Long.parseLong(valString) : def;
1686 } catch (NumberFormatException e) {
1687 value = def;
1688 }
1689 return value;
1690 }
1691
1692 /**
1693 * Convenience function for retrieving a single system settings value
1694 * as a {@code long}. Note that internally setting values are always
1695 * stored as strings; this function converts the string to a {@code long}
1696 * for you.
1697 * <p>
1698 * This version does not take a default value. If the setting has not
1699 * been set, or the string value is not a number,
1700 * it throws {@link SettingNotFoundException}.
1701 *
1702 * @param cr The ContentResolver to access.
1703 * @param name The name of the setting to retrieve.
1704 *
1705 * @return The setting's current value.
1706 * @throws SettingNotFoundException Thrown if a setting by the given
1707 * name can't be found or the setting value is not an integer.
1708 */
1709 public static long getLong(ContentResolver cr, String name)
1710 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07001711 return getLongForUser(cr, name, UserHandle.myUserId());
1712 }
1713
1714 /** @hide */
1715 public static long getLongForUser(ContentResolver cr, String name, int userHandle)
1716 throws SettingNotFoundException {
1717 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001718 try {
1719 return Long.parseLong(valString);
1720 } catch (NumberFormatException e) {
1721 throw new SettingNotFoundException(name);
1722 }
1723 }
1724
1725 /**
1726 * Convenience function for updating a single settings value as a long
1727 * integer. This will either create a new entry in the table if the
1728 * given name does not exist, or modify the value of the existing row
1729 * with that name. Note that internally setting values are always
1730 * stored as strings, so this function converts the given value to a
1731 * string before storing it.
1732 *
1733 * @param cr The ContentResolver to access.
1734 * @param name The name of the setting to modify.
1735 * @param value The new value for the setting.
1736 * @return true if the value was set, false on database errors
1737 */
1738 public static boolean putLong(ContentResolver cr, String name, long value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001739 return putLongForUser(cr, name, value, UserHandle.myUserId());
1740 }
1741
1742 /** @hide */
1743 public static boolean putLongForUser(ContentResolver cr, String name, long value,
1744 int userHandle) {
1745 return putStringForUser(cr, name, Long.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001746 }
1747
1748 /**
1749 * Convenience function for retrieving a single system settings value
1750 * as a floating point number. Note that internally setting values are
1751 * always stored as strings; this function converts the string to an
1752 * float for you. The default value will be returned if the setting
1753 * is not defined or not a valid float.
1754 *
1755 * @param cr The ContentResolver to access.
1756 * @param name The name of the setting to retrieve.
1757 * @param def Value to return if the setting is not defined.
1758 *
1759 * @return The setting's current value, or 'def' if it is not defined
1760 * or not a valid float.
1761 */
1762 public static float getFloat(ContentResolver cr, String name, float def) {
Christopher Tate06efb532012-08-24 15:29:27 -07001763 return getFloatForUser(cr, name, def, UserHandle.myUserId());
1764 }
1765
1766 /** @hide */
1767 public static float getFloatForUser(ContentResolver cr, String name, float def,
1768 int userHandle) {
1769 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001770 try {
1771 return v != null ? Float.parseFloat(v) : def;
1772 } catch (NumberFormatException e) {
1773 return def;
1774 }
1775 }
1776
1777 /**
1778 * Convenience function for retrieving a single system settings value
1779 * as a float. Note that internally setting values are always
1780 * stored as strings; this function converts the string to a float
1781 * for you.
1782 * <p>
1783 * This version does not take a default value. If the setting has not
1784 * been set, or the string value is not a number,
1785 * it throws {@link SettingNotFoundException}.
1786 *
1787 * @param cr The ContentResolver to access.
1788 * @param name The name of the setting to retrieve.
1789 *
1790 * @throws SettingNotFoundException Thrown if a setting by the given
1791 * name can't be found or the setting value is not a float.
1792 *
1793 * @return The setting's current value.
1794 */
1795 public static float getFloat(ContentResolver cr, String name)
1796 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07001797 return getFloatForUser(cr, name, UserHandle.myUserId());
1798 }
1799
1800 /** @hide */
1801 public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
1802 throws SettingNotFoundException {
1803 String v = getStringForUser(cr, name, userHandle);
Brian Muramatsue1d46982010-12-06 17:34:20 -08001804 if (v == null) {
1805 throw new SettingNotFoundException(name);
1806 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001807 try {
1808 return Float.parseFloat(v);
1809 } catch (NumberFormatException e) {
1810 throw new SettingNotFoundException(name);
1811 }
1812 }
1813
1814 /**
1815 * Convenience function for updating a single settings value as a
1816 * floating point number. This will either create a new entry in the
1817 * table if the given name does not exist, or modify the value of the
1818 * existing row with that name. Note that internally setting values
1819 * are always stored as strings, so this function converts the given
1820 * value to a string before storing it.
1821 *
1822 * @param cr The ContentResolver to access.
1823 * @param name The name of the setting to modify.
1824 * @param value The new value for the setting.
1825 * @return true if the value was set, false on database errors
1826 */
1827 public static boolean putFloat(ContentResolver cr, String name, float value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001828 return putFloatForUser(cr, name, value, UserHandle.myUserId());
1829 }
1830
1831 /** @hide */
1832 public static boolean putFloatForUser(ContentResolver cr, String name, float value,
1833 int userHandle) {
1834 return putStringForUser(cr, name, Float.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001835 }
1836
1837 /**
1838 * Convenience function to read all of the current
1839 * configuration-related settings into a
1840 * {@link Configuration} object.
1841 *
1842 * @param cr The ContentResolver to access.
1843 * @param outConfig Where to place the configuration settings.
1844 */
1845 public static void getConfiguration(ContentResolver cr, Configuration outConfig) {
Christopher Tate06efb532012-08-24 15:29:27 -07001846 getConfigurationForUser(cr, outConfig, UserHandle.myUserId());
1847 }
1848
1849 /** @hide */
1850 public static void getConfigurationForUser(ContentResolver cr, Configuration outConfig,
1851 int userHandle) {
1852 outConfig.fontScale = Settings.System.getFloatForUser(
1853 cr, FONT_SCALE, outConfig.fontScale, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001854 if (outConfig.fontScale < 0) {
1855 outConfig.fontScale = 1;
1856 }
1857 }
1858
1859 /**
Dianne Hackborn31ca8542011-07-19 14:58:28 -07001860 * @hide Erase the fields in the Configuration that should be applied
1861 * by the settings.
1862 */
1863 public static void clearConfiguration(Configuration inoutConfig) {
1864 inoutConfig.fontScale = 0;
1865 }
Narayan Kamath6d632962011-08-24 11:51:37 +01001866
Dianne Hackborn31ca8542011-07-19 14:58:28 -07001867 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001868 * Convenience function to write a batch of configuration-related
1869 * settings from a {@link Configuration} object.
1870 *
1871 * @param cr The ContentResolver to access.
1872 * @param config The settings to write.
1873 * @return true if the values were set, false on database errors
1874 */
1875 public static boolean putConfiguration(ContentResolver cr, Configuration config) {
Christopher Tate06efb532012-08-24 15:29:27 -07001876 return putConfigurationForUser(cr, config, UserHandle.myUserId());
1877 }
1878
1879 /** @hide */
1880 public static boolean putConfigurationForUser(ContentResolver cr, Configuration config,
1881 int userHandle) {
1882 return Settings.System.putFloatForUser(cr, FONT_SCALE, config.fontScale, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001883 }
1884
Dianne Hackbornb8b11a02010-03-10 15:53:11 -08001885 /** @hide */
1886 public static boolean hasInterestingConfigurationChanges(int changes) {
1887 return (changes&ActivityInfo.CONFIG_FONT_SCALE) != 0;
1888 }
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07001889
Christopher Tate06efb532012-08-24 15:29:27 -07001890 /** @deprecated - Do not use */
1891 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001892 public static boolean getShowGTalkServiceStatus(ContentResolver cr) {
Christopher Tate06efb532012-08-24 15:29:27 -07001893 return getShowGTalkServiceStatusForUser(cr, UserHandle.myUserId());
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001894 }
1895
Christopher Tate06efb532012-08-24 15:29:27 -07001896 /**
1897 * @hide
1898 * @deprecated - Do not use
1899 */
1900 public static boolean getShowGTalkServiceStatusForUser(ContentResolver cr,
1901 int userHandle) {
1902 return getIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, 0, userHandle) != 0;
1903 }
1904
1905 /** @deprecated - Do not use */
1906 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001907 public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag) {
Christopher Tatec8c08382012-09-19 17:18:18 -07001908 setShowGTalkServiceStatusForUser(cr, flag, UserHandle.myUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07001909 }
1910
1911 /**
1912 * @hide
1913 * @deprecated - Do not use
1914 */
1915 @Deprecated
1916 public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean flag,
1917 int userHandle) {
1918 putIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, flag ? 1 : 0, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001919 }
1920
Svetoslav683914b2015-01-15 14:22:26 -08001921 private static final class DiscreteValueValidator implements Validator {
1922 private final String[] mValues;
1923
1924 public DiscreteValueValidator(String[] values) {
1925 mValues = values;
1926 }
1927
Svetoslav1b71ea92015-02-17 18:20:29 -08001928 @Override
Svetoslav683914b2015-01-15 14:22:26 -08001929 public boolean validate(String value) {
1930 return ArrayUtils.contains(mValues, value);
1931 }
1932 }
1933
1934 private static final class InclusiveIntegerRangeValidator implements Validator {
1935 private final int mMin;
1936 private final int mMax;
1937
1938 public InclusiveIntegerRangeValidator(int min, int max) {
1939 mMin = min;
1940 mMax = max;
1941 }
1942
Svetoslav1b71ea92015-02-17 18:20:29 -08001943 @Override
Svetoslav683914b2015-01-15 14:22:26 -08001944 public boolean validate(String value) {
1945 try {
1946 final int intValue = Integer.parseInt(value);
1947 return intValue >= mMin && intValue <= mMax;
1948 } catch (NumberFormatException e) {
1949 return false;
1950 }
1951 }
1952 }
1953
1954 private static final class InclusiveFloatRangeValidator implements Validator {
1955 private final float mMin;
1956 private final float mMax;
1957
1958 public InclusiveFloatRangeValidator(float min, float max) {
1959 mMin = min;
1960 mMax = max;
1961 }
1962
Svetoslav1b71ea92015-02-17 18:20:29 -08001963 @Override
Svetoslav683914b2015-01-15 14:22:26 -08001964 public boolean validate(String value) {
1965 try {
1966 final float floatValue = Float.parseFloat(value);
1967 return floatValue >= mMin && floatValue <= mMax;
1968 } catch (NumberFormatException e) {
1969 return false;
1970 }
1971 }
1972 }
1973
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001974 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001975 * @deprecated Use {@link android.provider.Settings.Global#STAY_ON_WHILE_PLUGGED_IN} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001976 */
Christopher Tate06efb532012-08-24 15:29:27 -07001977 @Deprecated
1978 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 -08001979
1980 /**
1981 * What happens when the user presses the end call button if they're not
1982 * on a call.<br/>
1983 * <b>Values:</b><br/>
1984 * 0 - The end button does nothing.<br/>
1985 * 1 - The end button goes to the home screen.<br/>
1986 * 2 - The end button puts the device to sleep and locks the keyguard.<br/>
1987 * 3 - The end button goes to the home screen. If the user is already on the
1988 * home screen, it puts the device to sleep.
1989 */
1990 public static final String END_BUTTON_BEHAVIOR = "end_button_behavior";
1991
Svetoslav683914b2015-01-15 14:22:26 -08001992 private static final Validator END_BUTTON_BEHAVIOR_VALIDATOR =
1993 new InclusiveIntegerRangeValidator(0, 3);
1994
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001995 /**
David Brown458e8062010-03-08 21:52:11 -08001996 * END_BUTTON_BEHAVIOR value for "go home".
1997 * @hide
1998 */
1999 public static final int END_BUTTON_BEHAVIOR_HOME = 0x1;
2000
2001 /**
2002 * END_BUTTON_BEHAVIOR value for "go to sleep".
2003 * @hide
2004 */
2005 public static final int END_BUTTON_BEHAVIOR_SLEEP = 0x2;
2006
2007 /**
2008 * END_BUTTON_BEHAVIOR default value.
2009 * @hide
2010 */
2011 public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_SLEEP;
2012
2013 /**
Joe Onorato9cdffa12011-04-06 18:27:27 -07002014 * Is advanced settings mode turned on. 0 == no, 1 == yes
2015 * @hide
2016 */
2017 public static final String ADVANCED_SETTINGS = "advanced_settings";
2018
Svetoslav683914b2015-01-15 14:22:26 -08002019 private static final Validator ADVANCED_SETTINGS_VALIDATOR = sBooleanValidator;
2020
Joe Onorato9cdffa12011-04-06 18:27:27 -07002021 /**
2022 * ADVANCED_SETTINGS default value.
2023 * @hide
2024 */
2025 public static final int ADVANCED_SETTINGS_DEFAULT = 0;
2026
2027 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002028 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_ON} 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 AIRPLANE_MODE_ON = Global.AIRPLANE_MODE_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002032
2033 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002034 * @deprecated Use {@link android.provider.Settings.Global#RADIO_BLUETOOTH} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002035 */
Christopher Tate06efb532012-08-24 15:29:27 -07002036 @Deprecated
2037 public static final String RADIO_BLUETOOTH = Global.RADIO_BLUETOOTH;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002038
2039 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002040 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIFI} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002041 */
Christopher Tate06efb532012-08-24 15:29:27 -07002042 @Deprecated
2043 public static final String RADIO_WIFI = Global.RADIO_WIFI;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002044
Robert Greenwalt8588e472011-11-08 10:12:25 -08002045 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002046 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIMAX} instead
Robert Greenwalt8588e472011-11-08 10:12:25 -08002047 * {@hide}
2048 */
Christopher Tate06efb532012-08-24 15:29:27 -07002049 @Deprecated
2050 public static final String RADIO_WIMAX = Global.RADIO_WIMAX;
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#RADIO_CELL} instead
Nick Pelly8d32a012011-08-09 07:03:49 -07002054 */
Christopher Tate06efb532012-08-24 15:29:27 -07002055 @Deprecated
2056 public static final String RADIO_CELL = Global.RADIO_CELL;
Nick Pelly8d32a012011-08-09 07:03:49 -07002057
2058 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002059 * @deprecated Use {@link android.provider.Settings.Global#RADIO_NFC} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002060 */
Christopher Tate06efb532012-08-24 15:29:27 -07002061 @Deprecated
2062 public static final String RADIO_NFC = Global.RADIO_NFC;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002063
2064 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002065 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_RADIOS} instead
2066 */
2067 @Deprecated
2068 public static final String AIRPLANE_MODE_RADIOS = Global.AIRPLANE_MODE_RADIOS;
2069
2070 /**
2071 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_TOGGLEABLE_RADIOS} instead
Mike Lockwoodbd5ddf02009-07-29 21:37:14 -07002072 *
2073 * {@hide}
2074 */
Christopher Tate06efb532012-08-24 15:29:27 -07002075 @Deprecated
2076 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS =
2077 Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS;
Mike Lockwoodbd5ddf02009-07-29 21:37:14 -07002078
2079 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002080 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY} 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 String WIFI_SLEEP_POLICY = Global.WIFI_SLEEP_POLICY;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002084
2085 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002086 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_DEFAULT} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002087 */
Christopher Tate06efb532012-08-24 15:29:27 -07002088 @Deprecated
2089 public static final int WIFI_SLEEP_POLICY_DEFAULT = Global.WIFI_SLEEP_POLICY_DEFAULT;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002090
2091 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002092 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002093 */
Christopher Tate06efb532012-08-24 15:29:27 -07002094 @Deprecated
2095 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED =
2096 Global.WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002097
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002098 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002099 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002100 */
Christopher Tate06efb532012-08-24 15:29:27 -07002101 @Deprecated
2102 public static final int WIFI_SLEEP_POLICY_NEVER = Global.WIFI_SLEEP_POLICY_NEVER;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002103
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07002104 /**
2105 * @deprecated Use {@link android.provider.Settings.Global#MODE_RINGER} instead
2106 */
2107 @Deprecated
2108 public static final String MODE_RINGER = Global.MODE_RINGER;
2109
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002110 /**
2111 * Whether to use static IP and other static network attributes.
2112 * <p>
2113 * Set to 1 for true and 0 for false.
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_USE_STATIC_IP = "wifi_use_static_ip";
2119
Svetoslav683914b2015-01-15 14:22:26 -08002120 private static final Validator WIFI_USE_STATIC_IP_VALIDATOR = sBooleanValidator;
2121
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002122 /**
2123 * The static IP address.
2124 * <p>
2125 * Example: "192.168.1.51"
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_IP = "wifi_static_ip";
2131
Svetoslav683914b2015-01-15 14:22:26 -08002132 private static final Validator WIFI_STATIC_IP_VALIDATOR = sLenientIpAddressValidator;
2133
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002134 /**
2135 * If using static IP, the gateway's IP address.
2136 * <p>
2137 * Example: "192.168.1.1"
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_GATEWAY = "wifi_static_gateway";
2143
Svetoslav683914b2015-01-15 14:22:26 -08002144 private static final Validator WIFI_STATIC_GATEWAY_VALIDATOR = sLenientIpAddressValidator;
2145
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002146 /**
2147 * If using static IP, the net mask.
2148 * <p>
2149 * Example: "255.255.255.0"
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_NETMASK = "wifi_static_netmask";
2155
Svetoslav683914b2015-01-15 14:22:26 -08002156 private static final Validator WIFI_STATIC_NETMASK_VALIDATOR = sLenientIpAddressValidator;
2157
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002158 /**
2159 * If using static IP, the primary DNS's IP address.
2160 * <p>
2161 * Example: "192.168.1.1"
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_DNS1 = "wifi_static_dns1";
2167
Svetoslav683914b2015-01-15 14:22:26 -08002168 private static final Validator WIFI_STATIC_DNS1_VALIDATOR = sLenientIpAddressValidator;
2169
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002170 /**
2171 * If using static IP, the secondary DNS's IP address.
2172 * <p>
2173 * Example: "192.168.1.2"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002174 *
2175 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002176 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002177 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002178 public static final String WIFI_STATIC_DNS2 = "wifi_static_dns2";
2179
Svetoslav683914b2015-01-15 14:22:26 -08002180 private static final Validator WIFI_STATIC_DNS2_VALIDATOR = sLenientIpAddressValidator;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002181
2182 /**
2183 * Determines whether remote devices may discover and/or connect to
2184 * this device.
2185 * <P>Type: INT</P>
2186 * 2 -- discoverable and connectable
2187 * 1 -- connectable but not discoverable
2188 * 0 -- neither connectable nor discoverable
2189 */
2190 public static final String BLUETOOTH_DISCOVERABILITY =
2191 "bluetooth_discoverability";
2192
Svetoslav683914b2015-01-15 14:22:26 -08002193 private static final Validator BLUETOOTH_DISCOVERABILITY_VALIDATOR =
2194 new InclusiveIntegerRangeValidator(0, 2);
2195
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002196 /**
2197 * Bluetooth discoverability timeout. If this value is nonzero, then
2198 * Bluetooth becomes discoverable for a certain number of seconds,
2199 * after which is becomes simply connectable. The value is in seconds.
2200 */
2201 public static final String BLUETOOTH_DISCOVERABILITY_TIMEOUT =
2202 "bluetooth_discoverability_timeout";
2203
Svetoslav683914b2015-01-15 14:22:26 -08002204 private static final Validator BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR =
2205 sNonNegativeIntegerValidator;
2206
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002207 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08002208 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_ENABLED}
2209 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002210 */
Amith Yamasani156c4352010-03-05 17:10:03 -08002211 @Deprecated
2212 public static final String LOCK_PATTERN_ENABLED = Secure.LOCK_PATTERN_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002213
2214 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08002215 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_VISIBLE}
2216 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002217 */
Amith Yamasani156c4352010-03-05 17:10:03 -08002218 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002219 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
2220
2221 /**
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07002222 * @deprecated Use
Amith Yamasani156c4352010-03-05 17:10:03 -08002223 * {@link android.provider.Settings.Secure#LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED}
2224 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002225 */
Amith Yamasani156c4352010-03-05 17:10:03 -08002226 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002227 public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED =
2228 "lock_pattern_tactile_feedback_enabled";
2229
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002230 /**
2231 * A formatted string of the next alarm that is set, or the empty string
2232 * if there is no alarm set.
Adrian Roosc42a1e12014-07-07 23:35:53 +02002233 *
2234 * @deprecated Use {@link android.app.AlarmManager#getNextAlarmClock()}.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002235 */
Adrian Roosc42a1e12014-07-07 23:35:53 +02002236 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002237 public static final String NEXT_ALARM_FORMATTED = "next_alarm_formatted";
2238
Svetoslav683914b2015-01-15 14:22:26 -08002239 private static final Validator NEXT_ALARM_FORMATTED_VALIDATOR = new Validator() {
2240 private static final int MAX_LENGTH = 1000;
Svetoslav1b71ea92015-02-17 18:20:29 -08002241
Svetoslav683914b2015-01-15 14:22:26 -08002242 @Override
2243 public boolean validate(String value) {
2244 // TODO: No idea what the correct format is.
Svetoslav64d6e9c2015-02-12 11:30:36 -08002245 return value == null || value.length() < MAX_LENGTH;
Svetoslav683914b2015-01-15 14:22:26 -08002246 }
2247 };
2248
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002249 /**
2250 * Scaling factor for fonts, float.
2251 */
2252 public static final String FONT_SCALE = "font_scale";
2253
Svetoslav683914b2015-01-15 14:22:26 -08002254 private static final Validator FONT_SCALE_VALIDATOR = new Validator() {
2255 @Override
2256 public boolean validate(String value) {
2257 try {
2258 return Float.parseFloat(value) >= 0;
2259 } catch (NumberFormatException e) {
2260 return false;
2261 }
2262 }
2263 };
2264
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002265 /**
2266 * Name of an application package to be debugged.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002267 *
2268 * @deprecated Use {@link Global#DEBUG_APP} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002269 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002270 @Deprecated
2271 public static final String DEBUG_APP = Global.DEBUG_APP;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002272
2273 /**
2274 * If 1, when launching DEBUG_APP it will wait for the debugger before
2275 * starting user code. If 0, it will run normally.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002276 *
2277 * @deprecated Use {@link Global#WAIT_FOR_DEBUGGER} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002278 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002279 @Deprecated
2280 public static final String WAIT_FOR_DEBUGGER = Global.WAIT_FOR_DEBUGGER;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002281
2282 /**
2283 * Whether or not to dim the screen. 0=no 1=yes
Jeff Brown96307042012-07-27 15:51:34 -07002284 * @deprecated This setting is no longer used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002285 */
Jeff Brown96307042012-07-27 15:51:34 -07002286 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002287 public static final String DIM_SCREEN = "dim_screen";
2288
Svetoslav683914b2015-01-15 14:22:26 -08002289 private static final Validator DIM_SCREEN_VALIDATOR = sBooleanValidator;
2290
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002291 /**
Jeff Brown05af6ad2014-09-30 20:54:30 -07002292 * The amount of time in milliseconds before the device goes to sleep or begins
2293 * to dream after a period of inactivity. This value is also known as the
2294 * user activity timeout period since the screen isn't necessarily turned off
2295 * when it expires.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002296 */
2297 public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout";
2298
Svetoslav683914b2015-01-15 14:22:26 -08002299 private static final Validator SCREEN_OFF_TIMEOUT_VALIDATOR = sNonNegativeIntegerValidator;
2300
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002301 /**
2302 * The screen backlight brightness between 0 and 255.
2303 */
2304 public static final String SCREEN_BRIGHTNESS = "screen_brightness";
2305
Svetoslav683914b2015-01-15 14:22:26 -08002306 private static final Validator SCREEN_BRIGHTNESS_VALIDATOR =
2307 new InclusiveIntegerRangeValidator(0, 255);
2308
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002309 /**
Dan Murphy951764b2009-08-27 14:59:03 -05002310 * Control whether to enable automatic brightness mode.
Dan Murphy951764b2009-08-27 14:59:03 -05002311 */
2312 public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode";
2313
Svetoslav683914b2015-01-15 14:22:26 -08002314 private static final Validator SCREEN_BRIGHTNESS_MODE_VALIDATOR = sBooleanValidator;
2315
Dan Murphy951764b2009-08-27 14:59:03 -05002316 /**
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08002317 * Adjustment to auto-brightness to make it generally more (>0.0 <1.0)
2318 * or less (<0.0 >-1.0) bright.
Dianne Hackborn518a3d82012-05-09 16:30:49 -07002319 * @hide
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08002320 */
2321 public static final String SCREEN_AUTO_BRIGHTNESS_ADJ = "screen_auto_brightness_adj";
2322
Svetoslav683914b2015-01-15 14:22:26 -08002323 private static final Validator SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR =
2324 new InclusiveFloatRangeValidator(-1, 1);
2325
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08002326 /**
Mike Lockwooddc3494e2009-10-14 21:17:09 -07002327 * SCREEN_BRIGHTNESS_MODE value for manual mode.
Mike Lockwooddc3494e2009-10-14 21:17:09 -07002328 */
2329 public static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0;
2330
2331 /**
Scott Main52bfc242012-02-09 10:09:14 -08002332 * SCREEN_BRIGHTNESS_MODE value for automatic mode.
Mike Lockwooddc3494e2009-10-14 21:17:09 -07002333 */
2334 public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1;
2335
2336 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002337 * Control whether the process CPU usage meter should be shown.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002338 *
2339 * @deprecated Use {@link Global#SHOW_PROCESSES} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002340 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002341 @Deprecated
2342 public static final String SHOW_PROCESSES = Global.SHOW_PROCESSES;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002343
2344 /**
2345 * If 1, the activity manager will aggressively finish activities and
2346 * processes as soon as they are no longer needed. If 0, the normal
2347 * extended lifetime is used.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002348 *
2349 * @deprecated Use {@link Global#ALWAYS_FINISH_ACTIVITIES} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002350 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002351 @Deprecated
2352 public static final String ALWAYS_FINISH_ACTIVITIES = Global.ALWAYS_FINISH_ACTIVITIES;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002353
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002354 /**
2355 * Determines which streams are affected by ringer mode changes. The
2356 * stream type's bit should be set to 1 if it should be muted when going
2357 * into an inaudible ringer mode.
2358 */
2359 public static final String MODE_RINGER_STREAMS_AFFECTED = "mode_ringer_streams_affected";
2360
Svetoslav683914b2015-01-15 14:22:26 -08002361 private static final Validator MODE_RINGER_STREAMS_AFFECTED_VALIDATOR =
2362 sNonNegativeIntegerValidator;
2363
2364 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002365 * Determines which streams are affected by mute. The
2366 * stream type's bit should be set to 1 if it should be muted when a mute request
2367 * is received.
2368 */
Svetoslav683914b2015-01-15 14:22:26 -08002369 public static final String MUTE_STREAMS_AFFECTED = "mute_streams_affected";
2370
2371 private static final Validator MUTE_STREAMS_AFFECTED_VALIDATOR =
2372 sNonNegativeIntegerValidator;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002373
2374 /**
2375 * Whether vibrate is on for different events. This is used internally,
2376 * changing this value will not change the vibrate. See AudioManager.
2377 */
2378 public static final String VIBRATE_ON = "vibrate_on";
2379
Svetoslav683914b2015-01-15 14:22:26 -08002380 private static final Validator VIBRATE_ON_VALIDATOR = sBooleanValidator;
2381
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002382 /**
Jeff Brown7f6c2312012-04-13 20:38:38 -07002383 * If 1, redirects the system vibrator to all currently attached input devices
2384 * that support vibration. If there are no such input devices, then the system
2385 * vibrator is used instead.
2386 * If 0, does not register the system vibrator.
2387 *
2388 * This setting is mainly intended to provide a compatibility mechanism for
2389 * applications that only know about the system vibrator and do not use the
2390 * input device vibrator API.
2391 *
2392 * @hide
2393 */
2394 public static final String VIBRATE_INPUT_DEVICES = "vibrate_input_devices";
2395
Svetoslav683914b2015-01-15 14:22:26 -08002396 private static final Validator VIBRATE_INPUT_DEVICES_VALIDATOR = sBooleanValidator;
2397
Jeff Brown7f6c2312012-04-13 20:38:38 -07002398 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002399 * Ringer volume. This is used internally, changing this value will not
2400 * change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002401 *
2402 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002403 */
2404 public static final String VOLUME_RING = "volume_ring";
2405
2406 /**
2407 * System/notifications volume. This is used internally, changing this
2408 * value will not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002409 *
2410 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002411 */
2412 public static final String VOLUME_SYSTEM = "volume_system";
2413
2414 /**
2415 * Voice call volume. This is used internally, changing this value will
2416 * not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002417 *
2418 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002419 */
2420 public static final String VOLUME_VOICE = "volume_voice";
2421
2422 /**
2423 * Music/media/gaming volume. This is used internally, changing this
2424 * value will not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002425 *
2426 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002427 */
2428 public static final String VOLUME_MUSIC = "volume_music";
2429
2430 /**
2431 * Alarm volume. This is used internally, changing this
2432 * value will not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002433 *
2434 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002435 */
2436 public static final String VOLUME_ALARM = "volume_alarm";
2437
2438 /**
2439 * Notification volume. This is used internally, changing this
2440 * value will not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002441 *
2442 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002443 */
2444 public static final String VOLUME_NOTIFICATION = "volume_notification";
2445
2446 /**
Eric Laurent484d2882009-12-08 09:05:45 -08002447 * Bluetooth Headset volume. This is used internally, changing this value will
2448 * not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002449 *
2450 * @removed Not used by anything since API 2.
Eric Laurent484d2882009-12-08 09:05:45 -08002451 */
2452 public static final String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco";
2453
2454 /**
Mike Lockwood8517e462011-10-25 14:47:19 -04002455 * Master volume (float in the range 0.0f to 1.0f).
Svetoslavdbbeeb32015-02-18 19:16:25 -08002456 *
Mike Lockwood8517e462011-10-25 14:47:19 -04002457 * @hide
2458 */
2459 public static final String VOLUME_MASTER = "volume_master";
2460
2461 /**
Justin Koh57978ed2012-04-03 17:37:58 -07002462 * Master volume mute (int 1 = mute, 0 = not muted).
2463 *
2464 * @hide
2465 */
2466 public static final String VOLUME_MASTER_MUTE = "volume_master_mute";
2467
Svetoslav683914b2015-01-15 14:22:26 -08002468 private static final Validator VOLUME_MASTER_MUTE_VALIDATOR = sBooleanValidator;
2469
Justin Koh57978ed2012-04-03 17:37:58 -07002470 /**
Julia Reynoldsb53453f2014-08-22 11:42:43 -04002471 * Microphone mute (int 1 = mute, 0 = not muted).
2472 *
2473 * @hide
2474 */
2475 public static final String MICROPHONE_MUTE = "microphone_mute";
2476
Svetoslav683914b2015-01-15 14:22:26 -08002477 private static final Validator MICROPHONE_MUTE_VALIDATOR = sBooleanValidator;
2478
Julia Reynoldsb53453f2014-08-22 11:42:43 -04002479 /**
Justin Koh57978ed2012-04-03 17:37:58 -07002480 * Whether the notifications should use the ring volume (value of 1) or
2481 * a separate notification volume (value of 0). In most cases, users
2482 * will have this enabled so the notification and ringer volumes will be
2483 * the same. However, power users can disable this and use the separate
2484 * notification volume control.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002485 * <p>
Justin Koh57978ed2012-04-03 17:37:58 -07002486 * Note: This is a one-off setting that will be removed in the future
2487 * when there is profile support. For this reason, it is kept hidden
2488 * from the public APIs.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002489 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002490 * @hide
Amith Yamasani42722bf2011-07-22 10:34:27 -07002491 * @deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002492 */
Gilles Debunnee90bed12011-08-30 14:28:27 -07002493 @Deprecated
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002494 public static final String NOTIFICATIONS_USE_RING_VOLUME =
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002495 "notifications_use_ring_volume";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002496
Svetoslav683914b2015-01-15 14:22:26 -08002497 private static final Validator NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR = sBooleanValidator;
2498
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002499 /**
Daniel Sandler6329bf72010-02-26 15:17:44 -05002500 * Whether silent mode should allow vibration feedback. This is used
2501 * internally in AudioService and the Sound settings activity to
2502 * coordinate decoupling of vibrate and silent modes. This setting
2503 * will likely be removed in a future release with support for
2504 * audio/vibe feedback profiles.
2505 *
Eric Laurentbffc3d12012-05-07 17:43:49 -07002506 * Not used anymore. On devices with vibrator, the user explicitly selects
2507 * silent or vibrate mode.
2508 * Kept for use by legacy database upgrade code in DatabaseHelper.
Daniel Sandler6329bf72010-02-26 15:17:44 -05002509 * @hide
2510 */
2511 public static final String VIBRATE_IN_SILENT = "vibrate_in_silent";
2512
Svetoslav683914b2015-01-15 14:22:26 -08002513 private static final Validator VIBRATE_IN_SILENT_VALIDATOR = sBooleanValidator;
2514
Daniel Sandler6329bf72010-02-26 15:17:44 -05002515 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002516 * The mapping of stream type (integer) to its setting.
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[] VOLUME_SETTINGS = {
2521 VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC,
Eric Laurent484d2882009-12-08 09:05:45 -08002522 VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002523 };
2524
2525 /**
2526 * Appended to various volume related settings to record the previous
2527 * values before they the settings were affected by a silent/vibrate
2528 * ringer mode change.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002529 *
2530 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002531 */
2532 public static final String APPEND_FOR_LAST_AUDIBLE = "_last_audible";
2533
2534 /**
2535 * Persistent store for the system-wide default ringtone URI.
2536 * <p>
2537 * If you need to play the default ringtone at any given time, it is recommended
2538 * you give {@link #DEFAULT_RINGTONE_URI} to the media player. It will resolve
2539 * to the set default ringtone at the time of playing.
2540 *
2541 * @see #DEFAULT_RINGTONE_URI
2542 */
2543 public static final String RINGTONE = "ringtone";
2544
Svetoslav683914b2015-01-15 14:22:26 -08002545 private static final Validator RINGTONE_VALIDATOR = sUriValidator;
2546
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002547 /**
2548 * A {@link Uri} that will point to the current default ringtone at any
2549 * given time.
2550 * <p>
2551 * If the current default ringtone is in the DRM provider and the caller
2552 * does not have permission, the exception will be a
2553 * FileNotFoundException.
2554 */
2555 public static final Uri DEFAULT_RINGTONE_URI = getUriFor(RINGTONE);
2556
2557 /**
2558 * Persistent store for the system-wide default notification sound.
2559 *
2560 * @see #RINGTONE
2561 * @see #DEFAULT_NOTIFICATION_URI
2562 */
2563 public static final String NOTIFICATION_SOUND = "notification_sound";
2564
Svetoslav683914b2015-01-15 14:22:26 -08002565 private static final Validator NOTIFICATION_SOUND_VALIDATOR = sUriValidator;
2566
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002567 /**
2568 * A {@link Uri} that will point to the current default notification
2569 * sound at any given time.
2570 *
2571 * @see #DEFAULT_RINGTONE_URI
2572 */
2573 public static final Uri DEFAULT_NOTIFICATION_URI = getUriFor(NOTIFICATION_SOUND);
2574
2575 /**
Patrick Scott3156bb002009-04-13 09:57:38 -07002576 * Persistent store for the system-wide default alarm alert.
2577 *
2578 * @see #RINGTONE
2579 * @see #DEFAULT_ALARM_ALERT_URI
2580 */
2581 public static final String ALARM_ALERT = "alarm_alert";
2582
Svetoslav683914b2015-01-15 14:22:26 -08002583 private static final Validator ALARM_ALERT_VALIDATOR = sUriValidator;
2584
Patrick Scott3156bb002009-04-13 09:57:38 -07002585 /**
2586 * A {@link Uri} that will point to the current default alarm alert at
2587 * any given time.
2588 *
2589 * @see #DEFAULT_ALARM_ALERT_URI
2590 */
2591 public static final Uri DEFAULT_ALARM_ALERT_URI = getUriFor(ALARM_ALERT);
2592
2593 /**
Jean-Michel Trivid589fea2011-04-15 11:28:10 -07002594 * Persistent store for the system default media button event receiver.
2595 *
2596 * @hide
2597 */
2598 public static final String MEDIA_BUTTON_RECEIVER = "media_button_receiver";
2599
Svetoslav683914b2015-01-15 14:22:26 -08002600 private static final Validator MEDIA_BUTTON_RECEIVER_VALIDATOR = new Validator() {
2601 @Override
2602 public boolean validate(String value) {
2603 try {
2604 ComponentName.unflattenFromString(value);
2605 return true;
2606 } catch (NullPointerException e) {
2607 return false;
2608 }
2609 }
2610 };
2611
Jean-Michel Trivid589fea2011-04-15 11:28:10 -07002612 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002613 * Setting to enable Auto Replace (AutoText) in text editors. 1 = On, 0 = Off
2614 */
2615 public static final String TEXT_AUTO_REPLACE = "auto_replace";
2616
Svetoslav683914b2015-01-15 14:22:26 -08002617 private static final Validator TEXT_AUTO_REPLACE_VALIDATOR = sBooleanValidator;
2618
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002619 /**
2620 * Setting to enable Auto Caps in text editors. 1 = On, 0 = Off
2621 */
2622 public static final String TEXT_AUTO_CAPS = "auto_caps";
2623
Svetoslav683914b2015-01-15 14:22:26 -08002624 private static final Validator TEXT_AUTO_CAPS_VALIDATOR = sBooleanValidator;
2625
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002626 /**
2627 * Setting to enable Auto Punctuate in text editors. 1 = On, 0 = Off. This
2628 * feature converts two spaces to a "." and space.
2629 */
2630 public static final String TEXT_AUTO_PUNCTUATE = "auto_punctuate";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002631
Svetoslav683914b2015-01-15 14:22:26 -08002632 private static final Validator TEXT_AUTO_PUNCTUATE_VALIDATOR = sBooleanValidator;
2633
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002634 /**
2635 * Setting to showing password characters in text editors. 1 = On, 0 = Off
2636 */
2637 public static final String TEXT_SHOW_PASSWORD = "show_password";
2638
Svetoslav683914b2015-01-15 14:22:26 -08002639 private static final Validator TEXT_SHOW_PASSWORD_VALIDATOR = sBooleanValidator;
2640
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002641 public static final String SHOW_GTALK_SERVICE_STATUS =
2642 "SHOW_GTALK_SERVICE_STATUS";
2643
Svetoslav683914b2015-01-15 14:22:26 -08002644 private static final Validator SHOW_GTALK_SERVICE_STATUS_VALIDATOR = sBooleanValidator;
2645
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002646 /**
2647 * Name of activity to use for wallpaper on the home screen.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002648 *
2649 * @deprecated Use {@link WallpaperManager} instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002650 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002651 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002652 public static final String WALLPAPER_ACTIVITY = "wallpaper_activity";
2653
Svetoslav683914b2015-01-15 14:22:26 -08002654 private static final Validator WALLPAPER_ACTIVITY_VALIDATOR = new Validator() {
2655 private static final int MAX_LENGTH = 1000;
2656
2657 @Override
2658 public boolean validate(String value) {
2659 if (value != null && value.length() > MAX_LENGTH) {
2660 return false;
2661 }
2662 return ComponentName.unflattenFromString(value) != null;
2663 }
2664 };
2665
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002666 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002667 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME}
2668 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002669 */
Christopher Tate06efb532012-08-24 15:29:27 -07002670 @Deprecated
2671 public static final String AUTO_TIME = Global.AUTO_TIME;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002672
2673 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002674 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME_ZONE}
2675 * instead
Amith Yamasaniad450be2010-09-16 16:47:00 -07002676 */
Christopher Tate06efb532012-08-24 15:29:27 -07002677 @Deprecated
2678 public static final String AUTO_TIME_ZONE = Global.AUTO_TIME_ZONE;
Amith Yamasaniad450be2010-09-16 16:47:00 -07002679
2680 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002681 * Display times as 12 or 24 hours
2682 * 12
2683 * 24
2684 */
2685 public static final String TIME_12_24 = "time_12_24";
2686
Svetoslav683914b2015-01-15 14:22:26 -08002687 /** @hide */
2688 public static final Validator TIME_12_24_VALIDATOR =
2689 new DiscreteValueValidator(new String[] {"12", "24"});
2690
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002691 /**
2692 * Date format string
2693 * mm/dd/yyyy
2694 * dd/mm/yyyy
2695 * yyyy/mm/dd
2696 */
2697 public static final String DATE_FORMAT = "date_format";
2698
Svetoslav683914b2015-01-15 14:22:26 -08002699 /** @hide */
2700 public static final Validator DATE_FORMAT_VALIDATOR = new Validator() {
2701 @Override
2702 public boolean validate(String value) {
2703 try {
2704 new SimpleDateFormat(value);
2705 return true;
2706 } catch (IllegalArgumentException e) {
2707 return false;
2708 }
2709 }
2710 };
2711
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002712 /**
2713 * Whether the setup wizard has been run before (on first boot), or if
2714 * it still needs to be run.
2715 *
2716 * nonzero = it has been run in the past
2717 * 0 = it has not been run in the past
2718 */
2719 public static final String SETUP_WIZARD_HAS_RUN = "setup_wizard_has_run";
2720
Svetoslav683914b2015-01-15 14:22:26 -08002721 /** @hide */
2722 public static final Validator SETUP_WIZARD_HAS_RUN_VALIDATOR = sBooleanValidator;
2723
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002724 /**
2725 * Scaling factor for normal window animations. Setting to 0 will disable window
2726 * animations.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002727 *
2728 * @deprecated Use {@link Global#WINDOW_ANIMATION_SCALE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002729 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002730 @Deprecated
2731 public static final String WINDOW_ANIMATION_SCALE = Global.WINDOW_ANIMATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002732
2733 /**
2734 * Scaling factor for activity transition animations. Setting to 0 will disable window
2735 * animations.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002736 *
2737 * @deprecated Use {@link Global#TRANSITION_ANIMATION_SCALE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002738 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002739 @Deprecated
2740 public static final String TRANSITION_ANIMATION_SCALE = Global.TRANSITION_ANIMATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002741
2742 /**
Chet Haasec38fa1f2012-02-01 16:37:46 -08002743 * Scaling factor for Animator-based animations. This affects both the start delay and
2744 * duration of all such animations. Setting to 0 will cause animations to end immediately.
2745 * The default value is 1.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002746 *
2747 * @deprecated Use {@link Global#ANIMATOR_DURATION_SCALE} instead
Chet Haasec38fa1f2012-02-01 16:37:46 -08002748 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002749 @Deprecated
2750 public static final String ANIMATOR_DURATION_SCALE = Global.ANIMATOR_DURATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002751
2752 /**
2753 * Control whether the accelerometer will be used to change screen
2754 * orientation. If 0, it will not be used unless explicitly requested
2755 * by the application; if 1, it will be used by default unless explicitly
2756 * disabled by the application.
2757 */
2758 public static final String ACCELEROMETER_ROTATION = "accelerometer_rotation";
2759
Svetoslav683914b2015-01-15 14:22:26 -08002760 /** @hide */
2761 public static final Validator ACCELEROMETER_ROTATION_VALIDATOR = sBooleanValidator;
2762
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002763 /**
Daniel Sandlerb73617d2010-08-17 00:41:00 -04002764 * Default screen rotation when no other policy applies.
2765 * When {@link #ACCELEROMETER_ROTATION} is zero and no on-screen Activity expresses a
2766 * preference, this rotation value will be used. Must be one of the
Brian Muramatsue1d46982010-12-06 17:34:20 -08002767 * {@link android.view.Surface#ROTATION_0 Surface rotation constants}.
Daniel Sandlerb73617d2010-08-17 00:41:00 -04002768 *
Dianne Hackborn16ec0802014-08-15 18:32:33 -07002769 * @see android.view.Display#getRotation
Daniel Sandlerb73617d2010-08-17 00:41:00 -04002770 */
2771 public static final String USER_ROTATION = "user_rotation";
2772
Svetoslav683914b2015-01-15 14:22:26 -08002773 /** @hide */
2774 public static final Validator USER_ROTATION_VALIDATOR =
2775 new InclusiveIntegerRangeValidator(0, 3);
2776
Daniel Sandlerb73617d2010-08-17 00:41:00 -04002777 /**
Jeff Brown207673cd2012-06-05 17:47:11 -07002778 * Control whether the rotation lock toggle in the System UI should be hidden.
2779 * Typically this is done for accessibility purposes to make it harder for
2780 * the user to accidentally toggle the rotation lock while the display rotation
2781 * has been locked for accessibility.
2782 *
2783 * If 0, then rotation lock toggle is not hidden for accessibility (although it may be
2784 * unavailable for other reasons). If 1, then the rotation lock toggle is hidden.
2785 *
2786 * @hide
2787 */
2788 public static final String HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY =
2789 "hide_rotation_lock_toggle_for_accessibility";
2790
Svetoslav683914b2015-01-15 14:22:26 -08002791 /** @hide */
2792 public static final Validator HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR =
2793 sBooleanValidator;
2794
Jeff Brown207673cd2012-06-05 17:47:11 -07002795 /**
Daisuke Miyakawa3c60eeb2012-05-08 12:08:25 -07002796 * Whether the phone vibrates when it is ringing due to an incoming call. This will
2797 * be used by Phone and Setting apps; it shouldn't affect other apps.
2798 * The value is boolean (1 or 0).
2799 *
2800 * Note: this is not same as "vibrate on ring", which had been available until ICS.
2801 * It was about AudioManager's setting and thus affected all the applications which
2802 * relied on the setting, while this is purely about the vibration setting for incoming
2803 * calls.
Daisuke Miyakawa3c60eeb2012-05-08 12:08:25 -07002804 */
2805 public static final String VIBRATE_WHEN_RINGING = "vibrate_when_ringing";
2806
Svetoslav683914b2015-01-15 14:22:26 -08002807 /** @hide */
2808 public static final Validator VIBRATE_WHEN_RINGING_VALIDATOR = sBooleanValidator;
2809
Daisuke Miyakawa3c60eeb2012-05-08 12:08:25 -07002810 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002811 * Whether the audible DTMF tones are played by the dialer when dialing. The value is
2812 * boolean (1 or 0).
2813 */
2814 public static final String DTMF_TONE_WHEN_DIALING = "dtmf_tone";
2815
Svetoslav683914b2015-01-15 14:22:26 -08002816 /** @hide */
2817 public static final Validator DTMF_TONE_WHEN_DIALING_VALIDATOR = sBooleanValidator;
2818
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002819 /**
David Kraused0f67152009-06-13 18:01:13 -05002820 * CDMA only settings
2821 * DTMF tone type played by the dialer when dialing.
2822 * 0 = Normal
2823 * 1 = Long
David Kraused0f67152009-06-13 18:01:13 -05002824 */
2825 public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type";
2826
Svetoslav683914b2015-01-15 14:22:26 -08002827 /** @hide */
2828 public static final Validator DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR = sBooleanValidator;
2829
David Kraused0f67152009-06-13 18:01:13 -05002830 /**
David Kraused0f67152009-06-13 18:01:13 -05002831 * Whether the hearing aid is enabled. The value is
2832 * boolean (1 or 0).
2833 * @hide
2834 */
2835 public static final String HEARING_AID = "hearing_aid";
2836
Svetoslav683914b2015-01-15 14:22:26 -08002837 /** @hide */
2838 public static final Validator HEARING_AID_VALIDATOR = sBooleanValidator;
2839
David Kraused0f67152009-06-13 18:01:13 -05002840 /**
2841 * CDMA only settings
2842 * TTY Mode
2843 * 0 = OFF
2844 * 1 = FULL
2845 * 2 = VCO
2846 * 3 = HCO
2847 * @hide
2848 */
2849 public static final String TTY_MODE = "tty_mode";
2850
Svetoslav683914b2015-01-15 14:22:26 -08002851 /** @hide */
2852 public static final Validator TTY_MODE_VALIDATOR = new InclusiveIntegerRangeValidator(0, 3);
2853
David Kraused0f67152009-06-13 18:01:13 -05002854 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002855 * Whether the sounds effects (key clicks, lid open ...) are enabled. The value is
2856 * boolean (1 or 0).
2857 */
2858 public static final String SOUND_EFFECTS_ENABLED = "sound_effects_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002859
Svetoslav683914b2015-01-15 14:22:26 -08002860 /** @hide */
2861 public static final Validator SOUND_EFFECTS_ENABLED_VALIDATOR = sBooleanValidator;
2862
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002863 /**
2864 * Whether the haptic feedback (long presses, ...) are enabled. The value is
2865 * boolean (1 or 0).
2866 */
2867 public static final String HAPTIC_FEEDBACK_ENABLED = "haptic_feedback_enabled";
Sanjay Jeyakumar21bf2412009-07-09 13:31:48 -07002868
Svetoslav683914b2015-01-15 14:22:26 -08002869 /** @hide */
2870 public static final Validator HAPTIC_FEEDBACK_ENABLED_VALIDATOR = sBooleanValidator;
2871
Mike LeBeau48603e72009-06-05 00:27:00 +01002872 /**
Bjorn Bringert24abb662010-09-21 12:21:18 +01002873 * @deprecated Each application that shows web suggestions should have its own
2874 * setting for this.
Mike LeBeau48603e72009-06-05 00:27:00 +01002875 */
Bjorn Bringert24abb662010-09-21 12:21:18 +01002876 @Deprecated
Mike LeBeau48603e72009-06-05 00:27:00 +01002877 public static final String SHOW_WEB_SUGGESTIONS = "show_web_suggestions";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002878
Svetoslav683914b2015-01-15 14:22:26 -08002879 /** @hide */
2880 public static final Validator SHOW_WEB_SUGGESTIONS_VALIDATOR = sBooleanValidator;
2881
-b master501eec92009-07-06 13:53:11 -07002882 /**
Amith Yamasaniae3ed702009-12-01 19:02:05 -08002883 * Whether the notification LED should repeatedly flash when a notification is
2884 * pending. The value is boolean (1 or 0).
2885 * @hide
2886 */
2887 public static final String NOTIFICATION_LIGHT_PULSE = "notification_light_pulse";
2888
Svetoslav683914b2015-01-15 14:22:26 -08002889 /** @hide */
2890 public static final Validator NOTIFICATION_LIGHT_PULSE_VALIDATOR = sBooleanValidator;
2891
Amith Yamasaniae3ed702009-12-01 19:02:05 -08002892 /**
Dianne Hackborn90d2db32010-02-11 22:19:06 -08002893 * Show pointer location on screen?
2894 * 0 = no
2895 * 1 = yes
2896 * @hide
2897 */
2898 public static final String POINTER_LOCATION = "pointer_location";
2899
Svetoslav683914b2015-01-15 14:22:26 -08002900 /** @hide */
2901 public static final Validator POINTER_LOCATION_VALIDATOR = sBooleanValidator;
2902
Dianne Hackborn90d2db32010-02-11 22:19:06 -08002903 /**
Jeff Browndaf4a122011-08-26 17:14:14 -07002904 * Show touch positions on screen?
2905 * 0 = no
2906 * 1 = yes
2907 * @hide
2908 */
2909 public static final String SHOW_TOUCHES = "show_touches";
2910
Svetoslav683914b2015-01-15 14:22:26 -08002911 /** @hide */
2912 public static final Validator SHOW_TOUCHES_VALIDATOR = sBooleanValidator;
2913
Jeff Browndaf4a122011-08-26 17:14:14 -07002914 /**
Dianne Hackborn16ec0802014-08-15 18:32:33 -07002915 * Log raw orientation data from
Jorim Jaggib10e33f2015-02-04 21:57:40 +01002916 * {@link com.android.server.policy.WindowOrientationListener} for use with the
Jeff Brown4519f072011-01-23 13:16:01 -08002917 * orientationplot.py tool.
2918 * 0 = no
2919 * 1 = yes
2920 * @hide
2921 */
2922 public static final String WINDOW_ORIENTATION_LISTENER_LOG =
2923 "window_orientation_listener_log";
2924
Svetoslav683914b2015-01-15 14:22:26 -08002925 /** @hide */
2926 public static final Validator WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR = sBooleanValidator;
2927
Jeff Brown4519f072011-01-23 13:16:01 -08002928 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002929 * @deprecated Use {@link android.provider.Settings.Global#POWER_SOUNDS_ENABLED}
2930 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002931 * @hide
2932 */
Christopher Tate06efb532012-08-24 15:29:27 -07002933 @Deprecated
2934 public static final String POWER_SOUNDS_ENABLED = Global.POWER_SOUNDS_ENABLED;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002935
2936 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002937 * @deprecated Use {@link android.provider.Settings.Global#DOCK_SOUNDS_ENABLED}
2938 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002939 * @hide
2940 */
Christopher Tate06efb532012-08-24 15:29:27 -07002941 @Deprecated
2942 public static final String DOCK_SOUNDS_ENABLED = Global.DOCK_SOUNDS_ENABLED;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002943
2944 /**
2945 * Whether to play sounds when the keyguard is shown and dismissed.
2946 * @hide
2947 */
2948 public static final String LOCKSCREEN_SOUNDS_ENABLED = "lockscreen_sounds_enabled";
2949
Svetoslav683914b2015-01-15 14:22:26 -08002950 /** @hide */
2951 public static final Validator LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR = sBooleanValidator;
2952
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002953 /**
Mike Lockwood7bef7392011-10-20 16:51:53 -04002954 * Whether the lockscreen should be completely disabled.
2955 * @hide
2956 */
2957 public static final String LOCKSCREEN_DISABLED = "lockscreen.disabled";
2958
Svetoslav683914b2015-01-15 14:22:26 -08002959 /** @hide */
2960 public static final Validator LOCKSCREEN_DISABLED_VALIDATOR = sBooleanValidator;
2961
Mike Lockwood7bef7392011-10-20 16:51:53 -04002962 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002963 * @deprecated Use {@link android.provider.Settings.Global#LOW_BATTERY_SOUND}
2964 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002965 * @hide
2966 */
Christopher Tate06efb532012-08-24 15:29:27 -07002967 @Deprecated
2968 public static final String LOW_BATTERY_SOUND = Global.LOW_BATTERY_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002969
2970 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002971 * @deprecated Use {@link android.provider.Settings.Global#DESK_DOCK_SOUND}
2972 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002973 * @hide
2974 */
Christopher Tate06efb532012-08-24 15:29:27 -07002975 @Deprecated
2976 public static final String DESK_DOCK_SOUND = Global.DESK_DOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002977
2978 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002979 * @deprecated Use {@link android.provider.Settings.Global#DESK_UNDOCK_SOUND}
2980 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002981 * @hide
2982 */
Christopher Tate06efb532012-08-24 15:29:27 -07002983 @Deprecated
2984 public static final String DESK_UNDOCK_SOUND = Global.DESK_UNDOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002985
2986 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002987 * @deprecated Use {@link android.provider.Settings.Global#CAR_DOCK_SOUND}
2988 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002989 * @hide
2990 */
Christopher Tate06efb532012-08-24 15:29:27 -07002991 @Deprecated
2992 public static final String CAR_DOCK_SOUND = Global.CAR_DOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002993
2994 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002995 * @deprecated Use {@link android.provider.Settings.Global#CAR_UNDOCK_SOUND}
2996 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002997 * @hide
2998 */
Christopher Tate06efb532012-08-24 15:29:27 -07002999 @Deprecated
3000 public static final String CAR_UNDOCK_SOUND = Global.CAR_UNDOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003001
3002 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003003 * @deprecated Use {@link android.provider.Settings.Global#LOCK_SOUND}
3004 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003005 * @hide
3006 */
Christopher Tate06efb532012-08-24 15:29:27 -07003007 @Deprecated
3008 public static final String LOCK_SOUND = Global.LOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003009
3010 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003011 * @deprecated Use {@link android.provider.Settings.Global#UNLOCK_SOUND}
3012 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003013 * @hide
3014 */
Christopher Tate06efb532012-08-24 15:29:27 -07003015 @Deprecated
3016 public static final String UNLOCK_SOUND = Global.UNLOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003017
3018 /**
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003019 * Receive incoming SIP calls?
3020 * 0 = no
3021 * 1 = yes
3022 * @hide
3023 */
3024 public static final String SIP_RECEIVE_CALLS = "sip_receive_calls";
3025
Svetoslav683914b2015-01-15 14:22:26 -08003026 /** @hide */
3027 public static final Validator SIP_RECEIVE_CALLS_VALIDATOR = sBooleanValidator;
3028
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003029 /**
3030 * Call Preference String.
3031 * "SIP_ALWAYS" : Always use SIP with network access
3032 * "SIP_ADDRESS_ONLY" : Only if destination is a SIP address
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003033 * @hide
3034 */
3035 public static final String SIP_CALL_OPTIONS = "sip_call_options";
3036
Svetoslav683914b2015-01-15 14:22:26 -08003037 /** @hide */
3038 public static final Validator SIP_CALL_OPTIONS_VALIDATOR = new DiscreteValueValidator(
3039 new String[] {"SIP_ALWAYS", "SIP_ADDRESS_ONLY"});
3040
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003041 /**
3042 * One of the sip call options: Always use SIP with network access.
3043 * @hide
3044 */
3045 public static final String SIP_ALWAYS = "SIP_ALWAYS";
3046
Svetoslav683914b2015-01-15 14:22:26 -08003047 /** @hide */
3048 public static final Validator SIP_ALWAYS_VALIDATOR = sBooleanValidator;
3049
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003050 /**
3051 * One of the sip call options: Only if destination is a SIP address.
3052 * @hide
3053 */
3054 public static final String SIP_ADDRESS_ONLY = "SIP_ADDRESS_ONLY";
3055
Svetoslav683914b2015-01-15 14:22:26 -08003056 /** @hide */
3057 public static final Validator SIP_ADDRESS_ONLY_VALIDATOR = sBooleanValidator;
3058
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003059 /**
Tyler Gunn2c830a22014-09-02 08:39:35 -07003060 * @deprecated Use SIP_ALWAYS or SIP_ADDRESS_ONLY instead. Formerly used to indicate that
3061 * the user should be prompted each time a call is made whether it should be placed using
3062 * SIP. The {@link com.android.providers.settings.DatabaseHelper} replaces this with
3063 * SIP_ADDRESS_ONLY.
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003064 * @hide
3065 */
Tyler Gunn2c830a22014-09-02 08:39:35 -07003066 @Deprecated
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003067 public static final String SIP_ASK_ME_EACH_TIME = "SIP_ASK_ME_EACH_TIME";
3068
Svetoslav683914b2015-01-15 14:22:26 -08003069 /** @hide */
3070 public static final Validator SIP_ASK_ME_EACH_TIME_VALIDATOR = sBooleanValidator;
3071
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003072 /**
Jeff Brown1a84fd12011-06-02 01:26:32 -07003073 * Pointer speed setting.
3074 * This is an integer value in a range between -7 and +7, so there are 15 possible values.
3075 * -7 = slowest
3076 * 0 = default speed
3077 * +7 = fastest
3078 * @hide
3079 */
3080 public static final String POINTER_SPEED = "pointer_speed";
3081
Svetoslav683914b2015-01-15 14:22:26 -08003082 /** @hide */
3083 public static final Validator POINTER_SPEED_VALIDATOR =
3084 new InclusiveFloatRangeValidator(-7, 7);
3085
Jeff Brown1a84fd12011-06-02 01:26:32 -07003086 /**
Jason Monk56e09b42014-07-18 10:29:14 -04003087 * Whether lock-to-app will be triggered by long-press on recents.
3088 * @hide
3089 */
3090 public static final String LOCK_TO_APP_ENABLED = "lock_to_app_enabled";
3091
Svetoslav683914b2015-01-15 14:22:26 -08003092 /** @hide */
3093 public static final Validator LOCK_TO_APP_ENABLED_VALIDATOR = sBooleanValidator;
3094
Jason Monk56e09b42014-07-18 10:29:14 -04003095 /**
Daniel Sandler2fdb68b2013-10-03 00:12:11 -04003096 * I am the lolrus.
3097 * <p>
3098 * Nonzero values indicate that the user has a bukkit.
3099 * Backward-compatible with <code>PrefGetPreference(prefAllowEasterEggs)</code>.
3100 * @hide
3101 */
3102 public static final String EGG_MODE = "egg_mode";
3103
Svetoslav683914b2015-01-15 14:22:26 -08003104 /** @hide */
Svet Ganovb1918a02015-05-15 09:32:55 -07003105 public static final Validator EGG_MODE_VALIDATOR = new Validator() {
3106 @Override
3107 public boolean validate(String value) {
3108 try {
3109 return Long.parseLong(value) >= 0;
3110 } catch (NumberFormatException e) {
3111 return false;
3112 }
3113 }
3114 };
Svetoslav683914b2015-01-15 14:22:26 -08003115
3116 /**
3117 * IMPORTANT: If you add a new public settings you also have to add it to
3118 * PUBLIC_SETTINGS below. If the new setting is hidden you have to add
3119 * it to PRIVATE_SETTINGS below. Also add a validator that can validate
3120 * the setting value. See an example above.
3121 */
3122
Daniel Sandler2fdb68b2013-10-03 00:12:11 -04003123 /**
-b master501eec92009-07-06 13:53:11 -07003124 * Settings to backup. This is here so that it's in the same place as the settings
3125 * keys and easy to update.
Svetoslav Ganova571a582011-09-20 18:32:20 -07003126 *
3127 * NOTE: Settings are backed up and restored in the order they appear
3128 * in this array. If you have one setting depending on another,
3129 * make sure that they are ordered appropriately.
3130 *
-b master501eec92009-07-06 13:53:11 -07003131 * @hide
3132 */
3133 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate66488d62012-10-02 11:58:01 -07003134 STAY_ON_WHILE_PLUGGED_IN, // moved to global
-b master501eec92009-07-06 13:53:11 -07003135 WIFI_USE_STATIC_IP,
3136 WIFI_STATIC_IP,
3137 WIFI_STATIC_GATEWAY,
3138 WIFI_STATIC_NETMASK,
3139 WIFI_STATIC_DNS1,
3140 WIFI_STATIC_DNS2,
3141 BLUETOOTH_DISCOVERABILITY,
3142 BLUETOOTH_DISCOVERABILITY_TIMEOUT,
3143 DIM_SCREEN,
3144 SCREEN_OFF_TIMEOUT,
3145 SCREEN_BRIGHTNESS,
Christopher Tate362aca62009-09-25 15:58:03 -07003146 SCREEN_BRIGHTNESS_MODE,
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08003147 SCREEN_AUTO_BRIGHTNESS_ADJ,
Jeff Brown7f6c2312012-04-13 20:38:38 -07003148 VIBRATE_INPUT_DEVICES,
Amith Yamasani8823c0a82009-07-07 14:30:17 -07003149 MODE_RINGER_STREAMS_AFFECTED,
-b master501eec92009-07-06 13:53:11 -07003150 TEXT_AUTO_REPLACE,
3151 TEXT_AUTO_CAPS,
3152 TEXT_AUTO_PUNCTUATE,
3153 TEXT_SHOW_PASSWORD,
Christopher Tate66488d62012-10-02 11:58:01 -07003154 AUTO_TIME, // moved to global
3155 AUTO_TIME_ZONE, // moved to global
-b master501eec92009-07-06 13:53:11 -07003156 TIME_12_24,
3157 DATE_FORMAT,
-b master501eec92009-07-06 13:53:11 -07003158 DTMF_TONE_WHEN_DIALING,
3159 DTMF_TONE_TYPE_WHEN_DIALING,
-b master501eec92009-07-06 13:53:11 -07003160 HEARING_AID,
3161 TTY_MODE,
3162 SOUND_EFFECTS_ENABLED,
3163 HAPTIC_FEEDBACK_ENABLED,
Christopher Tate66488d62012-10-02 11:58:01 -07003164 POWER_SOUNDS_ENABLED, // moved to global
3165 DOCK_SOUNDS_ENABLED, // moved to global
Christopher Tate14c2d792010-02-25 16:49:44 -08003166 LOCKSCREEN_SOUNDS_ENABLED,
Amith Yamasaniae3ed702009-12-01 19:02:05 -08003167 SHOW_WEB_SUGGESTIONS,
Mike Lockwoodeabe8bf2010-08-31 14:35:23 -04003168 NOTIFICATION_LIGHT_PULSE,
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003169 SIP_CALL_OPTIONS,
Nick Pelly038cabe2010-09-23 16:12:11 -07003170 SIP_RECEIVE_CALLS,
Jeff Brown1a84fd12011-06-02 01:26:32 -07003171 POINTER_SPEED,
Amith Yamasani622bf2222013-09-06 13:54:28 -07003172 VIBRATE_WHEN_RINGING,
3173 RINGTONE,
Jason Monk94cfd9d2014-10-31 13:18:21 -04003174 LOCK_TO_APP_ENABLED,
Amith Yamasani622bf2222013-09-06 13:54:28 -07003175 NOTIFICATION_SOUND
-b master501eec92009-07-06 13:53:11 -07003176 };
3177
Sailesh Nepal1bd78762014-02-11 22:32:21 -08003178 /**
Amith Yamasanib0ff3222015-03-04 09:56:14 -08003179 * These are all public system settings
Svetoslav683914b2015-01-15 14:22:26 -08003180 *
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07003181 * @hide
3182 */
Svetoslav683914b2015-01-15 14:22:26 -08003183 public static final Set<String> PUBLIC_SETTINGS = new ArraySet<>();
3184 static {
3185 PUBLIC_SETTINGS.add(END_BUTTON_BEHAVIOR);
3186 PUBLIC_SETTINGS.add(WIFI_USE_STATIC_IP);
3187 PUBLIC_SETTINGS.add(WIFI_STATIC_IP);
3188 PUBLIC_SETTINGS.add(WIFI_STATIC_GATEWAY);
3189 PUBLIC_SETTINGS.add(WIFI_STATIC_NETMASK);
3190 PUBLIC_SETTINGS.add(WIFI_STATIC_DNS1);
3191 PUBLIC_SETTINGS.add(WIFI_STATIC_DNS2);
3192 PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY);
3193 PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY_TIMEOUT);
3194 PUBLIC_SETTINGS.add(NEXT_ALARM_FORMATTED);
3195 PUBLIC_SETTINGS.add(FONT_SCALE);
3196 PUBLIC_SETTINGS.add(DIM_SCREEN);
3197 PUBLIC_SETTINGS.add(SCREEN_OFF_TIMEOUT);
3198 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS);
3199 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_MODE);
3200 PUBLIC_SETTINGS.add(MODE_RINGER_STREAMS_AFFECTED);
3201 PUBLIC_SETTINGS.add(MUTE_STREAMS_AFFECTED);
3202 PUBLIC_SETTINGS.add(VIBRATE_ON);
3203 PUBLIC_SETTINGS.add(VOLUME_RING);
3204 PUBLIC_SETTINGS.add(VOLUME_SYSTEM);
3205 PUBLIC_SETTINGS.add(VOLUME_VOICE);
3206 PUBLIC_SETTINGS.add(VOLUME_MUSIC);
3207 PUBLIC_SETTINGS.add(VOLUME_ALARM);
3208 PUBLIC_SETTINGS.add(VOLUME_NOTIFICATION);
3209 PUBLIC_SETTINGS.add(VOLUME_BLUETOOTH_SCO);
3210 PUBLIC_SETTINGS.add(RINGTONE);
3211 PUBLIC_SETTINGS.add(NOTIFICATION_SOUND);
3212 PUBLIC_SETTINGS.add(ALARM_ALERT);
3213 PUBLIC_SETTINGS.add(TEXT_AUTO_REPLACE);
3214 PUBLIC_SETTINGS.add(TEXT_AUTO_CAPS);
3215 PUBLIC_SETTINGS.add(TEXT_AUTO_PUNCTUATE);
3216 PUBLIC_SETTINGS.add(TEXT_SHOW_PASSWORD);
3217 PUBLIC_SETTINGS.add(SHOW_GTALK_SERVICE_STATUS);
3218 PUBLIC_SETTINGS.add(WALLPAPER_ACTIVITY);
3219 PUBLIC_SETTINGS.add(TIME_12_24);
3220 PUBLIC_SETTINGS.add(DATE_FORMAT);
3221 PUBLIC_SETTINGS.add(SETUP_WIZARD_HAS_RUN);
3222 PUBLIC_SETTINGS.add(ACCELEROMETER_ROTATION);
3223 PUBLIC_SETTINGS.add(USER_ROTATION);
3224 PUBLIC_SETTINGS.add(DTMF_TONE_WHEN_DIALING);
3225 PUBLIC_SETTINGS.add(SOUND_EFFECTS_ENABLED);
3226 PUBLIC_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED);
3227 PUBLIC_SETTINGS.add(SHOW_WEB_SUGGESTIONS);
3228 }
3229
3230 /**
3231 * These are all hidden system settings.
3232 *
3233 * @hide
3234 */
3235 public static final Set<String> PRIVATE_SETTINGS = new ArraySet<>();
3236 static {
3237 PRIVATE_SETTINGS.add(WIFI_USE_STATIC_IP);
3238 PRIVATE_SETTINGS.add(END_BUTTON_BEHAVIOR);
3239 PRIVATE_SETTINGS.add(ADVANCED_SETTINGS);
3240 PRIVATE_SETTINGS.add(SCREEN_AUTO_BRIGHTNESS_ADJ);
3241 PRIVATE_SETTINGS.add(VIBRATE_INPUT_DEVICES);
3242 PRIVATE_SETTINGS.add(VOLUME_MASTER);
3243 PRIVATE_SETTINGS.add(VOLUME_MASTER_MUTE);
3244 PRIVATE_SETTINGS.add(MICROPHONE_MUTE);
3245 PRIVATE_SETTINGS.add(NOTIFICATIONS_USE_RING_VOLUME);
3246 PRIVATE_SETTINGS.add(VIBRATE_IN_SILENT);
3247 PRIVATE_SETTINGS.add(MEDIA_BUTTON_RECEIVER);
3248 PRIVATE_SETTINGS.add(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY);
3249 PRIVATE_SETTINGS.add(VIBRATE_WHEN_RINGING);
3250 PRIVATE_SETTINGS.add(DTMF_TONE_TYPE_WHEN_DIALING);
3251 PRIVATE_SETTINGS.add(HEARING_AID);
3252 PRIVATE_SETTINGS.add(TTY_MODE);
3253 PRIVATE_SETTINGS.add(NOTIFICATION_LIGHT_PULSE);
3254 PRIVATE_SETTINGS.add(POINTER_LOCATION);
3255 PRIVATE_SETTINGS.add(SHOW_TOUCHES);
3256 PRIVATE_SETTINGS.add(WINDOW_ORIENTATION_LISTENER_LOG);
3257 PRIVATE_SETTINGS.add(POWER_SOUNDS_ENABLED);
3258 PRIVATE_SETTINGS.add(DOCK_SOUNDS_ENABLED);
3259 PRIVATE_SETTINGS.add(LOCKSCREEN_SOUNDS_ENABLED);
3260 PRIVATE_SETTINGS.add(LOCKSCREEN_DISABLED);
3261 PRIVATE_SETTINGS.add(LOW_BATTERY_SOUND);
3262 PRIVATE_SETTINGS.add(DESK_DOCK_SOUND);
3263 PRIVATE_SETTINGS.add(DESK_UNDOCK_SOUND);
3264 PRIVATE_SETTINGS.add(CAR_DOCK_SOUND);
3265 PRIVATE_SETTINGS.add(CAR_UNDOCK_SOUND);
3266 PRIVATE_SETTINGS.add(LOCK_SOUND);
3267 PRIVATE_SETTINGS.add(UNLOCK_SOUND);
3268 PRIVATE_SETTINGS.add(SIP_RECEIVE_CALLS);
3269 PRIVATE_SETTINGS.add(SIP_CALL_OPTIONS);
3270 PRIVATE_SETTINGS.add(SIP_ALWAYS);
3271 PRIVATE_SETTINGS.add(SIP_ADDRESS_ONLY);
3272 PRIVATE_SETTINGS.add(SIP_ASK_ME_EACH_TIME);
3273 PRIVATE_SETTINGS.add(POINTER_SPEED);
3274 PRIVATE_SETTINGS.add(LOCK_TO_APP_ENABLED);
3275 PRIVATE_SETTINGS.add(EGG_MODE);
3276 }
3277
3278 /**
Amith Yamasanib0ff3222015-03-04 09:56:14 -08003279 * These are all public system settings
Svetoslav683914b2015-01-15 14:22:26 -08003280 *
3281 * @hide
3282 */
3283 public static final Map<String, Validator> VALIDATORS = new ArrayMap<>();
3284 static {
3285 VALIDATORS.put(END_BUTTON_BEHAVIOR,END_BUTTON_BEHAVIOR_VALIDATOR);
3286 VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR);
3287 VALIDATORS.put(BLUETOOTH_DISCOVERABILITY, BLUETOOTH_DISCOVERABILITY_VALIDATOR);
3288 VALIDATORS.put(BLUETOOTH_DISCOVERABILITY_TIMEOUT,
3289 BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR);
3290 VALIDATORS.put(NEXT_ALARM_FORMATTED, NEXT_ALARM_FORMATTED_VALIDATOR);
3291 VALIDATORS.put(FONT_SCALE, FONT_SCALE_VALIDATOR);
3292 VALIDATORS.put(DIM_SCREEN, DIM_SCREEN_VALIDATOR);
3293 VALIDATORS.put(SCREEN_OFF_TIMEOUT, SCREEN_OFF_TIMEOUT_VALIDATOR);
3294 VALIDATORS.put(SCREEN_BRIGHTNESS, SCREEN_BRIGHTNESS_VALIDATOR);
3295 VALIDATORS.put(SCREEN_BRIGHTNESS_MODE, SCREEN_BRIGHTNESS_MODE_VALIDATOR);
3296 VALIDATORS.put(MODE_RINGER_STREAMS_AFFECTED, MODE_RINGER_STREAMS_AFFECTED_VALIDATOR);
3297 VALIDATORS.put(MUTE_STREAMS_AFFECTED, MUTE_STREAMS_AFFECTED_VALIDATOR);
3298 VALIDATORS.put(VIBRATE_ON, VIBRATE_ON_VALIDATOR);
Svetoslav683914b2015-01-15 14:22:26 -08003299 VALIDATORS.put(RINGTONE, RINGTONE_VALIDATOR);
3300 VALIDATORS.put(NOTIFICATION_SOUND, NOTIFICATION_SOUND_VALIDATOR);
3301 VALIDATORS.put(ALARM_ALERT, ALARM_ALERT_VALIDATOR);
3302 VALIDATORS.put(TEXT_AUTO_REPLACE, TEXT_AUTO_REPLACE_VALIDATOR);
3303 VALIDATORS.put(TEXT_AUTO_CAPS, TEXT_AUTO_CAPS_VALIDATOR);
3304 VALIDATORS.put(TEXT_AUTO_PUNCTUATE, TEXT_AUTO_PUNCTUATE_VALIDATOR);
3305 VALIDATORS.put(TEXT_SHOW_PASSWORD, TEXT_SHOW_PASSWORD_VALIDATOR);
3306 VALIDATORS.put(SHOW_GTALK_SERVICE_STATUS, SHOW_GTALK_SERVICE_STATUS_VALIDATOR);
3307 VALIDATORS.put(WALLPAPER_ACTIVITY, WALLPAPER_ACTIVITY_VALIDATOR);
3308 VALIDATORS.put(TIME_12_24, TIME_12_24_VALIDATOR);
3309 VALIDATORS.put(DATE_FORMAT, DATE_FORMAT_VALIDATOR);
3310 VALIDATORS.put(SETUP_WIZARD_HAS_RUN, SETUP_WIZARD_HAS_RUN_VALIDATOR);
3311 VALIDATORS.put(ACCELEROMETER_ROTATION, ACCELEROMETER_ROTATION_VALIDATOR);
3312 VALIDATORS.put(USER_ROTATION, USER_ROTATION_VALIDATOR);
3313 VALIDATORS.put(DTMF_TONE_WHEN_DIALING, DTMF_TONE_WHEN_DIALING_VALIDATOR);
3314 VALIDATORS.put(SOUND_EFFECTS_ENABLED, SOUND_EFFECTS_ENABLED_VALIDATOR);
3315 VALIDATORS.put(HAPTIC_FEEDBACK_ENABLED, HAPTIC_FEEDBACK_ENABLED_VALIDATOR);
3316 VALIDATORS.put(SHOW_WEB_SUGGESTIONS, SHOW_WEB_SUGGESTIONS_VALIDATOR);
3317 VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR);
3318 VALIDATORS.put(END_BUTTON_BEHAVIOR, END_BUTTON_BEHAVIOR_VALIDATOR);
3319 VALIDATORS.put(ADVANCED_SETTINGS, ADVANCED_SETTINGS_VALIDATOR);
3320 VALIDATORS.put(SCREEN_AUTO_BRIGHTNESS_ADJ, SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR);
3321 VALIDATORS.put(VIBRATE_INPUT_DEVICES, VIBRATE_INPUT_DEVICES_VALIDATOR);
Svetoslav683914b2015-01-15 14:22:26 -08003322 VALIDATORS.put(VOLUME_MASTER_MUTE, VOLUME_MASTER_MUTE_VALIDATOR);
3323 VALIDATORS.put(MICROPHONE_MUTE, MICROPHONE_MUTE_VALIDATOR);
3324 VALIDATORS.put(NOTIFICATIONS_USE_RING_VOLUME, NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR);
3325 VALIDATORS.put(VIBRATE_IN_SILENT, VIBRATE_IN_SILENT_VALIDATOR);
3326 VALIDATORS.put(MEDIA_BUTTON_RECEIVER, MEDIA_BUTTON_RECEIVER_VALIDATOR);
3327 VALIDATORS.put(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY,
3328 HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR);
3329 VALIDATORS.put(VIBRATE_WHEN_RINGING, VIBRATE_WHEN_RINGING_VALIDATOR);
3330 VALIDATORS.put(DTMF_TONE_TYPE_WHEN_DIALING, DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR);
3331 VALIDATORS.put(HEARING_AID, HEARING_AID_VALIDATOR);
3332 VALIDATORS.put(TTY_MODE, TTY_MODE_VALIDATOR);
3333 VALIDATORS.put(NOTIFICATION_LIGHT_PULSE, NOTIFICATION_LIGHT_PULSE_VALIDATOR);
3334 VALIDATORS.put(POINTER_LOCATION, POINTER_LOCATION_VALIDATOR);
3335 VALIDATORS.put(SHOW_TOUCHES, SHOW_TOUCHES_VALIDATOR);
3336 VALIDATORS.put(WINDOW_ORIENTATION_LISTENER_LOG,
3337 WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR);
3338 VALIDATORS.put(LOCKSCREEN_SOUNDS_ENABLED, LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR);
3339 VALIDATORS.put(LOCKSCREEN_DISABLED, LOCKSCREEN_DISABLED_VALIDATOR);
3340 VALIDATORS.put(SIP_RECEIVE_CALLS, SIP_RECEIVE_CALLS_VALIDATOR);
3341 VALIDATORS.put(SIP_CALL_OPTIONS, SIP_CALL_OPTIONS_VALIDATOR);
3342 VALIDATORS.put(SIP_ALWAYS, SIP_ALWAYS_VALIDATOR);
3343 VALIDATORS.put(SIP_ADDRESS_ONLY, SIP_ADDRESS_ONLY_VALIDATOR);
3344 VALIDATORS.put(SIP_ASK_ME_EACH_TIME, SIP_ASK_ME_EACH_TIME_VALIDATOR);
3345 VALIDATORS.put(POINTER_SPEED, POINTER_SPEED_VALIDATOR);
3346 VALIDATORS.put(LOCK_TO_APP_ENABLED, LOCK_TO_APP_ENABLED_VALIDATOR);
3347 VALIDATORS.put(EGG_MODE, EGG_MODE_VALIDATOR);
3348 VALIDATORS.put(WIFI_STATIC_IP, WIFI_STATIC_IP_VALIDATOR);
3349 VALIDATORS.put(WIFI_STATIC_GATEWAY, WIFI_STATIC_GATEWAY_VALIDATOR);
3350 VALIDATORS.put(WIFI_STATIC_NETMASK, WIFI_STATIC_NETMASK_VALIDATOR);
3351 VALIDATORS.put(WIFI_STATIC_DNS1, WIFI_STATIC_DNS1_VALIDATOR);
3352 VALIDATORS.put(WIFI_STATIC_DNS2, WIFI_STATIC_DNS2_VALIDATOR);
3353 }
3354
3355 /**
3356 * These entries are considered common between the personal and the managed profile,
3357 * since the managed profile doesn't get to change them.
3358 */
3359 private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>();
3360 static {
3361 CLONE_TO_MANAGED_PROFILE.add(DATE_FORMAT);
3362 CLONE_TO_MANAGED_PROFILE.add(HAPTIC_FEEDBACK_ENABLED);
3363 CLONE_TO_MANAGED_PROFILE.add(SOUND_EFFECTS_ENABLED);
3364 CLONE_TO_MANAGED_PROFILE.add(TEXT_SHOW_PASSWORD);
3365 CLONE_TO_MANAGED_PROFILE.add(TIME_12_24);
3366 }
3367
3368 /** @hide */
3369 public static void getCloneToManagedProfileSettings(Set<String> outKeySet) {
3370 outKeySet.addAll(CLONE_TO_MANAGED_PROFILE);
3371 }
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07003372
3373 /**
Sailesh Nepal1bd78762014-02-11 22:32:21 -08003374 * When to use Wi-Fi calling
3375 *
3376 * @see android.telephony.TelephonyManager.WifiCallingChoices
3377 * @hide
3378 */
3379 public static final String WHEN_TO_MAKE_WIFI_CALLS = "when_to_make_wifi_calls";
3380
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003381 // Settings moved to Settings.Secure
3382
3383 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003384 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003385 * instead
3386 */
3387 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003388 public static final String ADB_ENABLED = Global.ADB_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003389
3390 /**
3391 * @deprecated Use {@link android.provider.Settings.Secure#ANDROID_ID} instead
3392 */
3393 @Deprecated
3394 public static final String ANDROID_ID = Secure.ANDROID_ID;
3395
3396 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003397 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003398 */
3399 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003400 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003401
3402 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003403 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003404 */
3405 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003406 public static final String DATA_ROAMING = Global.DATA_ROAMING;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003407
3408 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003409 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003410 */
3411 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003412 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003413
3414 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07003415 * @deprecated Use {@link android.provider.Settings.Global#HTTP_PROXY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003416 */
3417 @Deprecated
Jeff Sharkey625239a2012-09-26 22:03:49 -07003418 public static final String HTTP_PROXY = Global.HTTP_PROXY;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003419
3420 /**
Christopher Tateaa036a22014-05-19 16:33:27 -07003421 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003422 */
3423 @Deprecated
Christopher Tateaa036a22014-05-19 16:33:27 -07003424 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003425
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003426 /**
3427 * @deprecated Use {@link android.provider.Settings.Secure#LOCATION_PROVIDERS_ALLOWED}
3428 * instead
3429 */
3430 @Deprecated
3431 public static final String LOCATION_PROVIDERS_ALLOWED = Secure.LOCATION_PROVIDERS_ALLOWED;
3432
3433 /**
3434 * @deprecated Use {@link android.provider.Settings.Secure#LOGGING_ID} instead
3435 */
3436 @Deprecated
3437 public static final String LOGGING_ID = Secure.LOGGING_ID;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003438
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003439 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003440 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003441 */
3442 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003443 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003444
3445 /**
3446 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_ENABLED}
3447 * instead
3448 */
3449 @Deprecated
3450 public static final String PARENTAL_CONTROL_ENABLED = Secure.PARENTAL_CONTROL_ENABLED;
3451
3452 /**
3453 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_LAST_UPDATE}
3454 * instead
3455 */
3456 @Deprecated
3457 public static final String PARENTAL_CONTROL_LAST_UPDATE = Secure.PARENTAL_CONTROL_LAST_UPDATE;
3458
3459 /**
3460 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_REDIRECT_URL}
3461 * instead
3462 */
3463 @Deprecated
3464 public static final String PARENTAL_CONTROL_REDIRECT_URL =
3465 Secure.PARENTAL_CONTROL_REDIRECT_URL;
3466
3467 /**
3468 * @deprecated Use {@link android.provider.Settings.Secure#SETTINGS_CLASSNAME} instead
3469 */
3470 @Deprecated
3471 public static final String SETTINGS_CLASSNAME = Secure.SETTINGS_CLASSNAME;
3472
3473 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003474 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003475 */
3476 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003477 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003478
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003479 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003480 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003481 */
3482 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003483 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003484
Dianne Hackborn4a51c202009-08-21 15:14:02 -07003485 /**
3486 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07003487 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
Dianne Hackborn4a51c202009-08-21 15:14:02 -07003488 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003489 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003490 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 -08003491
Dianne Hackborn4a51c202009-08-21 15:14:02 -07003492 /**
3493 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07003494 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
Dianne Hackborn4a51c202009-08-21 15:14:02 -07003495 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003496 @Deprecated
3497 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
Christopher Tate06efb532012-08-24 15:29:27 -07003498 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003499
3500 /**
3501 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07003502 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003503 */
3504 @Deprecated
3505 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
Christopher Tate06efb532012-08-24 15:29:27 -07003506 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003507
3508 /**
3509 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07003510 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003511 */
3512 @Deprecated
3513 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
Christopher Tate06efb532012-08-24 15:29:27 -07003514 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003515
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003516 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003517 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003518 * instead
3519 */
3520 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003521 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 -08003522
3523 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003524 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003525 */
3526 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003527 public static final String WIFI_ON = Global.WIFI_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003528
3529 /**
3530 * @deprecated Use
3531 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE}
3532 * instead
3533 */
3534 @Deprecated
3535 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
3536 Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE;
3537
3538 /**
3539 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_AP_COUNT} instead
3540 */
3541 @Deprecated
3542 public static final String WIFI_WATCHDOG_AP_COUNT = Secure.WIFI_WATCHDOG_AP_COUNT;
3543
3544 /**
3545 * @deprecated Use
3546 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS} instead
3547 */
3548 @Deprecated
3549 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
3550 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003551
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003552 /**
3553 * @deprecated Use
3554 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED} instead
3555 */
3556 @Deprecated
3557 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
3558 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED;
3559
3560 /**
3561 * @deprecated Use
3562 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS}
3563 * instead
3564 */
3565 @Deprecated
3566 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
3567 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS;
3568
3569 /**
3570 * @deprecated Use
3571 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT} instead
3572 */
3573 @Deprecated
3574 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
3575 Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT;
3576
3577 /**
3578 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_MAX_AP_CHECKS}
3579 * instead
3580 */
3581 @Deprecated
3582 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = Secure.WIFI_WATCHDOG_MAX_AP_CHECKS;
3583
3584 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003585 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003586 */
3587 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003588 public static final String WIFI_WATCHDOG_ON = Global.WIFI_WATCHDOG_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003589
3590 /**
3591 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_COUNT} instead
3592 */
3593 @Deprecated
3594 public static final String WIFI_WATCHDOG_PING_COUNT = Secure.WIFI_WATCHDOG_PING_COUNT;
3595
3596 /**
3597 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_DELAY_MS}
3598 * instead
3599 */
3600 @Deprecated
3601 public static final String WIFI_WATCHDOG_PING_DELAY_MS = Secure.WIFI_WATCHDOG_PING_DELAY_MS;
3602
3603 /**
3604 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_TIMEOUT_MS}
3605 * instead
3606 */
3607 @Deprecated
3608 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS =
3609 Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS;
3610 }
3611
3612 /**
3613 * Secure system settings, containing system preferences that applications
3614 * can read but are not allowed to write. These are for preferences that
3615 * the user must explicitly modify through the system UI or specialized
3616 * APIs for those values, not modified directly by applications.
3617 */
3618 public static final class Secure extends NameValueTable {
3619 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_secure_version";
3620
Dianne Hackborn139748f2012-09-24 11:36:57 -07003621 /**
3622 * The content:// style URL for this table
3623 */
3624 public static final Uri CONTENT_URI =
3625 Uri.parse("content://" + AUTHORITY + "/secure");
3626
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08003627 // Populated lazily, guarded by class object:
Dianne Hackborn139748f2012-09-24 11:36:57 -07003628 private static final NameValueCache sNameValueCache = new NameValueCache(
3629 SYS_PROP_SETTING_VERSION,
3630 CONTENT_URI,
3631 CALL_METHOD_GET_SECURE,
3632 CALL_METHOD_PUT_SECURE);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003633
Amith Yamasani52c489c2012-03-28 11:42:42 -07003634 private static ILockSettings sLockSettings = null;
3635
Amith Yamasani7ab8c4a2012-04-06 09:27:12 -07003636 private static boolean sIsSystemProcess;
Amith Yamasani52c489c2012-03-28 11:42:42 -07003637 private static final HashSet<String> MOVED_TO_LOCK_SETTINGS;
Christopher Tate06efb532012-08-24 15:29:27 -07003638 private static final HashSet<String> MOVED_TO_GLOBAL;
Amith Yamasani52c489c2012-03-28 11:42:42 -07003639 static {
3640 MOVED_TO_LOCK_SETTINGS = new HashSet<String>(3);
3641 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_ENABLED);
3642 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_VISIBLE);
3643 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
Christopher Tate06efb532012-08-24 15:29:27 -07003644
3645 MOVED_TO_GLOBAL = new HashSet<String>();
3646 MOVED_TO_GLOBAL.add(Settings.Global.ADB_ENABLED);
3647 MOVED_TO_GLOBAL.add(Settings.Global.ASSISTED_GPS_ENABLED);
3648 MOVED_TO_GLOBAL.add(Settings.Global.BLUETOOTH_ON);
Christopher Tate58f41ec2013-01-11 15:40:36 -08003649 MOVED_TO_GLOBAL.add(Settings.Global.BUGREPORT_IN_POWER_MENU);
Christopher Tate06efb532012-08-24 15:29:27 -07003650 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_CELL_BROADCAST_SMS);
3651 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_ROAMING_MODE);
3652 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_SUBSCRIPTION_MODE);
3653 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_MOBILE);
3654 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_WIFI);
3655 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ROAMING);
3656 MOVED_TO_GLOBAL.add(Settings.Global.DEVELOPMENT_SETTINGS_ENABLED);
3657 MOVED_TO_GLOBAL.add(Settings.Global.DEVICE_PROVISIONED);
3658 MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_DENSITY_FORCED);
3659 MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_SIZE_FORCED);
3660 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_MAX_BYTES_OVER_MOBILE);
3661 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE);
Christopher Tate06efb532012-08-24 15:29:27 -07003662 MOVED_TO_GLOBAL.add(Settings.Global.MOBILE_DATA);
3663 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_BUCKET_DURATION);
3664 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_DELETE_AGE);
3665 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_PERSIST_BYTES);
3666 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_ROTATE_AGE);
3667 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_ENABLED);
3668 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_GLOBAL_ALERT_BYTES);
3669 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_POLL_INTERVAL);
Christopher Tate06efb532012-08-24 15:29:27 -07003670 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_SAMPLE_ENABLED);
3671 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_TIME_CACHE_MAX_AGE);
3672 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_BUCKET_DURATION);
3673 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_DELETE_AGE);
3674 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_PERSIST_BYTES);
3675 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_ROTATE_AGE);
3676 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_BUCKET_DURATION);
3677 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_DELETE_AGE);
3678 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_PERSIST_BYTES);
3679 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_ROTATE_AGE);
3680 MOVED_TO_GLOBAL.add(Settings.Global.NETWORK_PREFERENCE);
3681 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_DIFF);
3682 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_SPACING);
3683 MOVED_TO_GLOBAL.add(Settings.Global.NTP_SERVER);
3684 MOVED_TO_GLOBAL.add(Settings.Global.NTP_TIMEOUT);
3685 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_ERROR_POLL_COUNT);
3686 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_LONG_POLL_INTERVAL_MS);
3687 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT);
3688 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_POLL_INTERVAL_MS);
3689 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_TRIGGER_PACKET_COUNT);
3690 MOVED_TO_GLOBAL.add(Settings.Global.SAMPLING_PROFILER_MS);
3691 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DATA_SERVICE_URL);
3692 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_REDIR_HOST);
3693 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_TARGET_URL);
3694 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_APN);
3695 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_REQUIRED);
3696 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_SUPPORTED);
Christopher Tate06efb532012-08-24 15:29:27 -07003697 MOVED_TO_GLOBAL.add(Settings.Global.USB_MASS_STORAGE_ENABLED);
3698 MOVED_TO_GLOBAL.add(Settings.Global.USE_GOOGLE_MAIL);
Robert Greenwalt3ea0c992013-10-03 21:13:49 +00003699 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_COUNTRY_CODE);
Christopher Tate06efb532012-08-24 15:29:27 -07003700 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FRAMEWORK_SCAN_INTERVAL_MS);
3701 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FREQUENCY_BAND);
3702 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_IDLE_MS);
3703 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MAX_DHCP_RETRY_COUNT);
3704 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS);
3705 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
3706 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
3707 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NUM_OPEN_NETWORKS_KEPT);
3708 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ON);
3709 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_P2P_DEVICE_NAME);
3710 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SAVED_STATE);
3711 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUPPLICANT_SCAN_INTERVAL_MS);
3712 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUSPEND_OPTIMIZATIONS_ENABLED);
vandwalle7c3606c2014-03-31 19:12:07 -07003713 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ENHANCED_AUTO_JOIN);
3714 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORK_SHOW_RSSI);
Christopher Tate06efb532012-08-24 15:29:27 -07003715 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_ON);
3716 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED);
Christopher Tate06efb532012-08-24 15:29:27 -07003717 MOVED_TO_GLOBAL.add(Settings.Global.WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON);
Christopher Tatec868b642012-09-12 17:41:04 -07003718 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_ENABLE);
3719 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_TIMEOUT);
3720 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_DEFAULT_RESPONSE);
3721 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS);
3722 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS);
3723 MOVED_TO_GLOBAL.add(Settings.Global.GPRS_REGISTER_CHECK_PERIOD_MS);
Christopher Tate06efb532012-08-24 15:29:27 -07003724 MOVED_TO_GLOBAL.add(Settings.Global.WTF_IS_FATAL);
Jeff Sharkey625239a2012-09-26 22:03:49 -07003725 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_DURATION_THRESHOLD);
3726 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_THRESHOLD);
3727 MOVED_TO_GLOBAL.add(Settings.Global.SEND_ACTION_APP_ERROR);
3728 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_AGE_SECONDS);
3729 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_MAX_FILES);
3730 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_KB);
3731 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_PERCENT);
3732 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_RESERVE_PERCENT);
3733 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_TAG_PREFIX);
3734 MOVED_TO_GLOBAL.add(Settings.Global.ERROR_LOGCAT_PREFIX);
3735 MOVED_TO_GLOBAL.add(Settings.Global.SYS_FREE_STORAGE_LOG_INTERVAL);
3736 MOVED_TO_GLOBAL.add(Settings.Global.DISK_FREE_CHANGE_REPORTING_THRESHOLD);
3737 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_PERCENTAGE);
3738 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_MAX_BYTES);
3739 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_FULL_THRESHOLD_BYTES);
3740 MOVED_TO_GLOBAL.add(Settings.Global.SYNC_MAX_RETRY_DELAY_IN_SECONDS);
3741 MOVED_TO_GLOBAL.add(Settings.Global.CONNECTIVITY_CHANGE_DELAY);
3742 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED);
3743 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_SERVER);
3744 MOVED_TO_GLOBAL.add(Settings.Global.NSD_ON);
3745 MOVED_TO_GLOBAL.add(Settings.Global.SET_INSTALL_LOCATION);
3746 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_INSTALL_LOCATION);
3747 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_UP_DELAY);
3748 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_DOWN_DELAY);
3749 MOVED_TO_GLOBAL.add(Settings.Global.READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT);
3750 MOVED_TO_GLOBAL.add(Settings.Global.HTTP_PROXY);
3751 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_HOST);
3752 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_PORT);
3753 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST);
3754 MOVED_TO_GLOBAL.add(Settings.Global.SET_GLOBAL_HTTP_PROXY);
3755 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_DNS_SERVER);
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003756 MOVED_TO_GLOBAL.add(Settings.Global.PREFERRED_NETWORK_MODE);
Hui Shu22671772014-10-01 21:41:07 +00003757 MOVED_TO_GLOBAL.add(Settings.Global.WEBVIEW_DATA_REDUCTION_PROXY_KEY);
Christopher Tate06efb532012-08-24 15:29:27 -07003758 }
3759
Christopher Tate66488d62012-10-02 11:58:01 -07003760 /** @hide */
Svetoslav683914b2015-01-15 14:22:26 -08003761 public static void getMovedToGlobalSettings(Set<String> outKeySet) {
Christopher Tate66488d62012-10-02 11:58:01 -07003762 outKeySet.addAll(MOVED_TO_GLOBAL);
3763 }
3764
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003765 /**
3766 * Look up a name in the database.
3767 * @param resolver to access the database with
3768 * @param name to look up in the table
3769 * @return the corresponding value, or null if not present
3770 */
Dianne Hackborn139748f2012-09-24 11:36:57 -07003771 public static String getString(ContentResolver resolver, String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07003772 return getStringForUser(resolver, name, UserHandle.myUserId());
3773 }
3774
3775 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -07003776 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -07003777 int userHandle) {
3778 if (MOVED_TO_GLOBAL.contains(name)) {
3779 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
3780 + " to android.provider.Settings.Global.");
3781 return Global.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003782 }
Amith Yamasani52c489c2012-03-28 11:42:42 -07003783
Dianne Hackborn139748f2012-09-24 11:36:57 -07003784 if (MOVED_TO_LOCK_SETTINGS.contains(name)) {
3785 synchronized (Secure.class) {
3786 if (sLockSettings == null) {
3787 sLockSettings = ILockSettings.Stub.asInterface(
3788 (IBinder) ServiceManager.getService("lock_settings"));
3789 sIsSystemProcess = Process.myUid() == Process.SYSTEM_UID;
3790 }
3791 }
3792 if (sLockSettings != null && !sIsSystemProcess) {
3793 try {
3794 return sLockSettings.getString(name, "0", userHandle);
3795 } catch (RemoteException re) {
3796 // Fall through
3797 }
Amith Yamasani52c489c2012-03-28 11:42:42 -07003798 }
3799 }
3800
Christopher Tate06efb532012-08-24 15:29:27 -07003801 return sNameValueCache.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003802 }
3803
3804 /**
3805 * Store a name/value pair into the database.
3806 * @param resolver to access the database with
3807 * @param name to store
3808 * @param value to associate with the name
3809 * @return true if the value was set, false on database errors
3810 */
Christopher Tate06efb532012-08-24 15:29:27 -07003811 public static boolean putString(ContentResolver resolver, String name, String value) {
3812 return putStringForUser(resolver, name, value, UserHandle.myUserId());
3813 }
3814
3815 /** @hide */
3816 public static boolean putStringForUser(ContentResolver resolver, String name, String value,
3817 int userHandle) {
Julia Reynolds82735bc2014-09-04 16:43:30 -04003818 if (LOCATION_MODE.equals(name)) {
3819 // HACK ALERT: temporary hack to work around b/10491283.
3820 // TODO: once b/10491283 fixed, remove this hack
3821 return setLocationModeForUser(resolver, Integer.parseInt(value), userHandle);
3822 }
Christopher Tate06efb532012-08-24 15:29:27 -07003823 if (MOVED_TO_GLOBAL.contains(name)) {
3824 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
3825 + " to android.provider.Settings.Global");
3826 return Global.putStringForUser(resolver, name, value, userHandle);
3827 }
Christopher Tate06efb532012-08-24 15:29:27 -07003828 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003829 }
3830
3831 /**
3832 * Construct the content URI for a particular name/value pair,
3833 * useful for monitoring changes with a ContentObserver.
3834 * @param name to look up in the table
3835 * @return the corresponding content URI, or null if not present
3836 */
3837 public static Uri getUriFor(String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07003838 if (MOVED_TO_GLOBAL.contains(name)) {
3839 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
3840 + " to android.provider.Settings.Global, returning global URI.");
3841 return Global.getUriFor(Global.CONTENT_URI, name);
3842 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003843 return getUriFor(CONTENT_URI, name);
3844 }
3845
3846 /**
3847 * Convenience function for retrieving a single secure settings value
3848 * as an integer. Note that internally setting values are always
3849 * stored as strings; this function converts the string to an integer
3850 * for you. The default value will be returned if the setting is
3851 * not defined or not an integer.
3852 *
3853 * @param cr The ContentResolver to access.
3854 * @param name The name of the setting to retrieve.
3855 * @param def Value to return if the setting is not defined.
3856 *
3857 * @return The setting's current value, or 'def' if it is not defined
3858 * or not a valid integer.
3859 */
3860 public static int getInt(ContentResolver cr, String name, int def) {
Christopher Tate06efb532012-08-24 15:29:27 -07003861 return getIntForUser(cr, name, def, UserHandle.myUserId());
3862 }
3863
3864 /** @hide */
3865 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
Tom O'Neill7f6f4572013-08-27 10:53:15 -07003866 if (LOCATION_MODE.equals(name)) {
3867 // HACK ALERT: temporary hack to work around b/10491283.
3868 // TODO: once b/10491283 fixed, remove this hack
3869 return getLocationModeForUser(cr, userHandle);
3870 }
Christopher Tate06efb532012-08-24 15:29:27 -07003871 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003872 try {
3873 return v != null ? Integer.parseInt(v) : def;
3874 } catch (NumberFormatException e) {
3875 return def;
3876 }
3877 }
3878
3879 /**
3880 * Convenience function for retrieving a single secure settings value
3881 * as an integer. Note that internally setting values are always
3882 * stored as strings; this function converts the string to an integer
3883 * for you.
3884 * <p>
3885 * This version does not take a default value. If the setting has not
3886 * been set, or the string value is not a number,
3887 * it throws {@link SettingNotFoundException}.
3888 *
3889 * @param cr The ContentResolver to access.
3890 * @param name The name of the setting to retrieve.
3891 *
3892 * @throws SettingNotFoundException Thrown if a setting by the given
3893 * name can't be found or the setting value is not an integer.
3894 *
3895 * @return The setting's current value.
3896 */
3897 public static int getInt(ContentResolver cr, String name)
3898 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07003899 return getIntForUser(cr, name, UserHandle.myUserId());
3900 }
3901
3902 /** @hide */
3903 public static int getIntForUser(ContentResolver cr, String name, int userHandle)
3904 throws SettingNotFoundException {
Tom O'Neill7f6f4572013-08-27 10:53:15 -07003905 if (LOCATION_MODE.equals(name)) {
3906 // HACK ALERT: temporary hack to work around b/10491283.
3907 // TODO: once b/10491283 fixed, remove this hack
3908 return getLocationModeForUser(cr, userHandle);
3909 }
Christopher Tate06efb532012-08-24 15:29:27 -07003910 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003911 try {
3912 return Integer.parseInt(v);
3913 } catch (NumberFormatException e) {
3914 throw new SettingNotFoundException(name);
3915 }
3916 }
3917
3918 /**
3919 * Convenience function for updating a single settings value as an
3920 * integer. This will either create a new entry in the table if the
3921 * given name does not exist, or modify the value of the existing row
3922 * with that name. Note that internally setting values are always
3923 * stored as strings, so this function converts the given value to a
3924 * string before storing it.
3925 *
3926 * @param cr The ContentResolver to access.
3927 * @param name The name of the setting to modify.
3928 * @param value The new value for the setting.
3929 * @return true if the value was set, false on database errors
3930 */
3931 public static boolean putInt(ContentResolver cr, String name, int value) {
Christopher Tate06efb532012-08-24 15:29:27 -07003932 return putIntForUser(cr, name, value, UserHandle.myUserId());
3933 }
3934
3935 /** @hide */
3936 public static boolean putIntForUser(ContentResolver cr, String name, int value,
3937 int userHandle) {
3938 return putStringForUser(cr, name, Integer.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003939 }
3940
3941 /**
3942 * Convenience function for retrieving a single secure settings value
3943 * as a {@code long}. Note that internally setting values are always
3944 * stored as strings; this function converts the string to a {@code long}
3945 * for you. The default value will be returned if the setting is
3946 * not defined or not a {@code long}.
3947 *
3948 * @param cr The ContentResolver to access.
3949 * @param name The name of the setting to retrieve.
3950 * @param def Value to return if the setting is not defined.
3951 *
3952 * @return The setting's current value, or 'def' if it is not defined
3953 * or not a valid {@code long}.
3954 */
3955 public static long getLong(ContentResolver cr, String name, long def) {
Christopher Tate06efb532012-08-24 15:29:27 -07003956 return getLongForUser(cr, name, def, UserHandle.myUserId());
3957 }
3958
3959 /** @hide */
3960 public static long getLongForUser(ContentResolver cr, String name, long def,
3961 int userHandle) {
3962 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003963 long value;
3964 try {
3965 value = valString != null ? Long.parseLong(valString) : def;
3966 } catch (NumberFormatException e) {
3967 value = def;
3968 }
3969 return value;
3970 }
3971
3972 /**
3973 * Convenience function for retrieving a single secure settings value
3974 * as a {@code long}. Note that internally setting values are always
3975 * stored as strings; this function converts the string to a {@code long}
3976 * for you.
3977 * <p>
3978 * This version does not take a default value. If the setting has not
3979 * been set, or the string value is not a number,
3980 * it throws {@link SettingNotFoundException}.
3981 *
3982 * @param cr The ContentResolver to access.
3983 * @param name The name of the setting to retrieve.
3984 *
3985 * @return The setting's current value.
3986 * @throws SettingNotFoundException Thrown if a setting by the given
3987 * name can't be found or the setting value is not an integer.
3988 */
3989 public static long getLong(ContentResolver cr, String name)
3990 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07003991 return getLongForUser(cr, name, UserHandle.myUserId());
3992 }
3993
3994 /** @hide */
3995 public static long getLongForUser(ContentResolver cr, String name, int userHandle)
3996 throws SettingNotFoundException {
3997 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003998 try {
3999 return Long.parseLong(valString);
4000 } catch (NumberFormatException e) {
4001 throw new SettingNotFoundException(name);
4002 }
4003 }
4004
4005 /**
4006 * Convenience function for updating a secure settings value as a long
4007 * integer. This will either create a new entry in the table if the
4008 * given name does not exist, or modify the value of the existing row
4009 * with that name. Note that internally setting values are always
4010 * stored as strings, so this function converts the given value to a
4011 * string before storing it.
4012 *
4013 * @param cr The ContentResolver to access.
4014 * @param name The name of the setting to modify.
4015 * @param value The new value for the setting.
4016 * @return true if the value was set, false on database errors
4017 */
4018 public static boolean putLong(ContentResolver cr, String name, long value) {
Christopher Tate06efb532012-08-24 15:29:27 -07004019 return putLongForUser(cr, name, value, UserHandle.myUserId());
4020 }
4021
4022 /** @hide */
4023 public static boolean putLongForUser(ContentResolver cr, String name, long value,
4024 int userHandle) {
4025 return putStringForUser(cr, name, Long.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004026 }
4027
4028 /**
4029 * Convenience function for retrieving a single secure settings value
4030 * as a floating point number. Note that internally setting values are
4031 * always stored as strings; this function converts the string to an
4032 * float for you. The default value will be returned if the setting
4033 * is not defined or not a valid float.
4034 *
4035 * @param cr The ContentResolver to access.
4036 * @param name The name of the setting to retrieve.
4037 * @param def Value to return if the setting is not defined.
4038 *
4039 * @return The setting's current value, or 'def' if it is not defined
4040 * or not a valid float.
4041 */
4042 public static float getFloat(ContentResolver cr, String name, float def) {
Christopher Tate06efb532012-08-24 15:29:27 -07004043 return getFloatForUser(cr, name, def, UserHandle.myUserId());
4044 }
4045
4046 /** @hide */
4047 public static float getFloatForUser(ContentResolver cr, String name, float def,
4048 int userHandle) {
4049 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004050 try {
4051 return v != null ? Float.parseFloat(v) : def;
4052 } catch (NumberFormatException e) {
4053 return def;
4054 }
4055 }
4056
4057 /**
4058 * Convenience function for retrieving a single secure settings value
4059 * as a float. Note that internally setting values are always
4060 * stored as strings; this function converts the string to a float
4061 * for you.
4062 * <p>
4063 * This version does not take a default value. If the setting has not
4064 * been set, or the string value is not a number,
4065 * it throws {@link SettingNotFoundException}.
4066 *
4067 * @param cr The ContentResolver to access.
4068 * @param name The name of the setting to retrieve.
4069 *
4070 * @throws SettingNotFoundException Thrown if a setting by the given
4071 * name can't be found or the setting value is not a float.
4072 *
4073 * @return The setting's current value.
4074 */
4075 public static float getFloat(ContentResolver cr, String name)
4076 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07004077 return getFloatForUser(cr, name, UserHandle.myUserId());
4078 }
4079
4080 /** @hide */
4081 public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
4082 throws SettingNotFoundException {
4083 String v = getStringForUser(cr, name, userHandle);
Brian Muramatsue1d46982010-12-06 17:34:20 -08004084 if (v == null) {
4085 throw new SettingNotFoundException(name);
4086 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004087 try {
4088 return Float.parseFloat(v);
4089 } catch (NumberFormatException e) {
4090 throw new SettingNotFoundException(name);
4091 }
4092 }
4093
4094 /**
4095 * Convenience function for updating a single settings value as a
4096 * floating point number. This will either create a new entry in the
4097 * table if the given name does not exist, or modify the value of the
4098 * existing row with that name. Note that internally setting values
4099 * are always stored as strings, so this function converts the given
4100 * value to a string before storing it.
4101 *
4102 * @param cr The ContentResolver to access.
4103 * @param name The name of the setting to modify.
4104 * @param value The new value for the setting.
4105 * @return true if the value was set, false on database errors
4106 */
4107 public static boolean putFloat(ContentResolver cr, String name, float value) {
Christopher Tate06efb532012-08-24 15:29:27 -07004108 return putFloatForUser(cr, name, value, UserHandle.myUserId());
4109 }
4110
4111 /** @hide */
4112 public static boolean putFloatForUser(ContentResolver cr, String name, float value,
4113 int userHandle) {
4114 return putStringForUser(cr, name, Float.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004115 }
4116
4117 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004118 * @deprecated Use {@link android.provider.Settings.Global#DEVELOPMENT_SETTINGS_ENABLED}
4119 * instead
Dianne Hackborn895f99e2012-02-02 11:49:12 -08004120 */
Christopher Tate06efb532012-08-24 15:29:27 -07004121 @Deprecated
4122 public static final String DEVELOPMENT_SETTINGS_ENABLED =
4123 Global.DEVELOPMENT_SETTINGS_ENABLED;
Dianne Hackborn895f99e2012-02-02 11:49:12 -08004124
4125 /**
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07004126 * When the user has enable the option to have a "bug report" command
4127 * in the power menu.
Christopher Tate58f41ec2013-01-11 15:40:36 -08004128 * @deprecated Use {@link android.provider.Settings.Global#BUGREPORT_IN_POWER_MENU} instead
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07004129 * @hide
4130 */
Christopher Tate58f41ec2013-01-11 15:40:36 -08004131 @Deprecated
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07004132 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
4133
4134 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004135 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004136 */
Christopher Tate06efb532012-08-24 15:29:27 -07004137 @Deprecated
4138 public static final String ADB_ENABLED = Global.ADB_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004139
4140 /**
4141 * Setting to allow mock locations and location provider status to be injected into the
4142 * LocationManager service for testing purposes during application development. These
4143 * locations and status values override actual location and status information generated
4144 * by network, gps, or other location providers.
Svet Ganovf7e9cf42015-05-13 10:40:31 -07004145 *
4146 * @deprecated This settings is not used anymore.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004147 */
Svet Ganovf7e9cf42015-05-13 10:40:31 -07004148 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004149 public static final String ALLOW_MOCK_LOCATION = "mock_location";
4150
4151 /**
Doug Zongkerd8893db2010-01-26 12:29:44 -08004152 * A 64-bit number (as a hex string) that is randomly
Scott Main44895332013-11-12 09:23:13 -08004153 * generated when the user first sets up the device and should remain
4154 * constant for the lifetime of the user's device. The value may
4155 * change if a factory reset is performed on the device.
4156 * <p class="note"><strong>Note:</strong> When a device has <a
4157 * href="{@docRoot}about/versions/android-4.2.html#MultipleUsers">multiple users</a>
4158 * (available on certain devices running Android 4.2 or higher), each user appears as a
4159 * completely separate device, so the {@code ANDROID_ID} value is unique to each
4160 * user.</p>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004161 */
4162 public static final String ANDROID_ID = "android_id";
4163
4164 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004165 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004166 */
Christopher Tate06efb532012-08-24 15:29:27 -07004167 @Deprecated
4168 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004169
4170 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004171 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004172 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07004173 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07004174 public static final String DATA_ROAMING = Global.DATA_ROAMING;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004175
4176 /**
4177 * Setting to record the input method used by default, holding the ID
4178 * of the desired method.
4179 */
4180 public static final String DEFAULT_INPUT_METHOD = "default_input_method";
4181
4182 /**
satokab751aa2010-09-14 19:17:36 +09004183 * Setting to record the input method subtype used by default, holding the ID
4184 * of the desired method.
4185 */
4186 public static final String SELECTED_INPUT_METHOD_SUBTYPE =
4187 "selected_input_method_subtype";
4188
4189 /**
satok723a27e2010-11-11 14:58:11 +09004190 * Setting to record the history of input method subtype, holding the pair of ID of IME
4191 * and its last used subtype.
4192 * @hide
4193 */
4194 public static final String INPUT_METHODS_SUBTYPE_HISTORY =
4195 "input_methods_subtype_history";
4196
4197 /**
satok5c58dfc2010-12-14 21:54:47 +09004198 * Setting to record the visibility of input method selector
4199 */
4200 public static final String INPUT_METHOD_SELECTOR_VISIBILITY =
4201 "input_method_selector_visibility";
4202
4203 /**
Dianne Hackborn91097de2014-04-04 18:02:06 -07004204 * The currently selected voice interaction service flattened ComponentName.
4205 * @hide
4206 */
4207 public static final String VOICE_INTERACTION_SERVICE = "voice_interaction_service";
4208
4209 /**
Zhihai Xuaf5971e2013-06-10 20:28:31 -07004210 * bluetooth HCI snoop log configuration
4211 * @hide
4212 */
4213 public static final String BLUETOOTH_HCI_LOG =
4214 "bluetooth_hci_log";
4215
4216 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004217 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004218 */
Christopher Tate06efb532012-08-24 15:29:27 -07004219 @Deprecated
4220 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004221
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004222 /**
Russell Brennerde6ae442012-09-26 20:53:10 -07004223 * Whether the current user has been set up via setup wizard (0 = false, 1 = true)
4224 * @hide
4225 */
4226 public static final String USER_SETUP_COMPLETE = "user_setup_complete";
4227
4228 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004229 * List of input methods that are currently enabled. This is a string
4230 * containing the IDs of all enabled input methods, each ID separated
4231 * by ':'.
4232 */
4233 public static final String ENABLED_INPUT_METHODS = "enabled_input_methods";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004234
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004235 /**
Amith Yamasanie861ec12010-03-24 21:39:27 -07004236 * List of system input methods that are currently disabled. This is a string
4237 * containing the IDs of all disabled input methods, each ID separated
4238 * by ':'.
4239 * @hide
4240 */
4241 public static final String DISABLED_SYSTEM_INPUT_METHODS = "disabled_system_input_methods";
4242
4243 /**
Michael Wright7b5a96b2014-08-09 19:28:42 -07004244 * Whether to show the IME when a hard keyboard is connected. This is a boolean that
4245 * determines if the IME should be shown when a hard keyboard is attached.
4246 * @hide
4247 */
4248 public static final String SHOW_IME_WITH_HARD_KEYBOARD = "show_ime_with_hard_keyboard";
4249
4250 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07004251 * Host name and port for global http proxy. Uses ':' seperator for
4252 * between host and port.
4253 *
4254 * @deprecated Use {@link Global#HTTP_PROXY}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004255 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07004256 @Deprecated
4257 public static final String HTTP_PROXY = Global.HTTP_PROXY;
Robert Greenwalte90aa5e2010-09-01 11:34:05 -07004258
4259 /**
Christopher Tateaa036a22014-05-19 16:33:27 -07004260 * Whether applications can be installed for this user via the system's
4261 * {@link Intent#ACTION_INSTALL_PACKAGE} mechanism.
4262 *
4263 * <p>1 = permit app installation via the system package installer intent
4264 * <p>0 = do not allow use of the package installer
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004265 */
Christopher Tateaa036a22014-05-19 16:33:27 -07004266 public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004267
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004268 /**
Tom O'Neill923c0dc2014-03-03 11:07:55 -08004269 * Comma-separated list of location providers that activities may access. Do not rely on
4270 * this value being present in settings.db or on ContentObserver notifications on the
4271 * corresponding Uri.
Tom O'Neilla324ac72013-08-26 14:40:23 -07004272 *
Tom O'Neill923c0dc2014-03-03 11:07:55 -08004273 * @deprecated use {@link #LOCATION_MODE} and
4274 * {@link LocationManager#MODE_CHANGED_ACTION} (or
4275 * {@link LocationManager#PROVIDERS_CHANGED_ACTION})
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004276 */
Tom O'Neilla324ac72013-08-26 14:40:23 -07004277 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004278 public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004279
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004280 /**
Tom O'Neill7f6f4572013-08-27 10:53:15 -07004281 * The degree of location access enabled by the user.
Tom O'Neill923c0dc2014-03-03 11:07:55 -08004282 * <p>
Tom O'Neill7f6f4572013-08-27 10:53:15 -07004283 * When used with {@link #putInt(ContentResolver, String, int)}, must be one of {@link
4284 * #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY}, {@link
4285 * #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}. When used with {@link
4286 * #getInt(ContentResolver, String)}, the caller must gracefully handle additional location
4287 * modes that might be added in the future.
Tom O'Neill923c0dc2014-03-03 11:07:55 -08004288 * <p>
4289 * Note: do not rely on this value being present in settings.db or on ContentObserver
4290 * notifications for the corresponding Uri. Use {@link LocationManager#MODE_CHANGED_ACTION}
4291 * to receive changes in this value.
Tom O'Neilla324ac72013-08-26 14:40:23 -07004292 */
4293 public static final String LOCATION_MODE = "location_mode";
4294
4295 /**
Tom O'Neill7f6f4572013-08-27 10:53:15 -07004296 * Location access disabled.
Tom O'Neill1f48b782013-08-19 18:14:56 -07004297 */
4298 public static final int LOCATION_MODE_OFF = 0;
4299 /**
4300 * Network Location Provider disabled, but GPS and other sensors enabled.
4301 */
4302 public static final int LOCATION_MODE_SENSORS_ONLY = 1;
4303 /**
Tom O'Neilld5759432013-09-11 11:03:03 -07004304 * Reduced power usage, such as limiting the number of GPS updates per hour. Requests
4305 * with {@link android.location.Criteria#POWER_HIGH} may be downgraded to
4306 * {@link android.location.Criteria#POWER_MEDIUM}.
Tom O'Neill1f48b782013-08-19 18:14:56 -07004307 */
4308 public static final int LOCATION_MODE_BATTERY_SAVING = 2;
4309 /**
4310 * Best-effort location computation allowed.
4311 */
4312 public static final int LOCATION_MODE_HIGH_ACCURACY = 3;
4313
4314 /**
Danielle Millett925a7d82012-03-19 18:02:20 -04004315 * A flag containing settings used for biometric weak
4316 * @hide
4317 */
Adrian Roos230635e2015-01-07 20:50:29 +01004318 @Deprecated
Danielle Millett925a7d82012-03-19 18:02:20 -04004319 public static final String LOCK_BIOMETRIC_WEAK_FLAGS =
4320 "lock_biometric_weak_flags";
4321
4322 /**
Jason Monk94cfd9d2014-10-31 13:18:21 -04004323 * Whether lock-to-app will lock the keyguard when exiting.
4324 * @hide
4325 */
4326 public static final String LOCK_TO_APP_EXIT_LOCKED = "lock_to_app_exit_locked";
4327
4328 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08004329 * Whether autolock is enabled (0 = false, 1 = true)
Adrian Roos9dd16eb2015-01-08 16:20:49 +01004330 *
4331 * @deprecated Use {@link android.app.KeyguardManager} to determine the state and security
4332 * level of the keyguard.
Amith Yamasani156c4352010-03-05 17:10:03 -08004333 */
Adrian Roos9dd16eb2015-01-08 16:20:49 +01004334 @Deprecated
Amith Yamasani156c4352010-03-05 17:10:03 -08004335 public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock";
4336
4337 /**
4338 * Whether lock pattern is visible as user enters (0 = false, 1 = true)
4339 */
4340 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
4341
4342 /**
Jeff Sharkey5ed9d682012-10-10 14:28:27 -07004343 * Whether lock pattern will vibrate as user enters (0 = false, 1 =
4344 * true)
4345 *
4346 * @deprecated Starting in {@link VERSION_CODES#JELLY_BEAN_MR1} the
4347 * lockscreen uses
4348 * {@link Settings.System#HAPTIC_FEEDBACK_ENABLED}.
Amith Yamasani156c4352010-03-05 17:10:03 -08004349 */
Jeff Sharkey5ed9d682012-10-10 14:28:27 -07004350 @Deprecated
4351 public static final String
4352 LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = "lock_pattern_tactile_feedback_enabled";
Amith Yamasani156c4352010-03-05 17:10:03 -08004353
4354 /**
Jim Millerbc4603b2010-08-30 21:21:34 -07004355 * This preference allows the device to be locked given time after screen goes off,
4356 * subject to current DeviceAdmin policy limits.
4357 * @hide
4358 */
4359 public static final String LOCK_SCREEN_LOCK_AFTER_TIMEOUT = "lock_screen_lock_after_timeout";
4360
4361
4362 /**
John Spurlock5f050e52012-10-27 10:44:19 -04004363 * This preference contains the string that shows for owner info on LockScreen.
Jim Miller253a5ef2010-10-13 20:57:29 -07004364 * @hide
Jim Miller187ec582013-04-15 18:27:54 -07004365 * @deprecated
Jim Miller253a5ef2010-10-13 20:57:29 -07004366 */
4367 public static final String LOCK_SCREEN_OWNER_INFO = "lock_screen_owner_info";
4368
4369 /**
John Spurlock5f050e52012-10-27 10:44:19 -04004370 * Ids of the user-selected appwidgets on the lockscreen (comma-delimited).
Jim Millerf229e4d2012-09-12 20:32:50 -07004371 * @hide
4372 */
Adrian Roos230635e2015-01-07 20:50:29 +01004373 @Deprecated
Michael Jurkaaa2859a2012-10-24 12:46:49 -07004374 public static final String LOCK_SCREEN_APPWIDGET_IDS =
4375 "lock_screen_appwidget_ids";
Jim Millerf229e4d2012-09-12 20:32:50 -07004376
4377 /**
Jim Miller51117262012-11-04 17:58:09 -08004378 * Id of the appwidget shown on the lock screen when appwidgets are disabled.
4379 * @hide
4380 */
Adrian Roos230635e2015-01-07 20:50:29 +01004381 @Deprecated
Jim Miller51117262012-11-04 17:58:09 -08004382 public static final String LOCK_SCREEN_FALLBACK_APPWIDGET_ID =
4383 "lock_screen_fallback_appwidget_id";
4384
4385 /**
John Spurlock5f050e52012-10-27 10:44:19 -04004386 * Index of the lockscreen appwidget to restore, -1 if none.
4387 * @hide
4388 */
Adrian Roos230635e2015-01-07 20:50:29 +01004389 @Deprecated
John Spurlock5f050e52012-10-27 10:44:19 -04004390 public static final String LOCK_SCREEN_STICKY_APPWIDGET =
4391 "lock_screen_sticky_appwidget";
4392
4393 /**
4394 * This preference enables showing the owner info on LockScreen.
Jim Miller253a5ef2010-10-13 20:57:29 -07004395 * @hide
Jim Miller187ec582013-04-15 18:27:54 -07004396 * @deprecated
Jim Miller253a5ef2010-10-13 20:57:29 -07004397 */
4398 public static final String LOCK_SCREEN_OWNER_INFO_ENABLED =
4399 "lock_screen_owner_info_enabled";
4400
4401 /**
Dan Sandler5d7c3cc2014-02-18 17:35:15 -05004402 * When set by a user, allows notifications to be shown atop a securely locked screen
4403 * in their full "private" form (same as when the device is unlocked).
Dan Sandlerfd16d562014-02-13 18:43:31 -08004404 * @hide
4405 */
4406 public static final String LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS =
4407 "lock_screen_allow_private_notifications";
4408
4409 /**
Chris Wrencd8f4f72014-08-27 18:48:13 -04004410 * Set by the system to track if the user needs to see the call to action for
4411 * the lockscreen notification policy.
4412 * @hide
4413 */
4414 public static final String SHOW_NOTE_ABOUT_NOTIFICATION_HIDING =
4415 "show_note_about_notification_hiding";
4416
4417 /**
Adrian Roos3870d452014-09-05 18:22:28 +02004418 * Set to 1 by the system after trust agents have been initialized.
4419 * @hide
4420 */
4421 public static final String TRUST_AGENTS_INITIALIZED =
4422 "trust_agents_initialized";
4423
4424 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004425 * The Logging ID (a unique 64-bit value) as a hex string.
4426 * Used as a pseudonymous identifier for logging.
4427 * @deprecated This identifier is poorly initialized and has
4428 * many collisions. It should not be used.
4429 */
4430 @Deprecated
4431 public static final String LOGGING_ID = "logging_id";
4432
4433 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004434 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004435 */
Christopher Tate06efb532012-08-24 15:29:27 -07004436 @Deprecated
4437 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004438
4439 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08004440 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004441 */
4442 public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004443
4444 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08004445 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004446 */
4447 public static final String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004448
4449 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08004450 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004451 */
4452 public static final String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004453
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004454 /**
4455 * Settings classname to launch when Settings is clicked from All
4456 * Applications. Needed because of user testing between the old
4457 * and new Settings apps.
4458 */
4459 // TODO: 881807
4460 public static final String SETTINGS_CLASSNAME = "settings_classname";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004461
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004462 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004463 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004464 */
Christopher Tate06efb532012-08-24 15:29:27 -07004465 @Deprecated
4466 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004467
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004468 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004469 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004470 */
Christopher Tate06efb532012-08-24 15:29:27 -07004471 @Deprecated
4472 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004473
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004474 /**
svetoslavganov75986cf2009-05-14 22:28:01 -07004475 * If accessibility is enabled.
4476 */
4477 public static final String ACCESSIBILITY_ENABLED = "accessibility_enabled";
4478
4479 /**
Svetoslav Ganov00aabf72011-07-21 11:35:03 -07004480 * If touch exploration is enabled.
Svetoslav Ganov35bfede2011-07-14 17:57:06 -07004481 */
Svetoslav Ganov00aabf72011-07-21 11:35:03 -07004482 public static final String TOUCH_EXPLORATION_ENABLED = "touch_exploration_enabled";
Svetoslav Ganov35bfede2011-07-14 17:57:06 -07004483
4484 /**
svetoslavganov75986cf2009-05-14 22:28:01 -07004485 * List of the enabled accessibility providers.
4486 */
4487 public static final String ENABLED_ACCESSIBILITY_SERVICES =
4488 "enabled_accessibility_services";
4489
4490 /**
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07004491 * List of the accessibility services to which the user has granted
Svetoslav Ganov9a4c5cd2012-05-30 14:06:32 -07004492 * permission to put the device into touch exploration mode.
4493 *
4494 * @hide
4495 */
4496 public static final String TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES =
4497 "touch_exploration_granted_accessibility_services";
4498
4499 /**
Svetoslav Ganov55f937a2011-12-05 11:42:07 -08004500 * Whether to speak passwords while in accessibility mode.
4501 */
4502 public static final String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password";
4503
4504 /**
Chris Craikcce47eb2014-07-16 15:12:15 -07004505 * Whether to draw text with high contrast while in accessibility mode.
4506 *
4507 * @hide
4508 */
4509 public static final String ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED =
4510 "high_text_contrast_enabled";
4511
4512 /**
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08004513 * If injection of accessibility enhancing JavaScript screen-reader
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07004514 * is enabled.
4515 * <p>
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08004516 * Note: The JavaScript based screen-reader is served by the
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07004517 * Google infrastructure and enable users with disabilities to
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07004518 * efficiently navigate in and explore web content.
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07004519 * </p>
4520 * <p>
4521 * This property represents a boolean value.
4522 * </p>
4523 * @hide
4524 */
4525 public static final String ACCESSIBILITY_SCRIPT_INJECTION =
4526 "accessibility_script_injection";
4527
4528 /**
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08004529 * The URL for the injected JavaScript based screen-reader used
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07004530 * for providing accessibility of content in WebView.
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08004531 * <p>
4532 * Note: The JavaScript based screen-reader is served by the
4533 * Google infrastructure and enable users with disabilities to
4534 * efficiently navigate in and explore web content.
4535 * </p>
4536 * <p>
4537 * This property represents a string value.
4538 * </p>
4539 * @hide
4540 */
4541 public static final String ACCESSIBILITY_SCREEN_READER_URL =
4542 "accessibility_script_injection_url";
4543
4544 /**
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07004545 * Key bindings for navigation in built-in accessibility support for web content.
4546 * <p>
4547 * Note: These key bindings are for the built-in accessibility navigation for
4548 * web content which is used as a fall back solution if JavaScript in a WebView
4549 * is not enabled or the user has not opted-in script injection from Google.
4550 * </p>
4551 * <p>
4552 * The bindings are separated by semi-colon. A binding is a mapping from
4553 * a key to a sequence of actions (for more details look at
4554 * android.webkit.AccessibilityInjector). A key is represented as the hexademical
4555 * string representation of an integer obtained from a meta state (optional) shifted
4556 * sixteen times left and bitwise ored with a key code. An action is represented
4557 * as a hexademical string representation of an integer where the first two digits
4558 * are navigation action index, the second, the third, and the fourth digit pairs
4559 * represent the action arguments. The separate actions in a binding are colon
4560 * separated. The key and the action sequence it maps to are separated by equals.
4561 * </p>
4562 * <p>
4563 * For example, the binding below maps the DPAD right button to traverse the
4564 * current navigation axis once without firing an accessibility event and to
4565 * perform the same traversal again but to fire an event:
4566 * <code>
4567 * 0x16=0x01000100:0x01000101;
4568 * </code>
4569 * </p>
4570 * <p>
4571 * The goal of this binding is to enable dynamic rebinding of keys to
4572 * navigation actions for web content without requiring a framework change.
4573 * </p>
4574 * <p>
4575 * This property represents a string value.
4576 * </p>
4577 * @hide
4578 */
4579 public static final String ACCESSIBILITY_WEB_CONTENT_KEY_BINDINGS =
4580 "accessibility_web_content_key_bindings";
4581
4582 /**
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07004583 * Setting that specifies whether the display magnification is enabled.
4584 * Display magnifications allows the user to zoom in the display content
4585 * and is targeted to low vision users. The current magnification scale
4586 * is controlled by {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}.
4587 *
4588 * @hide
4589 */
4590 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED =
4591 "accessibility_display_magnification_enabled";
4592
4593 /**
4594 * Setting that specifies what the display magnification scale is.
4595 * Display magnifications allows the user to zoom in the display
4596 * content and is targeted to low vision users. Whether a display
4597 * magnification is performed is controlled by
4598 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED}
4599 *
4600 * @hide
4601 */
4602 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE =
4603 "accessibility_display_magnification_scale";
4604
4605 /**
4606 * Setting that specifies whether the display magnification should be
4607 * automatically updated. If this fearture is enabled the system will
4608 * exit magnification mode or pan the viewport when a context change
4609 * occurs. For example, on staring a new activity or rotating the screen,
4610 * the system may zoom out so the user can see the new context he is in.
4611 * Another example is on showing a window that is not visible in the
4612 * magnified viewport the system may pan the viewport to make the window
4613 * the has popped up so the user knows that the context has changed.
4614 * Whether a screen magnification is performed is controlled by
4615 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED}
4616 *
4617 * @hide
4618 */
4619 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE =
4620 "accessibility_display_magnification_auto_update";
4621
4622 /**
Alan Viveretteef793802013-07-23 14:15:28 -07004623 * Setting that specifies whether timed text (captions) should be
4624 * displayed in video content. Text display properties are controlled by
4625 * the following settings:
4626 * <ul>
4627 * <li>{@link #ACCESSIBILITY_CAPTIONING_LOCALE}
4628 * <li>{@link #ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR}
4629 * <li>{@link #ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR}
4630 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_COLOR}
4631 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_TYPE}
4632 * <li>{@link #ACCESSIBILITY_CAPTIONING_TYPEFACE}
Alan Viverette69ce69b2013-08-29 12:23:48 -07004633 * <li>{@link #ACCESSIBILITY_CAPTIONING_FONT_SCALE}
Alan Viveretteef793802013-07-23 14:15:28 -07004634 * </ul>
4635 *
4636 * @hide
4637 */
4638 public static final String ACCESSIBILITY_CAPTIONING_ENABLED =
4639 "accessibility_captioning_enabled";
4640
4641 /**
4642 * Setting that specifies the language for captions as a locale string,
4643 * e.g. en_US.
4644 *
4645 * @see java.util.Locale#toString
4646 * @hide
4647 */
4648 public static final String ACCESSIBILITY_CAPTIONING_LOCALE =
4649 "accessibility_captioning_locale";
4650
4651 /**
Alan Viverette43a1e3d2013-08-02 16:45:03 -07004652 * Integer property that specifies the preset style for captions, one
4653 * of:
4654 * <ul>
Alan Viverette69ce69b2013-08-29 12:23:48 -07004655 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESET_CUSTOM}
4656 * <li>a valid index of {@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESETS}
Alan Viverette43a1e3d2013-08-02 16:45:03 -07004657 * </ul>
4658 *
4659 * @see java.util.Locale#toString
4660 * @hide
4661 */
4662 public static final String ACCESSIBILITY_CAPTIONING_PRESET =
4663 "accessibility_captioning_preset";
4664
4665 /**
Alan Viveretteef793802013-07-23 14:15:28 -07004666 * Integer property that specifes the background color for captions as a
4667 * packed 32-bit color.
4668 *
4669 * @see android.graphics.Color#argb
4670 * @hide
4671 */
4672 public static final String ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR =
4673 "accessibility_captioning_background_color";
4674
4675 /**
4676 * Integer property that specifes the foreground color for captions as a
4677 * packed 32-bit color.
4678 *
4679 * @see android.graphics.Color#argb
4680 * @hide
4681 */
4682 public static final String ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR =
4683 "accessibility_captioning_foreground_color";
4684
4685 /**
4686 * Integer property that specifes the edge type for captions, one of:
4687 * <ul>
Alan Viverette69ce69b2013-08-29 12:23:48 -07004688 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_NONE}
4689 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_OUTLINE}
4690 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_DROP_SHADOW}
Alan Viveretteef793802013-07-23 14:15:28 -07004691 * </ul>
4692 *
4693 * @see #ACCESSIBILITY_CAPTIONING_EDGE_COLOR
4694 * @hide
4695 */
4696 public static final String ACCESSIBILITY_CAPTIONING_EDGE_TYPE =
4697 "accessibility_captioning_edge_type";
4698
4699 /**
4700 * Integer property that specifes the edge color for captions as a
4701 * packed 32-bit color.
4702 *
4703 * @see #ACCESSIBILITY_CAPTIONING_EDGE_TYPE
4704 * @see android.graphics.Color#argb
4705 * @hide
4706 */
4707 public static final String ACCESSIBILITY_CAPTIONING_EDGE_COLOR =
4708 "accessibility_captioning_edge_color";
4709
4710 /**
Alan Viverette55d70622013-12-11 15:22:14 -08004711 * Integer property that specifes the window color for captions as a
4712 * packed 32-bit color.
4713 *
4714 * @see android.graphics.Color#argb
4715 * @hide
4716 */
4717 public static final String ACCESSIBILITY_CAPTIONING_WINDOW_COLOR =
4718 "accessibility_captioning_window_color";
4719
4720 /**
Alan Viveretteef793802013-07-23 14:15:28 -07004721 * String property that specifies the typeface for captions, one of:
4722 * <ul>
4723 * <li>DEFAULT
4724 * <li>MONOSPACE
4725 * <li>SANS_SERIF
4726 * <li>SERIF
4727 * </ul>
4728 *
4729 * @see android.graphics.Typeface
4730 * @hide
4731 */
4732 public static final String ACCESSIBILITY_CAPTIONING_TYPEFACE =
4733 "accessibility_captioning_typeface";
4734
4735 /**
Alan Viverette69ce69b2013-08-29 12:23:48 -07004736 * Floating point property that specifies font scaling for captions.
Alan Viveretteef793802013-07-23 14:15:28 -07004737 *
4738 * @hide
4739 */
Alan Viverette69ce69b2013-08-29 12:23:48 -07004740 public static final String ACCESSIBILITY_CAPTIONING_FONT_SCALE =
4741 "accessibility_captioning_font_scale";
Alan Viveretteef793802013-07-23 14:15:28 -07004742
4743 /**
Alan Viverette410d4e32013-09-30 15:37:38 -07004744 * Setting that specifies whether display color inversion is enabled.
Alan Viverette410d4e32013-09-30 15:37:38 -07004745 */
4746 public static final String ACCESSIBILITY_DISPLAY_INVERSION_ENABLED =
4747 "accessibility_display_inversion_enabled";
4748
4749 /**
Alan Viverette410d4e32013-09-30 15:37:38 -07004750 * Setting that specifies whether display color space adjustment is
4751 * enabled.
4752 *
4753 * @hide
4754 */
4755 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED =
4756 "accessibility_display_daltonizer_enabled";
4757
4758 /**
4759 * Integer property that specifies the type of color space adjustment to
4760 * perform. Valid values are defined in AccessibilityManager.
4761 *
4762 * @hide
4763 */
4764 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER =
4765 "accessibility_display_daltonizer";
4766
4767 /**
Svetoslav Ganov54d068e2011-03-02 12:58:40 -08004768 * The timout for considering a press to be a long press in milliseconds.
4769 * @hide
4770 */
4771 public static final String LONG_PRESS_TIMEOUT = "long_press_timeout";
4772
4773 /**
Svetoslav Ganov6bd20bc2013-09-02 15:24:45 -07004774 * List of the enabled print services.
Svetoslav Ganov4b9a4d12013-06-11 15:20:06 -07004775 * @hide
4776 */
4777 public static final String ENABLED_PRINT_SERVICES =
4778 "enabled_print_services";
4779
4780 /**
Svetoslav Ganov6bd20bc2013-09-02 15:24:45 -07004781 * List of the system print services we enabled on first boot. On
4782 * first boot we enable all system, i.e. bundled print services,
4783 * once, so they work out-of-the-box.
4784 * @hide
4785 */
4786 public static final String ENABLED_ON_FIRST_BOOT_SYSTEM_PRINT_SERVICES =
4787 "enabled_on_first_boot_system_print_services";
4788
4789 /**
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07004790 * Setting to always use the default text-to-speech settings regardless
4791 * of the application settings.
4792 * 1 = override application settings,
4793 * 0 = use application settings (if specified).
Narayan Kamath6d632962011-08-24 11:51:37 +01004794 *
4795 * @deprecated The value of this setting is no longer respected by
4796 * the framework text to speech APIs as of the Ice Cream Sandwich release.
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07004797 */
Narayan Kamath6d632962011-08-24 11:51:37 +01004798 @Deprecated
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07004799 public static final String TTS_USE_DEFAULTS = "tts_use_defaults";
4800
4801 /**
4802 * Default text-to-speech engine speech rate. 100 = 1x
4803 */
4804 public static final String TTS_DEFAULT_RATE = "tts_default_rate";
4805
4806 /**
4807 * Default text-to-speech engine pitch. 100 = 1x
4808 */
4809 public static final String TTS_DEFAULT_PITCH = "tts_default_pitch";
4810
4811 /**
4812 * Default text-to-speech engine.
4813 */
4814 public static final String TTS_DEFAULT_SYNTH = "tts_default_synth";
4815
4816 /**
Jean-Michel Trivif4782672009-06-09 16:22:48 -07004817 * Default text-to-speech language.
Narayan Kamath6d632962011-08-24 11:51:37 +01004818 *
4819 * @deprecated this setting is no longer in use, as of the Ice Cream
4820 * Sandwich release. Apps should never need to read this setting directly,
4821 * instead can query the TextToSpeech framework classes for the default
4822 * locale. {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivif4782672009-06-09 16:22:48 -07004823 */
Narayan Kamath6d632962011-08-24 11:51:37 +01004824 @Deprecated
Jean-Michel Trivif4782672009-06-09 16:22:48 -07004825 public static final String TTS_DEFAULT_LANG = "tts_default_lang";
4826
4827 /**
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07004828 * Default text-to-speech country.
Narayan Kamath6d632962011-08-24 11:51:37 +01004829 *
4830 * @deprecated this setting is no longer in use, as of the Ice Cream
4831 * Sandwich release. Apps should never need to read this setting directly,
4832 * instead can query the TextToSpeech framework classes for the default
4833 * locale. {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07004834 */
Narayan Kamath6d632962011-08-24 11:51:37 +01004835 @Deprecated
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07004836 public static final String TTS_DEFAULT_COUNTRY = "tts_default_country";
4837
4838 /**
4839 * Default text-to-speech locale variant.
Narayan Kamath6d632962011-08-24 11:51:37 +01004840 *
4841 * @deprecated this setting is no longer in use, as of the Ice Cream
4842 * Sandwich release. Apps should never need to read this setting directly,
4843 * instead can query the TextToSpeech framework classes for the
4844 * locale that is in use {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07004845 */
Narayan Kamath6d632962011-08-24 11:51:37 +01004846 @Deprecated
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07004847 public static final String TTS_DEFAULT_VARIANT = "tts_default_variant";
4848
4849 /**
Narayan Kamathe5b8c4d2011-08-22 15:37:47 +01004850 * Stores the default tts locales on a per engine basis. Stored as
4851 * a comma seperated list of values, each value being of the form
4852 * {@code engine_name:locale} for example,
Narayan Kamath6d632962011-08-24 11:51:37 +01004853 * {@code com.foo.ttsengine:eng-USA,com.bar.ttsengine:esp-ESP}. This
4854 * supersedes {@link #TTS_DEFAULT_LANG}, {@link #TTS_DEFAULT_COUNTRY} and
4855 * {@link #TTS_DEFAULT_VARIANT}. Apps should never need to read this
4856 * setting directly, and can query the TextToSpeech framework classes
4857 * for the locale that is in use.
Narayan Kamathe5b8c4d2011-08-22 15:37:47 +01004858 *
4859 * @hide
4860 */
4861 public static final String TTS_DEFAULT_LOCALE = "tts_default_locale";
4862
4863 /**
Charles Chenceffa152010-03-16 21:18:10 -07004864 * Space delimited list of plugin packages that are enabled.
4865 */
4866 public static final String TTS_ENABLED_PLUGINS = "tts_enabled_plugins";
4867
4868 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004869 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON}
4870 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004871 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004872 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004873 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004874 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004875
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004876 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004877 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY}
4878 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004879 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004880 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004881 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004882 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004883
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004884 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004885 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
4886 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004887 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004888 @Deprecated
4889 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT =
4890 Global.WIFI_NUM_OPEN_NETWORKS_KEPT;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004891
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004892 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004893 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON}
4894 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004895 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004896 @Deprecated
4897 public static final String WIFI_ON = Global.WIFI_ON;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004898
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004899 /**
4900 * The acceptable packet loss percentage (range 0 - 100) before trying
4901 * another AP on the same network.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004902 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004903 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004904 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004905 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
4906 "wifi_watchdog_acceptable_packet_loss_percentage";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004907
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004908 /**
4909 * The number of access points required for a network in order for the
4910 * watchdog to monitor it.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004911 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004912 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004913 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004914 public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004915
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004916 /**
4917 * The delay between background checks.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004918 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004919 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004920 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004921 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
4922 "wifi_watchdog_background_check_delay_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004923
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004924 /**
4925 * Whether the Wi-Fi watchdog is enabled for background checking even
4926 * after it thinks the user has connected to a good access point.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004927 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004928 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004929 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004930 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
4931 "wifi_watchdog_background_check_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004932
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004933 /**
4934 * The timeout for a background ping
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004935 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004936 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004937 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004938 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
4939 "wifi_watchdog_background_check_timeout_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004940
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004941 /**
4942 * The number of initial pings to perform that *may* be ignored if they
4943 * fail. Again, if these fail, they will *not* be used in packet loss
4944 * calculation. For example, one network always seemed to time out for
4945 * the first couple pings, so this is set to 3 by default.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004946 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004947 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004948 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004949 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
4950 "wifi_watchdog_initial_ignored_ping_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004951
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004952 /**
4953 * The maximum number of access points (per network) to attempt to test.
4954 * If this number is reached, the watchdog will no longer monitor the
4955 * initial connection state for the network. This is a safeguard for
4956 * networks containing multiple APs whose DNS does not respond to pings.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004957 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004958 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004959 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004960 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = "wifi_watchdog_max_ap_checks";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004961
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004962 /**
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07004963 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004964 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07004965 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004966 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
4967
4968 /**
4969 * A comma-separated list of SSIDs for which the Wi-Fi watchdog should be enabled.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004970 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004971 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004972 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004973 public static final String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list";
4974
4975 /**
4976 * The number of pings to test if an access point is a good connection.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004977 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004978 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004979 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004980 public static final String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004981
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004982 /**
4983 * The delay between pings.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004984 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004985 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004986 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004987 public static final String WIFI_WATCHDOG_PING_DELAY_MS = "wifi_watchdog_ping_delay_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004988
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004989 /**
4990 * The timeout per ping.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004991 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004992 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004993 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004994 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004995
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004996 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004997 * @deprecated Use
4998 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004999 */
Christopher Tate06efb532012-08-24 15:29:27 -07005000 @Deprecated
5001 public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005002
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005003 /**
Jeff Brownbf6f6f92012-09-25 15:03:20 -07005004 * @deprecated Use
5005 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005006 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07005007 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005008 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
Jeff Brownbf6f6f92012-09-25 15:03:20 -07005009 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005010
5011 /**
Jeremy Joslin79294842014-12-03 17:15:28 -08005012 * The number of milliseconds to hold on to a PendingIntent based request. This delay gives
5013 * the receivers of the PendingIntent an opportunity to make a new network request before
5014 * the Network satisfying the request is potentially removed.
5015 *
5016 * @hide
5017 */
5018 public static final String CONNECTIVITY_RELEASE_PENDING_INTENT_DELAY_MS =
5019 "connectivity_release_pending_intent_delay_ms";
5020
5021 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07005022 * Whether background data usage is allowed.
5023 *
5024 * @deprecated As of {@link VERSION_CODES#ICE_CREAM_SANDWICH},
5025 * availability of background data depends on several
5026 * combined factors. When background data is unavailable,
5027 * {@link ConnectivityManager#getActiveNetworkInfo()} will
5028 * now appear disconnected.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005029 */
Jeff Sharkey3a844fc2011-08-16 14:37:57 -07005030 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005031 public static final String BACKGROUND_DATA = "background_data";
Wink Saville04e71b32009-04-02 11:00:54 -07005032
5033 /**
Bjorn Bringert98bfa392010-03-24 10:59:48 +00005034 * Origins for which browsers should allow geolocation by default.
5035 * The value is a space-separated list of origins.
5036 */
5037 public static final String ALLOWED_GEOLOCATION_ORIGINS
5038 = "allowed_geolocation_origins";
5039
5040 /**
Wink Savillee9b06d72009-05-18 21:47:50 -07005041 * The preferred TTY mode 0 = TTy Off, CDMA default
5042 * 1 = TTY Full
5043 * 2 = TTY HCO
5044 * 3 = TTY VCO
5045 * @hide
5046 */
5047 public static final String PREFERRED_TTY_MODE =
5048 "preferred_tty_mode";
5049
Wink Saville04e71b32009-04-02 11:00:54 -07005050 /**
Wink Saville04e71b32009-04-02 11:00:54 -07005051 * Whether the enhanced voice privacy mode is enabled.
5052 * 0 = normal voice privacy
5053 * 1 = enhanced voice privacy
5054 * @hide
5055 */
5056 public static final String ENHANCED_VOICE_PRIVACY_ENABLED = "enhanced_voice_privacy_enabled";
5057
5058 /**
5059 * Whether the TTY mode mode is enabled.
5060 * 0 = disabled
5061 * 1 = enabled
5062 * @hide
5063 */
5064 public static final String TTY_MODE_ENABLED = "tty_mode_enabled";
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005065
5066 /**
Christopher Tate8031a3d2009-07-06 16:36:05 -07005067 * Controls whether settings backup is enabled.
Dianne Hackborncf098292009-07-01 19:55:20 -07005068 * Type: int ( 0 = disabled, 1 = enabled )
5069 * @hide
5070 */
5071 public static final String BACKUP_ENABLED = "backup_enabled";
5072
5073 /**
Christopher Tatecce9da52010-02-03 15:11:15 -08005074 * Controls whether application data is automatically restored from backup
5075 * at install time.
5076 * Type: int ( 0 = disabled, 1 = enabled )
5077 * @hide
5078 */
5079 public static final String BACKUP_AUTO_RESTORE = "backup_auto_restore";
5080
5081 /**
Christopher Tate8031a3d2009-07-06 16:36:05 -07005082 * Indicates whether settings backup has been fully provisioned.
5083 * Type: int ( 0 = unprovisioned, 1 = fully provisioned )
5084 * @hide
5085 */
5086 public static final String BACKUP_PROVISIONED = "backup_provisioned";
5087
5088 /**
Dianne Hackborncf098292009-07-01 19:55:20 -07005089 * Component of the transport to use for backup/restore.
5090 * @hide
5091 */
5092 public static final String BACKUP_TRANSPORT = "backup_transport";
Sanjay Jeyakumar21bf2412009-07-09 13:31:48 -07005093
Dianne Hackbornd7cd29d2009-07-01 11:22:45 -07005094 /**
5095 * Version for which the setup wizard was last shown. Bumped for
5096 * each release when there is new setup information to show.
5097 * @hide
5098 */
5099 public static final String LAST_SETUP_SHOWN = "last_setup_shown";
Dianne Hackborncf098292009-07-01 19:55:20 -07005100
5101 /**
Doug Zongker43866e02010-01-07 12:09:54 -08005102 * The interval in milliseconds after which Wi-Fi is considered idle.
5103 * When idle, it is possible for the device to be switched from Wi-Fi to
5104 * the mobile data network.
5105 * @hide
Jeff Brownbf6f6f92012-09-25 15:03:20 -07005106 * @deprecated Use {@link android.provider.Settings.Global#WIFI_IDLE_MS}
5107 * instead.
Doug Zongker43866e02010-01-07 12:09:54 -08005108 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07005109 @Deprecated
5110 public static final String WIFI_IDLE_MS = Global.WIFI_IDLE_MS;
Doug Zongker43866e02010-01-07 12:09:54 -08005111
5112 /**
Narayan Kamathee69ff42011-06-28 12:07:18 +01005113 * The global search provider chosen by the user (if multiple global
5114 * search providers are installed). This will be the provider returned
5115 * by {@link SearchManager#getGlobalSearchActivity()} if it's still
5116 * installed. This setting is stored as a flattened component name as
5117 * per {@link ComponentName#flattenToString()}.
5118 *
5119 * @hide
5120 */
5121 public static final String SEARCH_GLOBAL_SEARCH_ACTIVITY =
5122 "search_global_search_activity";
5123
5124 /**
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08005125 * The number of promoted sources in GlobalSearch.
5126 * @hide
5127 */
5128 public static final String SEARCH_NUM_PROMOTED_SOURCES = "search_num_promoted_sources";
5129 /**
5130 * The maximum number of suggestions returned by GlobalSearch.
5131 * @hide
5132 */
5133 public static final String SEARCH_MAX_RESULTS_TO_DISPLAY = "search_max_results_to_display";
5134 /**
5135 * The number of suggestions GlobalSearch will ask each non-web search source for.
5136 * @hide
5137 */
5138 public static final String SEARCH_MAX_RESULTS_PER_SOURCE = "search_max_results_per_source";
5139 /**
5140 * The number of suggestions the GlobalSearch will ask the web search source for.
5141 * @hide
5142 */
5143 public static final String SEARCH_WEB_RESULTS_OVERRIDE_LIMIT =
5144 "search_web_results_override_limit";
5145 /**
5146 * The number of milliseconds that GlobalSearch will wait for suggestions from
5147 * promoted sources before continuing with all other sources.
5148 * @hide
5149 */
5150 public static final String SEARCH_PROMOTED_SOURCE_DEADLINE_MILLIS =
5151 "search_promoted_source_deadline_millis";
5152 /**
5153 * The number of milliseconds before GlobalSearch aborts search suggesiton queries.
5154 * @hide
5155 */
5156 public static final String SEARCH_SOURCE_TIMEOUT_MILLIS = "search_source_timeout_millis";
5157 /**
5158 * The maximum number of milliseconds that GlobalSearch shows the previous results
5159 * after receiving a new query.
5160 * @hide
5161 */
5162 public static final String SEARCH_PREFILL_MILLIS = "search_prefill_millis";
5163 /**
5164 * The maximum age of log data used for shortcuts in GlobalSearch.
5165 * @hide
5166 */
5167 public static final String SEARCH_MAX_STAT_AGE_MILLIS = "search_max_stat_age_millis";
5168 /**
5169 * The maximum age of log data used for source ranking in GlobalSearch.
5170 * @hide
5171 */
5172 public static final String SEARCH_MAX_SOURCE_EVENT_AGE_MILLIS =
5173 "search_max_source_event_age_millis";
5174 /**
5175 * The minimum number of impressions needed to rank a source in GlobalSearch.
5176 * @hide
5177 */
5178 public static final String SEARCH_MIN_IMPRESSIONS_FOR_SOURCE_RANKING =
5179 "search_min_impressions_for_source_ranking";
5180 /**
5181 * The minimum number of clicks needed to rank a source in GlobalSearch.
5182 * @hide
5183 */
5184 public static final String SEARCH_MIN_CLICKS_FOR_SOURCE_RANKING =
5185 "search_min_clicks_for_source_ranking";
5186 /**
5187 * The maximum number of shortcuts shown by GlobalSearch.
5188 * @hide
5189 */
5190 public static final String SEARCH_MAX_SHORTCUTS_RETURNED = "search_max_shortcuts_returned";
5191 /**
5192 * The size of the core thread pool for suggestion queries in GlobalSearch.
5193 * @hide
5194 */
5195 public static final String SEARCH_QUERY_THREAD_CORE_POOL_SIZE =
5196 "search_query_thread_core_pool_size";
5197 /**
5198 * The maximum size of the thread pool for suggestion queries in GlobalSearch.
5199 * @hide
5200 */
5201 public static final String SEARCH_QUERY_THREAD_MAX_POOL_SIZE =
5202 "search_query_thread_max_pool_size";
5203 /**
5204 * The size of the core thread pool for shortcut refreshing in GlobalSearch.
5205 * @hide
5206 */
5207 public static final String SEARCH_SHORTCUT_REFRESH_CORE_POOL_SIZE =
5208 "search_shortcut_refresh_core_pool_size";
5209 /**
5210 * The maximum size of the thread pool for shortcut refreshing in GlobalSearch.
5211 * @hide
5212 */
5213 public static final String SEARCH_SHORTCUT_REFRESH_MAX_POOL_SIZE =
5214 "search_shortcut_refresh_max_pool_size";
5215 /**
5216 * The maximun time that excess threads in the GlobalSeach thread pools will
5217 * wait before terminating.
5218 * @hide
5219 */
5220 public static final String SEARCH_THREAD_KEEPALIVE_SECONDS =
5221 "search_thread_keepalive_seconds";
5222 /**
5223 * The maximum number of concurrent suggestion queries to each source.
5224 * @hide
5225 */
5226 public static final String SEARCH_PER_SOURCE_CONCURRENT_QUERY_LIMIT =
5227 "search_per_source_concurrent_query_limit";
5228
San Mehat87734d32010-01-08 12:53:06 -08005229 /**
5230 * Whether or not alert sounds are played on MountService events. (0 = false, 1 = true)
5231 * @hide
5232 */
5233 public static final String MOUNT_PLAY_NOTIFICATION_SND = "mount_play_not_snd";
5234
5235 /**
5236 * Whether or not UMS auto-starts on UMS host detection. (0 = false, 1 = true)
5237 * @hide
5238 */
5239 public static final String MOUNT_UMS_AUTOSTART = "mount_ums_autostart";
5240
5241 /**
5242 * Whether or not a notification is displayed on UMS host detection. (0 = false, 1 = true)
5243 * @hide
5244 */
5245 public static final String MOUNT_UMS_PROMPT = "mount_ums_prompt";
5246
5247 /**
5248 * Whether or not a notification is displayed while UMS is enabled. (0 = false, 1 = true)
5249 * @hide
5250 */
5251 public static final String MOUNT_UMS_NOTIFY_ENABLED = "mount_ums_notify_enabled";
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08005252
Dan Egnor42471dd2010-01-07 17:25:22 -08005253 /**
5254 * If nonzero, ANRs in invisible background processes bring up a dialog.
5255 * Otherwise, the process will be silently killed.
5256 * @hide
5257 */
5258 public static final String ANR_SHOW_BACKGROUND = "anr_show_background";
Erikeebc8e22010-02-18 13:27:19 -08005259
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08005260 /**
5261 * The {@link ComponentName} string of the service to be used as the voice recognition
5262 * service.
Erikeebc8e22010-02-18 13:27:19 -08005263 *
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08005264 * @hide
5265 */
5266 public static final String VOICE_RECOGNITION_SERVICE = "voice_recognition_service";
Dan Egnor42471dd2010-01-07 17:25:22 -08005267
William Luh623a4282013-06-24 12:14:18 -07005268 /**
5269 * Stores whether an user has consented to have apps verified through PAM.
5270 * The value is boolean (1 or 0).
5271 *
5272 * @hide
5273 */
5274 public static final String PACKAGE_VERIFIER_USER_CONSENT =
5275 "package_verifier_user_consent";
satok988323c2011-06-22 16:38:13 +09005276
5277 /**
satokada8c4e2011-08-23 14:56:56 +09005278 * The {@link ComponentName} string of the selected spell checker service which is
5279 * one of the services managed by the text service manager.
5280 *
5281 * @hide
5282 */
5283 public static final String SELECTED_SPELL_CHECKER = "selected_spell_checker";
5284
5285 /**
5286 * The {@link ComponentName} string of the selected subtype of the selected spell checker
satok988323c2011-06-22 16:38:13 +09005287 * service which is one of the services managed by the text service manager.
5288 *
5289 * @hide
5290 */
satokada8c4e2011-08-23 14:56:56 +09005291 public static final String SELECTED_SPELL_CHECKER_SUBTYPE =
5292 "selected_spell_checker_subtype";
satok988323c2011-06-22 16:38:13 +09005293
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08005294 /**
satoka33c4fc2011-08-25 16:50:11 +09005295 * The {@link ComponentName} string whether spell checker is enabled or not.
5296 *
5297 * @hide
5298 */
5299 public static final String SPELL_CHECKER_ENABLED = "spell_checker_enabled";
5300
5301 /**
David Brown458e8062010-03-08 21:52:11 -08005302 * What happens when the user presses the Power button while in-call
5303 * and the screen is on.<br/>
5304 * <b>Values:</b><br/>
5305 * 1 - The Power button turns off the screen and locks the device. (Default behavior)<br/>
5306 * 2 - The Power button hangs up the current call.<br/>
5307 *
5308 * @hide
5309 */
5310 public static final String INCALL_POWER_BUTTON_BEHAVIOR = "incall_power_button_behavior";
5311
5312 /**
5313 * INCALL_POWER_BUTTON_BEHAVIOR value for "turn off screen".
5314 * @hide
5315 */
5316 public static final int INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF = 0x1;
5317
5318 /**
5319 * INCALL_POWER_BUTTON_BEHAVIOR value for "hang up".
5320 * @hide
5321 */
5322 public static final int INCALL_POWER_BUTTON_BEHAVIOR_HANGUP = 0x2;
5323
5324 /**
5325 * INCALL_POWER_BUTTON_BEHAVIOR default value.
5326 * @hide
5327 */
5328 public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT =
5329 INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF;
5330
5331 /**
Jeff Browna20dda42014-05-27 20:57:24 -07005332 * Whether the device should wake when the wake gesture sensor detects motion.
5333 * @hide
5334 */
5335 public static final String WAKE_GESTURE_ENABLED = "wake_gesture_enabled";
5336
5337 /**
John Spurlocka4215ce2014-08-04 14:50:38 -04005338 * Whether the device should doze if configured.
5339 * @hide
5340 */
5341 public static final String DOZE_ENABLED = "doze_enabled";
5342
5343 /**
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07005344 * The current night mode that has been selected by the user. Owned
5345 * and controlled by UiModeManagerService. Constants are as per
5346 * UiModeManager.
5347 * @hide
5348 */
5349 public static final String UI_NIGHT_MODE = "ui_night_mode";
Suchi Amalapurapu40e47252010-04-07 16:15:50 -07005350
5351 /**
John Spurlock1a868b72012-08-22 09:56:51 -04005352 * Whether screensavers are enabled.
Daniel Sandler0601eb72011-04-13 01:01:32 -04005353 * @hide
5354 */
Daniel Sandler2d545362011-11-17 10:38:37 -08005355 public static final String SCREENSAVER_ENABLED = "screensaver_enabled";
Daniel Sandler0601eb72011-04-13 01:01:32 -04005356
5357 /**
John Spurlock1a868b72012-08-22 09:56:51 -04005358 * The user's chosen screensaver components.
Daniel Sandler2d545362011-11-17 10:38:37 -08005359 *
John Spurlock1a868b72012-08-22 09:56:51 -04005360 * These will be launched by the PhoneWindowManager after a timeout when not on
Daniel Sandler2d545362011-11-17 10:38:37 -08005361 * battery, or upon dock insertion (if SCREENSAVER_ACTIVATE_ON_DOCK is set to 1).
Daniel Sandler0601eb72011-04-13 01:01:32 -04005362 * @hide
5363 */
John Spurlock1a868b72012-08-22 09:56:51 -04005364 public static final String SCREENSAVER_COMPONENTS = "screensaver_components";
Daniel Sandler2d545362011-11-17 10:38:37 -08005365
5366 /**
John Spurlock1a868b72012-08-22 09:56:51 -04005367 * If screensavers are enabled, whether the screensaver should be automatically launched
5368 * when the device is inserted into a (desk) dock.
Daniel Sandler2d545362011-11-17 10:38:37 -08005369 * @hide
5370 */
5371 public static final String SCREENSAVER_ACTIVATE_ON_DOCK = "screensaver_activate_on_dock";
Daniel Sandler0601eb72011-04-13 01:01:32 -04005372
John Spurlock1a868b72012-08-22 09:56:51 -04005373 /**
5374 * If screensavers are enabled, whether the screensaver should be automatically launched
5375 * when the screen times out when not on battery.
5376 * @hide
5377 */
5378 public static final String SCREENSAVER_ACTIVATE_ON_SLEEP = "screensaver_activate_on_sleep";
5379
5380 /**
5381 * If screensavers are enabled, the default screensaver component.
5382 * @hide
5383 */
5384 public static final String SCREENSAVER_DEFAULT_COMPONENT = "screensaver_default_component";
5385
Daniel Sandler0601eb72011-04-13 01:01:32 -04005386 /**
Martijn Coenena7397882013-07-30 20:07:47 -07005387 * The default NFC payment component
5388 * @hide
5389 */
5390 public static final String NFC_PAYMENT_DEFAULT_COMPONENT = "nfc_payment_default_component";
5391
5392 /**
Martijn Coenen2f6f3a012014-04-25 17:00:21 -07005393 * Whether NFC payment is handled by the foreground application or a default.
5394 * @hide
5395 */
5396 public static final String NFC_PAYMENT_FOREGROUND = "nfc_payment_foreground";
5397
5398 /**
David Braunf5d83192013-09-16 13:43:51 -07005399 * Specifies the package name currently configured to be the primary sms application
5400 * @hide
5401 */
5402 public static final String SMS_DEFAULT_APPLICATION = "sms_default_application";
5403
5404 /**
Yorke Lee014de022015-04-21 17:15:47 -07005405 * Specifies the package name currently configured to be the default dialer application
5406 * @hide
5407 */
5408 public static final String DIALER_DEFAULT_APPLICATION = "dialer_default_application";
5409
5410 /**
Adrian Roos943eb862015-03-26 12:31:16 -07005411 * Specifies the package name currently configured to be the emergency assistance application
5412 *
5413 * @see android.telephony.TelephonyManager#ACTION_EMERGENCY_ASSISTANCE
5414 *
5415 * @hide
5416 */
5417 public static final String EMERGENCY_ASSISTANCE_APPLICATION = "emergency_assistance_application";
5418
5419 /**
Jorim Jaggi9d910832015-05-18 17:35:26 -07005420 * Specifies whether the current app context on scren (assist data) will be sent to the
5421 * assist application (active voice interaction service).
5422 *
5423 * @hide
5424 */
5425 public static final String ASSIST_STRUCTURE_ENABLED = "assist_structure_enabled";
5426
5427 /**
Chris Wren8326a8a2014-10-22 14:13:32 -04005428 * Names of the packages that the current user has explicitly allowed to
5429 * see all of the user's notifications, separated by ':'.
Daniel Sandler4b749ef2013-03-18 21:53:04 -04005430 *
5431 * @hide
5432 */
5433 public static final String ENABLED_NOTIFICATION_LISTENERS = "enabled_notification_listeners";
5434
John Spurlock7340fc82014-04-24 18:50:12 -04005435 /**
5436 * @hide
5437 */
5438 public static final String ENABLED_CONDITION_PROVIDERS = "enabled_condition_providers";
5439
John Spurlock5c454122013-06-17 07:35:46 -04005440 /** @hide */
5441 public static final String BAR_SERVICE_COMPONENT = "bar_service_component";
5442
John Spurlockd67ec252013-09-05 11:31:54 -04005443 /** @hide */
John Spurlockcdb57ae2015-02-11 19:04:11 -05005444 public static final String VOLUME_CONTROLLER_SERVICE_COMPONENT
5445 = "volume_controller_service_component";
5446
5447 /** @hide */
John Spurlockf1a36642013-10-12 17:50:42 -04005448 public static final String IMMERSIVE_MODE_CONFIRMATIONS = "immersive_mode_confirmations";
John Spurlockd67ec252013-09-05 11:31:54 -04005449
Yorke Lee647f8f32013-05-07 10:49:44 -07005450 /**
Svetoslavf43e8512013-09-30 17:33:05 -07005451 * This is the query URI for finding a print service to install.
5452 *
5453 * @hide
5454 */
5455 public static final String PRINT_SERVICE_SEARCH_URI = "print_service_search_uri";
5456
5457 /**
5458 * This is the query URI for finding a NFC payment service to install.
5459 *
5460 * @hide
5461 */
5462 public static final String PAYMENT_SERVICE_SEARCH_URI = "payment_service_search_uri";
5463
5464 /**
Amith Yamasani1e9c2182014-06-11 17:25:51 -07005465 * If enabled, apps should try to skip any introductory hints on first launch. This might
Amith Yamasani0c416392014-06-13 15:54:39 -07005466 * apply to users that are already familiar with the environment or temporary users.
Amith Yamasani1e9c2182014-06-11 17:25:51 -07005467 * <p>
5468 * Type : int (0 to show hints, 1 to skip showing hints)
Amith Yamasani1e9c2182014-06-11 17:25:51 -07005469 */
5470 public static final String SKIP_FIRST_USE_HINTS = "skip_first_use_hints";
5471
5472 /**
John Spurlockaa5ee4d2014-07-25 13:05:12 -04005473 * Persisted playback time after a user confirmation of an unsafe volume level.
5474 *
5475 * @hide
5476 */
5477 public static final String UNSAFE_VOLUME_MUSIC_ACTIVE_MS = "unsafe_volume_music_active_ms";
5478
5479 /**
Dan Sandler52e5701e2014-07-22 23:14:54 -04005480 * This preference enables notification display on the lockscreen.
5481 * @hide
5482 */
5483 public static final String LOCK_SCREEN_SHOW_NOTIFICATIONS =
5484 "lock_screen_show_notifications";
5485
5486 /**
Dongwon Kang4d933a02014-08-07 22:51:47 -07005487 * List of TV inputs that are currently hidden. This is a string
Jaewan Kimf0e530e2014-08-22 00:43:31 +09005488 * containing the IDs of all hidden TV inputs. Each ID is encoded by
5489 * {@link android.net.Uri#encode(String)} and separated by ':'.
Dongwon Kang4d933a02014-08-07 22:51:47 -07005490 * @hide
5491 */
5492 public static final String TV_INPUT_HIDDEN_INPUTS = "tv_input_hidden_inputs";
5493
5494 /**
5495 * List of custom TV input labels. This is a string containing <TV input id, custom name>
Jaewan Kimf0e530e2014-08-22 00:43:31 +09005496 * pairs. TV input id and custom name are encoded by {@link android.net.Uri#encode(String)}
5497 * and separated by ','. Each pair is separated by ':'.
Dongwon Kang4d933a02014-08-07 22:51:47 -07005498 * @hide
5499 */
5500 public static final String TV_INPUT_CUSTOM_LABELS = "tv_input_custom_labels";
5501
5502 /**
Glenn Kasten34cc4db2014-08-13 10:56:38 -07005503 * Whether automatic routing of system audio to USB audio peripheral is disabled.
5504 * The value is boolean (1 or 0), where 1 means automatic routing is disabled,
5505 * and 0 means automatic routing is enabled.
5506 *
5507 * @hide
5508 */
5509 public static final String USB_AUDIO_AUTOMATIC_ROUTING_DISABLED =
5510 "usb_audio_automatic_routing_disabled";
5511
5512 /**
Jeff Brown05af6ad2014-09-30 20:54:30 -07005513 * The timeout in milliseconds before the device fully goes to sleep after
5514 * a period of inactivity. This value sets an upper bound on how long the device
5515 * will stay awake or dreaming without user activity. It should generally
Dianne Hackbornad6a99b2014-11-18 10:11:10 -08005516 * be longer than {@link Settings.System#SCREEN_OFF_TIMEOUT} as otherwise the device
Jeff Brown05af6ad2014-09-30 20:54:30 -07005517 * will sleep before it ever has a chance to dream.
5518 * <p>
5519 * Use -1 to disable this timeout.
5520 * </p>
5521 *
5522 * @hide
5523 */
5524 public static final String SLEEP_TIMEOUT = "sleep_timeout";
5525
5526 /**
Amith Yamasanib0ff3222015-03-04 09:56:14 -08005527 * Duration in milliseconds that an app should be inactive before it is considered idle.
5528 * <p/>Type: Long
5529 * @hide
5530 */
5531 public static final String APP_IDLE_DURATION = "app_idle_duration";
5532
5533 /**
Jason Monk27bbb2d2015-03-31 16:46:39 -04005534 * Controls whether double tap to wake is enabled.
5535 * @hide
5536 */
5537 public static final String DOUBLE_TAP_TO_WAKE = "double_tap_to_wake";
5538
5539 /**
Svetoslav Ganova571a582011-09-20 18:32:20 -07005540 * This are the settings to be backed up.
5541 *
5542 * NOTE: Settings are backed up and restored in the order they appear
5543 * in this array. If you have one setting depending on another,
5544 * make sure that they are ordered appropriately.
5545 *
-b master501eec92009-07-06 13:53:11 -07005546 * @hide
5547 */
5548 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate58f41ec2013-01-11 15:40:36 -08005549 BUGREPORT_IN_POWER_MENU, // moved to global
Amith Yamasani8823c0a82009-07-07 14:30:17 -07005550 ALLOW_MOCK_LOCATION,
-b master501eec92009-07-06 13:53:11 -07005551 PARENTAL_CONTROL_ENABLED,
5552 PARENTAL_CONTROL_REDIRECT_URL,
Christopher Tate66488d62012-10-02 11:58:01 -07005553 USB_MASS_STORAGE_ENABLED, // moved to global
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07005554 ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED,
5555 ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE,
5556 ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE,
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07005557 ACCESSIBILITY_SCRIPT_INJECTION,
Christopher Tate14c2d792010-02-25 16:49:44 -08005558 BACKUP_AUTO_RESTORE,
-b master501eec92009-07-06 13:53:11 -07005559 ENABLED_ACCESSIBILITY_SERVICES,
Christopher Tate6597e342015-02-17 12:15:25 -08005560 ENABLED_NOTIFICATION_LISTENERS,
Christopher Tate7b9a28c2015-03-18 13:06:16 -07005561 ENABLED_INPUT_METHODS,
Svetoslav Ganov9a4c5cd2012-05-30 14:06:32 -07005562 TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES,
Svetoslav Ganova28a16d2011-07-28 11:24:21 -07005563 TOUCH_EXPLORATION_ENABLED,
Svetoslav Ganova571a582011-09-20 18:32:20 -07005564 ACCESSIBILITY_ENABLED,
Svetoslav Ganov55f937a2011-12-05 11:42:07 -08005565 ACCESSIBILITY_SPEAK_PASSWORD,
Chris Craikcce47eb2014-07-16 15:12:15 -07005566 ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED,
Alan Viveretteef793802013-07-23 14:15:28 -07005567 ACCESSIBILITY_CAPTIONING_ENABLED,
5568 ACCESSIBILITY_CAPTIONING_LOCALE,
5569 ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR,
5570 ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR,
5571 ACCESSIBILITY_CAPTIONING_EDGE_TYPE,
5572 ACCESSIBILITY_CAPTIONING_EDGE_COLOR,
5573 ACCESSIBILITY_CAPTIONING_TYPEFACE,
Alan Viverette69ce69b2013-08-29 12:23:48 -07005574 ACCESSIBILITY_CAPTIONING_FONT_SCALE,
-b master501eec92009-07-06 13:53:11 -07005575 TTS_USE_DEFAULTS,
5576 TTS_DEFAULT_RATE,
5577 TTS_DEFAULT_PITCH,
5578 TTS_DEFAULT_SYNTH,
5579 TTS_DEFAULT_LANG,
5580 TTS_DEFAULT_COUNTRY,
Charles Chenceffa152010-03-16 21:18:10 -07005581 TTS_ENABLED_PLUGINS,
Narayan Kamath6d632962011-08-24 11:51:37 +01005582 TTS_DEFAULT_LOCALE,
Christopher Tate66488d62012-10-02 11:58:01 -07005583 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, // moved to global
5584 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, // moved to global
5585 WIFI_NUM_OPEN_NETWORKS_KEPT, // moved to global
Christopher Tate06cbadd2015-03-16 18:29:42 -07005586 SELECTED_SPELL_CHECKER,
5587 SELECTED_SPELL_CHECKER_SUBTYPE,
5588 SPELL_CHECKER_ENABLED,
San Mehat87734d32010-01-08 12:53:06 -08005589 MOUNT_PLAY_NOTIFICATION_SND,
5590 MOUNT_UMS_AUTOSTART,
5591 MOUNT_UMS_PROMPT,
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07005592 MOUNT_UMS_NOTIFY_ENABLED,
Jeff Brown05af6ad2014-09-30 20:54:30 -07005593 UI_NIGHT_MODE,
Jason Monk27bbb2d2015-03-31 16:46:39 -04005594 SLEEP_TIMEOUT,
5595 DOUBLE_TAP_TO_WAKE,
-b master501eec92009-07-06 13:53:11 -07005596 };
5597
5598 /**
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07005599 * These entries are considered common between the personal and the managed profile,
5600 * since the managed profile doesn't get to change them.
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07005601 */
Svetoslav683914b2015-01-15 14:22:26 -08005602 private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>();
Amith Yamasanib0ff3222015-03-04 09:56:14 -08005603
Svetoslav683914b2015-01-15 14:22:26 -08005604 static {
5605 CLONE_TO_MANAGED_PROFILE.add(ACCESSIBILITY_ENABLED);
5606 CLONE_TO_MANAGED_PROFILE.add(ALLOW_MOCK_LOCATION);
5607 CLONE_TO_MANAGED_PROFILE.add(ALLOWED_GEOLOCATION_ORIGINS);
5608 CLONE_TO_MANAGED_PROFILE.add(DEFAULT_INPUT_METHOD);
5609 CLONE_TO_MANAGED_PROFILE.add(ENABLED_ACCESSIBILITY_SERVICES);
5610 CLONE_TO_MANAGED_PROFILE.add(ENABLED_INPUT_METHODS);
5611 CLONE_TO_MANAGED_PROFILE.add(LOCATION_MODE);
5612 CLONE_TO_MANAGED_PROFILE.add(LOCATION_PROVIDERS_ALLOWED);
5613 CLONE_TO_MANAGED_PROFILE.add(LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS);
5614 CLONE_TO_MANAGED_PROFILE.add(SELECTED_INPUT_METHOD_SUBTYPE);
5615 CLONE_TO_MANAGED_PROFILE.add(SELECTED_SPELL_CHECKER);
5616 CLONE_TO_MANAGED_PROFILE.add(SELECTED_SPELL_CHECKER_SUBTYPE);
5617 }
5618
5619 /** @hide */
5620 public static void getCloneToManagedProfileSettings(Set<String> outKeySet) {
5621 outKeySet.addAll(CLONE_TO_MANAGED_PROFILE);
5622 }
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07005623
5624 /**
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005625 * Helper method for determining if a location provider is enabled.
Tom O'Neilld5759432013-09-11 11:03:03 -07005626 *
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005627 * @param cr the content resolver to use
5628 * @param provider the location provider to query
5629 * @return true if the provider is enabled
Tom O'Neilld5759432013-09-11 11:03:03 -07005630 *
5631 * @deprecated use {@link #LOCATION_MODE} or
5632 * {@link LocationManager#isProviderEnabled(String)}
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005633 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07005634 @Deprecated
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005635 public static final boolean isLocationProviderEnabled(ContentResolver cr, String provider) {
Victoria Leaseb711d572012-10-02 13:14:11 -07005636 return isLocationProviderEnabledForUser(cr, provider, UserHandle.myUserId());
5637 }
5638
5639 /**
5640 * Helper method for determining if a location provider is enabled.
5641 * @param cr the content resolver to use
5642 * @param provider the location provider to query
5643 * @param userId the userId to query
5644 * @return true if the provider is enabled
Tom O'Neilld5759432013-09-11 11:03:03 -07005645 * @deprecated use {@link #LOCATION_MODE} or
5646 * {@link LocationManager#isProviderEnabled(String)}
Victoria Leaseb711d572012-10-02 13:14:11 -07005647 * @hide
5648 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07005649 @Deprecated
Victoria Leaseb711d572012-10-02 13:14:11 -07005650 public static final boolean isLocationProviderEnabledForUser(ContentResolver cr, String provider, int userId) {
5651 String allowedProviders = Settings.Secure.getStringForUser(cr,
5652 LOCATION_PROVIDERS_ALLOWED, userId);
Brad Fitzpatrick11fe1812010-09-10 16:07:52 -07005653 return TextUtils.delimitedStringContains(allowedProviders, ',', provider);
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005654 }
5655
5656 /**
5657 * Thread-safe method for enabling or disabling a single location provider.
5658 * @param cr the content resolver to use
5659 * @param provider the location provider to enable or disable
5660 * @param enabled true if the provider should be enabled
Tom O'Neilla324ac72013-08-26 14:40:23 -07005661 * @deprecated use {@link #putInt(ContentResolver, String, int)} and {@link #LOCATION_MODE}
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005662 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07005663 @Deprecated
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005664 public static final void setLocationProviderEnabled(ContentResolver cr,
5665 String provider, boolean enabled) {
Victoria Leaseb711d572012-10-02 13:14:11 -07005666 setLocationProviderEnabledForUser(cr, provider, enabled, UserHandle.myUserId());
5667 }
5668
5669 /**
5670 * Thread-safe method for enabling or disabling a single location provider.
Tom O'Neilla324ac72013-08-26 14:40:23 -07005671 *
Victoria Leaseb711d572012-10-02 13:14:11 -07005672 * @param cr the content resolver to use
5673 * @param provider the location provider to enable or disable
5674 * @param enabled true if the provider should be enabled
5675 * @param userId the userId for which to enable/disable providers
Tom O'Neilla324ac72013-08-26 14:40:23 -07005676 * @return true if the value was set, false on database errors
5677 * @deprecated use {@link #putIntForUser(ContentResolver, String, int, int)} and
5678 * {@link #LOCATION_MODE}
Victoria Leaseb711d572012-10-02 13:14:11 -07005679 * @hide
5680 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07005681 @Deprecated
Tom O'Neilla324ac72013-08-26 14:40:23 -07005682 public static final boolean setLocationProviderEnabledForUser(ContentResolver cr,
Victoria Leaseb711d572012-10-02 13:14:11 -07005683 String provider, boolean enabled, int userId) {
David Christie3f7b6522013-08-06 19:19:08 -07005684 synchronized (mLocationSettingsLock) {
5685 // to ensure thread safety, we write the provider name with a '+' or '-'
5686 // and let the SettingsProvider handle it rather than reading and modifying
5687 // the list of enabled providers.
5688 if (enabled) {
5689 provider = "+" + provider;
5690 } else {
5691 provider = "-" + provider;
5692 }
Tom O'Neilla324ac72013-08-26 14:40:23 -07005693 return putStringForUser(cr, Settings.Secure.LOCATION_PROVIDERS_ALLOWED, provider,
David Christie3f7b6522013-08-06 19:19:08 -07005694 userId);
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005695 }
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005696 }
Tom O'Neill1f48b782013-08-19 18:14:56 -07005697
5698 /**
5699 * Thread-safe method for setting the location mode to one of
5700 * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY},
5701 * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}.
5702 *
Tom O'Neill1f48b782013-08-19 18:14:56 -07005703 * @param cr the content resolver to use
5704 * @param mode such as {@link #LOCATION_MODE_HIGH_ACCURACY}
5705 * @param userId the userId for which to change mode
Tom O'Neilla324ac72013-08-26 14:40:23 -07005706 * @return true if the value was set, false on database errors
Tom O'Neill1f48b782013-08-19 18:14:56 -07005707 *
5708 * @throws IllegalArgumentException if mode is not one of the supported values
5709 */
Tom O'Neill7f6f4572013-08-27 10:53:15 -07005710 private static final boolean setLocationModeForUser(ContentResolver cr, int mode,
5711 int userId) {
Tom O'Neill1f48b782013-08-19 18:14:56 -07005712 synchronized (mLocationSettingsLock) {
5713 boolean gps = false;
5714 boolean network = false;
5715 switch (mode) {
5716 case LOCATION_MODE_OFF:
5717 break;
5718 case LOCATION_MODE_SENSORS_ONLY:
5719 gps = true;
5720 break;
5721 case LOCATION_MODE_BATTERY_SAVING:
5722 network = true;
5723 break;
5724 case LOCATION_MODE_HIGH_ACCURACY:
5725 gps = true;
5726 network = true;
5727 break;
5728 default:
5729 throw new IllegalArgumentException("Invalid location mode: " + mode);
5730 }
Tom O'Neill7731a992014-10-09 11:30:49 -07005731 // Note it's important that we set the NLP mode first. The Google implementation
5732 // of NLP clears its NLP consent setting any time it receives a
5733 // LocationManager.PROVIDERS_CHANGED_ACTION broadcast and NLP is disabled. Also,
5734 // it shows an NLP consent dialog any time it receives the broadcast, NLP is
5735 // enabled, and the NLP consent is not set. If 1) we were to enable GPS first,
5736 // 2) a setup wizard has its own NLP consent UI that sets the NLP consent setting,
5737 // and 3) the receiver happened to complete before we enabled NLP, then the Google
5738 // NLP would detect the attempt to enable NLP and show a redundant NLP consent
5739 // dialog. Then the people who wrote the setup wizard would be sad.
Tom O'Neilla324ac72013-08-26 14:40:23 -07005740 boolean nlpSuccess = Settings.Secure.setLocationProviderEnabledForUser(
Tom O'Neill1f48b782013-08-19 18:14:56 -07005741 cr, LocationManager.NETWORK_PROVIDER, network, userId);
Tom O'Neill7731a992014-10-09 11:30:49 -07005742 boolean gpsSuccess = Settings.Secure.setLocationProviderEnabledForUser(
5743 cr, LocationManager.GPS_PROVIDER, gps, userId);
Tom O'Neilla324ac72013-08-26 14:40:23 -07005744 return gpsSuccess && nlpSuccess;
Tom O'Neill1f48b782013-08-19 18:14:56 -07005745 }
5746 }
5747
5748 /**
Tom O'Neill1f48b782013-08-19 18:14:56 -07005749 * Thread-safe method for reading the location mode, returns one of
5750 * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY},
5751 * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}.
5752 *
5753 * @param cr the content resolver to use
5754 * @param userId the userId for which to read the mode
5755 * @return the location mode
5756 */
Tom O'Neill7f6f4572013-08-27 10:53:15 -07005757 private static final int getLocationModeForUser(ContentResolver cr, int userId) {
Tom O'Neill1f48b782013-08-19 18:14:56 -07005758 synchronized (mLocationSettingsLock) {
5759 boolean gpsEnabled = Settings.Secure.isLocationProviderEnabledForUser(
5760 cr, LocationManager.GPS_PROVIDER, userId);
5761 boolean networkEnabled = Settings.Secure.isLocationProviderEnabledForUser(
5762 cr, LocationManager.NETWORK_PROVIDER, userId);
5763 if (gpsEnabled && networkEnabled) {
5764 return LOCATION_MODE_HIGH_ACCURACY;
5765 } else if (gpsEnabled) {
5766 return LOCATION_MODE_SENSORS_ONLY;
5767 } else if (networkEnabled) {
5768 return LOCATION_MODE_BATTERY_SAVING;
5769 } else {
5770 return LOCATION_MODE_OFF;
5771 }
5772 }
5773 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005774 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005775
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005776 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005777 * Global system settings, containing preferences that always apply identically
5778 * to all defined users. Applications can read these but are not allowed to write;
5779 * like the "Secure" settings, these are for preferences that the user must
5780 * explicitly modify through the system UI or specialized APIs for those values.
5781 */
5782 public static final class Global extends NameValueTable {
5783 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_global_version";
5784
5785 /**
5786 * The content:// style URL for global secure settings items. Not public.
5787 */
5788 public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/global");
5789
5790 /**
Amith Yamasani23a0f052014-07-25 12:26:53 -07005791 * Whether users are allowed to add more users or guest from lockscreen.
5792 * <p>
5793 * Type: int
5794 * @hide
5795 */
5796 public static final String ADD_USERS_WHEN_LOCKED = "add_users_when_locked";
5797
5798 /**
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07005799 * Setting whether the global gesture for enabling accessibility is enabled.
5800 * If this gesture is enabled the user will be able to perfrom it to enable
5801 * the accessibility state without visiting the settings app.
5802 * @hide
5803 */
5804 public static final String ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED =
5805 "enable_accessibility_global_gesture_enabled";
5806
5807 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005808 * Whether Airplane Mode is on.
5809 */
5810 public static final String AIRPLANE_MODE_ON = "airplane_mode_on";
5811
5812 /**
Bryce Lee584a4452014-10-21 15:55:55 -07005813 * Whether Theater Mode is on.
5814 * {@hide}
5815 */
Bryce Leecdfebd62015-02-02 08:19:11 -08005816 @SystemApi
Bryce Lee584a4452014-10-21 15:55:55 -07005817 public static final String THEATER_MODE_ON = "theater_mode_on";
5818
5819 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005820 * Constant for use in AIRPLANE_MODE_RADIOS to specify Bluetooth radio.
5821 */
5822 public static final String RADIO_BLUETOOTH = "bluetooth";
5823
5824 /**
5825 * Constant for use in AIRPLANE_MODE_RADIOS to specify Wi-Fi radio.
5826 */
5827 public static final String RADIO_WIFI = "wifi";
5828
5829 /**
5830 * {@hide}
5831 */
5832 public static final String RADIO_WIMAX = "wimax";
5833 /**
5834 * Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio.
5835 */
5836 public static final String RADIO_CELL = "cell";
5837
5838 /**
5839 * Constant for use in AIRPLANE_MODE_RADIOS to specify NFC radio.
5840 */
5841 public static final String RADIO_NFC = "nfc";
5842
5843 /**
5844 * A comma separated list of radios that need to be disabled when airplane mode
5845 * is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are
5846 * included in the comma separated list.
5847 */
5848 public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios";
5849
5850 /**
5851 * A comma separated list of radios that should to be disabled when airplane mode
5852 * is on, but can be manually reenabled by the user. For example, if RADIO_WIFI is
5853 * added to both AIRPLANE_MODE_RADIOS and AIRPLANE_MODE_TOGGLEABLE_RADIOS, then Wifi
5854 * will be turned off when entering airplane mode, but the user will be able to reenable
5855 * Wifi in the Settings app.
5856 *
5857 * {@hide}
5858 */
5859 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios";
5860
5861 /**
5862 * The policy for deciding when Wi-Fi should go to sleep (which will in
5863 * turn switch to using the mobile data as an Internet connection).
5864 * <p>
5865 * Set to one of {@link #WIFI_SLEEP_POLICY_DEFAULT},
5866 * {@link #WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED}, or
5867 * {@link #WIFI_SLEEP_POLICY_NEVER}.
5868 */
5869 public static final String WIFI_SLEEP_POLICY = "wifi_sleep_policy";
5870
5871 /**
5872 * Value for {@link #WIFI_SLEEP_POLICY} to use the default Wi-Fi sleep
5873 * policy, which is to sleep shortly after the turning off
5874 * according to the {@link #STAY_ON_WHILE_PLUGGED_IN} setting.
5875 */
5876 public static final int WIFI_SLEEP_POLICY_DEFAULT = 0;
5877
5878 /**
5879 * Value for {@link #WIFI_SLEEP_POLICY} to use the default policy when
5880 * the device is on battery, and never go to sleep when the device is
5881 * plugged in.
5882 */
5883 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1;
5884
5885 /**
5886 * Value for {@link #WIFI_SLEEP_POLICY} to never go to sleep.
5887 */
5888 public static final int WIFI_SLEEP_POLICY_NEVER = 2;
5889
5890 /**
5891 * Value to specify if the user prefers the date, time and time zone
5892 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
5893 */
5894 public static final String AUTO_TIME = "auto_time";
5895
5896 /**
5897 * Value to specify if the user prefers the time zone
5898 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
5899 */
5900 public static final String AUTO_TIME_ZONE = "auto_time_zone";
5901
5902 /**
5903 * URI for the car dock "in" event sound.
5904 * @hide
5905 */
5906 public static final String CAR_DOCK_SOUND = "car_dock_sound";
5907
5908 /**
5909 * URI for the car dock "out" event sound.
5910 * @hide
5911 */
5912 public static final String CAR_UNDOCK_SOUND = "car_undock_sound";
5913
5914 /**
5915 * URI for the desk dock "in" event sound.
5916 * @hide
5917 */
5918 public static final String DESK_DOCK_SOUND = "desk_dock_sound";
5919
5920 /**
5921 * URI for the desk dock "out" event sound.
5922 * @hide
5923 */
5924 public static final String DESK_UNDOCK_SOUND = "desk_undock_sound";
5925
5926 /**
5927 * Whether to play a sound for dock events.
5928 * @hide
5929 */
5930 public static final String DOCK_SOUNDS_ENABLED = "dock_sounds_enabled";
5931
5932 /**
5933 * URI for the "device locked" (keyguard shown) sound.
5934 * @hide
5935 */
5936 public static final String LOCK_SOUND = "lock_sound";
5937
5938 /**
5939 * URI for the "device unlocked" sound.
5940 * @hide
5941 */
5942 public static final String UNLOCK_SOUND = "unlock_sound";
5943
5944 /**
Adrian Roos49e057d2014-08-13 17:14:51 +02005945 * URI for the "device is trusted" sound, which is played when the device enters the trusted
5946 * state without unlocking.
5947 * @hide
5948 */
5949 public static final String TRUSTED_SOUND = "trusted_sound";
5950
5951 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005952 * URI for the low battery sound file.
5953 * @hide
5954 */
5955 public static final String LOW_BATTERY_SOUND = "low_battery_sound";
5956
5957 /**
5958 * Whether to play a sound for low-battery alerts.
5959 * @hide
5960 */
5961 public static final String POWER_SOUNDS_ENABLED = "power_sounds_enabled";
5962
5963 /**
Jeff Brown84e27562012-12-07 13:56:34 -08005964 * URI for the "wireless charging started" sound.
5965 * @hide
5966 */
5967 public static final String WIRELESS_CHARGING_STARTED_SOUND =
5968 "wireless_charging_started_sound";
5969
5970 /**
John Spurlock51a871d2015-05-06 17:41:30 -04005971 * Whether to play a sound for charging events.
5972 * @hide
5973 */
5974 public static final String CHARGING_SOUNDS_ENABLED = "charging_sounds_enabled";
5975
5976 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005977 * Whether we keep the device on while the device is plugged in.
5978 * Supported values are:
5979 * <ul>
5980 * <li>{@code 0} to never stay on while plugged in</li>
5981 * <li>{@link BatteryManager#BATTERY_PLUGGED_AC} to stay on for AC charger</li>
5982 * <li>{@link BatteryManager#BATTERY_PLUGGED_USB} to stay on for USB charger</li>
5983 * <li>{@link BatteryManager#BATTERY_PLUGGED_WIRELESS} to stay on for wireless charger</li>
5984 * </ul>
5985 * These values can be OR-ed together.
5986 */
5987 public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in";
5988
5989 /**
Christopher Tate58f41ec2013-01-11 15:40:36 -08005990 * When the user has enable the option to have a "bug report" command
5991 * in the power menu.
5992 * @hide
5993 */
5994 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
5995
5996 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005997 * Whether ADB is enabled.
5998 */
5999 public static final String ADB_ENABLED = "adb_enabled";
6000
6001 /**
Jon Miranda836c0a82014-08-11 12:32:26 -07006002 * Whether Views are allowed to save their attribute data.
6003 * @hide
6004 */
6005 public static final String DEBUG_VIEW_ATTRIBUTES = "debug_view_attributes";
6006
6007 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006008 * Whether assisted GPS should be enabled or not.
6009 * @hide
6010 */
6011 public static final String ASSISTED_GPS_ENABLED = "assisted_gps_enabled";
6012
6013 /**
6014 * Whether bluetooth is enabled/disabled
6015 * 0=disabled. 1=enabled.
6016 */
6017 public static final String BLUETOOTH_ON = "bluetooth_on";
6018
6019 /**
6020 * CDMA Cell Broadcast SMS
6021 * 0 = CDMA Cell Broadcast SMS disabled
6022 * 1 = CDMA Cell Broadcast SMS enabled
6023 * @hide
6024 */
6025 public static final String CDMA_CELL_BROADCAST_SMS =
6026 "cdma_cell_broadcast_sms";
6027
6028 /**
6029 * The CDMA roaming mode 0 = Home Networks, CDMA default
6030 * 1 = Roaming on Affiliated networks
6031 * 2 = Roaming on any networks
6032 * @hide
6033 */
6034 public static final String CDMA_ROAMING_MODE = "roaming_settings";
6035
6036 /**
6037 * The CDMA subscription mode 0 = RUIM/SIM (default)
6038 * 1 = NV
6039 * @hide
6040 */
6041 public static final String CDMA_SUBSCRIPTION_MODE = "subscription_mode";
6042
6043 /** Inactivity timeout to track mobile data activity.
6044 *
6045 * If set to a positive integer, it indicates the inactivity timeout value in seconds to
6046 * infer the data activity of mobile network. After a period of no activity on mobile
6047 * networks with length specified by the timeout, an {@code ACTION_DATA_ACTIVITY_CHANGE}
6048 * intent is fired to indicate a transition of network status from "active" to "idle". Any
6049 * subsequent activity on mobile networks triggers the firing of {@code
6050 * ACTION_DATA_ACTIVITY_CHANGE} intent indicating transition from "idle" to "active".
6051 *
6052 * Network activity refers to transmitting or receiving data on the network interfaces.
6053 *
6054 * Tracking is disabled if set to zero or negative value.
6055 *
6056 * @hide
6057 */
6058 public static final String DATA_ACTIVITY_TIMEOUT_MOBILE = "data_activity_timeout_mobile";
6059
6060 /** Timeout to tracking Wifi data activity. Same as {@code DATA_ACTIVITY_TIMEOUT_MOBILE}
6061 * but for Wifi network.
6062 * @hide
6063 */
6064 public static final String DATA_ACTIVITY_TIMEOUT_WIFI = "data_activity_timeout_wifi";
6065
6066 /**
6067 * Whether or not data roaming is enabled. (0 = false, 1 = true)
6068 */
6069 public static final String DATA_ROAMING = "data_roaming";
6070
6071 /**
Wink Saville75c1e692013-03-20 17:06:50 -07006072 * The value passed to a Mobile DataConnection via bringUp which defines the
6073 * number of retries to preform when setting up the initial connection. The default
6074 * value defined in DataConnectionTrackerBase#DEFAULT_MDC_INITIAL_RETRY is currently 1.
6075 * @hide
6076 */
6077 public static final String MDC_INITIAL_MAX_RETRY = "mdc_initial_max_retry";
6078
6079 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006080 * Whether user has enabled development settings.
6081 */
6082 public static final String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled";
6083
6084 /**
6085 * Whether the device has been provisioned (0 = false, 1 = true)
6086 */
6087 public static final String DEVICE_PROVISIONED = "device_provisioned";
6088
6089 /**
6090 * The saved value for WindowManagerService.setForcedDisplayDensity().
6091 * One integer in dpi. If unset, then use the real display density.
6092 * @hide
6093 */
6094 public static final String DISPLAY_DENSITY_FORCED = "display_density_forced";
6095
6096 /**
6097 * The saved value for WindowManagerService.setForcedDisplaySize().
6098 * Two integers separated by a comma. If unset, then use the real display size.
6099 * @hide
6100 */
6101 public static final String DISPLAY_SIZE_FORCED = "display_size_forced";
6102
6103 /**
Jeff Brownd46747a2015-04-15 19:02:36 -07006104 * The saved value for WindowManagerService.setForcedDisplayScalingMode().
6105 * 0 or unset if scaling is automatic, 1 if scaling is disabled.
6106 * @hide
6107 */
6108 public static final String DISPLAY_SCALING_FORCE = "display_scaling_force";
6109
6110 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006111 * The maximum size, in bytes, of a download that the download manager will transfer over
6112 * a non-wifi connection.
6113 * @hide
6114 */
6115 public static final String DOWNLOAD_MAX_BYTES_OVER_MOBILE =
6116 "download_manager_max_bytes_over_mobile";
6117
6118 /**
6119 * The recommended maximum size, in bytes, of a download that the download manager should
6120 * transfer over a non-wifi connection. Over this size, the use will be warned, but will
6121 * have the option to start the download over the mobile connection anyway.
6122 * @hide
6123 */
6124 public static final String DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE =
6125 "download_manager_recommended_max_bytes_over_mobile";
6126
6127 /**
Christopher Tateaa036a22014-05-19 16:33:27 -07006128 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
Christopher Tate06efb532012-08-24 15:29:27 -07006129 */
Christopher Tateaa036a22014-05-19 16:33:27 -07006130 @Deprecated
6131 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
Christopher Tate06efb532012-08-24 15:29:27 -07006132
6133 /**
Jinsuk Kimb3d91772014-07-10 12:48:54 +09006134 * Whether HDMI control shall be enabled. If disabled, no CEC/MHL command will be
6135 * sent or processed. (0 = false, 1 = true)
6136 * @hide
6137 */
6138 public static final String HDMI_CONTROL_ENABLED = "hdmi_control_enabled";
6139
6140 /**
6141 * Whether HDMI system audio is enabled. If enabled, TV internal speaker is muted,
6142 * and the output is redirected to AV Receiver connected via
6143 * {@Global#HDMI_SYSTEM_AUDIO_OUTPUT}.
6144 * @hide
6145 */
6146 public static final String HDMI_SYSTEM_AUDIO_ENABLED = "hdmi_system_audio_enabled";
6147
6148 /**
Jinsuk Kimb3d91772014-07-10 12:48:54 +09006149 * Whether TV will automatically turn on upon reception of the CEC command
6150 * &lt;Text View On&gt; or &lt;Image View On&gt;. (0 = false, 1 = true)
6151 * @hide
6152 */
6153 public static final String HDMI_CONTROL_AUTO_WAKEUP_ENABLED =
6154 "hdmi_control_auto_wakeup_enabled";
6155
6156 /**
6157 * Whether TV will also turn off other CEC devices when it goes to standby mode.
6158 * (0 = false, 1 = true)
6159 * @hide
6160 */
6161 public static final String HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED =
6162 "hdmi_control_auto_device_off_enabled";
6163
6164 /**
Lorenzo Colitti06d7e532015-03-16 23:46:24 +09006165 * Whether to use the DHCP client from Lollipop and earlier instead of the newer Android DHCP
6166 * client.
6167 * (0 = false, 1 = true)
6168 * @hide
6169 */
6170 public static final String LEGACY_DHCP_CLIENT = "legacy_dhcp_client";
6171
6172 /**
Jinsuk Kimb3d91772014-07-10 12:48:54 +09006173 * Whether TV will switch to MHL port when a mobile device is plugged in.
6174 * (0 = false, 1 = true)
6175 * @hide
6176 */
6177 public static final String MHL_INPUT_SWITCHING_ENABLED = "mhl_input_switching_enabled";
6178
6179 /**
6180 * Whether TV will charge the mobile device connected at MHL port. (0 = false, 1 = true)
6181 * @hide
6182 */
6183 public static final String MHL_POWER_CHARGE_ENABLED = "mhl_power_charge_enabled";
6184
6185 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006186 * Whether mobile data connections are allowed by the user. See
6187 * ConnectivityManager for more info.
6188 * @hide
6189 */
6190 public static final String MOBILE_DATA = "mobile_data";
6191
Erik Klineda4bfa82015-04-30 12:58:40 +09006192 /**
6193 * Whether the mobile data connection should remain active even when higher
6194 * priority networks like WiFi are active, to help make network switching faster.
6195 *
6196 * See ConnectivityService for more info.
6197 *
6198 * (0 = disabled, 1 = enabled)
6199 * @hide
6200 */
6201 public static final String MOBILE_DATA_ALWAYS_ON = "mobile_data_always_on";
6202
Christopher Tate06efb532012-08-24 15:29:27 -07006203 /** {@hide} */
6204 public static final String NETSTATS_ENABLED = "netstats_enabled";
6205 /** {@hide} */
6206 public static final String NETSTATS_POLL_INTERVAL = "netstats_poll_interval";
6207 /** {@hide} */
6208 public static final String NETSTATS_TIME_CACHE_MAX_AGE = "netstats_time_cache_max_age";
6209 /** {@hide} */
6210 public static final String NETSTATS_GLOBAL_ALERT_BYTES = "netstats_global_alert_bytes";
6211 /** {@hide} */
6212 public static final String NETSTATS_SAMPLE_ENABLED = "netstats_sample_enabled";
Christopher Tate06efb532012-08-24 15:29:27 -07006213
6214 /** {@hide} */
6215 public static final String NETSTATS_DEV_BUCKET_DURATION = "netstats_dev_bucket_duration";
6216 /** {@hide} */
6217 public static final String NETSTATS_DEV_PERSIST_BYTES = "netstats_dev_persist_bytes";
6218 /** {@hide} */
6219 public static final String NETSTATS_DEV_ROTATE_AGE = "netstats_dev_rotate_age";
6220 /** {@hide} */
6221 public static final String NETSTATS_DEV_DELETE_AGE = "netstats_dev_delete_age";
6222
6223 /** {@hide} */
6224 public static final String NETSTATS_UID_BUCKET_DURATION = "netstats_uid_bucket_duration";
6225 /** {@hide} */
6226 public static final String NETSTATS_UID_PERSIST_BYTES = "netstats_uid_persist_bytes";
6227 /** {@hide} */
6228 public static final String NETSTATS_UID_ROTATE_AGE = "netstats_uid_rotate_age";
6229 /** {@hide} */
6230 public static final String NETSTATS_UID_DELETE_AGE = "netstats_uid_delete_age";
6231
6232 /** {@hide} */
6233 public static final String NETSTATS_UID_TAG_BUCKET_DURATION = "netstats_uid_tag_bucket_duration";
6234 /** {@hide} */
6235 public static final String NETSTATS_UID_TAG_PERSIST_BYTES = "netstats_uid_tag_persist_bytes";
6236 /** {@hide} */
6237 public static final String NETSTATS_UID_TAG_ROTATE_AGE = "netstats_uid_tag_rotate_age";
6238 /** {@hide} */
6239 public static final String NETSTATS_UID_TAG_DELETE_AGE = "netstats_uid_tag_delete_age";
6240
6241 /**
6242 * User preference for which network(s) should be used. Only the
6243 * connectivity service should touch this.
6244 */
6245 public static final String NETWORK_PREFERENCE = "network_preference";
6246
6247 /**
Jeff Davidsondd6fd1e2014-04-14 15:14:30 -07006248 * Which package name to use for network scoring. If null, or if the package is not a valid
6249 * scorer app, external network scores will neither be requested nor accepted.
6250 * @hide
6251 */
6252 public static final String NETWORK_SCORER_APP = "network_scorer_app";
6253
6254 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006255 * If the NITZ_UPDATE_DIFF time is exceeded then an automatic adjustment
6256 * to SystemClock will be allowed even if NITZ_UPDATE_SPACING has not been
6257 * exceeded.
6258 * @hide
6259 */
6260 public static final String NITZ_UPDATE_DIFF = "nitz_update_diff";
6261
6262 /**
6263 * The length of time in milli-seconds that automatic small adjustments to
6264 * SystemClock are ignored if NITZ_UPDATE_DIFF is not exceeded.
6265 * @hide
6266 */
6267 public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing";
6268
6269 /** Preferred NTP server. {@hide} */
6270 public static final String NTP_SERVER = "ntp_server";
6271 /** Timeout in milliseconds to wait for NTP server. {@hide} */
6272 public static final String NTP_TIMEOUT = "ntp_timeout";
6273
6274 /**
rich cannings4d8fc792012-09-07 14:43:43 -07006275 * Whether the package manager should send package verification broadcasts for verifiers to
6276 * review apps prior to installation.
6277 * 1 = request apps to be verified prior to installation, if a verifier exists.
6278 * 0 = do not verify apps before installation
rich cannings4e5753f2012-09-19 16:03:56 -07006279 * @hide
rich cannings4d8fc792012-09-07 14:43:43 -07006280 */
6281 public static final String PACKAGE_VERIFIER_ENABLE = "package_verifier_enable";
6282
6283 /** Timeout for package verification.
rich cannings4e5753f2012-09-19 16:03:56 -07006284 * @hide */
rich cannings4d8fc792012-09-07 14:43:43 -07006285 public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout";
6286
6287 /** Default response code for package verification.
rich cannings4e5753f2012-09-19 16:03:56 -07006288 * @hide */
rich cannings4d8fc792012-09-07 14:43:43 -07006289 public static final String PACKAGE_VERIFIER_DEFAULT_RESPONSE = "verifier_default_response";
6290
rich cannings4e5753f2012-09-19 16:03:56 -07006291 /**
6292 * Show package verification setting in the Settings app.
rich canningse6686b32012-09-16 14:02:20 -07006293 * 1 = show (default)
6294 * 0 = hide
rich cannings4e5753f2012-09-19 16:03:56 -07006295 * @hide
rich canningse6686b32012-09-16 14:02:20 -07006296 */
6297 public static final String PACKAGE_VERIFIER_SETTING_VISIBLE = "verifier_setting_visible";
6298
rich cannings4d8fc792012-09-07 14:43:43 -07006299 /**
Fabrice Di Meglio1c1b4712014-11-19 17:12:32 -08006300 * Run package verification on apps installed through ADB/ADT/USB
rich cannings4e5753f2012-09-19 16:03:56 -07006301 * 1 = perform package verification on ADB installs (default)
6302 * 0 = bypass package verification on ADB installs
6303 * @hide
6304 */
6305 public static final String PACKAGE_VERIFIER_INCLUDE_ADB = "verifier_verify_adb_installs";
6306
6307 /**
Christopher Tate7265abe2014-11-21 13:54:45 -08006308 * Time since last fstrim (milliseconds) after which we force one to happen
6309 * during device startup. If unset, the default is 3 days.
6310 * @hide
6311 */
6312 public static final String FSTRIM_MANDATORY_INTERVAL = "fstrim_mandatory_interval";
6313
6314 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006315 * The interval in milliseconds at which to check packet counts on the
6316 * mobile data interface when screen is on, to detect possible data
6317 * connection problems.
6318 * @hide
6319 */
6320 public static final String PDP_WATCHDOG_POLL_INTERVAL_MS =
6321 "pdp_watchdog_poll_interval_ms";
6322
6323 /**
6324 * The interval in milliseconds at which to check packet counts on the
6325 * mobile data interface when screen is off, to detect possible data
6326 * connection problems.
6327 * @hide
6328 */
6329 public static final String PDP_WATCHDOG_LONG_POLL_INTERVAL_MS =
6330 "pdp_watchdog_long_poll_interval_ms";
6331
6332 /**
6333 * The interval in milliseconds at which to check packet counts on the
6334 * mobile data interface after {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT}
6335 * outgoing packets has been reached without incoming packets.
6336 * @hide
6337 */
6338 public static final String PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS =
6339 "pdp_watchdog_error_poll_interval_ms";
6340
6341 /**
6342 * The number of outgoing packets sent without seeing an incoming packet
6343 * that triggers a countdown (of {@link #PDP_WATCHDOG_ERROR_POLL_COUNT}
6344 * device is logged to the event log
6345 * @hide
6346 */
6347 public static final String PDP_WATCHDOG_TRIGGER_PACKET_COUNT =
6348 "pdp_watchdog_trigger_packet_count";
6349
6350 /**
6351 * The number of polls to perform (at {@link #PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS})
6352 * after hitting {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} before
6353 * attempting data connection recovery.
6354 * @hide
6355 */
6356 public static final String PDP_WATCHDOG_ERROR_POLL_COUNT =
6357 "pdp_watchdog_error_poll_count";
6358
6359 /**
6360 * The number of failed PDP reset attempts before moving to something more
6361 * drastic: re-registering to the network.
6362 * @hide
6363 */
6364 public static final String PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT =
6365 "pdp_watchdog_max_pdp_reset_fail_count";
6366
6367 /**
6368 * A positive value indicates how often the SamplingProfiler
6369 * should take snapshots. Zero value means SamplingProfiler
6370 * is disabled.
6371 *
6372 * @hide
6373 */
6374 public static final String SAMPLING_PROFILER_MS = "sampling_profiler_ms";
6375
6376 /**
6377 * URL to open browser on to allow user to manage a prepay account
6378 * @hide
6379 */
6380 public static final String SETUP_PREPAID_DATA_SERVICE_URL =
6381 "setup_prepaid_data_service_url";
6382
6383 /**
6384 * URL to attempt a GET on to see if this is a prepay device
6385 * @hide
6386 */
6387 public static final String SETUP_PREPAID_DETECTION_TARGET_URL =
6388 "setup_prepaid_detection_target_url";
6389
6390 /**
6391 * Host to check for a redirect to after an attempt to GET
6392 * SETUP_PREPAID_DETECTION_TARGET_URL. (If we redirected there,
6393 * this is a prepaid device with zero balance.)
6394 * @hide
6395 */
6396 public static final String SETUP_PREPAID_DETECTION_REDIR_HOST =
6397 "setup_prepaid_detection_redir_host";
6398
6399 /**
Jake Hamby76a61422012-09-06 17:40:21 -07006400 * The interval in milliseconds at which to check the number of SMS sent out without asking
6401 * for use permit, to limit the un-authorized SMS usage.
6402 *
6403 * @hide
6404 */
6405 public static final String SMS_OUTGOING_CHECK_INTERVAL_MS =
6406 "sms_outgoing_check_interval_ms";
6407
6408 /**
6409 * The number of outgoing SMS sent without asking for user permit (of {@link
6410 * #SMS_OUTGOING_CHECK_INTERVAL_MS}
6411 *
6412 * @hide
6413 */
6414 public static final String SMS_OUTGOING_CHECK_MAX_COUNT =
6415 "sms_outgoing_check_max_count";
6416
6417 /**
6418 * Used to disable SMS short code confirmation - defaults to true.
Robert Greenwalt026efcc2012-09-24 10:03:21 -07006419 * True indcates we will do the check, etc. Set to false to disable.
Jake Hamby76a61422012-09-06 17:40:21 -07006420 * @see com.android.internal.telephony.SmsUsageMonitor
6421 * @hide
6422 */
6423 public static final String SMS_SHORT_CODE_CONFIRMATION = "sms_short_code_confirmation";
6424
Robert Greenwalt026efcc2012-09-24 10:03:21 -07006425 /**
6426 * Used to select which country we use to determine premium sms codes.
6427 * One of com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_SIM,
6428 * com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_NETWORK,
6429 * or com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_BOTH.
6430 * @hide
6431 */
6432 public static final String SMS_SHORT_CODE_RULE = "sms_short_code_rule";
6433
Jake Hamby76a61422012-09-06 17:40:21 -07006434 /**
JP Abgrall32d1ac4d2014-02-21 12:05:20 -08006435 * Used to select TCP's default initial receiver window size in segments - defaults to a build config value
6436 * @hide
6437 */
6438 public static final String TCP_DEFAULT_INIT_RWND = "tcp_default_init_rwnd";
6439
6440 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006441 * Used to disable Tethering on a device - defaults to true
6442 * @hide
6443 */
6444 public static final String TETHER_SUPPORTED = "tether_supported";
6445
6446 /**
6447 * Used to require DUN APN on the device or not - defaults to a build config value
6448 * which defaults to false
6449 * @hide
6450 */
6451 public static final String TETHER_DUN_REQUIRED = "tether_dun_required";
6452
6453 /**
6454 * Used to hold a gservices-provisioned apn value for DUN. If set, or the
6455 * corresponding build config values are set it will override the APN DB
6456 * values.
6457 * Consists of a comma seperated list of strings:
6458 * "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type"
6459 * note that empty fields can be ommitted: "name,apn,,,,,,,,,310,260,,DUN"
6460 * @hide
6461 */
6462 public static final String TETHER_DUN_APN = "tether_dun_apn";
6463
6464 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006465 * USB Mass Storage Enabled
6466 */
6467 public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled";
6468
6469 /**
6470 * If this setting is set (to anything), then all references
6471 * to Gmail on the device must change to Google Mail.
6472 */
6473 public static final String USE_GOOGLE_MAIL = "use_google_mail";
6474
Hui Shu22671772014-10-01 21:41:07 +00006475 /**
6476 * Webview Data reduction proxy key.
6477 * @hide
6478 */
6479 public static final String WEBVIEW_DATA_REDUCTION_PROXY_KEY =
6480 "webview_data_reduction_proxy_key";
6481
Christopher Tate06efb532012-08-24 15:29:27 -07006482 /**
Jeff Brown89d55462012-09-19 11:33:42 -07006483 * Whether Wifi display is enabled/disabled
6484 * 0=disabled. 1=enabled.
6485 * @hide
6486 */
6487 public static final String WIFI_DISPLAY_ON = "wifi_display_on";
6488
6489 /**
Chong Zhang1f3ecaa2013-05-03 15:55:36 -07006490 * Whether Wifi display certification mode is enabled/disabled
6491 * 0=disabled. 1=enabled.
6492 * @hide
6493 */
6494 public static final String WIFI_DISPLAY_CERTIFICATION_ON =
6495 "wifi_display_certification_on";
6496
6497 /**
Chong Zhange38af812013-08-29 17:25:17 -07006498 * WPS Configuration method used by Wifi display, this setting only
6499 * takes effect when WIFI_DISPLAY_CERTIFICATION_ON is 1 (enabled).
6500 *
6501 * Possible values are:
6502 *
6503 * WpsInfo.INVALID: use default WPS method chosen by framework
6504 * WpsInfo.PBC : use Push button
6505 * WpsInfo.KEYPAD : use Keypad
6506 * WpsInfo.DISPLAY: use Display
6507 * @hide
6508 */
6509 public static final String WIFI_DISPLAY_WPS_CONFIG =
6510 "wifi_display_wps_config";
6511
6512 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006513 * Whether to notify the user of open networks.
6514 * <p>
6515 * If not connected and the scan results have an open network, we will
6516 * put this notification up. If we attempt to connect to a network or
6517 * the open network(s) disappear, we remove the notification. When we
6518 * show the notification, we will not show it again for
6519 * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time.
6520 */
6521 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
6522 "wifi_networks_available_notification_on";
6523 /**
6524 * {@hide}
6525 */
6526 public static final String WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON =
6527 "wimax_networks_available_notification_on";
6528
6529 /**
6530 * Delay (in seconds) before repeating the Wi-Fi networks available notification.
6531 * Connecting to a network will reset the timer.
6532 */
6533 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
6534 "wifi_networks_available_repeat_delay";
6535
6536 /**
Robert Greenwalt3ea0c992013-10-03 21:13:49 +00006537 * 802.11 country code in ISO 3166 format
6538 * @hide
6539 */
6540 public static final String WIFI_COUNTRY_CODE = "wifi_country_code";
6541
6542 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006543 * The interval in milliseconds to issue wake up scans when wifi needs
6544 * to connect. This is necessary to connect to an access point when
6545 * device is on the move and the screen is off.
6546 * @hide
6547 */
6548 public static final String WIFI_FRAMEWORK_SCAN_INTERVAL_MS =
6549 "wifi_framework_scan_interval_ms";
6550
6551 /**
6552 * The interval in milliseconds after which Wi-Fi is considered idle.
6553 * When idle, it is possible for the device to be switched from Wi-Fi to
6554 * the mobile data network.
6555 * @hide
6556 */
6557 public static final String WIFI_IDLE_MS = "wifi_idle_ms";
6558
6559 /**
6560 * When the number of open networks exceeds this number, the
6561 * least-recently-used excess networks will be removed.
6562 */
6563 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept";
6564
6565 /**
6566 * Whether the Wi-Fi should be on. Only the Wi-Fi service should touch this.
6567 */
6568 public static final String WIFI_ON = "wifi_on";
6569
6570 /**
Irfan Sheriff11aefad2013-03-06 07:57:41 -08006571 * Setting to allow scans to be enabled even wifi is turned off for connectivity.
6572 * @hide
6573 */
6574 public static final String WIFI_SCAN_ALWAYS_AVAILABLE =
6575 "wifi_scan_always_enabled";
6576
6577 /**
Wei Wangd91f1932015-03-19 15:09:56 -07006578 * Settings to allow BLE scans to be enabled even when Bluetooth is turned off for
6579 * connectivity.
6580 * @hide
6581 */
6582 public static final String BLE_SCAN_ALWAYS_AVAILABLE =
6583 "ble_scan_always_enabled";
6584
6585 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006586 * Used to save the Wifi_ON state prior to tethering.
6587 * This state will be checked to restore Wifi after
6588 * the user turns off tethering.
6589 *
6590 * @hide
6591 */
6592 public static final String WIFI_SAVED_STATE = "wifi_saved_state";
6593
6594 /**
6595 * The interval in milliseconds to scan as used by the wifi supplicant
6596 * @hide
6597 */
6598 public static final String WIFI_SUPPLICANT_SCAN_INTERVAL_MS =
6599 "wifi_supplicant_scan_interval_ms";
6600
vandwalle7c3606c2014-03-31 19:12:07 -07006601 /**
6602 * whether frameworks handles wifi auto-join
6603 * @hide
6604 */
6605 public static final String WIFI_ENHANCED_AUTO_JOIN =
6606 "wifi_enhanced_auto_join";
6607
6608 /**
6609 * whether settings show RSSI
6610 * @hide
6611 */
6612 public static final String WIFI_NETWORK_SHOW_RSSI =
6613 "wifi_network_show_rssi";
6614
6615 /**
Irfan Sheriff3809f502012-09-17 16:04:57 -07006616 * The interval in milliseconds to scan at supplicant when p2p is connected
6617 * @hide
6618 */
6619 public static final String WIFI_SCAN_INTERVAL_WHEN_P2P_CONNECTED_MS =
6620 "wifi_scan_interval_p2p_connected_ms";
6621
6622 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006623 * Whether the Wi-Fi watchdog is enabled.
6624 */
6625 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
6626
6627 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006628 * Setting to turn off poor network avoidance on Wi-Fi. Feature is enabled by default and
6629 * the setting needs to be set to 0 to disable it.
6630 * @hide
6631 */
6632 public static final String WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED =
6633 "wifi_watchdog_poor_network_test_enabled";
6634
6635 /**
6636 * Setting to turn on suspend optimizations at screen off on Wi-Fi. Enabled by default and
6637 * needs to be set to 0 to disable it.
6638 * @hide
6639 */
6640 public static final String WIFI_SUSPEND_OPTIMIZATIONS_ENABLED =
6641 "wifi_suspend_optimizations_enabled";
6642
6643 /**
6644 * The maximum number of times we will retry a connection to an access
6645 * point for which we have failed in acquiring an IP address from DHCP.
6646 * A value of N means that we will make N+1 connection attempts in all.
6647 */
6648 public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count";
6649
6650 /**
6651 * Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile
6652 * data connectivity to be established after a disconnect from Wi-Fi.
6653 */
6654 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
6655 "wifi_mobile_data_transition_wakelock_timeout_ms";
6656
6657 /**
6658 * The operational wifi frequency band
6659 * Set to one of {@link WifiManager#WIFI_FREQUENCY_BAND_AUTO},
6660 * {@link WifiManager#WIFI_FREQUENCY_BAND_5GHZ} or
6661 * {@link WifiManager#WIFI_FREQUENCY_BAND_2GHZ}
6662 *
6663 * @hide
6664 */
6665 public static final String WIFI_FREQUENCY_BAND = "wifi_frequency_band";
6666
6667 /**
6668 * The Wi-Fi peer-to-peer device name
6669 * @hide
6670 */
6671 public static final String WIFI_P2P_DEVICE_NAME = "wifi_p2p_device_name";
6672
6673 /**
Robert Greenwaltc12783a2013-05-16 12:48:20 -07006674 * The min time between wifi disable and wifi enable
6675 * @hide
6676 */
6677 public static final String WIFI_REENABLE_DELAY_MS = "wifi_reenable_delay";
6678
6679 /**
Jeff Davidsona20ca67d2014-12-16 11:48:54 -08006680 * Timeout for ephemeral networks when all known BSSIDs go out of range. We will disconnect
6681 * from an ephemeral network if there is no BSSID for that network with a non-null score that
6682 * has been seen in this time period.
6683 *
6684 * If this is less than or equal to zero, we use a more conservative behavior and only check
6685 * for a non-null score from the currently connected or target BSSID.
6686 * @hide
6687 */
6688 public static final String WIFI_EPHEMERAL_OUT_OF_RANGE_TIMEOUT_MS =
6689 "wifi_ephemeral_out_of_range_timeout_ms";
6690
6691 /**
Christopher Tatec868b642012-09-12 17:41:04 -07006692 * The number of milliseconds to delay when checking for data stalls during
6693 * non-aggressive detection. (screen is turned off.)
6694 * @hide
6695 */
6696 public static final String DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS =
6697 "data_stall_alarm_non_aggressive_delay_in_ms";
6698
6699 /**
6700 * The number of milliseconds to delay when checking for data stalls during
6701 * aggressive detection. (screen on or suspected data stall)
6702 * @hide
6703 */
6704 public static final String DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS =
6705 "data_stall_alarm_aggressive_delay_in_ms";
6706
6707 /**
Wink Savillece1e3792013-09-03 16:41:44 -07006708 * The number of milliseconds to allow the provisioning apn to remain active
6709 * @hide
6710 */
6711 public static final String PROVISIONING_APN_ALARM_DELAY_IN_MS =
6712 "provisioning_apn_alarm_delay_in_ms";
6713
6714 /**
Christopher Tatec868b642012-09-12 17:41:04 -07006715 * The interval in milliseconds at which to check gprs registration
6716 * after the first registration mismatch of gprs and voice service,
6717 * to detect possible data network registration problems.
6718 *
6719 * @hide
6720 */
6721 public static final String GPRS_REGISTER_CHECK_PERIOD_MS =
6722 "gprs_register_check_period_ms";
6723
6724 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006725 * Nonzero causes Log.wtf() to crash.
6726 * @hide
6727 */
6728 public static final String WTF_IS_FATAL = "wtf_is_fatal";
6729
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07006730 /**
6731 * Ringer mode. This is used internally, changing this value will not
6732 * change the ringer mode. See AudioManager.
6733 */
6734 public static final String MODE_RINGER = "mode_ringer";
Christopher Tate06efb532012-08-24 15:29:27 -07006735
Jeff Brownd4935962012-09-25 13:27:20 -07006736 /**
6737 * Overlay display devices setting.
6738 * The associated value is a specially formatted string that describes the
6739 * size and density of simulated secondary display devices.
6740 * <p>
6741 * Format: {width}x{height}/{dpi};...
6742 * </p><p>
6743 * Example:
6744 * <ul>
6745 * <li><code>1280x720/213</code>: make one overlay that is 1280x720 at 213dpi.</li>
6746 * <li><code>1920x1080/320;1280x720/213</code>: make two overlays, the first
6747 * at 1080p and the second at 720p.</li>
6748 * <li>If the value is empty, then no overlay display devices are created.</li>
6749 * </ul></p>
6750 *
6751 * @hide
6752 */
6753 public static final String OVERLAY_DISPLAY_DEVICES = "overlay_display_devices";
Christopher Tate06efb532012-08-24 15:29:27 -07006754
Jeff Sharkey625239a2012-09-26 22:03:49 -07006755 /**
6756 * Threshold values for the duration and level of a discharge cycle,
6757 * under which we log discharge cycle info.
6758 *
6759 * @hide
6760 */
6761 public static final String
6762 BATTERY_DISCHARGE_DURATION_THRESHOLD = "battery_discharge_duration_threshold";
6763
6764 /** @hide */
6765 public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold";
6766
6767 /**
6768 * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR
6769 * intents on application crashes and ANRs. If this is disabled, the
6770 * crash/ANR dialog will never display the "Report" button.
6771 * <p>
6772 * Type: int (0 = disallow, 1 = allow)
6773 *
6774 * @hide
6775 */
6776 public static final String SEND_ACTION_APP_ERROR = "send_action_app_error";
6777
6778 /**
6779 * Maximum age of entries kept by {@link DropBoxManager}.
6780 *
6781 * @hide
6782 */
6783 public static final String DROPBOX_AGE_SECONDS = "dropbox_age_seconds";
6784
6785 /**
6786 * Maximum number of entry files which {@link DropBoxManager} will keep
6787 * around.
6788 *
6789 * @hide
6790 */
6791 public static final String DROPBOX_MAX_FILES = "dropbox_max_files";
6792
6793 /**
6794 * Maximum amount of disk space used by {@link DropBoxManager} no matter
6795 * what.
6796 *
6797 * @hide
6798 */
6799 public static final String DROPBOX_QUOTA_KB = "dropbox_quota_kb";
6800
6801 /**
6802 * Percent of free disk (excluding reserve) which {@link DropBoxManager}
6803 * will use.
6804 *
6805 * @hide
6806 */
6807 public static final String DROPBOX_QUOTA_PERCENT = "dropbox_quota_percent";
6808
6809 /**
6810 * Percent of total disk which {@link DropBoxManager} will never dip
6811 * into.
6812 *
6813 * @hide
6814 */
6815 public static final String DROPBOX_RESERVE_PERCENT = "dropbox_reserve_percent";
6816
6817 /**
6818 * Prefix for per-tag dropbox disable/enable settings.
6819 *
6820 * @hide
6821 */
6822 public static final String DROPBOX_TAG_PREFIX = "dropbox:";
6823
6824 /**
6825 * Lines of logcat to include with system crash/ANR/etc. reports, as a
6826 * prefix of the dropbox tag of the report type. For example,
6827 * "logcat_for_system_server_anr" controls the lines of logcat captured
6828 * with system server ANR reports. 0 to disable.
6829 *
6830 * @hide
6831 */
6832 public static final String ERROR_LOGCAT_PREFIX = "logcat_for_";
6833
6834 /**
6835 * The interval in minutes after which the amount of free storage left
6836 * on the device is logged to the event log
6837 *
6838 * @hide
6839 */
6840 public static final String SYS_FREE_STORAGE_LOG_INTERVAL = "sys_free_storage_log_interval";
6841
6842 /**
6843 * Threshold for the amount of change in disk free space required to
6844 * report the amount of free space. Used to prevent spamming the logs
6845 * when the disk free space isn't changing frequently.
6846 *
6847 * @hide
6848 */
6849 public static final String
6850 DISK_FREE_CHANGE_REPORTING_THRESHOLD = "disk_free_change_reporting_threshold";
6851
6852 /**
6853 * Minimum percentage of free storage on the device that is used to
6854 * determine if the device is running low on storage. The default is 10.
6855 * <p>
6856 * Say this value is set to 10, the device is considered running low on
6857 * storage if 90% or more of the device storage is filled up.
6858 *
6859 * @hide
6860 */
6861 public static final String
6862 SYS_STORAGE_THRESHOLD_PERCENTAGE = "sys_storage_threshold_percentage";
6863
6864 /**
6865 * Maximum byte size of the low storage threshold. This is to ensure
6866 * that {@link #SYS_STORAGE_THRESHOLD_PERCENTAGE} does not result in an
6867 * overly large threshold for large storage devices. Currently this must
6868 * be less than 2GB. This default is 500MB.
6869 *
6870 * @hide
6871 */
6872 public static final String
6873 SYS_STORAGE_THRESHOLD_MAX_BYTES = "sys_storage_threshold_max_bytes";
6874
6875 /**
6876 * Minimum bytes of free storage on the device before the data partition
6877 * is considered full. By default, 1 MB is reserved to avoid system-wide
6878 * SQLite disk full exceptions.
6879 *
6880 * @hide
6881 */
6882 public static final String
6883 SYS_STORAGE_FULL_THRESHOLD_BYTES = "sys_storage_full_threshold_bytes";
6884
6885 /**
6886 * The maximum reconnect delay for short network outages or when the
6887 * network is suspended due to phone use.
6888 *
6889 * @hide
6890 */
6891 public static final String
6892 SYNC_MAX_RETRY_DELAY_IN_SECONDS = "sync_max_retry_delay_in_seconds";
6893
6894 /**
6895 * The number of milliseconds to delay before sending out
Erik Kline8f29dcf2014-12-08 16:25:20 +09006896 * {@link ConnectivityManager#CONNECTIVITY_ACTION} broadcasts. Ignored.
Jeff Sharkey625239a2012-09-26 22:03:49 -07006897 *
6898 * @hide
6899 */
6900 public static final String CONNECTIVITY_CHANGE_DELAY = "connectivity_change_delay";
6901
Vinit Deshapnde1f12cb52013-08-21 13:09:01 -07006902
6903 /**
6904 * Network sampling interval, in seconds. We'll generate link information
6905 * about bytes/packets sent and error rates based on data sampled in this interval
6906 *
6907 * @hide
6908 */
6909
6910 public static final String CONNECTIVITY_SAMPLING_INTERVAL_IN_SECONDS =
6911 "connectivity_sampling_interval_in_seconds";
6912
Jeff Sharkey625239a2012-09-26 22:03:49 -07006913 /**
Jason Monk602b2322013-07-03 17:04:33 -04006914 * The series of successively longer delays used in retrying to download PAC file.
6915 * Last delay is used between successful PAC downloads.
6916 *
6917 * @hide
6918 */
6919 public static final String PAC_CHANGE_DELAY = "pac_change_delay";
6920
6921 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07006922 * Setting to turn off captive portal detection. Feature is enabled by
6923 * default and the setting needs to be set to 0 to disable it.
6924 *
6925 * @hide
6926 */
6927 public static final String
6928 CAPTIVE_PORTAL_DETECTION_ENABLED = "captive_portal_detection_enabled";
6929
6930 /**
6931 * The server used for captive portal detection upon a new conection. A
6932 * 204 response code from the server is used for validation.
6933 *
6934 * @hide
6935 */
6936 public static final String CAPTIVE_PORTAL_SERVER = "captive_portal_server";
6937
6938 /**
6939 * Whether network service discovery is enabled.
6940 *
6941 * @hide
6942 */
6943 public static final String NSD_ON = "nsd_on";
6944
6945 /**
6946 * Let user pick default install location.
6947 *
6948 * @hide
6949 */
6950 public static final String SET_INSTALL_LOCATION = "set_install_location";
6951
6952 /**
6953 * Default install location value.
6954 * 0 = auto, let system decide
6955 * 1 = internal
6956 * 2 = sdcard
6957 * @hide
6958 */
6959 public static final String DEFAULT_INSTALL_LOCATION = "default_install_location";
6960
6961 /**
6962 * ms during which to consume extra events related to Inet connection
6963 * condition after a transtion to fully-connected
6964 *
6965 * @hide
6966 */
6967 public static final String
6968 INET_CONDITION_DEBOUNCE_UP_DELAY = "inet_condition_debounce_up_delay";
6969
6970 /**
6971 * ms during which to consume extra events related to Inet connection
6972 * condtion after a transtion to partly-connected
6973 *
6974 * @hide
6975 */
6976 public static final String
6977 INET_CONDITION_DEBOUNCE_DOWN_DELAY = "inet_condition_debounce_down_delay";
6978
6979 /** {@hide} */
6980 public static final String
6981 READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT = "read_external_storage_enforced_default";
6982
6983 /**
6984 * Host name and port for global http proxy. Uses ':' seperator for
6985 * between host and port.
6986 */
6987 public static final String HTTP_PROXY = "http_proxy";
6988
6989 /**
6990 * Host name for global http proxy. Set via ConnectivityManager.
6991 *
6992 * @hide
6993 */
6994 public static final String GLOBAL_HTTP_PROXY_HOST = "global_http_proxy_host";
6995
6996 /**
6997 * Integer host port for global http proxy. Set via ConnectivityManager.
6998 *
6999 * @hide
7000 */
7001 public static final String GLOBAL_HTTP_PROXY_PORT = "global_http_proxy_port";
7002
7003 /**
7004 * Exclusion list for global proxy. This string contains a list of
7005 * comma-separated domains where the global proxy does not apply.
7006 * Domains should be listed in a comma- separated list. Example of
7007 * acceptable formats: ".domain1.com,my.domain2.com" Use
7008 * ConnectivityManager to set/get.
7009 *
7010 * @hide
7011 */
7012 public static final String
7013 GLOBAL_HTTP_PROXY_EXCLUSION_LIST = "global_http_proxy_exclusion_list";
7014
7015 /**
Jason Monk602b2322013-07-03 17:04:33 -04007016 * The location PAC File for the proxy.
7017 * @hide
7018 */
7019 public static final String
7020 GLOBAL_HTTP_PROXY_PAC = "global_proxy_pac_url";
7021
7022 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07007023 * Enables the UI setting to allow the user to specify the global HTTP
7024 * proxy and associated exclusion list.
7025 *
7026 * @hide
7027 */
7028 public static final String SET_GLOBAL_HTTP_PROXY = "set_global_http_proxy";
7029
7030 /**
7031 * Setting for default DNS in case nobody suggests one
7032 *
7033 * @hide
7034 */
7035 public static final String DEFAULT_DNS_SERVER = "default_dns_server";
7036
Jeff Sharkey0ac10282012-10-01 12:50:22 -07007037 /** {@hide} */
7038 public static final String
7039 BLUETOOTH_HEADSET_PRIORITY_PREFIX = "bluetooth_headset_priority_";
7040 /** {@hide} */
7041 public static final String
7042 BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX = "bluetooth_a2dp_sink_priority_";
7043 /** {@hide} */
7044 public static final String
7045 BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX = "bluetooth_input_device_priority_";
Kim Schulz0d376052013-08-22 11:18:02 +02007046 /** {@hide} */
7047 public static final String
7048 BLUETOOTH_MAP_PRIORITY_PREFIX = "bluetooth_map_priority_";
Casper Bonde2a5f6082015-03-19 10:36:45 +01007049 /** {@hide} */
7050 public static final String
7051 BLUETOOTH_SAP_PRIORITY_PREFIX = "bluetooth_sap_priority_";
Jeff Sharkey0ac10282012-10-01 12:50:22 -07007052
7053 /**
7054 * Get the key that retrieves a bluetooth headset's priority.
7055 * @hide
7056 */
7057 public static final String getBluetoothHeadsetPriorityKey(String address) {
Elliott Hughescb64d432013-08-02 10:00:44 -07007058 return BLUETOOTH_HEADSET_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
Jeff Sharkey0ac10282012-10-01 12:50:22 -07007059 }
7060
7061 /**
7062 * Get the key that retrieves a bluetooth a2dp sink's priority.
7063 * @hide
7064 */
7065 public static final String getBluetoothA2dpSinkPriorityKey(String address) {
Elliott Hughescb64d432013-08-02 10:00:44 -07007066 return BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
Jeff Sharkey0ac10282012-10-01 12:50:22 -07007067 }
7068
7069 /**
7070 * Get the key that retrieves a bluetooth Input Device's priority.
7071 * @hide
7072 */
7073 public static final String getBluetoothInputDevicePriorityKey(String address) {
Elliott Hughescb64d432013-08-02 10:00:44 -07007074 return BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
Jeff Sharkey0ac10282012-10-01 12:50:22 -07007075 }
7076
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07007077 /**
Kim Schulz0d376052013-08-22 11:18:02 +02007078 * Get the key that retrieves a bluetooth map priority.
7079 * @hide
7080 */
7081 public static final String getBluetoothMapPriorityKey(String address) {
7082 return BLUETOOTH_MAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
7083 }
Casper Bonde2a5f6082015-03-19 10:36:45 +01007084
7085 /**
7086 * Get the key that retrieves a bluetooth map priority.
7087 * @hide
7088 */
7089 public static final String getBluetoothSapPriorityKey(String address) {
7090 return BLUETOOTH_SAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
7091 }
7092
Kim Schulz0d376052013-08-22 11:18:02 +02007093 /**
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07007094 * Scaling factor for normal window animations. Setting to 0 will
7095 * disable window animations.
7096 */
7097 public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale";
7098
7099 /**
7100 * Scaling factor for activity transition animations. Setting to 0 will
7101 * disable window animations.
7102 */
7103 public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale";
7104
7105 /**
7106 * Scaling factor for Animator-based animations. This affects both the
7107 * start delay and duration of all such animations. Setting to 0 will
7108 * cause animations to end immediately. The default value is 1.
7109 */
7110 public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale";
7111
7112 /**
7113 * Scaling factor for normal window animations. Setting to 0 will
7114 * disable window animations.
7115 *
7116 * @hide
7117 */
7118 public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations";
7119
7120 /**
7121 * If 0, the compatibility mode is off for all applications.
7122 * If 1, older applications run under compatibility mode.
7123 * TODO: remove this settings before code freeze (bug/1907571)
7124 * @hide
7125 */
7126 public static final String COMPATIBILITY_MODE = "compatibility_mode";
7127
7128 /**
7129 * CDMA only settings
7130 * Emergency Tone 0 = Off
7131 * 1 = Alert
7132 * 2 = Vibrate
7133 * @hide
7134 */
7135 public static final String EMERGENCY_TONE = "emergency_tone";
7136
7137 /**
7138 * CDMA only settings
7139 * Whether the auto retry is enabled. The value is
7140 * boolean (1 or 0).
7141 * @hide
7142 */
7143 public static final String CALL_AUTO_RETRY = "call_auto_retry";
7144
7145 /**
Sungmin Choie099ab12014-06-09 14:45:51 +09007146 * See RIL_PreferredNetworkType in ril.h
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07007147 * @hide
7148 */
7149 public static final String PREFERRED_NETWORK_MODE =
7150 "preferred_network_mode";
7151
7152 /**
Junda Liubbdc1c02014-11-07 11:18:02 -08007153 * Setting to 1 will hide carrier network settings.
7154 * Default is 0.
Junda Liubbdc1c02014-11-07 11:18:02 -08007155 */
7156 public static final String HIDE_CARRIER_NETWORK_SETTINGS =
7157 "hide_carrier_network_settings";
7158
7159 /**
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07007160 * Name of an application package to be debugged.
7161 */
7162 public static final String DEBUG_APP = "debug_app";
7163
7164 /**
7165 * If 1, when launching DEBUG_APP it will wait for the debugger before
7166 * starting user code. If 0, it will run normally.
7167 */
7168 public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger";
7169
7170 /**
7171 * Control whether the process CPU usage meter should be shown.
7172 */
7173 public static final String SHOW_PROCESSES = "show_processes";
7174
7175 /**
Ruchi Kandoi62b8a492014-04-17 18:01:40 -07007176 * If 1 low power mode is enabled.
7177 * @hide
7178 */
7179 public static final String LOW_POWER_MODE = "low_power";
7180
John Spurlockf8f524c2014-06-10 14:47:29 -04007181 /**
7182 * Battery level [1-99] at which low power mode automatically turns on.
Dianne Hackborn14272302014-06-10 23:13:02 -07007183 * If 0, it will not automatically turn on.
John Spurlockf8f524c2014-06-10 14:47:29 -04007184 * @hide
7185 */
7186 public static final String LOW_POWER_MODE_TRIGGER_LEVEL = "low_power_trigger_level";
7187
Ruchi Kandoi62b8a492014-04-17 18:01:40 -07007188 /**
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07007189 * If 1, the activity manager will aggressively finish activities and
7190 * processes as soon as they are no longer needed. If 0, the normal
7191 * extended lifetime is used.
7192 */
Dianne Hackborn89ad4562014-08-24 16:45:38 -07007193 public static final String ALWAYS_FINISH_ACTIVITIES = "always_finish_activities";
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07007194
Christopher Tate66488d62012-10-02 11:58:01 -07007195 /**
Eric Laurent7ee1e4f2012-10-26 18:11:21 -07007196 * Use Dock audio output for media:
7197 * 0 = disabled
7198 * 1 = enabled
7199 * @hide
7200 */
7201 public static final String DOCK_AUDIO_MEDIA_ENABLED = "dock_audio_media_enabled";
7202
7203 /**
Eric Laurent05274f32012-11-29 12:48:18 -08007204 * Persisted safe headphone volume management state by AudioService
7205 * @hide
7206 */
7207 public static final String AUDIO_SAFE_VOLUME_STATE = "audio_safe_volume_state";
7208
7209 /**
Geremy Condraa0735112013-03-26 21:49:26 -07007210 * URL for tzinfo (time zone) updates
7211 * @hide
7212 */
7213 public static final String TZINFO_UPDATE_CONTENT_URL = "tzinfo_content_url";
7214
7215 /**
7216 * URL for tzinfo (time zone) update metadata
7217 * @hide
7218 */
7219 public static final String TZINFO_UPDATE_METADATA_URL = "tzinfo_metadata_url";
7220
7221 /**
7222 * URL for selinux (mandatory access control) updates
7223 * @hide
7224 */
7225 public static final String SELINUX_UPDATE_CONTENT_URL = "selinux_content_url";
7226
7227 /**
7228 * URL for selinux (mandatory access control) update metadata
7229 * @hide
7230 */
7231 public static final String SELINUX_UPDATE_METADATA_URL = "selinux_metadata_url";
7232
7233 /**
7234 * URL for sms short code updates
7235 * @hide
7236 */
7237 public static final String SMS_SHORT_CODES_UPDATE_CONTENT_URL =
7238 "sms_short_codes_content_url";
7239
7240 /**
7241 * URL for sms short code update metadata
7242 * @hide
7243 */
7244 public static final String SMS_SHORT_CODES_UPDATE_METADATA_URL =
7245 "sms_short_codes_metadata_url";
7246
7247 /**
7248 * URL for cert pinlist updates
7249 * @hide
7250 */
7251 public static final String CERT_PIN_UPDATE_CONTENT_URL = "cert_pin_content_url";
7252
7253 /**
7254 * URL for cert pinlist updates
7255 * @hide
7256 */
7257 public static final String CERT_PIN_UPDATE_METADATA_URL = "cert_pin_metadata_url";
7258
Geremy Condra757ee522013-03-29 16:39:45 -07007259 /**
Ben Gruver633dc9b2013-04-04 12:05:49 -07007260 * URL for intent firewall updates
7261 * @hide
7262 */
7263 public static final String INTENT_FIREWALL_UPDATE_CONTENT_URL =
7264 "intent_firewall_content_url";
7265
7266 /**
7267 * URL for intent firewall update metadata
7268 * @hide
7269 */
7270 public static final String INTENT_FIREWALL_UPDATE_METADATA_URL =
7271 "intent_firewall_metadata_url";
7272
7273 /**
Geremy Condra4e7f7e82013-03-26 21:09:01 -07007274 * SELinux enforcement status. If 0, permissive; if 1, enforcing.
7275 * @hide
7276 */
7277 public static final String SELINUX_STATUS = "selinux_status";
7278
Geremy Condraa0735112013-03-26 21:49:26 -07007279 /**
Amith Yamasanid8415f42013-08-07 20:15:10 -07007280 * Developer setting to force RTL layout.
7281 * @hide
7282 */
7283 public static final String DEVELOPMENT_FORCE_RTL = "debug.force_rtl";
7284
7285 /**
Daniel Sandlerdea64622013-09-23 16:05:57 -04007286 * Milliseconds after screen-off after which low battery sounds will be silenced.
7287 *
7288 * If zero, battery sounds will always play.
7289 * Defaults to @integer/def_low_battery_sound_timeout in SettingsProvider.
7290 *
7291 * @hide
7292 */
7293 public static final String LOW_BATTERY_SOUND_TIMEOUT = "low_battery_sound_timeout";
7294
7295 /**
Evan Charltoncc7b0432014-01-14 14:47:11 -08007296 * Milliseconds to wait before bouncing Wi-Fi after settings is restored. Note that after
Dianne Hackborna3fb40d2014-08-12 15:06:50 -07007297 * the caller is done with this, they should call {@link ContentResolver#delete} to
Evan Charltoncc7b0432014-01-14 14:47:11 -08007298 * clean up any value that they may have written.
7299 *
7300 * @hide
7301 */
7302 public static final String WIFI_BOUNCE_DELAY_OVERRIDE_MS = "wifi_bounce_delay_override_ms";
7303
John Spurlockc6d1c602014-01-17 15:22:06 -05007304 /**
7305 * Defines global runtime overrides to window policy.
7306 *
Jorim Jaggib10e33f2015-02-04 21:57:40 +01007307 * See {@link com.android.server.policy.PolicyControl} for value format.
John Spurlockc6d1c602014-01-17 15:22:06 -05007308 *
7309 * @hide
7310 */
7311 public static final String POLICY_CONTROL = "policy_control";
Evan Charltoncc7b0432014-01-14 14:47:11 -08007312
7313 /**
John Spurlockae641c92014-06-30 18:11:40 -04007314 * Defines global zen mode. ZEN_MODE_OFF, ZEN_MODE_IMPORTANT_INTERRUPTIONS,
7315 * or ZEN_MODE_NO_INTERRUPTIONS.
John Spurlocke677d712014-02-13 12:52:19 -05007316 *
7317 * @hide
7318 */
7319 public static final String ZEN_MODE = "zen_mode";
7320
7321 /** @hide */ public static final int ZEN_MODE_OFF = 0;
John Spurlockae641c92014-06-30 18:11:40 -04007322 /** @hide */ public static final int ZEN_MODE_IMPORTANT_INTERRUPTIONS = 1;
7323 /** @hide */ public static final int ZEN_MODE_NO_INTERRUPTIONS = 2;
John Spurlock4f1163c2015-04-02 17:41:21 -04007324 /** @hide */ public static final int ZEN_MODE_ALARMS = 3;
John Spurlocke677d712014-02-13 12:52:19 -05007325
7326 /** @hide */ public static String zenModeToString(int mode) {
John Spurlockae641c92014-06-30 18:11:40 -04007327 if (mode == ZEN_MODE_IMPORTANT_INTERRUPTIONS) return "ZEN_MODE_IMPORTANT_INTERRUPTIONS";
John Spurlock4f1163c2015-04-02 17:41:21 -04007328 if (mode == ZEN_MODE_ALARMS) return "ZEN_MODE_ALARMS";
John Spurlockae641c92014-06-30 18:11:40 -04007329 if (mode == ZEN_MODE_NO_INTERRUPTIONS) return "ZEN_MODE_NO_INTERRUPTIONS";
7330 return "ZEN_MODE_OFF";
John Spurlocke677d712014-02-13 12:52:19 -05007331 }
7332
John Spurlockb2278d62015-04-07 12:47:12 -04007333 /** @hide */ public static boolean isValidZenMode(int value) {
7334 switch (value) {
7335 case Global.ZEN_MODE_OFF:
7336 case Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS:
7337 case Global.ZEN_MODE_ALARMS:
7338 case Global.ZEN_MODE_NO_INTERRUPTIONS:
7339 return true;
7340 default:
7341 return false;
7342 }
7343 }
7344
John Spurlocke677d712014-02-13 12:52:19 -05007345 /**
John Spurlock056c5192014-04-20 21:52:01 -04007346 * Opaque value, changes when persisted zen mode configuration changes.
7347 *
7348 * @hide
7349 */
7350 public static final String ZEN_MODE_CONFIG_ETAG = "zen_mode_config_etag";
7351
7352 /**
Chris Wren7bd241232014-02-28 16:25:05 -05007353 * Defines global heads up toggle. One of HEADS_UP_OFF, HEADS_UP_ON.
7354 *
7355 * @hide
7356 */
Chris Wren10d82df2014-03-01 10:34:51 -05007357 public static final String HEADS_UP_NOTIFICATIONS_ENABLED =
7358 "heads_up_notifications_enabled";
Chris Wren7bd241232014-02-28 16:25:05 -05007359
7360 /** @hide */ public static final int HEADS_UP_OFF = 0;
7361 /** @hide */ public static final int HEADS_UP_ON = 1;
7362
7363 /**
Jerome Poichet147b4d72014-05-12 18:13:27 -07007364 * The name of the device
7365 *
7366 * @hide
7367 */
7368 public static final String DEVICE_NAME = "device_name";
7369
7370 /**
Amith Yamasani1e9c2182014-06-11 17:25:51 -07007371 * Whether it should be possible to create a guest user on the device.
7372 * <p>
7373 * Type: int (0 for disabled, 1 for enabled)
7374 * @hide
7375 */
7376 public static final String GUEST_USER_ENABLED = "guest_user_enabled";
7377
7378 /**
Jeff Davidson56f9f732014-08-14 16:47:23 -07007379 * Whether the NetworkScoringService has been first initialized.
7380 * <p>
7381 * Type: int (0 for false, 1 for true)
7382 * @hide
7383 */
7384 public static final String NETWORK_SCORING_PROVISIONED = "network_scoring_provisioned";
7385
7386 /**
Jim Miller6848dc82014-10-13 18:51:53 -07007387 * Whether the user wants to be prompted for password to decrypt the device on boot.
7388 * This only matters if the storage is encrypted.
7389 * <p>
7390 * Type: int (0 for false, 1 for true)
7391 * @hide
7392 */
7393 public static final String REQUIRE_PASSWORD_TO_DECRYPT = "require_password_to_decrypt";
7394
7395 /**
Libin.Tang@motorola.com0499bb52014-10-10 14:55:57 -05007396 * Whether the Volte/VT is enabled
7397 * <p>
7398 * Type: int (0 for false, 1 for true)
7399 * @hide
7400 */
Etan Cohene41a9cf2014-10-22 10:50:46 -07007401 public static final String ENHANCED_4G_MODE_ENABLED = "volte_vt_enabled";
Libin.Tang@motorola.com0499bb52014-10-10 14:55:57 -05007402
7403 /**
Etan Cohen9c8f21b2014-12-23 15:02:19 -08007404 * Whether WFC is enabled
7405 * <p>
7406 * Type: int (0 for false, 1 for true)
7407 *
7408 * @hide
7409 */
7410 public static final String WFC_IMS_ENABLED = "wfc_ims_enabled";
7411
7412 /**
7413 * WFC Mode.
7414 * <p>
7415 * Type: int - 2=Wi-Fi preferred, 1=Cellular preferred, 0=Wi-Fi only
7416 *
7417 * @hide
7418 */
7419 public static final String WFC_IMS_MODE = "wfc_ims_mode";
7420
7421 /**
7422 * Whether WFC roaming is enabled
7423 * <p>
7424 * Type: int (0 for false, 1 for true)
7425 *
7426 * @hide
7427 */
7428 public static final String WFC_IMS_ROAMING_ENABLED = "wfc_ims_roaming_enabled";
7429
7430 /**
Etan Cohen7ab0ad12014-11-24 11:18:01 -08007431 * Global override to disable VoLTE (independent of user setting)
7432 * <p>
7433 * Type: int (1 for disable VoLTE, 0 to use user configuration)
7434 * @hide
7435 */
7436 public static final String VOLTE_FEATURE_DISABLED = "volte_feature_disabled";
7437
7438 /**
Amit Mahajan4fea0922014-11-18 12:56:28 -08007439 * Whether user can enable/disable LTE as a preferred network. A carrier might control
7440 * this via gservices, OMA-DM, carrier app, etc.
7441 * <p>
7442 * Type: int (0 for false, 1 for true)
7443 * @hide
7444 */
7445 public static final String LTE_SERVICE_FORCED = "lte_service_forced";
7446
7447 /**
Christopher Tate66488d62012-10-02 11:58:01 -07007448 * Settings to backup. This is here so that it's in the same place as the settings
7449 * keys and easy to update.
7450 *
7451 * These keys may be mentioned in the SETTINGS_TO_BACKUP arrays in System
7452 * and Secure as well. This is because those tables drive both backup and
7453 * restore, and restore needs to properly whitelist keys that used to live
7454 * in those namespaces. The keys will only actually be backed up / restored
7455 * if they are also mentioned in this table (Global.SETTINGS_TO_BACKUP).
7456 *
7457 * NOTE: Settings are backed up and restored in the order they appear
7458 * in this array. If you have one setting depending on another,
7459 * make sure that they are ordered appropriately.
7460 *
7461 * @hide
7462 */
7463 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate58f41ec2013-01-11 15:40:36 -08007464 BUGREPORT_IN_POWER_MENU,
Christopher Tate66488d62012-10-02 11:58:01 -07007465 STAY_ON_WHILE_PLUGGED_IN,
Christopher Tate66488d62012-10-02 11:58:01 -07007466 AUTO_TIME,
7467 AUTO_TIME_ZONE,
7468 POWER_SOUNDS_ENABLED,
7469 DOCK_SOUNDS_ENABLED,
7470 USB_MASS_STORAGE_ENABLED,
7471 ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED,
7472 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
7473 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY,
Christopher Tate16eb7cd2012-10-09 15:26:30 -07007474 WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED,
Christopher Tate66488d62012-10-02 11:58:01 -07007475 WIFI_NUM_OPEN_NETWORKS_KEPT,
7476 EMERGENCY_TONE,
7477 CALL_AUTO_RETRY,
Amith Yamasani94005242014-10-31 11:35:13 -07007478 DOCK_AUDIO_MEDIA_ENABLED,
7479 LOW_POWER_MODE_TRIGGER_LEVEL
Christopher Tate66488d62012-10-02 11:58:01 -07007480 };
7481
Christopher Tate06efb532012-08-24 15:29:27 -07007482 // Populated lazily, guarded by class object:
Dianne Hackborn139748f2012-09-24 11:36:57 -07007483 private static NameValueCache sNameValueCache = new NameValueCache(
7484 SYS_PROP_SETTING_VERSION,
7485 CONTENT_URI,
7486 CALL_METHOD_GET_GLOBAL,
7487 CALL_METHOD_PUT_GLOBAL);
Christopher Tate06efb532012-08-24 15:29:27 -07007488
Christopher Tateaa036a22014-05-19 16:33:27 -07007489 // Certain settings have been moved from global to the per-user secure namespace
7490 private static final HashSet<String> MOVED_TO_SECURE;
7491 static {
7492 MOVED_TO_SECURE = new HashSet<String>(1);
7493 MOVED_TO_SECURE.add(Settings.Global.INSTALL_NON_MARKET_APPS);
7494 }
7495
Svetoslav683914b2015-01-15 14:22:26 -08007496 /** @hide */
7497 public static void getMovedToSecureSettings(Set<String> outKeySet) {
7498 outKeySet.addAll(MOVED_TO_SECURE);
7499 }
7500
Christopher Tate06efb532012-08-24 15:29:27 -07007501 /**
7502 * Look up a name in the database.
7503 * @param resolver to access the database with
7504 * @param name to look up in the table
7505 * @return the corresponding value, or null if not present
7506 */
Dianne Hackborn139748f2012-09-24 11:36:57 -07007507 public static String getString(ContentResolver resolver, String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07007508 return getStringForUser(resolver, name, UserHandle.myUserId());
7509 }
7510
7511 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -07007512 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -07007513 int userHandle) {
Christopher Tateaa036a22014-05-19 16:33:27 -07007514 if (MOVED_TO_SECURE.contains(name)) {
7515 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
7516 + " to android.provider.Settings.Secure, returning read-only value.");
7517 return Secure.getStringForUser(resolver, name, userHandle);
7518 }
Christopher Tate06efb532012-08-24 15:29:27 -07007519 return sNameValueCache.getStringForUser(resolver, name, userHandle);
7520 }
7521
7522 /**
7523 * Store a name/value pair into the database.
7524 * @param resolver to access the database with
7525 * @param name to store
7526 * @param value to associate with the name
7527 * @return true if the value was set, false on database errors
7528 */
7529 public static boolean putString(ContentResolver resolver,
7530 String name, String value) {
7531 return putStringForUser(resolver, name, value, UserHandle.myUserId());
7532 }
7533
7534 /** @hide */
7535 public static boolean putStringForUser(ContentResolver resolver,
7536 String name, String value, int userHandle) {
Christopher Tate06efb532012-08-24 15:29:27 -07007537 if (LOCAL_LOGV) {
7538 Log.v(TAG, "Global.putString(name=" + name + ", value=" + value
7539 + " for " + userHandle);
7540 }
Christopher Tateaa036a22014-05-19 16:33:27 -07007541 // Global and Secure have the same access policy so we can forward writes
7542 if (MOVED_TO_SECURE.contains(name)) {
7543 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
7544 + " to android.provider.Settings.Secure, value is unchanged.");
7545 return Secure.putStringForUser(resolver, name, value, userHandle);
7546 }
Christopher Tate06efb532012-08-24 15:29:27 -07007547 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
7548 }
7549
7550 /**
7551 * Construct the content URI for a particular name/value pair,
7552 * useful for monitoring changes with a ContentObserver.
7553 * @param name to look up in the table
7554 * @return the corresponding content URI, or null if not present
7555 */
7556 public static Uri getUriFor(String name) {
7557 return getUriFor(CONTENT_URI, name);
7558 }
7559
7560 /**
7561 * Convenience function for retrieving a single secure settings value
7562 * as an integer. Note that internally setting values are always
7563 * stored as strings; this function converts the string to an integer
7564 * for you. The default value will be returned if the setting is
7565 * not defined or not an integer.
7566 *
7567 * @param cr The ContentResolver to access.
7568 * @param name The name of the setting to retrieve.
7569 * @param def Value to return if the setting is not defined.
7570 *
7571 * @return The setting's current value, or 'def' if it is not defined
7572 * or not a valid integer.
7573 */
7574 public static int getInt(ContentResolver cr, String name, int def) {
7575 String v = getString(cr, name);
7576 try {
7577 return v != null ? Integer.parseInt(v) : def;
7578 } catch (NumberFormatException e) {
7579 return def;
7580 }
7581 }
7582
7583 /**
7584 * Convenience function for retrieving a single secure settings value
7585 * as an integer. Note that internally setting values are always
7586 * stored as strings; this function converts the string to an integer
7587 * for you.
7588 * <p>
7589 * This version does not take a default value. If the setting has not
7590 * been set, or the string value is not a number,
7591 * it throws {@link SettingNotFoundException}.
7592 *
7593 * @param cr The ContentResolver to access.
7594 * @param name The name of the setting to retrieve.
7595 *
7596 * @throws SettingNotFoundException Thrown if a setting by the given
7597 * name can't be found or the setting value is not an integer.
7598 *
7599 * @return The setting's current value.
7600 */
7601 public static int getInt(ContentResolver cr, String name)
7602 throws SettingNotFoundException {
7603 String v = getString(cr, name);
7604 try {
7605 return Integer.parseInt(v);
7606 } catch (NumberFormatException e) {
7607 throw new SettingNotFoundException(name);
7608 }
7609 }
7610
7611 /**
7612 * Convenience function for updating a single settings value as an
7613 * integer. This will either create a new entry in the table if the
7614 * given name does not exist, or modify the value of the existing row
7615 * with that name. Note that internally setting values are always
7616 * stored as strings, so this function converts the given value to a
7617 * string before storing it.
7618 *
7619 * @param cr The ContentResolver to access.
7620 * @param name The name of the setting to modify.
7621 * @param value The new value for the setting.
7622 * @return true if the value was set, false on database errors
7623 */
7624 public static boolean putInt(ContentResolver cr, String name, int value) {
7625 return putString(cr, name, Integer.toString(value));
7626 }
7627
7628 /**
7629 * Convenience function for retrieving a single secure settings value
7630 * as a {@code long}. Note that internally setting values are always
7631 * stored as strings; this function converts the string to a {@code long}
7632 * for you. The default value will be returned if the setting is
7633 * not defined or not a {@code long}.
7634 *
7635 * @param cr The ContentResolver to access.
7636 * @param name The name of the setting to retrieve.
7637 * @param def Value to return if the setting is not defined.
7638 *
7639 * @return The setting's current value, or 'def' if it is not defined
7640 * or not a valid {@code long}.
7641 */
7642 public static long getLong(ContentResolver cr, String name, long def) {
7643 String valString = getString(cr, name);
7644 long value;
7645 try {
7646 value = valString != null ? Long.parseLong(valString) : def;
7647 } catch (NumberFormatException e) {
7648 value = def;
7649 }
7650 return value;
7651 }
7652
7653 /**
7654 * Convenience function for retrieving a single secure settings value
7655 * as a {@code long}. Note that internally setting values are always
7656 * stored as strings; this function converts the string to a {@code long}
7657 * for you.
7658 * <p>
7659 * This version does not take a default value. If the setting has not
7660 * been set, or the string value is not a number,
7661 * it throws {@link SettingNotFoundException}.
7662 *
7663 * @param cr The ContentResolver to access.
7664 * @param name The name of the setting to retrieve.
7665 *
7666 * @return The setting's current value.
7667 * @throws SettingNotFoundException Thrown if a setting by the given
7668 * name can't be found or the setting value is not an integer.
7669 */
7670 public static long getLong(ContentResolver cr, String name)
7671 throws SettingNotFoundException {
7672 String valString = getString(cr, name);
7673 try {
7674 return Long.parseLong(valString);
7675 } catch (NumberFormatException e) {
7676 throw new SettingNotFoundException(name);
7677 }
7678 }
7679
7680 /**
7681 * Convenience function for updating a secure settings value as a long
7682 * integer. This will either create a new entry in the table if the
7683 * given name does not exist, or modify the value of the existing row
7684 * with that name. Note that internally setting values are always
7685 * stored as strings, so this function converts the given value to a
7686 * string before storing it.
7687 *
7688 * @param cr The ContentResolver to access.
7689 * @param name The name of the setting to modify.
7690 * @param value The new value for the setting.
7691 * @return true if the value was set, false on database errors
7692 */
7693 public static boolean putLong(ContentResolver cr, String name, long value) {
7694 return putString(cr, name, Long.toString(value));
7695 }
7696
7697 /**
7698 * Convenience function for retrieving a single secure settings value
7699 * as a floating point number. Note that internally setting values are
7700 * always stored as strings; this function converts the string to an
7701 * float for you. The default value will be returned if the setting
7702 * is not defined or not a valid float.
7703 *
7704 * @param cr The ContentResolver to access.
7705 * @param name The name of the setting to retrieve.
7706 * @param def Value to return if the setting is not defined.
7707 *
7708 * @return The setting's current value, or 'def' if it is not defined
7709 * or not a valid float.
7710 */
7711 public static float getFloat(ContentResolver cr, String name, float def) {
7712 String v = getString(cr, name);
7713 try {
7714 return v != null ? Float.parseFloat(v) : def;
7715 } catch (NumberFormatException e) {
7716 return def;
7717 }
7718 }
7719
7720 /**
7721 * Convenience function for retrieving a single secure settings value
7722 * as a float. Note that internally setting values are always
7723 * stored as strings; this function converts the string to a float
7724 * for you.
7725 * <p>
7726 * This version does not take a default value. If the setting has not
7727 * been set, or the string value is not a number,
7728 * it throws {@link SettingNotFoundException}.
7729 *
7730 * @param cr The ContentResolver to access.
7731 * @param name The name of the setting to retrieve.
7732 *
7733 * @throws SettingNotFoundException Thrown if a setting by the given
7734 * name can't be found or the setting value is not a float.
7735 *
7736 * @return The setting's current value.
7737 */
7738 public static float getFloat(ContentResolver cr, String name)
7739 throws SettingNotFoundException {
7740 String v = getString(cr, name);
7741 if (v == null) {
7742 throw new SettingNotFoundException(name);
7743 }
7744 try {
7745 return Float.parseFloat(v);
7746 } catch (NumberFormatException e) {
7747 throw new SettingNotFoundException(name);
7748 }
7749 }
7750
7751 /**
7752 * Convenience function for updating a single settings value as a
7753 * floating point number. This will either create a new entry in the
7754 * table if the given name does not exist, or modify the value of the
7755 * existing row with that name. Note that internally setting values
7756 * are always stored as strings, so this function converts the given
7757 * value to a string before storing it.
7758 *
7759 * @param cr The ContentResolver to access.
7760 * @param name The name of the setting to modify.
7761 * @param value The new value for the setting.
7762 * @return true if the value was set, false on database errors
7763 */
7764 public static boolean putFloat(ContentResolver cr, String name, float value) {
7765 return putString(cr, name, Float.toString(value));
7766 }
Wink Savillefb40dd42014-06-12 17:02:31 -07007767
7768
7769 /**
7770 * Subscription to be used for voice call on a multi sim device. The supported values
7771 * are 0 = SUB1, 1 = SUB2 and etc.
7772 * @hide
7773 */
7774 public static final String MULTI_SIM_VOICE_CALL_SUBSCRIPTION = "multi_sim_voice_call";
7775
7776 /**
7777 * Used to provide option to user to select subscription during dial.
7778 * The supported values are 0 = disable or 1 = enable prompt.
7779 * @hide
7780 */
7781 public static final String MULTI_SIM_VOICE_PROMPT = "multi_sim_voice_prompt";
7782
7783 /**
7784 * Subscription to be used for data call on a multi sim device. The supported values
7785 * are 0 = SUB1, 1 = SUB2 and etc.
7786 * @hide
7787 */
7788 public static final String MULTI_SIM_DATA_CALL_SUBSCRIPTION = "multi_sim_data_call";
7789
7790 /**
7791 * Subscription to be used for SMS on a multi sim device. The supported values
7792 * are 0 = SUB1, 1 = SUB2 and etc.
7793 * @hide
7794 */
7795 public static final String MULTI_SIM_SMS_SUBSCRIPTION = "multi_sim_sms";
7796
7797 /**
7798 * Used to provide option to user to select subscription during send SMS.
7799 * The value 1 - enable, 0 - disable
7800 * @hide
7801 */
7802 public static final String MULTI_SIM_SMS_PROMPT = "multi_sim_sms_prompt";
7803
7804
7805
7806 /** User preferred subscriptions setting.
7807 * This holds the details of the user selected subscription from the card and
7808 * the activation status. Each settings string have the coma separated values
7809 * iccId,appType,appId,activationStatus,3gppIndex,3gpp2Index
7810 * @hide
7811 */
7812 public static final String[] MULTI_SIM_USER_PREFERRED_SUBS = {"user_preferred_sub1",
7813 "user_preferred_sub2","user_preferred_sub3"};
Zheng Fub218ff42015-04-13 16:31:16 -07007814
7815 /**
7816 * Whether to enable new contacts aggregator or not.
7817 * The value 1 - enable, 0 - disable
7818 * @hide
7819 */
7820 public static final String NEW_CONTACT_AGGREGATOR = "new_contact_aggregator";
Zheng Fu31ce78c2015-04-15 16:57:53 -07007821
7822 /**
7823 * Whether to enable contacts metadata syncing or not
7824 * The value 1 - enable, 0 - disable
7825 * @hide
7826 */
7827 public static final String CONTACT_METADATA_SYNC = "contact_metadata_sync";
Christopher Tate06efb532012-08-24 15:29:27 -07007828 }
7829
7830 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007831 * User-defined bookmarks and shortcuts. The target of each bookmark is an
7832 * Intent URL, allowing it to be either a web page or a particular
7833 * application activity.
7834 *
7835 * @hide
7836 */
7837 public static final class Bookmarks implements BaseColumns
7838 {
7839 private static final String TAG = "Bookmarks";
7840
7841 /**
7842 * The content:// style URL for this table
7843 */
7844 public static final Uri CONTENT_URI =
7845 Uri.parse("content://" + AUTHORITY + "/bookmarks");
7846
7847 /**
7848 * The row ID.
7849 * <p>Type: INTEGER</p>
7850 */
7851 public static final String ID = "_id";
7852
7853 /**
7854 * Descriptive name of the bookmark that can be displayed to the user.
7855 * If this is empty, the title should be resolved at display time (use
7856 * {@link #getTitle(Context, Cursor)} any time you want to display the
7857 * title of a bookmark.)
7858 * <P>
7859 * Type: TEXT
7860 * </P>
7861 */
7862 public static final String TITLE = "title";
7863
7864 /**
7865 * Arbitrary string (displayed to the user) that allows bookmarks to be
7866 * organized into categories. There are some special names for
7867 * standard folders, which all start with '@'. The label displayed for
7868 * the folder changes with the locale (via {@link #getLabelForFolder}) but
7869 * the folder name does not change so you can consistently query for
7870 * the folder regardless of the current locale.
7871 *
7872 * <P>Type: TEXT</P>
7873 *
7874 */
7875 public static final String FOLDER = "folder";
7876
7877 /**
7878 * The Intent URL of the bookmark, describing what it points to. This
7879 * value is given to {@link android.content.Intent#getIntent} to create
7880 * an Intent that can be launched.
7881 * <P>Type: TEXT</P>
7882 */
7883 public static final String INTENT = "intent";
7884
7885 /**
7886 * Optional shortcut character associated with this bookmark.
7887 * <P>Type: INTEGER</P>
7888 */
7889 public static final String SHORTCUT = "shortcut";
7890
7891 /**
7892 * The order in which the bookmark should be displayed
7893 * <P>Type: INTEGER</P>
7894 */
7895 public static final String ORDERING = "ordering";
7896
7897 private static final String[] sIntentProjection = { INTENT };
7898 private static final String[] sShortcutProjection = { ID, SHORTCUT };
7899 private static final String sShortcutSelection = SHORTCUT + "=?";
7900
7901 /**
7902 * Convenience function to retrieve the bookmarked Intent for a
7903 * particular shortcut key.
7904 *
7905 * @param cr The ContentResolver to query.
7906 * @param shortcut The shortcut key.
7907 *
7908 * @return Intent The bookmarked URL, or null if there is no bookmark
7909 * matching the given shortcut.
7910 */
7911 public static Intent getIntentForShortcut(ContentResolver cr, char shortcut)
7912 {
7913 Intent intent = null;
7914
7915 Cursor c = cr.query(CONTENT_URI,
7916 sIntentProjection, sShortcutSelection,
7917 new String[] { String.valueOf((int) shortcut) }, ORDERING);
7918 // Keep trying until we find a valid shortcut
7919 try {
7920 while (intent == null && c.moveToNext()) {
7921 try {
7922 String intentURI = c.getString(c.getColumnIndexOrThrow(INTENT));
Christian Mehlmauera34d2c92010-05-25 19:04:20 +02007923 intent = Intent.parseUri(intentURI, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007924 } catch (java.net.URISyntaxException e) {
7925 // The stored URL is bad... ignore it.
7926 } catch (IllegalArgumentException e) {
7927 // Column not found
Dianne Hackborna33e3f72009-09-29 17:28:24 -07007928 Log.w(TAG, "Intent column not found", e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007929 }
7930 }
7931 } finally {
7932 if (c != null) c.close();
7933 }
7934
7935 return intent;
7936 }
7937
7938 /**
7939 * Add a new bookmark to the system.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07007940 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007941 * @param cr The ContentResolver to query.
7942 * @param intent The desired target of the bookmark.
7943 * @param title Bookmark title that is shown to the user; null if none
7944 * or it should be resolved to the intent's title.
7945 * @param folder Folder in which to place the bookmark; null if none.
7946 * @param shortcut Shortcut that will invoke the bookmark; 0 if none. If
7947 * this is non-zero and there is an existing bookmark entry
7948 * with this same shortcut, then that existing shortcut is
7949 * cleared (the bookmark is not removed).
7950 * @return The unique content URL for the new bookmark entry.
7951 */
7952 public static Uri add(ContentResolver cr,
7953 Intent intent,
7954 String title,
7955 String folder,
7956 char shortcut,
7957 int ordering)
7958 {
7959 // If a shortcut is supplied, and it is already defined for
7960 // another bookmark, then remove the old definition.
7961 if (shortcut != 0) {
Jeff Hamilton7cd51ef2010-05-12 17:30:27 -05007962 cr.delete(CONTENT_URI, sShortcutSelection,
7963 new String[] { String.valueOf((int) shortcut) });
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007964 }
7965
7966 ContentValues values = new ContentValues();
7967 if (title != null) values.put(TITLE, title);
7968 if (folder != null) values.put(FOLDER, folder);
Jean-Baptiste Queru3b9f0a32010-06-21 13:46:59 -07007969 values.put(INTENT, intent.toUri(0));
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007970 if (shortcut != 0) values.put(SHORTCUT, (int) shortcut);
7971 values.put(ORDERING, ordering);
7972 return cr.insert(CONTENT_URI, values);
7973 }
7974
7975 /**
7976 * Return the folder name as it should be displayed to the user. This
7977 * takes care of localizing special folders.
7978 *
7979 * @param r Resources object for current locale; only need access to
7980 * system resources.
7981 * @param folder The value found in the {@link #FOLDER} column.
7982 *
7983 * @return CharSequence The label for this folder that should be shown
7984 * to the user.
7985 */
7986 public static CharSequence getLabelForFolder(Resources r, String folder) {
7987 return folder;
7988 }
7989
7990 /**
7991 * Return the title as it should be displayed to the user. This takes
7992 * care of localizing bookmarks that point to activities.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07007993 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007994 * @param context A context.
7995 * @param cursor A cursor pointing to the row whose title should be
7996 * returned. The cursor must contain at least the {@link #TITLE}
7997 * and {@link #INTENT} columns.
7998 * @return A title that is localized and can be displayed to the user,
7999 * or the empty string if one could not be found.
8000 */
8001 public static CharSequence getTitle(Context context, Cursor cursor) {
8002 int titleColumn = cursor.getColumnIndex(TITLE);
8003 int intentColumn = cursor.getColumnIndex(INTENT);
8004 if (titleColumn == -1 || intentColumn == -1) {
8005 throw new IllegalArgumentException(
8006 "The cursor must contain the TITLE and INTENT columns.");
8007 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07008008
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008009 String title = cursor.getString(titleColumn);
8010 if (!TextUtils.isEmpty(title)) {
8011 return title;
8012 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07008013
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008014 String intentUri = cursor.getString(intentColumn);
8015 if (TextUtils.isEmpty(intentUri)) {
8016 return "";
8017 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07008018
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008019 Intent intent;
8020 try {
Christian Mehlmauera34d2c92010-05-25 19:04:20 +02008021 intent = Intent.parseUri(intentUri, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008022 } catch (URISyntaxException e) {
8023 return "";
8024 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07008025
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008026 PackageManager packageManager = context.getPackageManager();
8027 ResolveInfo info = packageManager.resolveActivity(intent, 0);
8028 return info != null ? info.loadLabel(packageManager) : "";
8029 }
8030 }
8031
8032 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008033 * Returns the device ID that we should use when connecting to the mobile gtalk server.
8034 * This is a string like "android-0x1242", where the hex string is the Android ID obtained
8035 * from the GoogleLoginService.
8036 *
8037 * @param androidId The Android ID for this device.
8038 * @return The device ID that should be used when connecting to the mobile gtalk server.
8039 * @hide
8040 */
8041 public static String getGTalkDeviceId(long androidId) {
8042 return "android-" + Long.toHexString(androidId);
8043 }
8044}