blob: 8dc27dcf416ee1e4b6f1019561feb9520c82355b [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 Brown89d55462012-09-19 11:33:42 -0700327 * Activity Action: Show settings to allow configuration of Wifi Displays.
328 * <p>
329 * In some cases, a matching Activity may not exist, so ensure you
330 * safeguard against this.
331 * <p>
332 * Input: Nothing.
333 * <p>
334 * Output: Nothing.
335 * @hide
336 */
337 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
338 public static final String ACTION_WIFI_DISPLAY_SETTINGS =
339 "android.settings.WIFI_DISPLAY_SETTINGS";
340
341 /**
Jeff Brown1a937b02014-07-01 22:13:04 -0700342 * Activity Action: Show settings to allow configuration of
343 * {@link android.media.routing.MediaRouteService media route providers}.
344 * <p>
345 * In some cases, a matching Activity may not exist, so ensure you
346 * safeguard against this.
347 * <p>
348 * Input: Nothing.
349 * <p>
350 * Output: Nothing.
351 */
352 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
353 public static final String ACTION_CAST_SETTINGS =
354 "android.settings.CAST_SETTINGS";
355
356 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800357 * Activity Action: Show settings to allow configuration of date and time.
358 * <p>
359 * In some cases, a matching Activity may not exist, so ensure you
360 * safeguard against this.
361 * <p>
362 * Input: Nothing.
363 * <p>
364 * Output: Nothing.
365 */
366 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
367 public static final String ACTION_DATE_SETTINGS =
368 "android.settings.DATE_SETTINGS";
369
370 /**
371 * Activity Action: Show settings to allow configuration of sound and volume.
372 * <p>
373 * In some cases, a matching Activity may not exist, so ensure you
374 * safeguard against this.
375 * <p>
376 * Input: Nothing.
377 * <p>
378 * Output: Nothing.
379 */
380 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
381 public static final String ACTION_SOUND_SETTINGS =
382 "android.settings.SOUND_SETTINGS";
383
384 /**
385 * Activity Action: Show settings to allow configuration of display.
386 * <p>
387 * In some cases, a matching Activity may not exist, so ensure you
388 * safeguard against this.
389 * <p>
390 * Input: Nothing.
391 * <p>
392 * Output: Nothing.
393 */
394 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
395 public static final String ACTION_DISPLAY_SETTINGS =
396 "android.settings.DISPLAY_SETTINGS";
397
398 /**
399 * Activity Action: Show settings to allow configuration of locale.
400 * <p>
401 * In some cases, a matching Activity may not exist, so ensure you
402 * safeguard against this.
403 * <p>
404 * Input: Nothing.
405 * <p>
406 * Output: Nothing.
407 */
408 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
409 public static final String ACTION_LOCALE_SETTINGS =
410 "android.settings.LOCALE_SETTINGS";
411
412 /**
413 * Activity Action: Show settings to configure input methods, in particular
414 * allowing the user to enable input methods.
415 * <p>
416 * In some cases, a matching Activity may not exist, so ensure you
417 * safeguard against this.
418 * <p>
419 * Input: Nothing.
420 * <p>
421 * Output: Nothing.
422 */
423 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
Dianne Hackborna3fb40d2014-08-12 15:06:50 -0700424 public static final String ACTION_VOICE_INPUT_SETTINGS =
425 "android.settings.VOICE_INPUT_SETTINGS";
426
427 /**
428 * Activity Action: Show settings to configure input methods, in particular
429 * allowing the user to enable input methods.
430 * <p>
431 * In some cases, a matching Activity may not exist, so ensure you
432 * safeguard against this.
433 * <p>
434 * Input: Nothing.
435 * <p>
436 * Output: Nothing.
437 */
438 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800439 public static final String ACTION_INPUT_METHOD_SETTINGS =
440 "android.settings.INPUT_METHOD_SETTINGS";
441
442 /**
Tadashi G. Takaokaf49688f2011-01-20 17:56:13 +0900443 * Activity Action: Show settings to enable/disable input method subtypes.
satok86417ea2010-10-27 14:11:03 +0900444 * <p>
445 * In some cases, a matching Activity may not exist, so ensure you
446 * safeguard against this.
447 * <p>
Tadashi G. Takaoka25480202011-01-20 23:13:02 +0900448 * To tell which input method's subtypes are displayed in the settings, add
449 * {@link #EXTRA_INPUT_METHOD_ID} extra to this Intent with the input method id.
450 * If there is no extra in this Intent, subtypes from all installed input methods
451 * will be displayed in the settings.
452 *
453 * @see android.view.inputmethod.InputMethodInfo#getId
454 * <p>
satok86417ea2010-10-27 14:11:03 +0900455 * Input: Nothing.
456 * <p>
457 * Output: Nothing.
458 */
459 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
Tadashi G. Takaokaf49688f2011-01-20 17:56:13 +0900460 public static final String ACTION_INPUT_METHOD_SUBTYPE_SETTINGS =
461 "android.settings.INPUT_METHOD_SUBTYPE_SETTINGS";
satok86417ea2010-10-27 14:11:03 +0900462
463 /**
satok7cfc0ed2011-06-20 21:29:36 +0900464 * Activity Action: Show a dialog to select input method.
465 * <p>
466 * In some cases, a matching Activity may not exist, so ensure you
467 * safeguard against this.
468 * <p>
469 * Input: Nothing.
470 * <p>
471 * Output: Nothing.
472 * @hide
473 */
474 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
475 public static final String ACTION_SHOW_INPUT_METHOD_PICKER =
476 "android.settings.SHOW_INPUT_METHOD_PICKER";
477
478 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800479 * Activity Action: Show settings to manage the user input dictionary.
480 * <p>
Chet Haasee8222dd2013-09-05 07:44:18 -0700481 * Starting with {@link android.os.Build.VERSION_CODES#KITKAT},
Satoshi Kataoka2aa2bc52013-07-30 14:25:11 +0900482 * it is guaranteed there will always be an appropriate implementation for this Intent action.
483 * 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 -0800484 * <p>
485 * Input: Nothing.
486 * <p>
487 * Output: Nothing.
488 */
489 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
490 public static final String ACTION_USER_DICTIONARY_SETTINGS =
491 "android.settings.USER_DICTIONARY_SETTINGS";
492
493 /**
Gilles Debunnee90bed12011-08-30 14:28:27 -0700494 * Activity Action: Adds a word to the user dictionary.
495 * <p>
496 * In some cases, a matching Activity may not exist, so ensure you
497 * safeguard against this.
498 * <p>
499 * Input: An extra with key <code>word</code> that contains the word
500 * that should be added to the dictionary.
501 * <p>
502 * Output: Nothing.
503 *
504 * @hide
505 */
506 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
507 public static final String ACTION_USER_DICTIONARY_INSERT =
508 "com.android.settings.USER_DICTIONARY_INSERT";
509
510 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800511 * Activity Action: Show settings to allow configuration of application-related settings.
512 * <p>
513 * In some cases, a matching Activity may not exist, so ensure you
514 * safeguard against this.
515 * <p>
516 * Input: Nothing.
517 * <p>
518 * Output: Nothing.
519 */
520 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
521 public static final String ACTION_APPLICATION_SETTINGS =
522 "android.settings.APPLICATION_SETTINGS";
523
524 /**
525 * Activity Action: Show settings to allow configuration of application
Dianne Hackborn8d866e52012-10-10 18:39:45 -0700526 * development-related settings. As of
527 * {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1} this action is
528 * a required part of the platform.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800529 * <p>
530 * Input: Nothing.
531 * <p>
532 * Output: Nothing.
533 */
534 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
535 public static final String ACTION_APPLICATION_DEVELOPMENT_SETTINGS =
536 "android.settings.APPLICATION_DEVELOPMENT_SETTINGS";
537
538 /**
539 * Activity Action: Show settings to allow configuration of quick launch shortcuts.
540 * <p>
541 * In some cases, a matching Activity may not exist, so ensure you
542 * safeguard against this.
543 * <p>
544 * Input: Nothing.
545 * <p>
546 * Output: Nothing.
547 */
548 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
549 public static final String ACTION_QUICK_LAUNCH_SETTINGS =
550 "android.settings.QUICK_LAUNCH_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700551
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800552 /**
553 * Activity Action: Show settings to manage installed applications.
554 * <p>
555 * In some cases, a matching Activity may not exist, so ensure you
556 * safeguard against this.
557 * <p>
558 * Input: Nothing.
559 * <p>
560 * Output: Nothing.
561 */
562 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
563 public static final String ACTION_MANAGE_APPLICATIONS_SETTINGS =
564 "android.settings.MANAGE_APPLICATIONS_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700565
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800566 /**
Winson Chung44e8ff92010-09-27 14:36:52 -0700567 * Activity Action: Show settings to manage all applications.
568 * <p>
569 * In some cases, a matching Activity may not exist, so ensure you
570 * safeguard against this.
571 * <p>
572 * Input: Nothing.
573 * <p>
574 * Output: Nothing.
575 */
576 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
577 public static final String ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS =
578 "android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS";
579
580 /**
Dianne Hackbornb7bb3b32010-06-06 22:47:50 -0700581 * Activity Action: Show screen of details about a particular application.
582 * <p>
583 * In some cases, a matching Activity may not exist, so ensure you
584 * safeguard against this.
585 * <p>
586 * Input: The Intent's data URI specifies the application package name
587 * to be shown, with the "package" scheme. That is "package:com.my.app".
588 * <p>
589 * Output: Nothing.
590 */
591 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
592 public static final String ACTION_APPLICATION_DETAILS_SETTINGS =
593 "android.settings.APPLICATION_DETAILS_SETTINGS";
594
595 /**
Dianne Hackborn35654b62013-01-14 17:38:02 -0800596 * @hide
597 * Activity Action: Show the "app ops" settings screen.
598 * <p>
599 * Input: Nothing.
600 * <p>
601 * Output: Nothing.
602 */
603 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
604 public static final String ACTION_APP_OPS_SETTINGS =
605 "android.settings.APP_OPS_SETTINGS";
606
607 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800608 * Activity Action: Show settings for system update functionality.
609 * <p>
610 * In some cases, a matching Activity may not exist, so ensure you
611 * safeguard against this.
612 * <p>
613 * Input: Nothing.
614 * <p>
615 * Output: Nothing.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700616 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800617 * @hide
618 */
619 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
620 public static final String ACTION_SYSTEM_UPDATE_SETTINGS =
621 "android.settings.SYSTEM_UPDATE_SETTINGS";
622
623 /**
624 * Activity Action: Show settings to allow configuration of sync settings.
625 * <p>
626 * In some cases, a matching Activity may not exist, so ensure you
627 * safeguard against this.
628 * <p>
Erikeebc8e22010-02-18 13:27:19 -0800629 * The account types available to add via the add account button may be restricted by adding an
630 * {@link #EXTRA_AUTHORITIES} extra to this Intent with one or more syncable content provider's
631 * authorities. Only account types which can sync with that content provider will be offered to
632 * the user.
633 * <p>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800634 * Input: Nothing.
635 * <p>
636 * Output: Nothing.
637 */
638 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
639 public static final String ACTION_SYNC_SETTINGS =
640 "android.settings.SYNC_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700641
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800642 /**
Erikeebc8e22010-02-18 13:27:19 -0800643 * Activity Action: Show add account screen for creating a new account.
644 * <p>
645 * In some cases, a matching Activity may not exist, so ensure you
646 * safeguard against this.
647 * <p>
648 * The account types available to add may be restricted by adding an {@link #EXTRA_AUTHORITIES}
649 * extra to the Intent with one or more syncable content provider's authorities. Only account
650 * types which can sync with that content provider will be offered to the user.
651 * <p>
Alon Albert50359c22013-02-26 14:47:48 -0800652 * Account types can also be filtered by adding an {@link #EXTRA_ACCOUNT_TYPES} extra to the
653 * Intent with one or more account types.
654 * <p>
Erikeebc8e22010-02-18 13:27:19 -0800655 * Input: Nothing.
656 * <p>
657 * Output: Nothing.
658 */
659 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
660 public static final String ACTION_ADD_ACCOUNT =
661 "android.settings.ADD_ACCOUNT_SETTINGS";
662
663 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800664 * Activity Action: Show settings for selecting the network operator.
665 * <p>
666 * In some cases, a matching Activity may not exist, so ensure you
667 * safeguard against this.
668 * <p>
669 * Input: Nothing.
670 * <p>
671 * Output: Nothing.
672 */
673 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
674 public static final String ACTION_NETWORK_OPERATOR_SETTINGS =
675 "android.settings.NETWORK_OPERATOR_SETTINGS";
676
677 /**
678 * Activity Action: Show settings for selection of 2G/3G.
679 * <p>
680 * In some cases, a matching Activity may not exist, so ensure you
681 * safeguard against this.
682 * <p>
683 * Input: Nothing.
684 * <p>
685 * Output: Nothing.
686 */
687 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
688 public static final String ACTION_DATA_ROAMING_SETTINGS =
689 "android.settings.DATA_ROAMING_SETTINGS";
690
691 /**
692 * Activity Action: Show settings for internal storage.
693 * <p>
694 * In some cases, a matching Activity may not exist, so ensure you
695 * safeguard against this.
696 * <p>
697 * Input: Nothing.
698 * <p>
699 * Output: Nothing.
700 */
701 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
702 public static final String ACTION_INTERNAL_STORAGE_SETTINGS =
703 "android.settings.INTERNAL_STORAGE_SETTINGS";
704 /**
705 * Activity Action: Show settings for memory card storage.
706 * <p>
707 * In some cases, a matching Activity may not exist, so ensure you
708 * safeguard against this.
709 * <p>
710 * Input: Nothing.
711 * <p>
712 * Output: Nothing.
713 */
714 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
715 public static final String ACTION_MEMORY_CARD_SETTINGS =
716 "android.settings.MEMORY_CARD_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700717
Justin Mattsonef340352010-01-13 21:05:46 -0800718 /**
719 * Activity Action: Show settings for global search.
720 * <p>
721 * In some cases, a matching Activity may not exist, so ensure you
722 * safeguard against this.
723 * <p>
724 * Input: Nothing.
725 * <p>
726 * Output: Nothing
727 */
728 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
729 public static final String ACTION_SEARCH_SETTINGS =
730 "android.search.action.SEARCH_SETTINGS";
731
Daniel Sandler9d8b8762010-01-22 20:50:15 -0500732 /**
733 * Activity Action: Show general device information settings (serial
734 * number, software version, phone number, etc.).
735 * <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
742 */
743 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
744 public static final String ACTION_DEVICE_INFO_SETTINGS =
745 "android.settings.DEVICE_INFO_SETTINGS";
746
Martijn Coenen9b3c83f2011-07-28 11:21:39 -0500747 /**
Nick Pellycccf01d2011-10-31 14:49:40 -0700748 * Activity Action: Show NFC settings.
749 * <p>
750 * This shows UI that allows NFC to be turned on or off.
Martijn Coenen9b3c83f2011-07-28 11:21:39 -0500751 * <p>
752 * In some cases, a matching Activity may not exist, so ensure you
753 * safeguard against this.
754 * <p>
755 * Input: Nothing.
756 * <p>
757 * Output: Nothing
Nick Pellycccf01d2011-10-31 14:49:40 -0700758 * @see android.nfc.NfcAdapter#isEnabled()
759 */
760 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
761 public static final String ACTION_NFC_SETTINGS = "android.settings.NFC_SETTINGS";
762
763 /**
764 * Activity Action: Show NFC Sharing settings.
765 * <p>
766 * This shows UI that allows NDEF Push (Android Beam) to be turned on or
767 * off.
768 * <p>
769 * In some cases, a matching Activity may not exist, so ensure you
770 * safeguard against this.
771 * <p>
772 * Input: Nothing.
773 * <p>
774 * Output: Nothing
775 * @see android.nfc.NfcAdapter#isNdefPushEnabled()
Martijn Coenen9b3c83f2011-07-28 11:21:39 -0500776 */
777 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
778 public static final String ACTION_NFCSHARING_SETTINGS =
779 "android.settings.NFCSHARING_SETTINGS";
780
Daniel Sandlerc08cd022012-11-27 22:47:37 -0500781 /**
Martijn Coenen62c196a2013-08-09 13:43:34 -0700782 * Activity Action: Show NFC Tap & Pay settings
783 * <p>
784 * This shows UI that allows the user to configure Tap&Pay
785 * settings.
786 * <p>
787 * In some cases, a matching Activity may not exist, so ensure you
788 * safeguard against this.
789 * <p>
790 * Input: Nothing.
791 * <p>
792 * Output: Nothing
793 */
794 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
795 public static final String ACTION_NFC_PAYMENT_SETTINGS =
796 "android.settings.NFC_PAYMENT_SETTINGS";
797
798 /**
Daniel Sandlerc08cd022012-11-27 22:47:37 -0500799 * Activity Action: Show Daydream settings.
800 * <p>
801 * In some cases, a matching Activity may not exist, so ensure you
802 * safeguard against this.
803 * <p>
804 * Input: Nothing.
805 * <p>
806 * Output: Nothing.
807 * @see android.service.dreams.DreamService
Daniel Sandlerc08cd022012-11-27 22:47:37 -0500808 */
809 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
810 public static final String ACTION_DREAM_SETTINGS = "android.settings.DREAM_SETTINGS";
811
Daniel Sandler5feceeb2013-03-22 18:29:23 -0700812 /**
813 * Activity Action: Show Notification listener settings.
814 * <p>
815 * In some cases, a matching Activity may not exist, so ensure you
816 * safeguard against this.
817 * <p>
818 * Input: Nothing.
819 * <p>
820 * Output: Nothing.
821 * @see android.service.notification.NotificationListenerService
Daniel Sandler5feceeb2013-03-22 18:29:23 -0700822 */
823 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
824 public static final String ACTION_NOTIFICATION_LISTENER_SETTINGS
Chris Wren8326a8a2014-10-22 14:13:32 -0400825 = "android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS";
Daniel Sandler5feceeb2013-03-22 18:29:23 -0700826
Alan Viverette69ce69b2013-08-29 12:23:48 -0700827 /**
John Spurlock7340fc82014-04-24 18:50:12 -0400828 * @hide
829 */
830 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
831 public static final String ACTION_CONDITION_PROVIDER_SETTINGS
832 = "android.settings.ACTION_CONDITION_PROVIDER_SETTINGS";
833
834 /**
Alan Viverette69ce69b2013-08-29 12:23:48 -0700835 * Activity Action: Show settings for video captioning.
836 * <p>
837 * In some cases, a matching Activity may not exist, so ensure you safeguard
838 * against this.
839 * <p>
840 * Input: Nothing.
841 * <p>
842 * Output: Nothing.
843 */
844 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
845 public static final String ACTION_CAPTIONING_SETTINGS = "android.settings.CAPTIONING_SETTINGS";
846
Svetoslav773f54d2013-09-03 14:01:43 -0700847 /**
848 * Activity Action: Show the top level print settings.
849 * <p>
850 * In some cases, a matching Activity may not exist, so ensure you
851 * safeguard against this.
852 * <p>
853 * Input: Nothing.
854 * <p>
855 * Output: Nothing.
856 */
857 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
858 public static final String ACTION_PRINT_SETTINGS =
859 "android.settings.ACTION_PRINT_SETTINGS";
860
John Spurlockde547002014-02-28 17:50:39 -0500861 /**
862 * Activity Action: Show Zen Mode configuration settings.
863 *
864 * @hide
865 */
866 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
867 public static final String ACTION_ZEN_MODE_SETTINGS = "android.settings.ZEN_MODE_SETTINGS";
868
Santos Cordona4c75242014-07-09 12:07:51 -0700869 /**
John Spurlockfc746f82015-04-03 13:47:14 -0400870 * Activity Action: Show Zen Mode priority configuration settings.
871 *
872 * @hide
873 */
874 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
875 public static final String ACTION_ZEN_MODE_PRIORITY_SETTINGS
876 = "android.settings.ZEN_MODE_PRIORITY_SETTINGS";
877
878 /**
John Spurlock7af10182015-04-03 15:10:31 -0400879 * Activity Action: Show Zen Mode automation configuration settings.
880 *
881 * @hide
882 */
883 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
884 public static final String ACTION_ZEN_MODE_AUTOMATION_SETTINGS
885 = "android.settings.ZEN_MODE_AUTOMATION_SETTINGS";
886
887 /**
Barnaby Jamesb3006d32015-04-02 17:49:54 -0700888 * Activity Action: Modify do not disturb mode settings.
889 * <p>
890 * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
891 * <p>
892 * This intent MUST be started using
893 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
894 * startVoiceActivity}.
895 * <p>
896 * Note: The Activity implementing this intent MUST verify that
897 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction}.
898 * returns true before modifying the setting.
899 * <p>
900 * Input: The optional {@link #EXTRA_DO_NOT_DISTURB_MODE_MINUTES} extra can be used to indicate
901 * how long the user wishes to avoid interruptions for. The optional
902 * {@link #EXTRA_DO_NOT_DISTURB_MODE_ENABLED} extra can be to indicate if the user is
903 * enabling or disabling do not disturb mode. If either extra is not included, the
904 * user maybe asked to provide the value.
905 * <p>
906 * Output: Nothing.
907 */
908 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
909 public static final String ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE =
910 "android.settings.VOICE_CONTROL_DO_NOT_DISTURB_MODE";
911
912 /**
John Spurlockb2278d62015-04-07 12:47:12 -0400913 * Activity Action: Show Zen Mode schedule rule configuration settings.
914 *
915 * @hide
916 */
917 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
918 public static final String ACTION_ZEN_MODE_SCHEDULE_RULE_SETTINGS
919 = "android.settings.ZEN_MODE_SCHEDULE_RULE_SETTINGS";
920
921 /**
John Spurlock39581cc2015-04-10 11:59:01 -0400922 * Activity Action: Show Zen Mode external rule configuration settings.
923 *
924 * @hide
925 */
926 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
927 public static final String ACTION_ZEN_MODE_EXTERNAL_RULE_SETTINGS
928 = "android.settings.ZEN_MODE_EXTERNAL_RULE_SETTINGS";
929
930 /**
Santos Cordona4c75242014-07-09 12:07:51 -0700931 * Activity Action: Show the regulatory information screen for the device.
932 * <p>
933 * In some cases, a matching Activity may not exist, so ensure you safeguard
934 * against this.
935 * <p>
936 * Input: Nothing.
937 * <p>
938 * Output: Nothing.
939 */
Jeff Sharkeydd77fda2014-04-16 17:23:08 -0700940 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
941 public static final String
942 ACTION_SHOW_REGULATORY_INFO = "android.settings.SHOW_REGULATORY_INFO";
943
Jerome Poichet7974cb32014-05-14 12:04:43 -0700944 /**
945 * Activity Action: Show Device Name Settings.
946 * <p>
947 * In some cases, a matching Activity may not exist, so ensure you safeguard
Tim Kilbourn87cd0dc2014-04-14 15:37:51 -0700948 * against this.
Jerome Poichet7974cb32014-05-14 12:04:43 -0700949 *
950 * @hide
951 */
952 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
953 public static final String DEVICE_NAME_SETTINGS = "android.settings.DEVICE_NAME";
954
Tim Kilbourn87cd0dc2014-04-14 15:37:51 -0700955 /**
956 * Activity Action: Show pairing settings.
957 * <p>
958 * In some cases, a matching Activity may not exist, so ensure you safeguard
959 * against this.
960 *
961 * @hide
962 */
963 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
964 public static final String ACTION_PAIRING_SETTINGS = "android.settings.PAIRING_SETTINGS";
965
John Spurlockf8f524c2014-06-10 14:47:29 -0400966 /**
967 * Activity Action: Show battery saver settings.
John Spurlock73466662014-10-30 13:42:05 -0400968 * <p>
969 * In some cases, a matching Activity may not exist, so ensure you safeguard
970 * against this.
John Spurlockf8f524c2014-06-10 14:47:29 -0400971 */
972 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
973 public static final String ACTION_BATTERY_SAVER_SETTINGS
974 = "android.settings.BATTERY_SAVER_SETTINGS";
975
Amith Yamasanieb7b94a2014-07-14 18:02:08 -0700976 /**
Barnaby Jamesb3006d32015-04-02 17:49:54 -0700977 * Activity Action: Modify Battery Saver mode setting using a voice command.
978 * <p>
979 * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
980 * <p>
981 * This intent MUST be started using
982 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
983 * startVoiceActivity}.
984 * <p>
985 * Note: The activity implementing this intent MUST verify that
986 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before
987 * modifying the setting.
988 * <p>
989 * Input: To tell which state batter saver mode should be set to, add the
990 * {@link #EXTRA_BATTERY_SAVER_MODE_ENABLED} extra to this Intent with the state specified.
991 * If the extra is not included, no changes will be made.
992 * <p>
993 * Output: Nothing.
994 */
995 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
996 public static final String ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE =
997 "android.settings.VOICE_CONTROL_BATTERY_SAVER_MODE";
998
999 /**
Amith Yamasanieb7b94a2014-07-14 18:02:08 -07001000 * Activity Action: Show Home selection settings. If there are multiple activities
1001 * that can satisfy the {@link Intent#CATEGORY_HOME} intent, this screen allows you
1002 * to pick your preferred activity.
1003 */
1004 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1005 public static final String ACTION_HOME_SETTINGS
1006 = "android.settings.HOME_SETTINGS";
1007
John Spurlock2b0e09c2014-07-27 13:27:47 -04001008 /**
1009 * Activity Action: Show notification settings.
1010 *
1011 * @hide
1012 */
1013 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1014 public static final String ACTION_NOTIFICATION_SETTINGS
1015 = "android.settings.NOTIFICATION_SETTINGS";
1016
1017 /**
1018 * Activity Action: Show notification settings for a single app.
1019 *
1020 * @hide
1021 */
1022 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1023 public static final String ACTION_APP_NOTIFICATION_SETTINGS
1024 = "android.settings.APP_NOTIFICATION_SETTINGS";
1025
Chris Wrencd8f4f72014-08-27 18:48:13 -04001026 /**
1027 * Activity Action: Show notification redaction settings.
1028 *
1029 * @hide
1030 */
1031 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1032 public static final String ACTION_APP_NOTIFICATION_REDACTION
1033 = "android.settings.ACTION_APP_NOTIFICATION_REDACTION";
1034
John Spurlock2b0e09c2014-07-27 13:27:47 -04001035 /** @hide */ public static final String EXTRA_APP_UID = "app_uid";
1036 /** @hide */ public static final String EXTRA_APP_PACKAGE = "app_package";
1037
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001038 // End of Intent actions for Settings
1039
Erikeebc8e22010-02-18 13:27:19 -08001040 /**
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001041 * @hide - Private call() method on SettingsProvider to read from 'system' table.
1042 */
1043 public static final String CALL_METHOD_GET_SYSTEM = "GET_system";
1044
1045 /**
1046 * @hide - Private call() method on SettingsProvider to read from 'secure' table.
1047 */
1048 public static final String CALL_METHOD_GET_SECURE = "GET_secure";
1049
1050 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001051 * @hide - Private call() method on SettingsProvider to read from 'global' table.
1052 */
1053 public static final String CALL_METHOD_GET_GLOBAL = "GET_global";
1054
1055 /**
1056 * @hide - User handle argument extra to the fast-path call()-based requests
1057 */
1058 public static final String CALL_METHOD_USER_KEY = "_user";
1059
1060 /** @hide - Private call() method to write to 'system' table */
1061 public static final String CALL_METHOD_PUT_SYSTEM = "PUT_system";
1062
1063 /** @hide - Private call() method to write to 'secure' table */
1064 public static final String CALL_METHOD_PUT_SECURE = "PUT_secure";
1065
1066 /** @hide - Private call() method to write to 'global' table */
1067 public static final String CALL_METHOD_PUT_GLOBAL= "PUT_global";
1068
1069 /**
Erikeebc8e22010-02-18 13:27:19 -08001070 * Activity Extra: Limit available options in launched activity based on the given authority.
1071 * <p>
1072 * This can be passed as an extra field in an Activity Intent with one or more syncable content
1073 * provider's authorities as a String[]. This field is used by some intents to alter the
1074 * behavior of the called activity.
1075 * <p>
1076 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types available based
1077 * on the authority given.
1078 */
Alon Albert50359c22013-02-26 14:47:48 -08001079 public static final String EXTRA_AUTHORITIES = "authorities";
1080
Alon Albertd35bf1f2013-04-18 14:26:51 -07001081 /**
1082 * Activity Extra: Limit available options in launched activity based on the given account
1083 * types.
1084 * <p>
1085 * This can be passed as an extra field in an Activity Intent with one or more account types
1086 * as a String[]. This field is used by some intents to alter the behavior of the called
1087 * activity.
1088 * <p>
1089 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types to the specified
1090 * list.
1091 */
Alon Albert50359c22013-02-26 14:47:48 -08001092 public static final String EXTRA_ACCOUNT_TYPES = "account_types";
Erikeebc8e22010-02-18 13:27:19 -08001093
Tadashi G. Takaoka25480202011-01-20 23:13:02 +09001094 public static final String EXTRA_INPUT_METHOD_ID = "input_method_id";
1095
Barnaby James48f35522014-07-16 14:27:39 -07001096 /**
Michael Wrightc93fbd12014-09-22 20:07:59 -07001097 * Activity Extra: The device identifier to act upon.
1098 * <p>
1099 * This can be passed as an extra field in an Activity Intent with a single
1100 * InputDeviceIdentifier. This field is used by some activities to jump straight into the
1101 * settings for the given device.
1102 * <p>
Dianne Hackbornad6a99b2014-11-18 10:11:10 -08001103 * Example: The {@link #ACTION_INPUT_METHOD_SETTINGS} intent opens the keyboard layout
1104 * dialog for the given device.
Michael Wrightc93fbd12014-09-22 20:07:59 -07001105 * @hide
1106 */
1107 public static final String EXTRA_INPUT_DEVICE_IDENTIFIER = "input_device_identifier";
1108
1109 /**
Barnaby James48f35522014-07-16 14:27:39 -07001110 * Activity Extra: Enable or disable Airplane Mode.
1111 * <p>
1112 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_AIRPLANE_MODE}
Barnaby Jamesb3006d32015-04-02 17:49:54 -07001113 * intent as a boolean to indicate if it should be enabled.
Barnaby James48f35522014-07-16 14:27:39 -07001114 */
1115 public static final String EXTRA_AIRPLANE_MODE_ENABLED = "airplane_mode_enabled";
1116
Barnaby Jamesb3006d32015-04-02 17:49:54 -07001117 /**
1118 * Activity Extra: Enable or disable Battery saver mode.
1119 * <p>
1120 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE}
1121 * intent as a boolean to indicate if it should be enabled.
1122 */
1123 public static final String EXTRA_BATTERY_SAVER_MODE_ENABLED =
1124 "android.settings.extra.battery_saver_mode_enabled";
1125
1126 /**
1127 * Activity Extra: Enable or disable Do Not Disturb mode.
1128 * <p>
1129 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE}
1130 * intent as a boolean to indicate if it should be enabled.
1131 */
1132 public static final String EXTRA_DO_NOT_DISTURB_MODE_ENABLED =
1133 "android.settings.extra.do_not_disturb_mode_enabled";
1134
1135 /**
1136 * Activity Extra: How many minutes to enable do not disturb mode for.
1137 * <p>
1138 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE}
1139 * intent to indicate how long do not disturb mode should be enabled for.
1140 */
1141 public static final String EXTRA_DO_NOT_DISTURB_MODE_MINUTES =
1142 "android.settings.extra.do_not_disturb_mode_minutes";
1143
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001144 private static final String JID_RESOURCE_PREFIX = "android";
1145
1146 public static final String AUTHORITY = "settings";
1147
1148 private static final String TAG = "Settings";
Christopher Tate06efb532012-08-24 15:29:27 -07001149 private static final boolean LOCAL_LOGV = false;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001150
David Christie3f7b6522013-08-06 19:19:08 -07001151 // Lock ensures that when enabling/disabling the master location switch, we don't end up
1152 // with a partial enable/disable state in multi-threaded situations.
1153 private static final Object mLocationSettingsLock = new Object();
1154
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001155 public static class SettingNotFoundException extends AndroidException {
1156 public SettingNotFoundException(String msg) {
1157 super(msg);
1158 }
1159 }
1160
1161 /**
1162 * Common base for tables of name/value settings.
1163 */
1164 public static class NameValueTable implements BaseColumns {
1165 public static final String NAME = "name";
1166 public static final String VALUE = "value";
1167
1168 protected static boolean putString(ContentResolver resolver, Uri uri,
1169 String name, String value) {
1170 // The database will take care of replacing duplicates.
1171 try {
1172 ContentValues values = new ContentValues();
1173 values.put(NAME, name);
1174 values.put(VALUE, value);
1175 resolver.insert(uri, values);
1176 return true;
1177 } catch (SQLException e) {
Dianne Hackborna33e3f72009-09-29 17:28:24 -07001178 Log.w(TAG, "Can't set key " + name + " in " + uri, e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001179 return false;
1180 }
1181 }
1182
1183 public static Uri getUriFor(Uri uri, String name) {
1184 return Uri.withAppendedPath(uri, name);
1185 }
1186 }
1187
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001188 // Thread-safe.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001189 private static class NameValueCache {
1190 private final String mVersionSystemProperty;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001191 private final Uri mUri;
1192
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001193 private static final String[] SELECT_VALUE =
1194 new String[] { Settings.NameValueTable.VALUE };
1195 private static final String NAME_EQ_PLACEHOLDER = "name=?";
1196
1197 // Must synchronize on 'this' to access mValues and mValuesVersion.
Dan Egnor799f7212009-11-24 16:24:44 -08001198 private final HashMap<String, String> mValues = new HashMap<String, String>();
1199 private long mValuesVersion = 0;
1200
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001201 // Initially null; set lazily and held forever. Synchronized on 'this'.
1202 private IContentProvider mContentProvider = null;
1203
1204 // The method we'll call (or null, to not use) on the provider
1205 // for the fast path of retrieving settings.
Christopher Tate06efb532012-08-24 15:29:27 -07001206 private final String mCallGetCommand;
1207 private final String mCallSetCommand;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001208
Christopher Tate06efb532012-08-24 15:29:27 -07001209 public NameValueCache(String versionSystemProperty, Uri uri,
1210 String getCommand, String setCommand) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001211 mVersionSystemProperty = versionSystemProperty;
1212 mUri = uri;
Christopher Tate06efb532012-08-24 15:29:27 -07001213 mCallGetCommand = getCommand;
1214 mCallSetCommand = setCommand;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001215 }
1216
Christopher Tate06efb532012-08-24 15:29:27 -07001217 private IContentProvider lazyGetProvider(ContentResolver cr) {
1218 IContentProvider cp = null;
1219 synchronized (this) {
1220 cp = mContentProvider;
1221 if (cp == null) {
1222 cp = mContentProvider = cr.acquireProvider(mUri.getAuthority());
1223 }
1224 }
1225 return cp;
1226 }
1227
1228 public boolean putStringForUser(ContentResolver cr, String name, String value,
1229 final int userHandle) {
1230 try {
1231 Bundle arg = new Bundle();
1232 arg.putString(Settings.NameValueTable.VALUE, value);
Christopher Tated5fe1472012-09-10 15:48:38 -07001233 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
Christopher Tate06efb532012-08-24 15:29:27 -07001234 IContentProvider cp = lazyGetProvider(cr);
Dianne Hackborn35654b62013-01-14 17:38:02 -08001235 cp.call(cr.getPackageName(), mCallSetCommand, name, arg);
Christopher Tate06efb532012-08-24 15:29:27 -07001236 } catch (RemoteException e) {
1237 Log.w(TAG, "Can't set key " + name + " in " + mUri, e);
1238 return false;
1239 }
1240 return true;
1241 }
1242
Christopher Tate06efb532012-08-24 15:29:27 -07001243 public String getStringForUser(ContentResolver cr, String name, final int userHandle) {
Christopher Tate78d2a662012-09-13 16:19:44 -07001244 final boolean isSelf = (userHandle == UserHandle.myUserId());
1245 if (isSelf) {
1246 long newValuesVersion = SystemProperties.getLong(mVersionSystemProperty, 0);
Dan Egnor799f7212009-11-24 16:24:44 -08001247
Christopher Tate78d2a662012-09-13 16:19:44 -07001248 // Our own user's settings data uses a client-side cache
1249 synchronized (this) {
1250 if (mValuesVersion != newValuesVersion) {
1251 if (LOCAL_LOGV || false) {
1252 Log.v(TAG, "invalidate [" + mUri.getLastPathSegment() + "]: current "
1253 + newValuesVersion + " != cached " + mValuesVersion);
1254 }
1255
1256 mValues.clear();
1257 mValuesVersion = newValuesVersion;
Dan Egnor799f7212009-11-24 16:24:44 -08001258 }
1259
Christopher Tate78d2a662012-09-13 16:19:44 -07001260 if (mValues.containsKey(name)) {
1261 return mValues.get(name); // Could be null, that's OK -- negative caching
1262 }
Dan Egnor799f7212009-11-24 16:24:44 -08001263 }
Christopher Tate78d2a662012-09-13 16:19:44 -07001264 } else {
1265 if (LOCAL_LOGV) Log.v(TAG, "get setting for user " + userHandle
1266 + " by user " + UserHandle.myUserId() + " so skipping cache");
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001267 }
Dan Egnor799f7212009-11-24 16:24:44 -08001268
Christopher Tate06efb532012-08-24 15:29:27 -07001269 IContentProvider cp = lazyGetProvider(cr);
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001270
1271 // Try the fast path first, not using query(). If this
1272 // fails (alternate Settings provider that doesn't support
1273 // this interface?) then we fall back to the query/table
1274 // interface.
Christopher Tate06efb532012-08-24 15:29:27 -07001275 if (mCallGetCommand != null) {
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001276 try {
Christopher Tate06efb532012-08-24 15:29:27 -07001277 Bundle args = null;
Christopher Tate5e08af02012-09-21 17:17:22 -07001278 if (!isSelf) {
Christopher Tate06efb532012-08-24 15:29:27 -07001279 args = new Bundle();
1280 args.putInt(CALL_METHOD_USER_KEY, userHandle);
1281 }
Dianne Hackborn35654b62013-01-14 17:38:02 -08001282 Bundle b = cp.call(cr.getPackageName(), mCallGetCommand, name, args);
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001283 if (b != null) {
1284 String value = b.getPairValue();
Christopher Tate78d2a662012-09-13 16:19:44 -07001285 // Don't update our cache for reads of other users' data
1286 if (isSelf) {
1287 synchronized (this) {
1288 mValues.put(name, value);
1289 }
1290 } else {
1291 if (LOCAL_LOGV) Log.i(TAG, "call-query of user " + userHandle
1292 + " by " + UserHandle.myUserId()
1293 + " so not updating cache");
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001294 }
1295 return value;
1296 }
1297 // If the response Bundle is null, we fall through
1298 // to the query interface below.
1299 } catch (RemoteException e) {
1300 // Not supported by the remote side? Fall through
1301 // to query().
1302 }
1303 }
1304
Dan Egnor799f7212009-11-24 16:24:44 -08001305 Cursor c = null;
1306 try {
Dianne Hackborn35654b62013-01-14 17:38:02 -08001307 c = cp.query(cr.getPackageName(), mUri, SELECT_VALUE, NAME_EQ_PLACEHOLDER,
Jeff Brown75ea64f2012-01-25 19:37:13 -08001308 new String[]{name}, null, null);
Dan Egnor799f7212009-11-24 16:24:44 -08001309 if (c == null) {
1310 Log.w(TAG, "Can't get key " + name + " from " + mUri);
1311 return null;
1312 }
1313
1314 String value = c.moveToNext() ? c.getString(0) : null;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001315 synchronized (this) {
Dan Egnor799f7212009-11-24 16:24:44 -08001316 mValues.put(name, value);
1317 }
1318 if (LOCAL_LOGV) {
1319 Log.v(TAG, "cache miss [" + mUri.getLastPathSegment() + "]: " +
1320 name + " = " + (value == null ? "(null)" : value));
1321 }
1322 return value;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001323 } catch (RemoteException e) {
Dan Egnor799f7212009-11-24 16:24:44 -08001324 Log.w(TAG, "Can't get key " + name + " from " + mUri, e);
1325 return null; // Return null, but don't cache it.
1326 } finally {
1327 if (c != null) c.close();
1328 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001329 }
1330 }
1331
1332 /**
1333 * System settings, containing miscellaneous system preferences. This
1334 * table holds simple name/value pairs. There are convenience
1335 * functions for accessing individual settings entries.
1336 */
1337 public static final class System extends NameValueTable {
1338 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_system_version";
1339
Svetoslav683914b2015-01-15 14:22:26 -08001340 /** @hide */
1341 public static interface Validator {
1342 public boolean validate(String value);
1343 }
1344
Dianne Hackborn139748f2012-09-24 11:36:57 -07001345 /**
1346 * The content:// style URL for this table
1347 */
1348 public static final Uri CONTENT_URI =
1349 Uri.parse("content://" + AUTHORITY + "/system");
1350
1351 private static final NameValueCache sNameValueCache = new NameValueCache(
1352 SYS_PROP_SETTING_VERSION,
1353 CONTENT_URI,
1354 CALL_METHOD_GET_SYSTEM,
1355 CALL_METHOD_PUT_SYSTEM);
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001356
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001357 private static final HashSet<String> MOVED_TO_SECURE;
1358 static {
1359 MOVED_TO_SECURE = new HashSet<String>(30);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001360 MOVED_TO_SECURE.add(Secure.ANDROID_ID);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001361 MOVED_TO_SECURE.add(Secure.HTTP_PROXY);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001362 MOVED_TO_SECURE.add(Secure.LOCATION_PROVIDERS_ALLOWED);
Danielle Millett925a7d82012-03-19 18:02:20 -04001363 MOVED_TO_SECURE.add(Secure.LOCK_BIOMETRIC_WEAK_FLAGS);
Amith Yamasani156c4352010-03-05 17:10:03 -08001364 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_ENABLED);
1365 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_VISIBLE);
1366 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001367 MOVED_TO_SECURE.add(Secure.LOGGING_ID);
1368 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_ENABLED);
1369 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_LAST_UPDATE);
1370 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_REDIRECT_URL);
1371 MOVED_TO_SECURE.add(Secure.SETTINGS_CLASSNAME);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001372 MOVED_TO_SECURE.add(Secure.USE_GOOGLE_MAIL);
1373 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
1374 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
1375 MOVED_TO_SECURE.add(Secure.WIFI_NUM_OPEN_NETWORKS_KEPT);
1376 MOVED_TO_SECURE.add(Secure.WIFI_ON);
1377 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE);
1378 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_AP_COUNT);
1379 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS);
1380 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED);
1381 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS);
1382 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT);
1383 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_MAX_AP_CHECKS);
1384 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ON);
1385 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_COUNT);
1386 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_DELAY_MS);
1387 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS);
Christopher Tateaa036a22014-05-19 16:33:27 -07001388
1389 // At one time in System, then Global, but now back in Secure
1390 MOVED_TO_SECURE.add(Secure.INSTALL_NON_MARKET_APPS);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001391 }
1392
Christopher Tate06efb532012-08-24 15:29:27 -07001393 private static final HashSet<String> MOVED_TO_GLOBAL;
Christopher Tate66488d62012-10-02 11:58:01 -07001394 private static final HashSet<String> MOVED_TO_SECURE_THEN_GLOBAL;
Christopher Tate06efb532012-08-24 15:29:27 -07001395 static {
1396 MOVED_TO_GLOBAL = new HashSet<String>();
Christopher Tate66488d62012-10-02 11:58:01 -07001397 MOVED_TO_SECURE_THEN_GLOBAL = new HashSet<String>();
1398
Christopher Tate92198742012-09-07 12:00:13 -07001399 // these were originally in system but migrated to secure in the past,
1400 // so are duplicated in the Secure.* namespace
Christopher Tate66488d62012-10-02 11:58:01 -07001401 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.ADB_ENABLED);
1402 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.BLUETOOTH_ON);
1403 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DATA_ROAMING);
1404 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DEVICE_PROVISIONED);
Christopher Tate66488d62012-10-02 11:58:01 -07001405 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.USB_MASS_STORAGE_ENABLED);
1406 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.HTTP_PROXY);
Christopher Tate06efb532012-08-24 15:29:27 -07001407
Christopher Tate92198742012-09-07 12:00:13 -07001408 // these are moving directly from system to global
Christopher Tate06efb532012-08-24 15:29:27 -07001409 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_ON);
1410 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_RADIOS);
1411 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS);
1412 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME);
1413 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME_ZONE);
1414 MOVED_TO_GLOBAL.add(Settings.Global.CAR_DOCK_SOUND);
1415 MOVED_TO_GLOBAL.add(Settings.Global.CAR_UNDOCK_SOUND);
1416 MOVED_TO_GLOBAL.add(Settings.Global.DESK_DOCK_SOUND);
1417 MOVED_TO_GLOBAL.add(Settings.Global.DESK_UNDOCK_SOUND);
1418 MOVED_TO_GLOBAL.add(Settings.Global.DOCK_SOUNDS_ENABLED);
1419 MOVED_TO_GLOBAL.add(Settings.Global.LOCK_SOUND);
1420 MOVED_TO_GLOBAL.add(Settings.Global.UNLOCK_SOUND);
1421 MOVED_TO_GLOBAL.add(Settings.Global.LOW_BATTERY_SOUND);
1422 MOVED_TO_GLOBAL.add(Settings.Global.POWER_SOUNDS_ENABLED);
1423 MOVED_TO_GLOBAL.add(Settings.Global.STAY_ON_WHILE_PLUGGED_IN);
1424 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SLEEP_POLICY);
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07001425 MOVED_TO_GLOBAL.add(Settings.Global.MODE_RINGER);
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001426 MOVED_TO_GLOBAL.add(Settings.Global.WINDOW_ANIMATION_SCALE);
1427 MOVED_TO_GLOBAL.add(Settings.Global.TRANSITION_ANIMATION_SCALE);
1428 MOVED_TO_GLOBAL.add(Settings.Global.ANIMATOR_DURATION_SCALE);
1429 MOVED_TO_GLOBAL.add(Settings.Global.FANCY_IME_ANIMATIONS);
1430 MOVED_TO_GLOBAL.add(Settings.Global.COMPATIBILITY_MODE);
1431 MOVED_TO_GLOBAL.add(Settings.Global.EMERGENCY_TONE);
1432 MOVED_TO_GLOBAL.add(Settings.Global.CALL_AUTO_RETRY);
1433 MOVED_TO_GLOBAL.add(Settings.Global.DEBUG_APP);
1434 MOVED_TO_GLOBAL.add(Settings.Global.WAIT_FOR_DEBUGGER);
1435 MOVED_TO_GLOBAL.add(Settings.Global.SHOW_PROCESSES);
1436 MOVED_TO_GLOBAL.add(Settings.Global.ALWAYS_FINISH_ACTIVITIES);
Geremy Condraa0735112013-03-26 21:49:26 -07001437 MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_CONTENT_URL);
1438 MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_METADATA_URL);
1439 MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_CONTENT_URL);
1440 MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_METADATA_URL);
1441 MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_CONTENT_URL);
1442 MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_METADATA_URL);
1443 MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_CONTENT_URL);
1444 MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_METADATA_URL);
Christopher Tate06efb532012-08-24 15:29:27 -07001445 }
1446
Svetoslav683914b2015-01-15 14:22:26 -08001447 private static final Validator sBooleanValidator =
1448 new DiscreteValueValidator(new String[] {"0", "1"});
1449
1450 private static final Validator sNonNegativeIntegerValidator = new Validator() {
1451 @Override
1452 public boolean validate(String value) {
1453 try {
1454 return Integer.parseInt(value) >= 0;
1455 } catch (NumberFormatException e) {
1456 return false;
1457 }
1458 }
1459 };
1460
Svetoslav683914b2015-01-15 14:22:26 -08001461 private static final Validator sUriValidator = new Validator() {
1462 @Override
1463 public boolean validate(String value) {
1464 try {
1465 Uri.decode(value);
1466 return true;
1467 } catch (IllegalArgumentException e) {
1468 return false;
1469 }
1470 }
1471 };
1472
1473 private static final Validator sLenientIpAddressValidator = new Validator() {
1474 private static final int MAX_IPV6_LENGTH = 45;
1475
1476 @Override
1477 public boolean validate(String value) {
1478 return value.length() <= MAX_IPV6_LENGTH;
1479 }
1480 };
1481
Christopher Tate66488d62012-10-02 11:58:01 -07001482 /** @hide */
Svetoslav683914b2015-01-15 14:22:26 -08001483 public static void getMovedToGlobalSettings(Set<String> outKeySet) {
Christopher Tate66488d62012-10-02 11:58:01 -07001484 outKeySet.addAll(MOVED_TO_GLOBAL);
1485 outKeySet.addAll(MOVED_TO_SECURE_THEN_GLOBAL);
1486 }
1487
1488 /** @hide */
Svetoslav683914b2015-01-15 14:22:26 -08001489 public static void getMovedToSecureSettings(Set<String> outKeySet) {
1490 outKeySet.addAll(MOVED_TO_SECURE);
1491 }
1492
1493 /** @hide */
Christopher Tate66488d62012-10-02 11:58:01 -07001494 public static void getNonLegacyMovedKeys(HashSet<String> outKeySet) {
1495 outKeySet.addAll(MOVED_TO_GLOBAL);
1496 }
1497
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001498 /**
1499 * Look up a name in the database.
1500 * @param resolver to access the database with
1501 * @param name to look up in the table
1502 * @return the corresponding value, or null if not present
1503 */
Dianne Hackborn139748f2012-09-24 11:36:57 -07001504 public static String getString(ContentResolver resolver, String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07001505 return getStringForUser(resolver, name, UserHandle.myUserId());
1506 }
1507
1508 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -07001509 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -07001510 int userHandle) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001511 if (MOVED_TO_SECURE.contains(name)) {
1512 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1513 + " to android.provider.Settings.Secure, returning read-only value.");
Christopher Tate06efb532012-08-24 15:29:27 -07001514 return Secure.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001515 }
Christopher Tate66488d62012-10-02 11:58:01 -07001516 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07001517 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1518 + " to android.provider.Settings.Global, returning read-only value.");
1519 return Global.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001520 }
Christopher Tate06efb532012-08-24 15:29:27 -07001521 return sNameValueCache.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001522 }
1523
1524 /**
1525 * Store a name/value pair into the database.
1526 * @param resolver to access the database with
1527 * @param name to store
1528 * @param value to associate with the name
1529 * @return true if the value was set, false on database errors
1530 */
1531 public static boolean putString(ContentResolver resolver, String name, String value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001532 return putStringForUser(resolver, name, value, UserHandle.myUserId());
1533 }
1534
1535 /** @hide */
1536 public static boolean putStringForUser(ContentResolver resolver, String name, String value,
1537 int userHandle) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001538 if (MOVED_TO_SECURE.contains(name)) {
1539 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1540 + " to android.provider.Settings.Secure, value is unchanged.");
1541 return false;
1542 }
Christopher Tate66488d62012-10-02 11:58:01 -07001543 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07001544 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1545 + " to android.provider.Settings.Global, value is unchanged.");
1546 return false;
1547 }
Christopher Tate06efb532012-08-24 15:29:27 -07001548 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001549 }
1550
1551 /**
1552 * Construct the content URI for a particular name/value pair,
1553 * useful for monitoring changes with a ContentObserver.
1554 * @param name to look up in the table
1555 * @return the corresponding content URI, or null if not present
1556 */
1557 public static Uri getUriFor(String name) {
1558 if (MOVED_TO_SECURE.contains(name)) {
1559 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1560 + " to android.provider.Settings.Secure, returning Secure URI.");
1561 return Secure.getUriFor(Secure.CONTENT_URI, name);
1562 }
Christopher Tate66488d62012-10-02 11:58:01 -07001563 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07001564 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1565 + " to android.provider.Settings.Global, returning read-only global URI.");
1566 return Global.getUriFor(Global.CONTENT_URI, name);
1567 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001568 return getUriFor(CONTENT_URI, name);
1569 }
1570
1571 /**
1572 * Convenience function for retrieving a single system settings value
1573 * as an integer. Note that internally setting values are always
1574 * stored as strings; this function converts the string to an integer
1575 * for you. The default value will be returned if the setting is
1576 * not defined or not an integer.
1577 *
1578 * @param cr The ContentResolver to access.
1579 * @param name The name of the setting to retrieve.
1580 * @param def Value to return if the setting is not defined.
1581 *
1582 * @return The setting's current value, or 'def' if it is not defined
1583 * or not a valid integer.
1584 */
1585 public static int getInt(ContentResolver cr, String name, int def) {
Christopher Tate06efb532012-08-24 15:29:27 -07001586 return getIntForUser(cr, name, def, UserHandle.myUserId());
1587 }
1588
1589 /** @hide */
1590 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
1591 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001592 try {
1593 return v != null ? Integer.parseInt(v) : def;
1594 } catch (NumberFormatException e) {
1595 return def;
1596 }
1597 }
1598
1599 /**
1600 * Convenience function for retrieving a single system settings value
1601 * as an integer. Note that internally setting values are always
1602 * stored as strings; this function converts the string to an integer
1603 * for you.
1604 * <p>
1605 * This version does not take a default value. If the setting has not
1606 * been set, or the string value is not a number,
1607 * it throws {@link SettingNotFoundException}.
1608 *
1609 * @param cr The ContentResolver to access.
1610 * @param name The name of the setting to retrieve.
1611 *
1612 * @throws SettingNotFoundException Thrown if a setting by the given
1613 * name can't be found or the setting value is not an integer.
1614 *
1615 * @return The setting's current value.
1616 */
1617 public static int getInt(ContentResolver cr, String name)
1618 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07001619 return getIntForUser(cr, name, UserHandle.myUserId());
1620 }
1621
1622 /** @hide */
1623 public static int getIntForUser(ContentResolver cr, String name, int userHandle)
1624 throws SettingNotFoundException {
1625 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001626 try {
1627 return Integer.parseInt(v);
1628 } catch (NumberFormatException e) {
1629 throw new SettingNotFoundException(name);
1630 }
1631 }
1632
1633 /**
1634 * Convenience function for updating a single settings value as an
1635 * integer. This will either create a new entry in the table if the
1636 * given name does not exist, or modify the value of the existing row
1637 * with that name. Note that internally setting values are always
1638 * stored as strings, so this function converts the given value to a
1639 * string before storing it.
1640 *
1641 * @param cr The ContentResolver to access.
1642 * @param name The name of the setting to modify.
1643 * @param value The new value for the setting.
1644 * @return true if the value was set, false on database errors
1645 */
1646 public static boolean putInt(ContentResolver cr, String name, int value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001647 return putIntForUser(cr, name, value, UserHandle.myUserId());
1648 }
1649
1650 /** @hide */
1651 public static boolean putIntForUser(ContentResolver cr, String name, int value,
1652 int userHandle) {
1653 return putStringForUser(cr, name, Integer.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001654 }
1655
1656 /**
1657 * Convenience function for retrieving a single system settings value
1658 * as a {@code long}. Note that internally setting values are always
1659 * stored as strings; this function converts the string to a {@code long}
1660 * for you. The default value will be returned if the setting is
1661 * not defined or not a {@code long}.
1662 *
1663 * @param cr The ContentResolver to access.
1664 * @param name The name of the setting to retrieve.
1665 * @param def Value to return if the setting is not defined.
1666 *
1667 * @return The setting's current value, or 'def' if it is not defined
1668 * or not a valid {@code long}.
1669 */
1670 public static long getLong(ContentResolver cr, String name, long def) {
Christopher Tate06efb532012-08-24 15:29:27 -07001671 return getLongForUser(cr, name, def, UserHandle.myUserId());
1672 }
1673
1674 /** @hide */
1675 public static long getLongForUser(ContentResolver cr, String name, long def,
1676 int userHandle) {
1677 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001678 long value;
1679 try {
1680 value = valString != null ? Long.parseLong(valString) : def;
1681 } catch (NumberFormatException e) {
1682 value = def;
1683 }
1684 return value;
1685 }
1686
1687 /**
1688 * Convenience function for retrieving a single system settings value
1689 * as a {@code long}. Note that internally setting values are always
1690 * stored as strings; this function converts the string to a {@code long}
1691 * for you.
1692 * <p>
1693 * This version does not take a default value. If the setting has not
1694 * been set, or the string value is not a number,
1695 * it throws {@link SettingNotFoundException}.
1696 *
1697 * @param cr The ContentResolver to access.
1698 * @param name The name of the setting to retrieve.
1699 *
1700 * @return The setting's current value.
1701 * @throws SettingNotFoundException Thrown if a setting by the given
1702 * name can't be found or the setting value is not an integer.
1703 */
1704 public static long getLong(ContentResolver cr, String name)
1705 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07001706 return getLongForUser(cr, name, UserHandle.myUserId());
1707 }
1708
1709 /** @hide */
1710 public static long getLongForUser(ContentResolver cr, String name, int userHandle)
1711 throws SettingNotFoundException {
1712 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001713 try {
1714 return Long.parseLong(valString);
1715 } catch (NumberFormatException e) {
1716 throw new SettingNotFoundException(name);
1717 }
1718 }
1719
1720 /**
1721 * Convenience function for updating a single settings value as a long
1722 * integer. This will either create a new entry in the table if the
1723 * given name does not exist, or modify the value of the existing row
1724 * with that name. Note that internally setting values are always
1725 * stored as strings, so this function converts the given value to a
1726 * string before storing it.
1727 *
1728 * @param cr The ContentResolver to access.
1729 * @param name The name of the setting to modify.
1730 * @param value The new value for the setting.
1731 * @return true if the value was set, false on database errors
1732 */
1733 public static boolean putLong(ContentResolver cr, String name, long value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001734 return putLongForUser(cr, name, value, UserHandle.myUserId());
1735 }
1736
1737 /** @hide */
1738 public static boolean putLongForUser(ContentResolver cr, String name, long value,
1739 int userHandle) {
1740 return putStringForUser(cr, name, Long.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001741 }
1742
1743 /**
1744 * Convenience function for retrieving a single system settings value
1745 * as a floating point number. Note that internally setting values are
1746 * always stored as strings; this function converts the string to an
1747 * float for you. The default value will be returned if the setting
1748 * is not defined or not a valid float.
1749 *
1750 * @param cr The ContentResolver to access.
1751 * @param name The name of the setting to retrieve.
1752 * @param def Value to return if the setting is not defined.
1753 *
1754 * @return The setting's current value, or 'def' if it is not defined
1755 * or not a valid float.
1756 */
1757 public static float getFloat(ContentResolver cr, String name, float def) {
Christopher Tate06efb532012-08-24 15:29:27 -07001758 return getFloatForUser(cr, name, def, UserHandle.myUserId());
1759 }
1760
1761 /** @hide */
1762 public static float getFloatForUser(ContentResolver cr, String name, float def,
1763 int userHandle) {
1764 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001765 try {
1766 return v != null ? Float.parseFloat(v) : def;
1767 } catch (NumberFormatException e) {
1768 return def;
1769 }
1770 }
1771
1772 /**
1773 * Convenience function for retrieving a single system settings value
1774 * as a float. Note that internally setting values are always
1775 * stored as strings; this function converts the string to a float
1776 * for you.
1777 * <p>
1778 * This version does not take a default value. If the setting has not
1779 * been set, or the string value is not a number,
1780 * it throws {@link SettingNotFoundException}.
1781 *
1782 * @param cr The ContentResolver to access.
1783 * @param name The name of the setting to retrieve.
1784 *
1785 * @throws SettingNotFoundException Thrown if a setting by the given
1786 * name can't be found or the setting value is not a float.
1787 *
1788 * @return The setting's current value.
1789 */
1790 public static float getFloat(ContentResolver cr, String name)
1791 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07001792 return getFloatForUser(cr, name, UserHandle.myUserId());
1793 }
1794
1795 /** @hide */
1796 public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
1797 throws SettingNotFoundException {
1798 String v = getStringForUser(cr, name, userHandle);
Brian Muramatsue1d46982010-12-06 17:34:20 -08001799 if (v == null) {
1800 throw new SettingNotFoundException(name);
1801 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001802 try {
1803 return Float.parseFloat(v);
1804 } catch (NumberFormatException e) {
1805 throw new SettingNotFoundException(name);
1806 }
1807 }
1808
1809 /**
1810 * Convenience function for updating a single settings value as a
1811 * floating point number. This will either create a new entry in the
1812 * table if the given name does not exist, or modify the value of the
1813 * existing row with that name. Note that internally setting values
1814 * are always stored as strings, so this function converts the given
1815 * value to a string before storing it.
1816 *
1817 * @param cr The ContentResolver to access.
1818 * @param name The name of the setting to modify.
1819 * @param value The new value for the setting.
1820 * @return true if the value was set, false on database errors
1821 */
1822 public static boolean putFloat(ContentResolver cr, String name, float value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001823 return putFloatForUser(cr, name, value, UserHandle.myUserId());
1824 }
1825
1826 /** @hide */
1827 public static boolean putFloatForUser(ContentResolver cr, String name, float value,
1828 int userHandle) {
1829 return putStringForUser(cr, name, Float.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001830 }
1831
1832 /**
1833 * Convenience function to read all of the current
1834 * configuration-related settings into a
1835 * {@link Configuration} object.
1836 *
1837 * @param cr The ContentResolver to access.
1838 * @param outConfig Where to place the configuration settings.
1839 */
1840 public static void getConfiguration(ContentResolver cr, Configuration outConfig) {
Christopher Tate06efb532012-08-24 15:29:27 -07001841 getConfigurationForUser(cr, outConfig, UserHandle.myUserId());
1842 }
1843
1844 /** @hide */
1845 public static void getConfigurationForUser(ContentResolver cr, Configuration outConfig,
1846 int userHandle) {
1847 outConfig.fontScale = Settings.System.getFloatForUser(
1848 cr, FONT_SCALE, outConfig.fontScale, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001849 if (outConfig.fontScale < 0) {
1850 outConfig.fontScale = 1;
1851 }
1852 }
1853
1854 /**
Dianne Hackborn31ca8542011-07-19 14:58:28 -07001855 * @hide Erase the fields in the Configuration that should be applied
1856 * by the settings.
1857 */
1858 public static void clearConfiguration(Configuration inoutConfig) {
1859 inoutConfig.fontScale = 0;
1860 }
Narayan Kamath6d632962011-08-24 11:51:37 +01001861
Dianne Hackborn31ca8542011-07-19 14:58:28 -07001862 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001863 * Convenience function to write a batch of configuration-related
1864 * settings from a {@link Configuration} object.
1865 *
1866 * @param cr The ContentResolver to access.
1867 * @param config The settings to write.
1868 * @return true if the values were set, false on database errors
1869 */
1870 public static boolean putConfiguration(ContentResolver cr, Configuration config) {
Christopher Tate06efb532012-08-24 15:29:27 -07001871 return putConfigurationForUser(cr, config, UserHandle.myUserId());
1872 }
1873
1874 /** @hide */
1875 public static boolean putConfigurationForUser(ContentResolver cr, Configuration config,
1876 int userHandle) {
1877 return Settings.System.putFloatForUser(cr, FONT_SCALE, config.fontScale, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001878 }
1879
Dianne Hackbornb8b11a02010-03-10 15:53:11 -08001880 /** @hide */
1881 public static boolean hasInterestingConfigurationChanges(int changes) {
1882 return (changes&ActivityInfo.CONFIG_FONT_SCALE) != 0;
1883 }
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07001884
Christopher Tate06efb532012-08-24 15:29:27 -07001885 /** @deprecated - Do not use */
1886 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001887 public static boolean getShowGTalkServiceStatus(ContentResolver cr) {
Christopher Tate06efb532012-08-24 15:29:27 -07001888 return getShowGTalkServiceStatusForUser(cr, UserHandle.myUserId());
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001889 }
1890
Christopher Tate06efb532012-08-24 15:29:27 -07001891 /**
1892 * @hide
1893 * @deprecated - Do not use
1894 */
1895 public static boolean getShowGTalkServiceStatusForUser(ContentResolver cr,
1896 int userHandle) {
1897 return getIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, 0, userHandle) != 0;
1898 }
1899
1900 /** @deprecated - Do not use */
1901 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001902 public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag) {
Christopher Tatec8c08382012-09-19 17:18:18 -07001903 setShowGTalkServiceStatusForUser(cr, flag, UserHandle.myUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07001904 }
1905
1906 /**
1907 * @hide
1908 * @deprecated - Do not use
1909 */
1910 @Deprecated
1911 public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean flag,
1912 int userHandle) {
1913 putIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, flag ? 1 : 0, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001914 }
1915
Svetoslav683914b2015-01-15 14:22:26 -08001916 private static final class DiscreteValueValidator implements Validator {
1917 private final String[] mValues;
1918
1919 public DiscreteValueValidator(String[] values) {
1920 mValues = values;
1921 }
1922
Svetoslav1b71ea92015-02-17 18:20:29 -08001923 @Override
Svetoslav683914b2015-01-15 14:22:26 -08001924 public boolean validate(String value) {
1925 return ArrayUtils.contains(mValues, value);
1926 }
1927 }
1928
1929 private static final class InclusiveIntegerRangeValidator implements Validator {
1930 private final int mMin;
1931 private final int mMax;
1932
1933 public InclusiveIntegerRangeValidator(int min, int max) {
1934 mMin = min;
1935 mMax = max;
1936 }
1937
Svetoslav1b71ea92015-02-17 18:20:29 -08001938 @Override
Svetoslav683914b2015-01-15 14:22:26 -08001939 public boolean validate(String value) {
1940 try {
1941 final int intValue = Integer.parseInt(value);
1942 return intValue >= mMin && intValue <= mMax;
1943 } catch (NumberFormatException e) {
1944 return false;
1945 }
1946 }
1947 }
1948
1949 private static final class InclusiveFloatRangeValidator implements Validator {
1950 private final float mMin;
1951 private final float mMax;
1952
1953 public InclusiveFloatRangeValidator(float min, float max) {
1954 mMin = min;
1955 mMax = max;
1956 }
1957
Svetoslav1b71ea92015-02-17 18:20:29 -08001958 @Override
Svetoslav683914b2015-01-15 14:22:26 -08001959 public boolean validate(String value) {
1960 try {
1961 final float floatValue = Float.parseFloat(value);
1962 return floatValue >= mMin && floatValue <= mMax;
1963 } catch (NumberFormatException e) {
1964 return false;
1965 }
1966 }
1967 }
1968
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001969 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001970 * @deprecated Use {@link android.provider.Settings.Global#STAY_ON_WHILE_PLUGGED_IN} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001971 */
Christopher Tate06efb532012-08-24 15:29:27 -07001972 @Deprecated
1973 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 -08001974
1975 /**
1976 * What happens when the user presses the end call button if they're not
1977 * on a call.<br/>
1978 * <b>Values:</b><br/>
1979 * 0 - The end button does nothing.<br/>
1980 * 1 - The end button goes to the home screen.<br/>
1981 * 2 - The end button puts the device to sleep and locks the keyguard.<br/>
1982 * 3 - The end button goes to the home screen. If the user is already on the
1983 * home screen, it puts the device to sleep.
1984 */
1985 public static final String END_BUTTON_BEHAVIOR = "end_button_behavior";
1986
Svetoslav683914b2015-01-15 14:22:26 -08001987 private static final Validator END_BUTTON_BEHAVIOR_VALIDATOR =
1988 new InclusiveIntegerRangeValidator(0, 3);
1989
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001990 /**
David Brown458e8062010-03-08 21:52:11 -08001991 * END_BUTTON_BEHAVIOR value for "go home".
1992 * @hide
1993 */
1994 public static final int END_BUTTON_BEHAVIOR_HOME = 0x1;
1995
1996 /**
1997 * END_BUTTON_BEHAVIOR value for "go to sleep".
1998 * @hide
1999 */
2000 public static final int END_BUTTON_BEHAVIOR_SLEEP = 0x2;
2001
2002 /**
2003 * END_BUTTON_BEHAVIOR default value.
2004 * @hide
2005 */
2006 public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_SLEEP;
2007
2008 /**
Joe Onorato9cdffa12011-04-06 18:27:27 -07002009 * Is advanced settings mode turned on. 0 == no, 1 == yes
2010 * @hide
2011 */
2012 public static final String ADVANCED_SETTINGS = "advanced_settings";
2013
Svetoslav683914b2015-01-15 14:22:26 -08002014 private static final Validator ADVANCED_SETTINGS_VALIDATOR = sBooleanValidator;
2015
Joe Onorato9cdffa12011-04-06 18:27:27 -07002016 /**
2017 * ADVANCED_SETTINGS default value.
2018 * @hide
2019 */
2020 public static final int ADVANCED_SETTINGS_DEFAULT = 0;
2021
2022 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002023 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002024 */
Christopher Tate06efb532012-08-24 15:29:27 -07002025 @Deprecated
2026 public static final String AIRPLANE_MODE_ON = Global.AIRPLANE_MODE_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002027
2028 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002029 * @deprecated Use {@link android.provider.Settings.Global#RADIO_BLUETOOTH} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002030 */
Christopher Tate06efb532012-08-24 15:29:27 -07002031 @Deprecated
2032 public static final String RADIO_BLUETOOTH = Global.RADIO_BLUETOOTH;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002033
2034 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002035 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIFI} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002036 */
Christopher Tate06efb532012-08-24 15:29:27 -07002037 @Deprecated
2038 public static final String RADIO_WIFI = Global.RADIO_WIFI;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002039
Robert Greenwalt8588e472011-11-08 10:12:25 -08002040 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002041 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIMAX} instead
Robert Greenwalt8588e472011-11-08 10:12:25 -08002042 * {@hide}
2043 */
Christopher Tate06efb532012-08-24 15:29:27 -07002044 @Deprecated
2045 public static final String RADIO_WIMAX = Global.RADIO_WIMAX;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002046
2047 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002048 * @deprecated Use {@link android.provider.Settings.Global#RADIO_CELL} instead
Nick Pelly8d32a012011-08-09 07:03:49 -07002049 */
Christopher Tate06efb532012-08-24 15:29:27 -07002050 @Deprecated
2051 public static final String RADIO_CELL = Global.RADIO_CELL;
Nick Pelly8d32a012011-08-09 07:03:49 -07002052
2053 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002054 * @deprecated Use {@link android.provider.Settings.Global#RADIO_NFC} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002055 */
Christopher Tate06efb532012-08-24 15:29:27 -07002056 @Deprecated
2057 public static final String RADIO_NFC = Global.RADIO_NFC;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002058
2059 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002060 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_RADIOS} instead
2061 */
2062 @Deprecated
2063 public static final String AIRPLANE_MODE_RADIOS = Global.AIRPLANE_MODE_RADIOS;
2064
2065 /**
2066 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_TOGGLEABLE_RADIOS} instead
Mike Lockwoodbd5ddf02009-07-29 21:37:14 -07002067 *
2068 * {@hide}
2069 */
Christopher Tate06efb532012-08-24 15:29:27 -07002070 @Deprecated
2071 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS =
2072 Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS;
Mike Lockwoodbd5ddf02009-07-29 21:37:14 -07002073
2074 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002075 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002076 */
Christopher Tate06efb532012-08-24 15:29:27 -07002077 @Deprecated
2078 public static final String WIFI_SLEEP_POLICY = Global.WIFI_SLEEP_POLICY;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002079
2080 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002081 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_DEFAULT} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002082 */
Christopher Tate06efb532012-08-24 15:29:27 -07002083 @Deprecated
2084 public static final int WIFI_SLEEP_POLICY_DEFAULT = Global.WIFI_SLEEP_POLICY_DEFAULT;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002085
2086 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002087 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002088 */
Christopher Tate06efb532012-08-24 15:29:27 -07002089 @Deprecated
2090 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED =
2091 Global.WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002092
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002093 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002094 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002095 */
Christopher Tate06efb532012-08-24 15:29:27 -07002096 @Deprecated
2097 public static final int WIFI_SLEEP_POLICY_NEVER = Global.WIFI_SLEEP_POLICY_NEVER;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002098
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07002099 /**
2100 * @deprecated Use {@link android.provider.Settings.Global#MODE_RINGER} instead
2101 */
2102 @Deprecated
2103 public static final String MODE_RINGER = Global.MODE_RINGER;
2104
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002105 /**
2106 * Whether to use static IP and other static network attributes.
2107 * <p>
2108 * Set to 1 for true and 0 for false.
Jeff Sharkey625239a2012-09-26 22:03:49 -07002109 *
2110 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002111 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002112 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002113 public static final String WIFI_USE_STATIC_IP = "wifi_use_static_ip";
2114
Svetoslav683914b2015-01-15 14:22:26 -08002115 private static final Validator WIFI_USE_STATIC_IP_VALIDATOR = sBooleanValidator;
2116
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002117 /**
2118 * The static IP address.
2119 * <p>
2120 * Example: "192.168.1.51"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002121 *
2122 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002123 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002124 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002125 public static final String WIFI_STATIC_IP = "wifi_static_ip";
2126
Svetoslav683914b2015-01-15 14:22:26 -08002127 private static final Validator WIFI_STATIC_IP_VALIDATOR = sLenientIpAddressValidator;
2128
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002129 /**
2130 * If using static IP, the gateway's IP address.
2131 * <p>
2132 * Example: "192.168.1.1"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002133 *
2134 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002135 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002136 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002137 public static final String WIFI_STATIC_GATEWAY = "wifi_static_gateway";
2138
Svetoslav683914b2015-01-15 14:22:26 -08002139 private static final Validator WIFI_STATIC_GATEWAY_VALIDATOR = sLenientIpAddressValidator;
2140
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002141 /**
2142 * If using static IP, the net mask.
2143 * <p>
2144 * Example: "255.255.255.0"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002145 *
2146 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002147 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002148 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002149 public static final String WIFI_STATIC_NETMASK = "wifi_static_netmask";
2150
Svetoslav683914b2015-01-15 14:22:26 -08002151 private static final Validator WIFI_STATIC_NETMASK_VALIDATOR = sLenientIpAddressValidator;
2152
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002153 /**
2154 * If using static IP, the primary DNS's IP address.
2155 * <p>
2156 * Example: "192.168.1.1"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002157 *
2158 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002159 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002160 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002161 public static final String WIFI_STATIC_DNS1 = "wifi_static_dns1";
2162
Svetoslav683914b2015-01-15 14:22:26 -08002163 private static final Validator WIFI_STATIC_DNS1_VALIDATOR = sLenientIpAddressValidator;
2164
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002165 /**
2166 * If using static IP, the secondary DNS's IP address.
2167 * <p>
2168 * Example: "192.168.1.2"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002169 *
2170 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002171 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002172 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002173 public static final String WIFI_STATIC_DNS2 = "wifi_static_dns2";
2174
Svetoslav683914b2015-01-15 14:22:26 -08002175 private static final Validator WIFI_STATIC_DNS2_VALIDATOR = sLenientIpAddressValidator;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002176
2177 /**
2178 * Determines whether remote devices may discover and/or connect to
2179 * this device.
2180 * <P>Type: INT</P>
2181 * 2 -- discoverable and connectable
2182 * 1 -- connectable but not discoverable
2183 * 0 -- neither connectable nor discoverable
2184 */
2185 public static final String BLUETOOTH_DISCOVERABILITY =
2186 "bluetooth_discoverability";
2187
Svetoslav683914b2015-01-15 14:22:26 -08002188 private static final Validator BLUETOOTH_DISCOVERABILITY_VALIDATOR =
2189 new InclusiveIntegerRangeValidator(0, 2);
2190
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002191 /**
2192 * Bluetooth discoverability timeout. If this value is nonzero, then
2193 * Bluetooth becomes discoverable for a certain number of seconds,
2194 * after which is becomes simply connectable. The value is in seconds.
2195 */
2196 public static final String BLUETOOTH_DISCOVERABILITY_TIMEOUT =
2197 "bluetooth_discoverability_timeout";
2198
Svetoslav683914b2015-01-15 14:22:26 -08002199 private static final Validator BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR =
2200 sNonNegativeIntegerValidator;
2201
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002202 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08002203 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_ENABLED}
2204 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002205 */
Amith Yamasani156c4352010-03-05 17:10:03 -08002206 @Deprecated
2207 public static final String LOCK_PATTERN_ENABLED = Secure.LOCK_PATTERN_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002208
2209 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08002210 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_VISIBLE}
2211 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002212 */
Amith Yamasani156c4352010-03-05 17:10:03 -08002213 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002214 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
2215
2216 /**
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07002217 * @deprecated Use
Amith Yamasani156c4352010-03-05 17:10:03 -08002218 * {@link android.provider.Settings.Secure#LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED}
2219 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002220 */
Amith Yamasani156c4352010-03-05 17:10:03 -08002221 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002222 public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED =
2223 "lock_pattern_tactile_feedback_enabled";
2224
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002225 /**
2226 * A formatted string of the next alarm that is set, or the empty string
2227 * if there is no alarm set.
Adrian Roosc42a1e12014-07-07 23:35:53 +02002228 *
2229 * @deprecated Use {@link android.app.AlarmManager#getNextAlarmClock()}.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002230 */
Adrian Roosc42a1e12014-07-07 23:35:53 +02002231 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002232 public static final String NEXT_ALARM_FORMATTED = "next_alarm_formatted";
2233
Svetoslav683914b2015-01-15 14:22:26 -08002234 private static final Validator NEXT_ALARM_FORMATTED_VALIDATOR = new Validator() {
2235 private static final int MAX_LENGTH = 1000;
Svetoslav1b71ea92015-02-17 18:20:29 -08002236
Svetoslav683914b2015-01-15 14:22:26 -08002237 @Override
2238 public boolean validate(String value) {
2239 // TODO: No idea what the correct format is.
Svetoslav64d6e9c2015-02-12 11:30:36 -08002240 return value == null || value.length() < MAX_LENGTH;
Svetoslav683914b2015-01-15 14:22:26 -08002241 }
2242 };
2243
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002244 /**
2245 * Scaling factor for fonts, float.
2246 */
2247 public static final String FONT_SCALE = "font_scale";
2248
Svetoslav683914b2015-01-15 14:22:26 -08002249 private static final Validator FONT_SCALE_VALIDATOR = new Validator() {
2250 @Override
2251 public boolean validate(String value) {
2252 try {
2253 return Float.parseFloat(value) >= 0;
2254 } catch (NumberFormatException e) {
2255 return false;
2256 }
2257 }
2258 };
2259
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002260 /**
2261 * Name of an application package to be debugged.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002262 *
2263 * @deprecated Use {@link Global#DEBUG_APP} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002264 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002265 @Deprecated
2266 public static final String DEBUG_APP = Global.DEBUG_APP;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002267
2268 /**
2269 * If 1, when launching DEBUG_APP it will wait for the debugger before
2270 * starting user code. If 0, it will run normally.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002271 *
2272 * @deprecated Use {@link Global#WAIT_FOR_DEBUGGER} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002273 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002274 @Deprecated
2275 public static final String WAIT_FOR_DEBUGGER = Global.WAIT_FOR_DEBUGGER;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002276
2277 /**
2278 * Whether or not to dim the screen. 0=no 1=yes
Jeff Brown96307042012-07-27 15:51:34 -07002279 * @deprecated This setting is no longer used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002280 */
Jeff Brown96307042012-07-27 15:51:34 -07002281 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002282 public static final String DIM_SCREEN = "dim_screen";
2283
Svetoslav683914b2015-01-15 14:22:26 -08002284 private static final Validator DIM_SCREEN_VALIDATOR = sBooleanValidator;
2285
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002286 /**
Jeff Brown05af6ad2014-09-30 20:54:30 -07002287 * The amount of time in milliseconds before the device goes to sleep or begins
2288 * to dream after a period of inactivity. This value is also known as the
2289 * user activity timeout period since the screen isn't necessarily turned off
2290 * when it expires.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002291 */
2292 public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout";
2293
Svetoslav683914b2015-01-15 14:22:26 -08002294 private static final Validator SCREEN_OFF_TIMEOUT_VALIDATOR = sNonNegativeIntegerValidator;
2295
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002296 /**
2297 * The screen backlight brightness between 0 and 255.
2298 */
2299 public static final String SCREEN_BRIGHTNESS = "screen_brightness";
2300
Svetoslav683914b2015-01-15 14:22:26 -08002301 private static final Validator SCREEN_BRIGHTNESS_VALIDATOR =
2302 new InclusiveIntegerRangeValidator(0, 255);
2303
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002304 /**
Dan Murphy951764b2009-08-27 14:59:03 -05002305 * Control whether to enable automatic brightness mode.
Dan Murphy951764b2009-08-27 14:59:03 -05002306 */
2307 public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode";
2308
Svetoslav683914b2015-01-15 14:22:26 -08002309 private static final Validator SCREEN_BRIGHTNESS_MODE_VALIDATOR = sBooleanValidator;
2310
Dan Murphy951764b2009-08-27 14:59:03 -05002311 /**
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08002312 * Adjustment to auto-brightness to make it generally more (>0.0 <1.0)
2313 * or less (<0.0 >-1.0) bright.
Dianne Hackborn518a3d82012-05-09 16:30:49 -07002314 * @hide
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08002315 */
2316 public static final String SCREEN_AUTO_BRIGHTNESS_ADJ = "screen_auto_brightness_adj";
2317
Svetoslav683914b2015-01-15 14:22:26 -08002318 private static final Validator SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR =
2319 new InclusiveFloatRangeValidator(-1, 1);
2320
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08002321 /**
Mike Lockwooddc3494e2009-10-14 21:17:09 -07002322 * SCREEN_BRIGHTNESS_MODE value for manual mode.
Mike Lockwooddc3494e2009-10-14 21:17:09 -07002323 */
2324 public static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0;
2325
2326 /**
Scott Main52bfc242012-02-09 10:09:14 -08002327 * SCREEN_BRIGHTNESS_MODE value for automatic mode.
Mike Lockwooddc3494e2009-10-14 21:17:09 -07002328 */
2329 public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1;
2330
2331 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002332 * Control whether the process CPU usage meter should be shown.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002333 *
2334 * @deprecated Use {@link Global#SHOW_PROCESSES} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002335 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002336 @Deprecated
2337 public static final String SHOW_PROCESSES = Global.SHOW_PROCESSES;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002338
2339 /**
2340 * If 1, the activity manager will aggressively finish activities and
2341 * processes as soon as they are no longer needed. If 0, the normal
2342 * extended lifetime is used.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002343 *
2344 * @deprecated Use {@link Global#ALWAYS_FINISH_ACTIVITIES} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002345 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002346 @Deprecated
2347 public static final String ALWAYS_FINISH_ACTIVITIES = Global.ALWAYS_FINISH_ACTIVITIES;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002348
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002349 /**
2350 * Determines which streams are affected by ringer mode changes. The
2351 * stream type's bit should be set to 1 if it should be muted when going
2352 * into an inaudible ringer mode.
2353 */
2354 public static final String MODE_RINGER_STREAMS_AFFECTED = "mode_ringer_streams_affected";
2355
Svetoslav683914b2015-01-15 14:22:26 -08002356 private static final Validator MODE_RINGER_STREAMS_AFFECTED_VALIDATOR =
2357 sNonNegativeIntegerValidator;
2358
2359 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002360 * Determines which streams are affected by mute. The
2361 * stream type's bit should be set to 1 if it should be muted when a mute request
2362 * is received.
2363 */
Svetoslav683914b2015-01-15 14:22:26 -08002364 public static final String MUTE_STREAMS_AFFECTED = "mute_streams_affected";
2365
2366 private static final Validator MUTE_STREAMS_AFFECTED_VALIDATOR =
2367 sNonNegativeIntegerValidator;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002368
2369 /**
2370 * Whether vibrate is on for different events. This is used internally,
2371 * changing this value will not change the vibrate. See AudioManager.
2372 */
2373 public static final String VIBRATE_ON = "vibrate_on";
2374
Svetoslav683914b2015-01-15 14:22:26 -08002375 private static final Validator VIBRATE_ON_VALIDATOR = sBooleanValidator;
2376
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002377 /**
Jeff Brown7f6c2312012-04-13 20:38:38 -07002378 * If 1, redirects the system vibrator to all currently attached input devices
2379 * that support vibration. If there are no such input devices, then the system
2380 * vibrator is used instead.
2381 * If 0, does not register the system vibrator.
2382 *
2383 * This setting is mainly intended to provide a compatibility mechanism for
2384 * applications that only know about the system vibrator and do not use the
2385 * input device vibrator API.
2386 *
2387 * @hide
2388 */
2389 public static final String VIBRATE_INPUT_DEVICES = "vibrate_input_devices";
2390
Svetoslav683914b2015-01-15 14:22:26 -08002391 private static final Validator VIBRATE_INPUT_DEVICES_VALIDATOR = sBooleanValidator;
2392
Jeff Brown7f6c2312012-04-13 20:38:38 -07002393 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002394 * Ringer volume. This is used internally, changing this value will not
2395 * change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002396 *
2397 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002398 */
2399 public static final String VOLUME_RING = "volume_ring";
2400
2401 /**
2402 * System/notifications volume. This is used internally, changing this
2403 * value will not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002404 *
2405 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002406 */
2407 public static final String VOLUME_SYSTEM = "volume_system";
2408
2409 /**
2410 * Voice call volume. This is used internally, changing this value will
2411 * not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002412 *
2413 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002414 */
2415 public static final String VOLUME_VOICE = "volume_voice";
2416
2417 /**
2418 * Music/media/gaming volume. This is used internally, changing this
2419 * value will not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002420 *
2421 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002422 */
2423 public static final String VOLUME_MUSIC = "volume_music";
2424
2425 /**
2426 * Alarm volume. This is used internally, changing this
2427 * value will not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002428 *
2429 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002430 */
2431 public static final String VOLUME_ALARM = "volume_alarm";
2432
2433 /**
2434 * Notification volume. This is used internally, changing this
2435 * value will not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002436 *
2437 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002438 */
2439 public static final String VOLUME_NOTIFICATION = "volume_notification";
2440
2441 /**
Eric Laurent484d2882009-12-08 09:05:45 -08002442 * Bluetooth Headset volume. This is used internally, changing this value will
2443 * not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002444 *
2445 * @removed Not used by anything since API 2.
Eric Laurent484d2882009-12-08 09:05:45 -08002446 */
2447 public static final String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco";
2448
2449 /**
Mike Lockwood8517e462011-10-25 14:47:19 -04002450 * Master volume (float in the range 0.0f to 1.0f).
Svetoslavdbbeeb32015-02-18 19:16:25 -08002451 *
Mike Lockwood8517e462011-10-25 14:47:19 -04002452 * @hide
2453 */
2454 public static final String VOLUME_MASTER = "volume_master";
2455
2456 /**
Justin Koh57978ed2012-04-03 17:37:58 -07002457 * Master volume mute (int 1 = mute, 0 = not muted).
2458 *
2459 * @hide
2460 */
2461 public static final String VOLUME_MASTER_MUTE = "volume_master_mute";
2462
Svetoslav683914b2015-01-15 14:22:26 -08002463 private static final Validator VOLUME_MASTER_MUTE_VALIDATOR = sBooleanValidator;
2464
Justin Koh57978ed2012-04-03 17:37:58 -07002465 /**
Julia Reynoldsb53453f2014-08-22 11:42:43 -04002466 * Microphone mute (int 1 = mute, 0 = not muted).
2467 *
2468 * @hide
2469 */
2470 public static final String MICROPHONE_MUTE = "microphone_mute";
2471
Svetoslav683914b2015-01-15 14:22:26 -08002472 private static final Validator MICROPHONE_MUTE_VALIDATOR = sBooleanValidator;
2473
Julia Reynoldsb53453f2014-08-22 11:42:43 -04002474 /**
Justin Koh57978ed2012-04-03 17:37:58 -07002475 * Whether the notifications should use the ring volume (value of 1) or
2476 * a separate notification volume (value of 0). In most cases, users
2477 * will have this enabled so the notification and ringer volumes will be
2478 * the same. However, power users can disable this and use the separate
2479 * notification volume control.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002480 * <p>
Justin Koh57978ed2012-04-03 17:37:58 -07002481 * Note: This is a one-off setting that will be removed in the future
2482 * when there is profile support. For this reason, it is kept hidden
2483 * from the public APIs.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002484 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002485 * @hide
Amith Yamasani42722bf2011-07-22 10:34:27 -07002486 * @deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002487 */
Gilles Debunnee90bed12011-08-30 14:28:27 -07002488 @Deprecated
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002489 public static final String NOTIFICATIONS_USE_RING_VOLUME =
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002490 "notifications_use_ring_volume";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002491
Svetoslav683914b2015-01-15 14:22:26 -08002492 private static final Validator NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR = sBooleanValidator;
2493
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002494 /**
Daniel Sandler6329bf72010-02-26 15:17:44 -05002495 * Whether silent mode should allow vibration feedback. This is used
2496 * internally in AudioService and the Sound settings activity to
2497 * coordinate decoupling of vibrate and silent modes. This setting
2498 * will likely be removed in a future release with support for
2499 * audio/vibe feedback profiles.
2500 *
Eric Laurentbffc3d12012-05-07 17:43:49 -07002501 * Not used anymore. On devices with vibrator, the user explicitly selects
2502 * silent or vibrate mode.
2503 * Kept for use by legacy database upgrade code in DatabaseHelper.
Daniel Sandler6329bf72010-02-26 15:17:44 -05002504 * @hide
2505 */
2506 public static final String VIBRATE_IN_SILENT = "vibrate_in_silent";
2507
Svetoslav683914b2015-01-15 14:22:26 -08002508 private static final Validator VIBRATE_IN_SILENT_VALIDATOR = sBooleanValidator;
2509
Daniel Sandler6329bf72010-02-26 15:17:44 -05002510 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002511 * The mapping of stream type (integer) to its setting.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002512 *
2513 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002514 */
2515 public static final String[] VOLUME_SETTINGS = {
2516 VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC,
Eric Laurent484d2882009-12-08 09:05:45 -08002517 VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002518 };
2519
2520 /**
2521 * Appended to various volume related settings to record the previous
2522 * values before they the settings were affected by a silent/vibrate
2523 * ringer mode change.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002524 *
2525 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002526 */
2527 public static final String APPEND_FOR_LAST_AUDIBLE = "_last_audible";
2528
2529 /**
2530 * Persistent store for the system-wide default ringtone URI.
2531 * <p>
2532 * If you need to play the default ringtone at any given time, it is recommended
2533 * you give {@link #DEFAULT_RINGTONE_URI} to the media player. It will resolve
2534 * to the set default ringtone at the time of playing.
2535 *
2536 * @see #DEFAULT_RINGTONE_URI
2537 */
2538 public static final String RINGTONE = "ringtone";
2539
Svetoslav683914b2015-01-15 14:22:26 -08002540 private static final Validator RINGTONE_VALIDATOR = sUriValidator;
2541
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002542 /**
2543 * A {@link Uri} that will point to the current default ringtone at any
2544 * given time.
2545 * <p>
2546 * If the current default ringtone is in the DRM provider and the caller
2547 * does not have permission, the exception will be a
2548 * FileNotFoundException.
2549 */
2550 public static final Uri DEFAULT_RINGTONE_URI = getUriFor(RINGTONE);
2551
2552 /**
2553 * Persistent store for the system-wide default notification sound.
2554 *
2555 * @see #RINGTONE
2556 * @see #DEFAULT_NOTIFICATION_URI
2557 */
2558 public static final String NOTIFICATION_SOUND = "notification_sound";
2559
Svetoslav683914b2015-01-15 14:22:26 -08002560 private static final Validator NOTIFICATION_SOUND_VALIDATOR = sUriValidator;
2561
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002562 /**
2563 * A {@link Uri} that will point to the current default notification
2564 * sound at any given time.
2565 *
2566 * @see #DEFAULT_RINGTONE_URI
2567 */
2568 public static final Uri DEFAULT_NOTIFICATION_URI = getUriFor(NOTIFICATION_SOUND);
2569
2570 /**
Patrick Scott3156bb002009-04-13 09:57:38 -07002571 * Persistent store for the system-wide default alarm alert.
2572 *
2573 * @see #RINGTONE
2574 * @see #DEFAULT_ALARM_ALERT_URI
2575 */
2576 public static final String ALARM_ALERT = "alarm_alert";
2577
Svetoslav683914b2015-01-15 14:22:26 -08002578 private static final Validator ALARM_ALERT_VALIDATOR = sUriValidator;
2579
Patrick Scott3156bb002009-04-13 09:57:38 -07002580 /**
2581 * A {@link Uri} that will point to the current default alarm alert at
2582 * any given time.
2583 *
2584 * @see #DEFAULT_ALARM_ALERT_URI
2585 */
2586 public static final Uri DEFAULT_ALARM_ALERT_URI = getUriFor(ALARM_ALERT);
2587
2588 /**
Jean-Michel Trivid589fea2011-04-15 11:28:10 -07002589 * Persistent store for the system default media button event receiver.
2590 *
2591 * @hide
2592 */
2593 public static final String MEDIA_BUTTON_RECEIVER = "media_button_receiver";
2594
Svetoslav683914b2015-01-15 14:22:26 -08002595 private static final Validator MEDIA_BUTTON_RECEIVER_VALIDATOR = new Validator() {
2596 @Override
2597 public boolean validate(String value) {
2598 try {
2599 ComponentName.unflattenFromString(value);
2600 return true;
2601 } catch (NullPointerException e) {
2602 return false;
2603 }
2604 }
2605 };
2606
Jean-Michel Trivid589fea2011-04-15 11:28:10 -07002607 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002608 * Setting to enable Auto Replace (AutoText) in text editors. 1 = On, 0 = Off
2609 */
2610 public static final String TEXT_AUTO_REPLACE = "auto_replace";
2611
Svetoslav683914b2015-01-15 14:22:26 -08002612 private static final Validator TEXT_AUTO_REPLACE_VALIDATOR = sBooleanValidator;
2613
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002614 /**
2615 * Setting to enable Auto Caps in text editors. 1 = On, 0 = Off
2616 */
2617 public static final String TEXT_AUTO_CAPS = "auto_caps";
2618
Svetoslav683914b2015-01-15 14:22:26 -08002619 private static final Validator TEXT_AUTO_CAPS_VALIDATOR = sBooleanValidator;
2620
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002621 /**
2622 * Setting to enable Auto Punctuate in text editors. 1 = On, 0 = Off. This
2623 * feature converts two spaces to a "." and space.
2624 */
2625 public static final String TEXT_AUTO_PUNCTUATE = "auto_punctuate";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002626
Svetoslav683914b2015-01-15 14:22:26 -08002627 private static final Validator TEXT_AUTO_PUNCTUATE_VALIDATOR = sBooleanValidator;
2628
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002629 /**
2630 * Setting to showing password characters in text editors. 1 = On, 0 = Off
2631 */
2632 public static final String TEXT_SHOW_PASSWORD = "show_password";
2633
Svetoslav683914b2015-01-15 14:22:26 -08002634 private static final Validator TEXT_SHOW_PASSWORD_VALIDATOR = sBooleanValidator;
2635
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002636 public static final String SHOW_GTALK_SERVICE_STATUS =
2637 "SHOW_GTALK_SERVICE_STATUS";
2638
Svetoslav683914b2015-01-15 14:22:26 -08002639 private static final Validator SHOW_GTALK_SERVICE_STATUS_VALIDATOR = sBooleanValidator;
2640
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002641 /**
2642 * Name of activity to use for wallpaper on the home screen.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002643 *
2644 * @deprecated Use {@link WallpaperManager} instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002645 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002646 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002647 public static final String WALLPAPER_ACTIVITY = "wallpaper_activity";
2648
Svetoslav683914b2015-01-15 14:22:26 -08002649 private static final Validator WALLPAPER_ACTIVITY_VALIDATOR = new Validator() {
2650 private static final int MAX_LENGTH = 1000;
2651
2652 @Override
2653 public boolean validate(String value) {
2654 if (value != null && value.length() > MAX_LENGTH) {
2655 return false;
2656 }
2657 return ComponentName.unflattenFromString(value) != null;
2658 }
2659 };
2660
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002661 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002662 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME}
2663 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002664 */
Christopher Tate06efb532012-08-24 15:29:27 -07002665 @Deprecated
2666 public static final String AUTO_TIME = Global.AUTO_TIME;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002667
2668 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002669 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME_ZONE}
2670 * instead
Amith Yamasaniad450be2010-09-16 16:47:00 -07002671 */
Christopher Tate06efb532012-08-24 15:29:27 -07002672 @Deprecated
2673 public static final String AUTO_TIME_ZONE = Global.AUTO_TIME_ZONE;
Amith Yamasaniad450be2010-09-16 16:47:00 -07002674
2675 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002676 * Display times as 12 or 24 hours
2677 * 12
2678 * 24
2679 */
2680 public static final String TIME_12_24 = "time_12_24";
2681
Svetoslav683914b2015-01-15 14:22:26 -08002682 /** @hide */
2683 public static final Validator TIME_12_24_VALIDATOR =
2684 new DiscreteValueValidator(new String[] {"12", "24"});
2685
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002686 /**
2687 * Date format string
2688 * mm/dd/yyyy
2689 * dd/mm/yyyy
2690 * yyyy/mm/dd
2691 */
2692 public static final String DATE_FORMAT = "date_format";
2693
Svetoslav683914b2015-01-15 14:22:26 -08002694 /** @hide */
2695 public static final Validator DATE_FORMAT_VALIDATOR = new Validator() {
2696 @Override
2697 public boolean validate(String value) {
2698 try {
2699 new SimpleDateFormat(value);
2700 return true;
2701 } catch (IllegalArgumentException e) {
2702 return false;
2703 }
2704 }
2705 };
2706
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002707 /**
2708 * Whether the setup wizard has been run before (on first boot), or if
2709 * it still needs to be run.
2710 *
2711 * nonzero = it has been run in the past
2712 * 0 = it has not been run in the past
2713 */
2714 public static final String SETUP_WIZARD_HAS_RUN = "setup_wizard_has_run";
2715
Svetoslav683914b2015-01-15 14:22:26 -08002716 /** @hide */
2717 public static final Validator SETUP_WIZARD_HAS_RUN_VALIDATOR = sBooleanValidator;
2718
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002719 /**
2720 * Scaling factor for normal window animations. Setting to 0 will disable window
2721 * animations.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002722 *
2723 * @deprecated Use {@link Global#WINDOW_ANIMATION_SCALE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002724 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002725 @Deprecated
2726 public static final String WINDOW_ANIMATION_SCALE = Global.WINDOW_ANIMATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002727
2728 /**
2729 * Scaling factor for activity transition animations. Setting to 0 will disable window
2730 * animations.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002731 *
2732 * @deprecated Use {@link Global#TRANSITION_ANIMATION_SCALE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002733 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002734 @Deprecated
2735 public static final String TRANSITION_ANIMATION_SCALE = Global.TRANSITION_ANIMATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002736
2737 /**
Chet Haasec38fa1f2012-02-01 16:37:46 -08002738 * Scaling factor for Animator-based animations. This affects both the start delay and
2739 * duration of all such animations. Setting to 0 will cause animations to end immediately.
2740 * The default value is 1.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002741 *
2742 * @deprecated Use {@link Global#ANIMATOR_DURATION_SCALE} instead
Chet Haasec38fa1f2012-02-01 16:37:46 -08002743 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002744 @Deprecated
2745 public static final String ANIMATOR_DURATION_SCALE = Global.ANIMATOR_DURATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002746
2747 /**
2748 * Control whether the accelerometer will be used to change screen
2749 * orientation. If 0, it will not be used unless explicitly requested
2750 * by the application; if 1, it will be used by default unless explicitly
2751 * disabled by the application.
2752 */
2753 public static final String ACCELEROMETER_ROTATION = "accelerometer_rotation";
2754
Svetoslav683914b2015-01-15 14:22:26 -08002755 /** @hide */
2756 public static final Validator ACCELEROMETER_ROTATION_VALIDATOR = sBooleanValidator;
2757
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002758 /**
Daniel Sandlerb73617d2010-08-17 00:41:00 -04002759 * Default screen rotation when no other policy applies.
2760 * When {@link #ACCELEROMETER_ROTATION} is zero and no on-screen Activity expresses a
2761 * preference, this rotation value will be used. Must be one of the
Brian Muramatsue1d46982010-12-06 17:34:20 -08002762 * {@link android.view.Surface#ROTATION_0 Surface rotation constants}.
Daniel Sandlerb73617d2010-08-17 00:41:00 -04002763 *
Dianne Hackborn16ec0802014-08-15 18:32:33 -07002764 * @see android.view.Display#getRotation
Daniel Sandlerb73617d2010-08-17 00:41:00 -04002765 */
2766 public static final String USER_ROTATION = "user_rotation";
2767
Svetoslav683914b2015-01-15 14:22:26 -08002768 /** @hide */
2769 public static final Validator USER_ROTATION_VALIDATOR =
2770 new InclusiveIntegerRangeValidator(0, 3);
2771
Daniel Sandlerb73617d2010-08-17 00:41:00 -04002772 /**
Jeff Brown207673cd2012-06-05 17:47:11 -07002773 * Control whether the rotation lock toggle in the System UI should be hidden.
2774 * Typically this is done for accessibility purposes to make it harder for
2775 * the user to accidentally toggle the rotation lock while the display rotation
2776 * has been locked for accessibility.
2777 *
2778 * If 0, then rotation lock toggle is not hidden for accessibility (although it may be
2779 * unavailable for other reasons). If 1, then the rotation lock toggle is hidden.
2780 *
2781 * @hide
2782 */
2783 public static final String HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY =
2784 "hide_rotation_lock_toggle_for_accessibility";
2785
Svetoslav683914b2015-01-15 14:22:26 -08002786 /** @hide */
2787 public static final Validator HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR =
2788 sBooleanValidator;
2789
Jeff Brown207673cd2012-06-05 17:47:11 -07002790 /**
Daisuke Miyakawa3c60eeb2012-05-08 12:08:25 -07002791 * Whether the phone vibrates when it is ringing due to an incoming call. This will
2792 * be used by Phone and Setting apps; it shouldn't affect other apps.
2793 * The value is boolean (1 or 0).
2794 *
2795 * Note: this is not same as "vibrate on ring", which had been available until ICS.
2796 * It was about AudioManager's setting and thus affected all the applications which
2797 * relied on the setting, while this is purely about the vibration setting for incoming
2798 * calls.
Daisuke Miyakawa3c60eeb2012-05-08 12:08:25 -07002799 */
2800 public static final String VIBRATE_WHEN_RINGING = "vibrate_when_ringing";
2801
Svetoslav683914b2015-01-15 14:22:26 -08002802 /** @hide */
2803 public static final Validator VIBRATE_WHEN_RINGING_VALIDATOR = sBooleanValidator;
2804
Daisuke Miyakawa3c60eeb2012-05-08 12:08:25 -07002805 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002806 * Whether the audible DTMF tones are played by the dialer when dialing. The value is
2807 * boolean (1 or 0).
2808 */
2809 public static final String DTMF_TONE_WHEN_DIALING = "dtmf_tone";
2810
Svetoslav683914b2015-01-15 14:22:26 -08002811 /** @hide */
2812 public static final Validator DTMF_TONE_WHEN_DIALING_VALIDATOR = sBooleanValidator;
2813
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002814 /**
David Kraused0f67152009-06-13 18:01:13 -05002815 * CDMA only settings
2816 * DTMF tone type played by the dialer when dialing.
2817 * 0 = Normal
2818 * 1 = Long
David Kraused0f67152009-06-13 18:01:13 -05002819 */
2820 public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type";
2821
Svetoslav683914b2015-01-15 14:22:26 -08002822 /** @hide */
2823 public static final Validator DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR = sBooleanValidator;
2824
David Kraused0f67152009-06-13 18:01:13 -05002825 /**
David Kraused0f67152009-06-13 18:01:13 -05002826 * Whether the hearing aid is enabled. The value is
2827 * boolean (1 or 0).
2828 * @hide
2829 */
2830 public static final String HEARING_AID = "hearing_aid";
2831
Svetoslav683914b2015-01-15 14:22:26 -08002832 /** @hide */
2833 public static final Validator HEARING_AID_VALIDATOR = sBooleanValidator;
2834
David Kraused0f67152009-06-13 18:01:13 -05002835 /**
2836 * CDMA only settings
2837 * TTY Mode
2838 * 0 = OFF
2839 * 1 = FULL
2840 * 2 = VCO
2841 * 3 = HCO
2842 * @hide
2843 */
2844 public static final String TTY_MODE = "tty_mode";
2845
Svetoslav683914b2015-01-15 14:22:26 -08002846 /** @hide */
2847 public static final Validator TTY_MODE_VALIDATOR = new InclusiveIntegerRangeValidator(0, 3);
2848
David Kraused0f67152009-06-13 18:01:13 -05002849 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002850 * Whether the sounds effects (key clicks, lid open ...) are enabled. The value is
2851 * boolean (1 or 0).
2852 */
2853 public static final String SOUND_EFFECTS_ENABLED = "sound_effects_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002854
Svetoslav683914b2015-01-15 14:22:26 -08002855 /** @hide */
2856 public static final Validator SOUND_EFFECTS_ENABLED_VALIDATOR = sBooleanValidator;
2857
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002858 /**
2859 * Whether the haptic feedback (long presses, ...) are enabled. The value is
2860 * boolean (1 or 0).
2861 */
2862 public static final String HAPTIC_FEEDBACK_ENABLED = "haptic_feedback_enabled";
Sanjay Jeyakumar21bf2412009-07-09 13:31:48 -07002863
Svetoslav683914b2015-01-15 14:22:26 -08002864 /** @hide */
2865 public static final Validator HAPTIC_FEEDBACK_ENABLED_VALIDATOR = sBooleanValidator;
2866
Mike LeBeau48603e72009-06-05 00:27:00 +01002867 /**
Bjorn Bringert24abb662010-09-21 12:21:18 +01002868 * @deprecated Each application that shows web suggestions should have its own
2869 * setting for this.
Mike LeBeau48603e72009-06-05 00:27:00 +01002870 */
Bjorn Bringert24abb662010-09-21 12:21:18 +01002871 @Deprecated
Mike LeBeau48603e72009-06-05 00:27:00 +01002872 public static final String SHOW_WEB_SUGGESTIONS = "show_web_suggestions";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002873
Svetoslav683914b2015-01-15 14:22:26 -08002874 /** @hide */
2875 public static final Validator SHOW_WEB_SUGGESTIONS_VALIDATOR = sBooleanValidator;
2876
-b master501eec92009-07-06 13:53:11 -07002877 /**
Amith Yamasaniae3ed702009-12-01 19:02:05 -08002878 * Whether the notification LED should repeatedly flash when a notification is
2879 * pending. The value is boolean (1 or 0).
2880 * @hide
2881 */
2882 public static final String NOTIFICATION_LIGHT_PULSE = "notification_light_pulse";
2883
Svetoslav683914b2015-01-15 14:22:26 -08002884 /** @hide */
2885 public static final Validator NOTIFICATION_LIGHT_PULSE_VALIDATOR = sBooleanValidator;
2886
Amith Yamasaniae3ed702009-12-01 19:02:05 -08002887 /**
Dianne Hackborn90d2db32010-02-11 22:19:06 -08002888 * Show pointer location on screen?
2889 * 0 = no
2890 * 1 = yes
2891 * @hide
2892 */
2893 public static final String POINTER_LOCATION = "pointer_location";
2894
Svetoslav683914b2015-01-15 14:22:26 -08002895 /** @hide */
2896 public static final Validator POINTER_LOCATION_VALIDATOR = sBooleanValidator;
2897
Dianne Hackborn90d2db32010-02-11 22:19:06 -08002898 /**
Jeff Browndaf4a122011-08-26 17:14:14 -07002899 * Show touch positions on screen?
2900 * 0 = no
2901 * 1 = yes
2902 * @hide
2903 */
2904 public static final String SHOW_TOUCHES = "show_touches";
2905
Svetoslav683914b2015-01-15 14:22:26 -08002906 /** @hide */
2907 public static final Validator SHOW_TOUCHES_VALIDATOR = sBooleanValidator;
2908
Jeff Browndaf4a122011-08-26 17:14:14 -07002909 /**
Dianne Hackborn16ec0802014-08-15 18:32:33 -07002910 * Log raw orientation data from
Jorim Jaggib10e33f2015-02-04 21:57:40 +01002911 * {@link com.android.server.policy.WindowOrientationListener} for use with the
Jeff Brown4519f072011-01-23 13:16:01 -08002912 * orientationplot.py tool.
2913 * 0 = no
2914 * 1 = yes
2915 * @hide
2916 */
2917 public static final String WINDOW_ORIENTATION_LISTENER_LOG =
2918 "window_orientation_listener_log";
2919
Svetoslav683914b2015-01-15 14:22:26 -08002920 /** @hide */
2921 public static final Validator WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR = sBooleanValidator;
2922
Jeff Brown4519f072011-01-23 13:16:01 -08002923 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002924 * @deprecated Use {@link android.provider.Settings.Global#POWER_SOUNDS_ENABLED}
2925 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002926 * @hide
2927 */
Christopher Tate06efb532012-08-24 15:29:27 -07002928 @Deprecated
2929 public static final String POWER_SOUNDS_ENABLED = Global.POWER_SOUNDS_ENABLED;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002930
2931 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002932 * @deprecated Use {@link android.provider.Settings.Global#DOCK_SOUNDS_ENABLED}
2933 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002934 * @hide
2935 */
Christopher Tate06efb532012-08-24 15:29:27 -07002936 @Deprecated
2937 public static final String DOCK_SOUNDS_ENABLED = Global.DOCK_SOUNDS_ENABLED;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002938
2939 /**
2940 * Whether to play sounds when the keyguard is shown and dismissed.
2941 * @hide
2942 */
2943 public static final String LOCKSCREEN_SOUNDS_ENABLED = "lockscreen_sounds_enabled";
2944
Svetoslav683914b2015-01-15 14:22:26 -08002945 /** @hide */
2946 public static final Validator LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR = sBooleanValidator;
2947
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002948 /**
Mike Lockwood7bef7392011-10-20 16:51:53 -04002949 * Whether the lockscreen should be completely disabled.
2950 * @hide
2951 */
2952 public static final String LOCKSCREEN_DISABLED = "lockscreen.disabled";
2953
Svetoslav683914b2015-01-15 14:22:26 -08002954 /** @hide */
2955 public static final Validator LOCKSCREEN_DISABLED_VALIDATOR = sBooleanValidator;
2956
Mike Lockwood7bef7392011-10-20 16:51:53 -04002957 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002958 * @deprecated Use {@link android.provider.Settings.Global#LOW_BATTERY_SOUND}
2959 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002960 * @hide
2961 */
Christopher Tate06efb532012-08-24 15:29:27 -07002962 @Deprecated
2963 public static final String LOW_BATTERY_SOUND = Global.LOW_BATTERY_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002964
2965 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002966 * @deprecated Use {@link android.provider.Settings.Global#DESK_DOCK_SOUND}
2967 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002968 * @hide
2969 */
Christopher Tate06efb532012-08-24 15:29:27 -07002970 @Deprecated
2971 public static final String DESK_DOCK_SOUND = Global.DESK_DOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002972
2973 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002974 * @deprecated Use {@link android.provider.Settings.Global#DESK_UNDOCK_SOUND}
2975 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002976 * @hide
2977 */
Christopher Tate06efb532012-08-24 15:29:27 -07002978 @Deprecated
2979 public static final String DESK_UNDOCK_SOUND = Global.DESK_UNDOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002980
2981 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002982 * @deprecated Use {@link android.provider.Settings.Global#CAR_DOCK_SOUND}
2983 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002984 * @hide
2985 */
Christopher Tate06efb532012-08-24 15:29:27 -07002986 @Deprecated
2987 public static final String CAR_DOCK_SOUND = Global.CAR_DOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002988
2989 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002990 * @deprecated Use {@link android.provider.Settings.Global#CAR_UNDOCK_SOUND}
2991 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002992 * @hide
2993 */
Christopher Tate06efb532012-08-24 15:29:27 -07002994 @Deprecated
2995 public static final String CAR_UNDOCK_SOUND = Global.CAR_UNDOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002996
2997 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002998 * @deprecated Use {@link android.provider.Settings.Global#LOCK_SOUND}
2999 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003000 * @hide
3001 */
Christopher Tate06efb532012-08-24 15:29:27 -07003002 @Deprecated
3003 public static final String LOCK_SOUND = Global.LOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003004
3005 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003006 * @deprecated Use {@link android.provider.Settings.Global#UNLOCK_SOUND}
3007 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003008 * @hide
3009 */
Christopher Tate06efb532012-08-24 15:29:27 -07003010 @Deprecated
3011 public static final String UNLOCK_SOUND = Global.UNLOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003012
3013 /**
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003014 * Receive incoming SIP calls?
3015 * 0 = no
3016 * 1 = yes
3017 * @hide
3018 */
3019 public static final String SIP_RECEIVE_CALLS = "sip_receive_calls";
3020
Svetoslav683914b2015-01-15 14:22:26 -08003021 /** @hide */
3022 public static final Validator SIP_RECEIVE_CALLS_VALIDATOR = sBooleanValidator;
3023
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003024 /**
3025 * Call Preference String.
3026 * "SIP_ALWAYS" : Always use SIP with network access
3027 * "SIP_ADDRESS_ONLY" : Only if destination is a SIP address
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003028 * @hide
3029 */
3030 public static final String SIP_CALL_OPTIONS = "sip_call_options";
3031
Svetoslav683914b2015-01-15 14:22:26 -08003032 /** @hide */
3033 public static final Validator SIP_CALL_OPTIONS_VALIDATOR = new DiscreteValueValidator(
3034 new String[] {"SIP_ALWAYS", "SIP_ADDRESS_ONLY"});
3035
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003036 /**
3037 * One of the sip call options: Always use SIP with network access.
3038 * @hide
3039 */
3040 public static final String SIP_ALWAYS = "SIP_ALWAYS";
3041
Svetoslav683914b2015-01-15 14:22:26 -08003042 /** @hide */
3043 public static final Validator SIP_ALWAYS_VALIDATOR = sBooleanValidator;
3044
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003045 /**
3046 * One of the sip call options: Only if destination is a SIP address.
3047 * @hide
3048 */
3049 public static final String SIP_ADDRESS_ONLY = "SIP_ADDRESS_ONLY";
3050
Svetoslav683914b2015-01-15 14:22:26 -08003051 /** @hide */
3052 public static final Validator SIP_ADDRESS_ONLY_VALIDATOR = sBooleanValidator;
3053
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003054 /**
Tyler Gunn2c830a22014-09-02 08:39:35 -07003055 * @deprecated Use SIP_ALWAYS or SIP_ADDRESS_ONLY instead. Formerly used to indicate that
3056 * the user should be prompted each time a call is made whether it should be placed using
3057 * SIP. The {@link com.android.providers.settings.DatabaseHelper} replaces this with
3058 * SIP_ADDRESS_ONLY.
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003059 * @hide
3060 */
Tyler Gunn2c830a22014-09-02 08:39:35 -07003061 @Deprecated
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003062 public static final String SIP_ASK_ME_EACH_TIME = "SIP_ASK_ME_EACH_TIME";
3063
Svetoslav683914b2015-01-15 14:22:26 -08003064 /** @hide */
3065 public static final Validator SIP_ASK_ME_EACH_TIME_VALIDATOR = sBooleanValidator;
3066
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003067 /**
Jeff Brown1a84fd12011-06-02 01:26:32 -07003068 * Pointer speed setting.
3069 * This is an integer value in a range between -7 and +7, so there are 15 possible values.
3070 * -7 = slowest
3071 * 0 = default speed
3072 * +7 = fastest
3073 * @hide
3074 */
3075 public static final String POINTER_SPEED = "pointer_speed";
3076
Svetoslav683914b2015-01-15 14:22:26 -08003077 /** @hide */
3078 public static final Validator POINTER_SPEED_VALIDATOR =
3079 new InclusiveFloatRangeValidator(-7, 7);
3080
Jeff Brown1a84fd12011-06-02 01:26:32 -07003081 /**
Jason Monk56e09b42014-07-18 10:29:14 -04003082 * Whether lock-to-app will be triggered by long-press on recents.
3083 * @hide
3084 */
3085 public static final String LOCK_TO_APP_ENABLED = "lock_to_app_enabled";
3086
Svetoslav683914b2015-01-15 14:22:26 -08003087 /** @hide */
3088 public static final Validator LOCK_TO_APP_ENABLED_VALIDATOR = sBooleanValidator;
3089
Jason Monk56e09b42014-07-18 10:29:14 -04003090 /**
Daniel Sandler2fdb68b2013-10-03 00:12:11 -04003091 * I am the lolrus.
3092 * <p>
3093 * Nonzero values indicate that the user has a bukkit.
3094 * Backward-compatible with <code>PrefGetPreference(prefAllowEasterEggs)</code>.
3095 * @hide
3096 */
3097 public static final String EGG_MODE = "egg_mode";
3098
Svetoslav683914b2015-01-15 14:22:26 -08003099 /** @hide */
3100 public static final Validator EGG_MODE_VALIDATOR = sBooleanValidator;
3101
3102 /**
3103 * IMPORTANT: If you add a new public settings you also have to add it to
3104 * PUBLIC_SETTINGS below. If the new setting is hidden you have to add
3105 * it to PRIVATE_SETTINGS below. Also add a validator that can validate
3106 * the setting value. See an example above.
3107 */
3108
Daniel Sandler2fdb68b2013-10-03 00:12:11 -04003109 /**
-b master501eec92009-07-06 13:53:11 -07003110 * Settings to backup. This is here so that it's in the same place as the settings
3111 * keys and easy to update.
Svetoslav Ganova571a582011-09-20 18:32:20 -07003112 *
3113 * NOTE: Settings are backed up and restored in the order they appear
3114 * in this array. If you have one setting depending on another,
3115 * make sure that they are ordered appropriately.
3116 *
-b master501eec92009-07-06 13:53:11 -07003117 * @hide
3118 */
3119 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate66488d62012-10-02 11:58:01 -07003120 STAY_ON_WHILE_PLUGGED_IN, // moved to global
-b master501eec92009-07-06 13:53:11 -07003121 WIFI_USE_STATIC_IP,
3122 WIFI_STATIC_IP,
3123 WIFI_STATIC_GATEWAY,
3124 WIFI_STATIC_NETMASK,
3125 WIFI_STATIC_DNS1,
3126 WIFI_STATIC_DNS2,
3127 BLUETOOTH_DISCOVERABILITY,
3128 BLUETOOTH_DISCOVERABILITY_TIMEOUT,
3129 DIM_SCREEN,
3130 SCREEN_OFF_TIMEOUT,
3131 SCREEN_BRIGHTNESS,
Christopher Tate362aca62009-09-25 15:58:03 -07003132 SCREEN_BRIGHTNESS_MODE,
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08003133 SCREEN_AUTO_BRIGHTNESS_ADJ,
Jeff Brown7f6c2312012-04-13 20:38:38 -07003134 VIBRATE_INPUT_DEVICES,
Amith Yamasani8823c0a82009-07-07 14:30:17 -07003135 MODE_RINGER_STREAMS_AFFECTED,
-b master501eec92009-07-06 13:53:11 -07003136 TEXT_AUTO_REPLACE,
3137 TEXT_AUTO_CAPS,
3138 TEXT_AUTO_PUNCTUATE,
3139 TEXT_SHOW_PASSWORD,
Christopher Tate66488d62012-10-02 11:58:01 -07003140 AUTO_TIME, // moved to global
3141 AUTO_TIME_ZONE, // moved to global
-b master501eec92009-07-06 13:53:11 -07003142 TIME_12_24,
3143 DATE_FORMAT,
-b master501eec92009-07-06 13:53:11 -07003144 DTMF_TONE_WHEN_DIALING,
3145 DTMF_TONE_TYPE_WHEN_DIALING,
-b master501eec92009-07-06 13:53:11 -07003146 HEARING_AID,
3147 TTY_MODE,
3148 SOUND_EFFECTS_ENABLED,
3149 HAPTIC_FEEDBACK_ENABLED,
Christopher Tate66488d62012-10-02 11:58:01 -07003150 POWER_SOUNDS_ENABLED, // moved to global
3151 DOCK_SOUNDS_ENABLED, // moved to global
Christopher Tate14c2d792010-02-25 16:49:44 -08003152 LOCKSCREEN_SOUNDS_ENABLED,
Amith Yamasaniae3ed702009-12-01 19:02:05 -08003153 SHOW_WEB_SUGGESTIONS,
Mike Lockwoodeabe8bf2010-08-31 14:35:23 -04003154 NOTIFICATION_LIGHT_PULSE,
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003155 SIP_CALL_OPTIONS,
Nick Pelly038cabe2010-09-23 16:12:11 -07003156 SIP_RECEIVE_CALLS,
Jeff Brown1a84fd12011-06-02 01:26:32 -07003157 POINTER_SPEED,
Amith Yamasani622bf2222013-09-06 13:54:28 -07003158 VIBRATE_WHEN_RINGING,
3159 RINGTONE,
Jason Monk94cfd9d2014-10-31 13:18:21 -04003160 LOCK_TO_APP_ENABLED,
Amith Yamasani622bf2222013-09-06 13:54:28 -07003161 NOTIFICATION_SOUND
-b master501eec92009-07-06 13:53:11 -07003162 };
3163
Sailesh Nepal1bd78762014-02-11 22:32:21 -08003164 /**
Amith Yamasanib0ff3222015-03-04 09:56:14 -08003165 * These are all public system settings
Svetoslav683914b2015-01-15 14:22:26 -08003166 *
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07003167 * @hide
3168 */
Svetoslav683914b2015-01-15 14:22:26 -08003169 public static final Set<String> PUBLIC_SETTINGS = new ArraySet<>();
3170 static {
3171 PUBLIC_SETTINGS.add(END_BUTTON_BEHAVIOR);
3172 PUBLIC_SETTINGS.add(WIFI_USE_STATIC_IP);
3173 PUBLIC_SETTINGS.add(WIFI_STATIC_IP);
3174 PUBLIC_SETTINGS.add(WIFI_STATIC_GATEWAY);
3175 PUBLIC_SETTINGS.add(WIFI_STATIC_NETMASK);
3176 PUBLIC_SETTINGS.add(WIFI_STATIC_DNS1);
3177 PUBLIC_SETTINGS.add(WIFI_STATIC_DNS2);
3178 PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY);
3179 PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY_TIMEOUT);
3180 PUBLIC_SETTINGS.add(NEXT_ALARM_FORMATTED);
3181 PUBLIC_SETTINGS.add(FONT_SCALE);
3182 PUBLIC_SETTINGS.add(DIM_SCREEN);
3183 PUBLIC_SETTINGS.add(SCREEN_OFF_TIMEOUT);
3184 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS);
3185 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_MODE);
3186 PUBLIC_SETTINGS.add(MODE_RINGER_STREAMS_AFFECTED);
3187 PUBLIC_SETTINGS.add(MUTE_STREAMS_AFFECTED);
3188 PUBLIC_SETTINGS.add(VIBRATE_ON);
3189 PUBLIC_SETTINGS.add(VOLUME_RING);
3190 PUBLIC_SETTINGS.add(VOLUME_SYSTEM);
3191 PUBLIC_SETTINGS.add(VOLUME_VOICE);
3192 PUBLIC_SETTINGS.add(VOLUME_MUSIC);
3193 PUBLIC_SETTINGS.add(VOLUME_ALARM);
3194 PUBLIC_SETTINGS.add(VOLUME_NOTIFICATION);
3195 PUBLIC_SETTINGS.add(VOLUME_BLUETOOTH_SCO);
3196 PUBLIC_SETTINGS.add(RINGTONE);
3197 PUBLIC_SETTINGS.add(NOTIFICATION_SOUND);
3198 PUBLIC_SETTINGS.add(ALARM_ALERT);
3199 PUBLIC_SETTINGS.add(TEXT_AUTO_REPLACE);
3200 PUBLIC_SETTINGS.add(TEXT_AUTO_CAPS);
3201 PUBLIC_SETTINGS.add(TEXT_AUTO_PUNCTUATE);
3202 PUBLIC_SETTINGS.add(TEXT_SHOW_PASSWORD);
3203 PUBLIC_SETTINGS.add(SHOW_GTALK_SERVICE_STATUS);
3204 PUBLIC_SETTINGS.add(WALLPAPER_ACTIVITY);
3205 PUBLIC_SETTINGS.add(TIME_12_24);
3206 PUBLIC_SETTINGS.add(DATE_FORMAT);
3207 PUBLIC_SETTINGS.add(SETUP_WIZARD_HAS_RUN);
3208 PUBLIC_SETTINGS.add(ACCELEROMETER_ROTATION);
3209 PUBLIC_SETTINGS.add(USER_ROTATION);
3210 PUBLIC_SETTINGS.add(DTMF_TONE_WHEN_DIALING);
3211 PUBLIC_SETTINGS.add(SOUND_EFFECTS_ENABLED);
3212 PUBLIC_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED);
3213 PUBLIC_SETTINGS.add(SHOW_WEB_SUGGESTIONS);
3214 }
3215
3216 /**
3217 * These are all hidden system settings.
3218 *
3219 * @hide
3220 */
3221 public static final Set<String> PRIVATE_SETTINGS = new ArraySet<>();
3222 static {
3223 PRIVATE_SETTINGS.add(WIFI_USE_STATIC_IP);
3224 PRIVATE_SETTINGS.add(END_BUTTON_BEHAVIOR);
3225 PRIVATE_SETTINGS.add(ADVANCED_SETTINGS);
3226 PRIVATE_SETTINGS.add(SCREEN_AUTO_BRIGHTNESS_ADJ);
3227 PRIVATE_SETTINGS.add(VIBRATE_INPUT_DEVICES);
3228 PRIVATE_SETTINGS.add(VOLUME_MASTER);
3229 PRIVATE_SETTINGS.add(VOLUME_MASTER_MUTE);
3230 PRIVATE_SETTINGS.add(MICROPHONE_MUTE);
3231 PRIVATE_SETTINGS.add(NOTIFICATIONS_USE_RING_VOLUME);
3232 PRIVATE_SETTINGS.add(VIBRATE_IN_SILENT);
3233 PRIVATE_SETTINGS.add(MEDIA_BUTTON_RECEIVER);
3234 PRIVATE_SETTINGS.add(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY);
3235 PRIVATE_SETTINGS.add(VIBRATE_WHEN_RINGING);
3236 PRIVATE_SETTINGS.add(DTMF_TONE_TYPE_WHEN_DIALING);
3237 PRIVATE_SETTINGS.add(HEARING_AID);
3238 PRIVATE_SETTINGS.add(TTY_MODE);
3239 PRIVATE_SETTINGS.add(NOTIFICATION_LIGHT_PULSE);
3240 PRIVATE_SETTINGS.add(POINTER_LOCATION);
3241 PRIVATE_SETTINGS.add(SHOW_TOUCHES);
3242 PRIVATE_SETTINGS.add(WINDOW_ORIENTATION_LISTENER_LOG);
3243 PRIVATE_SETTINGS.add(POWER_SOUNDS_ENABLED);
3244 PRIVATE_SETTINGS.add(DOCK_SOUNDS_ENABLED);
3245 PRIVATE_SETTINGS.add(LOCKSCREEN_SOUNDS_ENABLED);
3246 PRIVATE_SETTINGS.add(LOCKSCREEN_DISABLED);
3247 PRIVATE_SETTINGS.add(LOW_BATTERY_SOUND);
3248 PRIVATE_SETTINGS.add(DESK_DOCK_SOUND);
3249 PRIVATE_SETTINGS.add(DESK_UNDOCK_SOUND);
3250 PRIVATE_SETTINGS.add(CAR_DOCK_SOUND);
3251 PRIVATE_SETTINGS.add(CAR_UNDOCK_SOUND);
3252 PRIVATE_SETTINGS.add(LOCK_SOUND);
3253 PRIVATE_SETTINGS.add(UNLOCK_SOUND);
3254 PRIVATE_SETTINGS.add(SIP_RECEIVE_CALLS);
3255 PRIVATE_SETTINGS.add(SIP_CALL_OPTIONS);
3256 PRIVATE_SETTINGS.add(SIP_ALWAYS);
3257 PRIVATE_SETTINGS.add(SIP_ADDRESS_ONLY);
3258 PRIVATE_SETTINGS.add(SIP_ASK_ME_EACH_TIME);
3259 PRIVATE_SETTINGS.add(POINTER_SPEED);
3260 PRIVATE_SETTINGS.add(LOCK_TO_APP_ENABLED);
3261 PRIVATE_SETTINGS.add(EGG_MODE);
3262 }
3263
3264 /**
Amith Yamasanib0ff3222015-03-04 09:56:14 -08003265 * These are all public system settings
Svetoslav683914b2015-01-15 14:22:26 -08003266 *
3267 * @hide
3268 */
3269 public static final Map<String, Validator> VALIDATORS = new ArrayMap<>();
3270 static {
3271 VALIDATORS.put(END_BUTTON_BEHAVIOR,END_BUTTON_BEHAVIOR_VALIDATOR);
3272 VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR);
3273 VALIDATORS.put(BLUETOOTH_DISCOVERABILITY, BLUETOOTH_DISCOVERABILITY_VALIDATOR);
3274 VALIDATORS.put(BLUETOOTH_DISCOVERABILITY_TIMEOUT,
3275 BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR);
3276 VALIDATORS.put(NEXT_ALARM_FORMATTED, NEXT_ALARM_FORMATTED_VALIDATOR);
3277 VALIDATORS.put(FONT_SCALE, FONT_SCALE_VALIDATOR);
3278 VALIDATORS.put(DIM_SCREEN, DIM_SCREEN_VALIDATOR);
3279 VALIDATORS.put(SCREEN_OFF_TIMEOUT, SCREEN_OFF_TIMEOUT_VALIDATOR);
3280 VALIDATORS.put(SCREEN_BRIGHTNESS, SCREEN_BRIGHTNESS_VALIDATOR);
3281 VALIDATORS.put(SCREEN_BRIGHTNESS_MODE, SCREEN_BRIGHTNESS_MODE_VALIDATOR);
3282 VALIDATORS.put(MODE_RINGER_STREAMS_AFFECTED, MODE_RINGER_STREAMS_AFFECTED_VALIDATOR);
3283 VALIDATORS.put(MUTE_STREAMS_AFFECTED, MUTE_STREAMS_AFFECTED_VALIDATOR);
3284 VALIDATORS.put(VIBRATE_ON, VIBRATE_ON_VALIDATOR);
Svetoslav683914b2015-01-15 14:22:26 -08003285 VALIDATORS.put(RINGTONE, RINGTONE_VALIDATOR);
3286 VALIDATORS.put(NOTIFICATION_SOUND, NOTIFICATION_SOUND_VALIDATOR);
3287 VALIDATORS.put(ALARM_ALERT, ALARM_ALERT_VALIDATOR);
3288 VALIDATORS.put(TEXT_AUTO_REPLACE, TEXT_AUTO_REPLACE_VALIDATOR);
3289 VALIDATORS.put(TEXT_AUTO_CAPS, TEXT_AUTO_CAPS_VALIDATOR);
3290 VALIDATORS.put(TEXT_AUTO_PUNCTUATE, TEXT_AUTO_PUNCTUATE_VALIDATOR);
3291 VALIDATORS.put(TEXT_SHOW_PASSWORD, TEXT_SHOW_PASSWORD_VALIDATOR);
3292 VALIDATORS.put(SHOW_GTALK_SERVICE_STATUS, SHOW_GTALK_SERVICE_STATUS_VALIDATOR);
3293 VALIDATORS.put(WALLPAPER_ACTIVITY, WALLPAPER_ACTIVITY_VALIDATOR);
3294 VALIDATORS.put(TIME_12_24, TIME_12_24_VALIDATOR);
3295 VALIDATORS.put(DATE_FORMAT, DATE_FORMAT_VALIDATOR);
3296 VALIDATORS.put(SETUP_WIZARD_HAS_RUN, SETUP_WIZARD_HAS_RUN_VALIDATOR);
3297 VALIDATORS.put(ACCELEROMETER_ROTATION, ACCELEROMETER_ROTATION_VALIDATOR);
3298 VALIDATORS.put(USER_ROTATION, USER_ROTATION_VALIDATOR);
3299 VALIDATORS.put(DTMF_TONE_WHEN_DIALING, DTMF_TONE_WHEN_DIALING_VALIDATOR);
3300 VALIDATORS.put(SOUND_EFFECTS_ENABLED, SOUND_EFFECTS_ENABLED_VALIDATOR);
3301 VALIDATORS.put(HAPTIC_FEEDBACK_ENABLED, HAPTIC_FEEDBACK_ENABLED_VALIDATOR);
3302 VALIDATORS.put(SHOW_WEB_SUGGESTIONS, SHOW_WEB_SUGGESTIONS_VALIDATOR);
3303 VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR);
3304 VALIDATORS.put(END_BUTTON_BEHAVIOR, END_BUTTON_BEHAVIOR_VALIDATOR);
3305 VALIDATORS.put(ADVANCED_SETTINGS, ADVANCED_SETTINGS_VALIDATOR);
3306 VALIDATORS.put(SCREEN_AUTO_BRIGHTNESS_ADJ, SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR);
3307 VALIDATORS.put(VIBRATE_INPUT_DEVICES, VIBRATE_INPUT_DEVICES_VALIDATOR);
Svetoslav683914b2015-01-15 14:22:26 -08003308 VALIDATORS.put(VOLUME_MASTER_MUTE, VOLUME_MASTER_MUTE_VALIDATOR);
3309 VALIDATORS.put(MICROPHONE_MUTE, MICROPHONE_MUTE_VALIDATOR);
3310 VALIDATORS.put(NOTIFICATIONS_USE_RING_VOLUME, NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR);
3311 VALIDATORS.put(VIBRATE_IN_SILENT, VIBRATE_IN_SILENT_VALIDATOR);
3312 VALIDATORS.put(MEDIA_BUTTON_RECEIVER, MEDIA_BUTTON_RECEIVER_VALIDATOR);
3313 VALIDATORS.put(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY,
3314 HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR);
3315 VALIDATORS.put(VIBRATE_WHEN_RINGING, VIBRATE_WHEN_RINGING_VALIDATOR);
3316 VALIDATORS.put(DTMF_TONE_TYPE_WHEN_DIALING, DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR);
3317 VALIDATORS.put(HEARING_AID, HEARING_AID_VALIDATOR);
3318 VALIDATORS.put(TTY_MODE, TTY_MODE_VALIDATOR);
3319 VALIDATORS.put(NOTIFICATION_LIGHT_PULSE, NOTIFICATION_LIGHT_PULSE_VALIDATOR);
3320 VALIDATORS.put(POINTER_LOCATION, POINTER_LOCATION_VALIDATOR);
3321 VALIDATORS.put(SHOW_TOUCHES, SHOW_TOUCHES_VALIDATOR);
3322 VALIDATORS.put(WINDOW_ORIENTATION_LISTENER_LOG,
3323 WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR);
3324 VALIDATORS.put(LOCKSCREEN_SOUNDS_ENABLED, LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR);
3325 VALIDATORS.put(LOCKSCREEN_DISABLED, LOCKSCREEN_DISABLED_VALIDATOR);
3326 VALIDATORS.put(SIP_RECEIVE_CALLS, SIP_RECEIVE_CALLS_VALIDATOR);
3327 VALIDATORS.put(SIP_CALL_OPTIONS, SIP_CALL_OPTIONS_VALIDATOR);
3328 VALIDATORS.put(SIP_ALWAYS, SIP_ALWAYS_VALIDATOR);
3329 VALIDATORS.put(SIP_ADDRESS_ONLY, SIP_ADDRESS_ONLY_VALIDATOR);
3330 VALIDATORS.put(SIP_ASK_ME_EACH_TIME, SIP_ASK_ME_EACH_TIME_VALIDATOR);
3331 VALIDATORS.put(POINTER_SPEED, POINTER_SPEED_VALIDATOR);
3332 VALIDATORS.put(LOCK_TO_APP_ENABLED, LOCK_TO_APP_ENABLED_VALIDATOR);
3333 VALIDATORS.put(EGG_MODE, EGG_MODE_VALIDATOR);
3334 VALIDATORS.put(WIFI_STATIC_IP, WIFI_STATIC_IP_VALIDATOR);
3335 VALIDATORS.put(WIFI_STATIC_GATEWAY, WIFI_STATIC_GATEWAY_VALIDATOR);
3336 VALIDATORS.put(WIFI_STATIC_NETMASK, WIFI_STATIC_NETMASK_VALIDATOR);
3337 VALIDATORS.put(WIFI_STATIC_DNS1, WIFI_STATIC_DNS1_VALIDATOR);
3338 VALIDATORS.put(WIFI_STATIC_DNS2, WIFI_STATIC_DNS2_VALIDATOR);
3339 }
3340
3341 /**
3342 * These entries are considered common between the personal and the managed profile,
3343 * since the managed profile doesn't get to change them.
3344 */
3345 private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>();
3346 static {
3347 CLONE_TO_MANAGED_PROFILE.add(DATE_FORMAT);
3348 CLONE_TO_MANAGED_PROFILE.add(HAPTIC_FEEDBACK_ENABLED);
3349 CLONE_TO_MANAGED_PROFILE.add(SOUND_EFFECTS_ENABLED);
3350 CLONE_TO_MANAGED_PROFILE.add(TEXT_SHOW_PASSWORD);
3351 CLONE_TO_MANAGED_PROFILE.add(TIME_12_24);
3352 }
3353
3354 /** @hide */
3355 public static void getCloneToManagedProfileSettings(Set<String> outKeySet) {
3356 outKeySet.addAll(CLONE_TO_MANAGED_PROFILE);
3357 }
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07003358
3359 /**
Sailesh Nepal1bd78762014-02-11 22:32:21 -08003360 * When to use Wi-Fi calling
3361 *
3362 * @see android.telephony.TelephonyManager.WifiCallingChoices
3363 * @hide
3364 */
3365 public static final String WHEN_TO_MAKE_WIFI_CALLS = "when_to_make_wifi_calls";
3366
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003367 // Settings moved to Settings.Secure
3368
3369 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003370 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003371 * instead
3372 */
3373 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003374 public static final String ADB_ENABLED = Global.ADB_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003375
3376 /**
3377 * @deprecated Use {@link android.provider.Settings.Secure#ANDROID_ID} instead
3378 */
3379 @Deprecated
3380 public static final String ANDROID_ID = Secure.ANDROID_ID;
3381
3382 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003383 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003384 */
3385 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003386 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003387
3388 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003389 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003390 */
3391 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003392 public static final String DATA_ROAMING = Global.DATA_ROAMING;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003393
3394 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003395 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003396 */
3397 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003398 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003399
3400 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07003401 * @deprecated Use {@link android.provider.Settings.Global#HTTP_PROXY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003402 */
3403 @Deprecated
Jeff Sharkey625239a2012-09-26 22:03:49 -07003404 public static final String HTTP_PROXY = Global.HTTP_PROXY;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003405
3406 /**
Christopher Tateaa036a22014-05-19 16:33:27 -07003407 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003408 */
3409 @Deprecated
Christopher Tateaa036a22014-05-19 16:33:27 -07003410 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003411
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003412 /**
3413 * @deprecated Use {@link android.provider.Settings.Secure#LOCATION_PROVIDERS_ALLOWED}
3414 * instead
3415 */
3416 @Deprecated
3417 public static final String LOCATION_PROVIDERS_ALLOWED = Secure.LOCATION_PROVIDERS_ALLOWED;
3418
3419 /**
3420 * @deprecated Use {@link android.provider.Settings.Secure#LOGGING_ID} instead
3421 */
3422 @Deprecated
3423 public static final String LOGGING_ID = Secure.LOGGING_ID;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003424
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003425 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003426 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003427 */
3428 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003429 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003430
3431 /**
3432 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_ENABLED}
3433 * instead
3434 */
3435 @Deprecated
3436 public static final String PARENTAL_CONTROL_ENABLED = Secure.PARENTAL_CONTROL_ENABLED;
3437
3438 /**
3439 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_LAST_UPDATE}
3440 * instead
3441 */
3442 @Deprecated
3443 public static final String PARENTAL_CONTROL_LAST_UPDATE = Secure.PARENTAL_CONTROL_LAST_UPDATE;
3444
3445 /**
3446 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_REDIRECT_URL}
3447 * instead
3448 */
3449 @Deprecated
3450 public static final String PARENTAL_CONTROL_REDIRECT_URL =
3451 Secure.PARENTAL_CONTROL_REDIRECT_URL;
3452
3453 /**
3454 * @deprecated Use {@link android.provider.Settings.Secure#SETTINGS_CLASSNAME} instead
3455 */
3456 @Deprecated
3457 public static final String SETTINGS_CLASSNAME = Secure.SETTINGS_CLASSNAME;
3458
3459 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003460 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003461 */
3462 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003463 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003464
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003465 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003466 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003467 */
3468 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003469 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003470
Dianne Hackborn4a51c202009-08-21 15:14:02 -07003471 /**
3472 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07003473 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
Dianne Hackborn4a51c202009-08-21 15:14:02 -07003474 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003475 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003476 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 -08003477
Dianne Hackborn4a51c202009-08-21 15:14:02 -07003478 /**
3479 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07003480 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
Dianne Hackborn4a51c202009-08-21 15:14:02 -07003481 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003482 @Deprecated
3483 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
Christopher Tate06efb532012-08-24 15:29:27 -07003484 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003485
3486 /**
3487 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07003488 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003489 */
3490 @Deprecated
3491 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
Christopher Tate06efb532012-08-24 15:29:27 -07003492 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003493
3494 /**
3495 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07003496 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003497 */
3498 @Deprecated
3499 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
Christopher Tate06efb532012-08-24 15:29:27 -07003500 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003501
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003502 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003503 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003504 * instead
3505 */
3506 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003507 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 -08003508
3509 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003510 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003511 */
3512 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003513 public static final String WIFI_ON = Global.WIFI_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003514
3515 /**
3516 * @deprecated Use
3517 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE}
3518 * instead
3519 */
3520 @Deprecated
3521 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
3522 Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE;
3523
3524 /**
3525 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_AP_COUNT} instead
3526 */
3527 @Deprecated
3528 public static final String WIFI_WATCHDOG_AP_COUNT = Secure.WIFI_WATCHDOG_AP_COUNT;
3529
3530 /**
3531 * @deprecated Use
3532 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS} instead
3533 */
3534 @Deprecated
3535 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
3536 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003537
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003538 /**
3539 * @deprecated Use
3540 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED} instead
3541 */
3542 @Deprecated
3543 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
3544 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED;
3545
3546 /**
3547 * @deprecated Use
3548 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS}
3549 * instead
3550 */
3551 @Deprecated
3552 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
3553 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS;
3554
3555 /**
3556 * @deprecated Use
3557 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT} instead
3558 */
3559 @Deprecated
3560 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
3561 Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT;
3562
3563 /**
3564 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_MAX_AP_CHECKS}
3565 * instead
3566 */
3567 @Deprecated
3568 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = Secure.WIFI_WATCHDOG_MAX_AP_CHECKS;
3569
3570 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003571 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003572 */
3573 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003574 public static final String WIFI_WATCHDOG_ON = Global.WIFI_WATCHDOG_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003575
3576 /**
3577 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_COUNT} instead
3578 */
3579 @Deprecated
3580 public static final String WIFI_WATCHDOG_PING_COUNT = Secure.WIFI_WATCHDOG_PING_COUNT;
3581
3582 /**
3583 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_DELAY_MS}
3584 * instead
3585 */
3586 @Deprecated
3587 public static final String WIFI_WATCHDOG_PING_DELAY_MS = Secure.WIFI_WATCHDOG_PING_DELAY_MS;
3588
3589 /**
3590 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_TIMEOUT_MS}
3591 * instead
3592 */
3593 @Deprecated
3594 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS =
3595 Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS;
3596 }
3597
3598 /**
3599 * Secure system settings, containing system preferences that applications
3600 * can read but are not allowed to write. These are for preferences that
3601 * the user must explicitly modify through the system UI or specialized
3602 * APIs for those values, not modified directly by applications.
3603 */
3604 public static final class Secure extends NameValueTable {
3605 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_secure_version";
3606
Dianne Hackborn139748f2012-09-24 11:36:57 -07003607 /**
3608 * The content:// style URL for this table
3609 */
3610 public static final Uri CONTENT_URI =
3611 Uri.parse("content://" + AUTHORITY + "/secure");
3612
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08003613 // Populated lazily, guarded by class object:
Dianne Hackborn139748f2012-09-24 11:36:57 -07003614 private static final NameValueCache sNameValueCache = new NameValueCache(
3615 SYS_PROP_SETTING_VERSION,
3616 CONTENT_URI,
3617 CALL_METHOD_GET_SECURE,
3618 CALL_METHOD_PUT_SECURE);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003619
Amith Yamasani52c489c2012-03-28 11:42:42 -07003620 private static ILockSettings sLockSettings = null;
3621
Amith Yamasani7ab8c4a2012-04-06 09:27:12 -07003622 private static boolean sIsSystemProcess;
Amith Yamasani52c489c2012-03-28 11:42:42 -07003623 private static final HashSet<String> MOVED_TO_LOCK_SETTINGS;
Christopher Tate06efb532012-08-24 15:29:27 -07003624 private static final HashSet<String> MOVED_TO_GLOBAL;
Amith Yamasani52c489c2012-03-28 11:42:42 -07003625 static {
3626 MOVED_TO_LOCK_SETTINGS = new HashSet<String>(3);
3627 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_ENABLED);
3628 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_VISIBLE);
3629 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
Christopher Tate06efb532012-08-24 15:29:27 -07003630
3631 MOVED_TO_GLOBAL = new HashSet<String>();
3632 MOVED_TO_GLOBAL.add(Settings.Global.ADB_ENABLED);
3633 MOVED_TO_GLOBAL.add(Settings.Global.ASSISTED_GPS_ENABLED);
3634 MOVED_TO_GLOBAL.add(Settings.Global.BLUETOOTH_ON);
Christopher Tate58f41ec2013-01-11 15:40:36 -08003635 MOVED_TO_GLOBAL.add(Settings.Global.BUGREPORT_IN_POWER_MENU);
Christopher Tate06efb532012-08-24 15:29:27 -07003636 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_CELL_BROADCAST_SMS);
3637 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_ROAMING_MODE);
3638 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_SUBSCRIPTION_MODE);
3639 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_MOBILE);
3640 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_WIFI);
3641 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ROAMING);
3642 MOVED_TO_GLOBAL.add(Settings.Global.DEVELOPMENT_SETTINGS_ENABLED);
3643 MOVED_TO_GLOBAL.add(Settings.Global.DEVICE_PROVISIONED);
3644 MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_DENSITY_FORCED);
3645 MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_SIZE_FORCED);
3646 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_MAX_BYTES_OVER_MOBILE);
3647 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE);
Christopher Tate06efb532012-08-24 15:29:27 -07003648 MOVED_TO_GLOBAL.add(Settings.Global.MOBILE_DATA);
3649 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_BUCKET_DURATION);
3650 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_DELETE_AGE);
3651 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_PERSIST_BYTES);
3652 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_ROTATE_AGE);
3653 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_ENABLED);
3654 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_GLOBAL_ALERT_BYTES);
3655 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_POLL_INTERVAL);
Christopher Tate06efb532012-08-24 15:29:27 -07003656 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_SAMPLE_ENABLED);
3657 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_TIME_CACHE_MAX_AGE);
3658 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_BUCKET_DURATION);
3659 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_DELETE_AGE);
3660 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_PERSIST_BYTES);
3661 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_ROTATE_AGE);
3662 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_BUCKET_DURATION);
3663 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_DELETE_AGE);
3664 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_PERSIST_BYTES);
3665 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_ROTATE_AGE);
3666 MOVED_TO_GLOBAL.add(Settings.Global.NETWORK_PREFERENCE);
3667 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_DIFF);
3668 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_SPACING);
3669 MOVED_TO_GLOBAL.add(Settings.Global.NTP_SERVER);
3670 MOVED_TO_GLOBAL.add(Settings.Global.NTP_TIMEOUT);
3671 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_ERROR_POLL_COUNT);
3672 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_LONG_POLL_INTERVAL_MS);
3673 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT);
3674 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_POLL_INTERVAL_MS);
3675 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_TRIGGER_PACKET_COUNT);
3676 MOVED_TO_GLOBAL.add(Settings.Global.SAMPLING_PROFILER_MS);
3677 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DATA_SERVICE_URL);
3678 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_REDIR_HOST);
3679 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_TARGET_URL);
3680 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_APN);
3681 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_REQUIRED);
3682 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_SUPPORTED);
Christopher Tate06efb532012-08-24 15:29:27 -07003683 MOVED_TO_GLOBAL.add(Settings.Global.USB_MASS_STORAGE_ENABLED);
3684 MOVED_TO_GLOBAL.add(Settings.Global.USE_GOOGLE_MAIL);
Robert Greenwalt3ea0c992013-10-03 21:13:49 +00003685 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_COUNTRY_CODE);
Christopher Tate06efb532012-08-24 15:29:27 -07003686 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FRAMEWORK_SCAN_INTERVAL_MS);
3687 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FREQUENCY_BAND);
3688 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_IDLE_MS);
3689 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MAX_DHCP_RETRY_COUNT);
3690 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS);
3691 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
3692 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
3693 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NUM_OPEN_NETWORKS_KEPT);
3694 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ON);
3695 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_P2P_DEVICE_NAME);
3696 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SAVED_STATE);
3697 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUPPLICANT_SCAN_INTERVAL_MS);
3698 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUSPEND_OPTIMIZATIONS_ENABLED);
vandwalle7c3606c2014-03-31 19:12:07 -07003699 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ENHANCED_AUTO_JOIN);
3700 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORK_SHOW_RSSI);
Christopher Tate06efb532012-08-24 15:29:27 -07003701 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_ON);
3702 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED);
Christopher Tate06efb532012-08-24 15:29:27 -07003703 MOVED_TO_GLOBAL.add(Settings.Global.WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON);
Christopher Tatec868b642012-09-12 17:41:04 -07003704 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_ENABLE);
3705 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_TIMEOUT);
3706 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_DEFAULT_RESPONSE);
3707 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS);
3708 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS);
3709 MOVED_TO_GLOBAL.add(Settings.Global.GPRS_REGISTER_CHECK_PERIOD_MS);
Christopher Tate06efb532012-08-24 15:29:27 -07003710 MOVED_TO_GLOBAL.add(Settings.Global.WTF_IS_FATAL);
Jeff Sharkey625239a2012-09-26 22:03:49 -07003711 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_DURATION_THRESHOLD);
3712 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_THRESHOLD);
3713 MOVED_TO_GLOBAL.add(Settings.Global.SEND_ACTION_APP_ERROR);
3714 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_AGE_SECONDS);
3715 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_MAX_FILES);
3716 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_KB);
3717 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_PERCENT);
3718 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_RESERVE_PERCENT);
3719 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_TAG_PREFIX);
3720 MOVED_TO_GLOBAL.add(Settings.Global.ERROR_LOGCAT_PREFIX);
3721 MOVED_TO_GLOBAL.add(Settings.Global.SYS_FREE_STORAGE_LOG_INTERVAL);
3722 MOVED_TO_GLOBAL.add(Settings.Global.DISK_FREE_CHANGE_REPORTING_THRESHOLD);
3723 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_PERCENTAGE);
3724 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_MAX_BYTES);
3725 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_FULL_THRESHOLD_BYTES);
3726 MOVED_TO_GLOBAL.add(Settings.Global.SYNC_MAX_RETRY_DELAY_IN_SECONDS);
3727 MOVED_TO_GLOBAL.add(Settings.Global.CONNECTIVITY_CHANGE_DELAY);
3728 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED);
3729 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_SERVER);
3730 MOVED_TO_GLOBAL.add(Settings.Global.NSD_ON);
3731 MOVED_TO_GLOBAL.add(Settings.Global.SET_INSTALL_LOCATION);
3732 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_INSTALL_LOCATION);
3733 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_UP_DELAY);
3734 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_DOWN_DELAY);
3735 MOVED_TO_GLOBAL.add(Settings.Global.READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT);
3736 MOVED_TO_GLOBAL.add(Settings.Global.HTTP_PROXY);
3737 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_HOST);
3738 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_PORT);
3739 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST);
3740 MOVED_TO_GLOBAL.add(Settings.Global.SET_GLOBAL_HTTP_PROXY);
3741 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_DNS_SERVER);
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003742 MOVED_TO_GLOBAL.add(Settings.Global.PREFERRED_NETWORK_MODE);
Hui Shu22671772014-10-01 21:41:07 +00003743 MOVED_TO_GLOBAL.add(Settings.Global.WEBVIEW_DATA_REDUCTION_PROXY_KEY);
Christopher Tate06efb532012-08-24 15:29:27 -07003744 }
3745
Christopher Tate66488d62012-10-02 11:58:01 -07003746 /** @hide */
Svetoslav683914b2015-01-15 14:22:26 -08003747 public static void getMovedToGlobalSettings(Set<String> outKeySet) {
Christopher Tate66488d62012-10-02 11:58:01 -07003748 outKeySet.addAll(MOVED_TO_GLOBAL);
3749 }
3750
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003751 /**
3752 * Look up a name in the database.
3753 * @param resolver to access the database with
3754 * @param name to look up in the table
3755 * @return the corresponding value, or null if not present
3756 */
Dianne Hackborn139748f2012-09-24 11:36:57 -07003757 public static String getString(ContentResolver resolver, String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07003758 return getStringForUser(resolver, name, UserHandle.myUserId());
3759 }
3760
3761 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -07003762 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -07003763 int userHandle) {
3764 if (MOVED_TO_GLOBAL.contains(name)) {
3765 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
3766 + " to android.provider.Settings.Global.");
3767 return Global.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003768 }
Amith Yamasani52c489c2012-03-28 11:42:42 -07003769
Dianne Hackborn139748f2012-09-24 11:36:57 -07003770 if (MOVED_TO_LOCK_SETTINGS.contains(name)) {
3771 synchronized (Secure.class) {
3772 if (sLockSettings == null) {
3773 sLockSettings = ILockSettings.Stub.asInterface(
3774 (IBinder) ServiceManager.getService("lock_settings"));
3775 sIsSystemProcess = Process.myUid() == Process.SYSTEM_UID;
3776 }
3777 }
3778 if (sLockSettings != null && !sIsSystemProcess) {
3779 try {
3780 return sLockSettings.getString(name, "0", userHandle);
3781 } catch (RemoteException re) {
3782 // Fall through
3783 }
Amith Yamasani52c489c2012-03-28 11:42:42 -07003784 }
3785 }
3786
Christopher Tate06efb532012-08-24 15:29:27 -07003787 return sNameValueCache.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003788 }
3789
3790 /**
3791 * Store a name/value pair into the database.
3792 * @param resolver to access the database with
3793 * @param name to store
3794 * @param value to associate with the name
3795 * @return true if the value was set, false on database errors
3796 */
Christopher Tate06efb532012-08-24 15:29:27 -07003797 public static boolean putString(ContentResolver resolver, String name, String value) {
3798 return putStringForUser(resolver, name, value, UserHandle.myUserId());
3799 }
3800
3801 /** @hide */
3802 public static boolean putStringForUser(ContentResolver resolver, String name, String value,
3803 int userHandle) {
Julia Reynolds82735bc2014-09-04 16:43:30 -04003804 if (LOCATION_MODE.equals(name)) {
3805 // HACK ALERT: temporary hack to work around b/10491283.
3806 // TODO: once b/10491283 fixed, remove this hack
3807 return setLocationModeForUser(resolver, Integer.parseInt(value), userHandle);
3808 }
Christopher Tate06efb532012-08-24 15:29:27 -07003809 if (MOVED_TO_GLOBAL.contains(name)) {
3810 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
3811 + " to android.provider.Settings.Global");
3812 return Global.putStringForUser(resolver, name, value, userHandle);
3813 }
Christopher Tate06efb532012-08-24 15:29:27 -07003814 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003815 }
3816
3817 /**
3818 * Construct the content URI for a particular name/value pair,
3819 * useful for monitoring changes with a ContentObserver.
3820 * @param name to look up in the table
3821 * @return the corresponding content URI, or null if not present
3822 */
3823 public static Uri getUriFor(String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07003824 if (MOVED_TO_GLOBAL.contains(name)) {
3825 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
3826 + " to android.provider.Settings.Global, returning global URI.");
3827 return Global.getUriFor(Global.CONTENT_URI, name);
3828 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003829 return getUriFor(CONTENT_URI, name);
3830 }
3831
3832 /**
3833 * Convenience function for retrieving a single secure settings value
3834 * as an integer. Note that internally setting values are always
3835 * stored as strings; this function converts the string to an integer
3836 * for you. The default value will be returned if the setting is
3837 * not defined or not an integer.
3838 *
3839 * @param cr The ContentResolver to access.
3840 * @param name The name of the setting to retrieve.
3841 * @param def Value to return if the setting is not defined.
3842 *
3843 * @return The setting's current value, or 'def' if it is not defined
3844 * or not a valid integer.
3845 */
3846 public static int getInt(ContentResolver cr, String name, int def) {
Christopher Tate06efb532012-08-24 15:29:27 -07003847 return getIntForUser(cr, name, def, UserHandle.myUserId());
3848 }
3849
3850 /** @hide */
3851 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
Tom O'Neill7f6f4572013-08-27 10:53:15 -07003852 if (LOCATION_MODE.equals(name)) {
3853 // HACK ALERT: temporary hack to work around b/10491283.
3854 // TODO: once b/10491283 fixed, remove this hack
3855 return getLocationModeForUser(cr, userHandle);
3856 }
Christopher Tate06efb532012-08-24 15:29:27 -07003857 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003858 try {
3859 return v != null ? Integer.parseInt(v) : def;
3860 } catch (NumberFormatException e) {
3861 return def;
3862 }
3863 }
3864
3865 /**
3866 * Convenience function for retrieving a single secure settings value
3867 * as an integer. Note that internally setting values are always
3868 * stored as strings; this function converts the string to an integer
3869 * for you.
3870 * <p>
3871 * This version does not take a default value. If the setting has not
3872 * been set, or the string value is not a number,
3873 * it throws {@link SettingNotFoundException}.
3874 *
3875 * @param cr The ContentResolver to access.
3876 * @param name The name of the setting to retrieve.
3877 *
3878 * @throws SettingNotFoundException Thrown if a setting by the given
3879 * name can't be found or the setting value is not an integer.
3880 *
3881 * @return The setting's current value.
3882 */
3883 public static int getInt(ContentResolver cr, String name)
3884 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07003885 return getIntForUser(cr, name, UserHandle.myUserId());
3886 }
3887
3888 /** @hide */
3889 public static int getIntForUser(ContentResolver cr, String name, int userHandle)
3890 throws SettingNotFoundException {
Tom O'Neill7f6f4572013-08-27 10:53:15 -07003891 if (LOCATION_MODE.equals(name)) {
3892 // HACK ALERT: temporary hack to work around b/10491283.
3893 // TODO: once b/10491283 fixed, remove this hack
3894 return getLocationModeForUser(cr, userHandle);
3895 }
Christopher Tate06efb532012-08-24 15:29:27 -07003896 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003897 try {
3898 return Integer.parseInt(v);
3899 } catch (NumberFormatException e) {
3900 throw new SettingNotFoundException(name);
3901 }
3902 }
3903
3904 /**
3905 * Convenience function for updating a single settings value as an
3906 * integer. This will either create a new entry in the table if the
3907 * given name does not exist, or modify the value of the existing row
3908 * with that name. Note that internally setting values are always
3909 * stored as strings, so this function converts the given value to a
3910 * string before storing it.
3911 *
3912 * @param cr The ContentResolver to access.
3913 * @param name The name of the setting to modify.
3914 * @param value The new value for the setting.
3915 * @return true if the value was set, false on database errors
3916 */
3917 public static boolean putInt(ContentResolver cr, String name, int value) {
Christopher Tate06efb532012-08-24 15:29:27 -07003918 return putIntForUser(cr, name, value, UserHandle.myUserId());
3919 }
3920
3921 /** @hide */
3922 public static boolean putIntForUser(ContentResolver cr, String name, int value,
3923 int userHandle) {
3924 return putStringForUser(cr, name, Integer.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003925 }
3926
3927 /**
3928 * Convenience function for retrieving a single secure settings value
3929 * as a {@code long}. Note that internally setting values are always
3930 * stored as strings; this function converts the string to a {@code long}
3931 * for you. The default value will be returned if the setting is
3932 * not defined or not a {@code long}.
3933 *
3934 * @param cr The ContentResolver to access.
3935 * @param name The name of the setting to retrieve.
3936 * @param def Value to return if the setting is not defined.
3937 *
3938 * @return The setting's current value, or 'def' if it is not defined
3939 * or not a valid {@code long}.
3940 */
3941 public static long getLong(ContentResolver cr, String name, long def) {
Christopher Tate06efb532012-08-24 15:29:27 -07003942 return getLongForUser(cr, name, def, UserHandle.myUserId());
3943 }
3944
3945 /** @hide */
3946 public static long getLongForUser(ContentResolver cr, String name, long def,
3947 int userHandle) {
3948 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003949 long value;
3950 try {
3951 value = valString != null ? Long.parseLong(valString) : def;
3952 } catch (NumberFormatException e) {
3953 value = def;
3954 }
3955 return value;
3956 }
3957
3958 /**
3959 * Convenience function for retrieving a single secure settings value
3960 * as a {@code long}. Note that internally setting values are always
3961 * stored as strings; this function converts the string to a {@code long}
3962 * for you.
3963 * <p>
3964 * This version does not take a default value. If the setting has not
3965 * been set, or the string value is not a number,
3966 * it throws {@link SettingNotFoundException}.
3967 *
3968 * @param cr The ContentResolver to access.
3969 * @param name The name of the setting to retrieve.
3970 *
3971 * @return The setting's current value.
3972 * @throws SettingNotFoundException Thrown if a setting by the given
3973 * name can't be found or the setting value is not an integer.
3974 */
3975 public static long getLong(ContentResolver cr, String name)
3976 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07003977 return getLongForUser(cr, name, UserHandle.myUserId());
3978 }
3979
3980 /** @hide */
3981 public static long getLongForUser(ContentResolver cr, String name, int userHandle)
3982 throws SettingNotFoundException {
3983 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003984 try {
3985 return Long.parseLong(valString);
3986 } catch (NumberFormatException e) {
3987 throw new SettingNotFoundException(name);
3988 }
3989 }
3990
3991 /**
3992 * Convenience function for updating a secure settings value as a long
3993 * integer. This will either create a new entry in the table if the
3994 * given name does not exist, or modify the value of the existing row
3995 * with that name. Note that internally setting values are always
3996 * stored as strings, so this function converts the given value to a
3997 * string before storing it.
3998 *
3999 * @param cr The ContentResolver to access.
4000 * @param name The name of the setting to modify.
4001 * @param value The new value for the setting.
4002 * @return true if the value was set, false on database errors
4003 */
4004 public static boolean putLong(ContentResolver cr, String name, long value) {
Christopher Tate06efb532012-08-24 15:29:27 -07004005 return putLongForUser(cr, name, value, UserHandle.myUserId());
4006 }
4007
4008 /** @hide */
4009 public static boolean putLongForUser(ContentResolver cr, String name, long value,
4010 int userHandle) {
4011 return putStringForUser(cr, name, Long.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004012 }
4013
4014 /**
4015 * Convenience function for retrieving a single secure settings value
4016 * as a floating point number. Note that internally setting values are
4017 * always stored as strings; this function converts the string to an
4018 * float for you. The default value will be returned if the setting
4019 * is not defined or not a valid float.
4020 *
4021 * @param cr The ContentResolver to access.
4022 * @param name The name of the setting to retrieve.
4023 * @param def Value to return if the setting is not defined.
4024 *
4025 * @return The setting's current value, or 'def' if it is not defined
4026 * or not a valid float.
4027 */
4028 public static float getFloat(ContentResolver cr, String name, float def) {
Christopher Tate06efb532012-08-24 15:29:27 -07004029 return getFloatForUser(cr, name, def, UserHandle.myUserId());
4030 }
4031
4032 /** @hide */
4033 public static float getFloatForUser(ContentResolver cr, String name, float def,
4034 int userHandle) {
4035 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004036 try {
4037 return v != null ? Float.parseFloat(v) : def;
4038 } catch (NumberFormatException e) {
4039 return def;
4040 }
4041 }
4042
4043 /**
4044 * Convenience function for retrieving a single secure settings value
4045 * as a float. Note that internally setting values are always
4046 * stored as strings; this function converts the string to a float
4047 * for you.
4048 * <p>
4049 * This version does not take a default value. If the setting has not
4050 * been set, or the string value is not a number,
4051 * it throws {@link SettingNotFoundException}.
4052 *
4053 * @param cr The ContentResolver to access.
4054 * @param name The name of the setting to retrieve.
4055 *
4056 * @throws SettingNotFoundException Thrown if a setting by the given
4057 * name can't be found or the setting value is not a float.
4058 *
4059 * @return The setting's current value.
4060 */
4061 public static float getFloat(ContentResolver cr, String name)
4062 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07004063 return getFloatForUser(cr, name, UserHandle.myUserId());
4064 }
4065
4066 /** @hide */
4067 public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
4068 throws SettingNotFoundException {
4069 String v = getStringForUser(cr, name, userHandle);
Brian Muramatsue1d46982010-12-06 17:34:20 -08004070 if (v == null) {
4071 throw new SettingNotFoundException(name);
4072 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004073 try {
4074 return Float.parseFloat(v);
4075 } catch (NumberFormatException e) {
4076 throw new SettingNotFoundException(name);
4077 }
4078 }
4079
4080 /**
4081 * Convenience function for updating a single settings value as a
4082 * floating point number. This will either create a new entry in the
4083 * table if the given name does not exist, or modify the value of the
4084 * existing row with that name. Note that internally setting values
4085 * are always stored as strings, so this function converts the given
4086 * value to a string before storing it.
4087 *
4088 * @param cr The ContentResolver to access.
4089 * @param name The name of the setting to modify.
4090 * @param value The new value for the setting.
4091 * @return true if the value was set, false on database errors
4092 */
4093 public static boolean putFloat(ContentResolver cr, String name, float value) {
Christopher Tate06efb532012-08-24 15:29:27 -07004094 return putFloatForUser(cr, name, value, UserHandle.myUserId());
4095 }
4096
4097 /** @hide */
4098 public static boolean putFloatForUser(ContentResolver cr, String name, float value,
4099 int userHandle) {
4100 return putStringForUser(cr, name, Float.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004101 }
4102
4103 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004104 * @deprecated Use {@link android.provider.Settings.Global#DEVELOPMENT_SETTINGS_ENABLED}
4105 * instead
Dianne Hackborn895f99e2012-02-02 11:49:12 -08004106 */
Christopher Tate06efb532012-08-24 15:29:27 -07004107 @Deprecated
4108 public static final String DEVELOPMENT_SETTINGS_ENABLED =
4109 Global.DEVELOPMENT_SETTINGS_ENABLED;
Dianne Hackborn895f99e2012-02-02 11:49:12 -08004110
4111 /**
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07004112 * When the user has enable the option to have a "bug report" command
4113 * in the power menu.
Christopher Tate58f41ec2013-01-11 15:40:36 -08004114 * @deprecated Use {@link android.provider.Settings.Global#BUGREPORT_IN_POWER_MENU} instead
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07004115 * @hide
4116 */
Christopher Tate58f41ec2013-01-11 15:40:36 -08004117 @Deprecated
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07004118 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
4119
4120 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004121 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004122 */
Christopher Tate06efb532012-08-24 15:29:27 -07004123 @Deprecated
4124 public static final String ADB_ENABLED = Global.ADB_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004125
4126 /**
4127 * Setting to allow mock locations and location provider status to be injected into the
4128 * LocationManager service for testing purposes during application development. These
4129 * locations and status values override actual location and status information generated
4130 * by network, gps, or other location providers.
4131 */
4132 public static final String ALLOW_MOCK_LOCATION = "mock_location";
4133
4134 /**
Doug Zongkerd8893db2010-01-26 12:29:44 -08004135 * A 64-bit number (as a hex string) that is randomly
Scott Main44895332013-11-12 09:23:13 -08004136 * generated when the user first sets up the device and should remain
4137 * constant for the lifetime of the user's device. The value may
4138 * change if a factory reset is performed on the device.
4139 * <p class="note"><strong>Note:</strong> When a device has <a
4140 * href="{@docRoot}about/versions/android-4.2.html#MultipleUsers">multiple users</a>
4141 * (available on certain devices running Android 4.2 or higher), each user appears as a
4142 * completely separate device, so the {@code ANDROID_ID} value is unique to each
4143 * user.</p>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004144 */
4145 public static final String ANDROID_ID = "android_id";
4146
4147 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004148 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004149 */
Christopher Tate06efb532012-08-24 15:29:27 -07004150 @Deprecated
4151 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004152
4153 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004154 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004155 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07004156 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07004157 public static final String DATA_ROAMING = Global.DATA_ROAMING;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004158
4159 /**
4160 * Setting to record the input method used by default, holding the ID
4161 * of the desired method.
4162 */
4163 public static final String DEFAULT_INPUT_METHOD = "default_input_method";
4164
4165 /**
satokab751aa2010-09-14 19:17:36 +09004166 * Setting to record the input method subtype used by default, holding the ID
4167 * of the desired method.
4168 */
4169 public static final String SELECTED_INPUT_METHOD_SUBTYPE =
4170 "selected_input_method_subtype";
4171
4172 /**
satok723a27e2010-11-11 14:58:11 +09004173 * Setting to record the history of input method subtype, holding the pair of ID of IME
4174 * and its last used subtype.
4175 * @hide
4176 */
4177 public static final String INPUT_METHODS_SUBTYPE_HISTORY =
4178 "input_methods_subtype_history";
4179
4180 /**
satok5c58dfc2010-12-14 21:54:47 +09004181 * Setting to record the visibility of input method selector
4182 */
4183 public static final String INPUT_METHOD_SELECTOR_VISIBILITY =
4184 "input_method_selector_visibility";
4185
4186 /**
Dianne Hackborn91097de2014-04-04 18:02:06 -07004187 * The currently selected voice interaction service flattened ComponentName.
4188 * @hide
4189 */
4190 public static final String VOICE_INTERACTION_SERVICE = "voice_interaction_service";
4191
4192 /**
Zhihai Xuaf5971e2013-06-10 20:28:31 -07004193 * bluetooth HCI snoop log configuration
4194 * @hide
4195 */
4196 public static final String BLUETOOTH_HCI_LOG =
4197 "bluetooth_hci_log";
4198
4199 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004200 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004201 */
Christopher Tate06efb532012-08-24 15:29:27 -07004202 @Deprecated
4203 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004204
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004205 /**
Russell Brennerde6ae442012-09-26 20:53:10 -07004206 * Whether the current user has been set up via setup wizard (0 = false, 1 = true)
4207 * @hide
4208 */
4209 public static final String USER_SETUP_COMPLETE = "user_setup_complete";
4210
4211 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004212 * List of input methods that are currently enabled. This is a string
4213 * containing the IDs of all enabled input methods, each ID separated
4214 * by ':'.
4215 */
4216 public static final String ENABLED_INPUT_METHODS = "enabled_input_methods";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004217
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004218 /**
Amith Yamasanie861ec12010-03-24 21:39:27 -07004219 * List of system input methods that are currently disabled. This is a string
4220 * containing the IDs of all disabled input methods, each ID separated
4221 * by ':'.
4222 * @hide
4223 */
4224 public static final String DISABLED_SYSTEM_INPUT_METHODS = "disabled_system_input_methods";
4225
4226 /**
Michael Wright7b5a96b2014-08-09 19:28:42 -07004227 * Whether to show the IME when a hard keyboard is connected. This is a boolean that
4228 * determines if the IME should be shown when a hard keyboard is attached.
4229 * @hide
4230 */
4231 public static final String SHOW_IME_WITH_HARD_KEYBOARD = "show_ime_with_hard_keyboard";
4232
4233 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07004234 * Host name and port for global http proxy. Uses ':' seperator for
4235 * between host and port.
4236 *
4237 * @deprecated Use {@link Global#HTTP_PROXY}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004238 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07004239 @Deprecated
4240 public static final String HTTP_PROXY = Global.HTTP_PROXY;
Robert Greenwalte90aa5e2010-09-01 11:34:05 -07004241
4242 /**
Christopher Tateaa036a22014-05-19 16:33:27 -07004243 * Whether applications can be installed for this user via the system's
4244 * {@link Intent#ACTION_INSTALL_PACKAGE} mechanism.
4245 *
4246 * <p>1 = permit app installation via the system package installer intent
4247 * <p>0 = do not allow use of the package installer
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004248 */
Christopher Tateaa036a22014-05-19 16:33:27 -07004249 public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004250
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004251 /**
Tom O'Neill923c0dc2014-03-03 11:07:55 -08004252 * Comma-separated list of location providers that activities may access. Do not rely on
4253 * this value being present in settings.db or on ContentObserver notifications on the
4254 * corresponding Uri.
Tom O'Neilla324ac72013-08-26 14:40:23 -07004255 *
Tom O'Neill923c0dc2014-03-03 11:07:55 -08004256 * @deprecated use {@link #LOCATION_MODE} and
4257 * {@link LocationManager#MODE_CHANGED_ACTION} (or
4258 * {@link LocationManager#PROVIDERS_CHANGED_ACTION})
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004259 */
Tom O'Neilla324ac72013-08-26 14:40:23 -07004260 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004261 public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004262
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004263 /**
Tom O'Neill7f6f4572013-08-27 10:53:15 -07004264 * The degree of location access enabled by the user.
Tom O'Neill923c0dc2014-03-03 11:07:55 -08004265 * <p>
Tom O'Neill7f6f4572013-08-27 10:53:15 -07004266 * When used with {@link #putInt(ContentResolver, String, int)}, must be one of {@link
4267 * #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY}, {@link
4268 * #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}. When used with {@link
4269 * #getInt(ContentResolver, String)}, the caller must gracefully handle additional location
4270 * modes that might be added in the future.
Tom O'Neill923c0dc2014-03-03 11:07:55 -08004271 * <p>
4272 * Note: do not rely on this value being present in settings.db or on ContentObserver
4273 * notifications for the corresponding Uri. Use {@link LocationManager#MODE_CHANGED_ACTION}
4274 * to receive changes in this value.
Tom O'Neilla324ac72013-08-26 14:40:23 -07004275 */
4276 public static final String LOCATION_MODE = "location_mode";
4277
4278 /**
Tom O'Neill7f6f4572013-08-27 10:53:15 -07004279 * Location access disabled.
Tom O'Neill1f48b782013-08-19 18:14:56 -07004280 */
4281 public static final int LOCATION_MODE_OFF = 0;
4282 /**
4283 * Network Location Provider disabled, but GPS and other sensors enabled.
4284 */
4285 public static final int LOCATION_MODE_SENSORS_ONLY = 1;
4286 /**
Tom O'Neilld5759432013-09-11 11:03:03 -07004287 * Reduced power usage, such as limiting the number of GPS updates per hour. Requests
4288 * with {@link android.location.Criteria#POWER_HIGH} may be downgraded to
4289 * {@link android.location.Criteria#POWER_MEDIUM}.
Tom O'Neill1f48b782013-08-19 18:14:56 -07004290 */
4291 public static final int LOCATION_MODE_BATTERY_SAVING = 2;
4292 /**
4293 * Best-effort location computation allowed.
4294 */
4295 public static final int LOCATION_MODE_HIGH_ACCURACY = 3;
4296
4297 /**
Danielle Millett925a7d82012-03-19 18:02:20 -04004298 * A flag containing settings used for biometric weak
4299 * @hide
4300 */
Adrian Roos230635e2015-01-07 20:50:29 +01004301 @Deprecated
Danielle Millett925a7d82012-03-19 18:02:20 -04004302 public static final String LOCK_BIOMETRIC_WEAK_FLAGS =
4303 "lock_biometric_weak_flags";
4304
4305 /**
Jason Monk94cfd9d2014-10-31 13:18:21 -04004306 * Whether lock-to-app will lock the keyguard when exiting.
4307 * @hide
4308 */
4309 public static final String LOCK_TO_APP_EXIT_LOCKED = "lock_to_app_exit_locked";
4310
4311 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08004312 * Whether autolock is enabled (0 = false, 1 = true)
Adrian Roos9dd16eb2015-01-08 16:20:49 +01004313 *
4314 * @deprecated Use {@link android.app.KeyguardManager} to determine the state and security
4315 * level of the keyguard.
Amith Yamasani156c4352010-03-05 17:10:03 -08004316 */
Adrian Roos9dd16eb2015-01-08 16:20:49 +01004317 @Deprecated
Amith Yamasani156c4352010-03-05 17:10:03 -08004318 public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock";
4319
4320 /**
4321 * Whether lock pattern is visible as user enters (0 = false, 1 = true)
4322 */
4323 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
4324
4325 /**
Jeff Sharkey5ed9d682012-10-10 14:28:27 -07004326 * Whether lock pattern will vibrate as user enters (0 = false, 1 =
4327 * true)
4328 *
4329 * @deprecated Starting in {@link VERSION_CODES#JELLY_BEAN_MR1} the
4330 * lockscreen uses
4331 * {@link Settings.System#HAPTIC_FEEDBACK_ENABLED}.
Amith Yamasani156c4352010-03-05 17:10:03 -08004332 */
Jeff Sharkey5ed9d682012-10-10 14:28:27 -07004333 @Deprecated
4334 public static final String
4335 LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = "lock_pattern_tactile_feedback_enabled";
Amith Yamasani156c4352010-03-05 17:10:03 -08004336
4337 /**
Jim Millerbc4603b2010-08-30 21:21:34 -07004338 * This preference allows the device to be locked given time after screen goes off,
4339 * subject to current DeviceAdmin policy limits.
4340 * @hide
4341 */
4342 public static final String LOCK_SCREEN_LOCK_AFTER_TIMEOUT = "lock_screen_lock_after_timeout";
4343
4344
4345 /**
John Spurlock5f050e52012-10-27 10:44:19 -04004346 * This preference contains the string that shows for owner info on LockScreen.
Jim Miller253a5ef2010-10-13 20:57:29 -07004347 * @hide
Jim Miller187ec582013-04-15 18:27:54 -07004348 * @deprecated
Jim Miller253a5ef2010-10-13 20:57:29 -07004349 */
4350 public static final String LOCK_SCREEN_OWNER_INFO = "lock_screen_owner_info";
4351
4352 /**
John Spurlock5f050e52012-10-27 10:44:19 -04004353 * Ids of the user-selected appwidgets on the lockscreen (comma-delimited).
Jim Millerf229e4d2012-09-12 20:32:50 -07004354 * @hide
4355 */
Adrian Roos230635e2015-01-07 20:50:29 +01004356 @Deprecated
Michael Jurkaaa2859a2012-10-24 12:46:49 -07004357 public static final String LOCK_SCREEN_APPWIDGET_IDS =
4358 "lock_screen_appwidget_ids";
Jim Millerf229e4d2012-09-12 20:32:50 -07004359
4360 /**
Jim Miller08fa40c2014-04-29 18:18:47 -07004361 * List of enrolled fingerprint identifiers (comma-delimited).
4362 * @hide
4363 */
4364 public static final String USER_FINGERPRINT_IDS = "user_fingerprint_ids";
4365
4366 /**
Jim Miller51117262012-11-04 17:58:09 -08004367 * Id of the appwidget shown on the lock screen when appwidgets are disabled.
4368 * @hide
4369 */
Adrian Roos230635e2015-01-07 20:50:29 +01004370 @Deprecated
Jim Miller51117262012-11-04 17:58:09 -08004371 public static final String LOCK_SCREEN_FALLBACK_APPWIDGET_ID =
4372 "lock_screen_fallback_appwidget_id";
4373
4374 /**
John Spurlock5f050e52012-10-27 10:44:19 -04004375 * Index of the lockscreen appwidget to restore, -1 if none.
4376 * @hide
4377 */
Adrian Roos230635e2015-01-07 20:50:29 +01004378 @Deprecated
John Spurlock5f050e52012-10-27 10:44:19 -04004379 public static final String LOCK_SCREEN_STICKY_APPWIDGET =
4380 "lock_screen_sticky_appwidget";
4381
4382 /**
4383 * This preference enables showing the owner info on LockScreen.
Jim Miller253a5ef2010-10-13 20:57:29 -07004384 * @hide
Jim Miller187ec582013-04-15 18:27:54 -07004385 * @deprecated
Jim Miller253a5ef2010-10-13 20:57:29 -07004386 */
4387 public static final String LOCK_SCREEN_OWNER_INFO_ENABLED =
4388 "lock_screen_owner_info_enabled";
4389
4390 /**
Dan Sandler5d7c3cc2014-02-18 17:35:15 -05004391 * When set by a user, allows notifications to be shown atop a securely locked screen
4392 * in their full "private" form (same as when the device is unlocked).
Dan Sandlerfd16d562014-02-13 18:43:31 -08004393 * @hide
4394 */
4395 public static final String LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS =
4396 "lock_screen_allow_private_notifications";
4397
4398 /**
Chris Wrencd8f4f72014-08-27 18:48:13 -04004399 * Set by the system to track if the user needs to see the call to action for
4400 * the lockscreen notification policy.
4401 * @hide
4402 */
4403 public static final String SHOW_NOTE_ABOUT_NOTIFICATION_HIDING =
4404 "show_note_about_notification_hiding";
4405
4406 /**
Adrian Roos3870d452014-09-05 18:22:28 +02004407 * Set to 1 by the system after trust agents have been initialized.
4408 * @hide
4409 */
4410 public static final String TRUST_AGENTS_INITIALIZED =
4411 "trust_agents_initialized";
4412
4413 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004414 * The Logging ID (a unique 64-bit value) as a hex string.
4415 * Used as a pseudonymous identifier for logging.
4416 * @deprecated This identifier is poorly initialized and has
4417 * many collisions. It should not be used.
4418 */
4419 @Deprecated
4420 public static final String LOGGING_ID = "logging_id";
4421
4422 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004423 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004424 */
Christopher Tate06efb532012-08-24 15:29:27 -07004425 @Deprecated
4426 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004427
4428 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08004429 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004430 */
4431 public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004432
4433 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08004434 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004435 */
4436 public static final String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004437
4438 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08004439 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004440 */
4441 public static final String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004442
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004443 /**
4444 * Settings classname to launch when Settings is clicked from All
4445 * Applications. Needed because of user testing between the old
4446 * and new Settings apps.
4447 */
4448 // TODO: 881807
4449 public static final String SETTINGS_CLASSNAME = "settings_classname";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004450
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004451 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004452 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004453 */
Christopher Tate06efb532012-08-24 15:29:27 -07004454 @Deprecated
4455 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004456
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004457 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004458 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004459 */
Christopher Tate06efb532012-08-24 15:29:27 -07004460 @Deprecated
4461 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004462
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004463 /**
svetoslavganov75986cf2009-05-14 22:28:01 -07004464 * If accessibility is enabled.
4465 */
4466 public static final String ACCESSIBILITY_ENABLED = "accessibility_enabled";
4467
4468 /**
Svetoslav Ganov00aabf72011-07-21 11:35:03 -07004469 * If touch exploration is enabled.
Svetoslav Ganov35bfede2011-07-14 17:57:06 -07004470 */
Svetoslav Ganov00aabf72011-07-21 11:35:03 -07004471 public static final String TOUCH_EXPLORATION_ENABLED = "touch_exploration_enabled";
Svetoslav Ganov35bfede2011-07-14 17:57:06 -07004472
4473 /**
svetoslavganov75986cf2009-05-14 22:28:01 -07004474 * List of the enabled accessibility providers.
4475 */
4476 public static final String ENABLED_ACCESSIBILITY_SERVICES =
4477 "enabled_accessibility_services";
4478
4479 /**
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07004480 * List of the accessibility services to which the user has granted
Svetoslav Ganov9a4c5cd2012-05-30 14:06:32 -07004481 * permission to put the device into touch exploration mode.
4482 *
4483 * @hide
4484 */
4485 public static final String TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES =
4486 "touch_exploration_granted_accessibility_services";
4487
4488 /**
Svetoslav Ganov55f937a2011-12-05 11:42:07 -08004489 * Whether to speak passwords while in accessibility mode.
4490 */
4491 public static final String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password";
4492
4493 /**
Chris Craikcce47eb2014-07-16 15:12:15 -07004494 * Whether to draw text with high contrast while in accessibility mode.
4495 *
4496 * @hide
4497 */
4498 public static final String ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED =
4499 "high_text_contrast_enabled";
4500
4501 /**
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08004502 * If injection of accessibility enhancing JavaScript screen-reader
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07004503 * is enabled.
4504 * <p>
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08004505 * Note: The JavaScript based screen-reader is served by the
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07004506 * Google infrastructure and enable users with disabilities to
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07004507 * efficiently navigate in and explore web content.
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07004508 * </p>
4509 * <p>
4510 * This property represents a boolean value.
4511 * </p>
4512 * @hide
4513 */
4514 public static final String ACCESSIBILITY_SCRIPT_INJECTION =
4515 "accessibility_script_injection";
4516
4517 /**
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08004518 * The URL for the injected JavaScript based screen-reader used
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07004519 * for providing accessibility of content in WebView.
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08004520 * <p>
4521 * Note: The JavaScript based screen-reader is served by the
4522 * Google infrastructure and enable users with disabilities to
4523 * efficiently navigate in and explore web content.
4524 * </p>
4525 * <p>
4526 * This property represents a string value.
4527 * </p>
4528 * @hide
4529 */
4530 public static final String ACCESSIBILITY_SCREEN_READER_URL =
4531 "accessibility_script_injection_url";
4532
4533 /**
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07004534 * Key bindings for navigation in built-in accessibility support for web content.
4535 * <p>
4536 * Note: These key bindings are for the built-in accessibility navigation for
4537 * web content which is used as a fall back solution if JavaScript in a WebView
4538 * is not enabled or the user has not opted-in script injection from Google.
4539 * </p>
4540 * <p>
4541 * The bindings are separated by semi-colon. A binding is a mapping from
4542 * a key to a sequence of actions (for more details look at
4543 * android.webkit.AccessibilityInjector). A key is represented as the hexademical
4544 * string representation of an integer obtained from a meta state (optional) shifted
4545 * sixteen times left and bitwise ored with a key code. An action is represented
4546 * as a hexademical string representation of an integer where the first two digits
4547 * are navigation action index, the second, the third, and the fourth digit pairs
4548 * represent the action arguments. The separate actions in a binding are colon
4549 * separated. The key and the action sequence it maps to are separated by equals.
4550 * </p>
4551 * <p>
4552 * For example, the binding below maps the DPAD right button to traverse the
4553 * current navigation axis once without firing an accessibility event and to
4554 * perform the same traversal again but to fire an event:
4555 * <code>
4556 * 0x16=0x01000100:0x01000101;
4557 * </code>
4558 * </p>
4559 * <p>
4560 * The goal of this binding is to enable dynamic rebinding of keys to
4561 * navigation actions for web content without requiring a framework change.
4562 * </p>
4563 * <p>
4564 * This property represents a string value.
4565 * </p>
4566 * @hide
4567 */
4568 public static final String ACCESSIBILITY_WEB_CONTENT_KEY_BINDINGS =
4569 "accessibility_web_content_key_bindings";
4570
4571 /**
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07004572 * Setting that specifies whether the display magnification is enabled.
4573 * Display magnifications allows the user to zoom in the display content
4574 * and is targeted to low vision users. The current magnification scale
4575 * is controlled by {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}.
4576 *
4577 * @hide
4578 */
4579 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED =
4580 "accessibility_display_magnification_enabled";
4581
4582 /**
4583 * Setting that specifies what the display magnification scale is.
4584 * Display magnifications allows the user to zoom in the display
4585 * content and is targeted to low vision users. Whether a display
4586 * magnification is performed is controlled by
4587 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED}
4588 *
4589 * @hide
4590 */
4591 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE =
4592 "accessibility_display_magnification_scale";
4593
4594 /**
4595 * Setting that specifies whether the display magnification should be
4596 * automatically updated. If this fearture is enabled the system will
4597 * exit magnification mode or pan the viewport when a context change
4598 * occurs. For example, on staring a new activity or rotating the screen,
4599 * the system may zoom out so the user can see the new context he is in.
4600 * Another example is on showing a window that is not visible in the
4601 * magnified viewport the system may pan the viewport to make the window
4602 * the has popped up so the user knows that the context has changed.
4603 * Whether a screen magnification is performed is controlled by
4604 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED}
4605 *
4606 * @hide
4607 */
4608 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE =
4609 "accessibility_display_magnification_auto_update";
4610
4611 /**
Alan Viveretteef793802013-07-23 14:15:28 -07004612 * Setting that specifies whether timed text (captions) should be
4613 * displayed in video content. Text display properties are controlled by
4614 * the following settings:
4615 * <ul>
4616 * <li>{@link #ACCESSIBILITY_CAPTIONING_LOCALE}
4617 * <li>{@link #ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR}
4618 * <li>{@link #ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR}
4619 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_COLOR}
4620 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_TYPE}
4621 * <li>{@link #ACCESSIBILITY_CAPTIONING_TYPEFACE}
Alan Viverette69ce69b2013-08-29 12:23:48 -07004622 * <li>{@link #ACCESSIBILITY_CAPTIONING_FONT_SCALE}
Alan Viveretteef793802013-07-23 14:15:28 -07004623 * </ul>
4624 *
4625 * @hide
4626 */
4627 public static final String ACCESSIBILITY_CAPTIONING_ENABLED =
4628 "accessibility_captioning_enabled";
4629
4630 /**
4631 * Setting that specifies the language for captions as a locale string,
4632 * e.g. en_US.
4633 *
4634 * @see java.util.Locale#toString
4635 * @hide
4636 */
4637 public static final String ACCESSIBILITY_CAPTIONING_LOCALE =
4638 "accessibility_captioning_locale";
4639
4640 /**
Alan Viverette43a1e3d2013-08-02 16:45:03 -07004641 * Integer property that specifies the preset style for captions, one
4642 * of:
4643 * <ul>
Alan Viverette69ce69b2013-08-29 12:23:48 -07004644 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESET_CUSTOM}
4645 * <li>a valid index of {@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESETS}
Alan Viverette43a1e3d2013-08-02 16:45:03 -07004646 * </ul>
4647 *
4648 * @see java.util.Locale#toString
4649 * @hide
4650 */
4651 public static final String ACCESSIBILITY_CAPTIONING_PRESET =
4652 "accessibility_captioning_preset";
4653
4654 /**
Alan Viveretteef793802013-07-23 14:15:28 -07004655 * Integer property that specifes the background color for captions as a
4656 * packed 32-bit color.
4657 *
4658 * @see android.graphics.Color#argb
4659 * @hide
4660 */
4661 public static final String ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR =
4662 "accessibility_captioning_background_color";
4663
4664 /**
4665 * Integer property that specifes the foreground color for captions as a
4666 * packed 32-bit color.
4667 *
4668 * @see android.graphics.Color#argb
4669 * @hide
4670 */
4671 public static final String ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR =
4672 "accessibility_captioning_foreground_color";
4673
4674 /**
4675 * Integer property that specifes the edge type for captions, one of:
4676 * <ul>
Alan Viverette69ce69b2013-08-29 12:23:48 -07004677 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_NONE}
4678 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_OUTLINE}
4679 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_DROP_SHADOW}
Alan Viveretteef793802013-07-23 14:15:28 -07004680 * </ul>
4681 *
4682 * @see #ACCESSIBILITY_CAPTIONING_EDGE_COLOR
4683 * @hide
4684 */
4685 public static final String ACCESSIBILITY_CAPTIONING_EDGE_TYPE =
4686 "accessibility_captioning_edge_type";
4687
4688 /**
4689 * Integer property that specifes the edge color for captions as a
4690 * packed 32-bit color.
4691 *
4692 * @see #ACCESSIBILITY_CAPTIONING_EDGE_TYPE
4693 * @see android.graphics.Color#argb
4694 * @hide
4695 */
4696 public static final String ACCESSIBILITY_CAPTIONING_EDGE_COLOR =
4697 "accessibility_captioning_edge_color";
4698
4699 /**
Alan Viverette55d70622013-12-11 15:22:14 -08004700 * Integer property that specifes the window color for captions as a
4701 * packed 32-bit color.
4702 *
4703 * @see android.graphics.Color#argb
4704 * @hide
4705 */
4706 public static final String ACCESSIBILITY_CAPTIONING_WINDOW_COLOR =
4707 "accessibility_captioning_window_color";
4708
4709 /**
Alan Viveretteef793802013-07-23 14:15:28 -07004710 * String property that specifies the typeface for captions, one of:
4711 * <ul>
4712 * <li>DEFAULT
4713 * <li>MONOSPACE
4714 * <li>SANS_SERIF
4715 * <li>SERIF
4716 * </ul>
4717 *
4718 * @see android.graphics.Typeface
4719 * @hide
4720 */
4721 public static final String ACCESSIBILITY_CAPTIONING_TYPEFACE =
4722 "accessibility_captioning_typeface";
4723
4724 /**
Alan Viverette69ce69b2013-08-29 12:23:48 -07004725 * Floating point property that specifies font scaling for captions.
Alan Viveretteef793802013-07-23 14:15:28 -07004726 *
4727 * @hide
4728 */
Alan Viverette69ce69b2013-08-29 12:23:48 -07004729 public static final String ACCESSIBILITY_CAPTIONING_FONT_SCALE =
4730 "accessibility_captioning_font_scale";
Alan Viveretteef793802013-07-23 14:15:28 -07004731
4732 /**
Alan Viverette410d4e32013-09-30 15:37:38 -07004733 * Setting that specifies whether display color inversion is enabled.
Alan Viverette410d4e32013-09-30 15:37:38 -07004734 */
4735 public static final String ACCESSIBILITY_DISPLAY_INVERSION_ENABLED =
4736 "accessibility_display_inversion_enabled";
4737
4738 /**
Alan Viverette410d4e32013-09-30 15:37:38 -07004739 * Setting that specifies whether display color space adjustment is
4740 * enabled.
4741 *
4742 * @hide
4743 */
4744 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED =
4745 "accessibility_display_daltonizer_enabled";
4746
4747 /**
4748 * Integer property that specifies the type of color space adjustment to
4749 * perform. Valid values are defined in AccessibilityManager.
4750 *
4751 * @hide
4752 */
4753 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER =
4754 "accessibility_display_daltonizer";
4755
4756 /**
Svetoslav Ganov54d068e2011-03-02 12:58:40 -08004757 * The timout for considering a press to be a long press in milliseconds.
4758 * @hide
4759 */
4760 public static final String LONG_PRESS_TIMEOUT = "long_press_timeout";
4761
4762 /**
Svetoslav Ganov6bd20bc2013-09-02 15:24:45 -07004763 * List of the enabled print services.
Svetoslav Ganov4b9a4d12013-06-11 15:20:06 -07004764 * @hide
4765 */
4766 public static final String ENABLED_PRINT_SERVICES =
4767 "enabled_print_services";
4768
4769 /**
Svetoslav Ganov6bd20bc2013-09-02 15:24:45 -07004770 * List of the system print services we enabled on first boot. On
4771 * first boot we enable all system, i.e. bundled print services,
4772 * once, so they work out-of-the-box.
4773 * @hide
4774 */
4775 public static final String ENABLED_ON_FIRST_BOOT_SYSTEM_PRINT_SERVICES =
4776 "enabled_on_first_boot_system_print_services";
4777
4778 /**
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07004779 * Setting to always use the default text-to-speech settings regardless
4780 * of the application settings.
4781 * 1 = override application settings,
4782 * 0 = use application settings (if specified).
Narayan Kamath6d632962011-08-24 11:51:37 +01004783 *
4784 * @deprecated The value of this setting is no longer respected by
4785 * the framework text to speech APIs as of the Ice Cream Sandwich release.
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07004786 */
Narayan Kamath6d632962011-08-24 11:51:37 +01004787 @Deprecated
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07004788 public static final String TTS_USE_DEFAULTS = "tts_use_defaults";
4789
4790 /**
4791 * Default text-to-speech engine speech rate. 100 = 1x
4792 */
4793 public static final String TTS_DEFAULT_RATE = "tts_default_rate";
4794
4795 /**
4796 * Default text-to-speech engine pitch. 100 = 1x
4797 */
4798 public static final String TTS_DEFAULT_PITCH = "tts_default_pitch";
4799
4800 /**
4801 * Default text-to-speech engine.
4802 */
4803 public static final String TTS_DEFAULT_SYNTH = "tts_default_synth";
4804
4805 /**
Jean-Michel Trivif4782672009-06-09 16:22:48 -07004806 * Default text-to-speech language.
Narayan Kamath6d632962011-08-24 11:51:37 +01004807 *
4808 * @deprecated this setting is no longer in use, as of the Ice Cream
4809 * Sandwich release. Apps should never need to read this setting directly,
4810 * instead can query the TextToSpeech framework classes for the default
4811 * locale. {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivif4782672009-06-09 16:22:48 -07004812 */
Narayan Kamath6d632962011-08-24 11:51:37 +01004813 @Deprecated
Jean-Michel Trivif4782672009-06-09 16:22:48 -07004814 public static final String TTS_DEFAULT_LANG = "tts_default_lang";
4815
4816 /**
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07004817 * Default text-to-speech country.
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 Trivia6fcc952009-06-19 14:06:01 -07004823 */
Narayan Kamath6d632962011-08-24 11:51:37 +01004824 @Deprecated
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07004825 public static final String TTS_DEFAULT_COUNTRY = "tts_default_country";
4826
4827 /**
4828 * Default text-to-speech locale variant.
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
4833 * locale that is in use {@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_VARIANT = "tts_default_variant";
4837
4838 /**
Narayan Kamathe5b8c4d2011-08-22 15:37:47 +01004839 * Stores the default tts locales on a per engine basis. Stored as
4840 * a comma seperated list of values, each value being of the form
4841 * {@code engine_name:locale} for example,
Narayan Kamath6d632962011-08-24 11:51:37 +01004842 * {@code com.foo.ttsengine:eng-USA,com.bar.ttsengine:esp-ESP}. This
4843 * supersedes {@link #TTS_DEFAULT_LANG}, {@link #TTS_DEFAULT_COUNTRY} and
4844 * {@link #TTS_DEFAULT_VARIANT}. Apps should never need to read this
4845 * setting directly, and can query the TextToSpeech framework classes
4846 * for the locale that is in use.
Narayan Kamathe5b8c4d2011-08-22 15:37:47 +01004847 *
4848 * @hide
4849 */
4850 public static final String TTS_DEFAULT_LOCALE = "tts_default_locale";
4851
4852 /**
Charles Chenceffa152010-03-16 21:18:10 -07004853 * Space delimited list of plugin packages that are enabled.
4854 */
4855 public static final String TTS_ENABLED_PLUGINS = "tts_enabled_plugins";
4856
4857 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004858 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON}
4859 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004860 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004861 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004862 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004863 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004864
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004865 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004866 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY}
4867 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004868 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004869 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004870 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004871 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004872
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004873 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004874 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
4875 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004876 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004877 @Deprecated
4878 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT =
4879 Global.WIFI_NUM_OPEN_NETWORKS_KEPT;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004880
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004881 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004882 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON}
4883 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004884 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004885 @Deprecated
4886 public static final String WIFI_ON = Global.WIFI_ON;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004887
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004888 /**
4889 * The acceptable packet loss percentage (range 0 - 100) before trying
4890 * another AP on the same network.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004891 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004892 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004893 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004894 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
4895 "wifi_watchdog_acceptable_packet_loss_percentage";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004896
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004897 /**
4898 * The number of access points required for a network in order for the
4899 * watchdog to monitor it.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004900 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004901 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004902 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004903 public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004904
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004905 /**
4906 * The delay between background checks.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004907 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004908 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004909 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004910 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
4911 "wifi_watchdog_background_check_delay_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004912
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004913 /**
4914 * Whether the Wi-Fi watchdog is enabled for background checking even
4915 * after it thinks the user has connected to a good access point.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004916 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004917 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004918 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004919 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
4920 "wifi_watchdog_background_check_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004921
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004922 /**
4923 * The timeout for a background ping
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004924 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004925 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004926 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004927 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
4928 "wifi_watchdog_background_check_timeout_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004929
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004930 /**
4931 * The number of initial pings to perform that *may* be ignored if they
4932 * fail. Again, if these fail, they will *not* be used in packet loss
4933 * calculation. For example, one network always seemed to time out for
4934 * the first couple pings, so this is set to 3 by default.
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_INITIAL_IGNORED_PING_COUNT =
4939 "wifi_watchdog_initial_ignored_ping_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004940
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004941 /**
4942 * The maximum number of access points (per network) to attempt to test.
4943 * If this number is reached, the watchdog will no longer monitor the
4944 * initial connection state for the network. This is a safeguard for
4945 * networks containing multiple APs whose DNS does not respond to pings.
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_MAX_AP_CHECKS = "wifi_watchdog_max_ap_checks";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004950
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004951 /**
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07004952 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004953 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07004954 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004955 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
4956
4957 /**
4958 * A comma-separated list of SSIDs for which the Wi-Fi watchdog should be enabled.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004959 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004960 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004961 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004962 public static final String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list";
4963
4964 /**
4965 * The number of pings to test if an access point is a good connection.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004966 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004967 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004968 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004969 public static final String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004970
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004971 /**
4972 * The delay between pings.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004973 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004974 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004975 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004976 public static final String WIFI_WATCHDOG_PING_DELAY_MS = "wifi_watchdog_ping_delay_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004977
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004978 /**
4979 * The timeout per ping.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004980 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004981 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004982 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004983 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004984
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004985 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004986 * @deprecated Use
4987 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004988 */
Christopher Tate06efb532012-08-24 15:29:27 -07004989 @Deprecated
4990 public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004991
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004992 /**
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004993 * @deprecated Use
4994 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004995 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07004996 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004997 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004998 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004999
5000 /**
Jeremy Joslin79294842014-12-03 17:15:28 -08005001 * The number of milliseconds to hold on to a PendingIntent based request. This delay gives
5002 * the receivers of the PendingIntent an opportunity to make a new network request before
5003 * the Network satisfying the request is potentially removed.
5004 *
5005 * @hide
5006 */
5007 public static final String CONNECTIVITY_RELEASE_PENDING_INTENT_DELAY_MS =
5008 "connectivity_release_pending_intent_delay_ms";
5009
5010 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07005011 * Whether background data usage is allowed.
5012 *
5013 * @deprecated As of {@link VERSION_CODES#ICE_CREAM_SANDWICH},
5014 * availability of background data depends on several
5015 * combined factors. When background data is unavailable,
5016 * {@link ConnectivityManager#getActiveNetworkInfo()} will
5017 * now appear disconnected.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005018 */
Jeff Sharkey3a844fc2011-08-16 14:37:57 -07005019 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005020 public static final String BACKGROUND_DATA = "background_data";
Wink Saville04e71b32009-04-02 11:00:54 -07005021
5022 /**
Bjorn Bringert98bfa392010-03-24 10:59:48 +00005023 * Origins for which browsers should allow geolocation by default.
5024 * The value is a space-separated list of origins.
5025 */
5026 public static final String ALLOWED_GEOLOCATION_ORIGINS
5027 = "allowed_geolocation_origins";
5028
5029 /**
Wink Savillee9b06d72009-05-18 21:47:50 -07005030 * The preferred TTY mode 0 = TTy Off, CDMA default
5031 * 1 = TTY Full
5032 * 2 = TTY HCO
5033 * 3 = TTY VCO
5034 * @hide
5035 */
5036 public static final String PREFERRED_TTY_MODE =
5037 "preferred_tty_mode";
5038
Wink Saville04e71b32009-04-02 11:00:54 -07005039 /**
Wink Saville04e71b32009-04-02 11:00:54 -07005040 * Whether the enhanced voice privacy mode is enabled.
5041 * 0 = normal voice privacy
5042 * 1 = enhanced voice privacy
5043 * @hide
5044 */
5045 public static final String ENHANCED_VOICE_PRIVACY_ENABLED = "enhanced_voice_privacy_enabled";
5046
5047 /**
5048 * Whether the TTY mode mode is enabled.
5049 * 0 = disabled
5050 * 1 = enabled
5051 * @hide
5052 */
5053 public static final String TTY_MODE_ENABLED = "tty_mode_enabled";
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005054
5055 /**
Christopher Tate8031a3d2009-07-06 16:36:05 -07005056 * Controls whether settings backup is enabled.
Dianne Hackborncf098292009-07-01 19:55:20 -07005057 * Type: int ( 0 = disabled, 1 = enabled )
5058 * @hide
5059 */
5060 public static final String BACKUP_ENABLED = "backup_enabled";
5061
5062 /**
Christopher Tatecce9da52010-02-03 15:11:15 -08005063 * Controls whether application data is automatically restored from backup
5064 * at install time.
5065 * Type: int ( 0 = disabled, 1 = enabled )
5066 * @hide
5067 */
5068 public static final String BACKUP_AUTO_RESTORE = "backup_auto_restore";
5069
5070 /**
Christopher Tate8031a3d2009-07-06 16:36:05 -07005071 * Indicates whether settings backup has been fully provisioned.
5072 * Type: int ( 0 = unprovisioned, 1 = fully provisioned )
5073 * @hide
5074 */
5075 public static final String BACKUP_PROVISIONED = "backup_provisioned";
5076
5077 /**
Dianne Hackborncf098292009-07-01 19:55:20 -07005078 * Component of the transport to use for backup/restore.
5079 * @hide
5080 */
5081 public static final String BACKUP_TRANSPORT = "backup_transport";
Sanjay Jeyakumar21bf2412009-07-09 13:31:48 -07005082
Dianne Hackbornd7cd29d2009-07-01 11:22:45 -07005083 /**
5084 * Version for which the setup wizard was last shown. Bumped for
5085 * each release when there is new setup information to show.
5086 * @hide
5087 */
5088 public static final String LAST_SETUP_SHOWN = "last_setup_shown";
Dianne Hackborncf098292009-07-01 19:55:20 -07005089
5090 /**
Doug Zongker43866e02010-01-07 12:09:54 -08005091 * The interval in milliseconds after which Wi-Fi is considered idle.
5092 * When idle, it is possible for the device to be switched from Wi-Fi to
5093 * the mobile data network.
5094 * @hide
Jeff Brownbf6f6f92012-09-25 15:03:20 -07005095 * @deprecated Use {@link android.provider.Settings.Global#WIFI_IDLE_MS}
5096 * instead.
Doug Zongker43866e02010-01-07 12:09:54 -08005097 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07005098 @Deprecated
5099 public static final String WIFI_IDLE_MS = Global.WIFI_IDLE_MS;
Doug Zongker43866e02010-01-07 12:09:54 -08005100
5101 /**
Narayan Kamathee69ff42011-06-28 12:07:18 +01005102 * The global search provider chosen by the user (if multiple global
5103 * search providers are installed). This will be the provider returned
5104 * by {@link SearchManager#getGlobalSearchActivity()} if it's still
5105 * installed. This setting is stored as a flattened component name as
5106 * per {@link ComponentName#flattenToString()}.
5107 *
5108 * @hide
5109 */
5110 public static final String SEARCH_GLOBAL_SEARCH_ACTIVITY =
5111 "search_global_search_activity";
5112
5113 /**
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08005114 * The number of promoted sources in GlobalSearch.
5115 * @hide
5116 */
5117 public static final String SEARCH_NUM_PROMOTED_SOURCES = "search_num_promoted_sources";
5118 /**
5119 * The maximum number of suggestions returned by GlobalSearch.
5120 * @hide
5121 */
5122 public static final String SEARCH_MAX_RESULTS_TO_DISPLAY = "search_max_results_to_display";
5123 /**
5124 * The number of suggestions GlobalSearch will ask each non-web search source for.
5125 * @hide
5126 */
5127 public static final String SEARCH_MAX_RESULTS_PER_SOURCE = "search_max_results_per_source";
5128 /**
5129 * The number of suggestions the GlobalSearch will ask the web search source for.
5130 * @hide
5131 */
5132 public static final String SEARCH_WEB_RESULTS_OVERRIDE_LIMIT =
5133 "search_web_results_override_limit";
5134 /**
5135 * The number of milliseconds that GlobalSearch will wait for suggestions from
5136 * promoted sources before continuing with all other sources.
5137 * @hide
5138 */
5139 public static final String SEARCH_PROMOTED_SOURCE_DEADLINE_MILLIS =
5140 "search_promoted_source_deadline_millis";
5141 /**
5142 * The number of milliseconds before GlobalSearch aborts search suggesiton queries.
5143 * @hide
5144 */
5145 public static final String SEARCH_SOURCE_TIMEOUT_MILLIS = "search_source_timeout_millis";
5146 /**
5147 * The maximum number of milliseconds that GlobalSearch shows the previous results
5148 * after receiving a new query.
5149 * @hide
5150 */
5151 public static final String SEARCH_PREFILL_MILLIS = "search_prefill_millis";
5152 /**
5153 * The maximum age of log data used for shortcuts in GlobalSearch.
5154 * @hide
5155 */
5156 public static final String SEARCH_MAX_STAT_AGE_MILLIS = "search_max_stat_age_millis";
5157 /**
5158 * The maximum age of log data used for source ranking in GlobalSearch.
5159 * @hide
5160 */
5161 public static final String SEARCH_MAX_SOURCE_EVENT_AGE_MILLIS =
5162 "search_max_source_event_age_millis";
5163 /**
5164 * The minimum number of impressions needed to rank a source in GlobalSearch.
5165 * @hide
5166 */
5167 public static final String SEARCH_MIN_IMPRESSIONS_FOR_SOURCE_RANKING =
5168 "search_min_impressions_for_source_ranking";
5169 /**
5170 * The minimum number of clicks needed to rank a source in GlobalSearch.
5171 * @hide
5172 */
5173 public static final String SEARCH_MIN_CLICKS_FOR_SOURCE_RANKING =
5174 "search_min_clicks_for_source_ranking";
5175 /**
5176 * The maximum number of shortcuts shown by GlobalSearch.
5177 * @hide
5178 */
5179 public static final String SEARCH_MAX_SHORTCUTS_RETURNED = "search_max_shortcuts_returned";
5180 /**
5181 * The size of the core thread pool for suggestion queries in GlobalSearch.
5182 * @hide
5183 */
5184 public static final String SEARCH_QUERY_THREAD_CORE_POOL_SIZE =
5185 "search_query_thread_core_pool_size";
5186 /**
5187 * The maximum size of the thread pool for suggestion queries in GlobalSearch.
5188 * @hide
5189 */
5190 public static final String SEARCH_QUERY_THREAD_MAX_POOL_SIZE =
5191 "search_query_thread_max_pool_size";
5192 /**
5193 * The size of the core thread pool for shortcut refreshing in GlobalSearch.
5194 * @hide
5195 */
5196 public static final String SEARCH_SHORTCUT_REFRESH_CORE_POOL_SIZE =
5197 "search_shortcut_refresh_core_pool_size";
5198 /**
5199 * The maximum size of the thread pool for shortcut refreshing in GlobalSearch.
5200 * @hide
5201 */
5202 public static final String SEARCH_SHORTCUT_REFRESH_MAX_POOL_SIZE =
5203 "search_shortcut_refresh_max_pool_size";
5204 /**
5205 * The maximun time that excess threads in the GlobalSeach thread pools will
5206 * wait before terminating.
5207 * @hide
5208 */
5209 public static final String SEARCH_THREAD_KEEPALIVE_SECONDS =
5210 "search_thread_keepalive_seconds";
5211 /**
5212 * The maximum number of concurrent suggestion queries to each source.
5213 * @hide
5214 */
5215 public static final String SEARCH_PER_SOURCE_CONCURRENT_QUERY_LIMIT =
5216 "search_per_source_concurrent_query_limit";
5217
San Mehat87734d32010-01-08 12:53:06 -08005218 /**
5219 * Whether or not alert sounds are played on MountService events. (0 = false, 1 = true)
5220 * @hide
5221 */
5222 public static final String MOUNT_PLAY_NOTIFICATION_SND = "mount_play_not_snd";
5223
5224 /**
5225 * Whether or not UMS auto-starts on UMS host detection. (0 = false, 1 = true)
5226 * @hide
5227 */
5228 public static final String MOUNT_UMS_AUTOSTART = "mount_ums_autostart";
5229
5230 /**
5231 * Whether or not a notification is displayed on UMS host detection. (0 = false, 1 = true)
5232 * @hide
5233 */
5234 public static final String MOUNT_UMS_PROMPT = "mount_ums_prompt";
5235
5236 /**
5237 * Whether or not a notification is displayed while UMS is enabled. (0 = false, 1 = true)
5238 * @hide
5239 */
5240 public static final String MOUNT_UMS_NOTIFY_ENABLED = "mount_ums_notify_enabled";
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08005241
Dan Egnor42471dd2010-01-07 17:25:22 -08005242 /**
5243 * If nonzero, ANRs in invisible background processes bring up a dialog.
5244 * Otherwise, the process will be silently killed.
5245 * @hide
5246 */
5247 public static final String ANR_SHOW_BACKGROUND = "anr_show_background";
Erikeebc8e22010-02-18 13:27:19 -08005248
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08005249 /**
5250 * The {@link ComponentName} string of the service to be used as the voice recognition
5251 * service.
Erikeebc8e22010-02-18 13:27:19 -08005252 *
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08005253 * @hide
5254 */
5255 public static final String VOICE_RECOGNITION_SERVICE = "voice_recognition_service";
Dan Egnor42471dd2010-01-07 17:25:22 -08005256
William Luh623a4282013-06-24 12:14:18 -07005257 /**
5258 * Stores whether an user has consented to have apps verified through PAM.
5259 * The value is boolean (1 or 0).
5260 *
5261 * @hide
5262 */
5263 public static final String PACKAGE_VERIFIER_USER_CONSENT =
5264 "package_verifier_user_consent";
satok988323c2011-06-22 16:38:13 +09005265
5266 /**
satokada8c4e2011-08-23 14:56:56 +09005267 * The {@link ComponentName} string of the selected spell checker service which is
5268 * one of the services managed by the text service manager.
5269 *
5270 * @hide
5271 */
5272 public static final String SELECTED_SPELL_CHECKER = "selected_spell_checker";
5273
5274 /**
5275 * The {@link ComponentName} string of the selected subtype of the selected spell checker
satok988323c2011-06-22 16:38:13 +09005276 * service which is one of the services managed by the text service manager.
5277 *
5278 * @hide
5279 */
satokada8c4e2011-08-23 14:56:56 +09005280 public static final String SELECTED_SPELL_CHECKER_SUBTYPE =
5281 "selected_spell_checker_subtype";
satok988323c2011-06-22 16:38:13 +09005282
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08005283 /**
satoka33c4fc2011-08-25 16:50:11 +09005284 * The {@link ComponentName} string whether spell checker is enabled or not.
5285 *
5286 * @hide
5287 */
5288 public static final String SPELL_CHECKER_ENABLED = "spell_checker_enabled";
5289
5290 /**
David Brown458e8062010-03-08 21:52:11 -08005291 * What happens when the user presses the Power button while in-call
5292 * and the screen is on.<br/>
5293 * <b>Values:</b><br/>
5294 * 1 - The Power button turns off the screen and locks the device. (Default behavior)<br/>
5295 * 2 - The Power button hangs up the current call.<br/>
5296 *
5297 * @hide
5298 */
5299 public static final String INCALL_POWER_BUTTON_BEHAVIOR = "incall_power_button_behavior";
5300
5301 /**
5302 * INCALL_POWER_BUTTON_BEHAVIOR value for "turn off screen".
5303 * @hide
5304 */
5305 public static final int INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF = 0x1;
5306
5307 /**
5308 * INCALL_POWER_BUTTON_BEHAVIOR value for "hang up".
5309 * @hide
5310 */
5311 public static final int INCALL_POWER_BUTTON_BEHAVIOR_HANGUP = 0x2;
5312
5313 /**
5314 * INCALL_POWER_BUTTON_BEHAVIOR default value.
5315 * @hide
5316 */
5317 public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT =
5318 INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF;
5319
5320 /**
Jeff Browna20dda42014-05-27 20:57:24 -07005321 * Whether the device should wake when the wake gesture sensor detects motion.
5322 * @hide
5323 */
5324 public static final String WAKE_GESTURE_ENABLED = "wake_gesture_enabled";
5325
5326 /**
John Spurlocka4215ce2014-08-04 14:50:38 -04005327 * Whether the device should doze if configured.
5328 * @hide
5329 */
5330 public static final String DOZE_ENABLED = "doze_enabled";
5331
5332 /**
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07005333 * The current night mode that has been selected by the user. Owned
5334 * and controlled by UiModeManagerService. Constants are as per
5335 * UiModeManager.
5336 * @hide
5337 */
5338 public static final String UI_NIGHT_MODE = "ui_night_mode";
Suchi Amalapurapu40e47252010-04-07 16:15:50 -07005339
5340 /**
John Spurlock1a868b72012-08-22 09:56:51 -04005341 * Whether screensavers are enabled.
Daniel Sandler0601eb72011-04-13 01:01:32 -04005342 * @hide
5343 */
Daniel Sandler2d545362011-11-17 10:38:37 -08005344 public static final String SCREENSAVER_ENABLED = "screensaver_enabled";
Daniel Sandler0601eb72011-04-13 01:01:32 -04005345
5346 /**
John Spurlock1a868b72012-08-22 09:56:51 -04005347 * The user's chosen screensaver components.
Daniel Sandler2d545362011-11-17 10:38:37 -08005348 *
John Spurlock1a868b72012-08-22 09:56:51 -04005349 * These will be launched by the PhoneWindowManager after a timeout when not on
Daniel Sandler2d545362011-11-17 10:38:37 -08005350 * battery, or upon dock insertion (if SCREENSAVER_ACTIVATE_ON_DOCK is set to 1).
Daniel Sandler0601eb72011-04-13 01:01:32 -04005351 * @hide
5352 */
John Spurlock1a868b72012-08-22 09:56:51 -04005353 public static final String SCREENSAVER_COMPONENTS = "screensaver_components";
Daniel Sandler2d545362011-11-17 10:38:37 -08005354
5355 /**
John Spurlock1a868b72012-08-22 09:56:51 -04005356 * If screensavers are enabled, whether the screensaver should be automatically launched
5357 * when the device is inserted into a (desk) dock.
Daniel Sandler2d545362011-11-17 10:38:37 -08005358 * @hide
5359 */
5360 public static final String SCREENSAVER_ACTIVATE_ON_DOCK = "screensaver_activate_on_dock";
Daniel Sandler0601eb72011-04-13 01:01:32 -04005361
John Spurlock1a868b72012-08-22 09:56:51 -04005362 /**
5363 * If screensavers are enabled, whether the screensaver should be automatically launched
5364 * when the screen times out when not on battery.
5365 * @hide
5366 */
5367 public static final String SCREENSAVER_ACTIVATE_ON_SLEEP = "screensaver_activate_on_sleep";
5368
5369 /**
5370 * If screensavers are enabled, the default screensaver component.
5371 * @hide
5372 */
5373 public static final String SCREENSAVER_DEFAULT_COMPONENT = "screensaver_default_component";
5374
Daniel Sandler0601eb72011-04-13 01:01:32 -04005375 /**
Martijn Coenena7397882013-07-30 20:07:47 -07005376 * The default NFC payment component
5377 * @hide
5378 */
5379 public static final String NFC_PAYMENT_DEFAULT_COMPONENT = "nfc_payment_default_component";
5380
5381 /**
Martijn Coenen2f6f3a012014-04-25 17:00:21 -07005382 * Whether NFC payment is handled by the foreground application or a default.
5383 * @hide
5384 */
5385 public static final String NFC_PAYMENT_FOREGROUND = "nfc_payment_foreground";
5386
5387 /**
David Braunf5d83192013-09-16 13:43:51 -07005388 * Specifies the package name currently configured to be the primary sms application
5389 * @hide
5390 */
5391 public static final String SMS_DEFAULT_APPLICATION = "sms_default_application";
5392
5393 /**
Adrian Roos943eb862015-03-26 12:31:16 -07005394 * Specifies the package name currently configured to be the emergency assistance application
5395 *
5396 * @see android.telephony.TelephonyManager#ACTION_EMERGENCY_ASSISTANCE
5397 *
5398 * @hide
5399 */
5400 public static final String EMERGENCY_ASSISTANCE_APPLICATION = "emergency_assistance_application";
5401
5402 /**
Chris Wren8326a8a2014-10-22 14:13:32 -04005403 * Names of the packages that the current user has explicitly allowed to
5404 * see all of the user's notifications, separated by ':'.
Daniel Sandler4b749ef2013-03-18 21:53:04 -04005405 *
5406 * @hide
5407 */
5408 public static final String ENABLED_NOTIFICATION_LISTENERS = "enabled_notification_listeners";
5409
John Spurlock7340fc82014-04-24 18:50:12 -04005410 /**
5411 * @hide
5412 */
5413 public static final String ENABLED_CONDITION_PROVIDERS = "enabled_condition_providers";
5414
John Spurlock5c454122013-06-17 07:35:46 -04005415 /** @hide */
5416 public static final String BAR_SERVICE_COMPONENT = "bar_service_component";
5417
John Spurlockd67ec252013-09-05 11:31:54 -04005418 /** @hide */
John Spurlockcdb57ae2015-02-11 19:04:11 -05005419 public static final String VOLUME_CONTROLLER_SERVICE_COMPONENT
5420 = "volume_controller_service_component";
5421
5422 /** @hide */
John Spurlockf1a36642013-10-12 17:50:42 -04005423 public static final String IMMERSIVE_MODE_CONFIRMATIONS = "immersive_mode_confirmations";
John Spurlockd67ec252013-09-05 11:31:54 -04005424
Yorke Lee647f8f32013-05-07 10:49:44 -07005425 /**
Svetoslavf43e8512013-09-30 17:33:05 -07005426 * This is the query URI for finding a print service to install.
5427 *
5428 * @hide
5429 */
5430 public static final String PRINT_SERVICE_SEARCH_URI = "print_service_search_uri";
5431
5432 /**
5433 * This is the query URI for finding a NFC payment service to install.
5434 *
5435 * @hide
5436 */
5437 public static final String PAYMENT_SERVICE_SEARCH_URI = "payment_service_search_uri";
5438
5439 /**
Amith Yamasani1e9c2182014-06-11 17:25:51 -07005440 * If enabled, apps should try to skip any introductory hints on first launch. This might
Amith Yamasani0c416392014-06-13 15:54:39 -07005441 * apply to users that are already familiar with the environment or temporary users.
Amith Yamasani1e9c2182014-06-11 17:25:51 -07005442 * <p>
5443 * Type : int (0 to show hints, 1 to skip showing hints)
Amith Yamasani1e9c2182014-06-11 17:25:51 -07005444 */
5445 public static final String SKIP_FIRST_USE_HINTS = "skip_first_use_hints";
5446
5447 /**
John Spurlockaa5ee4d2014-07-25 13:05:12 -04005448 * Persisted playback time after a user confirmation of an unsafe volume level.
5449 *
5450 * @hide
5451 */
5452 public static final String UNSAFE_VOLUME_MUSIC_ACTIVE_MS = "unsafe_volume_music_active_ms";
5453
5454 /**
Dan Sandler52e5701e2014-07-22 23:14:54 -04005455 * This preference enables notification display on the lockscreen.
5456 * @hide
5457 */
5458 public static final String LOCK_SCREEN_SHOW_NOTIFICATIONS =
5459 "lock_screen_show_notifications";
5460
5461 /**
Dongwon Kang4d933a02014-08-07 22:51:47 -07005462 * List of TV inputs that are currently hidden. This is a string
Jaewan Kimf0e530e2014-08-22 00:43:31 +09005463 * containing the IDs of all hidden TV inputs. Each ID is encoded by
5464 * {@link android.net.Uri#encode(String)} and separated by ':'.
Dongwon Kang4d933a02014-08-07 22:51:47 -07005465 * @hide
5466 */
5467 public static final String TV_INPUT_HIDDEN_INPUTS = "tv_input_hidden_inputs";
5468
5469 /**
5470 * List of custom TV input labels. This is a string containing <TV input id, custom name>
Jaewan Kimf0e530e2014-08-22 00:43:31 +09005471 * pairs. TV input id and custom name are encoded by {@link android.net.Uri#encode(String)}
5472 * and separated by ','. Each pair is separated by ':'.
Dongwon Kang4d933a02014-08-07 22:51:47 -07005473 * @hide
5474 */
5475 public static final String TV_INPUT_CUSTOM_LABELS = "tv_input_custom_labels";
5476
5477 /**
Glenn Kasten34cc4db2014-08-13 10:56:38 -07005478 * Whether automatic routing of system audio to USB audio peripheral is disabled.
5479 * The value is boolean (1 or 0), where 1 means automatic routing is disabled,
5480 * and 0 means automatic routing is enabled.
5481 *
5482 * @hide
5483 */
5484 public static final String USB_AUDIO_AUTOMATIC_ROUTING_DISABLED =
5485 "usb_audio_automatic_routing_disabled";
5486
5487 /**
Jeff Brown05af6ad2014-09-30 20:54:30 -07005488 * The timeout in milliseconds before the device fully goes to sleep after
5489 * a period of inactivity. This value sets an upper bound on how long the device
5490 * will stay awake or dreaming without user activity. It should generally
Dianne Hackbornad6a99b2014-11-18 10:11:10 -08005491 * be longer than {@link Settings.System#SCREEN_OFF_TIMEOUT} as otherwise the device
Jeff Brown05af6ad2014-09-30 20:54:30 -07005492 * will sleep before it ever has a chance to dream.
5493 * <p>
5494 * Use -1 to disable this timeout.
5495 * </p>
5496 *
5497 * @hide
5498 */
5499 public static final String SLEEP_TIMEOUT = "sleep_timeout";
5500
5501 /**
Amith Yamasanib0ff3222015-03-04 09:56:14 -08005502 * Duration in milliseconds that an app should be inactive before it is considered idle.
5503 * <p/>Type: Long
5504 * @hide
5505 */
5506 public static final String APP_IDLE_DURATION = "app_idle_duration";
5507
5508 /**
Svetoslav Ganova571a582011-09-20 18:32:20 -07005509 * This are the settings to be backed up.
5510 *
5511 * NOTE: Settings are backed up and restored in the order they appear
5512 * in this array. If you have one setting depending on another,
5513 * make sure that they are ordered appropriately.
5514 *
-b master501eec92009-07-06 13:53:11 -07005515 * @hide
5516 */
5517 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate58f41ec2013-01-11 15:40:36 -08005518 BUGREPORT_IN_POWER_MENU, // moved to global
Amith Yamasani8823c0a82009-07-07 14:30:17 -07005519 ALLOW_MOCK_LOCATION,
-b master501eec92009-07-06 13:53:11 -07005520 PARENTAL_CONTROL_ENABLED,
5521 PARENTAL_CONTROL_REDIRECT_URL,
Christopher Tate66488d62012-10-02 11:58:01 -07005522 USB_MASS_STORAGE_ENABLED, // moved to global
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07005523 ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED,
5524 ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE,
5525 ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE,
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07005526 ACCESSIBILITY_SCRIPT_INJECTION,
Christopher Tate14c2d792010-02-25 16:49:44 -08005527 BACKUP_AUTO_RESTORE,
-b master501eec92009-07-06 13:53:11 -07005528 ENABLED_ACCESSIBILITY_SERVICES,
Christopher Tate6597e342015-02-17 12:15:25 -08005529 ENABLED_NOTIFICATION_LISTENERS,
Christopher Tate7b9a28c2015-03-18 13:06:16 -07005530 ENABLED_INPUT_METHODS,
Svetoslav Ganov9a4c5cd2012-05-30 14:06:32 -07005531 TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES,
Svetoslav Ganova28a16d2011-07-28 11:24:21 -07005532 TOUCH_EXPLORATION_ENABLED,
Svetoslav Ganova571a582011-09-20 18:32:20 -07005533 ACCESSIBILITY_ENABLED,
Svetoslav Ganov55f937a2011-12-05 11:42:07 -08005534 ACCESSIBILITY_SPEAK_PASSWORD,
Chris Craikcce47eb2014-07-16 15:12:15 -07005535 ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED,
Alan Viveretteef793802013-07-23 14:15:28 -07005536 ACCESSIBILITY_CAPTIONING_ENABLED,
5537 ACCESSIBILITY_CAPTIONING_LOCALE,
5538 ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR,
5539 ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR,
5540 ACCESSIBILITY_CAPTIONING_EDGE_TYPE,
5541 ACCESSIBILITY_CAPTIONING_EDGE_COLOR,
5542 ACCESSIBILITY_CAPTIONING_TYPEFACE,
Alan Viverette69ce69b2013-08-29 12:23:48 -07005543 ACCESSIBILITY_CAPTIONING_FONT_SCALE,
-b master501eec92009-07-06 13:53:11 -07005544 TTS_USE_DEFAULTS,
5545 TTS_DEFAULT_RATE,
5546 TTS_DEFAULT_PITCH,
5547 TTS_DEFAULT_SYNTH,
5548 TTS_DEFAULT_LANG,
5549 TTS_DEFAULT_COUNTRY,
Charles Chenceffa152010-03-16 21:18:10 -07005550 TTS_ENABLED_PLUGINS,
Narayan Kamath6d632962011-08-24 11:51:37 +01005551 TTS_DEFAULT_LOCALE,
Christopher Tate66488d62012-10-02 11:58:01 -07005552 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, // moved to global
5553 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, // moved to global
5554 WIFI_NUM_OPEN_NETWORKS_KEPT, // moved to global
Christopher Tate06cbadd2015-03-16 18:29:42 -07005555 SELECTED_SPELL_CHECKER,
5556 SELECTED_SPELL_CHECKER_SUBTYPE,
5557 SPELL_CHECKER_ENABLED,
San Mehat87734d32010-01-08 12:53:06 -08005558 MOUNT_PLAY_NOTIFICATION_SND,
5559 MOUNT_UMS_AUTOSTART,
5560 MOUNT_UMS_PROMPT,
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07005561 MOUNT_UMS_NOTIFY_ENABLED,
Jeff Brown05af6ad2014-09-30 20:54:30 -07005562 UI_NIGHT_MODE,
5563 SLEEP_TIMEOUT
-b master501eec92009-07-06 13:53:11 -07005564 };
5565
5566 /**
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07005567 * These entries are considered common between the personal and the managed profile,
5568 * since the managed profile doesn't get to change them.
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07005569 */
Svetoslav683914b2015-01-15 14:22:26 -08005570 private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>();
Amith Yamasanib0ff3222015-03-04 09:56:14 -08005571
Svetoslav683914b2015-01-15 14:22:26 -08005572 static {
5573 CLONE_TO_MANAGED_PROFILE.add(ACCESSIBILITY_ENABLED);
5574 CLONE_TO_MANAGED_PROFILE.add(ALLOW_MOCK_LOCATION);
5575 CLONE_TO_MANAGED_PROFILE.add(ALLOWED_GEOLOCATION_ORIGINS);
5576 CLONE_TO_MANAGED_PROFILE.add(DEFAULT_INPUT_METHOD);
5577 CLONE_TO_MANAGED_PROFILE.add(ENABLED_ACCESSIBILITY_SERVICES);
5578 CLONE_TO_MANAGED_PROFILE.add(ENABLED_INPUT_METHODS);
5579 CLONE_TO_MANAGED_PROFILE.add(LOCATION_MODE);
5580 CLONE_TO_MANAGED_PROFILE.add(LOCATION_PROVIDERS_ALLOWED);
5581 CLONE_TO_MANAGED_PROFILE.add(LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS);
5582 CLONE_TO_MANAGED_PROFILE.add(SELECTED_INPUT_METHOD_SUBTYPE);
5583 CLONE_TO_MANAGED_PROFILE.add(SELECTED_SPELL_CHECKER);
5584 CLONE_TO_MANAGED_PROFILE.add(SELECTED_SPELL_CHECKER_SUBTYPE);
5585 }
5586
5587 /** @hide */
5588 public static void getCloneToManagedProfileSettings(Set<String> outKeySet) {
5589 outKeySet.addAll(CLONE_TO_MANAGED_PROFILE);
5590 }
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07005591
5592 /**
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005593 * Helper method for determining if a location provider is enabled.
Tom O'Neilld5759432013-09-11 11:03:03 -07005594 *
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005595 * @param cr the content resolver to use
5596 * @param provider the location provider to query
5597 * @return true if the provider is enabled
Tom O'Neilld5759432013-09-11 11:03:03 -07005598 *
5599 * @deprecated use {@link #LOCATION_MODE} or
5600 * {@link LocationManager#isProviderEnabled(String)}
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005601 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07005602 @Deprecated
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005603 public static final boolean isLocationProviderEnabled(ContentResolver cr, String provider) {
Victoria Leaseb711d572012-10-02 13:14:11 -07005604 return isLocationProviderEnabledForUser(cr, provider, UserHandle.myUserId());
5605 }
5606
5607 /**
5608 * Helper method for determining if a location provider is enabled.
5609 * @param cr the content resolver to use
5610 * @param provider the location provider to query
5611 * @param userId the userId to query
5612 * @return true if the provider is enabled
Tom O'Neilld5759432013-09-11 11:03:03 -07005613 * @deprecated use {@link #LOCATION_MODE} or
5614 * {@link LocationManager#isProviderEnabled(String)}
Victoria Leaseb711d572012-10-02 13:14:11 -07005615 * @hide
5616 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07005617 @Deprecated
Victoria Leaseb711d572012-10-02 13:14:11 -07005618 public static final boolean isLocationProviderEnabledForUser(ContentResolver cr, String provider, int userId) {
5619 String allowedProviders = Settings.Secure.getStringForUser(cr,
5620 LOCATION_PROVIDERS_ALLOWED, userId);
Brad Fitzpatrick11fe1812010-09-10 16:07:52 -07005621 return TextUtils.delimitedStringContains(allowedProviders, ',', provider);
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005622 }
5623
5624 /**
5625 * Thread-safe method for enabling or disabling a single location provider.
5626 * @param cr the content resolver to use
5627 * @param provider the location provider to enable or disable
5628 * @param enabled true if the provider should be enabled
Tom O'Neilla324ac72013-08-26 14:40:23 -07005629 * @deprecated use {@link #putInt(ContentResolver, String, int)} and {@link #LOCATION_MODE}
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005630 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07005631 @Deprecated
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005632 public static final void setLocationProviderEnabled(ContentResolver cr,
5633 String provider, boolean enabled) {
Victoria Leaseb711d572012-10-02 13:14:11 -07005634 setLocationProviderEnabledForUser(cr, provider, enabled, UserHandle.myUserId());
5635 }
5636
5637 /**
5638 * Thread-safe method for enabling or disabling a single location provider.
Tom O'Neilla324ac72013-08-26 14:40:23 -07005639 *
Victoria Leaseb711d572012-10-02 13:14:11 -07005640 * @param cr the content resolver to use
5641 * @param provider the location provider to enable or disable
5642 * @param enabled true if the provider should be enabled
5643 * @param userId the userId for which to enable/disable providers
Tom O'Neilla324ac72013-08-26 14:40:23 -07005644 * @return true if the value was set, false on database errors
5645 * @deprecated use {@link #putIntForUser(ContentResolver, String, int, int)} and
5646 * {@link #LOCATION_MODE}
Victoria Leaseb711d572012-10-02 13:14:11 -07005647 * @hide
5648 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07005649 @Deprecated
Tom O'Neilla324ac72013-08-26 14:40:23 -07005650 public static final boolean setLocationProviderEnabledForUser(ContentResolver cr,
Victoria Leaseb711d572012-10-02 13:14:11 -07005651 String provider, boolean enabled, int userId) {
David Christie3f7b6522013-08-06 19:19:08 -07005652 synchronized (mLocationSettingsLock) {
5653 // to ensure thread safety, we write the provider name with a '+' or '-'
5654 // and let the SettingsProvider handle it rather than reading and modifying
5655 // the list of enabled providers.
5656 if (enabled) {
5657 provider = "+" + provider;
5658 } else {
5659 provider = "-" + provider;
5660 }
Tom O'Neilla324ac72013-08-26 14:40:23 -07005661 return putStringForUser(cr, Settings.Secure.LOCATION_PROVIDERS_ALLOWED, provider,
David Christie3f7b6522013-08-06 19:19:08 -07005662 userId);
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005663 }
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005664 }
Tom O'Neill1f48b782013-08-19 18:14:56 -07005665
5666 /**
5667 * Thread-safe method for setting the location mode to one of
5668 * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY},
5669 * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}.
5670 *
Tom O'Neill1f48b782013-08-19 18:14:56 -07005671 * @param cr the content resolver to use
5672 * @param mode such as {@link #LOCATION_MODE_HIGH_ACCURACY}
5673 * @param userId the userId for which to change mode
Tom O'Neilla324ac72013-08-26 14:40:23 -07005674 * @return true if the value was set, false on database errors
Tom O'Neill1f48b782013-08-19 18:14:56 -07005675 *
5676 * @throws IllegalArgumentException if mode is not one of the supported values
5677 */
Tom O'Neill7f6f4572013-08-27 10:53:15 -07005678 private static final boolean setLocationModeForUser(ContentResolver cr, int mode,
5679 int userId) {
Tom O'Neill1f48b782013-08-19 18:14:56 -07005680 synchronized (mLocationSettingsLock) {
5681 boolean gps = false;
5682 boolean network = false;
5683 switch (mode) {
5684 case LOCATION_MODE_OFF:
5685 break;
5686 case LOCATION_MODE_SENSORS_ONLY:
5687 gps = true;
5688 break;
5689 case LOCATION_MODE_BATTERY_SAVING:
5690 network = true;
5691 break;
5692 case LOCATION_MODE_HIGH_ACCURACY:
5693 gps = true;
5694 network = true;
5695 break;
5696 default:
5697 throw new IllegalArgumentException("Invalid location mode: " + mode);
5698 }
Tom O'Neill7731a992014-10-09 11:30:49 -07005699 // Note it's important that we set the NLP mode first. The Google implementation
5700 // of NLP clears its NLP consent setting any time it receives a
5701 // LocationManager.PROVIDERS_CHANGED_ACTION broadcast and NLP is disabled. Also,
5702 // it shows an NLP consent dialog any time it receives the broadcast, NLP is
5703 // enabled, and the NLP consent is not set. If 1) we were to enable GPS first,
5704 // 2) a setup wizard has its own NLP consent UI that sets the NLP consent setting,
5705 // and 3) the receiver happened to complete before we enabled NLP, then the Google
5706 // NLP would detect the attempt to enable NLP and show a redundant NLP consent
5707 // dialog. Then the people who wrote the setup wizard would be sad.
Tom O'Neilla324ac72013-08-26 14:40:23 -07005708 boolean nlpSuccess = Settings.Secure.setLocationProviderEnabledForUser(
Tom O'Neill1f48b782013-08-19 18:14:56 -07005709 cr, LocationManager.NETWORK_PROVIDER, network, userId);
Tom O'Neill7731a992014-10-09 11:30:49 -07005710 boolean gpsSuccess = Settings.Secure.setLocationProviderEnabledForUser(
5711 cr, LocationManager.GPS_PROVIDER, gps, userId);
Tom O'Neilla324ac72013-08-26 14:40:23 -07005712 return gpsSuccess && nlpSuccess;
Tom O'Neill1f48b782013-08-19 18:14:56 -07005713 }
5714 }
5715
5716 /**
Tom O'Neill1f48b782013-08-19 18:14:56 -07005717 * Thread-safe method for reading the location mode, returns one of
5718 * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY},
5719 * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}.
5720 *
5721 * @param cr the content resolver to use
5722 * @param userId the userId for which to read the mode
5723 * @return the location mode
5724 */
Tom O'Neill7f6f4572013-08-27 10:53:15 -07005725 private static final int getLocationModeForUser(ContentResolver cr, int userId) {
Tom O'Neill1f48b782013-08-19 18:14:56 -07005726 synchronized (mLocationSettingsLock) {
5727 boolean gpsEnabled = Settings.Secure.isLocationProviderEnabledForUser(
5728 cr, LocationManager.GPS_PROVIDER, userId);
5729 boolean networkEnabled = Settings.Secure.isLocationProviderEnabledForUser(
5730 cr, LocationManager.NETWORK_PROVIDER, userId);
5731 if (gpsEnabled && networkEnabled) {
5732 return LOCATION_MODE_HIGH_ACCURACY;
5733 } else if (gpsEnabled) {
5734 return LOCATION_MODE_SENSORS_ONLY;
5735 } else if (networkEnabled) {
5736 return LOCATION_MODE_BATTERY_SAVING;
5737 } else {
5738 return LOCATION_MODE_OFF;
5739 }
5740 }
5741 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005742 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005743
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005744 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005745 * Global system settings, containing preferences that always apply identically
5746 * to all defined users. Applications can read these but are not allowed to write;
5747 * like the "Secure" settings, these are for preferences that the user must
5748 * explicitly modify through the system UI or specialized APIs for those values.
5749 */
5750 public static final class Global extends NameValueTable {
5751 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_global_version";
5752
5753 /**
5754 * The content:// style URL for global secure settings items. Not public.
5755 */
5756 public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/global");
5757
5758 /**
Amith Yamasani23a0f052014-07-25 12:26:53 -07005759 * Whether users are allowed to add more users or guest from lockscreen.
5760 * <p>
5761 * Type: int
5762 * @hide
5763 */
5764 public static final String ADD_USERS_WHEN_LOCKED = "add_users_when_locked";
5765
5766 /**
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07005767 * Setting whether the global gesture for enabling accessibility is enabled.
5768 * If this gesture is enabled the user will be able to perfrom it to enable
5769 * the accessibility state without visiting the settings app.
5770 * @hide
5771 */
5772 public static final String ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED =
5773 "enable_accessibility_global_gesture_enabled";
5774
5775 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005776 * Whether Airplane Mode is on.
5777 */
5778 public static final String AIRPLANE_MODE_ON = "airplane_mode_on";
5779
5780 /**
Bryce Lee584a4452014-10-21 15:55:55 -07005781 * Whether Theater Mode is on.
5782 * {@hide}
5783 */
Bryce Leecdfebd62015-02-02 08:19:11 -08005784 @SystemApi
Bryce Lee584a4452014-10-21 15:55:55 -07005785 public static final String THEATER_MODE_ON = "theater_mode_on";
5786
5787 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005788 * Constant for use in AIRPLANE_MODE_RADIOS to specify Bluetooth radio.
5789 */
5790 public static final String RADIO_BLUETOOTH = "bluetooth";
5791
5792 /**
5793 * Constant for use in AIRPLANE_MODE_RADIOS to specify Wi-Fi radio.
5794 */
5795 public static final String RADIO_WIFI = "wifi";
5796
5797 /**
5798 * {@hide}
5799 */
5800 public static final String RADIO_WIMAX = "wimax";
5801 /**
5802 * Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio.
5803 */
5804 public static final String RADIO_CELL = "cell";
5805
5806 /**
5807 * Constant for use in AIRPLANE_MODE_RADIOS to specify NFC radio.
5808 */
5809 public static final String RADIO_NFC = "nfc";
5810
5811 /**
5812 * A comma separated list of radios that need to be disabled when airplane mode
5813 * is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are
5814 * included in the comma separated list.
5815 */
5816 public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios";
5817
5818 /**
5819 * A comma separated list of radios that should to be disabled when airplane mode
5820 * is on, but can be manually reenabled by the user. For example, if RADIO_WIFI is
5821 * added to both AIRPLANE_MODE_RADIOS and AIRPLANE_MODE_TOGGLEABLE_RADIOS, then Wifi
5822 * will be turned off when entering airplane mode, but the user will be able to reenable
5823 * Wifi in the Settings app.
5824 *
5825 * {@hide}
5826 */
5827 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios";
5828
5829 /**
5830 * The policy for deciding when Wi-Fi should go to sleep (which will in
5831 * turn switch to using the mobile data as an Internet connection).
5832 * <p>
5833 * Set to one of {@link #WIFI_SLEEP_POLICY_DEFAULT},
5834 * {@link #WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED}, or
5835 * {@link #WIFI_SLEEP_POLICY_NEVER}.
5836 */
5837 public static final String WIFI_SLEEP_POLICY = "wifi_sleep_policy";
5838
5839 /**
5840 * Value for {@link #WIFI_SLEEP_POLICY} to use the default Wi-Fi sleep
5841 * policy, which is to sleep shortly after the turning off
5842 * according to the {@link #STAY_ON_WHILE_PLUGGED_IN} setting.
5843 */
5844 public static final int WIFI_SLEEP_POLICY_DEFAULT = 0;
5845
5846 /**
5847 * Value for {@link #WIFI_SLEEP_POLICY} to use the default policy when
5848 * the device is on battery, and never go to sleep when the device is
5849 * plugged in.
5850 */
5851 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1;
5852
5853 /**
5854 * Value for {@link #WIFI_SLEEP_POLICY} to never go to sleep.
5855 */
5856 public static final int WIFI_SLEEP_POLICY_NEVER = 2;
5857
5858 /**
5859 * Value to specify if the user prefers the date, time and time zone
5860 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
5861 */
5862 public static final String AUTO_TIME = "auto_time";
5863
5864 /**
5865 * Value to specify if the user prefers the time zone
5866 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
5867 */
5868 public static final String AUTO_TIME_ZONE = "auto_time_zone";
5869
5870 /**
5871 * URI for the car dock "in" event sound.
5872 * @hide
5873 */
5874 public static final String CAR_DOCK_SOUND = "car_dock_sound";
5875
5876 /**
5877 * URI for the car dock "out" event sound.
5878 * @hide
5879 */
5880 public static final String CAR_UNDOCK_SOUND = "car_undock_sound";
5881
5882 /**
5883 * URI for the desk dock "in" event sound.
5884 * @hide
5885 */
5886 public static final String DESK_DOCK_SOUND = "desk_dock_sound";
5887
5888 /**
5889 * URI for the desk dock "out" event sound.
5890 * @hide
5891 */
5892 public static final String DESK_UNDOCK_SOUND = "desk_undock_sound";
5893
5894 /**
5895 * Whether to play a sound for dock events.
5896 * @hide
5897 */
5898 public static final String DOCK_SOUNDS_ENABLED = "dock_sounds_enabled";
5899
5900 /**
5901 * URI for the "device locked" (keyguard shown) sound.
5902 * @hide
5903 */
5904 public static final String LOCK_SOUND = "lock_sound";
5905
5906 /**
5907 * URI for the "device unlocked" sound.
5908 * @hide
5909 */
5910 public static final String UNLOCK_SOUND = "unlock_sound";
5911
5912 /**
Adrian Roos49e057d2014-08-13 17:14:51 +02005913 * URI for the "device is trusted" sound, which is played when the device enters the trusted
5914 * state without unlocking.
5915 * @hide
5916 */
5917 public static final String TRUSTED_SOUND = "trusted_sound";
5918
5919 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005920 * URI for the low battery sound file.
5921 * @hide
5922 */
5923 public static final String LOW_BATTERY_SOUND = "low_battery_sound";
5924
5925 /**
5926 * Whether to play a sound for low-battery alerts.
5927 * @hide
5928 */
5929 public static final String POWER_SOUNDS_ENABLED = "power_sounds_enabled";
5930
5931 /**
Jeff Brown84e27562012-12-07 13:56:34 -08005932 * URI for the "wireless charging started" sound.
5933 * @hide
5934 */
5935 public static final String WIRELESS_CHARGING_STARTED_SOUND =
5936 "wireless_charging_started_sound";
5937
5938 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005939 * Whether we keep the device on while the device is plugged in.
5940 * Supported values are:
5941 * <ul>
5942 * <li>{@code 0} to never stay on while plugged in</li>
5943 * <li>{@link BatteryManager#BATTERY_PLUGGED_AC} to stay on for AC charger</li>
5944 * <li>{@link BatteryManager#BATTERY_PLUGGED_USB} to stay on for USB charger</li>
5945 * <li>{@link BatteryManager#BATTERY_PLUGGED_WIRELESS} to stay on for wireless charger</li>
5946 * </ul>
5947 * These values can be OR-ed together.
5948 */
5949 public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in";
5950
5951 /**
Christopher Tate58f41ec2013-01-11 15:40:36 -08005952 * When the user has enable the option to have a "bug report" command
5953 * in the power menu.
5954 * @hide
5955 */
5956 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
5957
5958 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005959 * Whether ADB is enabled.
5960 */
5961 public static final String ADB_ENABLED = "adb_enabled";
5962
5963 /**
Jon Miranda836c0a82014-08-11 12:32:26 -07005964 * Whether Views are allowed to save their attribute data.
5965 * @hide
5966 */
5967 public static final String DEBUG_VIEW_ATTRIBUTES = "debug_view_attributes";
5968
5969 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005970 * Whether assisted GPS should be enabled or not.
5971 * @hide
5972 */
5973 public static final String ASSISTED_GPS_ENABLED = "assisted_gps_enabled";
5974
5975 /**
5976 * Whether bluetooth is enabled/disabled
5977 * 0=disabled. 1=enabled.
5978 */
5979 public static final String BLUETOOTH_ON = "bluetooth_on";
5980
5981 /**
5982 * CDMA Cell Broadcast SMS
5983 * 0 = CDMA Cell Broadcast SMS disabled
5984 * 1 = CDMA Cell Broadcast SMS enabled
5985 * @hide
5986 */
5987 public static final String CDMA_CELL_BROADCAST_SMS =
5988 "cdma_cell_broadcast_sms";
5989
5990 /**
5991 * The CDMA roaming mode 0 = Home Networks, CDMA default
5992 * 1 = Roaming on Affiliated networks
5993 * 2 = Roaming on any networks
5994 * @hide
5995 */
5996 public static final String CDMA_ROAMING_MODE = "roaming_settings";
5997
5998 /**
5999 * The CDMA subscription mode 0 = RUIM/SIM (default)
6000 * 1 = NV
6001 * @hide
6002 */
6003 public static final String CDMA_SUBSCRIPTION_MODE = "subscription_mode";
6004
6005 /** Inactivity timeout to track mobile data activity.
6006 *
6007 * If set to a positive integer, it indicates the inactivity timeout value in seconds to
6008 * infer the data activity of mobile network. After a period of no activity on mobile
6009 * networks with length specified by the timeout, an {@code ACTION_DATA_ACTIVITY_CHANGE}
6010 * intent is fired to indicate a transition of network status from "active" to "idle". Any
6011 * subsequent activity on mobile networks triggers the firing of {@code
6012 * ACTION_DATA_ACTIVITY_CHANGE} intent indicating transition from "idle" to "active".
6013 *
6014 * Network activity refers to transmitting or receiving data on the network interfaces.
6015 *
6016 * Tracking is disabled if set to zero or negative value.
6017 *
6018 * @hide
6019 */
6020 public static final String DATA_ACTIVITY_TIMEOUT_MOBILE = "data_activity_timeout_mobile";
6021
6022 /** Timeout to tracking Wifi data activity. Same as {@code DATA_ACTIVITY_TIMEOUT_MOBILE}
6023 * but for Wifi network.
6024 * @hide
6025 */
6026 public static final String DATA_ACTIVITY_TIMEOUT_WIFI = "data_activity_timeout_wifi";
6027
6028 /**
6029 * Whether or not data roaming is enabled. (0 = false, 1 = true)
6030 */
6031 public static final String DATA_ROAMING = "data_roaming";
6032
6033 /**
Wink Saville75c1e692013-03-20 17:06:50 -07006034 * The value passed to a Mobile DataConnection via bringUp which defines the
6035 * number of retries to preform when setting up the initial connection. The default
6036 * value defined in DataConnectionTrackerBase#DEFAULT_MDC_INITIAL_RETRY is currently 1.
6037 * @hide
6038 */
6039 public static final String MDC_INITIAL_MAX_RETRY = "mdc_initial_max_retry";
6040
6041 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006042 * Whether user has enabled development settings.
6043 */
6044 public static final String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled";
6045
6046 /**
6047 * Whether the device has been provisioned (0 = false, 1 = true)
6048 */
6049 public static final String DEVICE_PROVISIONED = "device_provisioned";
6050
6051 /**
6052 * The saved value for WindowManagerService.setForcedDisplayDensity().
6053 * One integer in dpi. If unset, then use the real display density.
6054 * @hide
6055 */
6056 public static final String DISPLAY_DENSITY_FORCED = "display_density_forced";
6057
6058 /**
6059 * The saved value for WindowManagerService.setForcedDisplaySize().
6060 * Two integers separated by a comma. If unset, then use the real display size.
6061 * @hide
6062 */
6063 public static final String DISPLAY_SIZE_FORCED = "display_size_forced";
6064
6065 /**
Jeff Brownd46747a2015-04-15 19:02:36 -07006066 * The saved value for WindowManagerService.setForcedDisplayScalingMode().
6067 * 0 or unset if scaling is automatic, 1 if scaling is disabled.
6068 * @hide
6069 */
6070 public static final String DISPLAY_SCALING_FORCE = "display_scaling_force";
6071
6072 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006073 * The maximum size, in bytes, of a download that the download manager will transfer over
6074 * a non-wifi connection.
6075 * @hide
6076 */
6077 public static final String DOWNLOAD_MAX_BYTES_OVER_MOBILE =
6078 "download_manager_max_bytes_over_mobile";
6079
6080 /**
6081 * The recommended maximum size, in bytes, of a download that the download manager should
6082 * transfer over a non-wifi connection. Over this size, the use will be warned, but will
6083 * have the option to start the download over the mobile connection anyway.
6084 * @hide
6085 */
6086 public static final String DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE =
6087 "download_manager_recommended_max_bytes_over_mobile";
6088
6089 /**
Christopher Tateaa036a22014-05-19 16:33:27 -07006090 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
Christopher Tate06efb532012-08-24 15:29:27 -07006091 */
Christopher Tateaa036a22014-05-19 16:33:27 -07006092 @Deprecated
6093 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
Christopher Tate06efb532012-08-24 15:29:27 -07006094
6095 /**
Jinsuk Kimb3d91772014-07-10 12:48:54 +09006096 * Whether HDMI control shall be enabled. If disabled, no CEC/MHL command will be
6097 * sent or processed. (0 = false, 1 = true)
6098 * @hide
6099 */
6100 public static final String HDMI_CONTROL_ENABLED = "hdmi_control_enabled";
6101
6102 /**
6103 * Whether HDMI system audio is enabled. If enabled, TV internal speaker is muted,
6104 * and the output is redirected to AV Receiver connected via
6105 * {@Global#HDMI_SYSTEM_AUDIO_OUTPUT}.
6106 * @hide
6107 */
6108 public static final String HDMI_SYSTEM_AUDIO_ENABLED = "hdmi_system_audio_enabled";
6109
6110 /**
Jinsuk Kimb3d91772014-07-10 12:48:54 +09006111 * Whether TV will automatically turn on upon reception of the CEC command
6112 * &lt;Text View On&gt; or &lt;Image View On&gt;. (0 = false, 1 = true)
6113 * @hide
6114 */
6115 public static final String HDMI_CONTROL_AUTO_WAKEUP_ENABLED =
6116 "hdmi_control_auto_wakeup_enabled";
6117
6118 /**
6119 * Whether TV will also turn off other CEC devices when it goes to standby mode.
6120 * (0 = false, 1 = true)
6121 * @hide
6122 */
6123 public static final String HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED =
6124 "hdmi_control_auto_device_off_enabled";
6125
6126 /**
Lorenzo Colitti06d7e532015-03-16 23:46:24 +09006127 * Whether to use the DHCP client from Lollipop and earlier instead of the newer Android DHCP
6128 * client.
6129 * (0 = false, 1 = true)
6130 * @hide
6131 */
6132 public static final String LEGACY_DHCP_CLIENT = "legacy_dhcp_client";
6133
6134 /**
Jinsuk Kimb3d91772014-07-10 12:48:54 +09006135 * Whether TV will switch to MHL port when a mobile device is plugged in.
6136 * (0 = false, 1 = true)
6137 * @hide
6138 */
6139 public static final String MHL_INPUT_SWITCHING_ENABLED = "mhl_input_switching_enabled";
6140
6141 /**
6142 * Whether TV will charge the mobile device connected at MHL port. (0 = false, 1 = true)
6143 * @hide
6144 */
6145 public static final String MHL_POWER_CHARGE_ENABLED = "mhl_power_charge_enabled";
6146
6147 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006148 * Whether mobile data connections are allowed by the user. See
6149 * ConnectivityManager for more info.
6150 * @hide
6151 */
6152 public static final String MOBILE_DATA = "mobile_data";
6153
6154 /** {@hide} */
6155 public static final String NETSTATS_ENABLED = "netstats_enabled";
6156 /** {@hide} */
6157 public static final String NETSTATS_POLL_INTERVAL = "netstats_poll_interval";
6158 /** {@hide} */
6159 public static final String NETSTATS_TIME_CACHE_MAX_AGE = "netstats_time_cache_max_age";
6160 /** {@hide} */
6161 public static final String NETSTATS_GLOBAL_ALERT_BYTES = "netstats_global_alert_bytes";
6162 /** {@hide} */
6163 public static final String NETSTATS_SAMPLE_ENABLED = "netstats_sample_enabled";
Christopher Tate06efb532012-08-24 15:29:27 -07006164
6165 /** {@hide} */
6166 public static final String NETSTATS_DEV_BUCKET_DURATION = "netstats_dev_bucket_duration";
6167 /** {@hide} */
6168 public static final String NETSTATS_DEV_PERSIST_BYTES = "netstats_dev_persist_bytes";
6169 /** {@hide} */
6170 public static final String NETSTATS_DEV_ROTATE_AGE = "netstats_dev_rotate_age";
6171 /** {@hide} */
6172 public static final String NETSTATS_DEV_DELETE_AGE = "netstats_dev_delete_age";
6173
6174 /** {@hide} */
6175 public static final String NETSTATS_UID_BUCKET_DURATION = "netstats_uid_bucket_duration";
6176 /** {@hide} */
6177 public static final String NETSTATS_UID_PERSIST_BYTES = "netstats_uid_persist_bytes";
6178 /** {@hide} */
6179 public static final String NETSTATS_UID_ROTATE_AGE = "netstats_uid_rotate_age";
6180 /** {@hide} */
6181 public static final String NETSTATS_UID_DELETE_AGE = "netstats_uid_delete_age";
6182
6183 /** {@hide} */
6184 public static final String NETSTATS_UID_TAG_BUCKET_DURATION = "netstats_uid_tag_bucket_duration";
6185 /** {@hide} */
6186 public static final String NETSTATS_UID_TAG_PERSIST_BYTES = "netstats_uid_tag_persist_bytes";
6187 /** {@hide} */
6188 public static final String NETSTATS_UID_TAG_ROTATE_AGE = "netstats_uid_tag_rotate_age";
6189 /** {@hide} */
6190 public static final String NETSTATS_UID_TAG_DELETE_AGE = "netstats_uid_tag_delete_age";
6191
6192 /**
6193 * User preference for which network(s) should be used. Only the
6194 * connectivity service should touch this.
6195 */
6196 public static final String NETWORK_PREFERENCE = "network_preference";
6197
6198 /**
Jeff Davidsondd6fd1e2014-04-14 15:14:30 -07006199 * Which package name to use for network scoring. If null, or if the package is not a valid
6200 * scorer app, external network scores will neither be requested nor accepted.
6201 * @hide
6202 */
6203 public static final String NETWORK_SCORER_APP = "network_scorer_app";
6204
6205 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006206 * If the NITZ_UPDATE_DIFF time is exceeded then an automatic adjustment
6207 * to SystemClock will be allowed even if NITZ_UPDATE_SPACING has not been
6208 * exceeded.
6209 * @hide
6210 */
6211 public static final String NITZ_UPDATE_DIFF = "nitz_update_diff";
6212
6213 /**
6214 * The length of time in milli-seconds that automatic small adjustments to
6215 * SystemClock are ignored if NITZ_UPDATE_DIFF is not exceeded.
6216 * @hide
6217 */
6218 public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing";
6219
6220 /** Preferred NTP server. {@hide} */
6221 public static final String NTP_SERVER = "ntp_server";
6222 /** Timeout in milliseconds to wait for NTP server. {@hide} */
6223 public static final String NTP_TIMEOUT = "ntp_timeout";
6224
6225 /**
rich cannings4d8fc792012-09-07 14:43:43 -07006226 * Whether the package manager should send package verification broadcasts for verifiers to
6227 * review apps prior to installation.
6228 * 1 = request apps to be verified prior to installation, if a verifier exists.
6229 * 0 = do not verify apps before installation
rich cannings4e5753f2012-09-19 16:03:56 -07006230 * @hide
rich cannings4d8fc792012-09-07 14:43:43 -07006231 */
6232 public static final String PACKAGE_VERIFIER_ENABLE = "package_verifier_enable";
6233
6234 /** Timeout for package verification.
rich cannings4e5753f2012-09-19 16:03:56 -07006235 * @hide */
rich cannings4d8fc792012-09-07 14:43:43 -07006236 public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout";
6237
6238 /** Default response code for package verification.
rich cannings4e5753f2012-09-19 16:03:56 -07006239 * @hide */
rich cannings4d8fc792012-09-07 14:43:43 -07006240 public static final String PACKAGE_VERIFIER_DEFAULT_RESPONSE = "verifier_default_response";
6241
rich cannings4e5753f2012-09-19 16:03:56 -07006242 /**
6243 * Show package verification setting in the Settings app.
rich canningse6686b32012-09-16 14:02:20 -07006244 * 1 = show (default)
6245 * 0 = hide
rich cannings4e5753f2012-09-19 16:03:56 -07006246 * @hide
rich canningse6686b32012-09-16 14:02:20 -07006247 */
6248 public static final String PACKAGE_VERIFIER_SETTING_VISIBLE = "verifier_setting_visible";
6249
rich cannings4d8fc792012-09-07 14:43:43 -07006250 /**
Fabrice Di Meglio1c1b4712014-11-19 17:12:32 -08006251 * Run package verification on apps installed through ADB/ADT/USB
rich cannings4e5753f2012-09-19 16:03:56 -07006252 * 1 = perform package verification on ADB installs (default)
6253 * 0 = bypass package verification on ADB installs
6254 * @hide
6255 */
6256 public static final String PACKAGE_VERIFIER_INCLUDE_ADB = "verifier_verify_adb_installs";
6257
6258 /**
Christopher Tate7265abe2014-11-21 13:54:45 -08006259 * Time since last fstrim (milliseconds) after which we force one to happen
6260 * during device startup. If unset, the default is 3 days.
6261 * @hide
6262 */
6263 public static final String FSTRIM_MANDATORY_INTERVAL = "fstrim_mandatory_interval";
6264
6265 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006266 * The interval in milliseconds at which to check packet counts on the
6267 * mobile data interface when screen is on, to detect possible data
6268 * connection problems.
6269 * @hide
6270 */
6271 public static final String PDP_WATCHDOG_POLL_INTERVAL_MS =
6272 "pdp_watchdog_poll_interval_ms";
6273
6274 /**
6275 * The interval in milliseconds at which to check packet counts on the
6276 * mobile data interface when screen is off, to detect possible data
6277 * connection problems.
6278 * @hide
6279 */
6280 public static final String PDP_WATCHDOG_LONG_POLL_INTERVAL_MS =
6281 "pdp_watchdog_long_poll_interval_ms";
6282
6283 /**
6284 * The interval in milliseconds at which to check packet counts on the
6285 * mobile data interface after {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT}
6286 * outgoing packets has been reached without incoming packets.
6287 * @hide
6288 */
6289 public static final String PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS =
6290 "pdp_watchdog_error_poll_interval_ms";
6291
6292 /**
6293 * The number of outgoing packets sent without seeing an incoming packet
6294 * that triggers a countdown (of {@link #PDP_WATCHDOG_ERROR_POLL_COUNT}
6295 * device is logged to the event log
6296 * @hide
6297 */
6298 public static final String PDP_WATCHDOG_TRIGGER_PACKET_COUNT =
6299 "pdp_watchdog_trigger_packet_count";
6300
6301 /**
6302 * The number of polls to perform (at {@link #PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS})
6303 * after hitting {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} before
6304 * attempting data connection recovery.
6305 * @hide
6306 */
6307 public static final String PDP_WATCHDOG_ERROR_POLL_COUNT =
6308 "pdp_watchdog_error_poll_count";
6309
6310 /**
6311 * The number of failed PDP reset attempts before moving to something more
6312 * drastic: re-registering to the network.
6313 * @hide
6314 */
6315 public static final String PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT =
6316 "pdp_watchdog_max_pdp_reset_fail_count";
6317
6318 /**
6319 * A positive value indicates how often the SamplingProfiler
6320 * should take snapshots. Zero value means SamplingProfiler
6321 * is disabled.
6322 *
6323 * @hide
6324 */
6325 public static final String SAMPLING_PROFILER_MS = "sampling_profiler_ms";
6326
6327 /**
6328 * URL to open browser on to allow user to manage a prepay account
6329 * @hide
6330 */
6331 public static final String SETUP_PREPAID_DATA_SERVICE_URL =
6332 "setup_prepaid_data_service_url";
6333
6334 /**
6335 * URL to attempt a GET on to see if this is a prepay device
6336 * @hide
6337 */
6338 public static final String SETUP_PREPAID_DETECTION_TARGET_URL =
6339 "setup_prepaid_detection_target_url";
6340
6341 /**
6342 * Host to check for a redirect to after an attempt to GET
6343 * SETUP_PREPAID_DETECTION_TARGET_URL. (If we redirected there,
6344 * this is a prepaid device with zero balance.)
6345 * @hide
6346 */
6347 public static final String SETUP_PREPAID_DETECTION_REDIR_HOST =
6348 "setup_prepaid_detection_redir_host";
6349
6350 /**
Jake Hamby76a61422012-09-06 17:40:21 -07006351 * The interval in milliseconds at which to check the number of SMS sent out without asking
6352 * for use permit, to limit the un-authorized SMS usage.
6353 *
6354 * @hide
6355 */
6356 public static final String SMS_OUTGOING_CHECK_INTERVAL_MS =
6357 "sms_outgoing_check_interval_ms";
6358
6359 /**
6360 * The number of outgoing SMS sent without asking for user permit (of {@link
6361 * #SMS_OUTGOING_CHECK_INTERVAL_MS}
6362 *
6363 * @hide
6364 */
6365 public static final String SMS_OUTGOING_CHECK_MAX_COUNT =
6366 "sms_outgoing_check_max_count";
6367
6368 /**
6369 * Used to disable SMS short code confirmation - defaults to true.
Robert Greenwalt026efcc2012-09-24 10:03:21 -07006370 * True indcates we will do the check, etc. Set to false to disable.
Jake Hamby76a61422012-09-06 17:40:21 -07006371 * @see com.android.internal.telephony.SmsUsageMonitor
6372 * @hide
6373 */
6374 public static final String SMS_SHORT_CODE_CONFIRMATION = "sms_short_code_confirmation";
6375
Robert Greenwalt026efcc2012-09-24 10:03:21 -07006376 /**
6377 * Used to select which country we use to determine premium sms codes.
6378 * One of com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_SIM,
6379 * com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_NETWORK,
6380 * or com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_BOTH.
6381 * @hide
6382 */
6383 public static final String SMS_SHORT_CODE_RULE = "sms_short_code_rule";
6384
Jake Hamby76a61422012-09-06 17:40:21 -07006385 /**
JP Abgrall32d1ac4d2014-02-21 12:05:20 -08006386 * Used to select TCP's default initial receiver window size in segments - defaults to a build config value
6387 * @hide
6388 */
6389 public static final String TCP_DEFAULT_INIT_RWND = "tcp_default_init_rwnd";
6390
6391 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006392 * Used to disable Tethering on a device - defaults to true
6393 * @hide
6394 */
6395 public static final String TETHER_SUPPORTED = "tether_supported";
6396
6397 /**
6398 * Used to require DUN APN on the device or not - defaults to a build config value
6399 * which defaults to false
6400 * @hide
6401 */
6402 public static final String TETHER_DUN_REQUIRED = "tether_dun_required";
6403
6404 /**
6405 * Used to hold a gservices-provisioned apn value for DUN. If set, or the
6406 * corresponding build config values are set it will override the APN DB
6407 * values.
6408 * Consists of a comma seperated list of strings:
6409 * "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type"
6410 * note that empty fields can be ommitted: "name,apn,,,,,,,,,310,260,,DUN"
6411 * @hide
6412 */
6413 public static final String TETHER_DUN_APN = "tether_dun_apn";
6414
6415 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006416 * USB Mass Storage Enabled
6417 */
6418 public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled";
6419
6420 /**
6421 * If this setting is set (to anything), then all references
6422 * to Gmail on the device must change to Google Mail.
6423 */
6424 public static final String USE_GOOGLE_MAIL = "use_google_mail";
6425
Hui Shu22671772014-10-01 21:41:07 +00006426 /**
6427 * Webview Data reduction proxy key.
6428 * @hide
6429 */
6430 public static final String WEBVIEW_DATA_REDUCTION_PROXY_KEY =
6431 "webview_data_reduction_proxy_key";
6432
Christopher Tate06efb532012-08-24 15:29:27 -07006433 /**
Jeff Brown89d55462012-09-19 11:33:42 -07006434 * Whether Wifi display is enabled/disabled
6435 * 0=disabled. 1=enabled.
6436 * @hide
6437 */
6438 public static final String WIFI_DISPLAY_ON = "wifi_display_on";
6439
6440 /**
Chong Zhang1f3ecaa2013-05-03 15:55:36 -07006441 * Whether Wifi display certification mode is enabled/disabled
6442 * 0=disabled. 1=enabled.
6443 * @hide
6444 */
6445 public static final String WIFI_DISPLAY_CERTIFICATION_ON =
6446 "wifi_display_certification_on";
6447
6448 /**
Chong Zhange38af812013-08-29 17:25:17 -07006449 * WPS Configuration method used by Wifi display, this setting only
6450 * takes effect when WIFI_DISPLAY_CERTIFICATION_ON is 1 (enabled).
6451 *
6452 * Possible values are:
6453 *
6454 * WpsInfo.INVALID: use default WPS method chosen by framework
6455 * WpsInfo.PBC : use Push button
6456 * WpsInfo.KEYPAD : use Keypad
6457 * WpsInfo.DISPLAY: use Display
6458 * @hide
6459 */
6460 public static final String WIFI_DISPLAY_WPS_CONFIG =
6461 "wifi_display_wps_config";
6462
6463 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006464 * Whether to notify the user of open networks.
6465 * <p>
6466 * If not connected and the scan results have an open network, we will
6467 * put this notification up. If we attempt to connect to a network or
6468 * the open network(s) disappear, we remove the notification. When we
6469 * show the notification, we will not show it again for
6470 * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time.
6471 */
6472 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
6473 "wifi_networks_available_notification_on";
6474 /**
6475 * {@hide}
6476 */
6477 public static final String WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON =
6478 "wimax_networks_available_notification_on";
6479
6480 /**
6481 * Delay (in seconds) before repeating the Wi-Fi networks available notification.
6482 * Connecting to a network will reset the timer.
6483 */
6484 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
6485 "wifi_networks_available_repeat_delay";
6486
6487 /**
Robert Greenwalt3ea0c992013-10-03 21:13:49 +00006488 * 802.11 country code in ISO 3166 format
6489 * @hide
6490 */
6491 public static final String WIFI_COUNTRY_CODE = "wifi_country_code";
6492
6493 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006494 * The interval in milliseconds to issue wake up scans when wifi needs
6495 * to connect. This is necessary to connect to an access point when
6496 * device is on the move and the screen is off.
6497 * @hide
6498 */
6499 public static final String WIFI_FRAMEWORK_SCAN_INTERVAL_MS =
6500 "wifi_framework_scan_interval_ms";
6501
6502 /**
6503 * The interval in milliseconds after which Wi-Fi is considered idle.
6504 * When idle, it is possible for the device to be switched from Wi-Fi to
6505 * the mobile data network.
6506 * @hide
6507 */
6508 public static final String WIFI_IDLE_MS = "wifi_idle_ms";
6509
6510 /**
6511 * When the number of open networks exceeds this number, the
6512 * least-recently-used excess networks will be removed.
6513 */
6514 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept";
6515
6516 /**
6517 * Whether the Wi-Fi should be on. Only the Wi-Fi service should touch this.
6518 */
6519 public static final String WIFI_ON = "wifi_on";
6520
6521 /**
Irfan Sheriff11aefad2013-03-06 07:57:41 -08006522 * Setting to allow scans to be enabled even wifi is turned off for connectivity.
6523 * @hide
6524 */
6525 public static final String WIFI_SCAN_ALWAYS_AVAILABLE =
6526 "wifi_scan_always_enabled";
6527
6528 /**
Wei Wangd91f1932015-03-19 15:09:56 -07006529 * Settings to allow BLE scans to be enabled even when Bluetooth is turned off for
6530 * connectivity.
6531 * @hide
6532 */
6533 public static final String BLE_SCAN_ALWAYS_AVAILABLE =
6534 "ble_scan_always_enabled";
6535
6536 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006537 * Used to save the Wifi_ON state prior to tethering.
6538 * This state will be checked to restore Wifi after
6539 * the user turns off tethering.
6540 *
6541 * @hide
6542 */
6543 public static final String WIFI_SAVED_STATE = "wifi_saved_state";
6544
6545 /**
6546 * The interval in milliseconds to scan as used by the wifi supplicant
6547 * @hide
6548 */
6549 public static final String WIFI_SUPPLICANT_SCAN_INTERVAL_MS =
6550 "wifi_supplicant_scan_interval_ms";
6551
vandwalle7c3606c2014-03-31 19:12:07 -07006552 /**
6553 * whether frameworks handles wifi auto-join
6554 * @hide
6555 */
6556 public static final String WIFI_ENHANCED_AUTO_JOIN =
6557 "wifi_enhanced_auto_join";
6558
6559 /**
6560 * whether settings show RSSI
6561 * @hide
6562 */
6563 public static final String WIFI_NETWORK_SHOW_RSSI =
6564 "wifi_network_show_rssi";
6565
6566 /**
Irfan Sheriff3809f502012-09-17 16:04:57 -07006567 * The interval in milliseconds to scan at supplicant when p2p is connected
6568 * @hide
6569 */
6570 public static final String WIFI_SCAN_INTERVAL_WHEN_P2P_CONNECTED_MS =
6571 "wifi_scan_interval_p2p_connected_ms";
6572
6573 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006574 * Whether the Wi-Fi watchdog is enabled.
6575 */
6576 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
6577
6578 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006579 * Setting to turn off poor network avoidance on Wi-Fi. Feature is enabled by default and
6580 * the setting needs to be set to 0 to disable it.
6581 * @hide
6582 */
6583 public static final String WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED =
6584 "wifi_watchdog_poor_network_test_enabled";
6585
6586 /**
6587 * Setting to turn on suspend optimizations at screen off on Wi-Fi. Enabled by default and
6588 * needs to be set to 0 to disable it.
6589 * @hide
6590 */
6591 public static final String WIFI_SUSPEND_OPTIMIZATIONS_ENABLED =
6592 "wifi_suspend_optimizations_enabled";
6593
6594 /**
6595 * The maximum number of times we will retry a connection to an access
6596 * point for which we have failed in acquiring an IP address from DHCP.
6597 * A value of N means that we will make N+1 connection attempts in all.
6598 */
6599 public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count";
6600
6601 /**
6602 * Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile
6603 * data connectivity to be established after a disconnect from Wi-Fi.
6604 */
6605 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
6606 "wifi_mobile_data_transition_wakelock_timeout_ms";
6607
6608 /**
6609 * The operational wifi frequency band
6610 * Set to one of {@link WifiManager#WIFI_FREQUENCY_BAND_AUTO},
6611 * {@link WifiManager#WIFI_FREQUENCY_BAND_5GHZ} or
6612 * {@link WifiManager#WIFI_FREQUENCY_BAND_2GHZ}
6613 *
6614 * @hide
6615 */
6616 public static final String WIFI_FREQUENCY_BAND = "wifi_frequency_band";
6617
6618 /**
6619 * The Wi-Fi peer-to-peer device name
6620 * @hide
6621 */
6622 public static final String WIFI_P2P_DEVICE_NAME = "wifi_p2p_device_name";
6623
6624 /**
Robert Greenwaltc12783a2013-05-16 12:48:20 -07006625 * The min time between wifi disable and wifi enable
6626 * @hide
6627 */
6628 public static final String WIFI_REENABLE_DELAY_MS = "wifi_reenable_delay";
6629
6630 /**
Jeff Davidsona20ca67d2014-12-16 11:48:54 -08006631 * Timeout for ephemeral networks when all known BSSIDs go out of range. We will disconnect
6632 * from an ephemeral network if there is no BSSID for that network with a non-null score that
6633 * has been seen in this time period.
6634 *
6635 * If this is less than or equal to zero, we use a more conservative behavior and only check
6636 * for a non-null score from the currently connected or target BSSID.
6637 * @hide
6638 */
6639 public static final String WIFI_EPHEMERAL_OUT_OF_RANGE_TIMEOUT_MS =
6640 "wifi_ephemeral_out_of_range_timeout_ms";
6641
6642 /**
Christopher Tatec868b642012-09-12 17:41:04 -07006643 * The number of milliseconds to delay when checking for data stalls during
6644 * non-aggressive detection. (screen is turned off.)
6645 * @hide
6646 */
6647 public static final String DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS =
6648 "data_stall_alarm_non_aggressive_delay_in_ms";
6649
6650 /**
6651 * The number of milliseconds to delay when checking for data stalls during
6652 * aggressive detection. (screen on or suspected data stall)
6653 * @hide
6654 */
6655 public static final String DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS =
6656 "data_stall_alarm_aggressive_delay_in_ms";
6657
6658 /**
Wink Savillece1e3792013-09-03 16:41:44 -07006659 * The number of milliseconds to allow the provisioning apn to remain active
6660 * @hide
6661 */
6662 public static final String PROVISIONING_APN_ALARM_DELAY_IN_MS =
6663 "provisioning_apn_alarm_delay_in_ms";
6664
6665 /**
Christopher Tatec868b642012-09-12 17:41:04 -07006666 * The interval in milliseconds at which to check gprs registration
6667 * after the first registration mismatch of gprs and voice service,
6668 * to detect possible data network registration problems.
6669 *
6670 * @hide
6671 */
6672 public static final String GPRS_REGISTER_CHECK_PERIOD_MS =
6673 "gprs_register_check_period_ms";
6674
6675 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006676 * Nonzero causes Log.wtf() to crash.
6677 * @hide
6678 */
6679 public static final String WTF_IS_FATAL = "wtf_is_fatal";
6680
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07006681 /**
6682 * Ringer mode. This is used internally, changing this value will not
6683 * change the ringer mode. See AudioManager.
6684 */
6685 public static final String MODE_RINGER = "mode_ringer";
Christopher Tate06efb532012-08-24 15:29:27 -07006686
Jeff Brownd4935962012-09-25 13:27:20 -07006687 /**
6688 * Overlay display devices setting.
6689 * The associated value is a specially formatted string that describes the
6690 * size and density of simulated secondary display devices.
6691 * <p>
6692 * Format: {width}x{height}/{dpi};...
6693 * </p><p>
6694 * Example:
6695 * <ul>
6696 * <li><code>1280x720/213</code>: make one overlay that is 1280x720 at 213dpi.</li>
6697 * <li><code>1920x1080/320;1280x720/213</code>: make two overlays, the first
6698 * at 1080p and the second at 720p.</li>
6699 * <li>If the value is empty, then no overlay display devices are created.</li>
6700 * </ul></p>
6701 *
6702 * @hide
6703 */
6704 public static final String OVERLAY_DISPLAY_DEVICES = "overlay_display_devices";
Christopher Tate06efb532012-08-24 15:29:27 -07006705
Jeff Sharkey625239a2012-09-26 22:03:49 -07006706 /**
6707 * Threshold values for the duration and level of a discharge cycle,
6708 * under which we log discharge cycle info.
6709 *
6710 * @hide
6711 */
6712 public static final String
6713 BATTERY_DISCHARGE_DURATION_THRESHOLD = "battery_discharge_duration_threshold";
6714
6715 /** @hide */
6716 public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold";
6717
6718 /**
6719 * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR
6720 * intents on application crashes and ANRs. If this is disabled, the
6721 * crash/ANR dialog will never display the "Report" button.
6722 * <p>
6723 * Type: int (0 = disallow, 1 = allow)
6724 *
6725 * @hide
6726 */
6727 public static final String SEND_ACTION_APP_ERROR = "send_action_app_error";
6728
6729 /**
6730 * Maximum age of entries kept by {@link DropBoxManager}.
6731 *
6732 * @hide
6733 */
6734 public static final String DROPBOX_AGE_SECONDS = "dropbox_age_seconds";
6735
6736 /**
6737 * Maximum number of entry files which {@link DropBoxManager} will keep
6738 * around.
6739 *
6740 * @hide
6741 */
6742 public static final String DROPBOX_MAX_FILES = "dropbox_max_files";
6743
6744 /**
6745 * Maximum amount of disk space used by {@link DropBoxManager} no matter
6746 * what.
6747 *
6748 * @hide
6749 */
6750 public static final String DROPBOX_QUOTA_KB = "dropbox_quota_kb";
6751
6752 /**
6753 * Percent of free disk (excluding reserve) which {@link DropBoxManager}
6754 * will use.
6755 *
6756 * @hide
6757 */
6758 public static final String DROPBOX_QUOTA_PERCENT = "dropbox_quota_percent";
6759
6760 /**
6761 * Percent of total disk which {@link DropBoxManager} will never dip
6762 * into.
6763 *
6764 * @hide
6765 */
6766 public static final String DROPBOX_RESERVE_PERCENT = "dropbox_reserve_percent";
6767
6768 /**
6769 * Prefix for per-tag dropbox disable/enable settings.
6770 *
6771 * @hide
6772 */
6773 public static final String DROPBOX_TAG_PREFIX = "dropbox:";
6774
6775 /**
6776 * Lines of logcat to include with system crash/ANR/etc. reports, as a
6777 * prefix of the dropbox tag of the report type. For example,
6778 * "logcat_for_system_server_anr" controls the lines of logcat captured
6779 * with system server ANR reports. 0 to disable.
6780 *
6781 * @hide
6782 */
6783 public static final String ERROR_LOGCAT_PREFIX = "logcat_for_";
6784
6785 /**
6786 * The interval in minutes after which the amount of free storage left
6787 * on the device is logged to the event log
6788 *
6789 * @hide
6790 */
6791 public static final String SYS_FREE_STORAGE_LOG_INTERVAL = "sys_free_storage_log_interval";
6792
6793 /**
6794 * Threshold for the amount of change in disk free space required to
6795 * report the amount of free space. Used to prevent spamming the logs
6796 * when the disk free space isn't changing frequently.
6797 *
6798 * @hide
6799 */
6800 public static final String
6801 DISK_FREE_CHANGE_REPORTING_THRESHOLD = "disk_free_change_reporting_threshold";
6802
6803 /**
6804 * Minimum percentage of free storage on the device that is used to
6805 * determine if the device is running low on storage. The default is 10.
6806 * <p>
6807 * Say this value is set to 10, the device is considered running low on
6808 * storage if 90% or more of the device storage is filled up.
6809 *
6810 * @hide
6811 */
6812 public static final String
6813 SYS_STORAGE_THRESHOLD_PERCENTAGE = "sys_storage_threshold_percentage";
6814
6815 /**
6816 * Maximum byte size of the low storage threshold. This is to ensure
6817 * that {@link #SYS_STORAGE_THRESHOLD_PERCENTAGE} does not result in an
6818 * overly large threshold for large storage devices. Currently this must
6819 * be less than 2GB. This default is 500MB.
6820 *
6821 * @hide
6822 */
6823 public static final String
6824 SYS_STORAGE_THRESHOLD_MAX_BYTES = "sys_storage_threshold_max_bytes";
6825
6826 /**
6827 * Minimum bytes of free storage on the device before the data partition
6828 * is considered full. By default, 1 MB is reserved to avoid system-wide
6829 * SQLite disk full exceptions.
6830 *
6831 * @hide
6832 */
6833 public static final String
6834 SYS_STORAGE_FULL_THRESHOLD_BYTES = "sys_storage_full_threshold_bytes";
6835
6836 /**
6837 * The maximum reconnect delay for short network outages or when the
6838 * network is suspended due to phone use.
6839 *
6840 * @hide
6841 */
6842 public static final String
6843 SYNC_MAX_RETRY_DELAY_IN_SECONDS = "sync_max_retry_delay_in_seconds";
6844
6845 /**
6846 * The number of milliseconds to delay before sending out
Erik Kline8f29dcf2014-12-08 16:25:20 +09006847 * {@link ConnectivityManager#CONNECTIVITY_ACTION} broadcasts. Ignored.
Jeff Sharkey625239a2012-09-26 22:03:49 -07006848 *
6849 * @hide
6850 */
6851 public static final String CONNECTIVITY_CHANGE_DELAY = "connectivity_change_delay";
6852
Vinit Deshapnde1f12cb52013-08-21 13:09:01 -07006853
6854 /**
6855 * Network sampling interval, in seconds. We'll generate link information
6856 * about bytes/packets sent and error rates based on data sampled in this interval
6857 *
6858 * @hide
6859 */
6860
6861 public static final String CONNECTIVITY_SAMPLING_INTERVAL_IN_SECONDS =
6862 "connectivity_sampling_interval_in_seconds";
6863
Jeff Sharkey625239a2012-09-26 22:03:49 -07006864 /**
Jason Monk602b2322013-07-03 17:04:33 -04006865 * The series of successively longer delays used in retrying to download PAC file.
6866 * Last delay is used between successful PAC downloads.
6867 *
6868 * @hide
6869 */
6870 public static final String PAC_CHANGE_DELAY = "pac_change_delay";
6871
6872 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07006873 * Setting to turn off captive portal detection. Feature is enabled by
6874 * default and the setting needs to be set to 0 to disable it.
6875 *
6876 * @hide
6877 */
6878 public static final String
6879 CAPTIVE_PORTAL_DETECTION_ENABLED = "captive_portal_detection_enabled";
6880
6881 /**
6882 * The server used for captive portal detection upon a new conection. A
6883 * 204 response code from the server is used for validation.
6884 *
6885 * @hide
6886 */
6887 public static final String CAPTIVE_PORTAL_SERVER = "captive_portal_server";
6888
6889 /**
6890 * Whether network service discovery is enabled.
6891 *
6892 * @hide
6893 */
6894 public static final String NSD_ON = "nsd_on";
6895
6896 /**
6897 * Let user pick default install location.
6898 *
6899 * @hide
6900 */
6901 public static final String SET_INSTALL_LOCATION = "set_install_location";
6902
6903 /**
6904 * Default install location value.
6905 * 0 = auto, let system decide
6906 * 1 = internal
6907 * 2 = sdcard
6908 * @hide
6909 */
6910 public static final String DEFAULT_INSTALL_LOCATION = "default_install_location";
6911
6912 /**
6913 * ms during which to consume extra events related to Inet connection
6914 * condition after a transtion to fully-connected
6915 *
6916 * @hide
6917 */
6918 public static final String
6919 INET_CONDITION_DEBOUNCE_UP_DELAY = "inet_condition_debounce_up_delay";
6920
6921 /**
6922 * ms during which to consume extra events related to Inet connection
6923 * condtion after a transtion to partly-connected
6924 *
6925 * @hide
6926 */
6927 public static final String
6928 INET_CONDITION_DEBOUNCE_DOWN_DELAY = "inet_condition_debounce_down_delay";
6929
6930 /** {@hide} */
6931 public static final String
6932 READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT = "read_external_storage_enforced_default";
6933
6934 /**
6935 * Host name and port for global http proxy. Uses ':' seperator for
6936 * between host and port.
6937 */
6938 public static final String HTTP_PROXY = "http_proxy";
6939
6940 /**
6941 * Host name for global http proxy. Set via ConnectivityManager.
6942 *
6943 * @hide
6944 */
6945 public static final String GLOBAL_HTTP_PROXY_HOST = "global_http_proxy_host";
6946
6947 /**
6948 * Integer host port for global http proxy. Set via ConnectivityManager.
6949 *
6950 * @hide
6951 */
6952 public static final String GLOBAL_HTTP_PROXY_PORT = "global_http_proxy_port";
6953
6954 /**
6955 * Exclusion list for global proxy. This string contains a list of
6956 * comma-separated domains where the global proxy does not apply.
6957 * Domains should be listed in a comma- separated list. Example of
6958 * acceptable formats: ".domain1.com,my.domain2.com" Use
6959 * ConnectivityManager to set/get.
6960 *
6961 * @hide
6962 */
6963 public static final String
6964 GLOBAL_HTTP_PROXY_EXCLUSION_LIST = "global_http_proxy_exclusion_list";
6965
6966 /**
Jason Monk602b2322013-07-03 17:04:33 -04006967 * The location PAC File for the proxy.
6968 * @hide
6969 */
6970 public static final String
6971 GLOBAL_HTTP_PROXY_PAC = "global_proxy_pac_url";
6972
6973 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07006974 * Enables the UI setting to allow the user to specify the global HTTP
6975 * proxy and associated exclusion list.
6976 *
6977 * @hide
6978 */
6979 public static final String SET_GLOBAL_HTTP_PROXY = "set_global_http_proxy";
6980
6981 /**
6982 * Setting for default DNS in case nobody suggests one
6983 *
6984 * @hide
6985 */
6986 public static final String DEFAULT_DNS_SERVER = "default_dns_server";
6987
Jeff Sharkey0ac10282012-10-01 12:50:22 -07006988 /** {@hide} */
6989 public static final String
6990 BLUETOOTH_HEADSET_PRIORITY_PREFIX = "bluetooth_headset_priority_";
6991 /** {@hide} */
6992 public static final String
6993 BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX = "bluetooth_a2dp_sink_priority_";
6994 /** {@hide} */
6995 public static final String
6996 BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX = "bluetooth_input_device_priority_";
Kim Schulz0d376052013-08-22 11:18:02 +02006997 /** {@hide} */
6998 public static final String
6999 BLUETOOTH_MAP_PRIORITY_PREFIX = "bluetooth_map_priority_";
Casper Bonde2a5f6082015-03-19 10:36:45 +01007000 /** {@hide} */
7001 public static final String
7002 BLUETOOTH_SAP_PRIORITY_PREFIX = "bluetooth_sap_priority_";
Jeff Sharkey0ac10282012-10-01 12:50:22 -07007003
7004 /**
7005 * Get the key that retrieves a bluetooth headset's priority.
7006 * @hide
7007 */
7008 public static final String getBluetoothHeadsetPriorityKey(String address) {
Elliott Hughescb64d432013-08-02 10:00:44 -07007009 return BLUETOOTH_HEADSET_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
Jeff Sharkey0ac10282012-10-01 12:50:22 -07007010 }
7011
7012 /**
7013 * Get the key that retrieves a bluetooth a2dp sink's priority.
7014 * @hide
7015 */
7016 public static final String getBluetoothA2dpSinkPriorityKey(String address) {
Elliott Hughescb64d432013-08-02 10:00:44 -07007017 return BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
Jeff Sharkey0ac10282012-10-01 12:50:22 -07007018 }
7019
7020 /**
7021 * Get the key that retrieves a bluetooth Input Device's priority.
7022 * @hide
7023 */
7024 public static final String getBluetoothInputDevicePriorityKey(String address) {
Elliott Hughescb64d432013-08-02 10:00:44 -07007025 return BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
Jeff Sharkey0ac10282012-10-01 12:50:22 -07007026 }
7027
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07007028 /**
Kim Schulz0d376052013-08-22 11:18:02 +02007029 * Get the key that retrieves a bluetooth map priority.
7030 * @hide
7031 */
7032 public static final String getBluetoothMapPriorityKey(String address) {
7033 return BLUETOOTH_MAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
7034 }
Casper Bonde2a5f6082015-03-19 10:36:45 +01007035
7036 /**
7037 * Get the key that retrieves a bluetooth map priority.
7038 * @hide
7039 */
7040 public static final String getBluetoothSapPriorityKey(String address) {
7041 return BLUETOOTH_SAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
7042 }
7043
Kim Schulz0d376052013-08-22 11:18:02 +02007044 /**
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07007045 * Scaling factor for normal window animations. Setting to 0 will
7046 * disable window animations.
7047 */
7048 public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale";
7049
7050 /**
7051 * Scaling factor for activity transition animations. Setting to 0 will
7052 * disable window animations.
7053 */
7054 public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale";
7055
7056 /**
7057 * Scaling factor for Animator-based animations. This affects both the
7058 * start delay and duration of all such animations. Setting to 0 will
7059 * cause animations to end immediately. The default value is 1.
7060 */
7061 public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale";
7062
7063 /**
7064 * Scaling factor for normal window animations. Setting to 0 will
7065 * disable window animations.
7066 *
7067 * @hide
7068 */
7069 public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations";
7070
7071 /**
7072 * If 0, the compatibility mode is off for all applications.
7073 * If 1, older applications run under compatibility mode.
7074 * TODO: remove this settings before code freeze (bug/1907571)
7075 * @hide
7076 */
7077 public static final String COMPATIBILITY_MODE = "compatibility_mode";
7078
7079 /**
7080 * CDMA only settings
7081 * Emergency Tone 0 = Off
7082 * 1 = Alert
7083 * 2 = Vibrate
7084 * @hide
7085 */
7086 public static final String EMERGENCY_TONE = "emergency_tone";
7087
7088 /**
7089 * CDMA only settings
7090 * Whether the auto retry is enabled. The value is
7091 * boolean (1 or 0).
7092 * @hide
7093 */
7094 public static final String CALL_AUTO_RETRY = "call_auto_retry";
7095
7096 /**
Sungmin Choie099ab12014-06-09 14:45:51 +09007097 * See RIL_PreferredNetworkType in ril.h
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07007098 * @hide
7099 */
7100 public static final String PREFERRED_NETWORK_MODE =
7101 "preferred_network_mode";
7102
7103 /**
Junda Liubbdc1c02014-11-07 11:18:02 -08007104 * Setting to 1 will hide carrier network settings.
7105 * Default is 0.
Junda Liubbdc1c02014-11-07 11:18:02 -08007106 */
7107 public static final String HIDE_CARRIER_NETWORK_SETTINGS =
7108 "hide_carrier_network_settings";
7109
7110 /**
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07007111 * Name of an application package to be debugged.
7112 */
7113 public static final String DEBUG_APP = "debug_app";
7114
7115 /**
7116 * If 1, when launching DEBUG_APP it will wait for the debugger before
7117 * starting user code. If 0, it will run normally.
7118 */
7119 public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger";
7120
7121 /**
7122 * Control whether the process CPU usage meter should be shown.
7123 */
7124 public static final String SHOW_PROCESSES = "show_processes";
7125
7126 /**
Ruchi Kandoi62b8a492014-04-17 18:01:40 -07007127 * If 1 low power mode is enabled.
7128 * @hide
7129 */
7130 public static final String LOW_POWER_MODE = "low_power";
7131
John Spurlockf8f524c2014-06-10 14:47:29 -04007132 /**
7133 * Battery level [1-99] at which low power mode automatically turns on.
Dianne Hackborn14272302014-06-10 23:13:02 -07007134 * If 0, it will not automatically turn on.
John Spurlockf8f524c2014-06-10 14:47:29 -04007135 * @hide
7136 */
7137 public static final String LOW_POWER_MODE_TRIGGER_LEVEL = "low_power_trigger_level";
7138
Ruchi Kandoi62b8a492014-04-17 18:01:40 -07007139 /**
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07007140 * If 1, the activity manager will aggressively finish activities and
7141 * processes as soon as they are no longer needed. If 0, the normal
7142 * extended lifetime is used.
7143 */
Dianne Hackborn89ad4562014-08-24 16:45:38 -07007144 public static final String ALWAYS_FINISH_ACTIVITIES = "always_finish_activities";
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07007145
Christopher Tate66488d62012-10-02 11:58:01 -07007146 /**
Eric Laurent7ee1e4f2012-10-26 18:11:21 -07007147 * Use Dock audio output for media:
7148 * 0 = disabled
7149 * 1 = enabled
7150 * @hide
7151 */
7152 public static final String DOCK_AUDIO_MEDIA_ENABLED = "dock_audio_media_enabled";
7153
7154 /**
Eric Laurent05274f32012-11-29 12:48:18 -08007155 * Persisted safe headphone volume management state by AudioService
7156 * @hide
7157 */
7158 public static final String AUDIO_SAFE_VOLUME_STATE = "audio_safe_volume_state";
7159
7160 /**
Geremy Condraa0735112013-03-26 21:49:26 -07007161 * URL for tzinfo (time zone) updates
7162 * @hide
7163 */
7164 public static final String TZINFO_UPDATE_CONTENT_URL = "tzinfo_content_url";
7165
7166 /**
7167 * URL for tzinfo (time zone) update metadata
7168 * @hide
7169 */
7170 public static final String TZINFO_UPDATE_METADATA_URL = "tzinfo_metadata_url";
7171
7172 /**
7173 * URL for selinux (mandatory access control) updates
7174 * @hide
7175 */
7176 public static final String SELINUX_UPDATE_CONTENT_URL = "selinux_content_url";
7177
7178 /**
7179 * URL for selinux (mandatory access control) update metadata
7180 * @hide
7181 */
7182 public static final String SELINUX_UPDATE_METADATA_URL = "selinux_metadata_url";
7183
7184 /**
7185 * URL for sms short code updates
7186 * @hide
7187 */
7188 public static final String SMS_SHORT_CODES_UPDATE_CONTENT_URL =
7189 "sms_short_codes_content_url";
7190
7191 /**
7192 * URL for sms short code update metadata
7193 * @hide
7194 */
7195 public static final String SMS_SHORT_CODES_UPDATE_METADATA_URL =
7196 "sms_short_codes_metadata_url";
7197
7198 /**
7199 * URL for cert pinlist updates
7200 * @hide
7201 */
7202 public static final String CERT_PIN_UPDATE_CONTENT_URL = "cert_pin_content_url";
7203
7204 /**
7205 * URL for cert pinlist updates
7206 * @hide
7207 */
7208 public static final String CERT_PIN_UPDATE_METADATA_URL = "cert_pin_metadata_url";
7209
Geremy Condra757ee522013-03-29 16:39:45 -07007210 /**
Ben Gruver633dc9b2013-04-04 12:05:49 -07007211 * URL for intent firewall updates
7212 * @hide
7213 */
7214 public static final String INTENT_FIREWALL_UPDATE_CONTENT_URL =
7215 "intent_firewall_content_url";
7216
7217 /**
7218 * URL for intent firewall update metadata
7219 * @hide
7220 */
7221 public static final String INTENT_FIREWALL_UPDATE_METADATA_URL =
7222 "intent_firewall_metadata_url";
7223
7224 /**
Geremy Condra4e7f7e82013-03-26 21:09:01 -07007225 * SELinux enforcement status. If 0, permissive; if 1, enforcing.
7226 * @hide
7227 */
7228 public static final String SELINUX_STATUS = "selinux_status";
7229
Geremy Condraa0735112013-03-26 21:49:26 -07007230 /**
Amith Yamasanid8415f42013-08-07 20:15:10 -07007231 * Developer setting to force RTL layout.
7232 * @hide
7233 */
7234 public static final String DEVELOPMENT_FORCE_RTL = "debug.force_rtl";
7235
7236 /**
Daniel Sandlerdea64622013-09-23 16:05:57 -04007237 * Milliseconds after screen-off after which low battery sounds will be silenced.
7238 *
7239 * If zero, battery sounds will always play.
7240 * Defaults to @integer/def_low_battery_sound_timeout in SettingsProvider.
7241 *
7242 * @hide
7243 */
7244 public static final String LOW_BATTERY_SOUND_TIMEOUT = "low_battery_sound_timeout";
7245
7246 /**
Evan Charltoncc7b0432014-01-14 14:47:11 -08007247 * Milliseconds to wait before bouncing Wi-Fi after settings is restored. Note that after
Dianne Hackborna3fb40d2014-08-12 15:06:50 -07007248 * the caller is done with this, they should call {@link ContentResolver#delete} to
Evan Charltoncc7b0432014-01-14 14:47:11 -08007249 * clean up any value that they may have written.
7250 *
7251 * @hide
7252 */
7253 public static final String WIFI_BOUNCE_DELAY_OVERRIDE_MS = "wifi_bounce_delay_override_ms";
7254
John Spurlockc6d1c602014-01-17 15:22:06 -05007255 /**
7256 * Defines global runtime overrides to window policy.
7257 *
Jorim Jaggib10e33f2015-02-04 21:57:40 +01007258 * See {@link com.android.server.policy.PolicyControl} for value format.
John Spurlockc6d1c602014-01-17 15:22:06 -05007259 *
7260 * @hide
7261 */
7262 public static final String POLICY_CONTROL = "policy_control";
Evan Charltoncc7b0432014-01-14 14:47:11 -08007263
7264 /**
John Spurlockae641c92014-06-30 18:11:40 -04007265 * Defines global zen mode. ZEN_MODE_OFF, ZEN_MODE_IMPORTANT_INTERRUPTIONS,
7266 * or ZEN_MODE_NO_INTERRUPTIONS.
John Spurlocke677d712014-02-13 12:52:19 -05007267 *
7268 * @hide
7269 */
7270 public static final String ZEN_MODE = "zen_mode";
7271
7272 /** @hide */ public static final int ZEN_MODE_OFF = 0;
John Spurlockae641c92014-06-30 18:11:40 -04007273 /** @hide */ public static final int ZEN_MODE_IMPORTANT_INTERRUPTIONS = 1;
7274 /** @hide */ public static final int ZEN_MODE_NO_INTERRUPTIONS = 2;
John Spurlock4f1163c2015-04-02 17:41:21 -04007275 /** @hide */ public static final int ZEN_MODE_ALARMS = 3;
John Spurlocke677d712014-02-13 12:52:19 -05007276
7277 /** @hide */ public static String zenModeToString(int mode) {
John Spurlockae641c92014-06-30 18:11:40 -04007278 if (mode == ZEN_MODE_IMPORTANT_INTERRUPTIONS) return "ZEN_MODE_IMPORTANT_INTERRUPTIONS";
John Spurlock4f1163c2015-04-02 17:41:21 -04007279 if (mode == ZEN_MODE_ALARMS) return "ZEN_MODE_ALARMS";
John Spurlockae641c92014-06-30 18:11:40 -04007280 if (mode == ZEN_MODE_NO_INTERRUPTIONS) return "ZEN_MODE_NO_INTERRUPTIONS";
7281 return "ZEN_MODE_OFF";
John Spurlocke677d712014-02-13 12:52:19 -05007282 }
7283
John Spurlockb2278d62015-04-07 12:47:12 -04007284 /** @hide */ public static boolean isValidZenMode(int value) {
7285 switch (value) {
7286 case Global.ZEN_MODE_OFF:
7287 case Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS:
7288 case Global.ZEN_MODE_ALARMS:
7289 case Global.ZEN_MODE_NO_INTERRUPTIONS:
7290 return true;
7291 default:
7292 return false;
7293 }
7294 }
7295
John Spurlocke677d712014-02-13 12:52:19 -05007296 /**
John Spurlock056c5192014-04-20 21:52:01 -04007297 * Opaque value, changes when persisted zen mode configuration changes.
7298 *
7299 * @hide
7300 */
7301 public static final String ZEN_MODE_CONFIG_ETAG = "zen_mode_config_etag";
7302
7303 /**
Chris Wren7bd241232014-02-28 16:25:05 -05007304 * Defines global heads up toggle. One of HEADS_UP_OFF, HEADS_UP_ON.
7305 *
7306 * @hide
7307 */
Chris Wren10d82df2014-03-01 10:34:51 -05007308 public static final String HEADS_UP_NOTIFICATIONS_ENABLED =
7309 "heads_up_notifications_enabled";
Chris Wren7bd241232014-02-28 16:25:05 -05007310
7311 /** @hide */ public static final int HEADS_UP_OFF = 0;
7312 /** @hide */ public static final int HEADS_UP_ON = 1;
7313
7314 /**
Jerome Poichet147b4d72014-05-12 18:13:27 -07007315 * The name of the device
7316 *
7317 * @hide
7318 */
7319 public static final String DEVICE_NAME = "device_name";
7320
7321 /**
Amith Yamasani1e9c2182014-06-11 17:25:51 -07007322 * Whether it should be possible to create a guest user on the device.
7323 * <p>
7324 * Type: int (0 for disabled, 1 for enabled)
7325 * @hide
7326 */
7327 public static final String GUEST_USER_ENABLED = "guest_user_enabled";
7328
7329 /**
Jeff Davidson56f9f732014-08-14 16:47:23 -07007330 * Whether the NetworkScoringService has been first initialized.
7331 * <p>
7332 * Type: int (0 for false, 1 for true)
7333 * @hide
7334 */
7335 public static final String NETWORK_SCORING_PROVISIONED = "network_scoring_provisioned";
7336
7337 /**
Jim Miller6848dc82014-10-13 18:51:53 -07007338 * Whether the user wants to be prompted for password to decrypt the device on boot.
7339 * This only matters if the storage is encrypted.
7340 * <p>
7341 * Type: int (0 for false, 1 for true)
7342 * @hide
7343 */
7344 public static final String REQUIRE_PASSWORD_TO_DECRYPT = "require_password_to_decrypt";
7345
7346 /**
Libin.Tang@motorola.com0499bb52014-10-10 14:55:57 -05007347 * Whether the Volte/VT is enabled
7348 * <p>
7349 * Type: int (0 for false, 1 for true)
7350 * @hide
7351 */
Etan Cohene41a9cf2014-10-22 10:50:46 -07007352 public static final String ENHANCED_4G_MODE_ENABLED = "volte_vt_enabled";
Libin.Tang@motorola.com0499bb52014-10-10 14:55:57 -05007353
7354 /**
Etan Cohen9c8f21b2014-12-23 15:02:19 -08007355 * Whether WFC is enabled
7356 * <p>
7357 * Type: int (0 for false, 1 for true)
7358 *
7359 * @hide
7360 */
7361 public static final String WFC_IMS_ENABLED = "wfc_ims_enabled";
7362
7363 /**
7364 * WFC Mode.
7365 * <p>
7366 * Type: int - 2=Wi-Fi preferred, 1=Cellular preferred, 0=Wi-Fi only
7367 *
7368 * @hide
7369 */
7370 public static final String WFC_IMS_MODE = "wfc_ims_mode";
7371
7372 /**
7373 * Whether WFC roaming is enabled
7374 * <p>
7375 * Type: int (0 for false, 1 for true)
7376 *
7377 * @hide
7378 */
7379 public static final String WFC_IMS_ROAMING_ENABLED = "wfc_ims_roaming_enabled";
7380
7381 /**
Etan Cohen7ab0ad12014-11-24 11:18:01 -08007382 * Global override to disable VoLTE (independent of user setting)
7383 * <p>
7384 * Type: int (1 for disable VoLTE, 0 to use user configuration)
7385 * @hide
7386 */
7387 public static final String VOLTE_FEATURE_DISABLED = "volte_feature_disabled";
7388
7389 /**
Amit Mahajan4fea0922014-11-18 12:56:28 -08007390 * Whether user can enable/disable LTE as a preferred network. A carrier might control
7391 * this via gservices, OMA-DM, carrier app, etc.
7392 * <p>
7393 * Type: int (0 for false, 1 for true)
7394 * @hide
7395 */
7396 public static final String LTE_SERVICE_FORCED = "lte_service_forced";
7397
7398 /**
Christopher Tate66488d62012-10-02 11:58:01 -07007399 * Settings to backup. This is here so that it's in the same place as the settings
7400 * keys and easy to update.
7401 *
7402 * These keys may be mentioned in the SETTINGS_TO_BACKUP arrays in System
7403 * and Secure as well. This is because those tables drive both backup and
7404 * restore, and restore needs to properly whitelist keys that used to live
7405 * in those namespaces. The keys will only actually be backed up / restored
7406 * if they are also mentioned in this table (Global.SETTINGS_TO_BACKUP).
7407 *
7408 * NOTE: Settings are backed up and restored in the order they appear
7409 * in this array. If you have one setting depending on another,
7410 * make sure that they are ordered appropriately.
7411 *
7412 * @hide
7413 */
7414 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate58f41ec2013-01-11 15:40:36 -08007415 BUGREPORT_IN_POWER_MENU,
Christopher Tate66488d62012-10-02 11:58:01 -07007416 STAY_ON_WHILE_PLUGGED_IN,
Christopher Tate66488d62012-10-02 11:58:01 -07007417 AUTO_TIME,
7418 AUTO_TIME_ZONE,
7419 POWER_SOUNDS_ENABLED,
7420 DOCK_SOUNDS_ENABLED,
7421 USB_MASS_STORAGE_ENABLED,
7422 ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED,
7423 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
7424 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY,
Christopher Tate16eb7cd2012-10-09 15:26:30 -07007425 WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED,
Christopher Tate66488d62012-10-02 11:58:01 -07007426 WIFI_NUM_OPEN_NETWORKS_KEPT,
7427 EMERGENCY_TONE,
7428 CALL_AUTO_RETRY,
Amith Yamasani94005242014-10-31 11:35:13 -07007429 DOCK_AUDIO_MEDIA_ENABLED,
7430 LOW_POWER_MODE_TRIGGER_LEVEL
Christopher Tate66488d62012-10-02 11:58:01 -07007431 };
7432
Christopher Tate06efb532012-08-24 15:29:27 -07007433 // Populated lazily, guarded by class object:
Dianne Hackborn139748f2012-09-24 11:36:57 -07007434 private static NameValueCache sNameValueCache = new NameValueCache(
7435 SYS_PROP_SETTING_VERSION,
7436 CONTENT_URI,
7437 CALL_METHOD_GET_GLOBAL,
7438 CALL_METHOD_PUT_GLOBAL);
Christopher Tate06efb532012-08-24 15:29:27 -07007439
Christopher Tateaa036a22014-05-19 16:33:27 -07007440 // Certain settings have been moved from global to the per-user secure namespace
7441 private static final HashSet<String> MOVED_TO_SECURE;
7442 static {
7443 MOVED_TO_SECURE = new HashSet<String>(1);
7444 MOVED_TO_SECURE.add(Settings.Global.INSTALL_NON_MARKET_APPS);
7445 }
7446
Svetoslav683914b2015-01-15 14:22:26 -08007447 /** @hide */
7448 public static void getMovedToSecureSettings(Set<String> outKeySet) {
7449 outKeySet.addAll(MOVED_TO_SECURE);
7450 }
7451
Christopher Tate06efb532012-08-24 15:29:27 -07007452 /**
7453 * Look up a name in the database.
7454 * @param resolver to access the database with
7455 * @param name to look up in the table
7456 * @return the corresponding value, or null if not present
7457 */
Dianne Hackborn139748f2012-09-24 11:36:57 -07007458 public static String getString(ContentResolver resolver, String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07007459 return getStringForUser(resolver, name, UserHandle.myUserId());
7460 }
7461
7462 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -07007463 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -07007464 int userHandle) {
Christopher Tateaa036a22014-05-19 16:33:27 -07007465 if (MOVED_TO_SECURE.contains(name)) {
7466 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
7467 + " to android.provider.Settings.Secure, returning read-only value.");
7468 return Secure.getStringForUser(resolver, name, userHandle);
7469 }
Christopher Tate06efb532012-08-24 15:29:27 -07007470 return sNameValueCache.getStringForUser(resolver, name, userHandle);
7471 }
7472
7473 /**
7474 * Store a name/value pair into the database.
7475 * @param resolver to access the database with
7476 * @param name to store
7477 * @param value to associate with the name
7478 * @return true if the value was set, false on database errors
7479 */
7480 public static boolean putString(ContentResolver resolver,
7481 String name, String value) {
7482 return putStringForUser(resolver, name, value, UserHandle.myUserId());
7483 }
7484
7485 /** @hide */
7486 public static boolean putStringForUser(ContentResolver resolver,
7487 String name, String value, int userHandle) {
Christopher Tate06efb532012-08-24 15:29:27 -07007488 if (LOCAL_LOGV) {
7489 Log.v(TAG, "Global.putString(name=" + name + ", value=" + value
7490 + " for " + userHandle);
7491 }
Christopher Tateaa036a22014-05-19 16:33:27 -07007492 // Global and Secure have the same access policy so we can forward writes
7493 if (MOVED_TO_SECURE.contains(name)) {
7494 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
7495 + " to android.provider.Settings.Secure, value is unchanged.");
7496 return Secure.putStringForUser(resolver, name, value, userHandle);
7497 }
Christopher Tate06efb532012-08-24 15:29:27 -07007498 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
7499 }
7500
7501 /**
7502 * Construct the content URI for a particular name/value pair,
7503 * useful for monitoring changes with a ContentObserver.
7504 * @param name to look up in the table
7505 * @return the corresponding content URI, or null if not present
7506 */
7507 public static Uri getUriFor(String name) {
7508 return getUriFor(CONTENT_URI, name);
7509 }
7510
7511 /**
7512 * Convenience function for retrieving a single secure settings value
7513 * as an integer. Note that internally setting values are always
7514 * stored as strings; this function converts the string to an integer
7515 * for you. The default value will be returned if the setting is
7516 * not defined or not an integer.
7517 *
7518 * @param cr The ContentResolver to access.
7519 * @param name The name of the setting to retrieve.
7520 * @param def Value to return if the setting is not defined.
7521 *
7522 * @return The setting's current value, or 'def' if it is not defined
7523 * or not a valid integer.
7524 */
7525 public static int getInt(ContentResolver cr, String name, int def) {
7526 String v = getString(cr, name);
7527 try {
7528 return v != null ? Integer.parseInt(v) : def;
7529 } catch (NumberFormatException e) {
7530 return def;
7531 }
7532 }
7533
7534 /**
7535 * Convenience function for retrieving a single secure settings value
7536 * as an integer. Note that internally setting values are always
7537 * stored as strings; this function converts the string to an integer
7538 * for you.
7539 * <p>
7540 * This version does not take a default value. If the setting has not
7541 * been set, or the string value is not a number,
7542 * it throws {@link SettingNotFoundException}.
7543 *
7544 * @param cr The ContentResolver to access.
7545 * @param name The name of the setting to retrieve.
7546 *
7547 * @throws SettingNotFoundException Thrown if a setting by the given
7548 * name can't be found or the setting value is not an integer.
7549 *
7550 * @return The setting's current value.
7551 */
7552 public static int getInt(ContentResolver cr, String name)
7553 throws SettingNotFoundException {
7554 String v = getString(cr, name);
7555 try {
7556 return Integer.parseInt(v);
7557 } catch (NumberFormatException e) {
7558 throw new SettingNotFoundException(name);
7559 }
7560 }
7561
7562 /**
7563 * Convenience function for updating a single settings value as an
7564 * integer. This will either create a new entry in the table if the
7565 * given name does not exist, or modify the value of the existing row
7566 * with that name. Note that internally setting values are always
7567 * stored as strings, so this function converts the given value to a
7568 * string before storing it.
7569 *
7570 * @param cr The ContentResolver to access.
7571 * @param name The name of the setting to modify.
7572 * @param value The new value for the setting.
7573 * @return true if the value was set, false on database errors
7574 */
7575 public static boolean putInt(ContentResolver cr, String name, int value) {
7576 return putString(cr, name, Integer.toString(value));
7577 }
7578
7579 /**
7580 * Convenience function for retrieving a single secure settings value
7581 * as a {@code long}. Note that internally setting values are always
7582 * stored as strings; this function converts the string to a {@code long}
7583 * for you. The default value will be returned if the setting is
7584 * not defined or not a {@code long}.
7585 *
7586 * @param cr The ContentResolver to access.
7587 * @param name The name of the setting to retrieve.
7588 * @param def Value to return if the setting is not defined.
7589 *
7590 * @return The setting's current value, or 'def' if it is not defined
7591 * or not a valid {@code long}.
7592 */
7593 public static long getLong(ContentResolver cr, String name, long def) {
7594 String valString = getString(cr, name);
7595 long value;
7596 try {
7597 value = valString != null ? Long.parseLong(valString) : def;
7598 } catch (NumberFormatException e) {
7599 value = def;
7600 }
7601 return value;
7602 }
7603
7604 /**
7605 * Convenience function for retrieving a single secure settings value
7606 * as a {@code long}. Note that internally setting values are always
7607 * stored as strings; this function converts the string to a {@code long}
7608 * for you.
7609 * <p>
7610 * This version does not take a default value. If the setting has not
7611 * been set, or the string value is not a number,
7612 * it throws {@link SettingNotFoundException}.
7613 *
7614 * @param cr The ContentResolver to access.
7615 * @param name The name of the setting to retrieve.
7616 *
7617 * @return The setting's current value.
7618 * @throws SettingNotFoundException Thrown if a setting by the given
7619 * name can't be found or the setting value is not an integer.
7620 */
7621 public static long getLong(ContentResolver cr, String name)
7622 throws SettingNotFoundException {
7623 String valString = getString(cr, name);
7624 try {
7625 return Long.parseLong(valString);
7626 } catch (NumberFormatException e) {
7627 throw new SettingNotFoundException(name);
7628 }
7629 }
7630
7631 /**
7632 * Convenience function for updating a secure settings value as a long
7633 * integer. This will either create a new entry in the table if the
7634 * given name does not exist, or modify the value of the existing row
7635 * with that name. Note that internally setting values are always
7636 * stored as strings, so this function converts the given value to a
7637 * string before storing it.
7638 *
7639 * @param cr The ContentResolver to access.
7640 * @param name The name of the setting to modify.
7641 * @param value The new value for the setting.
7642 * @return true if the value was set, false on database errors
7643 */
7644 public static boolean putLong(ContentResolver cr, String name, long value) {
7645 return putString(cr, name, Long.toString(value));
7646 }
7647
7648 /**
7649 * Convenience function for retrieving a single secure settings value
7650 * as a floating point number. Note that internally setting values are
7651 * always stored as strings; this function converts the string to an
7652 * float for you. The default value will be returned if the setting
7653 * is not defined or not a valid float.
7654 *
7655 * @param cr The ContentResolver to access.
7656 * @param name The name of the setting to retrieve.
7657 * @param def Value to return if the setting is not defined.
7658 *
7659 * @return The setting's current value, or 'def' if it is not defined
7660 * or not a valid float.
7661 */
7662 public static float getFloat(ContentResolver cr, String name, float def) {
7663 String v = getString(cr, name);
7664 try {
7665 return v != null ? Float.parseFloat(v) : def;
7666 } catch (NumberFormatException e) {
7667 return def;
7668 }
7669 }
7670
7671 /**
7672 * Convenience function for retrieving a single secure settings value
7673 * as a float. Note that internally setting values are always
7674 * stored as strings; this function converts the string to a float
7675 * for you.
7676 * <p>
7677 * This version does not take a default value. If the setting has not
7678 * been set, or the string value is not a number,
7679 * it throws {@link SettingNotFoundException}.
7680 *
7681 * @param cr The ContentResolver to access.
7682 * @param name The name of the setting to retrieve.
7683 *
7684 * @throws SettingNotFoundException Thrown if a setting by the given
7685 * name can't be found or the setting value is not a float.
7686 *
7687 * @return The setting's current value.
7688 */
7689 public static float getFloat(ContentResolver cr, String name)
7690 throws SettingNotFoundException {
7691 String v = getString(cr, name);
7692 if (v == null) {
7693 throw new SettingNotFoundException(name);
7694 }
7695 try {
7696 return Float.parseFloat(v);
7697 } catch (NumberFormatException e) {
7698 throw new SettingNotFoundException(name);
7699 }
7700 }
7701
7702 /**
7703 * Convenience function for updating a single settings value as a
7704 * floating point number. This will either create a new entry in the
7705 * table if the given name does not exist, or modify the value of the
7706 * existing row with that name. Note that internally setting values
7707 * are always stored as strings, so this function converts the given
7708 * value to a string before storing it.
7709 *
7710 * @param cr The ContentResolver to access.
7711 * @param name The name of the setting to modify.
7712 * @param value The new value for the setting.
7713 * @return true if the value was set, false on database errors
7714 */
7715 public static boolean putFloat(ContentResolver cr, String name, float value) {
7716 return putString(cr, name, Float.toString(value));
7717 }
Wink Savillefb40dd42014-06-12 17:02:31 -07007718
7719
7720 /**
7721 * Subscription to be used for voice call on a multi sim device. The supported values
7722 * are 0 = SUB1, 1 = SUB2 and etc.
7723 * @hide
7724 */
7725 public static final String MULTI_SIM_VOICE_CALL_SUBSCRIPTION = "multi_sim_voice_call";
7726
7727 /**
7728 * Used to provide option to user to select subscription during dial.
7729 * The supported values are 0 = disable or 1 = enable prompt.
7730 * @hide
7731 */
7732 public static final String MULTI_SIM_VOICE_PROMPT = "multi_sim_voice_prompt";
7733
7734 /**
7735 * Subscription to be used for data call on a multi sim device. The supported values
7736 * are 0 = SUB1, 1 = SUB2 and etc.
7737 * @hide
7738 */
7739 public static final String MULTI_SIM_DATA_CALL_SUBSCRIPTION = "multi_sim_data_call";
7740
7741 /**
7742 * Subscription to be used for SMS on a multi sim device. The supported values
7743 * are 0 = SUB1, 1 = SUB2 and etc.
7744 * @hide
7745 */
7746 public static final String MULTI_SIM_SMS_SUBSCRIPTION = "multi_sim_sms";
7747
7748 /**
7749 * Used to provide option to user to select subscription during send SMS.
7750 * The value 1 - enable, 0 - disable
7751 * @hide
7752 */
7753 public static final String MULTI_SIM_SMS_PROMPT = "multi_sim_sms_prompt";
7754
7755
7756
7757 /** User preferred subscriptions setting.
7758 * This holds the details of the user selected subscription from the card and
7759 * the activation status. Each settings string have the coma separated values
7760 * iccId,appType,appId,activationStatus,3gppIndex,3gpp2Index
7761 * @hide
7762 */
7763 public static final String[] MULTI_SIM_USER_PREFERRED_SUBS = {"user_preferred_sub1",
7764 "user_preferred_sub2","user_preferred_sub3"};
Zheng Fub218ff42015-04-13 16:31:16 -07007765
7766 /**
7767 * Whether to enable new contacts aggregator or not.
7768 * The value 1 - enable, 0 - disable
7769 * @hide
7770 */
7771 public static final String NEW_CONTACT_AGGREGATOR = "new_contact_aggregator";
Zheng Fu31ce78c2015-04-15 16:57:53 -07007772
7773 /**
7774 * Whether to enable contacts metadata syncing or not
7775 * The value 1 - enable, 0 - disable
7776 * @hide
7777 */
7778 public static final String CONTACT_METADATA_SYNC = "contact_metadata_sync";
Christopher Tate06efb532012-08-24 15:29:27 -07007779 }
7780
7781 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007782 * User-defined bookmarks and shortcuts. The target of each bookmark is an
7783 * Intent URL, allowing it to be either a web page or a particular
7784 * application activity.
7785 *
7786 * @hide
7787 */
7788 public static final class Bookmarks implements BaseColumns
7789 {
7790 private static final String TAG = "Bookmarks";
7791
7792 /**
7793 * The content:// style URL for this table
7794 */
7795 public static final Uri CONTENT_URI =
7796 Uri.parse("content://" + AUTHORITY + "/bookmarks");
7797
7798 /**
7799 * The row ID.
7800 * <p>Type: INTEGER</p>
7801 */
7802 public static final String ID = "_id";
7803
7804 /**
7805 * Descriptive name of the bookmark that can be displayed to the user.
7806 * If this is empty, the title should be resolved at display time (use
7807 * {@link #getTitle(Context, Cursor)} any time you want to display the
7808 * title of a bookmark.)
7809 * <P>
7810 * Type: TEXT
7811 * </P>
7812 */
7813 public static final String TITLE = "title";
7814
7815 /**
7816 * Arbitrary string (displayed to the user) that allows bookmarks to be
7817 * organized into categories. There are some special names for
7818 * standard folders, which all start with '@'. The label displayed for
7819 * the folder changes with the locale (via {@link #getLabelForFolder}) but
7820 * the folder name does not change so you can consistently query for
7821 * the folder regardless of the current locale.
7822 *
7823 * <P>Type: TEXT</P>
7824 *
7825 */
7826 public static final String FOLDER = "folder";
7827
7828 /**
7829 * The Intent URL of the bookmark, describing what it points to. This
7830 * value is given to {@link android.content.Intent#getIntent} to create
7831 * an Intent that can be launched.
7832 * <P>Type: TEXT</P>
7833 */
7834 public static final String INTENT = "intent";
7835
7836 /**
7837 * Optional shortcut character associated with this bookmark.
7838 * <P>Type: INTEGER</P>
7839 */
7840 public static final String SHORTCUT = "shortcut";
7841
7842 /**
7843 * The order in which the bookmark should be displayed
7844 * <P>Type: INTEGER</P>
7845 */
7846 public static final String ORDERING = "ordering";
7847
7848 private static final String[] sIntentProjection = { INTENT };
7849 private static final String[] sShortcutProjection = { ID, SHORTCUT };
7850 private static final String sShortcutSelection = SHORTCUT + "=?";
7851
7852 /**
7853 * Convenience function to retrieve the bookmarked Intent for a
7854 * particular shortcut key.
7855 *
7856 * @param cr The ContentResolver to query.
7857 * @param shortcut The shortcut key.
7858 *
7859 * @return Intent The bookmarked URL, or null if there is no bookmark
7860 * matching the given shortcut.
7861 */
7862 public static Intent getIntentForShortcut(ContentResolver cr, char shortcut)
7863 {
7864 Intent intent = null;
7865
7866 Cursor c = cr.query(CONTENT_URI,
7867 sIntentProjection, sShortcutSelection,
7868 new String[] { String.valueOf((int) shortcut) }, ORDERING);
7869 // Keep trying until we find a valid shortcut
7870 try {
7871 while (intent == null && c.moveToNext()) {
7872 try {
7873 String intentURI = c.getString(c.getColumnIndexOrThrow(INTENT));
Christian Mehlmauera34d2c92010-05-25 19:04:20 +02007874 intent = Intent.parseUri(intentURI, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007875 } catch (java.net.URISyntaxException e) {
7876 // The stored URL is bad... ignore it.
7877 } catch (IllegalArgumentException e) {
7878 // Column not found
Dianne Hackborna33e3f72009-09-29 17:28:24 -07007879 Log.w(TAG, "Intent column not found", e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007880 }
7881 }
7882 } finally {
7883 if (c != null) c.close();
7884 }
7885
7886 return intent;
7887 }
7888
7889 /**
7890 * Add a new bookmark to the system.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07007891 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007892 * @param cr The ContentResolver to query.
7893 * @param intent The desired target of the bookmark.
7894 * @param title Bookmark title that is shown to the user; null if none
7895 * or it should be resolved to the intent's title.
7896 * @param folder Folder in which to place the bookmark; null if none.
7897 * @param shortcut Shortcut that will invoke the bookmark; 0 if none. If
7898 * this is non-zero and there is an existing bookmark entry
7899 * with this same shortcut, then that existing shortcut is
7900 * cleared (the bookmark is not removed).
7901 * @return The unique content URL for the new bookmark entry.
7902 */
7903 public static Uri add(ContentResolver cr,
7904 Intent intent,
7905 String title,
7906 String folder,
7907 char shortcut,
7908 int ordering)
7909 {
7910 // If a shortcut is supplied, and it is already defined for
7911 // another bookmark, then remove the old definition.
7912 if (shortcut != 0) {
Jeff Hamilton7cd51ef2010-05-12 17:30:27 -05007913 cr.delete(CONTENT_URI, sShortcutSelection,
7914 new String[] { String.valueOf((int) shortcut) });
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007915 }
7916
7917 ContentValues values = new ContentValues();
7918 if (title != null) values.put(TITLE, title);
7919 if (folder != null) values.put(FOLDER, folder);
Jean-Baptiste Queru3b9f0a32010-06-21 13:46:59 -07007920 values.put(INTENT, intent.toUri(0));
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007921 if (shortcut != 0) values.put(SHORTCUT, (int) shortcut);
7922 values.put(ORDERING, ordering);
7923 return cr.insert(CONTENT_URI, values);
7924 }
7925
7926 /**
7927 * Return the folder name as it should be displayed to the user. This
7928 * takes care of localizing special folders.
7929 *
7930 * @param r Resources object for current locale; only need access to
7931 * system resources.
7932 * @param folder The value found in the {@link #FOLDER} column.
7933 *
7934 * @return CharSequence The label for this folder that should be shown
7935 * to the user.
7936 */
7937 public static CharSequence getLabelForFolder(Resources r, String folder) {
7938 return folder;
7939 }
7940
7941 /**
7942 * Return the title as it should be displayed to the user. This takes
7943 * care of localizing bookmarks that point to activities.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07007944 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007945 * @param context A context.
7946 * @param cursor A cursor pointing to the row whose title should be
7947 * returned. The cursor must contain at least the {@link #TITLE}
7948 * and {@link #INTENT} columns.
7949 * @return A title that is localized and can be displayed to the user,
7950 * or the empty string if one could not be found.
7951 */
7952 public static CharSequence getTitle(Context context, Cursor cursor) {
7953 int titleColumn = cursor.getColumnIndex(TITLE);
7954 int intentColumn = cursor.getColumnIndex(INTENT);
7955 if (titleColumn == -1 || intentColumn == -1) {
7956 throw new IllegalArgumentException(
7957 "The cursor must contain the TITLE and INTENT columns.");
7958 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07007959
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007960 String title = cursor.getString(titleColumn);
7961 if (!TextUtils.isEmpty(title)) {
7962 return title;
7963 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07007964
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007965 String intentUri = cursor.getString(intentColumn);
7966 if (TextUtils.isEmpty(intentUri)) {
7967 return "";
7968 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07007969
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007970 Intent intent;
7971 try {
Christian Mehlmauera34d2c92010-05-25 19:04:20 +02007972 intent = Intent.parseUri(intentUri, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007973 } catch (URISyntaxException e) {
7974 return "";
7975 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07007976
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007977 PackageManager packageManager = context.getPackageManager();
7978 ResolveInfo info = packageManager.resolveActivity(intent, 0);
7979 return info != null ? info.loadLabel(packageManager) : "";
7980 }
7981 }
7982
7983 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007984 * Returns the device ID that we should use when connecting to the mobile gtalk server.
7985 * This is a string like "android-0x1242", where the hex string is the Android ID obtained
7986 * from the GoogleLoginService.
7987 *
7988 * @param androidId The Android ID for this device.
7989 * @return The device ID that should be used when connecting to the mobile gtalk server.
7990 * @hide
7991 */
7992 public static String getGTalkDeviceId(long androidId) {
7993 return "android-" + Long.toHexString(androidId);
7994 }
7995}