blob: 61c98a1a9991a7739e284cf340919cad6a4e2bd2 [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/*
2 * Copyright (C) 2006 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.provider;
18
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080019import android.annotation.SdkConstant;
20import android.annotation.SdkConstant.SdkConstantType;
Bryce Leecdfebd62015-02-02 08:19:11 -080021import android.annotation.SystemApi;
Narayan Kamathee69ff42011-06-28 12:07:18 +010022import android.app.SearchManager;
Jeff Sharkey6e2bee72012-10-01 13:39:08 -070023import android.app.WallpaperManager;
Mike LeBeau5d34e9b2010-02-10 19:34:56 -080024import android.content.ComponentName;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080025import android.content.ContentResolver;
26import android.content.ContentValues;
27import android.content.Context;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -080028import android.content.IContentProvider;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080029import android.content.Intent;
Dianne Hackbornb8b11a02010-03-10 15:53:11 -080030import android.content.pm.ActivityInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080031import android.content.pm.PackageManager;
32import android.content.pm.ResolveInfo;
33import android.content.res.Configuration;
34import android.content.res.Resources;
35import android.database.Cursor;
36import android.database.SQLException;
David Christie3f7b6522013-08-06 19:19:08 -070037import android.location.LocationManager;
Jeff Sharkey625239a2012-09-26 22:03:49 -070038import android.net.ConnectivityManager;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080039import android.net.Uri;
Irfan Sheriff36f74132010-11-04 16:57:37 -070040import android.net.wifi.WifiManager;
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -070041import android.os.BatteryManager;
42import android.os.Bundle;
Jeff Sharkey625239a2012-09-26 22:03:49 -070043import android.os.DropBoxManager;
Amith Yamasani52c489c2012-03-28 11:42:42 -070044import android.os.IBinder;
Amith Yamasani7ab8c4a2012-04-06 09:27:12 -070045import android.os.Process;
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -070046import android.os.RemoteException;
Amith Yamasani52c489c2012-03-28 11:42:42 -070047import android.os.ServiceManager;
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -070048import android.os.SystemProperties;
Dianne Hackbornf02b60a2012-08-16 10:48:27 -070049import android.os.UserHandle;
Jeff Sharkey625239a2012-09-26 22:03:49 -070050import android.os.Build.VERSION_CODES;
Narayan Kamath6d632962011-08-24 11:51:37 +010051import android.speech.tts.TextToSpeech;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080052import android.text.TextUtils;
53import android.util.AndroidException;
Svetoslav683914b2015-01-15 14:22:26 -080054import android.util.ArrayMap;
55import android.util.ArraySet;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080056import android.util.Log;
57
Svetoslav683914b2015-01-15 14:22:26 -080058import com.android.internal.util.ArrayUtils;
Amith Yamasani52c489c2012-03-28 11:42:42 -070059import com.android.internal.widget.ILockSettings;
60
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080061import java.net.URISyntaxException;
Svetoslav683914b2015-01-15 14:22:26 -080062import java.text.SimpleDateFormat;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080063import java.util.HashMap;
64import java.util.HashSet;
Elliott Hughescb64d432013-08-02 10:00:44 -070065import java.util.Locale;
Svetoslav683914b2015-01-15 14:22:26 -080066import java.util.Map;
67import java.util.Set;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080068
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080069/**
70 * The Settings provider contains global system-level device preferences.
71 */
72public final class Settings {
73
74 // Intent actions for Settings
75
76 /**
77 * Activity Action: Show system settings.
78 * <p>
79 * Input: Nothing.
80 * <p>
Gilles Debunnee90bed12011-08-30 14:28:27 -070081 * Output: Nothing.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080082 */
83 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
84 public static final String ACTION_SETTINGS = "android.settings.SETTINGS";
85
86 /**
87 * Activity Action: Show settings to allow configuration of APNs.
88 * <p>
89 * Input: Nothing.
90 * <p>
Gilles Debunnee90bed12011-08-30 14:28:27 -070091 * Output: Nothing.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080092 */
93 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
94 public static final String ACTION_APN_SETTINGS = "android.settings.APN_SETTINGS";
95
96 /**
97 * Activity Action: Show settings to allow configuration of current location
98 * sources.
99 * <p>
100 * In some cases, a matching Activity may not exist, so ensure you
101 * safeguard against this.
102 * <p>
103 * Input: Nothing.
104 * <p>
105 * Output: Nothing.
106 */
107 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
108 public static final String ACTION_LOCATION_SOURCE_SETTINGS =
109 "android.settings.LOCATION_SOURCE_SETTINGS";
110
111 /**
112 * Activity Action: Show settings to allow configuration of wireless controls
113 * such as Wi-Fi, Bluetooth and Mobile networks.
114 * <p>
115 * In some cases, a matching Activity may not exist, so ensure you
116 * safeguard against this.
117 * <p>
118 * Input: Nothing.
119 * <p>
120 * Output: Nothing.
121 */
122 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
123 public static final String ACTION_WIRELESS_SETTINGS =
124 "android.settings.WIRELESS_SETTINGS";
125
126 /**
127 * Activity Action: Show settings to allow entering/exiting airplane mode.
128 * <p>
129 * In some cases, a matching Activity may not exist, so ensure you
130 * safeguard against this.
131 * <p>
132 * Input: Nothing.
133 * <p>
134 * Output: Nothing.
135 */
136 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
137 public static final String ACTION_AIRPLANE_MODE_SETTINGS =
138 "android.settings.AIRPLANE_MODE_SETTINGS";
139
140 /**
Barnaby Jamesb3006d32015-04-02 17:49:54 -0700141 * Activity Action: Modify Airplane mode settings using a voice command.
Barnaby James48f35522014-07-16 14:27:39 -0700142 * <p>
143 * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
144 * <p>
145 * This intent MUST be started using
146 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
147 * startVoiceActivity}.
148 * <p>
Barnaby Jamesb3006d32015-04-02 17:49:54 -0700149 * Note: The activity implementing this intent MUST verify that
Barnaby James48f35522014-07-16 14:27:39 -0700150 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before
151 * modifying the setting.
152 * <p>
Barnaby Jamesb3006d32015-04-02 17:49:54 -0700153 * Input: To tell which state airplane mode should be set to, add the
154 * {@link #EXTRA_AIRPLANE_MODE_ENABLED} extra to this Intent with the state specified.
155 * If the extra is not included, no changes will be made.
Barnaby James48f35522014-07-16 14:27:39 -0700156 * <p>
157 * Output: Nothing.
158 */
159 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
160 public static final String ACTION_VOICE_CONTROL_AIRPLANE_MODE =
161 "android.settings.VOICE_CONTROL_AIRPLANE_MODE";
162
163 /**
Dianne Hackborndd9b82c2009-09-03 00:18:47 -0700164 * Activity Action: Show settings for accessibility modules.
165 * <p>
166 * In some cases, a matching Activity may not exist, so ensure you
167 * safeguard against this.
168 * <p>
169 * Input: Nothing.
170 * <p>
171 * Output: Nothing.
172 */
173 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
174 public static final String ACTION_ACCESSIBILITY_SETTINGS =
175 "android.settings.ACCESSIBILITY_SETTINGS";
176
177 /**
Dianne Hackborna3fb40d2014-08-12 15:06:50 -0700178 * Activity Action: Show settings to control access to usage information.
179 * <p>
180 * In some cases, a matching Activity may not exist, so ensure you
181 * safeguard against this.
182 * <p>
183 * Input: Nothing.
184 * <p>
185 * Output: Nothing.
186 */
187 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
188 public static final String ACTION_USAGE_ACCESS_SETTINGS =
189 "android.settings.USAGE_ACCESS_SETTINGS";
190
191 /**
Jason Monk6f909782015-04-17 14:30:25 -0400192 * Activity Category: Show application settings related to usage access.
193 * <p>
194 * An activity that provides a user interface for adjusting usage access related
195 * preferences for its containing application. Optional but recommended for apps that
196 * use {@link android.Manifest.permission#PACKAGE_USAGE_STATS}.
197 * <p>
198 * The activity may define meta-data to describe what usage access is
199 * used for within their app with {@link #METADATA_USAGE_ACCESS_REASON}, which
200 * will be displayed in Settings.
201 * <p>
202 * Input: Nothing.
203 * <p>
204 * Output: Nothing.
205 */
206 @SdkConstant(SdkConstantType.INTENT_CATEGORY)
207 public static final String INTENT_CATEGORY_USAGE_ACCESS_CONFIG =
208 "android.intent.category.USAGE_ACCESS_CONFIG";
209
210 /**
211 * Metadata key: Reason for needing usage access.
212 * <p>
213 * A key for metadata attached to an activity that receives action
214 * {@link #INTENT_CATEGORY_USAGE_ACCESS_CONFIG}, shown to the
215 * user as description of how the app uses usage access.
216 * <p>
217 */
218 public static final String METADATA_USAGE_ACCESS_REASON =
219 "android.settings.metadata.USAGE_ACCESS_REASON";
220
221 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800222 * Activity Action: Show settings to allow configuration of security and
223 * location privacy.
224 * <p>
225 * In some cases, a matching Activity may not exist, so ensure you
226 * safeguard against this.
227 * <p>
228 * Input: Nothing.
229 * <p>
230 * Output: Nothing.
231 */
232 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
233 public static final String ACTION_SECURITY_SETTINGS =
234 "android.settings.SECURITY_SETTINGS";
235
236 /**
Maggie Benthall0469f412013-09-05 15:30:26 -0400237 * Activity Action: Show trusted credentials settings, opening to the user tab,
238 * to allow management of installed credentials.
239 * <p>
240 * In some cases, a matching Activity may not exist, so ensure you
241 * safeguard against this.
242 * <p>
243 * Input: Nothing.
244 * <p>
245 * Output: Nothing.
246 * @hide
247 */
248 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
249 public static final String ACTION_TRUSTED_CREDENTIALS_USER =
250 "com.android.settings.TRUSTED_CREDENTIALS_USER";
251
252 /**
253 * Activity Action: Show dialog explaining that an installed CA cert may enable
254 * monitoring of encrypted network traffic.
255 * <p>
256 * In some cases, a matching Activity may not exist, so ensure you
257 * safeguard against this.
258 * <p>
259 * Input: Nothing.
260 * <p>
261 * Output: Nothing.
262 * @hide
263 */
264 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
265 public static final String ACTION_MONITORING_CERT_INFO =
266 "com.android.settings.MONITORING_CERT_INFO";
267
268 /**
Amith Yamasanic15255a2009-09-23 15:33:19 -0700269 * Activity Action: Show settings to allow configuration of privacy options.
270 * <p>
271 * In some cases, a matching Activity may not exist, so ensure you
272 * safeguard against this.
273 * <p>
274 * Input: Nothing.
275 * <p>
276 * Output: Nothing.
277 */
278 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
279 public static final String ACTION_PRIVACY_SETTINGS =
280 "android.settings.PRIVACY_SETTINGS";
281
282 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800283 * Activity Action: Show settings to allow configuration of Wi-Fi.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800284 * <p>
285 * In some cases, a matching Activity may not exist, so ensure you
286 * safeguard against this.
287 * <p>
288 * Input: Nothing.
289 * <p>
290 * Output: Nothing.
291
292 */
293 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
294 public static final String ACTION_WIFI_SETTINGS =
295 "android.settings.WIFI_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700296
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800297 /**
298 * Activity Action: Show settings to allow configuration of a static IP
299 * address for Wi-Fi.
300 * <p>
301 * In some cases, a matching Activity may not exist, so ensure you safeguard
302 * against this.
303 * <p>
304 * Input: Nothing.
305 * <p>
306 * Output: Nothing.
307 */
308 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
309 public static final String ACTION_WIFI_IP_SETTINGS =
310 "android.settings.WIFI_IP_SETTINGS";
311
312 /**
313 * Activity Action: Show settings to allow configuration of Bluetooth.
314 * <p>
315 * In some cases, a matching Activity may not exist, so ensure you
316 * safeguard against this.
317 * <p>
318 * Input: Nothing.
319 * <p>
320 * Output: Nothing.
321 */
322 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
323 public static final String ACTION_BLUETOOTH_SETTINGS =
324 "android.settings.BLUETOOTH_SETTINGS";
325
326 /**
Jeff Brownc05c1ae2015-05-05 13:46:30 -0700327 * Activity Action: Show settings to allow configuration of cast endpoints.
Jeff Brown1a937b02014-07-01 22:13:04 -0700328 * <p>
329 * In some cases, a matching Activity may not exist, so ensure you
330 * safeguard against this.
331 * <p>
332 * Input: Nothing.
333 * <p>
334 * Output: Nothing.
335 */
336 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
337 public static final String ACTION_CAST_SETTINGS =
338 "android.settings.CAST_SETTINGS";
339
340 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800341 * Activity Action: Show settings to allow configuration of date and time.
342 * <p>
343 * In some cases, a matching Activity may not exist, so ensure you
344 * safeguard against this.
345 * <p>
346 * Input: Nothing.
347 * <p>
348 * Output: Nothing.
349 */
350 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
351 public static final String ACTION_DATE_SETTINGS =
352 "android.settings.DATE_SETTINGS";
353
354 /**
355 * Activity Action: Show settings to allow configuration of sound and volume.
356 * <p>
357 * In some cases, a matching Activity may not exist, so ensure you
358 * safeguard against this.
359 * <p>
360 * Input: Nothing.
361 * <p>
362 * Output: Nothing.
363 */
364 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
365 public static final String ACTION_SOUND_SETTINGS =
366 "android.settings.SOUND_SETTINGS";
367
368 /**
369 * Activity Action: Show settings to allow configuration of display.
370 * <p>
371 * In some cases, a matching Activity may not exist, so ensure you
372 * safeguard against this.
373 * <p>
374 * Input: Nothing.
375 * <p>
376 * Output: Nothing.
377 */
378 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
379 public static final String ACTION_DISPLAY_SETTINGS =
380 "android.settings.DISPLAY_SETTINGS";
381
382 /**
383 * Activity Action: Show settings to allow configuration of locale.
384 * <p>
385 * In some cases, a matching Activity may not exist, so ensure you
386 * safeguard against this.
387 * <p>
388 * Input: Nothing.
389 * <p>
390 * Output: Nothing.
391 */
392 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
393 public static final String ACTION_LOCALE_SETTINGS =
394 "android.settings.LOCALE_SETTINGS";
395
396 /**
397 * Activity Action: Show settings to configure input methods, in particular
398 * allowing the user to enable input methods.
399 * <p>
400 * In some cases, a matching Activity may not exist, so ensure you
401 * safeguard against this.
402 * <p>
403 * Input: Nothing.
404 * <p>
405 * Output: Nothing.
406 */
407 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
Dianne Hackborna3fb40d2014-08-12 15:06:50 -0700408 public static final String ACTION_VOICE_INPUT_SETTINGS =
409 "android.settings.VOICE_INPUT_SETTINGS";
410
411 /**
412 * Activity Action: Show settings to configure input methods, in particular
413 * allowing the user to enable input methods.
414 * <p>
415 * In some cases, a matching Activity may not exist, so ensure you
416 * safeguard against this.
417 * <p>
418 * Input: Nothing.
419 * <p>
420 * Output: Nothing.
421 */
422 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800423 public static final String ACTION_INPUT_METHOD_SETTINGS =
424 "android.settings.INPUT_METHOD_SETTINGS";
425
426 /**
Tadashi G. Takaokaf49688f2011-01-20 17:56:13 +0900427 * Activity Action: Show settings to enable/disable input method subtypes.
satok86417ea2010-10-27 14:11:03 +0900428 * <p>
429 * In some cases, a matching Activity may not exist, so ensure you
430 * safeguard against this.
431 * <p>
Tadashi G. Takaoka25480202011-01-20 23:13:02 +0900432 * To tell which input method's subtypes are displayed in the settings, add
433 * {@link #EXTRA_INPUT_METHOD_ID} extra to this Intent with the input method id.
434 * If there is no extra in this Intent, subtypes from all installed input methods
435 * will be displayed in the settings.
436 *
437 * @see android.view.inputmethod.InputMethodInfo#getId
438 * <p>
satok86417ea2010-10-27 14:11:03 +0900439 * Input: Nothing.
440 * <p>
441 * Output: Nothing.
442 */
443 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
Tadashi G. Takaokaf49688f2011-01-20 17:56:13 +0900444 public static final String ACTION_INPUT_METHOD_SUBTYPE_SETTINGS =
445 "android.settings.INPUT_METHOD_SUBTYPE_SETTINGS";
satok86417ea2010-10-27 14:11:03 +0900446
447 /**
satok7cfc0ed2011-06-20 21:29:36 +0900448 * Activity Action: Show a dialog to select input method.
449 * <p>
450 * In some cases, a matching Activity may not exist, so ensure you
451 * safeguard against this.
452 * <p>
453 * Input: Nothing.
454 * <p>
455 * Output: Nothing.
456 * @hide
457 */
458 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
459 public static final String ACTION_SHOW_INPUT_METHOD_PICKER =
460 "android.settings.SHOW_INPUT_METHOD_PICKER";
461
462 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800463 * Activity Action: Show settings to manage the user input dictionary.
464 * <p>
Chet Haasee8222dd2013-09-05 07:44:18 -0700465 * Starting with {@link android.os.Build.VERSION_CODES#KITKAT},
Satoshi Kataoka2aa2bc52013-07-30 14:25:11 +0900466 * it is guaranteed there will always be an appropriate implementation for this Intent action.
467 * In prior releases of the platform this was optional, so ensure you safeguard against it.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800468 * <p>
469 * Input: Nothing.
470 * <p>
471 * Output: Nothing.
472 */
473 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
474 public static final String ACTION_USER_DICTIONARY_SETTINGS =
475 "android.settings.USER_DICTIONARY_SETTINGS";
476
477 /**
Gilles Debunnee90bed12011-08-30 14:28:27 -0700478 * Activity Action: Adds a word to the user dictionary.
479 * <p>
480 * In some cases, a matching Activity may not exist, so ensure you
481 * safeguard against this.
482 * <p>
483 * Input: An extra with key <code>word</code> that contains the word
484 * that should be added to the dictionary.
485 * <p>
486 * Output: Nothing.
487 *
488 * @hide
489 */
490 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
491 public static final String ACTION_USER_DICTIONARY_INSERT =
492 "com.android.settings.USER_DICTIONARY_INSERT";
493
494 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800495 * Activity Action: Show settings to allow configuration of application-related settings.
496 * <p>
497 * In some cases, a matching Activity may not exist, so ensure you
498 * safeguard against this.
499 * <p>
500 * Input: Nothing.
501 * <p>
502 * Output: Nothing.
503 */
504 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
505 public static final String ACTION_APPLICATION_SETTINGS =
506 "android.settings.APPLICATION_SETTINGS";
507
508 /**
509 * Activity Action: Show settings to allow configuration of application
Dianne Hackborn8d866e52012-10-10 18:39:45 -0700510 * development-related settings. As of
511 * {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1} this action is
512 * a required part of the platform.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800513 * <p>
514 * Input: Nothing.
515 * <p>
516 * Output: Nothing.
517 */
518 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
519 public static final String ACTION_APPLICATION_DEVELOPMENT_SETTINGS =
520 "android.settings.APPLICATION_DEVELOPMENT_SETTINGS";
521
522 /**
523 * Activity Action: Show settings to allow configuration of quick launch shortcuts.
524 * <p>
525 * In some cases, a matching Activity may not exist, so ensure you
526 * safeguard against this.
527 * <p>
528 * Input: Nothing.
529 * <p>
530 * Output: Nothing.
531 */
532 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
533 public static final String ACTION_QUICK_LAUNCH_SETTINGS =
534 "android.settings.QUICK_LAUNCH_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700535
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800536 /**
537 * Activity Action: Show settings to manage installed applications.
538 * <p>
539 * In some cases, a matching Activity may not exist, so ensure you
540 * safeguard against this.
541 * <p>
542 * Input: Nothing.
543 * <p>
544 * Output: Nothing.
545 */
546 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
547 public static final String ACTION_MANAGE_APPLICATIONS_SETTINGS =
548 "android.settings.MANAGE_APPLICATIONS_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700549
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800550 /**
Winson Chung44e8ff92010-09-27 14:36:52 -0700551 * Activity Action: Show settings to manage all applications.
552 * <p>
553 * In some cases, a matching Activity may not exist, so ensure you
554 * safeguard against this.
555 * <p>
556 * Input: Nothing.
557 * <p>
558 * Output: Nothing.
559 */
560 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
561 public static final String ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS =
562 "android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS";
563
564 /**
Billy Laucbe540f2015-06-25 01:51:44 +0100565 * Activity Action: Show settings to toggle permission to draw on top of
566 * other apps.
567 * <p>
568 * In some cases, a matching Activity may not exist, so ensure you
569 * safeguard against this.
570 * <p>
571 * Input: Nothing.
572 * <p>
573 * Output: Nothing.
574 */
575 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
576 public static final String ACTION_MANAGE_OVERLAY_PERMISSION =
Billy Lau22b3f4c2015-07-08 00:31:01 +0100577 "android.settings.action.MANAGE_OVERLAY_PERMISSION";
578
579 /**
580 * Activity Action: Show settings to toggle apps' capablity to
581 * to read/write system settings.
582 * <p>
583 * In some cases, a matching Activity may not exist, so ensure you
584 * safeguard against this.
585 * <p>
586 * Input: Nothing.
587 * <p>
588 * Output: Nothing.
589 */
590 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
591 public static final String ACTION_MANAGE_WRITE_SETTINGS =
592 "android.settings.action.MANAGE_WRITE_SETTINGS";
Billy Laucbe540f2015-06-25 01:51:44 +0100593
594 /**
Dianne Hackbornb7bb3b32010-06-06 22:47:50 -0700595 * Activity Action: Show screen of details about a particular application.
596 * <p>
597 * In some cases, a matching Activity may not exist, so ensure you
598 * safeguard against this.
599 * <p>
600 * Input: The Intent's data URI specifies the application package name
601 * to be shown, with the "package" scheme. That is "package:com.my.app".
602 * <p>
603 * Output: Nothing.
604 */
605 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
606 public static final String ACTION_APPLICATION_DETAILS_SETTINGS =
607 "android.settings.APPLICATION_DETAILS_SETTINGS";
608
609 /**
Jason Monk287b8892015-06-10 10:39:23 -0400610 * Activity Action: Show screen for controlling which apps can ignore battery optimizations.
611 * <p>
Dianne Hackborn1958e5e2015-06-12 18:11:41 -0700612 * Input: Optionally, the Intent's data URI specifies the application package name
Jason Monk287b8892015-06-10 10:39:23 -0400613 * to be shown, with the "package" scheme. That is "package:com.my.app".
614 * <p>
615 * Output: Nothing.
Dianne Hackborn1958e5e2015-06-12 18:11:41 -0700616 * <p>
617 * You can use {@link android.os.PowerManager#isIgnoringBatteryOptimizations
618 * PowerManager.isIgnoringBatteryOptimizations()} to determine if an application is
619 * already ignoring optimizations.
Jason Monk287b8892015-06-10 10:39:23 -0400620 */
621 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
622 public static final String ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS =
623 "android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS";
624
625 /**
Dianne Hackborn35654b62013-01-14 17:38:02 -0800626 * @hide
627 * Activity Action: Show the "app ops" settings screen.
628 * <p>
629 * Input: Nothing.
630 * <p>
631 * Output: Nothing.
632 */
633 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
634 public static final String ACTION_APP_OPS_SETTINGS =
635 "android.settings.APP_OPS_SETTINGS";
636
637 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800638 * Activity Action: Show settings for system update functionality.
639 * <p>
640 * In some cases, a matching Activity may not exist, so ensure you
641 * safeguard against this.
642 * <p>
643 * Input: Nothing.
644 * <p>
645 * Output: Nothing.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700646 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800647 * @hide
648 */
649 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
650 public static final String ACTION_SYSTEM_UPDATE_SETTINGS =
651 "android.settings.SYSTEM_UPDATE_SETTINGS";
652
653 /**
654 * Activity Action: Show settings to allow configuration of sync settings.
655 * <p>
656 * In some cases, a matching Activity may not exist, so ensure you
657 * safeguard against this.
658 * <p>
Erikeebc8e22010-02-18 13:27:19 -0800659 * The account types available to add via the add account button may be restricted by adding an
660 * {@link #EXTRA_AUTHORITIES} extra to this Intent with one or more syncable content provider's
661 * authorities. Only account types which can sync with that content provider will be offered to
662 * the user.
663 * <p>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800664 * Input: Nothing.
665 * <p>
666 * Output: Nothing.
667 */
668 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
669 public static final String ACTION_SYNC_SETTINGS =
670 "android.settings.SYNC_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700671
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800672 /**
Erikeebc8e22010-02-18 13:27:19 -0800673 * Activity Action: Show add account screen for creating a new account.
674 * <p>
675 * In some cases, a matching Activity may not exist, so ensure you
676 * safeguard against this.
677 * <p>
678 * The account types available to add may be restricted by adding an {@link #EXTRA_AUTHORITIES}
679 * extra to the Intent with one or more syncable content provider's authorities. Only account
680 * types which can sync with that content provider will be offered to the user.
681 * <p>
Alon Albert50359c22013-02-26 14:47:48 -0800682 * Account types can also be filtered by adding an {@link #EXTRA_ACCOUNT_TYPES} extra to the
683 * Intent with one or more account types.
684 * <p>
Erikeebc8e22010-02-18 13:27:19 -0800685 * Input: Nothing.
686 * <p>
687 * Output: Nothing.
688 */
689 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
690 public static final String ACTION_ADD_ACCOUNT =
691 "android.settings.ADD_ACCOUNT_SETTINGS";
692
693 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800694 * Activity Action: Show settings for selecting the network operator.
695 * <p>
696 * In some cases, a matching Activity may not exist, so ensure you
697 * safeguard against this.
698 * <p>
699 * Input: Nothing.
700 * <p>
701 * Output: Nothing.
702 */
703 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
704 public static final String ACTION_NETWORK_OPERATOR_SETTINGS =
705 "android.settings.NETWORK_OPERATOR_SETTINGS";
706
707 /**
708 * Activity Action: Show settings for selection of 2G/3G.
709 * <p>
710 * In some cases, a matching Activity may not exist, so ensure you
711 * safeguard against this.
712 * <p>
713 * Input: Nothing.
714 * <p>
715 * Output: Nothing.
716 */
717 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
718 public static final String ACTION_DATA_ROAMING_SETTINGS =
719 "android.settings.DATA_ROAMING_SETTINGS";
720
721 /**
722 * Activity Action: Show settings for internal storage.
723 * <p>
724 * In some cases, a matching Activity may not exist, so ensure you
725 * safeguard against this.
726 * <p>
727 * Input: Nothing.
728 * <p>
729 * Output: Nothing.
730 */
731 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
732 public static final String ACTION_INTERNAL_STORAGE_SETTINGS =
733 "android.settings.INTERNAL_STORAGE_SETTINGS";
734 /**
735 * Activity Action: Show settings for memory card storage.
736 * <p>
737 * In some cases, a matching Activity may not exist, so ensure you
738 * safeguard against this.
739 * <p>
740 * Input: Nothing.
741 * <p>
742 * Output: Nothing.
743 */
744 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
745 public static final String ACTION_MEMORY_CARD_SETTINGS =
746 "android.settings.MEMORY_CARD_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700747
Justin Mattsonef340352010-01-13 21:05:46 -0800748 /**
749 * Activity Action: Show settings for global search.
750 * <p>
751 * In some cases, a matching Activity may not exist, so ensure you
752 * safeguard against this.
753 * <p>
754 * Input: Nothing.
755 * <p>
756 * Output: Nothing
757 */
758 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
759 public static final String ACTION_SEARCH_SETTINGS =
760 "android.search.action.SEARCH_SETTINGS";
761
Daniel Sandler9d8b8762010-01-22 20:50:15 -0500762 /**
763 * Activity Action: Show general device information settings (serial
764 * number, software version, phone number, etc.).
765 * <p>
766 * In some cases, a matching Activity may not exist, so ensure you
767 * safeguard against this.
768 * <p>
769 * Input: Nothing.
770 * <p>
771 * Output: Nothing
772 */
773 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
774 public static final String ACTION_DEVICE_INFO_SETTINGS =
775 "android.settings.DEVICE_INFO_SETTINGS";
776
Martijn Coenen9b3c83f2011-07-28 11:21:39 -0500777 /**
Nick Pellycccf01d2011-10-31 14:49:40 -0700778 * Activity Action: Show NFC settings.
779 * <p>
780 * This shows UI that allows NFC to be turned on or off.
Martijn Coenen9b3c83f2011-07-28 11:21:39 -0500781 * <p>
782 * In some cases, a matching Activity may not exist, so ensure you
783 * safeguard against this.
784 * <p>
785 * Input: Nothing.
786 * <p>
787 * Output: Nothing
Nick Pellycccf01d2011-10-31 14:49:40 -0700788 * @see android.nfc.NfcAdapter#isEnabled()
789 */
790 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
791 public static final String ACTION_NFC_SETTINGS = "android.settings.NFC_SETTINGS";
792
793 /**
794 * Activity Action: Show NFC Sharing settings.
795 * <p>
796 * This shows UI that allows NDEF Push (Android Beam) to be turned on or
797 * off.
798 * <p>
799 * In some cases, a matching Activity may not exist, so ensure you
800 * safeguard against this.
801 * <p>
802 * Input: Nothing.
803 * <p>
804 * Output: Nothing
805 * @see android.nfc.NfcAdapter#isNdefPushEnabled()
Martijn Coenen9b3c83f2011-07-28 11:21:39 -0500806 */
807 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
808 public static final String ACTION_NFCSHARING_SETTINGS =
809 "android.settings.NFCSHARING_SETTINGS";
810
Daniel Sandlerc08cd022012-11-27 22:47:37 -0500811 /**
Martijn Coenen62c196a2013-08-09 13:43:34 -0700812 * Activity Action: Show NFC Tap & Pay settings
813 * <p>
814 * This shows UI that allows the user to configure Tap&Pay
815 * settings.
816 * <p>
817 * In some cases, a matching Activity may not exist, so ensure you
818 * safeguard against this.
819 * <p>
820 * Input: Nothing.
821 * <p>
822 * Output: Nothing
823 */
824 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
825 public static final String ACTION_NFC_PAYMENT_SETTINGS =
826 "android.settings.NFC_PAYMENT_SETTINGS";
827
828 /**
Daniel Sandlerc08cd022012-11-27 22:47:37 -0500829 * Activity Action: Show Daydream settings.
830 * <p>
831 * In some cases, a matching Activity may not exist, so ensure you
832 * safeguard against this.
833 * <p>
834 * Input: Nothing.
835 * <p>
836 * Output: Nothing.
837 * @see android.service.dreams.DreamService
Daniel Sandlerc08cd022012-11-27 22:47:37 -0500838 */
839 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
840 public static final String ACTION_DREAM_SETTINGS = "android.settings.DREAM_SETTINGS";
841
Daniel Sandler5feceeb2013-03-22 18:29:23 -0700842 /**
843 * Activity Action: Show Notification listener settings.
844 * <p>
845 * In some cases, a matching Activity may not exist, so ensure you
846 * safeguard against this.
847 * <p>
848 * Input: Nothing.
849 * <p>
850 * Output: Nothing.
851 * @see android.service.notification.NotificationListenerService
Daniel Sandler5feceeb2013-03-22 18:29:23 -0700852 */
853 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
854 public static final String ACTION_NOTIFICATION_LISTENER_SETTINGS
Chris Wren8326a8a2014-10-22 14:13:32 -0400855 = "android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS";
Daniel Sandler5feceeb2013-03-22 18:29:23 -0700856
Alan Viverette69ce69b2013-08-29 12:23:48 -0700857 /**
John Spurlock80774932015-05-07 17:38:50 -0400858 * Activity Action: Show Do Not Disturb access settings.
859 * <p>
John Spurlock7c74f782015-06-04 13:01:42 -0400860 * Users can grant and deny access to Do Not Disturb configuration from here.
861 * See {@link android.app.NotificationManager#isNotificationPolicyAccessGranted()} for more
862 * details.
John Spurlock80774932015-05-07 17:38:50 -0400863 * <p>
864 * Input: Nothing.
865 * <p>
866 * Output: Nothing.
867 */
868 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
John Spurlock7c74f782015-06-04 13:01:42 -0400869 public static final String ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS
870 = "android.settings.NOTIFICATION_POLICY_ACCESS_SETTINGS";
John Spurlock80774932015-05-07 17:38:50 -0400871
872 /**
John Spurlock7340fc82014-04-24 18:50:12 -0400873 * @hide
874 */
875 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
876 public static final String ACTION_CONDITION_PROVIDER_SETTINGS
877 = "android.settings.ACTION_CONDITION_PROVIDER_SETTINGS";
878
879 /**
Alan Viverette69ce69b2013-08-29 12:23:48 -0700880 * Activity Action: Show settings for video captioning.
881 * <p>
882 * In some cases, a matching Activity may not exist, so ensure you safeguard
883 * against this.
884 * <p>
885 * Input: Nothing.
886 * <p>
887 * Output: Nothing.
888 */
889 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
890 public static final String ACTION_CAPTIONING_SETTINGS = "android.settings.CAPTIONING_SETTINGS";
891
Svetoslav773f54d2013-09-03 14:01:43 -0700892 /**
893 * Activity Action: Show the top level print settings.
894 * <p>
895 * In some cases, a matching Activity may not exist, so ensure you
896 * safeguard against this.
897 * <p>
898 * Input: Nothing.
899 * <p>
900 * Output: Nothing.
901 */
902 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
903 public static final String ACTION_PRINT_SETTINGS =
904 "android.settings.ACTION_PRINT_SETTINGS";
905
John Spurlockde547002014-02-28 17:50:39 -0500906 /**
907 * Activity Action: Show Zen Mode configuration settings.
908 *
909 * @hide
910 */
911 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
912 public static final String ACTION_ZEN_MODE_SETTINGS = "android.settings.ZEN_MODE_SETTINGS";
913
Santos Cordona4c75242014-07-09 12:07:51 -0700914 /**
John Spurlockfc746f82015-04-03 13:47:14 -0400915 * Activity Action: Show Zen Mode priority configuration settings.
916 *
917 * @hide
918 */
919 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
920 public static final String ACTION_ZEN_MODE_PRIORITY_SETTINGS
921 = "android.settings.ZEN_MODE_PRIORITY_SETTINGS";
922
923 /**
John Spurlock7af10182015-04-03 15:10:31 -0400924 * Activity Action: Show Zen Mode automation configuration settings.
925 *
926 * @hide
927 */
928 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
929 public static final String ACTION_ZEN_MODE_AUTOMATION_SETTINGS
930 = "android.settings.ZEN_MODE_AUTOMATION_SETTINGS";
931
932 /**
Barnaby Jamesb3006d32015-04-02 17:49:54 -0700933 * Activity Action: Modify do not disturb mode settings.
934 * <p>
935 * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
936 * <p>
937 * This intent MUST be started using
938 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
939 * startVoiceActivity}.
940 * <p>
941 * Note: The Activity implementing this intent MUST verify that
942 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction}.
943 * returns true before modifying the setting.
944 * <p>
945 * Input: The optional {@link #EXTRA_DO_NOT_DISTURB_MODE_MINUTES} extra can be used to indicate
946 * how long the user wishes to avoid interruptions for. The optional
947 * {@link #EXTRA_DO_NOT_DISTURB_MODE_ENABLED} extra can be to indicate if the user is
948 * enabling or disabling do not disturb mode. If either extra is not included, the
949 * user maybe asked to provide the value.
950 * <p>
951 * Output: Nothing.
952 */
953 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
954 public static final String ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE =
955 "android.settings.VOICE_CONTROL_DO_NOT_DISTURB_MODE";
956
957 /**
John Spurlockb2278d62015-04-07 12:47:12 -0400958 * Activity Action: Show Zen Mode schedule rule configuration settings.
959 *
960 * @hide
961 */
962 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
963 public static final String ACTION_ZEN_MODE_SCHEDULE_RULE_SETTINGS
964 = "android.settings.ZEN_MODE_SCHEDULE_RULE_SETTINGS";
965
966 /**
John Spurlockd60258f2015-04-30 09:30:52 -0400967 * Activity Action: Show Zen Mode event rule configuration settings.
968 *
969 * @hide
970 */
971 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
972 public static final String ACTION_ZEN_MODE_EVENT_RULE_SETTINGS
973 = "android.settings.ZEN_MODE_EVENT_RULE_SETTINGS";
974
975 /**
John Spurlock39581cc2015-04-10 11:59:01 -0400976 * Activity Action: Show Zen Mode external rule configuration settings.
977 *
978 * @hide
979 */
980 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
981 public static final String ACTION_ZEN_MODE_EXTERNAL_RULE_SETTINGS
982 = "android.settings.ZEN_MODE_EXTERNAL_RULE_SETTINGS";
983
984 /**
Santos Cordona4c75242014-07-09 12:07:51 -0700985 * Activity Action: Show the regulatory information screen for the device.
986 * <p>
987 * In some cases, a matching Activity may not exist, so ensure you safeguard
988 * against this.
989 * <p>
990 * Input: Nothing.
991 * <p>
992 * Output: Nothing.
993 */
Jeff Sharkeydd77fda2014-04-16 17:23:08 -0700994 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
995 public static final String
996 ACTION_SHOW_REGULATORY_INFO = "android.settings.SHOW_REGULATORY_INFO";
997
Jerome Poichet7974cb32014-05-14 12:04:43 -0700998 /**
999 * Activity Action: Show Device Name Settings.
1000 * <p>
1001 * In some cases, a matching Activity may not exist, so ensure you safeguard
Tim Kilbourn87cd0dc2014-04-14 15:37:51 -07001002 * against this.
Jerome Poichet7974cb32014-05-14 12:04:43 -07001003 *
1004 * @hide
1005 */
1006 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1007 public static final String DEVICE_NAME_SETTINGS = "android.settings.DEVICE_NAME";
1008
Tim Kilbourn87cd0dc2014-04-14 15:37:51 -07001009 /**
1010 * Activity Action: Show pairing settings.
1011 * <p>
1012 * In some cases, a matching Activity may not exist, so ensure you safeguard
1013 * against this.
1014 *
1015 * @hide
1016 */
1017 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1018 public static final String ACTION_PAIRING_SETTINGS = "android.settings.PAIRING_SETTINGS";
1019
John Spurlockf8f524c2014-06-10 14:47:29 -04001020 /**
1021 * Activity Action: Show battery saver settings.
John Spurlock73466662014-10-30 13:42:05 -04001022 * <p>
1023 * In some cases, a matching Activity may not exist, so ensure you safeguard
1024 * against this.
John Spurlockf8f524c2014-06-10 14:47:29 -04001025 */
1026 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1027 public static final String ACTION_BATTERY_SAVER_SETTINGS
1028 = "android.settings.BATTERY_SAVER_SETTINGS";
1029
Amith Yamasanieb7b94a2014-07-14 18:02:08 -07001030 /**
Barnaby Jamesb3006d32015-04-02 17:49:54 -07001031 * Activity Action: Modify Battery Saver mode setting using a voice command.
1032 * <p>
1033 * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
1034 * <p>
1035 * This intent MUST be started using
1036 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
1037 * startVoiceActivity}.
1038 * <p>
1039 * Note: The activity implementing this intent MUST verify that
1040 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before
1041 * modifying the setting.
1042 * <p>
1043 * Input: To tell which state batter saver mode should be set to, add the
1044 * {@link #EXTRA_BATTERY_SAVER_MODE_ENABLED} extra to this Intent with the state specified.
1045 * If the extra is not included, no changes will be made.
1046 * <p>
1047 * Output: Nothing.
1048 */
1049 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1050 public static final String ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE =
1051 "android.settings.VOICE_CONTROL_BATTERY_SAVER_MODE";
1052
1053 /**
Amith Yamasanieb7b94a2014-07-14 18:02:08 -07001054 * Activity Action: Show Home selection settings. If there are multiple activities
1055 * that can satisfy the {@link Intent#CATEGORY_HOME} intent, this screen allows you
1056 * to pick your preferred activity.
1057 */
1058 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1059 public static final String ACTION_HOME_SETTINGS
1060 = "android.settings.HOME_SETTINGS";
1061
John Spurlock2b0e09c2014-07-27 13:27:47 -04001062 /**
1063 * Activity Action: Show notification settings.
1064 *
1065 * @hide
1066 */
1067 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1068 public static final String ACTION_NOTIFICATION_SETTINGS
1069 = "android.settings.NOTIFICATION_SETTINGS";
1070
1071 /**
1072 * Activity Action: Show notification settings for a single app.
1073 *
1074 * @hide
1075 */
1076 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1077 public static final String ACTION_APP_NOTIFICATION_SETTINGS
1078 = "android.settings.APP_NOTIFICATION_SETTINGS";
1079
Chris Wrencd8f4f72014-08-27 18:48:13 -04001080 /**
1081 * Activity Action: Show notification redaction settings.
1082 *
1083 * @hide
1084 */
1085 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1086 public static final String ACTION_APP_NOTIFICATION_REDACTION
1087 = "android.settings.ACTION_APP_NOTIFICATION_REDACTION";
1088
John Spurlock2b0e09c2014-07-27 13:27:47 -04001089 /** @hide */ public static final String EXTRA_APP_UID = "app_uid";
1090 /** @hide */ public static final String EXTRA_APP_PACKAGE = "app_package";
1091
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001092 // End of Intent actions for Settings
1093
Erikeebc8e22010-02-18 13:27:19 -08001094 /**
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001095 * @hide - Private call() method on SettingsProvider to read from 'system' table.
1096 */
1097 public static final String CALL_METHOD_GET_SYSTEM = "GET_system";
1098
1099 /**
1100 * @hide - Private call() method on SettingsProvider to read from 'secure' table.
1101 */
1102 public static final String CALL_METHOD_GET_SECURE = "GET_secure";
1103
1104 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001105 * @hide - Private call() method on SettingsProvider to read from 'global' table.
1106 */
1107 public static final String CALL_METHOD_GET_GLOBAL = "GET_global";
1108
1109 /**
1110 * @hide - User handle argument extra to the fast-path call()-based requests
1111 */
1112 public static final String CALL_METHOD_USER_KEY = "_user";
1113
1114 /** @hide - Private call() method to write to 'system' table */
1115 public static final String CALL_METHOD_PUT_SYSTEM = "PUT_system";
1116
1117 /** @hide - Private call() method to write to 'secure' table */
1118 public static final String CALL_METHOD_PUT_SECURE = "PUT_secure";
1119
1120 /** @hide - Private call() method to write to 'global' table */
1121 public static final String CALL_METHOD_PUT_GLOBAL= "PUT_global";
1122
1123 /**
Erikeebc8e22010-02-18 13:27:19 -08001124 * Activity Extra: Limit available options in launched activity based on the given authority.
1125 * <p>
1126 * This can be passed as an extra field in an Activity Intent with one or more syncable content
1127 * provider's authorities as a String[]. This field is used by some intents to alter the
1128 * behavior of the called activity.
1129 * <p>
1130 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types available based
1131 * on the authority given.
1132 */
Alon Albert50359c22013-02-26 14:47:48 -08001133 public static final String EXTRA_AUTHORITIES = "authorities";
1134
Alon Albertd35bf1f2013-04-18 14:26:51 -07001135 /**
1136 * Activity Extra: Limit available options in launched activity based on the given account
1137 * types.
1138 * <p>
1139 * This can be passed as an extra field in an Activity Intent with one or more account types
1140 * as a String[]. This field is used by some intents to alter the behavior of the called
1141 * activity.
1142 * <p>
1143 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types to the specified
1144 * list.
1145 */
Alon Albert50359c22013-02-26 14:47:48 -08001146 public static final String EXTRA_ACCOUNT_TYPES = "account_types";
Erikeebc8e22010-02-18 13:27:19 -08001147
Tadashi G. Takaoka25480202011-01-20 23:13:02 +09001148 public static final String EXTRA_INPUT_METHOD_ID = "input_method_id";
1149
Barnaby James48f35522014-07-16 14:27:39 -07001150 /**
Michael Wrightc93fbd12014-09-22 20:07:59 -07001151 * Activity Extra: The device identifier to act upon.
1152 * <p>
1153 * This can be passed as an extra field in an Activity Intent with a single
1154 * InputDeviceIdentifier. This field is used by some activities to jump straight into the
1155 * settings for the given device.
1156 * <p>
Dianne Hackbornad6a99b2014-11-18 10:11:10 -08001157 * Example: The {@link #ACTION_INPUT_METHOD_SETTINGS} intent opens the keyboard layout
1158 * dialog for the given device.
Michael Wrightc93fbd12014-09-22 20:07:59 -07001159 * @hide
1160 */
1161 public static final String EXTRA_INPUT_DEVICE_IDENTIFIER = "input_device_identifier";
1162
1163 /**
Barnaby James48f35522014-07-16 14:27:39 -07001164 * Activity Extra: Enable or disable Airplane Mode.
1165 * <p>
1166 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_AIRPLANE_MODE}
Barnaby Jamesb3006d32015-04-02 17:49:54 -07001167 * intent as a boolean to indicate if it should be enabled.
Barnaby James48f35522014-07-16 14:27:39 -07001168 */
1169 public static final String EXTRA_AIRPLANE_MODE_ENABLED = "airplane_mode_enabled";
1170
Barnaby Jamesb3006d32015-04-02 17:49:54 -07001171 /**
1172 * Activity Extra: Enable or disable Battery saver mode.
1173 * <p>
1174 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE}
1175 * intent as a boolean to indicate if it should be enabled.
1176 */
1177 public static final String EXTRA_BATTERY_SAVER_MODE_ENABLED =
1178 "android.settings.extra.battery_saver_mode_enabled";
1179
1180 /**
1181 * Activity Extra: Enable or disable Do Not Disturb mode.
1182 * <p>
1183 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE}
1184 * intent as a boolean to indicate if it should be enabled.
1185 */
1186 public static final String EXTRA_DO_NOT_DISTURB_MODE_ENABLED =
1187 "android.settings.extra.do_not_disturb_mode_enabled";
1188
1189 /**
1190 * Activity Extra: How many minutes to enable do not disturb mode for.
1191 * <p>
1192 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE}
1193 * intent to indicate how long do not disturb mode should be enabled for.
1194 */
1195 public static final String EXTRA_DO_NOT_DISTURB_MODE_MINUTES =
1196 "android.settings.extra.do_not_disturb_mode_minutes";
1197
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001198 private static final String JID_RESOURCE_PREFIX = "android";
1199
1200 public static final String AUTHORITY = "settings";
1201
1202 private static final String TAG = "Settings";
Christopher Tate06efb532012-08-24 15:29:27 -07001203 private static final boolean LOCAL_LOGV = false;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001204
David Christie3f7b6522013-08-06 19:19:08 -07001205 // Lock ensures that when enabling/disabling the master location switch, we don't end up
1206 // with a partial enable/disable state in multi-threaded situations.
1207 private static final Object mLocationSettingsLock = new Object();
1208
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001209 public static class SettingNotFoundException extends AndroidException {
1210 public SettingNotFoundException(String msg) {
1211 super(msg);
1212 }
1213 }
1214
1215 /**
1216 * Common base for tables of name/value settings.
1217 */
1218 public static class NameValueTable implements BaseColumns {
1219 public static final String NAME = "name";
1220 public static final String VALUE = "value";
1221
1222 protected static boolean putString(ContentResolver resolver, Uri uri,
1223 String name, String value) {
1224 // The database will take care of replacing duplicates.
1225 try {
1226 ContentValues values = new ContentValues();
1227 values.put(NAME, name);
1228 values.put(VALUE, value);
1229 resolver.insert(uri, values);
1230 return true;
1231 } catch (SQLException e) {
Dianne Hackborna33e3f72009-09-29 17:28:24 -07001232 Log.w(TAG, "Can't set key " + name + " in " + uri, e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001233 return false;
1234 }
1235 }
1236
1237 public static Uri getUriFor(Uri uri, String name) {
1238 return Uri.withAppendedPath(uri, name);
1239 }
1240 }
1241
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001242 // Thread-safe.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001243 private static class NameValueCache {
1244 private final String mVersionSystemProperty;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001245 private final Uri mUri;
1246
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001247 private static final String[] SELECT_VALUE =
1248 new String[] { Settings.NameValueTable.VALUE };
1249 private static final String NAME_EQ_PLACEHOLDER = "name=?";
1250
1251 // Must synchronize on 'this' to access mValues and mValuesVersion.
Dan Egnor799f7212009-11-24 16:24:44 -08001252 private final HashMap<String, String> mValues = new HashMap<String, String>();
1253 private long mValuesVersion = 0;
1254
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001255 // Initially null; set lazily and held forever. Synchronized on 'this'.
1256 private IContentProvider mContentProvider = null;
1257
1258 // The method we'll call (or null, to not use) on the provider
1259 // for the fast path of retrieving settings.
Christopher Tate06efb532012-08-24 15:29:27 -07001260 private final String mCallGetCommand;
1261 private final String mCallSetCommand;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001262
Christopher Tate06efb532012-08-24 15:29:27 -07001263 public NameValueCache(String versionSystemProperty, Uri uri,
1264 String getCommand, String setCommand) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001265 mVersionSystemProperty = versionSystemProperty;
1266 mUri = uri;
Christopher Tate06efb532012-08-24 15:29:27 -07001267 mCallGetCommand = getCommand;
1268 mCallSetCommand = setCommand;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001269 }
1270
Christopher Tate06efb532012-08-24 15:29:27 -07001271 private IContentProvider lazyGetProvider(ContentResolver cr) {
1272 IContentProvider cp = null;
1273 synchronized (this) {
1274 cp = mContentProvider;
1275 if (cp == null) {
1276 cp = mContentProvider = cr.acquireProvider(mUri.getAuthority());
1277 }
1278 }
1279 return cp;
1280 }
1281
1282 public boolean putStringForUser(ContentResolver cr, String name, String value,
1283 final int userHandle) {
1284 try {
1285 Bundle arg = new Bundle();
1286 arg.putString(Settings.NameValueTable.VALUE, value);
Christopher Tated5fe1472012-09-10 15:48:38 -07001287 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
Christopher Tate06efb532012-08-24 15:29:27 -07001288 IContentProvider cp = lazyGetProvider(cr);
Dianne Hackborn35654b62013-01-14 17:38:02 -08001289 cp.call(cr.getPackageName(), mCallSetCommand, name, arg);
Christopher Tate06efb532012-08-24 15:29:27 -07001290 } catch (RemoteException e) {
1291 Log.w(TAG, "Can't set key " + name + " in " + mUri, e);
1292 return false;
1293 }
1294 return true;
1295 }
1296
Christopher Tate06efb532012-08-24 15:29:27 -07001297 public String getStringForUser(ContentResolver cr, String name, final int userHandle) {
Christopher Tate78d2a662012-09-13 16:19:44 -07001298 final boolean isSelf = (userHandle == UserHandle.myUserId());
1299 if (isSelf) {
1300 long newValuesVersion = SystemProperties.getLong(mVersionSystemProperty, 0);
Dan Egnor799f7212009-11-24 16:24:44 -08001301
Christopher Tate78d2a662012-09-13 16:19:44 -07001302 // Our own user's settings data uses a client-side cache
1303 synchronized (this) {
1304 if (mValuesVersion != newValuesVersion) {
1305 if (LOCAL_LOGV || false) {
1306 Log.v(TAG, "invalidate [" + mUri.getLastPathSegment() + "]: current "
1307 + newValuesVersion + " != cached " + mValuesVersion);
1308 }
1309
1310 mValues.clear();
1311 mValuesVersion = newValuesVersion;
Dan Egnor799f7212009-11-24 16:24:44 -08001312 }
1313
Christopher Tate78d2a662012-09-13 16:19:44 -07001314 if (mValues.containsKey(name)) {
1315 return mValues.get(name); // Could be null, that's OK -- negative caching
1316 }
Dan Egnor799f7212009-11-24 16:24:44 -08001317 }
Christopher Tate78d2a662012-09-13 16:19:44 -07001318 } else {
1319 if (LOCAL_LOGV) Log.v(TAG, "get setting for user " + userHandle
1320 + " by user " + UserHandle.myUserId() + " so skipping cache");
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001321 }
Dan Egnor799f7212009-11-24 16:24:44 -08001322
Christopher Tate06efb532012-08-24 15:29:27 -07001323 IContentProvider cp = lazyGetProvider(cr);
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001324
1325 // Try the fast path first, not using query(). If this
1326 // fails (alternate Settings provider that doesn't support
1327 // this interface?) then we fall back to the query/table
1328 // interface.
Christopher Tate06efb532012-08-24 15:29:27 -07001329 if (mCallGetCommand != null) {
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001330 try {
Christopher Tate06efb532012-08-24 15:29:27 -07001331 Bundle args = null;
Christopher Tate5e08af02012-09-21 17:17:22 -07001332 if (!isSelf) {
Christopher Tate06efb532012-08-24 15:29:27 -07001333 args = new Bundle();
1334 args.putInt(CALL_METHOD_USER_KEY, userHandle);
1335 }
Dianne Hackborn35654b62013-01-14 17:38:02 -08001336 Bundle b = cp.call(cr.getPackageName(), mCallGetCommand, name, args);
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001337 if (b != null) {
1338 String value = b.getPairValue();
Christopher Tate78d2a662012-09-13 16:19:44 -07001339 // Don't update our cache for reads of other users' data
1340 if (isSelf) {
1341 synchronized (this) {
1342 mValues.put(name, value);
1343 }
1344 } else {
1345 if (LOCAL_LOGV) Log.i(TAG, "call-query of user " + userHandle
1346 + " by " + UserHandle.myUserId()
1347 + " so not updating cache");
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001348 }
1349 return value;
1350 }
1351 // If the response Bundle is null, we fall through
1352 // to the query interface below.
1353 } catch (RemoteException e) {
1354 // Not supported by the remote side? Fall through
1355 // to query().
1356 }
1357 }
1358
Dan Egnor799f7212009-11-24 16:24:44 -08001359 Cursor c = null;
1360 try {
Dianne Hackborn35654b62013-01-14 17:38:02 -08001361 c = cp.query(cr.getPackageName(), mUri, SELECT_VALUE, NAME_EQ_PLACEHOLDER,
Jeff Brown75ea64f2012-01-25 19:37:13 -08001362 new String[]{name}, null, null);
Dan Egnor799f7212009-11-24 16:24:44 -08001363 if (c == null) {
1364 Log.w(TAG, "Can't get key " + name + " from " + mUri);
1365 return null;
1366 }
1367
1368 String value = c.moveToNext() ? c.getString(0) : null;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001369 synchronized (this) {
Dan Egnor799f7212009-11-24 16:24:44 -08001370 mValues.put(name, value);
1371 }
1372 if (LOCAL_LOGV) {
1373 Log.v(TAG, "cache miss [" + mUri.getLastPathSegment() + "]: " +
1374 name + " = " + (value == null ? "(null)" : value));
1375 }
1376 return value;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001377 } catch (RemoteException e) {
Dan Egnor799f7212009-11-24 16:24:44 -08001378 Log.w(TAG, "Can't get key " + name + " from " + mUri, e);
1379 return null; // Return null, but don't cache it.
1380 } finally {
1381 if (c != null) c.close();
1382 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001383 }
1384 }
1385
1386 /**
1387 * System settings, containing miscellaneous system preferences. This
1388 * table holds simple name/value pairs. There are convenience
1389 * functions for accessing individual settings entries.
1390 */
1391 public static final class System extends NameValueTable {
1392 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_system_version";
1393
Svetoslav683914b2015-01-15 14:22:26 -08001394 /** @hide */
1395 public static interface Validator {
1396 public boolean validate(String value);
1397 }
1398
Dianne Hackborn139748f2012-09-24 11:36:57 -07001399 /**
1400 * The content:// style URL for this table
1401 */
1402 public static final Uri CONTENT_URI =
1403 Uri.parse("content://" + AUTHORITY + "/system");
1404
1405 private static final NameValueCache sNameValueCache = new NameValueCache(
1406 SYS_PROP_SETTING_VERSION,
1407 CONTENT_URI,
1408 CALL_METHOD_GET_SYSTEM,
1409 CALL_METHOD_PUT_SYSTEM);
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001410
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001411 private static final HashSet<String> MOVED_TO_SECURE;
1412 static {
1413 MOVED_TO_SECURE = new HashSet<String>(30);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001414 MOVED_TO_SECURE.add(Secure.ANDROID_ID);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001415 MOVED_TO_SECURE.add(Secure.HTTP_PROXY);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001416 MOVED_TO_SECURE.add(Secure.LOCATION_PROVIDERS_ALLOWED);
Danielle Millett925a7d82012-03-19 18:02:20 -04001417 MOVED_TO_SECURE.add(Secure.LOCK_BIOMETRIC_WEAK_FLAGS);
Amith Yamasani156c4352010-03-05 17:10:03 -08001418 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_ENABLED);
1419 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_VISIBLE);
1420 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001421 MOVED_TO_SECURE.add(Secure.LOGGING_ID);
1422 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_ENABLED);
1423 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_LAST_UPDATE);
1424 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_REDIRECT_URL);
1425 MOVED_TO_SECURE.add(Secure.SETTINGS_CLASSNAME);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001426 MOVED_TO_SECURE.add(Secure.USE_GOOGLE_MAIL);
1427 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
1428 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
1429 MOVED_TO_SECURE.add(Secure.WIFI_NUM_OPEN_NETWORKS_KEPT);
1430 MOVED_TO_SECURE.add(Secure.WIFI_ON);
1431 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE);
1432 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_AP_COUNT);
1433 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS);
1434 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED);
1435 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS);
1436 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT);
1437 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_MAX_AP_CHECKS);
1438 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ON);
1439 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_COUNT);
1440 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_DELAY_MS);
1441 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS);
Christopher Tateaa036a22014-05-19 16:33:27 -07001442
1443 // At one time in System, then Global, but now back in Secure
1444 MOVED_TO_SECURE.add(Secure.INSTALL_NON_MARKET_APPS);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001445 }
1446
Christopher Tate06efb532012-08-24 15:29:27 -07001447 private static final HashSet<String> MOVED_TO_GLOBAL;
Christopher Tate66488d62012-10-02 11:58:01 -07001448 private static final HashSet<String> MOVED_TO_SECURE_THEN_GLOBAL;
Christopher Tate06efb532012-08-24 15:29:27 -07001449 static {
1450 MOVED_TO_GLOBAL = new HashSet<String>();
Christopher Tate66488d62012-10-02 11:58:01 -07001451 MOVED_TO_SECURE_THEN_GLOBAL = new HashSet<String>();
1452
Christopher Tate92198742012-09-07 12:00:13 -07001453 // these were originally in system but migrated to secure in the past,
1454 // so are duplicated in the Secure.* namespace
Christopher Tate66488d62012-10-02 11:58:01 -07001455 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.ADB_ENABLED);
1456 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.BLUETOOTH_ON);
1457 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DATA_ROAMING);
1458 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DEVICE_PROVISIONED);
Christopher Tate66488d62012-10-02 11:58:01 -07001459 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.USB_MASS_STORAGE_ENABLED);
1460 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.HTTP_PROXY);
Christopher Tate06efb532012-08-24 15:29:27 -07001461
Christopher Tate92198742012-09-07 12:00:13 -07001462 // these are moving directly from system to global
Christopher Tate06efb532012-08-24 15:29:27 -07001463 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_ON);
1464 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_RADIOS);
1465 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS);
1466 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME);
1467 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME_ZONE);
1468 MOVED_TO_GLOBAL.add(Settings.Global.CAR_DOCK_SOUND);
1469 MOVED_TO_GLOBAL.add(Settings.Global.CAR_UNDOCK_SOUND);
1470 MOVED_TO_GLOBAL.add(Settings.Global.DESK_DOCK_SOUND);
1471 MOVED_TO_GLOBAL.add(Settings.Global.DESK_UNDOCK_SOUND);
1472 MOVED_TO_GLOBAL.add(Settings.Global.DOCK_SOUNDS_ENABLED);
1473 MOVED_TO_GLOBAL.add(Settings.Global.LOCK_SOUND);
1474 MOVED_TO_GLOBAL.add(Settings.Global.UNLOCK_SOUND);
1475 MOVED_TO_GLOBAL.add(Settings.Global.LOW_BATTERY_SOUND);
1476 MOVED_TO_GLOBAL.add(Settings.Global.POWER_SOUNDS_ENABLED);
1477 MOVED_TO_GLOBAL.add(Settings.Global.STAY_ON_WHILE_PLUGGED_IN);
1478 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SLEEP_POLICY);
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07001479 MOVED_TO_GLOBAL.add(Settings.Global.MODE_RINGER);
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001480 MOVED_TO_GLOBAL.add(Settings.Global.WINDOW_ANIMATION_SCALE);
1481 MOVED_TO_GLOBAL.add(Settings.Global.TRANSITION_ANIMATION_SCALE);
1482 MOVED_TO_GLOBAL.add(Settings.Global.ANIMATOR_DURATION_SCALE);
1483 MOVED_TO_GLOBAL.add(Settings.Global.FANCY_IME_ANIMATIONS);
1484 MOVED_TO_GLOBAL.add(Settings.Global.COMPATIBILITY_MODE);
1485 MOVED_TO_GLOBAL.add(Settings.Global.EMERGENCY_TONE);
1486 MOVED_TO_GLOBAL.add(Settings.Global.CALL_AUTO_RETRY);
1487 MOVED_TO_GLOBAL.add(Settings.Global.DEBUG_APP);
1488 MOVED_TO_GLOBAL.add(Settings.Global.WAIT_FOR_DEBUGGER);
1489 MOVED_TO_GLOBAL.add(Settings.Global.SHOW_PROCESSES);
1490 MOVED_TO_GLOBAL.add(Settings.Global.ALWAYS_FINISH_ACTIVITIES);
Geremy Condraa0735112013-03-26 21:49:26 -07001491 MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_CONTENT_URL);
1492 MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_METADATA_URL);
1493 MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_CONTENT_URL);
1494 MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_METADATA_URL);
1495 MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_CONTENT_URL);
1496 MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_METADATA_URL);
1497 MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_CONTENT_URL);
1498 MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_METADATA_URL);
Christopher Tate06efb532012-08-24 15:29:27 -07001499 }
1500
Svetoslav683914b2015-01-15 14:22:26 -08001501 private static final Validator sBooleanValidator =
1502 new DiscreteValueValidator(new String[] {"0", "1"});
1503
1504 private static final Validator sNonNegativeIntegerValidator = new Validator() {
1505 @Override
1506 public boolean validate(String value) {
1507 try {
1508 return Integer.parseInt(value) >= 0;
1509 } catch (NumberFormatException e) {
1510 return false;
1511 }
1512 }
1513 };
1514
Svetoslav683914b2015-01-15 14:22:26 -08001515 private static final Validator sUriValidator = new Validator() {
1516 @Override
1517 public boolean validate(String value) {
1518 try {
1519 Uri.decode(value);
1520 return true;
1521 } catch (IllegalArgumentException e) {
1522 return false;
1523 }
1524 }
1525 };
1526
1527 private static final Validator sLenientIpAddressValidator = new Validator() {
1528 private static final int MAX_IPV6_LENGTH = 45;
1529
1530 @Override
1531 public boolean validate(String value) {
1532 return value.length() <= MAX_IPV6_LENGTH;
1533 }
1534 };
1535
Christopher Tate66488d62012-10-02 11:58:01 -07001536 /** @hide */
Svetoslav683914b2015-01-15 14:22:26 -08001537 public static void getMovedToGlobalSettings(Set<String> outKeySet) {
Christopher Tate66488d62012-10-02 11:58:01 -07001538 outKeySet.addAll(MOVED_TO_GLOBAL);
1539 outKeySet.addAll(MOVED_TO_SECURE_THEN_GLOBAL);
1540 }
1541
1542 /** @hide */
Svetoslav683914b2015-01-15 14:22:26 -08001543 public static void getMovedToSecureSettings(Set<String> outKeySet) {
1544 outKeySet.addAll(MOVED_TO_SECURE);
1545 }
1546
1547 /** @hide */
Christopher Tate66488d62012-10-02 11:58:01 -07001548 public static void getNonLegacyMovedKeys(HashSet<String> outKeySet) {
1549 outKeySet.addAll(MOVED_TO_GLOBAL);
1550 }
1551
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001552 /**
1553 * Look up a name in the database.
1554 * @param resolver to access the database with
1555 * @param name to look up in the table
1556 * @return the corresponding value, or null if not present
1557 */
Dianne Hackborn139748f2012-09-24 11:36:57 -07001558 public static String getString(ContentResolver resolver, String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07001559 return getStringForUser(resolver, name, UserHandle.myUserId());
1560 }
1561
1562 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -07001563 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -07001564 int userHandle) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001565 if (MOVED_TO_SECURE.contains(name)) {
1566 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1567 + " to android.provider.Settings.Secure, returning read-only value.");
Christopher Tate06efb532012-08-24 15:29:27 -07001568 return Secure.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001569 }
Christopher Tate66488d62012-10-02 11:58:01 -07001570 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07001571 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1572 + " to android.provider.Settings.Global, returning read-only value.");
1573 return Global.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001574 }
Christopher Tate06efb532012-08-24 15:29:27 -07001575 return sNameValueCache.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001576 }
1577
1578 /**
1579 * Store a name/value pair into the database.
1580 * @param resolver to access the database with
1581 * @param name to store
1582 * @param value to associate with the name
1583 * @return true if the value was set, false on database errors
1584 */
1585 public static boolean putString(ContentResolver resolver, String name, String value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001586 return putStringForUser(resolver, name, value, UserHandle.myUserId());
1587 }
1588
1589 /** @hide */
1590 public static boolean putStringForUser(ContentResolver resolver, String name, String value,
1591 int userHandle) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001592 if (MOVED_TO_SECURE.contains(name)) {
1593 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1594 + " to android.provider.Settings.Secure, value is unchanged.");
1595 return false;
1596 }
Christopher Tate66488d62012-10-02 11:58:01 -07001597 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07001598 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1599 + " to android.provider.Settings.Global, value is unchanged.");
1600 return false;
1601 }
Christopher Tate06efb532012-08-24 15:29:27 -07001602 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001603 }
1604
1605 /**
1606 * Construct the content URI for a particular name/value pair,
1607 * useful for monitoring changes with a ContentObserver.
1608 * @param name to look up in the table
1609 * @return the corresponding content URI, or null if not present
1610 */
1611 public static Uri getUriFor(String name) {
1612 if (MOVED_TO_SECURE.contains(name)) {
1613 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1614 + " to android.provider.Settings.Secure, returning Secure URI.");
1615 return Secure.getUriFor(Secure.CONTENT_URI, name);
1616 }
Christopher Tate66488d62012-10-02 11:58:01 -07001617 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07001618 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1619 + " to android.provider.Settings.Global, returning read-only global URI.");
1620 return Global.getUriFor(Global.CONTENT_URI, name);
1621 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001622 return getUriFor(CONTENT_URI, name);
1623 }
1624
1625 /**
1626 * Convenience function for retrieving a single system settings value
1627 * as an integer. Note that internally setting values are always
1628 * stored as strings; this function converts the string to an integer
1629 * for you. The default value will be returned if the setting is
1630 * not defined or not an integer.
1631 *
1632 * @param cr The ContentResolver to access.
1633 * @param name The name of the setting to retrieve.
1634 * @param def Value to return if the setting is not defined.
1635 *
1636 * @return The setting's current value, or 'def' if it is not defined
1637 * or not a valid integer.
1638 */
1639 public static int getInt(ContentResolver cr, String name, int def) {
Christopher Tate06efb532012-08-24 15:29:27 -07001640 return getIntForUser(cr, name, def, UserHandle.myUserId());
1641 }
1642
1643 /** @hide */
1644 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
1645 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001646 try {
1647 return v != null ? Integer.parseInt(v) : def;
1648 } catch (NumberFormatException e) {
1649 return def;
1650 }
1651 }
1652
1653 /**
1654 * Convenience function for retrieving a single system settings value
1655 * as an integer. Note that internally setting values are always
1656 * stored as strings; this function converts the string to an integer
1657 * for you.
1658 * <p>
1659 * This version does not take a default value. If the setting has not
1660 * been set, or the string value is not a number,
1661 * it throws {@link SettingNotFoundException}.
1662 *
1663 * @param cr The ContentResolver to access.
1664 * @param name The name of the setting to retrieve.
1665 *
1666 * @throws SettingNotFoundException Thrown if a setting by the given
1667 * name can't be found or the setting value is not an integer.
1668 *
1669 * @return The setting's current value.
1670 */
1671 public static int getInt(ContentResolver cr, String name)
1672 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07001673 return getIntForUser(cr, name, UserHandle.myUserId());
1674 }
1675
1676 /** @hide */
1677 public static int getIntForUser(ContentResolver cr, String name, int userHandle)
1678 throws SettingNotFoundException {
1679 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001680 try {
1681 return Integer.parseInt(v);
1682 } catch (NumberFormatException e) {
1683 throw new SettingNotFoundException(name);
1684 }
1685 }
1686
1687 /**
1688 * Convenience function for updating a single settings value as an
1689 * integer. This will either create a new entry in the table if the
1690 * given name does not exist, or modify the value of the existing row
1691 * with that name. Note that internally setting values are always
1692 * stored as strings, so this function converts the given value to a
1693 * string before storing it.
1694 *
1695 * @param cr The ContentResolver to access.
1696 * @param name The name of the setting to modify.
1697 * @param value The new value for the setting.
1698 * @return true if the value was set, false on database errors
1699 */
1700 public static boolean putInt(ContentResolver cr, String name, int value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001701 return putIntForUser(cr, name, value, UserHandle.myUserId());
1702 }
1703
1704 /** @hide */
1705 public static boolean putIntForUser(ContentResolver cr, String name, int value,
1706 int userHandle) {
1707 return putStringForUser(cr, name, Integer.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001708 }
1709
1710 /**
1711 * Convenience function for retrieving a single system settings value
1712 * as a {@code long}. Note that internally setting values are always
1713 * stored as strings; this function converts the string to a {@code long}
1714 * for you. The default value will be returned if the setting is
1715 * not defined or not a {@code long}.
1716 *
1717 * @param cr The ContentResolver to access.
1718 * @param name The name of the setting to retrieve.
1719 * @param def Value to return if the setting is not defined.
1720 *
1721 * @return The setting's current value, or 'def' if it is not defined
1722 * or not a valid {@code long}.
1723 */
1724 public static long getLong(ContentResolver cr, String name, long def) {
Christopher Tate06efb532012-08-24 15:29:27 -07001725 return getLongForUser(cr, name, def, UserHandle.myUserId());
1726 }
1727
1728 /** @hide */
1729 public static long getLongForUser(ContentResolver cr, String name, long def,
1730 int userHandle) {
1731 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001732 long value;
1733 try {
1734 value = valString != null ? Long.parseLong(valString) : def;
1735 } catch (NumberFormatException e) {
1736 value = def;
1737 }
1738 return value;
1739 }
1740
1741 /**
1742 * Convenience function for retrieving a single system settings value
1743 * as a {@code long}. Note that internally setting values are always
1744 * stored as strings; this function converts the string to a {@code long}
1745 * for you.
1746 * <p>
1747 * This version does not take a default value. If the setting has not
1748 * been set, or the string value is not a number,
1749 * it throws {@link SettingNotFoundException}.
1750 *
1751 * @param cr The ContentResolver to access.
1752 * @param name The name of the setting to retrieve.
1753 *
1754 * @return The setting's current value.
1755 * @throws SettingNotFoundException Thrown if a setting by the given
1756 * name can't be found or the setting value is not an integer.
1757 */
1758 public static long getLong(ContentResolver cr, String name)
1759 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07001760 return getLongForUser(cr, name, UserHandle.myUserId());
1761 }
1762
1763 /** @hide */
1764 public static long getLongForUser(ContentResolver cr, String name, int userHandle)
1765 throws SettingNotFoundException {
1766 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001767 try {
1768 return Long.parseLong(valString);
1769 } catch (NumberFormatException e) {
1770 throw new SettingNotFoundException(name);
1771 }
1772 }
1773
1774 /**
1775 * Convenience function for updating a single settings value as a long
1776 * integer. This will either create a new entry in the table if the
1777 * given name does not exist, or modify the value of the existing row
1778 * with that name. Note that internally setting values are always
1779 * stored as strings, so this function converts the given value to a
1780 * string before storing it.
1781 *
1782 * @param cr The ContentResolver to access.
1783 * @param name The name of the setting to modify.
1784 * @param value The new value for the setting.
1785 * @return true if the value was set, false on database errors
1786 */
1787 public static boolean putLong(ContentResolver cr, String name, long value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001788 return putLongForUser(cr, name, value, UserHandle.myUserId());
1789 }
1790
1791 /** @hide */
1792 public static boolean putLongForUser(ContentResolver cr, String name, long value,
1793 int userHandle) {
1794 return putStringForUser(cr, name, Long.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001795 }
1796
1797 /**
1798 * Convenience function for retrieving a single system settings value
1799 * as a floating point number. Note that internally setting values are
1800 * always stored as strings; this function converts the string to an
1801 * float for you. The default value will be returned if the setting
1802 * is not defined or not a valid float.
1803 *
1804 * @param cr The ContentResolver to access.
1805 * @param name The name of the setting to retrieve.
1806 * @param def Value to return if the setting is not defined.
1807 *
1808 * @return The setting's current value, or 'def' if it is not defined
1809 * or not a valid float.
1810 */
1811 public static float getFloat(ContentResolver cr, String name, float def) {
Christopher Tate06efb532012-08-24 15:29:27 -07001812 return getFloatForUser(cr, name, def, UserHandle.myUserId());
1813 }
1814
1815 /** @hide */
1816 public static float getFloatForUser(ContentResolver cr, String name, float def,
1817 int userHandle) {
1818 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001819 try {
1820 return v != null ? Float.parseFloat(v) : def;
1821 } catch (NumberFormatException e) {
1822 return def;
1823 }
1824 }
1825
1826 /**
1827 * Convenience function for retrieving a single system settings value
1828 * as a float. Note that internally setting values are always
1829 * stored as strings; this function converts the string to a float
1830 * for you.
1831 * <p>
1832 * This version does not take a default value. If the setting has not
1833 * been set, or the string value is not a number,
1834 * it throws {@link SettingNotFoundException}.
1835 *
1836 * @param cr The ContentResolver to access.
1837 * @param name The name of the setting to retrieve.
1838 *
1839 * @throws SettingNotFoundException Thrown if a setting by the given
1840 * name can't be found or the setting value is not a float.
1841 *
1842 * @return The setting's current value.
1843 */
1844 public static float getFloat(ContentResolver cr, String name)
1845 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07001846 return getFloatForUser(cr, name, UserHandle.myUserId());
1847 }
1848
1849 /** @hide */
1850 public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
1851 throws SettingNotFoundException {
1852 String v = getStringForUser(cr, name, userHandle);
Brian Muramatsue1d46982010-12-06 17:34:20 -08001853 if (v == null) {
1854 throw new SettingNotFoundException(name);
1855 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001856 try {
1857 return Float.parseFloat(v);
1858 } catch (NumberFormatException e) {
1859 throw new SettingNotFoundException(name);
1860 }
1861 }
1862
1863 /**
1864 * Convenience function for updating a single settings value as a
1865 * floating point number. This will either create a new entry in the
1866 * table if the given name does not exist, or modify the value of the
1867 * existing row with that name. Note that internally setting values
1868 * are always stored as strings, so this function converts the given
1869 * value to a string before storing it.
1870 *
1871 * @param cr The ContentResolver to access.
1872 * @param name The name of the setting to modify.
1873 * @param value The new value for the setting.
1874 * @return true if the value was set, false on database errors
1875 */
1876 public static boolean putFloat(ContentResolver cr, String name, float value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001877 return putFloatForUser(cr, name, value, UserHandle.myUserId());
1878 }
1879
1880 /** @hide */
1881 public static boolean putFloatForUser(ContentResolver cr, String name, float value,
1882 int userHandle) {
1883 return putStringForUser(cr, name, Float.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001884 }
1885
1886 /**
1887 * Convenience function to read all of the current
1888 * configuration-related settings into a
1889 * {@link Configuration} object.
1890 *
1891 * @param cr The ContentResolver to access.
1892 * @param outConfig Where to place the configuration settings.
1893 */
1894 public static void getConfiguration(ContentResolver cr, Configuration outConfig) {
Christopher Tate06efb532012-08-24 15:29:27 -07001895 getConfigurationForUser(cr, outConfig, UserHandle.myUserId());
1896 }
1897
1898 /** @hide */
1899 public static void getConfigurationForUser(ContentResolver cr, Configuration outConfig,
1900 int userHandle) {
1901 outConfig.fontScale = Settings.System.getFloatForUser(
1902 cr, FONT_SCALE, outConfig.fontScale, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001903 if (outConfig.fontScale < 0) {
1904 outConfig.fontScale = 1;
1905 }
1906 }
1907
1908 /**
Dianne Hackborn31ca8542011-07-19 14:58:28 -07001909 * @hide Erase the fields in the Configuration that should be applied
1910 * by the settings.
1911 */
1912 public static void clearConfiguration(Configuration inoutConfig) {
1913 inoutConfig.fontScale = 0;
1914 }
Narayan Kamath6d632962011-08-24 11:51:37 +01001915
Dianne Hackborn31ca8542011-07-19 14:58:28 -07001916 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001917 * Convenience function to write a batch of configuration-related
1918 * settings from a {@link Configuration} object.
1919 *
1920 * @param cr The ContentResolver to access.
1921 * @param config The settings to write.
1922 * @return true if the values were set, false on database errors
1923 */
1924 public static boolean putConfiguration(ContentResolver cr, Configuration config) {
Christopher Tate06efb532012-08-24 15:29:27 -07001925 return putConfigurationForUser(cr, config, UserHandle.myUserId());
1926 }
1927
1928 /** @hide */
1929 public static boolean putConfigurationForUser(ContentResolver cr, Configuration config,
1930 int userHandle) {
1931 return Settings.System.putFloatForUser(cr, FONT_SCALE, config.fontScale, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001932 }
1933
Dianne Hackbornb8b11a02010-03-10 15:53:11 -08001934 /** @hide */
1935 public static boolean hasInterestingConfigurationChanges(int changes) {
1936 return (changes&ActivityInfo.CONFIG_FONT_SCALE) != 0;
1937 }
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07001938
Christopher Tate06efb532012-08-24 15:29:27 -07001939 /** @deprecated - Do not use */
1940 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001941 public static boolean getShowGTalkServiceStatus(ContentResolver cr) {
Christopher Tate06efb532012-08-24 15:29:27 -07001942 return getShowGTalkServiceStatusForUser(cr, UserHandle.myUserId());
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001943 }
1944
Christopher Tate06efb532012-08-24 15:29:27 -07001945 /**
1946 * @hide
1947 * @deprecated - Do not use
1948 */
1949 public static boolean getShowGTalkServiceStatusForUser(ContentResolver cr,
1950 int userHandle) {
1951 return getIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, 0, userHandle) != 0;
1952 }
1953
1954 /** @deprecated - Do not use */
1955 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001956 public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag) {
Christopher Tatec8c08382012-09-19 17:18:18 -07001957 setShowGTalkServiceStatusForUser(cr, flag, UserHandle.myUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07001958 }
1959
1960 /**
1961 * @hide
1962 * @deprecated - Do not use
1963 */
1964 @Deprecated
1965 public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean flag,
1966 int userHandle) {
1967 putIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, flag ? 1 : 0, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001968 }
1969
Svetoslav683914b2015-01-15 14:22:26 -08001970 private static final class DiscreteValueValidator implements Validator {
1971 private final String[] mValues;
1972
1973 public DiscreteValueValidator(String[] values) {
1974 mValues = values;
1975 }
1976
Svetoslav1b71ea92015-02-17 18:20:29 -08001977 @Override
Svetoslav683914b2015-01-15 14:22:26 -08001978 public boolean validate(String value) {
1979 return ArrayUtils.contains(mValues, value);
1980 }
1981 }
1982
1983 private static final class InclusiveIntegerRangeValidator implements Validator {
1984 private final int mMin;
1985 private final int mMax;
1986
1987 public InclusiveIntegerRangeValidator(int min, int max) {
1988 mMin = min;
1989 mMax = max;
1990 }
1991
Svetoslav1b71ea92015-02-17 18:20:29 -08001992 @Override
Svetoslav683914b2015-01-15 14:22:26 -08001993 public boolean validate(String value) {
1994 try {
1995 final int intValue = Integer.parseInt(value);
1996 return intValue >= mMin && intValue <= mMax;
1997 } catch (NumberFormatException e) {
1998 return false;
1999 }
2000 }
2001 }
2002
2003 private static final class InclusiveFloatRangeValidator implements Validator {
2004 private final float mMin;
2005 private final float mMax;
2006
2007 public InclusiveFloatRangeValidator(float min, float max) {
2008 mMin = min;
2009 mMax = max;
2010 }
2011
Svetoslav1b71ea92015-02-17 18:20:29 -08002012 @Override
Svetoslav683914b2015-01-15 14:22:26 -08002013 public boolean validate(String value) {
2014 try {
2015 final float floatValue = Float.parseFloat(value);
2016 return floatValue >= mMin && floatValue <= mMax;
2017 } catch (NumberFormatException e) {
2018 return false;
2019 }
2020 }
2021 }
2022
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002023 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002024 * @deprecated Use {@link android.provider.Settings.Global#STAY_ON_WHILE_PLUGGED_IN} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002025 */
Christopher Tate06efb532012-08-24 15:29:27 -07002026 @Deprecated
2027 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 -08002028
2029 /**
2030 * What happens when the user presses the end call button if they're not
2031 * on a call.<br/>
2032 * <b>Values:</b><br/>
2033 * 0 - The end button does nothing.<br/>
2034 * 1 - The end button goes to the home screen.<br/>
2035 * 2 - The end button puts the device to sleep and locks the keyguard.<br/>
2036 * 3 - The end button goes to the home screen. If the user is already on the
2037 * home screen, it puts the device to sleep.
2038 */
2039 public static final String END_BUTTON_BEHAVIOR = "end_button_behavior";
2040
Svetoslav683914b2015-01-15 14:22:26 -08002041 private static final Validator END_BUTTON_BEHAVIOR_VALIDATOR =
2042 new InclusiveIntegerRangeValidator(0, 3);
2043
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002044 /**
David Brown458e8062010-03-08 21:52:11 -08002045 * END_BUTTON_BEHAVIOR value for "go home".
2046 * @hide
2047 */
2048 public static final int END_BUTTON_BEHAVIOR_HOME = 0x1;
2049
2050 /**
2051 * END_BUTTON_BEHAVIOR value for "go to sleep".
2052 * @hide
2053 */
2054 public static final int END_BUTTON_BEHAVIOR_SLEEP = 0x2;
2055
2056 /**
2057 * END_BUTTON_BEHAVIOR default value.
2058 * @hide
2059 */
2060 public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_SLEEP;
2061
2062 /**
Joe Onorato9cdffa12011-04-06 18:27:27 -07002063 * Is advanced settings mode turned on. 0 == no, 1 == yes
2064 * @hide
2065 */
2066 public static final String ADVANCED_SETTINGS = "advanced_settings";
2067
Svetoslav683914b2015-01-15 14:22:26 -08002068 private static final Validator ADVANCED_SETTINGS_VALIDATOR = sBooleanValidator;
2069
Joe Onorato9cdffa12011-04-06 18:27:27 -07002070 /**
2071 * ADVANCED_SETTINGS default value.
2072 * @hide
2073 */
2074 public static final int ADVANCED_SETTINGS_DEFAULT = 0;
2075
2076 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002077 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002078 */
Christopher Tate06efb532012-08-24 15:29:27 -07002079 @Deprecated
2080 public static final String AIRPLANE_MODE_ON = Global.AIRPLANE_MODE_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002081
2082 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002083 * @deprecated Use {@link android.provider.Settings.Global#RADIO_BLUETOOTH} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002084 */
Christopher Tate06efb532012-08-24 15:29:27 -07002085 @Deprecated
2086 public static final String RADIO_BLUETOOTH = Global.RADIO_BLUETOOTH;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002087
2088 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002089 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIFI} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002090 */
Christopher Tate06efb532012-08-24 15:29:27 -07002091 @Deprecated
2092 public static final String RADIO_WIFI = Global.RADIO_WIFI;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002093
Robert Greenwalt8588e472011-11-08 10:12:25 -08002094 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002095 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIMAX} instead
Robert Greenwalt8588e472011-11-08 10:12:25 -08002096 * {@hide}
2097 */
Christopher Tate06efb532012-08-24 15:29:27 -07002098 @Deprecated
2099 public static final String RADIO_WIMAX = Global.RADIO_WIMAX;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002100
2101 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002102 * @deprecated Use {@link android.provider.Settings.Global#RADIO_CELL} instead
Nick Pelly8d32a012011-08-09 07:03:49 -07002103 */
Christopher Tate06efb532012-08-24 15:29:27 -07002104 @Deprecated
2105 public static final String RADIO_CELL = Global.RADIO_CELL;
Nick Pelly8d32a012011-08-09 07:03:49 -07002106
2107 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002108 * @deprecated Use {@link android.provider.Settings.Global#RADIO_NFC} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002109 */
Christopher Tate06efb532012-08-24 15:29:27 -07002110 @Deprecated
2111 public static final String RADIO_NFC = Global.RADIO_NFC;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002112
2113 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002114 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_RADIOS} instead
2115 */
2116 @Deprecated
2117 public static final String AIRPLANE_MODE_RADIOS = Global.AIRPLANE_MODE_RADIOS;
2118
2119 /**
2120 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_TOGGLEABLE_RADIOS} instead
Mike Lockwoodbd5ddf02009-07-29 21:37:14 -07002121 *
2122 * {@hide}
2123 */
Christopher Tate06efb532012-08-24 15:29:27 -07002124 @Deprecated
2125 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS =
2126 Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS;
Mike Lockwoodbd5ddf02009-07-29 21:37:14 -07002127
2128 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002129 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002130 */
Christopher Tate06efb532012-08-24 15:29:27 -07002131 @Deprecated
2132 public static final String WIFI_SLEEP_POLICY = Global.WIFI_SLEEP_POLICY;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002133
2134 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002135 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_DEFAULT} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002136 */
Christopher Tate06efb532012-08-24 15:29:27 -07002137 @Deprecated
2138 public static final int WIFI_SLEEP_POLICY_DEFAULT = Global.WIFI_SLEEP_POLICY_DEFAULT;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002139
2140 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002141 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002142 */
Christopher Tate06efb532012-08-24 15:29:27 -07002143 @Deprecated
2144 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED =
2145 Global.WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002146
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002147 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002148 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002149 */
Christopher Tate06efb532012-08-24 15:29:27 -07002150 @Deprecated
2151 public static final int WIFI_SLEEP_POLICY_NEVER = Global.WIFI_SLEEP_POLICY_NEVER;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002152
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07002153 /**
2154 * @deprecated Use {@link android.provider.Settings.Global#MODE_RINGER} instead
2155 */
2156 @Deprecated
2157 public static final String MODE_RINGER = Global.MODE_RINGER;
2158
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002159 /**
2160 * Whether to use static IP and other static network attributes.
2161 * <p>
2162 * Set to 1 for true and 0 for false.
Jeff Sharkey625239a2012-09-26 22:03:49 -07002163 *
2164 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002165 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002166 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002167 public static final String WIFI_USE_STATIC_IP = "wifi_use_static_ip";
2168
Svetoslav683914b2015-01-15 14:22:26 -08002169 private static final Validator WIFI_USE_STATIC_IP_VALIDATOR = sBooleanValidator;
2170
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002171 /**
2172 * The static IP address.
2173 * <p>
2174 * Example: "192.168.1.51"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002175 *
2176 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002177 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002178 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002179 public static final String WIFI_STATIC_IP = "wifi_static_ip";
2180
Svetoslav683914b2015-01-15 14:22:26 -08002181 private static final Validator WIFI_STATIC_IP_VALIDATOR = sLenientIpAddressValidator;
2182
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002183 /**
2184 * If using static IP, the gateway's IP address.
2185 * <p>
2186 * Example: "192.168.1.1"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002187 *
2188 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002189 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002190 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002191 public static final String WIFI_STATIC_GATEWAY = "wifi_static_gateway";
2192
Svetoslav683914b2015-01-15 14:22:26 -08002193 private static final Validator WIFI_STATIC_GATEWAY_VALIDATOR = sLenientIpAddressValidator;
2194
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002195 /**
2196 * If using static IP, the net mask.
2197 * <p>
2198 * Example: "255.255.255.0"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002199 *
2200 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002201 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002202 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002203 public static final String WIFI_STATIC_NETMASK = "wifi_static_netmask";
2204
Svetoslav683914b2015-01-15 14:22:26 -08002205 private static final Validator WIFI_STATIC_NETMASK_VALIDATOR = sLenientIpAddressValidator;
2206
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002207 /**
2208 * If using static IP, the primary DNS's IP address.
2209 * <p>
2210 * Example: "192.168.1.1"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002211 *
2212 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002213 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002214 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002215 public static final String WIFI_STATIC_DNS1 = "wifi_static_dns1";
2216
Svetoslav683914b2015-01-15 14:22:26 -08002217 private static final Validator WIFI_STATIC_DNS1_VALIDATOR = sLenientIpAddressValidator;
2218
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002219 /**
2220 * If using static IP, the secondary DNS's IP address.
2221 * <p>
2222 * Example: "192.168.1.2"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002223 *
2224 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002225 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002226 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002227 public static final String WIFI_STATIC_DNS2 = "wifi_static_dns2";
2228
Svetoslav683914b2015-01-15 14:22:26 -08002229 private static final Validator WIFI_STATIC_DNS2_VALIDATOR = sLenientIpAddressValidator;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002230
2231 /**
2232 * Determines whether remote devices may discover and/or connect to
2233 * this device.
2234 * <P>Type: INT</P>
2235 * 2 -- discoverable and connectable
2236 * 1 -- connectable but not discoverable
2237 * 0 -- neither connectable nor discoverable
2238 */
2239 public static final String BLUETOOTH_DISCOVERABILITY =
2240 "bluetooth_discoverability";
2241
Svetoslav683914b2015-01-15 14:22:26 -08002242 private static final Validator BLUETOOTH_DISCOVERABILITY_VALIDATOR =
2243 new InclusiveIntegerRangeValidator(0, 2);
2244
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002245 /**
2246 * Bluetooth discoverability timeout. If this value is nonzero, then
2247 * Bluetooth becomes discoverable for a certain number of seconds,
2248 * after which is becomes simply connectable. The value is in seconds.
2249 */
2250 public static final String BLUETOOTH_DISCOVERABILITY_TIMEOUT =
2251 "bluetooth_discoverability_timeout";
2252
Svetoslav683914b2015-01-15 14:22:26 -08002253 private static final Validator BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR =
2254 sNonNegativeIntegerValidator;
2255
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002256 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08002257 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_ENABLED}
2258 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002259 */
Amith Yamasani156c4352010-03-05 17:10:03 -08002260 @Deprecated
2261 public static final String LOCK_PATTERN_ENABLED = Secure.LOCK_PATTERN_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002262
2263 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08002264 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_VISIBLE}
2265 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002266 */
Amith Yamasani156c4352010-03-05 17:10:03 -08002267 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002268 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
2269
2270 /**
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07002271 * @deprecated Use
Amith Yamasani156c4352010-03-05 17:10:03 -08002272 * {@link android.provider.Settings.Secure#LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED}
2273 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002274 */
Amith Yamasani156c4352010-03-05 17:10:03 -08002275 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002276 public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED =
2277 "lock_pattern_tactile_feedback_enabled";
2278
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002279 /**
2280 * A formatted string of the next alarm that is set, or the empty string
2281 * if there is no alarm set.
Adrian Roosc42a1e12014-07-07 23:35:53 +02002282 *
2283 * @deprecated Use {@link android.app.AlarmManager#getNextAlarmClock()}.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002284 */
Adrian Roosc42a1e12014-07-07 23:35:53 +02002285 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002286 public static final String NEXT_ALARM_FORMATTED = "next_alarm_formatted";
2287
Svetoslav683914b2015-01-15 14:22:26 -08002288 private static final Validator NEXT_ALARM_FORMATTED_VALIDATOR = new Validator() {
2289 private static final int MAX_LENGTH = 1000;
Svetoslav1b71ea92015-02-17 18:20:29 -08002290
Svetoslav683914b2015-01-15 14:22:26 -08002291 @Override
2292 public boolean validate(String value) {
2293 // TODO: No idea what the correct format is.
Svetoslav64d6e9c2015-02-12 11:30:36 -08002294 return value == null || value.length() < MAX_LENGTH;
Svetoslav683914b2015-01-15 14:22:26 -08002295 }
2296 };
2297
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002298 /**
2299 * Scaling factor for fonts, float.
2300 */
2301 public static final String FONT_SCALE = "font_scale";
2302
Svetoslav683914b2015-01-15 14:22:26 -08002303 private static final Validator FONT_SCALE_VALIDATOR = new Validator() {
2304 @Override
2305 public boolean validate(String value) {
2306 try {
2307 return Float.parseFloat(value) >= 0;
2308 } catch (NumberFormatException e) {
2309 return false;
2310 }
2311 }
2312 };
2313
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002314 /**
2315 * Name of an application package to be debugged.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002316 *
2317 * @deprecated Use {@link Global#DEBUG_APP} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002318 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002319 @Deprecated
2320 public static final String DEBUG_APP = Global.DEBUG_APP;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002321
2322 /**
2323 * If 1, when launching DEBUG_APP it will wait for the debugger before
2324 * starting user code. If 0, it will run normally.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002325 *
2326 * @deprecated Use {@link Global#WAIT_FOR_DEBUGGER} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002327 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002328 @Deprecated
2329 public static final String WAIT_FOR_DEBUGGER = Global.WAIT_FOR_DEBUGGER;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002330
2331 /**
2332 * Whether or not to dim the screen. 0=no 1=yes
Jeff Brown96307042012-07-27 15:51:34 -07002333 * @deprecated This setting is no longer used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002334 */
Jeff Brown96307042012-07-27 15:51:34 -07002335 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002336 public static final String DIM_SCREEN = "dim_screen";
2337
Svetoslav683914b2015-01-15 14:22:26 -08002338 private static final Validator DIM_SCREEN_VALIDATOR = sBooleanValidator;
2339
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002340 /**
Jeff Brown05af6ad2014-09-30 20:54:30 -07002341 * The amount of time in milliseconds before the device goes to sleep or begins
2342 * to dream after a period of inactivity. This value is also known as the
2343 * user activity timeout period since the screen isn't necessarily turned off
2344 * when it expires.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002345 */
2346 public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout";
2347
Svetoslav683914b2015-01-15 14:22:26 -08002348 private static final Validator SCREEN_OFF_TIMEOUT_VALIDATOR = sNonNegativeIntegerValidator;
2349
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002350 /**
2351 * The screen backlight brightness between 0 and 255.
2352 */
2353 public static final String SCREEN_BRIGHTNESS = "screen_brightness";
2354
Svetoslav683914b2015-01-15 14:22:26 -08002355 private static final Validator SCREEN_BRIGHTNESS_VALIDATOR =
2356 new InclusiveIntegerRangeValidator(0, 255);
2357
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002358 /**
Dan Murphy951764b2009-08-27 14:59:03 -05002359 * Control whether to enable automatic brightness mode.
Dan Murphy951764b2009-08-27 14:59:03 -05002360 */
2361 public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode";
2362
Svetoslav683914b2015-01-15 14:22:26 -08002363 private static final Validator SCREEN_BRIGHTNESS_MODE_VALIDATOR = sBooleanValidator;
2364
Dan Murphy951764b2009-08-27 14:59:03 -05002365 /**
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08002366 * Adjustment to auto-brightness to make it generally more (>0.0 <1.0)
2367 * or less (<0.0 >-1.0) bright.
Dianne Hackborn518a3d82012-05-09 16:30:49 -07002368 * @hide
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08002369 */
2370 public static final String SCREEN_AUTO_BRIGHTNESS_ADJ = "screen_auto_brightness_adj";
2371
Svetoslav683914b2015-01-15 14:22:26 -08002372 private static final Validator SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR =
2373 new InclusiveFloatRangeValidator(-1, 1);
2374
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08002375 /**
Mike Lockwooddc3494e2009-10-14 21:17:09 -07002376 * SCREEN_BRIGHTNESS_MODE value for manual mode.
Mike Lockwooddc3494e2009-10-14 21:17:09 -07002377 */
2378 public static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0;
2379
2380 /**
Scott Main52bfc242012-02-09 10:09:14 -08002381 * SCREEN_BRIGHTNESS_MODE value for automatic mode.
Mike Lockwooddc3494e2009-10-14 21:17:09 -07002382 */
2383 public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1;
2384
2385 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002386 * Control whether the process CPU usage meter should be shown.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002387 *
2388 * @deprecated Use {@link Global#SHOW_PROCESSES} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002389 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002390 @Deprecated
2391 public static final String SHOW_PROCESSES = Global.SHOW_PROCESSES;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002392
2393 /**
2394 * If 1, the activity manager will aggressively finish activities and
2395 * processes as soon as they are no longer needed. If 0, the normal
2396 * extended lifetime is used.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002397 *
2398 * @deprecated Use {@link Global#ALWAYS_FINISH_ACTIVITIES} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002399 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002400 @Deprecated
2401 public static final String ALWAYS_FINISH_ACTIVITIES = Global.ALWAYS_FINISH_ACTIVITIES;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002402
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002403 /**
2404 * Determines which streams are affected by ringer mode changes. The
2405 * stream type's bit should be set to 1 if it should be muted when going
2406 * into an inaudible ringer mode.
2407 */
2408 public static final String MODE_RINGER_STREAMS_AFFECTED = "mode_ringer_streams_affected";
2409
Svetoslav683914b2015-01-15 14:22:26 -08002410 private static final Validator MODE_RINGER_STREAMS_AFFECTED_VALIDATOR =
2411 sNonNegativeIntegerValidator;
2412
2413 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002414 * Determines which streams are affected by mute. The
2415 * stream type's bit should be set to 1 if it should be muted when a mute request
2416 * is received.
2417 */
Svetoslav683914b2015-01-15 14:22:26 -08002418 public static final String MUTE_STREAMS_AFFECTED = "mute_streams_affected";
2419
2420 private static final Validator MUTE_STREAMS_AFFECTED_VALIDATOR =
2421 sNonNegativeIntegerValidator;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002422
2423 /**
2424 * Whether vibrate is on for different events. This is used internally,
2425 * changing this value will not change the vibrate. See AudioManager.
2426 */
2427 public static final String VIBRATE_ON = "vibrate_on";
2428
Svetoslav683914b2015-01-15 14:22:26 -08002429 private static final Validator VIBRATE_ON_VALIDATOR = sBooleanValidator;
2430
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002431 /**
Jeff Brown7f6c2312012-04-13 20:38:38 -07002432 * If 1, redirects the system vibrator to all currently attached input devices
2433 * that support vibration. If there are no such input devices, then the system
2434 * vibrator is used instead.
2435 * If 0, does not register the system vibrator.
2436 *
2437 * This setting is mainly intended to provide a compatibility mechanism for
2438 * applications that only know about the system vibrator and do not use the
2439 * input device vibrator API.
2440 *
2441 * @hide
2442 */
2443 public static final String VIBRATE_INPUT_DEVICES = "vibrate_input_devices";
2444
Svetoslav683914b2015-01-15 14:22:26 -08002445 private static final Validator VIBRATE_INPUT_DEVICES_VALIDATOR = sBooleanValidator;
2446
Jeff Brown7f6c2312012-04-13 20:38:38 -07002447 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002448 * Ringer volume. This is used internally, changing this value will not
2449 * change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002450 *
2451 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002452 */
2453 public static final String VOLUME_RING = "volume_ring";
2454
2455 /**
2456 * System/notifications volume. This is used internally, changing this
2457 * value will not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002458 *
2459 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002460 */
2461 public static final String VOLUME_SYSTEM = "volume_system";
2462
2463 /**
2464 * Voice call volume. This is used internally, changing this value will
2465 * not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002466 *
2467 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002468 */
2469 public static final String VOLUME_VOICE = "volume_voice";
2470
2471 /**
2472 * Music/media/gaming volume. This is used internally, changing this
2473 * value will not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002474 *
2475 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002476 */
2477 public static final String VOLUME_MUSIC = "volume_music";
2478
2479 /**
2480 * Alarm volume. This is used internally, changing this
2481 * value will not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002482 *
2483 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002484 */
2485 public static final String VOLUME_ALARM = "volume_alarm";
2486
2487 /**
2488 * Notification volume. This is used internally, changing this
2489 * value will not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002490 *
2491 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002492 */
2493 public static final String VOLUME_NOTIFICATION = "volume_notification";
2494
2495 /**
Eric Laurent484d2882009-12-08 09:05:45 -08002496 * Bluetooth Headset volume. This is used internally, changing this value will
2497 * not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002498 *
2499 * @removed Not used by anything since API 2.
Eric Laurent484d2882009-12-08 09:05:45 -08002500 */
2501 public static final String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco";
2502
2503 /**
Mike Lockwood8517e462011-10-25 14:47:19 -04002504 * Master volume (float in the range 0.0f to 1.0f).
Svetoslavdbbeeb32015-02-18 19:16:25 -08002505 *
Mike Lockwood8517e462011-10-25 14:47:19 -04002506 * @hide
2507 */
2508 public static final String VOLUME_MASTER = "volume_master";
2509
2510 /**
Justin Koh57978ed2012-04-03 17:37:58 -07002511 * Master volume mute (int 1 = mute, 0 = not muted).
2512 *
2513 * @hide
2514 */
2515 public static final String VOLUME_MASTER_MUTE = "volume_master_mute";
2516
Svetoslav683914b2015-01-15 14:22:26 -08002517 private static final Validator VOLUME_MASTER_MUTE_VALIDATOR = sBooleanValidator;
2518
Justin Koh57978ed2012-04-03 17:37:58 -07002519 /**
Julia Reynoldsb53453f2014-08-22 11:42:43 -04002520 * Microphone mute (int 1 = mute, 0 = not muted).
2521 *
2522 * @hide
2523 */
2524 public static final String MICROPHONE_MUTE = "microphone_mute";
2525
Svetoslav683914b2015-01-15 14:22:26 -08002526 private static final Validator MICROPHONE_MUTE_VALIDATOR = sBooleanValidator;
2527
Julia Reynoldsb53453f2014-08-22 11:42:43 -04002528 /**
Justin Koh57978ed2012-04-03 17:37:58 -07002529 * Whether the notifications should use the ring volume (value of 1) or
2530 * a separate notification volume (value of 0). In most cases, users
2531 * will have this enabled so the notification and ringer volumes will be
2532 * the same. However, power users can disable this and use the separate
2533 * notification volume control.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002534 * <p>
Justin Koh57978ed2012-04-03 17:37:58 -07002535 * Note: This is a one-off setting that will be removed in the future
2536 * when there is profile support. For this reason, it is kept hidden
2537 * from the public APIs.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002538 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002539 * @hide
Amith Yamasani42722bf2011-07-22 10:34:27 -07002540 * @deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002541 */
Gilles Debunnee90bed12011-08-30 14:28:27 -07002542 @Deprecated
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002543 public static final String NOTIFICATIONS_USE_RING_VOLUME =
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002544 "notifications_use_ring_volume";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002545
Svetoslav683914b2015-01-15 14:22:26 -08002546 private static final Validator NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR = sBooleanValidator;
2547
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002548 /**
Daniel Sandler6329bf72010-02-26 15:17:44 -05002549 * Whether silent mode should allow vibration feedback. This is used
2550 * internally in AudioService and the Sound settings activity to
2551 * coordinate decoupling of vibrate and silent modes. This setting
2552 * will likely be removed in a future release with support for
2553 * audio/vibe feedback profiles.
2554 *
Eric Laurentbffc3d12012-05-07 17:43:49 -07002555 * Not used anymore. On devices with vibrator, the user explicitly selects
2556 * silent or vibrate mode.
2557 * Kept for use by legacy database upgrade code in DatabaseHelper.
Daniel Sandler6329bf72010-02-26 15:17:44 -05002558 * @hide
2559 */
2560 public static final String VIBRATE_IN_SILENT = "vibrate_in_silent";
2561
Svetoslav683914b2015-01-15 14:22:26 -08002562 private static final Validator VIBRATE_IN_SILENT_VALIDATOR = sBooleanValidator;
2563
Daniel Sandler6329bf72010-02-26 15:17:44 -05002564 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002565 * The mapping of stream type (integer) to its setting.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002566 *
2567 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002568 */
2569 public static final String[] VOLUME_SETTINGS = {
2570 VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC,
Eric Laurent484d2882009-12-08 09:05:45 -08002571 VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002572 };
2573
2574 /**
2575 * Appended to various volume related settings to record the previous
2576 * values before they the settings were affected by a silent/vibrate
2577 * ringer mode change.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002578 *
2579 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002580 */
2581 public static final String APPEND_FOR_LAST_AUDIBLE = "_last_audible";
2582
2583 /**
2584 * Persistent store for the system-wide default ringtone URI.
2585 * <p>
2586 * If you need to play the default ringtone at any given time, it is recommended
2587 * you give {@link #DEFAULT_RINGTONE_URI} to the media player. It will resolve
2588 * to the set default ringtone at the time of playing.
2589 *
2590 * @see #DEFAULT_RINGTONE_URI
2591 */
2592 public static final String RINGTONE = "ringtone";
2593
Svetoslav683914b2015-01-15 14:22:26 -08002594 private static final Validator RINGTONE_VALIDATOR = sUriValidator;
2595
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002596 /**
2597 * A {@link Uri} that will point to the current default ringtone at any
2598 * given time.
2599 * <p>
2600 * If the current default ringtone is in the DRM provider and the caller
2601 * does not have permission, the exception will be a
2602 * FileNotFoundException.
2603 */
2604 public static final Uri DEFAULT_RINGTONE_URI = getUriFor(RINGTONE);
2605
2606 /**
2607 * Persistent store for the system-wide default notification sound.
2608 *
2609 * @see #RINGTONE
2610 * @see #DEFAULT_NOTIFICATION_URI
2611 */
2612 public static final String NOTIFICATION_SOUND = "notification_sound";
2613
Svetoslav683914b2015-01-15 14:22:26 -08002614 private static final Validator NOTIFICATION_SOUND_VALIDATOR = sUriValidator;
2615
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002616 /**
2617 * A {@link Uri} that will point to the current default notification
2618 * sound at any given time.
2619 *
2620 * @see #DEFAULT_RINGTONE_URI
2621 */
2622 public static final Uri DEFAULT_NOTIFICATION_URI = getUriFor(NOTIFICATION_SOUND);
2623
2624 /**
Patrick Scott3156bb002009-04-13 09:57:38 -07002625 * Persistent store for the system-wide default alarm alert.
2626 *
2627 * @see #RINGTONE
2628 * @see #DEFAULT_ALARM_ALERT_URI
2629 */
2630 public static final String ALARM_ALERT = "alarm_alert";
2631
Svetoslav683914b2015-01-15 14:22:26 -08002632 private static final Validator ALARM_ALERT_VALIDATOR = sUriValidator;
2633
Patrick Scott3156bb002009-04-13 09:57:38 -07002634 /**
2635 * A {@link Uri} that will point to the current default alarm alert at
2636 * any given time.
2637 *
2638 * @see #DEFAULT_ALARM_ALERT_URI
2639 */
2640 public static final Uri DEFAULT_ALARM_ALERT_URI = getUriFor(ALARM_ALERT);
2641
2642 /**
Jean-Michel Trivid589fea2011-04-15 11:28:10 -07002643 * Persistent store for the system default media button event receiver.
2644 *
2645 * @hide
2646 */
2647 public static final String MEDIA_BUTTON_RECEIVER = "media_button_receiver";
2648
Svetoslav683914b2015-01-15 14:22:26 -08002649 private static final Validator MEDIA_BUTTON_RECEIVER_VALIDATOR = new Validator() {
2650 @Override
2651 public boolean validate(String value) {
2652 try {
2653 ComponentName.unflattenFromString(value);
2654 return true;
2655 } catch (NullPointerException e) {
2656 return false;
2657 }
2658 }
2659 };
2660
Jean-Michel Trivid589fea2011-04-15 11:28:10 -07002661 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002662 * Setting to enable Auto Replace (AutoText) in text editors. 1 = On, 0 = Off
2663 */
2664 public static final String TEXT_AUTO_REPLACE = "auto_replace";
2665
Svetoslav683914b2015-01-15 14:22:26 -08002666 private static final Validator TEXT_AUTO_REPLACE_VALIDATOR = sBooleanValidator;
2667
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002668 /**
2669 * Setting to enable Auto Caps in text editors. 1 = On, 0 = Off
2670 */
2671 public static final String TEXT_AUTO_CAPS = "auto_caps";
2672
Svetoslav683914b2015-01-15 14:22:26 -08002673 private static final Validator TEXT_AUTO_CAPS_VALIDATOR = sBooleanValidator;
2674
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002675 /**
2676 * Setting to enable Auto Punctuate in text editors. 1 = On, 0 = Off. This
2677 * feature converts two spaces to a "." and space.
2678 */
2679 public static final String TEXT_AUTO_PUNCTUATE = "auto_punctuate";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002680
Svetoslav683914b2015-01-15 14:22:26 -08002681 private static final Validator TEXT_AUTO_PUNCTUATE_VALIDATOR = sBooleanValidator;
2682
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002683 /**
2684 * Setting to showing password characters in text editors. 1 = On, 0 = Off
2685 */
2686 public static final String TEXT_SHOW_PASSWORD = "show_password";
2687
Svetoslav683914b2015-01-15 14:22:26 -08002688 private static final Validator TEXT_SHOW_PASSWORD_VALIDATOR = sBooleanValidator;
2689
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002690 public static final String SHOW_GTALK_SERVICE_STATUS =
2691 "SHOW_GTALK_SERVICE_STATUS";
2692
Svetoslav683914b2015-01-15 14:22:26 -08002693 private static final Validator SHOW_GTALK_SERVICE_STATUS_VALIDATOR = sBooleanValidator;
2694
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002695 /**
2696 * Name of activity to use for wallpaper on the home screen.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002697 *
2698 * @deprecated Use {@link WallpaperManager} instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002699 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002700 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002701 public static final String WALLPAPER_ACTIVITY = "wallpaper_activity";
2702
Svetoslav683914b2015-01-15 14:22:26 -08002703 private static final Validator WALLPAPER_ACTIVITY_VALIDATOR = new Validator() {
2704 private static final int MAX_LENGTH = 1000;
2705
2706 @Override
2707 public boolean validate(String value) {
2708 if (value != null && value.length() > MAX_LENGTH) {
2709 return false;
2710 }
2711 return ComponentName.unflattenFromString(value) != null;
2712 }
2713 };
2714
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002715 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002716 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME}
2717 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002718 */
Christopher Tate06efb532012-08-24 15:29:27 -07002719 @Deprecated
2720 public static final String AUTO_TIME = Global.AUTO_TIME;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002721
2722 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002723 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME_ZONE}
2724 * instead
Amith Yamasaniad450be2010-09-16 16:47:00 -07002725 */
Christopher Tate06efb532012-08-24 15:29:27 -07002726 @Deprecated
2727 public static final String AUTO_TIME_ZONE = Global.AUTO_TIME_ZONE;
Amith Yamasaniad450be2010-09-16 16:47:00 -07002728
2729 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002730 * Display times as 12 or 24 hours
2731 * 12
2732 * 24
2733 */
2734 public static final String TIME_12_24 = "time_12_24";
2735
Svetoslav683914b2015-01-15 14:22:26 -08002736 /** @hide */
2737 public static final Validator TIME_12_24_VALIDATOR =
2738 new DiscreteValueValidator(new String[] {"12", "24"});
2739
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002740 /**
2741 * Date format string
2742 * mm/dd/yyyy
2743 * dd/mm/yyyy
2744 * yyyy/mm/dd
2745 */
2746 public static final String DATE_FORMAT = "date_format";
2747
Svetoslav683914b2015-01-15 14:22:26 -08002748 /** @hide */
2749 public static final Validator DATE_FORMAT_VALIDATOR = new Validator() {
2750 @Override
2751 public boolean validate(String value) {
2752 try {
2753 new SimpleDateFormat(value);
2754 return true;
2755 } catch (IllegalArgumentException e) {
2756 return false;
2757 }
2758 }
2759 };
2760
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002761 /**
2762 * Whether the setup wizard has been run before (on first boot), or if
2763 * it still needs to be run.
2764 *
2765 * nonzero = it has been run in the past
2766 * 0 = it has not been run in the past
2767 */
2768 public static final String SETUP_WIZARD_HAS_RUN = "setup_wizard_has_run";
2769
Svetoslav683914b2015-01-15 14:22:26 -08002770 /** @hide */
2771 public static final Validator SETUP_WIZARD_HAS_RUN_VALIDATOR = sBooleanValidator;
2772
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002773 /**
2774 * Scaling factor for normal window animations. Setting to 0 will disable window
2775 * animations.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002776 *
2777 * @deprecated Use {@link Global#WINDOW_ANIMATION_SCALE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002778 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002779 @Deprecated
2780 public static final String WINDOW_ANIMATION_SCALE = Global.WINDOW_ANIMATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002781
2782 /**
2783 * Scaling factor for activity transition animations. Setting to 0 will disable window
2784 * animations.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002785 *
2786 * @deprecated Use {@link Global#TRANSITION_ANIMATION_SCALE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002787 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002788 @Deprecated
2789 public static final String TRANSITION_ANIMATION_SCALE = Global.TRANSITION_ANIMATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002790
2791 /**
Chet Haasec38fa1f2012-02-01 16:37:46 -08002792 * Scaling factor for Animator-based animations. This affects both the start delay and
2793 * duration of all such animations. Setting to 0 will cause animations to end immediately.
2794 * The default value is 1.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002795 *
2796 * @deprecated Use {@link Global#ANIMATOR_DURATION_SCALE} instead
Chet Haasec38fa1f2012-02-01 16:37:46 -08002797 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002798 @Deprecated
2799 public static final String ANIMATOR_DURATION_SCALE = Global.ANIMATOR_DURATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002800
2801 /**
2802 * Control whether the accelerometer will be used to change screen
2803 * orientation. If 0, it will not be used unless explicitly requested
2804 * by the application; if 1, it will be used by default unless explicitly
2805 * disabled by the application.
2806 */
2807 public static final String ACCELEROMETER_ROTATION = "accelerometer_rotation";
2808
Svetoslav683914b2015-01-15 14:22:26 -08002809 /** @hide */
2810 public static final Validator ACCELEROMETER_ROTATION_VALIDATOR = sBooleanValidator;
2811
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002812 /**
Daniel Sandlerb73617d2010-08-17 00:41:00 -04002813 * Default screen rotation when no other policy applies.
2814 * When {@link #ACCELEROMETER_ROTATION} is zero and no on-screen Activity expresses a
2815 * preference, this rotation value will be used. Must be one of the
Brian Muramatsue1d46982010-12-06 17:34:20 -08002816 * {@link android.view.Surface#ROTATION_0 Surface rotation constants}.
Daniel Sandlerb73617d2010-08-17 00:41:00 -04002817 *
Dianne Hackborn16ec0802014-08-15 18:32:33 -07002818 * @see android.view.Display#getRotation
Daniel Sandlerb73617d2010-08-17 00:41:00 -04002819 */
2820 public static final String USER_ROTATION = "user_rotation";
2821
Svetoslav683914b2015-01-15 14:22:26 -08002822 /** @hide */
2823 public static final Validator USER_ROTATION_VALIDATOR =
2824 new InclusiveIntegerRangeValidator(0, 3);
2825
Daniel Sandlerb73617d2010-08-17 00:41:00 -04002826 /**
Jeff Brown207673cd2012-06-05 17:47:11 -07002827 * Control whether the rotation lock toggle in the System UI should be hidden.
2828 * Typically this is done for accessibility purposes to make it harder for
2829 * the user to accidentally toggle the rotation lock while the display rotation
2830 * has been locked for accessibility.
2831 *
2832 * If 0, then rotation lock toggle is not hidden for accessibility (although it may be
2833 * unavailable for other reasons). If 1, then the rotation lock toggle is hidden.
2834 *
2835 * @hide
2836 */
2837 public static final String HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY =
2838 "hide_rotation_lock_toggle_for_accessibility";
2839
Svetoslav683914b2015-01-15 14:22:26 -08002840 /** @hide */
2841 public static final Validator HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR =
2842 sBooleanValidator;
2843
Jeff Brown207673cd2012-06-05 17:47:11 -07002844 /**
Daisuke Miyakawa3c60eeb2012-05-08 12:08:25 -07002845 * Whether the phone vibrates when it is ringing due to an incoming call. This will
2846 * be used by Phone and Setting apps; it shouldn't affect other apps.
2847 * The value is boolean (1 or 0).
2848 *
2849 * Note: this is not same as "vibrate on ring", which had been available until ICS.
2850 * It was about AudioManager's setting and thus affected all the applications which
2851 * relied on the setting, while this is purely about the vibration setting for incoming
2852 * calls.
Daisuke Miyakawa3c60eeb2012-05-08 12:08:25 -07002853 */
2854 public static final String VIBRATE_WHEN_RINGING = "vibrate_when_ringing";
2855
Svetoslav683914b2015-01-15 14:22:26 -08002856 /** @hide */
2857 public static final Validator VIBRATE_WHEN_RINGING_VALIDATOR = sBooleanValidator;
2858
Daisuke Miyakawa3c60eeb2012-05-08 12:08:25 -07002859 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002860 * Whether the audible DTMF tones are played by the dialer when dialing. The value is
2861 * boolean (1 or 0).
2862 */
2863 public static final String DTMF_TONE_WHEN_DIALING = "dtmf_tone";
2864
Svetoslav683914b2015-01-15 14:22:26 -08002865 /** @hide */
2866 public static final Validator DTMF_TONE_WHEN_DIALING_VALIDATOR = sBooleanValidator;
2867
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002868 /**
David Kraused0f67152009-06-13 18:01:13 -05002869 * CDMA only settings
2870 * DTMF tone type played by the dialer when dialing.
2871 * 0 = Normal
2872 * 1 = Long
David Kraused0f67152009-06-13 18:01:13 -05002873 */
2874 public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type";
2875
Svetoslav683914b2015-01-15 14:22:26 -08002876 /** @hide */
2877 public static final Validator DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR = sBooleanValidator;
2878
David Kraused0f67152009-06-13 18:01:13 -05002879 /**
David Kraused0f67152009-06-13 18:01:13 -05002880 * Whether the hearing aid is enabled. The value is
2881 * boolean (1 or 0).
2882 * @hide
2883 */
2884 public static final String HEARING_AID = "hearing_aid";
2885
Svetoslav683914b2015-01-15 14:22:26 -08002886 /** @hide */
2887 public static final Validator HEARING_AID_VALIDATOR = sBooleanValidator;
2888
David Kraused0f67152009-06-13 18:01:13 -05002889 /**
2890 * CDMA only settings
2891 * TTY Mode
2892 * 0 = OFF
2893 * 1 = FULL
2894 * 2 = VCO
2895 * 3 = HCO
2896 * @hide
2897 */
2898 public static final String TTY_MODE = "tty_mode";
2899
Svetoslav683914b2015-01-15 14:22:26 -08002900 /** @hide */
2901 public static final Validator TTY_MODE_VALIDATOR = new InclusiveIntegerRangeValidator(0, 3);
2902
David Kraused0f67152009-06-13 18:01:13 -05002903 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002904 * Whether the sounds effects (key clicks, lid open ...) are enabled. The value is
2905 * boolean (1 or 0).
2906 */
2907 public static final String SOUND_EFFECTS_ENABLED = "sound_effects_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002908
Svetoslav683914b2015-01-15 14:22:26 -08002909 /** @hide */
2910 public static final Validator SOUND_EFFECTS_ENABLED_VALIDATOR = sBooleanValidator;
2911
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002912 /**
2913 * Whether the haptic feedback (long presses, ...) are enabled. The value is
2914 * boolean (1 or 0).
2915 */
2916 public static final String HAPTIC_FEEDBACK_ENABLED = "haptic_feedback_enabled";
Sanjay Jeyakumar21bf2412009-07-09 13:31:48 -07002917
Svetoslav683914b2015-01-15 14:22:26 -08002918 /** @hide */
2919 public static final Validator HAPTIC_FEEDBACK_ENABLED_VALIDATOR = sBooleanValidator;
2920
Mike LeBeau48603e72009-06-05 00:27:00 +01002921 /**
Bjorn Bringert24abb662010-09-21 12:21:18 +01002922 * @deprecated Each application that shows web suggestions should have its own
2923 * setting for this.
Mike LeBeau48603e72009-06-05 00:27:00 +01002924 */
Bjorn Bringert24abb662010-09-21 12:21:18 +01002925 @Deprecated
Mike LeBeau48603e72009-06-05 00:27:00 +01002926 public static final String SHOW_WEB_SUGGESTIONS = "show_web_suggestions";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002927
Svetoslav683914b2015-01-15 14:22:26 -08002928 /** @hide */
2929 public static final Validator SHOW_WEB_SUGGESTIONS_VALIDATOR = sBooleanValidator;
2930
-b master501eec92009-07-06 13:53:11 -07002931 /**
Amith Yamasaniae3ed702009-12-01 19:02:05 -08002932 * Whether the notification LED should repeatedly flash when a notification is
2933 * pending. The value is boolean (1 or 0).
2934 * @hide
2935 */
2936 public static final String NOTIFICATION_LIGHT_PULSE = "notification_light_pulse";
2937
Svetoslav683914b2015-01-15 14:22:26 -08002938 /** @hide */
2939 public static final Validator NOTIFICATION_LIGHT_PULSE_VALIDATOR = sBooleanValidator;
2940
Amith Yamasaniae3ed702009-12-01 19:02:05 -08002941 /**
Dianne Hackborn90d2db32010-02-11 22:19:06 -08002942 * Show pointer location on screen?
2943 * 0 = no
2944 * 1 = yes
2945 * @hide
2946 */
2947 public static final String POINTER_LOCATION = "pointer_location";
2948
Svetoslav683914b2015-01-15 14:22:26 -08002949 /** @hide */
2950 public static final Validator POINTER_LOCATION_VALIDATOR = sBooleanValidator;
2951
Dianne Hackborn90d2db32010-02-11 22:19:06 -08002952 /**
Jeff Browndaf4a122011-08-26 17:14:14 -07002953 * Show touch positions on screen?
2954 * 0 = no
2955 * 1 = yes
2956 * @hide
2957 */
2958 public static final String SHOW_TOUCHES = "show_touches";
2959
Svetoslav683914b2015-01-15 14:22:26 -08002960 /** @hide */
2961 public static final Validator SHOW_TOUCHES_VALIDATOR = sBooleanValidator;
2962
Jeff Browndaf4a122011-08-26 17:14:14 -07002963 /**
Dianne Hackborn16ec0802014-08-15 18:32:33 -07002964 * Log raw orientation data from
Jorim Jaggib10e33f2015-02-04 21:57:40 +01002965 * {@link com.android.server.policy.WindowOrientationListener} for use with the
Jeff Brown4519f072011-01-23 13:16:01 -08002966 * orientationplot.py tool.
2967 * 0 = no
2968 * 1 = yes
2969 * @hide
2970 */
2971 public static final String WINDOW_ORIENTATION_LISTENER_LOG =
2972 "window_orientation_listener_log";
2973
Svetoslav683914b2015-01-15 14:22:26 -08002974 /** @hide */
2975 public static final Validator WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR = sBooleanValidator;
2976
Jeff Brown4519f072011-01-23 13:16:01 -08002977 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002978 * @deprecated Use {@link android.provider.Settings.Global#POWER_SOUNDS_ENABLED}
2979 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002980 * @hide
2981 */
Christopher Tate06efb532012-08-24 15:29:27 -07002982 @Deprecated
2983 public static final String POWER_SOUNDS_ENABLED = Global.POWER_SOUNDS_ENABLED;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002984
2985 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002986 * @deprecated Use {@link android.provider.Settings.Global#DOCK_SOUNDS_ENABLED}
2987 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002988 * @hide
2989 */
Christopher Tate06efb532012-08-24 15:29:27 -07002990 @Deprecated
2991 public static final String DOCK_SOUNDS_ENABLED = Global.DOCK_SOUNDS_ENABLED;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002992
2993 /**
2994 * Whether to play sounds when the keyguard is shown and dismissed.
2995 * @hide
2996 */
2997 public static final String LOCKSCREEN_SOUNDS_ENABLED = "lockscreen_sounds_enabled";
2998
Svetoslav683914b2015-01-15 14:22:26 -08002999 /** @hide */
3000 public static final Validator LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR = sBooleanValidator;
3001
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003002 /**
Mike Lockwood7bef7392011-10-20 16:51:53 -04003003 * Whether the lockscreen should be completely disabled.
3004 * @hide
3005 */
3006 public static final String LOCKSCREEN_DISABLED = "lockscreen.disabled";
3007
Svetoslav683914b2015-01-15 14:22:26 -08003008 /** @hide */
3009 public static final Validator LOCKSCREEN_DISABLED_VALIDATOR = sBooleanValidator;
3010
Mike Lockwood7bef7392011-10-20 16:51:53 -04003011 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003012 * @deprecated Use {@link android.provider.Settings.Global#LOW_BATTERY_SOUND}
3013 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003014 * @hide
3015 */
Christopher Tate06efb532012-08-24 15:29:27 -07003016 @Deprecated
3017 public static final String LOW_BATTERY_SOUND = Global.LOW_BATTERY_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003018
3019 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003020 * @deprecated Use {@link android.provider.Settings.Global#DESK_DOCK_SOUND}
3021 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003022 * @hide
3023 */
Christopher Tate06efb532012-08-24 15:29:27 -07003024 @Deprecated
3025 public static final String DESK_DOCK_SOUND = Global.DESK_DOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003026
3027 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003028 * @deprecated Use {@link android.provider.Settings.Global#DESK_UNDOCK_SOUND}
3029 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003030 * @hide
3031 */
Christopher Tate06efb532012-08-24 15:29:27 -07003032 @Deprecated
3033 public static final String DESK_UNDOCK_SOUND = Global.DESK_UNDOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003034
3035 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003036 * @deprecated Use {@link android.provider.Settings.Global#CAR_DOCK_SOUND}
3037 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003038 * @hide
3039 */
Christopher Tate06efb532012-08-24 15:29:27 -07003040 @Deprecated
3041 public static final String CAR_DOCK_SOUND = Global.CAR_DOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003042
3043 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003044 * @deprecated Use {@link android.provider.Settings.Global#CAR_UNDOCK_SOUND}
3045 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003046 * @hide
3047 */
Christopher Tate06efb532012-08-24 15:29:27 -07003048 @Deprecated
3049 public static final String CAR_UNDOCK_SOUND = Global.CAR_UNDOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003050
3051 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003052 * @deprecated Use {@link android.provider.Settings.Global#LOCK_SOUND}
3053 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003054 * @hide
3055 */
Christopher Tate06efb532012-08-24 15:29:27 -07003056 @Deprecated
3057 public static final String LOCK_SOUND = Global.LOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003058
3059 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003060 * @deprecated Use {@link android.provider.Settings.Global#UNLOCK_SOUND}
3061 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003062 * @hide
3063 */
Christopher Tate06efb532012-08-24 15:29:27 -07003064 @Deprecated
3065 public static final String UNLOCK_SOUND = Global.UNLOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003066
3067 /**
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003068 * Receive incoming SIP calls?
3069 * 0 = no
3070 * 1 = yes
3071 * @hide
3072 */
3073 public static final String SIP_RECEIVE_CALLS = "sip_receive_calls";
3074
Svetoslav683914b2015-01-15 14:22:26 -08003075 /** @hide */
3076 public static final Validator SIP_RECEIVE_CALLS_VALIDATOR = sBooleanValidator;
3077
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003078 /**
3079 * Call Preference String.
3080 * "SIP_ALWAYS" : Always use SIP with network access
3081 * "SIP_ADDRESS_ONLY" : Only if destination is a SIP address
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003082 * @hide
3083 */
3084 public static final String SIP_CALL_OPTIONS = "sip_call_options";
3085
Svetoslav683914b2015-01-15 14:22:26 -08003086 /** @hide */
3087 public static final Validator SIP_CALL_OPTIONS_VALIDATOR = new DiscreteValueValidator(
3088 new String[] {"SIP_ALWAYS", "SIP_ADDRESS_ONLY"});
3089
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003090 /**
3091 * One of the sip call options: Always use SIP with network access.
3092 * @hide
3093 */
3094 public static final String SIP_ALWAYS = "SIP_ALWAYS";
3095
Svetoslav683914b2015-01-15 14:22:26 -08003096 /** @hide */
3097 public static final Validator SIP_ALWAYS_VALIDATOR = sBooleanValidator;
3098
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003099 /**
3100 * One of the sip call options: Only if destination is a SIP address.
3101 * @hide
3102 */
3103 public static final String SIP_ADDRESS_ONLY = "SIP_ADDRESS_ONLY";
3104
Svetoslav683914b2015-01-15 14:22:26 -08003105 /** @hide */
3106 public static final Validator SIP_ADDRESS_ONLY_VALIDATOR = sBooleanValidator;
3107
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003108 /**
Tyler Gunn2c830a22014-09-02 08:39:35 -07003109 * @deprecated Use SIP_ALWAYS or SIP_ADDRESS_ONLY instead. Formerly used to indicate that
3110 * the user should be prompted each time a call is made whether it should be placed using
3111 * SIP. The {@link com.android.providers.settings.DatabaseHelper} replaces this with
3112 * SIP_ADDRESS_ONLY.
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003113 * @hide
3114 */
Tyler Gunn2c830a22014-09-02 08:39:35 -07003115 @Deprecated
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003116 public static final String SIP_ASK_ME_EACH_TIME = "SIP_ASK_ME_EACH_TIME";
3117
Svetoslav683914b2015-01-15 14:22:26 -08003118 /** @hide */
3119 public static final Validator SIP_ASK_ME_EACH_TIME_VALIDATOR = sBooleanValidator;
3120
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003121 /**
Jeff Brown1a84fd12011-06-02 01:26:32 -07003122 * Pointer speed setting.
3123 * This is an integer value in a range between -7 and +7, so there are 15 possible values.
3124 * -7 = slowest
3125 * 0 = default speed
3126 * +7 = fastest
3127 * @hide
3128 */
3129 public static final String POINTER_SPEED = "pointer_speed";
3130
Svetoslav683914b2015-01-15 14:22:26 -08003131 /** @hide */
3132 public static final Validator POINTER_SPEED_VALIDATOR =
3133 new InclusiveFloatRangeValidator(-7, 7);
3134
Jeff Brown1a84fd12011-06-02 01:26:32 -07003135 /**
Jason Monk56e09b42014-07-18 10:29:14 -04003136 * Whether lock-to-app will be triggered by long-press on recents.
3137 * @hide
3138 */
3139 public static final String LOCK_TO_APP_ENABLED = "lock_to_app_enabled";
3140
Svetoslav683914b2015-01-15 14:22:26 -08003141 /** @hide */
3142 public static final Validator LOCK_TO_APP_ENABLED_VALIDATOR = sBooleanValidator;
3143
Jason Monk56e09b42014-07-18 10:29:14 -04003144 /**
Daniel Sandler2fdb68b2013-10-03 00:12:11 -04003145 * I am the lolrus.
3146 * <p>
3147 * Nonzero values indicate that the user has a bukkit.
3148 * Backward-compatible with <code>PrefGetPreference(prefAllowEasterEggs)</code>.
3149 * @hide
3150 */
3151 public static final String EGG_MODE = "egg_mode";
3152
Svetoslav683914b2015-01-15 14:22:26 -08003153 /** @hide */
Svet Ganovb1918a02015-05-15 09:32:55 -07003154 public static final Validator EGG_MODE_VALIDATOR = new Validator() {
3155 @Override
3156 public boolean validate(String value) {
3157 try {
3158 return Long.parseLong(value) >= 0;
3159 } catch (NumberFormatException e) {
3160 return false;
3161 }
3162 }
3163 };
Svetoslav683914b2015-01-15 14:22:26 -08003164
3165 /**
3166 * IMPORTANT: If you add a new public settings you also have to add it to
3167 * PUBLIC_SETTINGS below. If the new setting is hidden you have to add
3168 * it to PRIVATE_SETTINGS below. Also add a validator that can validate
3169 * the setting value. See an example above.
3170 */
3171
Daniel Sandler2fdb68b2013-10-03 00:12:11 -04003172 /**
-b master501eec92009-07-06 13:53:11 -07003173 * Settings to backup. This is here so that it's in the same place as the settings
3174 * keys and easy to update.
Svetoslav Ganova571a582011-09-20 18:32:20 -07003175 *
3176 * NOTE: Settings are backed up and restored in the order they appear
3177 * in this array. If you have one setting depending on another,
3178 * make sure that they are ordered appropriately.
3179 *
-b master501eec92009-07-06 13:53:11 -07003180 * @hide
3181 */
3182 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate66488d62012-10-02 11:58:01 -07003183 STAY_ON_WHILE_PLUGGED_IN, // moved to global
-b master501eec92009-07-06 13:53:11 -07003184 WIFI_USE_STATIC_IP,
3185 WIFI_STATIC_IP,
3186 WIFI_STATIC_GATEWAY,
3187 WIFI_STATIC_NETMASK,
3188 WIFI_STATIC_DNS1,
3189 WIFI_STATIC_DNS2,
3190 BLUETOOTH_DISCOVERABILITY,
3191 BLUETOOTH_DISCOVERABILITY_TIMEOUT,
3192 DIM_SCREEN,
3193 SCREEN_OFF_TIMEOUT,
3194 SCREEN_BRIGHTNESS,
Christopher Tate362aca62009-09-25 15:58:03 -07003195 SCREEN_BRIGHTNESS_MODE,
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08003196 SCREEN_AUTO_BRIGHTNESS_ADJ,
Jeff Brown7f6c2312012-04-13 20:38:38 -07003197 VIBRATE_INPUT_DEVICES,
Amith Yamasani8823c0a82009-07-07 14:30:17 -07003198 MODE_RINGER_STREAMS_AFFECTED,
-b master501eec92009-07-06 13:53:11 -07003199 TEXT_AUTO_REPLACE,
3200 TEXT_AUTO_CAPS,
3201 TEXT_AUTO_PUNCTUATE,
3202 TEXT_SHOW_PASSWORD,
Christopher Tate66488d62012-10-02 11:58:01 -07003203 AUTO_TIME, // moved to global
3204 AUTO_TIME_ZONE, // moved to global
-b master501eec92009-07-06 13:53:11 -07003205 TIME_12_24,
3206 DATE_FORMAT,
-b master501eec92009-07-06 13:53:11 -07003207 DTMF_TONE_WHEN_DIALING,
3208 DTMF_TONE_TYPE_WHEN_DIALING,
-b master501eec92009-07-06 13:53:11 -07003209 HEARING_AID,
3210 TTY_MODE,
3211 SOUND_EFFECTS_ENABLED,
3212 HAPTIC_FEEDBACK_ENABLED,
Christopher Tate66488d62012-10-02 11:58:01 -07003213 POWER_SOUNDS_ENABLED, // moved to global
3214 DOCK_SOUNDS_ENABLED, // moved to global
Christopher Tate14c2d792010-02-25 16:49:44 -08003215 LOCKSCREEN_SOUNDS_ENABLED,
Amith Yamasaniae3ed702009-12-01 19:02:05 -08003216 SHOW_WEB_SUGGESTIONS,
Mike Lockwoodeabe8bf2010-08-31 14:35:23 -04003217 NOTIFICATION_LIGHT_PULSE,
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003218 SIP_CALL_OPTIONS,
Nick Pelly038cabe2010-09-23 16:12:11 -07003219 SIP_RECEIVE_CALLS,
Jeff Brown1a84fd12011-06-02 01:26:32 -07003220 POINTER_SPEED,
Amith Yamasani622bf2222013-09-06 13:54:28 -07003221 VIBRATE_WHEN_RINGING,
3222 RINGTONE,
Jason Monk94cfd9d2014-10-31 13:18:21 -04003223 LOCK_TO_APP_ENABLED,
Amith Yamasani622bf2222013-09-06 13:54:28 -07003224 NOTIFICATION_SOUND
-b master501eec92009-07-06 13:53:11 -07003225 };
3226
Sailesh Nepal1bd78762014-02-11 22:32:21 -08003227 /**
Amith Yamasanib0ff3222015-03-04 09:56:14 -08003228 * These are all public system settings
Svetoslav683914b2015-01-15 14:22:26 -08003229 *
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07003230 * @hide
3231 */
Svetoslav683914b2015-01-15 14:22:26 -08003232 public static final Set<String> PUBLIC_SETTINGS = new ArraySet<>();
3233 static {
3234 PUBLIC_SETTINGS.add(END_BUTTON_BEHAVIOR);
3235 PUBLIC_SETTINGS.add(WIFI_USE_STATIC_IP);
3236 PUBLIC_SETTINGS.add(WIFI_STATIC_IP);
3237 PUBLIC_SETTINGS.add(WIFI_STATIC_GATEWAY);
3238 PUBLIC_SETTINGS.add(WIFI_STATIC_NETMASK);
3239 PUBLIC_SETTINGS.add(WIFI_STATIC_DNS1);
3240 PUBLIC_SETTINGS.add(WIFI_STATIC_DNS2);
3241 PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY);
3242 PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY_TIMEOUT);
3243 PUBLIC_SETTINGS.add(NEXT_ALARM_FORMATTED);
3244 PUBLIC_SETTINGS.add(FONT_SCALE);
3245 PUBLIC_SETTINGS.add(DIM_SCREEN);
3246 PUBLIC_SETTINGS.add(SCREEN_OFF_TIMEOUT);
3247 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS);
3248 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_MODE);
3249 PUBLIC_SETTINGS.add(MODE_RINGER_STREAMS_AFFECTED);
3250 PUBLIC_SETTINGS.add(MUTE_STREAMS_AFFECTED);
3251 PUBLIC_SETTINGS.add(VIBRATE_ON);
3252 PUBLIC_SETTINGS.add(VOLUME_RING);
3253 PUBLIC_SETTINGS.add(VOLUME_SYSTEM);
3254 PUBLIC_SETTINGS.add(VOLUME_VOICE);
3255 PUBLIC_SETTINGS.add(VOLUME_MUSIC);
3256 PUBLIC_SETTINGS.add(VOLUME_ALARM);
3257 PUBLIC_SETTINGS.add(VOLUME_NOTIFICATION);
3258 PUBLIC_SETTINGS.add(VOLUME_BLUETOOTH_SCO);
3259 PUBLIC_SETTINGS.add(RINGTONE);
3260 PUBLIC_SETTINGS.add(NOTIFICATION_SOUND);
3261 PUBLIC_SETTINGS.add(ALARM_ALERT);
3262 PUBLIC_SETTINGS.add(TEXT_AUTO_REPLACE);
3263 PUBLIC_SETTINGS.add(TEXT_AUTO_CAPS);
3264 PUBLIC_SETTINGS.add(TEXT_AUTO_PUNCTUATE);
3265 PUBLIC_SETTINGS.add(TEXT_SHOW_PASSWORD);
3266 PUBLIC_SETTINGS.add(SHOW_GTALK_SERVICE_STATUS);
3267 PUBLIC_SETTINGS.add(WALLPAPER_ACTIVITY);
3268 PUBLIC_SETTINGS.add(TIME_12_24);
3269 PUBLIC_SETTINGS.add(DATE_FORMAT);
3270 PUBLIC_SETTINGS.add(SETUP_WIZARD_HAS_RUN);
3271 PUBLIC_SETTINGS.add(ACCELEROMETER_ROTATION);
3272 PUBLIC_SETTINGS.add(USER_ROTATION);
3273 PUBLIC_SETTINGS.add(DTMF_TONE_WHEN_DIALING);
3274 PUBLIC_SETTINGS.add(SOUND_EFFECTS_ENABLED);
3275 PUBLIC_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED);
3276 PUBLIC_SETTINGS.add(SHOW_WEB_SUGGESTIONS);
3277 }
3278
3279 /**
3280 * These are all hidden system settings.
3281 *
3282 * @hide
3283 */
3284 public static final Set<String> PRIVATE_SETTINGS = new ArraySet<>();
3285 static {
3286 PRIVATE_SETTINGS.add(WIFI_USE_STATIC_IP);
3287 PRIVATE_SETTINGS.add(END_BUTTON_BEHAVIOR);
3288 PRIVATE_SETTINGS.add(ADVANCED_SETTINGS);
3289 PRIVATE_SETTINGS.add(SCREEN_AUTO_BRIGHTNESS_ADJ);
3290 PRIVATE_SETTINGS.add(VIBRATE_INPUT_DEVICES);
3291 PRIVATE_SETTINGS.add(VOLUME_MASTER);
3292 PRIVATE_SETTINGS.add(VOLUME_MASTER_MUTE);
3293 PRIVATE_SETTINGS.add(MICROPHONE_MUTE);
3294 PRIVATE_SETTINGS.add(NOTIFICATIONS_USE_RING_VOLUME);
3295 PRIVATE_SETTINGS.add(VIBRATE_IN_SILENT);
3296 PRIVATE_SETTINGS.add(MEDIA_BUTTON_RECEIVER);
3297 PRIVATE_SETTINGS.add(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY);
3298 PRIVATE_SETTINGS.add(VIBRATE_WHEN_RINGING);
3299 PRIVATE_SETTINGS.add(DTMF_TONE_TYPE_WHEN_DIALING);
3300 PRIVATE_SETTINGS.add(HEARING_AID);
3301 PRIVATE_SETTINGS.add(TTY_MODE);
3302 PRIVATE_SETTINGS.add(NOTIFICATION_LIGHT_PULSE);
3303 PRIVATE_SETTINGS.add(POINTER_LOCATION);
3304 PRIVATE_SETTINGS.add(SHOW_TOUCHES);
3305 PRIVATE_SETTINGS.add(WINDOW_ORIENTATION_LISTENER_LOG);
3306 PRIVATE_SETTINGS.add(POWER_SOUNDS_ENABLED);
3307 PRIVATE_SETTINGS.add(DOCK_SOUNDS_ENABLED);
3308 PRIVATE_SETTINGS.add(LOCKSCREEN_SOUNDS_ENABLED);
3309 PRIVATE_SETTINGS.add(LOCKSCREEN_DISABLED);
3310 PRIVATE_SETTINGS.add(LOW_BATTERY_SOUND);
3311 PRIVATE_SETTINGS.add(DESK_DOCK_SOUND);
3312 PRIVATE_SETTINGS.add(DESK_UNDOCK_SOUND);
3313 PRIVATE_SETTINGS.add(CAR_DOCK_SOUND);
3314 PRIVATE_SETTINGS.add(CAR_UNDOCK_SOUND);
3315 PRIVATE_SETTINGS.add(LOCK_SOUND);
3316 PRIVATE_SETTINGS.add(UNLOCK_SOUND);
3317 PRIVATE_SETTINGS.add(SIP_RECEIVE_CALLS);
3318 PRIVATE_SETTINGS.add(SIP_CALL_OPTIONS);
3319 PRIVATE_SETTINGS.add(SIP_ALWAYS);
3320 PRIVATE_SETTINGS.add(SIP_ADDRESS_ONLY);
3321 PRIVATE_SETTINGS.add(SIP_ASK_ME_EACH_TIME);
3322 PRIVATE_SETTINGS.add(POINTER_SPEED);
3323 PRIVATE_SETTINGS.add(LOCK_TO_APP_ENABLED);
3324 PRIVATE_SETTINGS.add(EGG_MODE);
3325 }
3326
3327 /**
Amith Yamasanib0ff3222015-03-04 09:56:14 -08003328 * These are all public system settings
Svetoslav683914b2015-01-15 14:22:26 -08003329 *
3330 * @hide
3331 */
3332 public static final Map<String, Validator> VALIDATORS = new ArrayMap<>();
3333 static {
3334 VALIDATORS.put(END_BUTTON_BEHAVIOR,END_BUTTON_BEHAVIOR_VALIDATOR);
3335 VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR);
3336 VALIDATORS.put(BLUETOOTH_DISCOVERABILITY, BLUETOOTH_DISCOVERABILITY_VALIDATOR);
3337 VALIDATORS.put(BLUETOOTH_DISCOVERABILITY_TIMEOUT,
3338 BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR);
3339 VALIDATORS.put(NEXT_ALARM_FORMATTED, NEXT_ALARM_FORMATTED_VALIDATOR);
3340 VALIDATORS.put(FONT_SCALE, FONT_SCALE_VALIDATOR);
3341 VALIDATORS.put(DIM_SCREEN, DIM_SCREEN_VALIDATOR);
3342 VALIDATORS.put(SCREEN_OFF_TIMEOUT, SCREEN_OFF_TIMEOUT_VALIDATOR);
3343 VALIDATORS.put(SCREEN_BRIGHTNESS, SCREEN_BRIGHTNESS_VALIDATOR);
3344 VALIDATORS.put(SCREEN_BRIGHTNESS_MODE, SCREEN_BRIGHTNESS_MODE_VALIDATOR);
3345 VALIDATORS.put(MODE_RINGER_STREAMS_AFFECTED, MODE_RINGER_STREAMS_AFFECTED_VALIDATOR);
3346 VALIDATORS.put(MUTE_STREAMS_AFFECTED, MUTE_STREAMS_AFFECTED_VALIDATOR);
3347 VALIDATORS.put(VIBRATE_ON, VIBRATE_ON_VALIDATOR);
Svetoslav683914b2015-01-15 14:22:26 -08003348 VALIDATORS.put(RINGTONE, RINGTONE_VALIDATOR);
3349 VALIDATORS.put(NOTIFICATION_SOUND, NOTIFICATION_SOUND_VALIDATOR);
3350 VALIDATORS.put(ALARM_ALERT, ALARM_ALERT_VALIDATOR);
3351 VALIDATORS.put(TEXT_AUTO_REPLACE, TEXT_AUTO_REPLACE_VALIDATOR);
3352 VALIDATORS.put(TEXT_AUTO_CAPS, TEXT_AUTO_CAPS_VALIDATOR);
3353 VALIDATORS.put(TEXT_AUTO_PUNCTUATE, TEXT_AUTO_PUNCTUATE_VALIDATOR);
3354 VALIDATORS.put(TEXT_SHOW_PASSWORD, TEXT_SHOW_PASSWORD_VALIDATOR);
3355 VALIDATORS.put(SHOW_GTALK_SERVICE_STATUS, SHOW_GTALK_SERVICE_STATUS_VALIDATOR);
3356 VALIDATORS.put(WALLPAPER_ACTIVITY, WALLPAPER_ACTIVITY_VALIDATOR);
3357 VALIDATORS.put(TIME_12_24, TIME_12_24_VALIDATOR);
3358 VALIDATORS.put(DATE_FORMAT, DATE_FORMAT_VALIDATOR);
3359 VALIDATORS.put(SETUP_WIZARD_HAS_RUN, SETUP_WIZARD_HAS_RUN_VALIDATOR);
3360 VALIDATORS.put(ACCELEROMETER_ROTATION, ACCELEROMETER_ROTATION_VALIDATOR);
3361 VALIDATORS.put(USER_ROTATION, USER_ROTATION_VALIDATOR);
3362 VALIDATORS.put(DTMF_TONE_WHEN_DIALING, DTMF_TONE_WHEN_DIALING_VALIDATOR);
3363 VALIDATORS.put(SOUND_EFFECTS_ENABLED, SOUND_EFFECTS_ENABLED_VALIDATOR);
3364 VALIDATORS.put(HAPTIC_FEEDBACK_ENABLED, HAPTIC_FEEDBACK_ENABLED_VALIDATOR);
3365 VALIDATORS.put(SHOW_WEB_SUGGESTIONS, SHOW_WEB_SUGGESTIONS_VALIDATOR);
3366 VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR);
3367 VALIDATORS.put(END_BUTTON_BEHAVIOR, END_BUTTON_BEHAVIOR_VALIDATOR);
3368 VALIDATORS.put(ADVANCED_SETTINGS, ADVANCED_SETTINGS_VALIDATOR);
3369 VALIDATORS.put(SCREEN_AUTO_BRIGHTNESS_ADJ, SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR);
3370 VALIDATORS.put(VIBRATE_INPUT_DEVICES, VIBRATE_INPUT_DEVICES_VALIDATOR);
Svetoslav683914b2015-01-15 14:22:26 -08003371 VALIDATORS.put(VOLUME_MASTER_MUTE, VOLUME_MASTER_MUTE_VALIDATOR);
3372 VALIDATORS.put(MICROPHONE_MUTE, MICROPHONE_MUTE_VALIDATOR);
3373 VALIDATORS.put(NOTIFICATIONS_USE_RING_VOLUME, NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR);
3374 VALIDATORS.put(VIBRATE_IN_SILENT, VIBRATE_IN_SILENT_VALIDATOR);
3375 VALIDATORS.put(MEDIA_BUTTON_RECEIVER, MEDIA_BUTTON_RECEIVER_VALIDATOR);
3376 VALIDATORS.put(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY,
3377 HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR);
3378 VALIDATORS.put(VIBRATE_WHEN_RINGING, VIBRATE_WHEN_RINGING_VALIDATOR);
3379 VALIDATORS.put(DTMF_TONE_TYPE_WHEN_DIALING, DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR);
3380 VALIDATORS.put(HEARING_AID, HEARING_AID_VALIDATOR);
3381 VALIDATORS.put(TTY_MODE, TTY_MODE_VALIDATOR);
3382 VALIDATORS.put(NOTIFICATION_LIGHT_PULSE, NOTIFICATION_LIGHT_PULSE_VALIDATOR);
3383 VALIDATORS.put(POINTER_LOCATION, POINTER_LOCATION_VALIDATOR);
3384 VALIDATORS.put(SHOW_TOUCHES, SHOW_TOUCHES_VALIDATOR);
3385 VALIDATORS.put(WINDOW_ORIENTATION_LISTENER_LOG,
3386 WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR);
3387 VALIDATORS.put(LOCKSCREEN_SOUNDS_ENABLED, LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR);
3388 VALIDATORS.put(LOCKSCREEN_DISABLED, LOCKSCREEN_DISABLED_VALIDATOR);
3389 VALIDATORS.put(SIP_RECEIVE_CALLS, SIP_RECEIVE_CALLS_VALIDATOR);
3390 VALIDATORS.put(SIP_CALL_OPTIONS, SIP_CALL_OPTIONS_VALIDATOR);
3391 VALIDATORS.put(SIP_ALWAYS, SIP_ALWAYS_VALIDATOR);
3392 VALIDATORS.put(SIP_ADDRESS_ONLY, SIP_ADDRESS_ONLY_VALIDATOR);
3393 VALIDATORS.put(SIP_ASK_ME_EACH_TIME, SIP_ASK_ME_EACH_TIME_VALIDATOR);
3394 VALIDATORS.put(POINTER_SPEED, POINTER_SPEED_VALIDATOR);
3395 VALIDATORS.put(LOCK_TO_APP_ENABLED, LOCK_TO_APP_ENABLED_VALIDATOR);
3396 VALIDATORS.put(EGG_MODE, EGG_MODE_VALIDATOR);
3397 VALIDATORS.put(WIFI_STATIC_IP, WIFI_STATIC_IP_VALIDATOR);
3398 VALIDATORS.put(WIFI_STATIC_GATEWAY, WIFI_STATIC_GATEWAY_VALIDATOR);
3399 VALIDATORS.put(WIFI_STATIC_NETMASK, WIFI_STATIC_NETMASK_VALIDATOR);
3400 VALIDATORS.put(WIFI_STATIC_DNS1, WIFI_STATIC_DNS1_VALIDATOR);
3401 VALIDATORS.put(WIFI_STATIC_DNS2, WIFI_STATIC_DNS2_VALIDATOR);
3402 }
3403
3404 /**
3405 * These entries are considered common between the personal and the managed profile,
3406 * since the managed profile doesn't get to change them.
3407 */
3408 private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>();
3409 static {
3410 CLONE_TO_MANAGED_PROFILE.add(DATE_FORMAT);
3411 CLONE_TO_MANAGED_PROFILE.add(HAPTIC_FEEDBACK_ENABLED);
3412 CLONE_TO_MANAGED_PROFILE.add(SOUND_EFFECTS_ENABLED);
3413 CLONE_TO_MANAGED_PROFILE.add(TEXT_SHOW_PASSWORD);
3414 CLONE_TO_MANAGED_PROFILE.add(TIME_12_24);
3415 }
3416
3417 /** @hide */
3418 public static void getCloneToManagedProfileSettings(Set<String> outKeySet) {
3419 outKeySet.addAll(CLONE_TO_MANAGED_PROFILE);
3420 }
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07003421
3422 /**
Sailesh Nepal1bd78762014-02-11 22:32:21 -08003423 * When to use Wi-Fi calling
3424 *
3425 * @see android.telephony.TelephonyManager.WifiCallingChoices
3426 * @hide
3427 */
3428 public static final String WHEN_TO_MAKE_WIFI_CALLS = "when_to_make_wifi_calls";
3429
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003430 // Settings moved to Settings.Secure
3431
3432 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003433 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003434 * instead
3435 */
3436 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003437 public static final String ADB_ENABLED = Global.ADB_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003438
3439 /**
3440 * @deprecated Use {@link android.provider.Settings.Secure#ANDROID_ID} instead
3441 */
3442 @Deprecated
3443 public static final String ANDROID_ID = Secure.ANDROID_ID;
3444
3445 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003446 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003447 */
3448 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003449 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003450
3451 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003452 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003453 */
3454 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003455 public static final String DATA_ROAMING = Global.DATA_ROAMING;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003456
3457 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003458 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003459 */
3460 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003461 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003462
3463 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07003464 * @deprecated Use {@link android.provider.Settings.Global#HTTP_PROXY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003465 */
3466 @Deprecated
Jeff Sharkey625239a2012-09-26 22:03:49 -07003467 public static final String HTTP_PROXY = Global.HTTP_PROXY;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003468
3469 /**
Christopher Tateaa036a22014-05-19 16:33:27 -07003470 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003471 */
3472 @Deprecated
Christopher Tateaa036a22014-05-19 16:33:27 -07003473 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003474
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003475 /**
3476 * @deprecated Use {@link android.provider.Settings.Secure#LOCATION_PROVIDERS_ALLOWED}
3477 * instead
3478 */
3479 @Deprecated
3480 public static final String LOCATION_PROVIDERS_ALLOWED = Secure.LOCATION_PROVIDERS_ALLOWED;
3481
3482 /**
3483 * @deprecated Use {@link android.provider.Settings.Secure#LOGGING_ID} instead
3484 */
3485 @Deprecated
3486 public static final String LOGGING_ID = Secure.LOGGING_ID;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003487
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003488 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003489 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003490 */
3491 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003492 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003493
3494 /**
3495 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_ENABLED}
3496 * instead
3497 */
3498 @Deprecated
3499 public static final String PARENTAL_CONTROL_ENABLED = Secure.PARENTAL_CONTROL_ENABLED;
3500
3501 /**
3502 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_LAST_UPDATE}
3503 * instead
3504 */
3505 @Deprecated
3506 public static final String PARENTAL_CONTROL_LAST_UPDATE = Secure.PARENTAL_CONTROL_LAST_UPDATE;
3507
3508 /**
3509 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_REDIRECT_URL}
3510 * instead
3511 */
3512 @Deprecated
3513 public static final String PARENTAL_CONTROL_REDIRECT_URL =
3514 Secure.PARENTAL_CONTROL_REDIRECT_URL;
3515
3516 /**
3517 * @deprecated Use {@link android.provider.Settings.Secure#SETTINGS_CLASSNAME} instead
3518 */
3519 @Deprecated
3520 public static final String SETTINGS_CLASSNAME = Secure.SETTINGS_CLASSNAME;
3521
3522 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003523 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003524 */
3525 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003526 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003527
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003528 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003529 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003530 */
3531 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003532 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003533
Dianne Hackborn4a51c202009-08-21 15:14:02 -07003534 /**
3535 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07003536 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
Dianne Hackborn4a51c202009-08-21 15:14:02 -07003537 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003538 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003539 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 -08003540
Dianne Hackborn4a51c202009-08-21 15:14:02 -07003541 /**
3542 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07003543 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
Dianne Hackborn4a51c202009-08-21 15:14:02 -07003544 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003545 @Deprecated
3546 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
Christopher Tate06efb532012-08-24 15:29:27 -07003547 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003548
3549 /**
3550 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07003551 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003552 */
3553 @Deprecated
3554 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
Christopher Tate06efb532012-08-24 15:29:27 -07003555 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003556
3557 /**
3558 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07003559 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003560 */
3561 @Deprecated
3562 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
Christopher Tate06efb532012-08-24 15:29:27 -07003563 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003564
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003565 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003566 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003567 * instead
3568 */
3569 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003570 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 -08003571
3572 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003573 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003574 */
3575 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003576 public static final String WIFI_ON = Global.WIFI_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003577
3578 /**
3579 * @deprecated Use
3580 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE}
3581 * instead
3582 */
3583 @Deprecated
3584 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
3585 Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE;
3586
3587 /**
3588 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_AP_COUNT} instead
3589 */
3590 @Deprecated
3591 public static final String WIFI_WATCHDOG_AP_COUNT = Secure.WIFI_WATCHDOG_AP_COUNT;
3592
3593 /**
3594 * @deprecated Use
3595 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS} instead
3596 */
3597 @Deprecated
3598 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
3599 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003600
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003601 /**
3602 * @deprecated Use
3603 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED} instead
3604 */
3605 @Deprecated
3606 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
3607 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED;
3608
3609 /**
3610 * @deprecated Use
3611 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS}
3612 * instead
3613 */
3614 @Deprecated
3615 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
3616 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS;
3617
3618 /**
3619 * @deprecated Use
3620 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT} instead
3621 */
3622 @Deprecated
3623 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
3624 Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT;
3625
3626 /**
3627 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_MAX_AP_CHECKS}
3628 * instead
3629 */
3630 @Deprecated
3631 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = Secure.WIFI_WATCHDOG_MAX_AP_CHECKS;
3632
3633 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003634 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003635 */
3636 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003637 public static final String WIFI_WATCHDOG_ON = Global.WIFI_WATCHDOG_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003638
3639 /**
3640 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_COUNT} instead
3641 */
3642 @Deprecated
3643 public static final String WIFI_WATCHDOG_PING_COUNT = Secure.WIFI_WATCHDOG_PING_COUNT;
3644
3645 /**
3646 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_DELAY_MS}
3647 * instead
3648 */
3649 @Deprecated
3650 public static final String WIFI_WATCHDOG_PING_DELAY_MS = Secure.WIFI_WATCHDOG_PING_DELAY_MS;
3651
3652 /**
3653 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_TIMEOUT_MS}
3654 * instead
3655 */
3656 @Deprecated
3657 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS =
3658 Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS;
3659 }
3660
3661 /**
3662 * Secure system settings, containing system preferences that applications
3663 * can read but are not allowed to write. These are for preferences that
3664 * the user must explicitly modify through the system UI or specialized
3665 * APIs for those values, not modified directly by applications.
3666 */
3667 public static final class Secure extends NameValueTable {
3668 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_secure_version";
3669
Dianne Hackborn139748f2012-09-24 11:36:57 -07003670 /**
3671 * The content:// style URL for this table
3672 */
3673 public static final Uri CONTENT_URI =
3674 Uri.parse("content://" + AUTHORITY + "/secure");
3675
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08003676 // Populated lazily, guarded by class object:
Dianne Hackborn139748f2012-09-24 11:36:57 -07003677 private static final NameValueCache sNameValueCache = new NameValueCache(
3678 SYS_PROP_SETTING_VERSION,
3679 CONTENT_URI,
3680 CALL_METHOD_GET_SECURE,
3681 CALL_METHOD_PUT_SECURE);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003682
Amith Yamasani52c489c2012-03-28 11:42:42 -07003683 private static ILockSettings sLockSettings = null;
3684
Amith Yamasani7ab8c4a2012-04-06 09:27:12 -07003685 private static boolean sIsSystemProcess;
Amith Yamasani52c489c2012-03-28 11:42:42 -07003686 private static final HashSet<String> MOVED_TO_LOCK_SETTINGS;
Christopher Tate06efb532012-08-24 15:29:27 -07003687 private static final HashSet<String> MOVED_TO_GLOBAL;
Amith Yamasani52c489c2012-03-28 11:42:42 -07003688 static {
3689 MOVED_TO_LOCK_SETTINGS = new HashSet<String>(3);
3690 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_ENABLED);
3691 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_VISIBLE);
3692 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
Christopher Tate06efb532012-08-24 15:29:27 -07003693
3694 MOVED_TO_GLOBAL = new HashSet<String>();
3695 MOVED_TO_GLOBAL.add(Settings.Global.ADB_ENABLED);
3696 MOVED_TO_GLOBAL.add(Settings.Global.ASSISTED_GPS_ENABLED);
3697 MOVED_TO_GLOBAL.add(Settings.Global.BLUETOOTH_ON);
Christopher Tate58f41ec2013-01-11 15:40:36 -08003698 MOVED_TO_GLOBAL.add(Settings.Global.BUGREPORT_IN_POWER_MENU);
Christopher Tate06efb532012-08-24 15:29:27 -07003699 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_CELL_BROADCAST_SMS);
3700 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_ROAMING_MODE);
3701 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_SUBSCRIPTION_MODE);
3702 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_MOBILE);
3703 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_WIFI);
3704 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ROAMING);
3705 MOVED_TO_GLOBAL.add(Settings.Global.DEVELOPMENT_SETTINGS_ENABLED);
3706 MOVED_TO_GLOBAL.add(Settings.Global.DEVICE_PROVISIONED);
3707 MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_DENSITY_FORCED);
3708 MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_SIZE_FORCED);
3709 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_MAX_BYTES_OVER_MOBILE);
3710 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE);
Christopher Tate06efb532012-08-24 15:29:27 -07003711 MOVED_TO_GLOBAL.add(Settings.Global.MOBILE_DATA);
3712 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_BUCKET_DURATION);
3713 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_DELETE_AGE);
3714 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_PERSIST_BYTES);
3715 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_ROTATE_AGE);
3716 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_ENABLED);
3717 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_GLOBAL_ALERT_BYTES);
3718 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_POLL_INTERVAL);
Christopher Tate06efb532012-08-24 15:29:27 -07003719 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_SAMPLE_ENABLED);
3720 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_TIME_CACHE_MAX_AGE);
3721 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_BUCKET_DURATION);
3722 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_DELETE_AGE);
3723 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_PERSIST_BYTES);
3724 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_ROTATE_AGE);
3725 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_BUCKET_DURATION);
3726 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_DELETE_AGE);
3727 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_PERSIST_BYTES);
3728 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_ROTATE_AGE);
3729 MOVED_TO_GLOBAL.add(Settings.Global.NETWORK_PREFERENCE);
3730 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_DIFF);
3731 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_SPACING);
3732 MOVED_TO_GLOBAL.add(Settings.Global.NTP_SERVER);
3733 MOVED_TO_GLOBAL.add(Settings.Global.NTP_TIMEOUT);
3734 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_ERROR_POLL_COUNT);
3735 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_LONG_POLL_INTERVAL_MS);
3736 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT);
3737 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_POLL_INTERVAL_MS);
3738 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_TRIGGER_PACKET_COUNT);
3739 MOVED_TO_GLOBAL.add(Settings.Global.SAMPLING_PROFILER_MS);
3740 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DATA_SERVICE_URL);
3741 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_REDIR_HOST);
3742 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_TARGET_URL);
3743 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_APN);
3744 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_REQUIRED);
3745 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_SUPPORTED);
Christopher Tate06efb532012-08-24 15:29:27 -07003746 MOVED_TO_GLOBAL.add(Settings.Global.USB_MASS_STORAGE_ENABLED);
3747 MOVED_TO_GLOBAL.add(Settings.Global.USE_GOOGLE_MAIL);
Robert Greenwalt3ea0c992013-10-03 21:13:49 +00003748 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_COUNTRY_CODE);
Christopher Tate06efb532012-08-24 15:29:27 -07003749 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FRAMEWORK_SCAN_INTERVAL_MS);
3750 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FREQUENCY_BAND);
3751 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_IDLE_MS);
3752 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MAX_DHCP_RETRY_COUNT);
3753 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS);
3754 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
3755 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
3756 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NUM_OPEN_NETWORKS_KEPT);
3757 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ON);
3758 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_P2P_DEVICE_NAME);
3759 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SAVED_STATE);
3760 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUPPLICANT_SCAN_INTERVAL_MS);
3761 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUSPEND_OPTIMIZATIONS_ENABLED);
vandwalle7c3606c2014-03-31 19:12:07 -07003762 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ENHANCED_AUTO_JOIN);
3763 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORK_SHOW_RSSI);
Christopher Tate06efb532012-08-24 15:29:27 -07003764 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_ON);
3765 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED);
Christopher Tate06efb532012-08-24 15:29:27 -07003766 MOVED_TO_GLOBAL.add(Settings.Global.WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON);
Christopher Tatec868b642012-09-12 17:41:04 -07003767 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_ENABLE);
3768 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_TIMEOUT);
3769 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_DEFAULT_RESPONSE);
3770 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS);
3771 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS);
3772 MOVED_TO_GLOBAL.add(Settings.Global.GPRS_REGISTER_CHECK_PERIOD_MS);
Christopher Tate06efb532012-08-24 15:29:27 -07003773 MOVED_TO_GLOBAL.add(Settings.Global.WTF_IS_FATAL);
Jeff Sharkey625239a2012-09-26 22:03:49 -07003774 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_DURATION_THRESHOLD);
3775 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_THRESHOLD);
3776 MOVED_TO_GLOBAL.add(Settings.Global.SEND_ACTION_APP_ERROR);
3777 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_AGE_SECONDS);
3778 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_MAX_FILES);
3779 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_KB);
3780 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_PERCENT);
3781 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_RESERVE_PERCENT);
3782 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_TAG_PREFIX);
3783 MOVED_TO_GLOBAL.add(Settings.Global.ERROR_LOGCAT_PREFIX);
3784 MOVED_TO_GLOBAL.add(Settings.Global.SYS_FREE_STORAGE_LOG_INTERVAL);
3785 MOVED_TO_GLOBAL.add(Settings.Global.DISK_FREE_CHANGE_REPORTING_THRESHOLD);
3786 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_PERCENTAGE);
3787 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_MAX_BYTES);
3788 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_FULL_THRESHOLD_BYTES);
3789 MOVED_TO_GLOBAL.add(Settings.Global.SYNC_MAX_RETRY_DELAY_IN_SECONDS);
3790 MOVED_TO_GLOBAL.add(Settings.Global.CONNECTIVITY_CHANGE_DELAY);
3791 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED);
3792 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_SERVER);
3793 MOVED_TO_GLOBAL.add(Settings.Global.NSD_ON);
3794 MOVED_TO_GLOBAL.add(Settings.Global.SET_INSTALL_LOCATION);
3795 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_INSTALL_LOCATION);
3796 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_UP_DELAY);
3797 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_DOWN_DELAY);
3798 MOVED_TO_GLOBAL.add(Settings.Global.READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT);
3799 MOVED_TO_GLOBAL.add(Settings.Global.HTTP_PROXY);
3800 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_HOST);
3801 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_PORT);
3802 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST);
3803 MOVED_TO_GLOBAL.add(Settings.Global.SET_GLOBAL_HTTP_PROXY);
3804 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_DNS_SERVER);
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003805 MOVED_TO_GLOBAL.add(Settings.Global.PREFERRED_NETWORK_MODE);
Hui Shu22671772014-10-01 21:41:07 +00003806 MOVED_TO_GLOBAL.add(Settings.Global.WEBVIEW_DATA_REDUCTION_PROXY_KEY);
Christopher Tate06efb532012-08-24 15:29:27 -07003807 }
3808
Christopher Tate66488d62012-10-02 11:58:01 -07003809 /** @hide */
Svetoslav683914b2015-01-15 14:22:26 -08003810 public static void getMovedToGlobalSettings(Set<String> outKeySet) {
Christopher Tate66488d62012-10-02 11:58:01 -07003811 outKeySet.addAll(MOVED_TO_GLOBAL);
3812 }
3813
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003814 /**
3815 * Look up a name in the database.
3816 * @param resolver to access the database with
3817 * @param name to look up in the table
3818 * @return the corresponding value, or null if not present
3819 */
Dianne Hackborn139748f2012-09-24 11:36:57 -07003820 public static String getString(ContentResolver resolver, String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07003821 return getStringForUser(resolver, name, UserHandle.myUserId());
3822 }
3823
3824 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -07003825 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -07003826 int userHandle) {
3827 if (MOVED_TO_GLOBAL.contains(name)) {
3828 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
3829 + " to android.provider.Settings.Global.");
3830 return Global.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003831 }
Amith Yamasani52c489c2012-03-28 11:42:42 -07003832
Dianne Hackborn139748f2012-09-24 11:36:57 -07003833 if (MOVED_TO_LOCK_SETTINGS.contains(name)) {
3834 synchronized (Secure.class) {
3835 if (sLockSettings == null) {
3836 sLockSettings = ILockSettings.Stub.asInterface(
3837 (IBinder) ServiceManager.getService("lock_settings"));
3838 sIsSystemProcess = Process.myUid() == Process.SYSTEM_UID;
3839 }
3840 }
3841 if (sLockSettings != null && !sIsSystemProcess) {
3842 try {
3843 return sLockSettings.getString(name, "0", userHandle);
3844 } catch (RemoteException re) {
3845 // Fall through
3846 }
Amith Yamasani52c489c2012-03-28 11:42:42 -07003847 }
3848 }
3849
Christopher Tate06efb532012-08-24 15:29:27 -07003850 return sNameValueCache.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003851 }
3852
3853 /**
3854 * Store a name/value pair into the database.
3855 * @param resolver to access the database with
3856 * @param name to store
3857 * @param value to associate with the name
3858 * @return true if the value was set, false on database errors
3859 */
Christopher Tate06efb532012-08-24 15:29:27 -07003860 public static boolean putString(ContentResolver resolver, String name, String value) {
3861 return putStringForUser(resolver, name, value, UserHandle.myUserId());
3862 }
3863
3864 /** @hide */
3865 public static boolean putStringForUser(ContentResolver resolver, String name, String value,
3866 int userHandle) {
Julia Reynolds82735bc2014-09-04 16:43:30 -04003867 if (LOCATION_MODE.equals(name)) {
3868 // HACK ALERT: temporary hack to work around b/10491283.
3869 // TODO: once b/10491283 fixed, remove this hack
3870 return setLocationModeForUser(resolver, Integer.parseInt(value), userHandle);
3871 }
Christopher Tate06efb532012-08-24 15:29:27 -07003872 if (MOVED_TO_GLOBAL.contains(name)) {
3873 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
3874 + " to android.provider.Settings.Global");
3875 return Global.putStringForUser(resolver, name, value, userHandle);
3876 }
Christopher Tate06efb532012-08-24 15:29:27 -07003877 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003878 }
3879
3880 /**
3881 * Construct the content URI for a particular name/value pair,
3882 * useful for monitoring changes with a ContentObserver.
3883 * @param name to look up in the table
3884 * @return the corresponding content URI, or null if not present
3885 */
3886 public static Uri getUriFor(String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07003887 if (MOVED_TO_GLOBAL.contains(name)) {
3888 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
3889 + " to android.provider.Settings.Global, returning global URI.");
3890 return Global.getUriFor(Global.CONTENT_URI, name);
3891 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003892 return getUriFor(CONTENT_URI, name);
3893 }
3894
3895 /**
3896 * Convenience function for retrieving a single secure settings value
3897 * as an integer. Note that internally setting values are always
3898 * stored as strings; this function converts the string to an integer
3899 * for you. The default value will be returned if the setting is
3900 * not defined or not an integer.
3901 *
3902 * @param cr The ContentResolver to access.
3903 * @param name The name of the setting to retrieve.
3904 * @param def Value to return if the setting is not defined.
3905 *
3906 * @return The setting's current value, or 'def' if it is not defined
3907 * or not a valid integer.
3908 */
3909 public static int getInt(ContentResolver cr, String name, int def) {
Christopher Tate06efb532012-08-24 15:29:27 -07003910 return getIntForUser(cr, name, def, UserHandle.myUserId());
3911 }
3912
3913 /** @hide */
3914 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
Tom O'Neill7f6f4572013-08-27 10:53:15 -07003915 if (LOCATION_MODE.equals(name)) {
3916 // HACK ALERT: temporary hack to work around b/10491283.
3917 // TODO: once b/10491283 fixed, remove this hack
3918 return getLocationModeForUser(cr, userHandle);
3919 }
Christopher Tate06efb532012-08-24 15:29:27 -07003920 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003921 try {
3922 return v != null ? Integer.parseInt(v) : def;
3923 } catch (NumberFormatException e) {
3924 return def;
3925 }
3926 }
3927
3928 /**
3929 * Convenience function for retrieving a single secure settings value
3930 * as an integer. Note that internally setting values are always
3931 * stored as strings; this function converts the string to an integer
3932 * for you.
3933 * <p>
3934 * This version does not take a default value. If the setting has not
3935 * been set, or the string value is not a number,
3936 * it throws {@link SettingNotFoundException}.
3937 *
3938 * @param cr The ContentResolver to access.
3939 * @param name The name of the setting to retrieve.
3940 *
3941 * @throws SettingNotFoundException Thrown if a setting by the given
3942 * name can't be found or the setting value is not an integer.
3943 *
3944 * @return The setting's current value.
3945 */
3946 public static int getInt(ContentResolver cr, String name)
3947 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07003948 return getIntForUser(cr, name, UserHandle.myUserId());
3949 }
3950
3951 /** @hide */
3952 public static int getIntForUser(ContentResolver cr, String name, int userHandle)
3953 throws SettingNotFoundException {
Tom O'Neill7f6f4572013-08-27 10:53:15 -07003954 if (LOCATION_MODE.equals(name)) {
3955 // HACK ALERT: temporary hack to work around b/10491283.
3956 // TODO: once b/10491283 fixed, remove this hack
3957 return getLocationModeForUser(cr, userHandle);
3958 }
Christopher Tate06efb532012-08-24 15:29:27 -07003959 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003960 try {
3961 return Integer.parseInt(v);
3962 } catch (NumberFormatException e) {
3963 throw new SettingNotFoundException(name);
3964 }
3965 }
3966
3967 /**
3968 * Convenience function for updating a single settings value as an
3969 * integer. This will either create a new entry in the table if the
3970 * given name does not exist, or modify the value of the existing row
3971 * with that name. Note that internally setting values are always
3972 * stored as strings, so this function converts the given value to a
3973 * string before storing it.
3974 *
3975 * @param cr The ContentResolver to access.
3976 * @param name The name of the setting to modify.
3977 * @param value The new value for the setting.
3978 * @return true if the value was set, false on database errors
3979 */
3980 public static boolean putInt(ContentResolver cr, String name, int value) {
Christopher Tate06efb532012-08-24 15:29:27 -07003981 return putIntForUser(cr, name, value, UserHandle.myUserId());
3982 }
3983
3984 /** @hide */
3985 public static boolean putIntForUser(ContentResolver cr, String name, int value,
3986 int userHandle) {
3987 return putStringForUser(cr, name, Integer.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003988 }
3989
3990 /**
3991 * Convenience function for retrieving a single secure settings value
3992 * as a {@code long}. Note that internally setting values are always
3993 * stored as strings; this function converts the string to a {@code long}
3994 * for you. The default value will be returned if the setting is
3995 * not defined or not a {@code long}.
3996 *
3997 * @param cr The ContentResolver to access.
3998 * @param name The name of the setting to retrieve.
3999 * @param def Value to return if the setting is not defined.
4000 *
4001 * @return The setting's current value, or 'def' if it is not defined
4002 * or not a valid {@code long}.
4003 */
4004 public static long getLong(ContentResolver cr, String name, long def) {
Christopher Tate06efb532012-08-24 15:29:27 -07004005 return getLongForUser(cr, name, def, UserHandle.myUserId());
4006 }
4007
4008 /** @hide */
4009 public static long getLongForUser(ContentResolver cr, String name, long def,
4010 int userHandle) {
4011 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004012 long value;
4013 try {
4014 value = valString != null ? Long.parseLong(valString) : def;
4015 } catch (NumberFormatException e) {
4016 value = def;
4017 }
4018 return value;
4019 }
4020
4021 /**
4022 * Convenience function for retrieving a single secure settings value
4023 * as a {@code long}. Note that internally setting values are always
4024 * stored as strings; this function converts the string to a {@code long}
4025 * for you.
4026 * <p>
4027 * This version does not take a default value. If the setting has not
4028 * been set, or the string value is not a number,
4029 * it throws {@link SettingNotFoundException}.
4030 *
4031 * @param cr The ContentResolver to access.
4032 * @param name The name of the setting to retrieve.
4033 *
4034 * @return The setting's current value.
4035 * @throws SettingNotFoundException Thrown if a setting by the given
4036 * name can't be found or the setting value is not an integer.
4037 */
4038 public static long getLong(ContentResolver cr, String name)
4039 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07004040 return getLongForUser(cr, name, UserHandle.myUserId());
4041 }
4042
4043 /** @hide */
4044 public static long getLongForUser(ContentResolver cr, String name, int userHandle)
4045 throws SettingNotFoundException {
4046 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004047 try {
4048 return Long.parseLong(valString);
4049 } catch (NumberFormatException e) {
4050 throw new SettingNotFoundException(name);
4051 }
4052 }
4053
4054 /**
4055 * Convenience function for updating a secure settings value as a long
4056 * integer. This will either create a new entry in the table if the
4057 * given name does not exist, or modify the value of the existing row
4058 * with that name. Note that internally setting values are always
4059 * stored as strings, so this function converts the given value to a
4060 * string before storing it.
4061 *
4062 * @param cr The ContentResolver to access.
4063 * @param name The name of the setting to modify.
4064 * @param value The new value for the setting.
4065 * @return true if the value was set, false on database errors
4066 */
4067 public static boolean putLong(ContentResolver cr, String name, long value) {
Christopher Tate06efb532012-08-24 15:29:27 -07004068 return putLongForUser(cr, name, value, UserHandle.myUserId());
4069 }
4070
4071 /** @hide */
4072 public static boolean putLongForUser(ContentResolver cr, String name, long value,
4073 int userHandle) {
4074 return putStringForUser(cr, name, Long.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004075 }
4076
4077 /**
4078 * Convenience function for retrieving a single secure settings value
4079 * as a floating point number. Note that internally setting values are
4080 * always stored as strings; this function converts the string to an
4081 * float for you. The default value will be returned if the setting
4082 * is not defined or not a valid float.
4083 *
4084 * @param cr The ContentResolver to access.
4085 * @param name The name of the setting to retrieve.
4086 * @param def Value to return if the setting is not defined.
4087 *
4088 * @return The setting's current value, or 'def' if it is not defined
4089 * or not a valid float.
4090 */
4091 public static float getFloat(ContentResolver cr, String name, float def) {
Christopher Tate06efb532012-08-24 15:29:27 -07004092 return getFloatForUser(cr, name, def, UserHandle.myUserId());
4093 }
4094
4095 /** @hide */
4096 public static float getFloatForUser(ContentResolver cr, String name, float def,
4097 int userHandle) {
4098 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004099 try {
4100 return v != null ? Float.parseFloat(v) : def;
4101 } catch (NumberFormatException e) {
4102 return def;
4103 }
4104 }
4105
4106 /**
4107 * Convenience function for retrieving a single secure settings value
4108 * as a float. Note that internally setting values are always
4109 * stored as strings; this function converts the string to a float
4110 * for you.
4111 * <p>
4112 * This version does not take a default value. If the setting has not
4113 * been set, or the string value is not a number,
4114 * it throws {@link SettingNotFoundException}.
4115 *
4116 * @param cr The ContentResolver to access.
4117 * @param name The name of the setting to retrieve.
4118 *
4119 * @throws SettingNotFoundException Thrown if a setting by the given
4120 * name can't be found or the setting value is not a float.
4121 *
4122 * @return The setting's current value.
4123 */
4124 public static float getFloat(ContentResolver cr, String name)
4125 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07004126 return getFloatForUser(cr, name, UserHandle.myUserId());
4127 }
4128
4129 /** @hide */
4130 public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
4131 throws SettingNotFoundException {
4132 String v = getStringForUser(cr, name, userHandle);
Brian Muramatsue1d46982010-12-06 17:34:20 -08004133 if (v == null) {
4134 throw new SettingNotFoundException(name);
4135 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004136 try {
4137 return Float.parseFloat(v);
4138 } catch (NumberFormatException e) {
4139 throw new SettingNotFoundException(name);
4140 }
4141 }
4142
4143 /**
4144 * Convenience function for updating a single settings value as a
4145 * floating point number. This will either create a new entry in the
4146 * table if the given name does not exist, or modify the value of the
4147 * existing row with that name. Note that internally setting values
4148 * are always stored as strings, so this function converts the given
4149 * value to a string before storing it.
4150 *
4151 * @param cr The ContentResolver to access.
4152 * @param name The name of the setting to modify.
4153 * @param value The new value for the setting.
4154 * @return true if the value was set, false on database errors
4155 */
4156 public static boolean putFloat(ContentResolver cr, String name, float value) {
Christopher Tate06efb532012-08-24 15:29:27 -07004157 return putFloatForUser(cr, name, value, UserHandle.myUserId());
4158 }
4159
4160 /** @hide */
4161 public static boolean putFloatForUser(ContentResolver cr, String name, float value,
4162 int userHandle) {
4163 return putStringForUser(cr, name, Float.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004164 }
4165
4166 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004167 * @deprecated Use {@link android.provider.Settings.Global#DEVELOPMENT_SETTINGS_ENABLED}
4168 * instead
Dianne Hackborn895f99e2012-02-02 11:49:12 -08004169 */
Christopher Tate06efb532012-08-24 15:29:27 -07004170 @Deprecated
4171 public static final String DEVELOPMENT_SETTINGS_ENABLED =
4172 Global.DEVELOPMENT_SETTINGS_ENABLED;
Dianne Hackborn895f99e2012-02-02 11:49:12 -08004173
4174 /**
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07004175 * When the user has enable the option to have a "bug report" command
4176 * in the power menu.
Christopher Tate58f41ec2013-01-11 15:40:36 -08004177 * @deprecated Use {@link android.provider.Settings.Global#BUGREPORT_IN_POWER_MENU} instead
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07004178 * @hide
4179 */
Christopher Tate58f41ec2013-01-11 15:40:36 -08004180 @Deprecated
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07004181 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
4182
4183 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004184 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004185 */
Christopher Tate06efb532012-08-24 15:29:27 -07004186 @Deprecated
4187 public static final String ADB_ENABLED = Global.ADB_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004188
4189 /**
4190 * Setting to allow mock locations and location provider status to be injected into the
4191 * LocationManager service for testing purposes during application development. These
4192 * locations and status values override actual location and status information generated
4193 * by network, gps, or other location providers.
Svet Ganovf7e9cf42015-05-13 10:40:31 -07004194 *
4195 * @deprecated This settings is not used anymore.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004196 */
Svet Ganovf7e9cf42015-05-13 10:40:31 -07004197 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004198 public static final String ALLOW_MOCK_LOCATION = "mock_location";
4199
4200 /**
Doug Zongkerd8893db2010-01-26 12:29:44 -08004201 * A 64-bit number (as a hex string) that is randomly
Scott Main44895332013-11-12 09:23:13 -08004202 * generated when the user first sets up the device and should remain
4203 * constant for the lifetime of the user's device. The value may
4204 * change if a factory reset is performed on the device.
4205 * <p class="note"><strong>Note:</strong> When a device has <a
4206 * href="{@docRoot}about/versions/android-4.2.html#MultipleUsers">multiple users</a>
4207 * (available on certain devices running Android 4.2 or higher), each user appears as a
4208 * completely separate device, so the {@code ANDROID_ID} value is unique to each
4209 * user.</p>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004210 */
4211 public static final String ANDROID_ID = "android_id";
4212
4213 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004214 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004215 */
Christopher Tate06efb532012-08-24 15:29:27 -07004216 @Deprecated
4217 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004218
4219 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004220 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004221 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07004222 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07004223 public static final String DATA_ROAMING = Global.DATA_ROAMING;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004224
4225 /**
4226 * Setting to record the input method used by default, holding the ID
4227 * of the desired method.
4228 */
4229 public static final String DEFAULT_INPUT_METHOD = "default_input_method";
4230
4231 /**
satokab751aa2010-09-14 19:17:36 +09004232 * Setting to record the input method subtype used by default, holding the ID
4233 * of the desired method.
4234 */
4235 public static final String SELECTED_INPUT_METHOD_SUBTYPE =
4236 "selected_input_method_subtype";
4237
4238 /**
satok723a27e2010-11-11 14:58:11 +09004239 * Setting to record the history of input method subtype, holding the pair of ID of IME
4240 * and its last used subtype.
4241 * @hide
4242 */
4243 public static final String INPUT_METHODS_SUBTYPE_HISTORY =
4244 "input_methods_subtype_history";
4245
4246 /**
satok5c58dfc2010-12-14 21:54:47 +09004247 * Setting to record the visibility of input method selector
4248 */
4249 public static final String INPUT_METHOD_SELECTOR_VISIBILITY =
4250 "input_method_selector_visibility";
4251
4252 /**
Dianne Hackborn91097de2014-04-04 18:02:06 -07004253 * The currently selected voice interaction service flattened ComponentName.
4254 * @hide
4255 */
4256 public static final String VOICE_INTERACTION_SERVICE = "voice_interaction_service";
4257
4258 /**
Zhihai Xuaf5971e2013-06-10 20:28:31 -07004259 * bluetooth HCI snoop log configuration
4260 * @hide
4261 */
4262 public static final String BLUETOOTH_HCI_LOG =
4263 "bluetooth_hci_log";
4264
4265 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004266 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004267 */
Christopher Tate06efb532012-08-24 15:29:27 -07004268 @Deprecated
4269 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004270
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004271 /**
Russell Brennerde6ae442012-09-26 20:53:10 -07004272 * Whether the current user has been set up via setup wizard (0 = false, 1 = true)
4273 * @hide
4274 */
4275 public static final String USER_SETUP_COMPLETE = "user_setup_complete";
4276
4277 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004278 * List of input methods that are currently enabled. This is a string
4279 * containing the IDs of all enabled input methods, each ID separated
4280 * by ':'.
4281 */
4282 public static final String ENABLED_INPUT_METHODS = "enabled_input_methods";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004283
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004284 /**
Amith Yamasanie861ec12010-03-24 21:39:27 -07004285 * List of system input methods that are currently disabled. This is a string
4286 * containing the IDs of all disabled input methods, each ID separated
4287 * by ':'.
4288 * @hide
4289 */
4290 public static final String DISABLED_SYSTEM_INPUT_METHODS = "disabled_system_input_methods";
4291
4292 /**
Michael Wright7b5a96b2014-08-09 19:28:42 -07004293 * Whether to show the IME when a hard keyboard is connected. This is a boolean that
4294 * determines if the IME should be shown when a hard keyboard is attached.
4295 * @hide
4296 */
4297 public static final String SHOW_IME_WITH_HARD_KEYBOARD = "show_ime_with_hard_keyboard";
4298
4299 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07004300 * Host name and port for global http proxy. Uses ':' seperator for
4301 * between host and port.
4302 *
4303 * @deprecated Use {@link Global#HTTP_PROXY}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004304 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07004305 @Deprecated
4306 public static final String HTTP_PROXY = Global.HTTP_PROXY;
Robert Greenwalte90aa5e2010-09-01 11:34:05 -07004307
4308 /**
Christopher Tateaa036a22014-05-19 16:33:27 -07004309 * Whether applications can be installed for this user via the system's
4310 * {@link Intent#ACTION_INSTALL_PACKAGE} mechanism.
4311 *
4312 * <p>1 = permit app installation via the system package installer intent
4313 * <p>0 = do not allow use of the package installer
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004314 */
Christopher Tateaa036a22014-05-19 16:33:27 -07004315 public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004316
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004317 /**
Tom O'Neill923c0dc2014-03-03 11:07:55 -08004318 * Comma-separated list of location providers that activities may access. Do not rely on
4319 * this value being present in settings.db or on ContentObserver notifications on the
4320 * corresponding Uri.
Tom O'Neilla324ac72013-08-26 14:40:23 -07004321 *
Tom O'Neill923c0dc2014-03-03 11:07:55 -08004322 * @deprecated use {@link #LOCATION_MODE} and
4323 * {@link LocationManager#MODE_CHANGED_ACTION} (or
4324 * {@link LocationManager#PROVIDERS_CHANGED_ACTION})
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004325 */
Tom O'Neilla324ac72013-08-26 14:40:23 -07004326 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004327 public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004328
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004329 /**
Tom O'Neill7f6f4572013-08-27 10:53:15 -07004330 * The degree of location access enabled by the user.
Tom O'Neill923c0dc2014-03-03 11:07:55 -08004331 * <p>
Tom O'Neill7f6f4572013-08-27 10:53:15 -07004332 * When used with {@link #putInt(ContentResolver, String, int)}, must be one of {@link
4333 * #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY}, {@link
4334 * #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}. When used with {@link
4335 * #getInt(ContentResolver, String)}, the caller must gracefully handle additional location
4336 * modes that might be added in the future.
Tom O'Neill923c0dc2014-03-03 11:07:55 -08004337 * <p>
4338 * Note: do not rely on this value being present in settings.db or on ContentObserver
4339 * notifications for the corresponding Uri. Use {@link LocationManager#MODE_CHANGED_ACTION}
4340 * to receive changes in this value.
Tom O'Neilla324ac72013-08-26 14:40:23 -07004341 */
4342 public static final String LOCATION_MODE = "location_mode";
4343
4344 /**
Tom O'Neill7f6f4572013-08-27 10:53:15 -07004345 * Location access disabled.
Tom O'Neill1f48b782013-08-19 18:14:56 -07004346 */
4347 public static final int LOCATION_MODE_OFF = 0;
4348 /**
4349 * Network Location Provider disabled, but GPS and other sensors enabled.
4350 */
4351 public static final int LOCATION_MODE_SENSORS_ONLY = 1;
4352 /**
Tom O'Neilld5759432013-09-11 11:03:03 -07004353 * Reduced power usage, such as limiting the number of GPS updates per hour. Requests
4354 * with {@link android.location.Criteria#POWER_HIGH} may be downgraded to
4355 * {@link android.location.Criteria#POWER_MEDIUM}.
Tom O'Neill1f48b782013-08-19 18:14:56 -07004356 */
4357 public static final int LOCATION_MODE_BATTERY_SAVING = 2;
4358 /**
4359 * Best-effort location computation allowed.
4360 */
4361 public static final int LOCATION_MODE_HIGH_ACCURACY = 3;
4362
4363 /**
Danielle Millett925a7d82012-03-19 18:02:20 -04004364 * A flag containing settings used for biometric weak
4365 * @hide
4366 */
Adrian Roos230635e2015-01-07 20:50:29 +01004367 @Deprecated
Danielle Millett925a7d82012-03-19 18:02:20 -04004368 public static final String LOCK_BIOMETRIC_WEAK_FLAGS =
4369 "lock_biometric_weak_flags";
4370
4371 /**
Jason Monk94cfd9d2014-10-31 13:18:21 -04004372 * Whether lock-to-app will lock the keyguard when exiting.
4373 * @hide
4374 */
4375 public static final String LOCK_TO_APP_EXIT_LOCKED = "lock_to_app_exit_locked";
4376
4377 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08004378 * Whether autolock is enabled (0 = false, 1 = true)
Adrian Roos9dd16eb2015-01-08 16:20:49 +01004379 *
4380 * @deprecated Use {@link android.app.KeyguardManager} to determine the state and security
4381 * level of the keyguard.
Amith Yamasani156c4352010-03-05 17:10:03 -08004382 */
Adrian Roos9dd16eb2015-01-08 16:20:49 +01004383 @Deprecated
Amith Yamasani156c4352010-03-05 17:10:03 -08004384 public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock";
4385
4386 /**
4387 * Whether lock pattern is visible as user enters (0 = false, 1 = true)
4388 */
4389 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
4390
4391 /**
Jeff Sharkey5ed9d682012-10-10 14:28:27 -07004392 * Whether lock pattern will vibrate as user enters (0 = false, 1 =
4393 * true)
4394 *
4395 * @deprecated Starting in {@link VERSION_CODES#JELLY_BEAN_MR1} the
4396 * lockscreen uses
4397 * {@link Settings.System#HAPTIC_FEEDBACK_ENABLED}.
Amith Yamasani156c4352010-03-05 17:10:03 -08004398 */
Jeff Sharkey5ed9d682012-10-10 14:28:27 -07004399 @Deprecated
4400 public static final String
4401 LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = "lock_pattern_tactile_feedback_enabled";
Amith Yamasani156c4352010-03-05 17:10:03 -08004402
4403 /**
Jim Millerbc4603b2010-08-30 21:21:34 -07004404 * This preference allows the device to be locked given time after screen goes off,
4405 * subject to current DeviceAdmin policy limits.
4406 * @hide
4407 */
4408 public static final String LOCK_SCREEN_LOCK_AFTER_TIMEOUT = "lock_screen_lock_after_timeout";
4409
4410
4411 /**
John Spurlock5f050e52012-10-27 10:44:19 -04004412 * This preference contains the string that shows for owner info on LockScreen.
Jim Miller253a5ef2010-10-13 20:57:29 -07004413 * @hide
Jim Miller187ec582013-04-15 18:27:54 -07004414 * @deprecated
Jim Miller253a5ef2010-10-13 20:57:29 -07004415 */
4416 public static final String LOCK_SCREEN_OWNER_INFO = "lock_screen_owner_info";
4417
4418 /**
John Spurlock5f050e52012-10-27 10:44:19 -04004419 * Ids of the user-selected appwidgets on the lockscreen (comma-delimited).
Jim Millerf229e4d2012-09-12 20:32:50 -07004420 * @hide
4421 */
Adrian Roos230635e2015-01-07 20:50:29 +01004422 @Deprecated
Michael Jurkaaa2859a2012-10-24 12:46:49 -07004423 public static final String LOCK_SCREEN_APPWIDGET_IDS =
4424 "lock_screen_appwidget_ids";
Jim Millerf229e4d2012-09-12 20:32:50 -07004425
4426 /**
Jim Miller51117262012-11-04 17:58:09 -08004427 * Id of the appwidget shown on the lock screen when appwidgets are disabled.
4428 * @hide
4429 */
Adrian Roos230635e2015-01-07 20:50:29 +01004430 @Deprecated
Jim Miller51117262012-11-04 17:58:09 -08004431 public static final String LOCK_SCREEN_FALLBACK_APPWIDGET_ID =
4432 "lock_screen_fallback_appwidget_id";
4433
4434 /**
John Spurlock5f050e52012-10-27 10:44:19 -04004435 * Index of the lockscreen appwidget to restore, -1 if none.
4436 * @hide
4437 */
Adrian Roos230635e2015-01-07 20:50:29 +01004438 @Deprecated
John Spurlock5f050e52012-10-27 10:44:19 -04004439 public static final String LOCK_SCREEN_STICKY_APPWIDGET =
4440 "lock_screen_sticky_appwidget";
4441
4442 /**
4443 * This preference enables showing the owner info on LockScreen.
Jim Miller253a5ef2010-10-13 20:57:29 -07004444 * @hide
Jim Miller187ec582013-04-15 18:27:54 -07004445 * @deprecated
Jim Miller253a5ef2010-10-13 20:57:29 -07004446 */
4447 public static final String LOCK_SCREEN_OWNER_INFO_ENABLED =
4448 "lock_screen_owner_info_enabled";
4449
4450 /**
Dan Sandler5d7c3cc2014-02-18 17:35:15 -05004451 * When set by a user, allows notifications to be shown atop a securely locked screen
4452 * in their full "private" form (same as when the device is unlocked).
Dan Sandlerfd16d562014-02-13 18:43:31 -08004453 * @hide
4454 */
4455 public static final String LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS =
4456 "lock_screen_allow_private_notifications";
4457
4458 /**
Chris Wrencd8f4f72014-08-27 18:48:13 -04004459 * Set by the system to track if the user needs to see the call to action for
4460 * the lockscreen notification policy.
4461 * @hide
4462 */
4463 public static final String SHOW_NOTE_ABOUT_NOTIFICATION_HIDING =
4464 "show_note_about_notification_hiding";
4465
4466 /**
Adrian Roos3870d452014-09-05 18:22:28 +02004467 * Set to 1 by the system after trust agents have been initialized.
4468 * @hide
4469 */
4470 public static final String TRUST_AGENTS_INITIALIZED =
4471 "trust_agents_initialized";
4472
4473 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004474 * The Logging ID (a unique 64-bit value) as a hex string.
4475 * Used as a pseudonymous identifier for logging.
4476 * @deprecated This identifier is poorly initialized and has
4477 * many collisions. It should not be used.
4478 */
4479 @Deprecated
4480 public static final String LOGGING_ID = "logging_id";
4481
4482 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004483 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004484 */
Christopher Tate06efb532012-08-24 15:29:27 -07004485 @Deprecated
4486 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004487
4488 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08004489 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004490 */
4491 public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004492
4493 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08004494 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004495 */
4496 public static final String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004497
4498 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08004499 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004500 */
4501 public static final String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004502
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004503 /**
4504 * Settings classname to launch when Settings is clicked from All
4505 * Applications. Needed because of user testing between the old
4506 * and new Settings apps.
4507 */
4508 // TODO: 881807
4509 public static final String SETTINGS_CLASSNAME = "settings_classname";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004510
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004511 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004512 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004513 */
Christopher Tate06efb532012-08-24 15:29:27 -07004514 @Deprecated
4515 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004516
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004517 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004518 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004519 */
Christopher Tate06efb532012-08-24 15:29:27 -07004520 @Deprecated
4521 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004522
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004523 /**
svetoslavganov75986cf2009-05-14 22:28:01 -07004524 * If accessibility is enabled.
4525 */
4526 public static final String ACCESSIBILITY_ENABLED = "accessibility_enabled";
4527
4528 /**
Svetoslav Ganov00aabf72011-07-21 11:35:03 -07004529 * If touch exploration is enabled.
Svetoslav Ganov35bfede2011-07-14 17:57:06 -07004530 */
Svetoslav Ganov00aabf72011-07-21 11:35:03 -07004531 public static final String TOUCH_EXPLORATION_ENABLED = "touch_exploration_enabled";
Svetoslav Ganov35bfede2011-07-14 17:57:06 -07004532
4533 /**
svetoslavganov75986cf2009-05-14 22:28:01 -07004534 * List of the enabled accessibility providers.
4535 */
4536 public static final String ENABLED_ACCESSIBILITY_SERVICES =
4537 "enabled_accessibility_services";
4538
4539 /**
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07004540 * List of the accessibility services to which the user has granted
Svetoslav Ganov9a4c5cd2012-05-30 14:06:32 -07004541 * permission to put the device into touch exploration mode.
4542 *
4543 * @hide
4544 */
4545 public static final String TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES =
4546 "touch_exploration_granted_accessibility_services";
4547
4548 /**
Svetoslav Ganov55f937a2011-12-05 11:42:07 -08004549 * Whether to speak passwords while in accessibility mode.
4550 */
4551 public static final String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password";
4552
4553 /**
Chris Craikcce47eb2014-07-16 15:12:15 -07004554 * Whether to draw text with high contrast while in accessibility mode.
4555 *
4556 * @hide
4557 */
4558 public static final String ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED =
4559 "high_text_contrast_enabled";
4560
4561 /**
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08004562 * If injection of accessibility enhancing JavaScript screen-reader
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07004563 * is enabled.
4564 * <p>
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08004565 * Note: The JavaScript based screen-reader is served by the
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07004566 * Google infrastructure and enable users with disabilities to
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07004567 * efficiently navigate in and explore web content.
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07004568 * </p>
4569 * <p>
4570 * This property represents a boolean value.
4571 * </p>
4572 * @hide
4573 */
4574 public static final String ACCESSIBILITY_SCRIPT_INJECTION =
4575 "accessibility_script_injection";
4576
4577 /**
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08004578 * The URL for the injected JavaScript based screen-reader used
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07004579 * for providing accessibility of content in WebView.
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08004580 * <p>
4581 * Note: The JavaScript based screen-reader is served by the
4582 * Google infrastructure and enable users with disabilities to
4583 * efficiently navigate in and explore web content.
4584 * </p>
4585 * <p>
4586 * This property represents a string value.
4587 * </p>
4588 * @hide
4589 */
4590 public static final String ACCESSIBILITY_SCREEN_READER_URL =
4591 "accessibility_script_injection_url";
4592
4593 /**
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07004594 * Key bindings for navigation in built-in accessibility support for web content.
4595 * <p>
4596 * Note: These key bindings are for the built-in accessibility navigation for
4597 * web content which is used as a fall back solution if JavaScript in a WebView
4598 * is not enabled or the user has not opted-in script injection from Google.
4599 * </p>
4600 * <p>
4601 * The bindings are separated by semi-colon. A binding is a mapping from
4602 * a key to a sequence of actions (for more details look at
4603 * android.webkit.AccessibilityInjector). A key is represented as the hexademical
4604 * string representation of an integer obtained from a meta state (optional) shifted
4605 * sixteen times left and bitwise ored with a key code. An action is represented
4606 * as a hexademical string representation of an integer where the first two digits
4607 * are navigation action index, the second, the third, and the fourth digit pairs
4608 * represent the action arguments. The separate actions in a binding are colon
4609 * separated. The key and the action sequence it maps to are separated by equals.
4610 * </p>
4611 * <p>
4612 * For example, the binding below maps the DPAD right button to traverse the
4613 * current navigation axis once without firing an accessibility event and to
4614 * perform the same traversal again but to fire an event:
4615 * <code>
4616 * 0x16=0x01000100:0x01000101;
4617 * </code>
4618 * </p>
4619 * <p>
4620 * The goal of this binding is to enable dynamic rebinding of keys to
4621 * navigation actions for web content without requiring a framework change.
4622 * </p>
4623 * <p>
4624 * This property represents a string value.
4625 * </p>
4626 * @hide
4627 */
4628 public static final String ACCESSIBILITY_WEB_CONTENT_KEY_BINDINGS =
4629 "accessibility_web_content_key_bindings";
4630
4631 /**
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07004632 * Setting that specifies whether the display magnification is enabled.
4633 * Display magnifications allows the user to zoom in the display content
4634 * and is targeted to low vision users. The current magnification scale
4635 * is controlled by {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}.
4636 *
4637 * @hide
4638 */
4639 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED =
4640 "accessibility_display_magnification_enabled";
4641
4642 /**
4643 * Setting that specifies what the display magnification scale is.
4644 * Display magnifications allows the user to zoom in the display
4645 * content and is targeted to low vision users. Whether a display
4646 * magnification is performed is controlled by
4647 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED}
4648 *
4649 * @hide
4650 */
4651 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE =
4652 "accessibility_display_magnification_scale";
4653
4654 /**
4655 * Setting that specifies whether the display magnification should be
4656 * automatically updated. If this fearture is enabled the system will
4657 * exit magnification mode or pan the viewport when a context change
4658 * occurs. For example, on staring a new activity or rotating the screen,
4659 * the system may zoom out so the user can see the new context he is in.
4660 * Another example is on showing a window that is not visible in the
4661 * magnified viewport the system may pan the viewport to make the window
4662 * the has popped up so the user knows that the context has changed.
4663 * Whether a screen magnification is performed is controlled by
4664 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED}
4665 *
4666 * @hide
4667 */
4668 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE =
4669 "accessibility_display_magnification_auto_update";
4670
4671 /**
Alan Viveretteef793802013-07-23 14:15:28 -07004672 * Setting that specifies whether timed text (captions) should be
4673 * displayed in video content. Text display properties are controlled by
4674 * the following settings:
4675 * <ul>
4676 * <li>{@link #ACCESSIBILITY_CAPTIONING_LOCALE}
4677 * <li>{@link #ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR}
4678 * <li>{@link #ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR}
4679 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_COLOR}
4680 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_TYPE}
4681 * <li>{@link #ACCESSIBILITY_CAPTIONING_TYPEFACE}
Alan Viverette69ce69b2013-08-29 12:23:48 -07004682 * <li>{@link #ACCESSIBILITY_CAPTIONING_FONT_SCALE}
Alan Viveretteef793802013-07-23 14:15:28 -07004683 * </ul>
4684 *
4685 * @hide
4686 */
4687 public static final String ACCESSIBILITY_CAPTIONING_ENABLED =
4688 "accessibility_captioning_enabled";
4689
4690 /**
4691 * Setting that specifies the language for captions as a locale string,
4692 * e.g. en_US.
4693 *
4694 * @see java.util.Locale#toString
4695 * @hide
4696 */
4697 public static final String ACCESSIBILITY_CAPTIONING_LOCALE =
4698 "accessibility_captioning_locale";
4699
4700 /**
Alan Viverette43a1e3d2013-08-02 16:45:03 -07004701 * Integer property that specifies the preset style for captions, one
4702 * of:
4703 * <ul>
Alan Viverette69ce69b2013-08-29 12:23:48 -07004704 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESET_CUSTOM}
4705 * <li>a valid index of {@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESETS}
Alan Viverette43a1e3d2013-08-02 16:45:03 -07004706 * </ul>
4707 *
4708 * @see java.util.Locale#toString
4709 * @hide
4710 */
4711 public static final String ACCESSIBILITY_CAPTIONING_PRESET =
4712 "accessibility_captioning_preset";
4713
4714 /**
Alan Viveretteef793802013-07-23 14:15:28 -07004715 * Integer property that specifes the background color for captions as a
4716 * packed 32-bit color.
4717 *
4718 * @see android.graphics.Color#argb
4719 * @hide
4720 */
4721 public static final String ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR =
4722 "accessibility_captioning_background_color";
4723
4724 /**
4725 * Integer property that specifes the foreground color for captions as a
4726 * packed 32-bit color.
4727 *
4728 * @see android.graphics.Color#argb
4729 * @hide
4730 */
4731 public static final String ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR =
4732 "accessibility_captioning_foreground_color";
4733
4734 /**
4735 * Integer property that specifes the edge type for captions, one of:
4736 * <ul>
Alan Viverette69ce69b2013-08-29 12:23:48 -07004737 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_NONE}
4738 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_OUTLINE}
4739 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_DROP_SHADOW}
Alan Viveretteef793802013-07-23 14:15:28 -07004740 * </ul>
4741 *
4742 * @see #ACCESSIBILITY_CAPTIONING_EDGE_COLOR
4743 * @hide
4744 */
4745 public static final String ACCESSIBILITY_CAPTIONING_EDGE_TYPE =
4746 "accessibility_captioning_edge_type";
4747
4748 /**
4749 * Integer property that specifes the edge color for captions as a
4750 * packed 32-bit color.
4751 *
4752 * @see #ACCESSIBILITY_CAPTIONING_EDGE_TYPE
4753 * @see android.graphics.Color#argb
4754 * @hide
4755 */
4756 public static final String ACCESSIBILITY_CAPTIONING_EDGE_COLOR =
4757 "accessibility_captioning_edge_color";
4758
4759 /**
Alan Viverette55d70622013-12-11 15:22:14 -08004760 * Integer property that specifes the window color for captions as a
4761 * packed 32-bit color.
4762 *
4763 * @see android.graphics.Color#argb
4764 * @hide
4765 */
4766 public static final String ACCESSIBILITY_CAPTIONING_WINDOW_COLOR =
4767 "accessibility_captioning_window_color";
4768
4769 /**
Alan Viveretteef793802013-07-23 14:15:28 -07004770 * String property that specifies the typeface for captions, one of:
4771 * <ul>
4772 * <li>DEFAULT
4773 * <li>MONOSPACE
4774 * <li>SANS_SERIF
4775 * <li>SERIF
4776 * </ul>
4777 *
4778 * @see android.graphics.Typeface
4779 * @hide
4780 */
4781 public static final String ACCESSIBILITY_CAPTIONING_TYPEFACE =
4782 "accessibility_captioning_typeface";
4783
4784 /**
Alan Viverette69ce69b2013-08-29 12:23:48 -07004785 * Floating point property that specifies font scaling for captions.
Alan Viveretteef793802013-07-23 14:15:28 -07004786 *
4787 * @hide
4788 */
Alan Viverette69ce69b2013-08-29 12:23:48 -07004789 public static final String ACCESSIBILITY_CAPTIONING_FONT_SCALE =
4790 "accessibility_captioning_font_scale";
Alan Viveretteef793802013-07-23 14:15:28 -07004791
4792 /**
Alan Viverette410d4e32013-09-30 15:37:38 -07004793 * Setting that specifies whether display color inversion is enabled.
Alan Viverette410d4e32013-09-30 15:37:38 -07004794 */
4795 public static final String ACCESSIBILITY_DISPLAY_INVERSION_ENABLED =
4796 "accessibility_display_inversion_enabled";
4797
4798 /**
Alan Viverette410d4e32013-09-30 15:37:38 -07004799 * Setting that specifies whether display color space adjustment is
4800 * enabled.
4801 *
4802 * @hide
4803 */
4804 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED =
4805 "accessibility_display_daltonizer_enabled";
4806
4807 /**
4808 * Integer property that specifies the type of color space adjustment to
4809 * perform. Valid values are defined in AccessibilityManager.
4810 *
4811 * @hide
4812 */
4813 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER =
4814 "accessibility_display_daltonizer";
4815
4816 /**
Svetoslav Ganov54d068e2011-03-02 12:58:40 -08004817 * The timout for considering a press to be a long press in milliseconds.
4818 * @hide
4819 */
4820 public static final String LONG_PRESS_TIMEOUT = "long_press_timeout";
4821
4822 /**
Svetoslav Ganov6bd20bc2013-09-02 15:24:45 -07004823 * List of the enabled print services.
Svetoslav Ganov4b9a4d12013-06-11 15:20:06 -07004824 * @hide
4825 */
4826 public static final String ENABLED_PRINT_SERVICES =
4827 "enabled_print_services";
4828
4829 /**
Svetoslav Ganov6bd20bc2013-09-02 15:24:45 -07004830 * List of the system print services we enabled on first boot. On
4831 * first boot we enable all system, i.e. bundled print services,
4832 * once, so they work out-of-the-box.
4833 * @hide
4834 */
4835 public static final String ENABLED_ON_FIRST_BOOT_SYSTEM_PRINT_SERVICES =
4836 "enabled_on_first_boot_system_print_services";
4837
4838 /**
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07004839 * Setting to always use the default text-to-speech settings regardless
4840 * of the application settings.
4841 * 1 = override application settings,
4842 * 0 = use application settings (if specified).
Narayan Kamath6d632962011-08-24 11:51:37 +01004843 *
4844 * @deprecated The value of this setting is no longer respected by
4845 * the framework text to speech APIs as of the Ice Cream Sandwich release.
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07004846 */
Narayan Kamath6d632962011-08-24 11:51:37 +01004847 @Deprecated
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07004848 public static final String TTS_USE_DEFAULTS = "tts_use_defaults";
4849
4850 /**
4851 * Default text-to-speech engine speech rate. 100 = 1x
4852 */
4853 public static final String TTS_DEFAULT_RATE = "tts_default_rate";
4854
4855 /**
4856 * Default text-to-speech engine pitch. 100 = 1x
4857 */
4858 public static final String TTS_DEFAULT_PITCH = "tts_default_pitch";
4859
4860 /**
4861 * Default text-to-speech engine.
4862 */
4863 public static final String TTS_DEFAULT_SYNTH = "tts_default_synth";
4864
4865 /**
Jean-Michel Trivif4782672009-06-09 16:22:48 -07004866 * Default text-to-speech language.
Narayan Kamath6d632962011-08-24 11:51:37 +01004867 *
4868 * @deprecated this setting is no longer in use, as of the Ice Cream
4869 * Sandwich release. Apps should never need to read this setting directly,
4870 * instead can query the TextToSpeech framework classes for the default
4871 * locale. {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivif4782672009-06-09 16:22:48 -07004872 */
Narayan Kamath6d632962011-08-24 11:51:37 +01004873 @Deprecated
Jean-Michel Trivif4782672009-06-09 16:22:48 -07004874 public static final String TTS_DEFAULT_LANG = "tts_default_lang";
4875
4876 /**
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07004877 * Default text-to-speech country.
Narayan Kamath6d632962011-08-24 11:51:37 +01004878 *
4879 * @deprecated this setting is no longer in use, as of the Ice Cream
4880 * Sandwich release. Apps should never need to read this setting directly,
4881 * instead can query the TextToSpeech framework classes for the default
4882 * locale. {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07004883 */
Narayan Kamath6d632962011-08-24 11:51:37 +01004884 @Deprecated
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07004885 public static final String TTS_DEFAULT_COUNTRY = "tts_default_country";
4886
4887 /**
4888 * Default text-to-speech locale variant.
Narayan Kamath6d632962011-08-24 11:51:37 +01004889 *
4890 * @deprecated this setting is no longer in use, as of the Ice Cream
4891 * Sandwich release. Apps should never need to read this setting directly,
4892 * instead can query the TextToSpeech framework classes for the
4893 * locale that is in use {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07004894 */
Narayan Kamath6d632962011-08-24 11:51:37 +01004895 @Deprecated
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07004896 public static final String TTS_DEFAULT_VARIANT = "tts_default_variant";
4897
4898 /**
Narayan Kamathe5b8c4d2011-08-22 15:37:47 +01004899 * Stores the default tts locales on a per engine basis. Stored as
4900 * a comma seperated list of values, each value being of the form
4901 * {@code engine_name:locale} for example,
Narayan Kamath6d632962011-08-24 11:51:37 +01004902 * {@code com.foo.ttsengine:eng-USA,com.bar.ttsengine:esp-ESP}. This
4903 * supersedes {@link #TTS_DEFAULT_LANG}, {@link #TTS_DEFAULT_COUNTRY} and
4904 * {@link #TTS_DEFAULT_VARIANT}. Apps should never need to read this
4905 * setting directly, and can query the TextToSpeech framework classes
4906 * for the locale that is in use.
Narayan Kamathe5b8c4d2011-08-22 15:37:47 +01004907 *
4908 * @hide
4909 */
4910 public static final String TTS_DEFAULT_LOCALE = "tts_default_locale";
4911
4912 /**
Charles Chenceffa152010-03-16 21:18:10 -07004913 * Space delimited list of plugin packages that are enabled.
4914 */
4915 public static final String TTS_ENABLED_PLUGINS = "tts_enabled_plugins";
4916
4917 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004918 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON}
4919 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004920 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004921 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004922 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004923 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004924
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004925 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004926 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY}
4927 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004928 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004929 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004930 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004931 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004932
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004933 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004934 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
4935 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004936 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004937 @Deprecated
4938 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT =
4939 Global.WIFI_NUM_OPEN_NETWORKS_KEPT;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004940
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004941 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004942 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON}
4943 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004944 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004945 @Deprecated
4946 public static final String WIFI_ON = Global.WIFI_ON;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004947
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004948 /**
4949 * The acceptable packet loss percentage (range 0 - 100) before trying
4950 * another AP on the same network.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004951 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004952 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004953 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004954 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
4955 "wifi_watchdog_acceptable_packet_loss_percentage";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004956
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004957 /**
4958 * The number of access points required for a network in order for the
4959 * watchdog to monitor it.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004960 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004961 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004962 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004963 public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004964
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004965 /**
4966 * The delay between background checks.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004967 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004968 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004969 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004970 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
4971 "wifi_watchdog_background_check_delay_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004972
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004973 /**
4974 * Whether the Wi-Fi watchdog is enabled for background checking even
4975 * after it thinks the user has connected to a good access point.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004976 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004977 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004978 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004979 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
4980 "wifi_watchdog_background_check_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004981
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004982 /**
4983 * The timeout for a background ping
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004984 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004985 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004986 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004987 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
4988 "wifi_watchdog_background_check_timeout_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004989
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004990 /**
4991 * The number of initial pings to perform that *may* be ignored if they
4992 * fail. Again, if these fail, they will *not* be used in packet loss
4993 * calculation. For example, one network always seemed to time out for
4994 * the first couple pings, so this is set to 3 by default.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004995 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004996 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004997 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004998 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
4999 "wifi_watchdog_initial_ignored_ping_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005000
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005001 /**
5002 * The maximum number of access points (per network) to attempt to test.
5003 * If this number is reached, the watchdog will no longer monitor the
5004 * initial connection state for the network. This is a safeguard for
5005 * networks containing multiple APs whose DNS does not respond to pings.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07005006 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005007 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07005008 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005009 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = "wifi_watchdog_max_ap_checks";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005010
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005011 /**
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07005012 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005013 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07005014 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005015 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
5016
5017 /**
5018 * A comma-separated list of SSIDs for which the Wi-Fi watchdog should be enabled.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07005019 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005020 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07005021 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005022 public static final String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list";
5023
5024 /**
5025 * The number of pings to test if an access point is a good connection.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07005026 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005027 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07005028 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005029 public static final String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005030
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005031 /**
5032 * The delay between pings.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07005033 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005034 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07005035 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005036 public static final String WIFI_WATCHDOG_PING_DELAY_MS = "wifi_watchdog_ping_delay_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005037
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005038 /**
5039 * The timeout per ping.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07005040 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005041 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07005042 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005043 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005044
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005045 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005046 * @deprecated Use
5047 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005048 */
Christopher Tate06efb532012-08-24 15:29:27 -07005049 @Deprecated
5050 public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005051
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005052 /**
Jeff Brownbf6f6f92012-09-25 15:03:20 -07005053 * @deprecated Use
5054 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005055 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07005056 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005057 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
Jeff Brownbf6f6f92012-09-25 15:03:20 -07005058 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005059
5060 /**
Jeremy Joslin79294842014-12-03 17:15:28 -08005061 * The number of milliseconds to hold on to a PendingIntent based request. This delay gives
5062 * the receivers of the PendingIntent an opportunity to make a new network request before
5063 * the Network satisfying the request is potentially removed.
5064 *
5065 * @hide
5066 */
5067 public static final String CONNECTIVITY_RELEASE_PENDING_INTENT_DELAY_MS =
5068 "connectivity_release_pending_intent_delay_ms";
5069
5070 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07005071 * Whether background data usage is allowed.
5072 *
5073 * @deprecated As of {@link VERSION_CODES#ICE_CREAM_SANDWICH},
5074 * availability of background data depends on several
5075 * combined factors. When background data is unavailable,
5076 * {@link ConnectivityManager#getActiveNetworkInfo()} will
5077 * now appear disconnected.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005078 */
Jeff Sharkey3a844fc2011-08-16 14:37:57 -07005079 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005080 public static final String BACKGROUND_DATA = "background_data";
Wink Saville04e71b32009-04-02 11:00:54 -07005081
5082 /**
Bjorn Bringert98bfa392010-03-24 10:59:48 +00005083 * Origins for which browsers should allow geolocation by default.
5084 * The value is a space-separated list of origins.
5085 */
5086 public static final String ALLOWED_GEOLOCATION_ORIGINS
5087 = "allowed_geolocation_origins";
5088
5089 /**
Wink Savillee9b06d72009-05-18 21:47:50 -07005090 * The preferred TTY mode 0 = TTy Off, CDMA default
5091 * 1 = TTY Full
5092 * 2 = TTY HCO
5093 * 3 = TTY VCO
5094 * @hide
5095 */
5096 public static final String PREFERRED_TTY_MODE =
5097 "preferred_tty_mode";
5098
Wink Saville04e71b32009-04-02 11:00:54 -07005099 /**
Wink Saville04e71b32009-04-02 11:00:54 -07005100 * Whether the enhanced voice privacy mode is enabled.
5101 * 0 = normal voice privacy
5102 * 1 = enhanced voice privacy
5103 * @hide
5104 */
5105 public static final String ENHANCED_VOICE_PRIVACY_ENABLED = "enhanced_voice_privacy_enabled";
5106
5107 /**
5108 * Whether the TTY mode mode is enabled.
5109 * 0 = disabled
5110 * 1 = enabled
5111 * @hide
5112 */
5113 public static final String TTY_MODE_ENABLED = "tty_mode_enabled";
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005114
5115 /**
Christopher Tate8031a3d2009-07-06 16:36:05 -07005116 * Controls whether settings backup is enabled.
Dianne Hackborncf098292009-07-01 19:55:20 -07005117 * Type: int ( 0 = disabled, 1 = enabled )
5118 * @hide
5119 */
5120 public static final String BACKUP_ENABLED = "backup_enabled";
5121
5122 /**
Christopher Tatecce9da52010-02-03 15:11:15 -08005123 * Controls whether application data is automatically restored from backup
5124 * at install time.
5125 * Type: int ( 0 = disabled, 1 = enabled )
5126 * @hide
5127 */
5128 public static final String BACKUP_AUTO_RESTORE = "backup_auto_restore";
5129
5130 /**
Christopher Tate8031a3d2009-07-06 16:36:05 -07005131 * Indicates whether settings backup has been fully provisioned.
5132 * Type: int ( 0 = unprovisioned, 1 = fully provisioned )
5133 * @hide
5134 */
5135 public static final String BACKUP_PROVISIONED = "backup_provisioned";
5136
5137 /**
Dianne Hackborncf098292009-07-01 19:55:20 -07005138 * Component of the transport to use for backup/restore.
5139 * @hide
5140 */
5141 public static final String BACKUP_TRANSPORT = "backup_transport";
Sanjay Jeyakumar21bf2412009-07-09 13:31:48 -07005142
Dianne Hackbornd7cd29d2009-07-01 11:22:45 -07005143 /**
5144 * Version for which the setup wizard was last shown. Bumped for
5145 * each release when there is new setup information to show.
5146 * @hide
5147 */
5148 public static final String LAST_SETUP_SHOWN = "last_setup_shown";
Dianne Hackborncf098292009-07-01 19:55:20 -07005149
5150 /**
Doug Zongker43866e02010-01-07 12:09:54 -08005151 * The interval in milliseconds after which Wi-Fi is considered idle.
5152 * When idle, it is possible for the device to be switched from Wi-Fi to
5153 * the mobile data network.
5154 * @hide
Jeff Brownbf6f6f92012-09-25 15:03:20 -07005155 * @deprecated Use {@link android.provider.Settings.Global#WIFI_IDLE_MS}
5156 * instead.
Doug Zongker43866e02010-01-07 12:09:54 -08005157 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07005158 @Deprecated
5159 public static final String WIFI_IDLE_MS = Global.WIFI_IDLE_MS;
Doug Zongker43866e02010-01-07 12:09:54 -08005160
5161 /**
Narayan Kamathee69ff42011-06-28 12:07:18 +01005162 * The global search provider chosen by the user (if multiple global
5163 * search providers are installed). This will be the provider returned
5164 * by {@link SearchManager#getGlobalSearchActivity()} if it's still
5165 * installed. This setting is stored as a flattened component name as
5166 * per {@link ComponentName#flattenToString()}.
5167 *
5168 * @hide
5169 */
5170 public static final String SEARCH_GLOBAL_SEARCH_ACTIVITY =
5171 "search_global_search_activity";
5172
5173 /**
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08005174 * The number of promoted sources in GlobalSearch.
5175 * @hide
5176 */
5177 public static final String SEARCH_NUM_PROMOTED_SOURCES = "search_num_promoted_sources";
5178 /**
5179 * The maximum number of suggestions returned by GlobalSearch.
5180 * @hide
5181 */
5182 public static final String SEARCH_MAX_RESULTS_TO_DISPLAY = "search_max_results_to_display";
5183 /**
5184 * The number of suggestions GlobalSearch will ask each non-web search source for.
5185 * @hide
5186 */
5187 public static final String SEARCH_MAX_RESULTS_PER_SOURCE = "search_max_results_per_source";
5188 /**
5189 * The number of suggestions the GlobalSearch will ask the web search source for.
5190 * @hide
5191 */
5192 public static final String SEARCH_WEB_RESULTS_OVERRIDE_LIMIT =
5193 "search_web_results_override_limit";
5194 /**
5195 * The number of milliseconds that GlobalSearch will wait for suggestions from
5196 * promoted sources before continuing with all other sources.
5197 * @hide
5198 */
5199 public static final String SEARCH_PROMOTED_SOURCE_DEADLINE_MILLIS =
5200 "search_promoted_source_deadline_millis";
5201 /**
5202 * The number of milliseconds before GlobalSearch aborts search suggesiton queries.
5203 * @hide
5204 */
5205 public static final String SEARCH_SOURCE_TIMEOUT_MILLIS = "search_source_timeout_millis";
5206 /**
5207 * The maximum number of milliseconds that GlobalSearch shows the previous results
5208 * after receiving a new query.
5209 * @hide
5210 */
5211 public static final String SEARCH_PREFILL_MILLIS = "search_prefill_millis";
5212 /**
5213 * The maximum age of log data used for shortcuts in GlobalSearch.
5214 * @hide
5215 */
5216 public static final String SEARCH_MAX_STAT_AGE_MILLIS = "search_max_stat_age_millis";
5217 /**
5218 * The maximum age of log data used for source ranking in GlobalSearch.
5219 * @hide
5220 */
5221 public static final String SEARCH_MAX_SOURCE_EVENT_AGE_MILLIS =
5222 "search_max_source_event_age_millis";
5223 /**
5224 * The minimum number of impressions needed to rank a source in GlobalSearch.
5225 * @hide
5226 */
5227 public static final String SEARCH_MIN_IMPRESSIONS_FOR_SOURCE_RANKING =
5228 "search_min_impressions_for_source_ranking";
5229 /**
5230 * The minimum number of clicks needed to rank a source in GlobalSearch.
5231 * @hide
5232 */
5233 public static final String SEARCH_MIN_CLICKS_FOR_SOURCE_RANKING =
5234 "search_min_clicks_for_source_ranking";
5235 /**
5236 * The maximum number of shortcuts shown by GlobalSearch.
5237 * @hide
5238 */
5239 public static final String SEARCH_MAX_SHORTCUTS_RETURNED = "search_max_shortcuts_returned";
5240 /**
5241 * The size of the core thread pool for suggestion queries in GlobalSearch.
5242 * @hide
5243 */
5244 public static final String SEARCH_QUERY_THREAD_CORE_POOL_SIZE =
5245 "search_query_thread_core_pool_size";
5246 /**
5247 * The maximum size of the thread pool for suggestion queries in GlobalSearch.
5248 * @hide
5249 */
5250 public static final String SEARCH_QUERY_THREAD_MAX_POOL_SIZE =
5251 "search_query_thread_max_pool_size";
5252 /**
5253 * The size of the core thread pool for shortcut refreshing in GlobalSearch.
5254 * @hide
5255 */
5256 public static final String SEARCH_SHORTCUT_REFRESH_CORE_POOL_SIZE =
5257 "search_shortcut_refresh_core_pool_size";
5258 /**
5259 * The maximum size of the thread pool for shortcut refreshing in GlobalSearch.
5260 * @hide
5261 */
5262 public static final String SEARCH_SHORTCUT_REFRESH_MAX_POOL_SIZE =
5263 "search_shortcut_refresh_max_pool_size";
5264 /**
5265 * The maximun time that excess threads in the GlobalSeach thread pools will
5266 * wait before terminating.
5267 * @hide
5268 */
5269 public static final String SEARCH_THREAD_KEEPALIVE_SECONDS =
5270 "search_thread_keepalive_seconds";
5271 /**
5272 * The maximum number of concurrent suggestion queries to each source.
5273 * @hide
5274 */
5275 public static final String SEARCH_PER_SOURCE_CONCURRENT_QUERY_LIMIT =
5276 "search_per_source_concurrent_query_limit";
5277
San Mehat87734d32010-01-08 12:53:06 -08005278 /**
5279 * Whether or not alert sounds are played on MountService events. (0 = false, 1 = true)
5280 * @hide
5281 */
5282 public static final String MOUNT_PLAY_NOTIFICATION_SND = "mount_play_not_snd";
5283
5284 /**
5285 * Whether or not UMS auto-starts on UMS host detection. (0 = false, 1 = true)
5286 * @hide
5287 */
5288 public static final String MOUNT_UMS_AUTOSTART = "mount_ums_autostart";
5289
5290 /**
5291 * Whether or not a notification is displayed on UMS host detection. (0 = false, 1 = true)
5292 * @hide
5293 */
5294 public static final String MOUNT_UMS_PROMPT = "mount_ums_prompt";
5295
5296 /**
5297 * Whether or not a notification is displayed while UMS is enabled. (0 = false, 1 = true)
5298 * @hide
5299 */
5300 public static final String MOUNT_UMS_NOTIFY_ENABLED = "mount_ums_notify_enabled";
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08005301
Dan Egnor42471dd2010-01-07 17:25:22 -08005302 /**
5303 * If nonzero, ANRs in invisible background processes bring up a dialog.
5304 * Otherwise, the process will be silently killed.
5305 * @hide
5306 */
5307 public static final String ANR_SHOW_BACKGROUND = "anr_show_background";
Erikeebc8e22010-02-18 13:27:19 -08005308
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08005309 /**
5310 * The {@link ComponentName} string of the service to be used as the voice recognition
5311 * service.
Erikeebc8e22010-02-18 13:27:19 -08005312 *
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08005313 * @hide
5314 */
5315 public static final String VOICE_RECOGNITION_SERVICE = "voice_recognition_service";
Dan Egnor42471dd2010-01-07 17:25:22 -08005316
William Luh623a4282013-06-24 12:14:18 -07005317 /**
5318 * Stores whether an user has consented to have apps verified through PAM.
5319 * The value is boolean (1 or 0).
5320 *
5321 * @hide
5322 */
5323 public static final String PACKAGE_VERIFIER_USER_CONSENT =
5324 "package_verifier_user_consent";
satok988323c2011-06-22 16:38:13 +09005325
5326 /**
satokada8c4e2011-08-23 14:56:56 +09005327 * The {@link ComponentName} string of the selected spell checker service which is
5328 * one of the services managed by the text service manager.
5329 *
5330 * @hide
5331 */
5332 public static final String SELECTED_SPELL_CHECKER = "selected_spell_checker";
5333
5334 /**
5335 * The {@link ComponentName} string of the selected subtype of the selected spell checker
satok988323c2011-06-22 16:38:13 +09005336 * service which is one of the services managed by the text service manager.
5337 *
5338 * @hide
5339 */
satokada8c4e2011-08-23 14:56:56 +09005340 public static final String SELECTED_SPELL_CHECKER_SUBTYPE =
5341 "selected_spell_checker_subtype";
satok988323c2011-06-22 16:38:13 +09005342
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08005343 /**
satoka33c4fc2011-08-25 16:50:11 +09005344 * The {@link ComponentName} string whether spell checker is enabled or not.
5345 *
5346 * @hide
5347 */
5348 public static final String SPELL_CHECKER_ENABLED = "spell_checker_enabled";
5349
5350 /**
David Brown458e8062010-03-08 21:52:11 -08005351 * What happens when the user presses the Power button while in-call
5352 * and the screen is on.<br/>
5353 * <b>Values:</b><br/>
5354 * 1 - The Power button turns off the screen and locks the device. (Default behavior)<br/>
5355 * 2 - The Power button hangs up the current call.<br/>
5356 *
5357 * @hide
5358 */
5359 public static final String INCALL_POWER_BUTTON_BEHAVIOR = "incall_power_button_behavior";
5360
5361 /**
5362 * INCALL_POWER_BUTTON_BEHAVIOR value for "turn off screen".
5363 * @hide
5364 */
5365 public static final int INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF = 0x1;
5366
5367 /**
5368 * INCALL_POWER_BUTTON_BEHAVIOR value for "hang up".
5369 * @hide
5370 */
5371 public static final int INCALL_POWER_BUTTON_BEHAVIOR_HANGUP = 0x2;
5372
5373 /**
5374 * INCALL_POWER_BUTTON_BEHAVIOR default value.
5375 * @hide
5376 */
5377 public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT =
5378 INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF;
5379
5380 /**
Jeff Browna20dda42014-05-27 20:57:24 -07005381 * Whether the device should wake when the wake gesture sensor detects motion.
5382 * @hide
5383 */
5384 public static final String WAKE_GESTURE_ENABLED = "wake_gesture_enabled";
5385
5386 /**
John Spurlocka4215ce2014-08-04 14:50:38 -04005387 * Whether the device should doze if configured.
5388 * @hide
5389 */
5390 public static final String DOZE_ENABLED = "doze_enabled";
5391
5392 /**
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07005393 * The current night mode that has been selected by the user. Owned
5394 * and controlled by UiModeManagerService. Constants are as per
5395 * UiModeManager.
5396 * @hide
5397 */
5398 public static final String UI_NIGHT_MODE = "ui_night_mode";
Suchi Amalapurapu40e47252010-04-07 16:15:50 -07005399
5400 /**
John Spurlock1a868b72012-08-22 09:56:51 -04005401 * Whether screensavers are enabled.
Daniel Sandler0601eb72011-04-13 01:01:32 -04005402 * @hide
5403 */
Daniel Sandler2d545362011-11-17 10:38:37 -08005404 public static final String SCREENSAVER_ENABLED = "screensaver_enabled";
Daniel Sandler0601eb72011-04-13 01:01:32 -04005405
5406 /**
John Spurlock1a868b72012-08-22 09:56:51 -04005407 * The user's chosen screensaver components.
Daniel Sandler2d545362011-11-17 10:38:37 -08005408 *
John Spurlock1a868b72012-08-22 09:56:51 -04005409 * These will be launched by the PhoneWindowManager after a timeout when not on
Daniel Sandler2d545362011-11-17 10:38:37 -08005410 * battery, or upon dock insertion (if SCREENSAVER_ACTIVATE_ON_DOCK is set to 1).
Daniel Sandler0601eb72011-04-13 01:01:32 -04005411 * @hide
5412 */
John Spurlock1a868b72012-08-22 09:56:51 -04005413 public static final String SCREENSAVER_COMPONENTS = "screensaver_components";
Daniel Sandler2d545362011-11-17 10:38:37 -08005414
5415 /**
John Spurlock1a868b72012-08-22 09:56:51 -04005416 * If screensavers are enabled, whether the screensaver should be automatically launched
5417 * when the device is inserted into a (desk) dock.
Daniel Sandler2d545362011-11-17 10:38:37 -08005418 * @hide
5419 */
5420 public static final String SCREENSAVER_ACTIVATE_ON_DOCK = "screensaver_activate_on_dock";
Daniel Sandler0601eb72011-04-13 01:01:32 -04005421
John Spurlock1a868b72012-08-22 09:56:51 -04005422 /**
5423 * If screensavers are enabled, whether the screensaver should be automatically launched
5424 * when the screen times out when not on battery.
5425 * @hide
5426 */
5427 public static final String SCREENSAVER_ACTIVATE_ON_SLEEP = "screensaver_activate_on_sleep";
5428
5429 /**
5430 * If screensavers are enabled, the default screensaver component.
5431 * @hide
5432 */
5433 public static final String SCREENSAVER_DEFAULT_COMPONENT = "screensaver_default_component";
5434
Daniel Sandler0601eb72011-04-13 01:01:32 -04005435 /**
Martijn Coenena7397882013-07-30 20:07:47 -07005436 * The default NFC payment component
5437 * @hide
5438 */
5439 public static final String NFC_PAYMENT_DEFAULT_COMPONENT = "nfc_payment_default_component";
5440
5441 /**
Martijn Coenen2f6f3a012014-04-25 17:00:21 -07005442 * Whether NFC payment is handled by the foreground application or a default.
5443 * @hide
5444 */
5445 public static final String NFC_PAYMENT_FOREGROUND = "nfc_payment_foreground";
5446
5447 /**
David Braunf5d83192013-09-16 13:43:51 -07005448 * Specifies the package name currently configured to be the primary sms application
5449 * @hide
5450 */
5451 public static final String SMS_DEFAULT_APPLICATION = "sms_default_application";
5452
5453 /**
Yorke Lee014de022015-04-21 17:15:47 -07005454 * Specifies the package name currently configured to be the default dialer application
5455 * @hide
5456 */
5457 public static final String DIALER_DEFAULT_APPLICATION = "dialer_default_application";
5458
5459 /**
Adrian Roos943eb862015-03-26 12:31:16 -07005460 * Specifies the package name currently configured to be the emergency assistance application
5461 *
5462 * @see android.telephony.TelephonyManager#ACTION_EMERGENCY_ASSISTANCE
5463 *
5464 * @hide
5465 */
5466 public static final String EMERGENCY_ASSISTANCE_APPLICATION = "emergency_assistance_application";
5467
5468 /**
Jorim Jaggi9d910832015-05-18 17:35:26 -07005469 * Specifies whether the current app context on scren (assist data) will be sent to the
5470 * assist application (active voice interaction service).
5471 *
5472 * @hide
5473 */
5474 public static final String ASSIST_STRUCTURE_ENABLED = "assist_structure_enabled";
5475
5476 /**
Jorim Jaggia133f0b2015-06-26 16:40:00 -07005477 * Specifies whether a screenshot of the screen contents will be sent to the assist
5478 * application (active voice interaction service).
5479 *
5480 * @hide
5481 */
5482 public static final String ASSIST_SCREENSHOT_ENABLED = "assist_screenshot_enabled";
5483
5484 /**
John Spurlock7c74f782015-06-04 13:01:42 -04005485 * Names of the service components that the current user has explicitly allowed to
Chris Wren8326a8a2014-10-22 14:13:32 -04005486 * see all of the user's notifications, separated by ':'.
Daniel Sandler4b749ef2013-03-18 21:53:04 -04005487 *
5488 * @hide
5489 */
5490 public static final String ENABLED_NOTIFICATION_LISTENERS = "enabled_notification_listeners";
5491
John Spurlock7340fc82014-04-24 18:50:12 -04005492 /**
John Spurlock7c74f782015-06-04 13:01:42 -04005493 * Names of the packages that the current user has explicitly allowed to
5494 * manage notification policy configuration, separated by ':'.
5495 *
5496 * @hide
5497 */
5498 public static final String ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES =
5499 "enabled_notification_policy_access_packages";
5500
5501 /**
John Spurlock7340fc82014-04-24 18:50:12 -04005502 * @hide
5503 */
5504 public static final String ENABLED_CONDITION_PROVIDERS = "enabled_condition_providers";
5505
John Spurlock5c454122013-06-17 07:35:46 -04005506 /** @hide */
5507 public static final String BAR_SERVICE_COMPONENT = "bar_service_component";
5508
John Spurlockd67ec252013-09-05 11:31:54 -04005509 /** @hide */
John Spurlockcdb57ae2015-02-11 19:04:11 -05005510 public static final String VOLUME_CONTROLLER_SERVICE_COMPONENT
5511 = "volume_controller_service_component";
5512
5513 /** @hide */
John Spurlockf1a36642013-10-12 17:50:42 -04005514 public static final String IMMERSIVE_MODE_CONFIRMATIONS = "immersive_mode_confirmations";
John Spurlockd67ec252013-09-05 11:31:54 -04005515
Yorke Lee647f8f32013-05-07 10:49:44 -07005516 /**
Svetoslavf43e8512013-09-30 17:33:05 -07005517 * This is the query URI for finding a print service to install.
5518 *
5519 * @hide
5520 */
5521 public static final String PRINT_SERVICE_SEARCH_URI = "print_service_search_uri";
5522
5523 /**
5524 * This is the query URI for finding a NFC payment service to install.
5525 *
5526 * @hide
5527 */
5528 public static final String PAYMENT_SERVICE_SEARCH_URI = "payment_service_search_uri";
5529
5530 /**
Amith Yamasani1e9c2182014-06-11 17:25:51 -07005531 * If enabled, apps should try to skip any introductory hints on first launch. This might
Amith Yamasani0c416392014-06-13 15:54:39 -07005532 * apply to users that are already familiar with the environment or temporary users.
Amith Yamasani1e9c2182014-06-11 17:25:51 -07005533 * <p>
5534 * Type : int (0 to show hints, 1 to skip showing hints)
Amith Yamasani1e9c2182014-06-11 17:25:51 -07005535 */
5536 public static final String SKIP_FIRST_USE_HINTS = "skip_first_use_hints";
5537
5538 /**
John Spurlockaa5ee4d2014-07-25 13:05:12 -04005539 * Persisted playback time after a user confirmation of an unsafe volume level.
5540 *
5541 * @hide
5542 */
5543 public static final String UNSAFE_VOLUME_MUSIC_ACTIVE_MS = "unsafe_volume_music_active_ms";
5544
5545 /**
Dan Sandler52e5701e2014-07-22 23:14:54 -04005546 * This preference enables notification display on the lockscreen.
5547 * @hide
5548 */
5549 public static final String LOCK_SCREEN_SHOW_NOTIFICATIONS =
5550 "lock_screen_show_notifications";
5551
5552 /**
Dongwon Kang4d933a02014-08-07 22:51:47 -07005553 * List of TV inputs that are currently hidden. This is a string
Jaewan Kimf0e530e2014-08-22 00:43:31 +09005554 * containing the IDs of all hidden TV inputs. Each ID is encoded by
5555 * {@link android.net.Uri#encode(String)} and separated by ':'.
Dongwon Kang4d933a02014-08-07 22:51:47 -07005556 * @hide
5557 */
5558 public static final String TV_INPUT_HIDDEN_INPUTS = "tv_input_hidden_inputs";
5559
5560 /**
5561 * List of custom TV input labels. This is a string containing <TV input id, custom name>
Jaewan Kimf0e530e2014-08-22 00:43:31 +09005562 * pairs. TV input id and custom name are encoded by {@link android.net.Uri#encode(String)}
5563 * and separated by ','. Each pair is separated by ':'.
Dongwon Kang4d933a02014-08-07 22:51:47 -07005564 * @hide
5565 */
5566 public static final String TV_INPUT_CUSTOM_LABELS = "tv_input_custom_labels";
5567
5568 /**
Glenn Kasten34cc4db2014-08-13 10:56:38 -07005569 * Whether automatic routing of system audio to USB audio peripheral is disabled.
5570 * The value is boolean (1 or 0), where 1 means automatic routing is disabled,
5571 * and 0 means automatic routing is enabled.
5572 *
5573 * @hide
5574 */
5575 public static final String USB_AUDIO_AUTOMATIC_ROUTING_DISABLED =
5576 "usb_audio_automatic_routing_disabled";
5577
5578 /**
Jeff Brown05af6ad2014-09-30 20:54:30 -07005579 * The timeout in milliseconds before the device fully goes to sleep after
5580 * a period of inactivity. This value sets an upper bound on how long the device
5581 * will stay awake or dreaming without user activity. It should generally
Dianne Hackbornad6a99b2014-11-18 10:11:10 -08005582 * be longer than {@link Settings.System#SCREEN_OFF_TIMEOUT} as otherwise the device
Jeff Brown05af6ad2014-09-30 20:54:30 -07005583 * will sleep before it ever has a chance to dream.
5584 * <p>
5585 * Use -1 to disable this timeout.
5586 * </p>
5587 *
5588 * @hide
5589 */
5590 public static final String SLEEP_TIMEOUT = "sleep_timeout";
5591
5592 /**
Jason Monk27bbb2d2015-03-31 16:46:39 -04005593 * Controls whether double tap to wake is enabled.
5594 * @hide
5595 */
5596 public static final String DOUBLE_TAP_TO_WAKE = "double_tap_to_wake";
5597
5598 /**
Xiyuan Xiae6de8b92015-06-06 22:18:05 -07005599 * The current assistant component. It could be a voice interaction service,
5600 * or an activity that handles ACTION_ASSIST, or empty which means using the default
5601 * handling.
5602 *
5603 * @hide
5604 */
5605 public static final String ASSISTANT = "assistant";
5606
5607 /**
Svetoslav Ganova571a582011-09-20 18:32:20 -07005608 * This are the settings to be backed up.
5609 *
5610 * NOTE: Settings are backed up and restored in the order they appear
5611 * in this array. If you have one setting depending on another,
5612 * make sure that they are ordered appropriately.
5613 *
-b master501eec92009-07-06 13:53:11 -07005614 * @hide
5615 */
5616 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate58f41ec2013-01-11 15:40:36 -08005617 BUGREPORT_IN_POWER_MENU, // moved to global
Amith Yamasani8823c0a82009-07-07 14:30:17 -07005618 ALLOW_MOCK_LOCATION,
-b master501eec92009-07-06 13:53:11 -07005619 PARENTAL_CONTROL_ENABLED,
5620 PARENTAL_CONTROL_REDIRECT_URL,
Christopher Tate66488d62012-10-02 11:58:01 -07005621 USB_MASS_STORAGE_ENABLED, // moved to global
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07005622 ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED,
5623 ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE,
5624 ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE,
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07005625 ACCESSIBILITY_SCRIPT_INJECTION,
Christopher Tate14c2d792010-02-25 16:49:44 -08005626 BACKUP_AUTO_RESTORE,
-b master501eec92009-07-06 13:53:11 -07005627 ENABLED_ACCESSIBILITY_SERVICES,
Christopher Tate6597e342015-02-17 12:15:25 -08005628 ENABLED_NOTIFICATION_LISTENERS,
Christopher Tate7b9a28c2015-03-18 13:06:16 -07005629 ENABLED_INPUT_METHODS,
Svetoslav Ganov9a4c5cd2012-05-30 14:06:32 -07005630 TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES,
Svetoslav Ganova28a16d2011-07-28 11:24:21 -07005631 TOUCH_EXPLORATION_ENABLED,
Svetoslav Ganova571a582011-09-20 18:32:20 -07005632 ACCESSIBILITY_ENABLED,
Svetoslav Ganov55f937a2011-12-05 11:42:07 -08005633 ACCESSIBILITY_SPEAK_PASSWORD,
Chris Craikcce47eb2014-07-16 15:12:15 -07005634 ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED,
Alan Viveretteef793802013-07-23 14:15:28 -07005635 ACCESSIBILITY_CAPTIONING_ENABLED,
5636 ACCESSIBILITY_CAPTIONING_LOCALE,
5637 ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR,
5638 ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR,
5639 ACCESSIBILITY_CAPTIONING_EDGE_TYPE,
5640 ACCESSIBILITY_CAPTIONING_EDGE_COLOR,
5641 ACCESSIBILITY_CAPTIONING_TYPEFACE,
Alan Viverette69ce69b2013-08-29 12:23:48 -07005642 ACCESSIBILITY_CAPTIONING_FONT_SCALE,
-b master501eec92009-07-06 13:53:11 -07005643 TTS_USE_DEFAULTS,
5644 TTS_DEFAULT_RATE,
5645 TTS_DEFAULT_PITCH,
5646 TTS_DEFAULT_SYNTH,
5647 TTS_DEFAULT_LANG,
5648 TTS_DEFAULT_COUNTRY,
Charles Chenceffa152010-03-16 21:18:10 -07005649 TTS_ENABLED_PLUGINS,
Narayan Kamath6d632962011-08-24 11:51:37 +01005650 TTS_DEFAULT_LOCALE,
Christopher Tate66488d62012-10-02 11:58:01 -07005651 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, // moved to global
5652 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, // moved to global
5653 WIFI_NUM_OPEN_NETWORKS_KEPT, // moved to global
Christopher Tate06cbadd2015-03-16 18:29:42 -07005654 SELECTED_SPELL_CHECKER,
5655 SELECTED_SPELL_CHECKER_SUBTYPE,
5656 SPELL_CHECKER_ENABLED,
San Mehat87734d32010-01-08 12:53:06 -08005657 MOUNT_PLAY_NOTIFICATION_SND,
5658 MOUNT_UMS_AUTOSTART,
5659 MOUNT_UMS_PROMPT,
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07005660 MOUNT_UMS_NOTIFY_ENABLED,
Jeff Brown05af6ad2014-09-30 20:54:30 -07005661 UI_NIGHT_MODE,
Jason Monk27bbb2d2015-03-31 16:46:39 -04005662 SLEEP_TIMEOUT,
5663 DOUBLE_TAP_TO_WAKE,
-b master501eec92009-07-06 13:53:11 -07005664 };
5665
5666 /**
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07005667 * These entries are considered common between the personal and the managed profile,
5668 * since the managed profile doesn't get to change them.
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07005669 */
Svetoslav683914b2015-01-15 14:22:26 -08005670 private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>();
Amith Yamasanib0ff3222015-03-04 09:56:14 -08005671
Svetoslav683914b2015-01-15 14:22:26 -08005672 static {
5673 CLONE_TO_MANAGED_PROFILE.add(ACCESSIBILITY_ENABLED);
5674 CLONE_TO_MANAGED_PROFILE.add(ALLOW_MOCK_LOCATION);
5675 CLONE_TO_MANAGED_PROFILE.add(ALLOWED_GEOLOCATION_ORIGINS);
5676 CLONE_TO_MANAGED_PROFILE.add(DEFAULT_INPUT_METHOD);
5677 CLONE_TO_MANAGED_PROFILE.add(ENABLED_ACCESSIBILITY_SERVICES);
5678 CLONE_TO_MANAGED_PROFILE.add(ENABLED_INPUT_METHODS);
5679 CLONE_TO_MANAGED_PROFILE.add(LOCATION_MODE);
5680 CLONE_TO_MANAGED_PROFILE.add(LOCATION_PROVIDERS_ALLOWED);
5681 CLONE_TO_MANAGED_PROFILE.add(LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS);
5682 CLONE_TO_MANAGED_PROFILE.add(SELECTED_INPUT_METHOD_SUBTYPE);
5683 CLONE_TO_MANAGED_PROFILE.add(SELECTED_SPELL_CHECKER);
5684 CLONE_TO_MANAGED_PROFILE.add(SELECTED_SPELL_CHECKER_SUBTYPE);
5685 }
5686
5687 /** @hide */
5688 public static void getCloneToManagedProfileSettings(Set<String> outKeySet) {
5689 outKeySet.addAll(CLONE_TO_MANAGED_PROFILE);
5690 }
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07005691
5692 /**
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005693 * Helper method for determining if a location provider is enabled.
Tom O'Neilld5759432013-09-11 11:03:03 -07005694 *
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005695 * @param cr the content resolver to use
5696 * @param provider the location provider to query
5697 * @return true if the provider is enabled
Tom O'Neilld5759432013-09-11 11:03:03 -07005698 *
5699 * @deprecated use {@link #LOCATION_MODE} or
5700 * {@link LocationManager#isProviderEnabled(String)}
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005701 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07005702 @Deprecated
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005703 public static final boolean isLocationProviderEnabled(ContentResolver cr, String provider) {
Victoria Leaseb711d572012-10-02 13:14:11 -07005704 return isLocationProviderEnabledForUser(cr, provider, UserHandle.myUserId());
5705 }
5706
5707 /**
5708 * Helper method for determining if a location provider is enabled.
5709 * @param cr the content resolver to use
5710 * @param provider the location provider to query
5711 * @param userId the userId to query
5712 * @return true if the provider is enabled
Tom O'Neilld5759432013-09-11 11:03:03 -07005713 * @deprecated use {@link #LOCATION_MODE} or
5714 * {@link LocationManager#isProviderEnabled(String)}
Victoria Leaseb711d572012-10-02 13:14:11 -07005715 * @hide
5716 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07005717 @Deprecated
Victoria Leaseb711d572012-10-02 13:14:11 -07005718 public static final boolean isLocationProviderEnabledForUser(ContentResolver cr, String provider, int userId) {
5719 String allowedProviders = Settings.Secure.getStringForUser(cr,
5720 LOCATION_PROVIDERS_ALLOWED, userId);
Brad Fitzpatrick11fe1812010-09-10 16:07:52 -07005721 return TextUtils.delimitedStringContains(allowedProviders, ',', provider);
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005722 }
5723
5724 /**
5725 * Thread-safe method for enabling or disabling a single location provider.
5726 * @param cr the content resolver to use
5727 * @param provider the location provider to enable or disable
5728 * @param enabled true if the provider should be enabled
Tom O'Neilla324ac72013-08-26 14:40:23 -07005729 * @deprecated use {@link #putInt(ContentResolver, String, int)} and {@link #LOCATION_MODE}
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005730 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07005731 @Deprecated
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005732 public static final void setLocationProviderEnabled(ContentResolver cr,
5733 String provider, boolean enabled) {
Victoria Leaseb711d572012-10-02 13:14:11 -07005734 setLocationProviderEnabledForUser(cr, provider, enabled, UserHandle.myUserId());
5735 }
5736
5737 /**
5738 * Thread-safe method for enabling or disabling a single location provider.
Tom O'Neilla324ac72013-08-26 14:40:23 -07005739 *
Victoria Leaseb711d572012-10-02 13:14:11 -07005740 * @param cr the content resolver to use
5741 * @param provider the location provider to enable or disable
5742 * @param enabled true if the provider should be enabled
5743 * @param userId the userId for which to enable/disable providers
Tom O'Neilla324ac72013-08-26 14:40:23 -07005744 * @return true if the value was set, false on database errors
5745 * @deprecated use {@link #putIntForUser(ContentResolver, String, int, int)} and
5746 * {@link #LOCATION_MODE}
Victoria Leaseb711d572012-10-02 13:14:11 -07005747 * @hide
5748 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07005749 @Deprecated
Tom O'Neilla324ac72013-08-26 14:40:23 -07005750 public static final boolean setLocationProviderEnabledForUser(ContentResolver cr,
Victoria Leaseb711d572012-10-02 13:14:11 -07005751 String provider, boolean enabled, int userId) {
David Christie3f7b6522013-08-06 19:19:08 -07005752 synchronized (mLocationSettingsLock) {
5753 // to ensure thread safety, we write the provider name with a '+' or '-'
5754 // and let the SettingsProvider handle it rather than reading and modifying
5755 // the list of enabled providers.
5756 if (enabled) {
5757 provider = "+" + provider;
5758 } else {
5759 provider = "-" + provider;
5760 }
Tom O'Neilla324ac72013-08-26 14:40:23 -07005761 return putStringForUser(cr, Settings.Secure.LOCATION_PROVIDERS_ALLOWED, provider,
David Christie3f7b6522013-08-06 19:19:08 -07005762 userId);
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005763 }
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005764 }
Tom O'Neill1f48b782013-08-19 18:14:56 -07005765
5766 /**
5767 * Thread-safe method for setting the location mode to one of
5768 * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY},
5769 * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}.
5770 *
Tom O'Neill1f48b782013-08-19 18:14:56 -07005771 * @param cr the content resolver to use
5772 * @param mode such as {@link #LOCATION_MODE_HIGH_ACCURACY}
5773 * @param userId the userId for which to change mode
Tom O'Neilla324ac72013-08-26 14:40:23 -07005774 * @return true if the value was set, false on database errors
Tom O'Neill1f48b782013-08-19 18:14:56 -07005775 *
5776 * @throws IllegalArgumentException if mode is not one of the supported values
5777 */
Tom O'Neill7f6f4572013-08-27 10:53:15 -07005778 private static final boolean setLocationModeForUser(ContentResolver cr, int mode,
5779 int userId) {
Tom O'Neill1f48b782013-08-19 18:14:56 -07005780 synchronized (mLocationSettingsLock) {
5781 boolean gps = false;
5782 boolean network = false;
5783 switch (mode) {
5784 case LOCATION_MODE_OFF:
5785 break;
5786 case LOCATION_MODE_SENSORS_ONLY:
5787 gps = true;
5788 break;
5789 case LOCATION_MODE_BATTERY_SAVING:
5790 network = true;
5791 break;
5792 case LOCATION_MODE_HIGH_ACCURACY:
5793 gps = true;
5794 network = true;
5795 break;
5796 default:
5797 throw new IllegalArgumentException("Invalid location mode: " + mode);
5798 }
Tom O'Neill7731a992014-10-09 11:30:49 -07005799 // Note it's important that we set the NLP mode first. The Google implementation
5800 // of NLP clears its NLP consent setting any time it receives a
5801 // LocationManager.PROVIDERS_CHANGED_ACTION broadcast and NLP is disabled. Also,
5802 // it shows an NLP consent dialog any time it receives the broadcast, NLP is
5803 // enabled, and the NLP consent is not set. If 1) we were to enable GPS first,
5804 // 2) a setup wizard has its own NLP consent UI that sets the NLP consent setting,
5805 // and 3) the receiver happened to complete before we enabled NLP, then the Google
5806 // NLP would detect the attempt to enable NLP and show a redundant NLP consent
5807 // dialog. Then the people who wrote the setup wizard would be sad.
Tom O'Neilla324ac72013-08-26 14:40:23 -07005808 boolean nlpSuccess = Settings.Secure.setLocationProviderEnabledForUser(
Tom O'Neill1f48b782013-08-19 18:14:56 -07005809 cr, LocationManager.NETWORK_PROVIDER, network, userId);
Tom O'Neill7731a992014-10-09 11:30:49 -07005810 boolean gpsSuccess = Settings.Secure.setLocationProviderEnabledForUser(
5811 cr, LocationManager.GPS_PROVIDER, gps, userId);
Tom O'Neilla324ac72013-08-26 14:40:23 -07005812 return gpsSuccess && nlpSuccess;
Tom O'Neill1f48b782013-08-19 18:14:56 -07005813 }
5814 }
5815
5816 /**
Tom O'Neill1f48b782013-08-19 18:14:56 -07005817 * Thread-safe method for reading the location mode, returns one of
5818 * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY},
5819 * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}.
5820 *
5821 * @param cr the content resolver to use
5822 * @param userId the userId for which to read the mode
5823 * @return the location mode
5824 */
Tom O'Neill7f6f4572013-08-27 10:53:15 -07005825 private static final int getLocationModeForUser(ContentResolver cr, int userId) {
Tom O'Neill1f48b782013-08-19 18:14:56 -07005826 synchronized (mLocationSettingsLock) {
5827 boolean gpsEnabled = Settings.Secure.isLocationProviderEnabledForUser(
5828 cr, LocationManager.GPS_PROVIDER, userId);
5829 boolean networkEnabled = Settings.Secure.isLocationProviderEnabledForUser(
5830 cr, LocationManager.NETWORK_PROVIDER, userId);
5831 if (gpsEnabled && networkEnabled) {
5832 return LOCATION_MODE_HIGH_ACCURACY;
5833 } else if (gpsEnabled) {
5834 return LOCATION_MODE_SENSORS_ONLY;
5835 } else if (networkEnabled) {
5836 return LOCATION_MODE_BATTERY_SAVING;
5837 } else {
5838 return LOCATION_MODE_OFF;
5839 }
5840 }
5841 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005842 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005843
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005844 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005845 * Global system settings, containing preferences that always apply identically
5846 * to all defined users. Applications can read these but are not allowed to write;
5847 * like the "Secure" settings, these are for preferences that the user must
5848 * explicitly modify through the system UI or specialized APIs for those values.
5849 */
5850 public static final class Global extends NameValueTable {
5851 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_global_version";
5852
5853 /**
5854 * The content:// style URL for global secure settings items. Not public.
5855 */
5856 public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/global");
5857
5858 /**
Amith Yamasani23a0f052014-07-25 12:26:53 -07005859 * Whether users are allowed to add more users or guest from lockscreen.
5860 * <p>
5861 * Type: int
5862 * @hide
5863 */
5864 public static final String ADD_USERS_WHEN_LOCKED = "add_users_when_locked";
5865
5866 /**
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07005867 * Setting whether the global gesture for enabling accessibility is enabled.
5868 * If this gesture is enabled the user will be able to perfrom it to enable
5869 * the accessibility state without visiting the settings app.
5870 * @hide
5871 */
5872 public static final String ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED =
5873 "enable_accessibility_global_gesture_enabled";
5874
5875 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005876 * Whether Airplane Mode is on.
5877 */
5878 public static final String AIRPLANE_MODE_ON = "airplane_mode_on";
5879
5880 /**
Bryce Lee584a4452014-10-21 15:55:55 -07005881 * Whether Theater Mode is on.
5882 * {@hide}
5883 */
Bryce Leecdfebd62015-02-02 08:19:11 -08005884 @SystemApi
Bryce Lee584a4452014-10-21 15:55:55 -07005885 public static final String THEATER_MODE_ON = "theater_mode_on";
5886
5887 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005888 * Constant for use in AIRPLANE_MODE_RADIOS to specify Bluetooth radio.
5889 */
5890 public static final String RADIO_BLUETOOTH = "bluetooth";
5891
5892 /**
5893 * Constant for use in AIRPLANE_MODE_RADIOS to specify Wi-Fi radio.
5894 */
5895 public static final String RADIO_WIFI = "wifi";
5896
5897 /**
5898 * {@hide}
5899 */
5900 public static final String RADIO_WIMAX = "wimax";
5901 /**
5902 * Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio.
5903 */
5904 public static final String RADIO_CELL = "cell";
5905
5906 /**
5907 * Constant for use in AIRPLANE_MODE_RADIOS to specify NFC radio.
5908 */
5909 public static final String RADIO_NFC = "nfc";
5910
5911 /**
5912 * A comma separated list of radios that need to be disabled when airplane mode
5913 * is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are
5914 * included in the comma separated list.
5915 */
5916 public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios";
5917
5918 /**
5919 * A comma separated list of radios that should to be disabled when airplane mode
5920 * is on, but can be manually reenabled by the user. For example, if RADIO_WIFI is
5921 * added to both AIRPLANE_MODE_RADIOS and AIRPLANE_MODE_TOGGLEABLE_RADIOS, then Wifi
5922 * will be turned off when entering airplane mode, but the user will be able to reenable
5923 * Wifi in the Settings app.
5924 *
5925 * {@hide}
5926 */
5927 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios";
5928
5929 /**
5930 * The policy for deciding when Wi-Fi should go to sleep (which will in
5931 * turn switch to using the mobile data as an Internet connection).
5932 * <p>
5933 * Set to one of {@link #WIFI_SLEEP_POLICY_DEFAULT},
5934 * {@link #WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED}, or
5935 * {@link #WIFI_SLEEP_POLICY_NEVER}.
5936 */
5937 public static final String WIFI_SLEEP_POLICY = "wifi_sleep_policy";
5938
5939 /**
5940 * Value for {@link #WIFI_SLEEP_POLICY} to use the default Wi-Fi sleep
5941 * policy, which is to sleep shortly after the turning off
5942 * according to the {@link #STAY_ON_WHILE_PLUGGED_IN} setting.
5943 */
5944 public static final int WIFI_SLEEP_POLICY_DEFAULT = 0;
5945
5946 /**
5947 * Value for {@link #WIFI_SLEEP_POLICY} to use the default policy when
5948 * the device is on battery, and never go to sleep when the device is
5949 * plugged in.
5950 */
5951 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1;
5952
5953 /**
5954 * Value for {@link #WIFI_SLEEP_POLICY} to never go to sleep.
5955 */
5956 public static final int WIFI_SLEEP_POLICY_NEVER = 2;
5957
5958 /**
5959 * Value to specify if the user prefers the date, time and time zone
5960 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
5961 */
5962 public static final String AUTO_TIME = "auto_time";
5963
5964 /**
5965 * Value to specify if the user prefers the time zone
5966 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
5967 */
5968 public static final String AUTO_TIME_ZONE = "auto_time_zone";
5969
5970 /**
5971 * URI for the car dock "in" event sound.
5972 * @hide
5973 */
5974 public static final String CAR_DOCK_SOUND = "car_dock_sound";
5975
5976 /**
5977 * URI for the car dock "out" event sound.
5978 * @hide
5979 */
5980 public static final String CAR_UNDOCK_SOUND = "car_undock_sound";
5981
5982 /**
5983 * URI for the desk dock "in" event sound.
5984 * @hide
5985 */
5986 public static final String DESK_DOCK_SOUND = "desk_dock_sound";
5987
5988 /**
5989 * URI for the desk dock "out" event sound.
5990 * @hide
5991 */
5992 public static final String DESK_UNDOCK_SOUND = "desk_undock_sound";
5993
5994 /**
5995 * Whether to play a sound for dock events.
5996 * @hide
5997 */
5998 public static final String DOCK_SOUNDS_ENABLED = "dock_sounds_enabled";
5999
6000 /**
6001 * URI for the "device locked" (keyguard shown) sound.
6002 * @hide
6003 */
6004 public static final String LOCK_SOUND = "lock_sound";
6005
6006 /**
6007 * URI for the "device unlocked" sound.
6008 * @hide
6009 */
6010 public static final String UNLOCK_SOUND = "unlock_sound";
6011
6012 /**
Adrian Roos49e057d2014-08-13 17:14:51 +02006013 * URI for the "device is trusted" sound, which is played when the device enters the trusted
6014 * state without unlocking.
6015 * @hide
6016 */
6017 public static final String TRUSTED_SOUND = "trusted_sound";
6018
6019 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006020 * URI for the low battery sound file.
6021 * @hide
6022 */
6023 public static final String LOW_BATTERY_SOUND = "low_battery_sound";
6024
6025 /**
6026 * Whether to play a sound for low-battery alerts.
6027 * @hide
6028 */
6029 public static final String POWER_SOUNDS_ENABLED = "power_sounds_enabled";
6030
6031 /**
Jeff Brown84e27562012-12-07 13:56:34 -08006032 * URI for the "wireless charging started" sound.
6033 * @hide
6034 */
6035 public static final String WIRELESS_CHARGING_STARTED_SOUND =
6036 "wireless_charging_started_sound";
6037
6038 /**
John Spurlock51a871d2015-05-06 17:41:30 -04006039 * Whether to play a sound for charging events.
6040 * @hide
6041 */
6042 public static final String CHARGING_SOUNDS_ENABLED = "charging_sounds_enabled";
6043
6044 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006045 * Whether we keep the device on while the device is plugged in.
6046 * Supported values are:
6047 * <ul>
6048 * <li>{@code 0} to never stay on while plugged in</li>
6049 * <li>{@link BatteryManager#BATTERY_PLUGGED_AC} to stay on for AC charger</li>
6050 * <li>{@link BatteryManager#BATTERY_PLUGGED_USB} to stay on for USB charger</li>
6051 * <li>{@link BatteryManager#BATTERY_PLUGGED_WIRELESS} to stay on for wireless charger</li>
6052 * </ul>
6053 * These values can be OR-ed together.
6054 */
6055 public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in";
6056
6057 /**
Christopher Tate58f41ec2013-01-11 15:40:36 -08006058 * When the user has enable the option to have a "bug report" command
6059 * in the power menu.
6060 * @hide
6061 */
6062 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
6063
6064 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006065 * Whether ADB is enabled.
6066 */
6067 public static final String ADB_ENABLED = "adb_enabled";
6068
6069 /**
Jon Miranda836c0a82014-08-11 12:32:26 -07006070 * Whether Views are allowed to save their attribute data.
6071 * @hide
6072 */
6073 public static final String DEBUG_VIEW_ATTRIBUTES = "debug_view_attributes";
6074
6075 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006076 * Whether assisted GPS should be enabled or not.
6077 * @hide
6078 */
6079 public static final String ASSISTED_GPS_ENABLED = "assisted_gps_enabled";
6080
6081 /**
6082 * Whether bluetooth is enabled/disabled
6083 * 0=disabled. 1=enabled.
6084 */
6085 public static final String BLUETOOTH_ON = "bluetooth_on";
6086
6087 /**
6088 * CDMA Cell Broadcast SMS
6089 * 0 = CDMA Cell Broadcast SMS disabled
6090 * 1 = CDMA Cell Broadcast SMS enabled
6091 * @hide
6092 */
6093 public static final String CDMA_CELL_BROADCAST_SMS =
6094 "cdma_cell_broadcast_sms";
6095
6096 /**
6097 * The CDMA roaming mode 0 = Home Networks, CDMA default
6098 * 1 = Roaming on Affiliated networks
6099 * 2 = Roaming on any networks
6100 * @hide
6101 */
6102 public static final String CDMA_ROAMING_MODE = "roaming_settings";
6103
6104 /**
6105 * The CDMA subscription mode 0 = RUIM/SIM (default)
6106 * 1 = NV
6107 * @hide
6108 */
6109 public static final String CDMA_SUBSCRIPTION_MODE = "subscription_mode";
6110
6111 /** Inactivity timeout to track mobile data activity.
6112 *
6113 * If set to a positive integer, it indicates the inactivity timeout value in seconds to
6114 * infer the data activity of mobile network. After a period of no activity on mobile
6115 * networks with length specified by the timeout, an {@code ACTION_DATA_ACTIVITY_CHANGE}
6116 * intent is fired to indicate a transition of network status from "active" to "idle". Any
6117 * subsequent activity on mobile networks triggers the firing of {@code
6118 * ACTION_DATA_ACTIVITY_CHANGE} intent indicating transition from "idle" to "active".
6119 *
6120 * Network activity refers to transmitting or receiving data on the network interfaces.
6121 *
6122 * Tracking is disabled if set to zero or negative value.
6123 *
6124 * @hide
6125 */
6126 public static final String DATA_ACTIVITY_TIMEOUT_MOBILE = "data_activity_timeout_mobile";
6127
6128 /** Timeout to tracking Wifi data activity. Same as {@code DATA_ACTIVITY_TIMEOUT_MOBILE}
6129 * but for Wifi network.
6130 * @hide
6131 */
6132 public static final String DATA_ACTIVITY_TIMEOUT_WIFI = "data_activity_timeout_wifi";
6133
6134 /**
6135 * Whether or not data roaming is enabled. (0 = false, 1 = true)
6136 */
6137 public static final String DATA_ROAMING = "data_roaming";
6138
6139 /**
Wink Saville75c1e692013-03-20 17:06:50 -07006140 * The value passed to a Mobile DataConnection via bringUp which defines the
6141 * number of retries to preform when setting up the initial connection. The default
6142 * value defined in DataConnectionTrackerBase#DEFAULT_MDC_INITIAL_RETRY is currently 1.
6143 * @hide
6144 */
6145 public static final String MDC_INITIAL_MAX_RETRY = "mdc_initial_max_retry";
6146
6147 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006148 * Whether user has enabled development settings.
6149 */
6150 public static final String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled";
6151
6152 /**
6153 * Whether the device has been provisioned (0 = false, 1 = true)
6154 */
6155 public static final String DEVICE_PROVISIONED = "device_provisioned";
6156
6157 /**
6158 * The saved value for WindowManagerService.setForcedDisplayDensity().
6159 * One integer in dpi. If unset, then use the real display density.
6160 * @hide
6161 */
6162 public static final String DISPLAY_DENSITY_FORCED = "display_density_forced";
6163
6164 /**
6165 * The saved value for WindowManagerService.setForcedDisplaySize().
6166 * Two integers separated by a comma. If unset, then use the real display size.
6167 * @hide
6168 */
6169 public static final String DISPLAY_SIZE_FORCED = "display_size_forced";
6170
6171 /**
Jeff Brownd46747a2015-04-15 19:02:36 -07006172 * The saved value for WindowManagerService.setForcedDisplayScalingMode().
6173 * 0 or unset if scaling is automatic, 1 if scaling is disabled.
6174 * @hide
6175 */
6176 public static final String DISPLAY_SCALING_FORCE = "display_scaling_force";
6177
6178 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006179 * The maximum size, in bytes, of a download that the download manager will transfer over
6180 * a non-wifi connection.
6181 * @hide
6182 */
6183 public static final String DOWNLOAD_MAX_BYTES_OVER_MOBILE =
6184 "download_manager_max_bytes_over_mobile";
6185
6186 /**
6187 * The recommended maximum size, in bytes, of a download that the download manager should
6188 * transfer over a non-wifi connection. Over this size, the use will be warned, but will
6189 * have the option to start the download over the mobile connection anyway.
6190 * @hide
6191 */
6192 public static final String DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE =
6193 "download_manager_recommended_max_bytes_over_mobile";
6194
6195 /**
Christopher Tateaa036a22014-05-19 16:33:27 -07006196 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
Christopher Tate06efb532012-08-24 15:29:27 -07006197 */
Christopher Tateaa036a22014-05-19 16:33:27 -07006198 @Deprecated
6199 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
Christopher Tate06efb532012-08-24 15:29:27 -07006200
6201 /**
Jinsuk Kimb3d91772014-07-10 12:48:54 +09006202 * Whether HDMI control shall be enabled. If disabled, no CEC/MHL command will be
6203 * sent or processed. (0 = false, 1 = true)
6204 * @hide
6205 */
6206 public static final String HDMI_CONTROL_ENABLED = "hdmi_control_enabled";
6207
6208 /**
6209 * Whether HDMI system audio is enabled. If enabled, TV internal speaker is muted,
6210 * and the output is redirected to AV Receiver connected via
6211 * {@Global#HDMI_SYSTEM_AUDIO_OUTPUT}.
6212 * @hide
6213 */
6214 public static final String HDMI_SYSTEM_AUDIO_ENABLED = "hdmi_system_audio_enabled";
6215
6216 /**
Jinsuk Kimb3d91772014-07-10 12:48:54 +09006217 * Whether TV will automatically turn on upon reception of the CEC command
6218 * &lt;Text View On&gt; or &lt;Image View On&gt;. (0 = false, 1 = true)
6219 * @hide
6220 */
6221 public static final String HDMI_CONTROL_AUTO_WAKEUP_ENABLED =
6222 "hdmi_control_auto_wakeup_enabled";
6223
6224 /**
6225 * Whether TV will also turn off other CEC devices when it goes to standby mode.
6226 * (0 = false, 1 = true)
6227 * @hide
6228 */
6229 public static final String HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED =
6230 "hdmi_control_auto_device_off_enabled";
6231
6232 /**
Lorenzo Colitti06d7e532015-03-16 23:46:24 +09006233 * Whether to use the DHCP client from Lollipop and earlier instead of the newer Android DHCP
6234 * client.
6235 * (0 = false, 1 = true)
6236 * @hide
6237 */
6238 public static final String LEGACY_DHCP_CLIENT = "legacy_dhcp_client";
6239
6240 /**
Jinsuk Kimb3d91772014-07-10 12:48:54 +09006241 * Whether TV will switch to MHL port when a mobile device is plugged in.
6242 * (0 = false, 1 = true)
6243 * @hide
6244 */
6245 public static final String MHL_INPUT_SWITCHING_ENABLED = "mhl_input_switching_enabled";
6246
6247 /**
6248 * Whether TV will charge the mobile device connected at MHL port. (0 = false, 1 = true)
6249 * @hide
6250 */
6251 public static final String MHL_POWER_CHARGE_ENABLED = "mhl_power_charge_enabled";
6252
6253 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006254 * Whether mobile data connections are allowed by the user. See
6255 * ConnectivityManager for more info.
6256 * @hide
6257 */
6258 public static final String MOBILE_DATA = "mobile_data";
6259
Erik Klineda4bfa82015-04-30 12:58:40 +09006260 /**
6261 * Whether the mobile data connection should remain active even when higher
6262 * priority networks like WiFi are active, to help make network switching faster.
6263 *
6264 * See ConnectivityService for more info.
6265 *
6266 * (0 = disabled, 1 = enabled)
6267 * @hide
6268 */
6269 public static final String MOBILE_DATA_ALWAYS_ON = "mobile_data_always_on";
6270
Christopher Tate06efb532012-08-24 15:29:27 -07006271 /** {@hide} */
6272 public static final String NETSTATS_ENABLED = "netstats_enabled";
6273 /** {@hide} */
6274 public static final String NETSTATS_POLL_INTERVAL = "netstats_poll_interval";
6275 /** {@hide} */
6276 public static final String NETSTATS_TIME_CACHE_MAX_AGE = "netstats_time_cache_max_age";
6277 /** {@hide} */
6278 public static final String NETSTATS_GLOBAL_ALERT_BYTES = "netstats_global_alert_bytes";
6279 /** {@hide} */
6280 public static final String NETSTATS_SAMPLE_ENABLED = "netstats_sample_enabled";
Christopher Tate06efb532012-08-24 15:29:27 -07006281
6282 /** {@hide} */
6283 public static final String NETSTATS_DEV_BUCKET_DURATION = "netstats_dev_bucket_duration";
6284 /** {@hide} */
6285 public static final String NETSTATS_DEV_PERSIST_BYTES = "netstats_dev_persist_bytes";
6286 /** {@hide} */
6287 public static final String NETSTATS_DEV_ROTATE_AGE = "netstats_dev_rotate_age";
6288 /** {@hide} */
6289 public static final String NETSTATS_DEV_DELETE_AGE = "netstats_dev_delete_age";
6290
6291 /** {@hide} */
6292 public static final String NETSTATS_UID_BUCKET_DURATION = "netstats_uid_bucket_duration";
6293 /** {@hide} */
6294 public static final String NETSTATS_UID_PERSIST_BYTES = "netstats_uid_persist_bytes";
6295 /** {@hide} */
6296 public static final String NETSTATS_UID_ROTATE_AGE = "netstats_uid_rotate_age";
6297 /** {@hide} */
6298 public static final String NETSTATS_UID_DELETE_AGE = "netstats_uid_delete_age";
6299
6300 /** {@hide} */
6301 public static final String NETSTATS_UID_TAG_BUCKET_DURATION = "netstats_uid_tag_bucket_duration";
6302 /** {@hide} */
6303 public static final String NETSTATS_UID_TAG_PERSIST_BYTES = "netstats_uid_tag_persist_bytes";
6304 /** {@hide} */
6305 public static final String NETSTATS_UID_TAG_ROTATE_AGE = "netstats_uid_tag_rotate_age";
6306 /** {@hide} */
6307 public static final String NETSTATS_UID_TAG_DELETE_AGE = "netstats_uid_tag_delete_age";
6308
6309 /**
6310 * User preference for which network(s) should be used. Only the
6311 * connectivity service should touch this.
6312 */
6313 public static final String NETWORK_PREFERENCE = "network_preference";
6314
6315 /**
Jeff Davidsondd6fd1e2014-04-14 15:14:30 -07006316 * Which package name to use for network scoring. If null, or if the package is not a valid
6317 * scorer app, external network scores will neither be requested nor accepted.
6318 * @hide
6319 */
6320 public static final String NETWORK_SCORER_APP = "network_scorer_app";
6321
6322 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006323 * If the NITZ_UPDATE_DIFF time is exceeded then an automatic adjustment
6324 * to SystemClock will be allowed even if NITZ_UPDATE_SPACING has not been
6325 * exceeded.
6326 * @hide
6327 */
6328 public static final String NITZ_UPDATE_DIFF = "nitz_update_diff";
6329
6330 /**
6331 * The length of time in milli-seconds that automatic small adjustments to
6332 * SystemClock are ignored if NITZ_UPDATE_DIFF is not exceeded.
6333 * @hide
6334 */
6335 public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing";
6336
6337 /** Preferred NTP server. {@hide} */
6338 public static final String NTP_SERVER = "ntp_server";
6339 /** Timeout in milliseconds to wait for NTP server. {@hide} */
6340 public static final String NTP_TIMEOUT = "ntp_timeout";
6341
Jeff Sharkeye8a4b662015-06-27 15:43:45 -07006342 /** {@hide} */
6343 public static final String STORAGE_BENCHMARK_INTERVAL = "storage_benchmark_interval";
6344
Christopher Tate06efb532012-08-24 15:29:27 -07006345 /**
rich cannings4d8fc792012-09-07 14:43:43 -07006346 * Whether the package manager should send package verification broadcasts for verifiers to
6347 * review apps prior to installation.
6348 * 1 = request apps to be verified prior to installation, if a verifier exists.
6349 * 0 = do not verify apps before installation
rich cannings4e5753f2012-09-19 16:03:56 -07006350 * @hide
rich cannings4d8fc792012-09-07 14:43:43 -07006351 */
6352 public static final String PACKAGE_VERIFIER_ENABLE = "package_verifier_enable";
6353
6354 /** Timeout for package verification.
rich cannings4e5753f2012-09-19 16:03:56 -07006355 * @hide */
rich cannings4d8fc792012-09-07 14:43:43 -07006356 public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout";
6357
6358 /** Default response code for package verification.
rich cannings4e5753f2012-09-19 16:03:56 -07006359 * @hide */
rich cannings4d8fc792012-09-07 14:43:43 -07006360 public static final String PACKAGE_VERIFIER_DEFAULT_RESPONSE = "verifier_default_response";
6361
rich cannings4e5753f2012-09-19 16:03:56 -07006362 /**
6363 * Show package verification setting in the Settings app.
rich canningse6686b32012-09-16 14:02:20 -07006364 * 1 = show (default)
6365 * 0 = hide
rich cannings4e5753f2012-09-19 16:03:56 -07006366 * @hide
rich canningse6686b32012-09-16 14:02:20 -07006367 */
6368 public static final String PACKAGE_VERIFIER_SETTING_VISIBLE = "verifier_setting_visible";
6369
rich cannings4d8fc792012-09-07 14:43:43 -07006370 /**
Fabrice Di Meglio1c1b4712014-11-19 17:12:32 -08006371 * Run package verification on apps installed through ADB/ADT/USB
rich cannings4e5753f2012-09-19 16:03:56 -07006372 * 1 = perform package verification on ADB installs (default)
6373 * 0 = bypass package verification on ADB installs
6374 * @hide
6375 */
6376 public static final String PACKAGE_VERIFIER_INCLUDE_ADB = "verifier_verify_adb_installs";
6377
6378 /**
Christopher Tate7265abe2014-11-21 13:54:45 -08006379 * Time since last fstrim (milliseconds) after which we force one to happen
6380 * during device startup. If unset, the default is 3 days.
6381 * @hide
6382 */
6383 public static final String FSTRIM_MANDATORY_INTERVAL = "fstrim_mandatory_interval";
6384
6385 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006386 * The interval in milliseconds at which to check packet counts on the
6387 * mobile data interface when screen is on, to detect possible data
6388 * connection problems.
6389 * @hide
6390 */
6391 public static final String PDP_WATCHDOG_POLL_INTERVAL_MS =
6392 "pdp_watchdog_poll_interval_ms";
6393
6394 /**
6395 * The interval in milliseconds at which to check packet counts on the
6396 * mobile data interface when screen is off, to detect possible data
6397 * connection problems.
6398 * @hide
6399 */
6400 public static final String PDP_WATCHDOG_LONG_POLL_INTERVAL_MS =
6401 "pdp_watchdog_long_poll_interval_ms";
6402
6403 /**
6404 * The interval in milliseconds at which to check packet counts on the
6405 * mobile data interface after {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT}
6406 * outgoing packets has been reached without incoming packets.
6407 * @hide
6408 */
6409 public static final String PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS =
6410 "pdp_watchdog_error_poll_interval_ms";
6411
6412 /**
6413 * The number of outgoing packets sent without seeing an incoming packet
6414 * that triggers a countdown (of {@link #PDP_WATCHDOG_ERROR_POLL_COUNT}
6415 * device is logged to the event log
6416 * @hide
6417 */
6418 public static final String PDP_WATCHDOG_TRIGGER_PACKET_COUNT =
6419 "pdp_watchdog_trigger_packet_count";
6420
6421 /**
6422 * The number of polls to perform (at {@link #PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS})
6423 * after hitting {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} before
6424 * attempting data connection recovery.
6425 * @hide
6426 */
6427 public static final String PDP_WATCHDOG_ERROR_POLL_COUNT =
6428 "pdp_watchdog_error_poll_count";
6429
6430 /**
6431 * The number of failed PDP reset attempts before moving to something more
6432 * drastic: re-registering to the network.
6433 * @hide
6434 */
6435 public static final String PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT =
6436 "pdp_watchdog_max_pdp_reset_fail_count";
6437
6438 /**
6439 * A positive value indicates how often the SamplingProfiler
6440 * should take snapshots. Zero value means SamplingProfiler
6441 * is disabled.
6442 *
6443 * @hide
6444 */
6445 public static final String SAMPLING_PROFILER_MS = "sampling_profiler_ms";
6446
6447 /**
6448 * URL to open browser on to allow user to manage a prepay account
6449 * @hide
6450 */
6451 public static final String SETUP_PREPAID_DATA_SERVICE_URL =
6452 "setup_prepaid_data_service_url";
6453
6454 /**
6455 * URL to attempt a GET on to see if this is a prepay device
6456 * @hide
6457 */
6458 public static final String SETUP_PREPAID_DETECTION_TARGET_URL =
6459 "setup_prepaid_detection_target_url";
6460
6461 /**
6462 * Host to check for a redirect to after an attempt to GET
6463 * SETUP_PREPAID_DETECTION_TARGET_URL. (If we redirected there,
6464 * this is a prepaid device with zero balance.)
6465 * @hide
6466 */
6467 public static final String SETUP_PREPAID_DETECTION_REDIR_HOST =
6468 "setup_prepaid_detection_redir_host";
6469
6470 /**
Jake Hamby76a61422012-09-06 17:40:21 -07006471 * The interval in milliseconds at which to check the number of SMS sent out without asking
6472 * for use permit, to limit the un-authorized SMS usage.
6473 *
6474 * @hide
6475 */
6476 public static final String SMS_OUTGOING_CHECK_INTERVAL_MS =
6477 "sms_outgoing_check_interval_ms";
6478
6479 /**
6480 * The number of outgoing SMS sent without asking for user permit (of {@link
6481 * #SMS_OUTGOING_CHECK_INTERVAL_MS}
6482 *
6483 * @hide
6484 */
6485 public static final String SMS_OUTGOING_CHECK_MAX_COUNT =
6486 "sms_outgoing_check_max_count";
6487
6488 /**
6489 * Used to disable SMS short code confirmation - defaults to true.
Robert Greenwalt026efcc2012-09-24 10:03:21 -07006490 * True indcates we will do the check, etc. Set to false to disable.
Jake Hamby76a61422012-09-06 17:40:21 -07006491 * @see com.android.internal.telephony.SmsUsageMonitor
6492 * @hide
6493 */
6494 public static final String SMS_SHORT_CODE_CONFIRMATION = "sms_short_code_confirmation";
6495
Robert Greenwalt026efcc2012-09-24 10:03:21 -07006496 /**
6497 * Used to select which country we use to determine premium sms codes.
6498 * One of com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_SIM,
6499 * com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_NETWORK,
6500 * or com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_BOTH.
6501 * @hide
6502 */
6503 public static final String SMS_SHORT_CODE_RULE = "sms_short_code_rule";
6504
Jake Hamby76a61422012-09-06 17:40:21 -07006505 /**
JP Abgrall32d1ac4d2014-02-21 12:05:20 -08006506 * Used to select TCP's default initial receiver window size in segments - defaults to a build config value
6507 * @hide
6508 */
6509 public static final String TCP_DEFAULT_INIT_RWND = "tcp_default_init_rwnd";
6510
6511 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006512 * Used to disable Tethering on a device - defaults to true
6513 * @hide
6514 */
6515 public static final String TETHER_SUPPORTED = "tether_supported";
6516
6517 /**
6518 * Used to require DUN APN on the device or not - defaults to a build config value
6519 * which defaults to false
6520 * @hide
6521 */
6522 public static final String TETHER_DUN_REQUIRED = "tether_dun_required";
6523
6524 /**
6525 * Used to hold a gservices-provisioned apn value for DUN. If set, or the
6526 * corresponding build config values are set it will override the APN DB
6527 * values.
6528 * Consists of a comma seperated list of strings:
6529 * "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type"
6530 * note that empty fields can be ommitted: "name,apn,,,,,,,,,310,260,,DUN"
6531 * @hide
6532 */
6533 public static final String TETHER_DUN_APN = "tether_dun_apn";
6534
6535 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006536 * USB Mass Storage Enabled
6537 */
6538 public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled";
6539
6540 /**
6541 * If this setting is set (to anything), then all references
6542 * to Gmail on the device must change to Google Mail.
6543 */
6544 public static final String USE_GOOGLE_MAIL = "use_google_mail";
6545
Hui Shu22671772014-10-01 21:41:07 +00006546 /**
6547 * Webview Data reduction proxy key.
6548 * @hide
6549 */
6550 public static final String WEBVIEW_DATA_REDUCTION_PROXY_KEY =
6551 "webview_data_reduction_proxy_key";
6552
Christopher Tate06efb532012-08-24 15:29:27 -07006553 /**
Jeff Brown89d55462012-09-19 11:33:42 -07006554 * Whether Wifi display is enabled/disabled
6555 * 0=disabled. 1=enabled.
6556 * @hide
6557 */
6558 public static final String WIFI_DISPLAY_ON = "wifi_display_on";
6559
6560 /**
Chong Zhang1f3ecaa2013-05-03 15:55:36 -07006561 * Whether Wifi display certification mode is enabled/disabled
6562 * 0=disabled. 1=enabled.
6563 * @hide
6564 */
6565 public static final String WIFI_DISPLAY_CERTIFICATION_ON =
6566 "wifi_display_certification_on";
6567
6568 /**
Chong Zhange38af812013-08-29 17:25:17 -07006569 * WPS Configuration method used by Wifi display, this setting only
6570 * takes effect when WIFI_DISPLAY_CERTIFICATION_ON is 1 (enabled).
6571 *
6572 * Possible values are:
6573 *
6574 * WpsInfo.INVALID: use default WPS method chosen by framework
6575 * WpsInfo.PBC : use Push button
6576 * WpsInfo.KEYPAD : use Keypad
6577 * WpsInfo.DISPLAY: use Display
6578 * @hide
6579 */
6580 public static final String WIFI_DISPLAY_WPS_CONFIG =
6581 "wifi_display_wps_config";
6582
6583 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006584 * Whether to notify the user of open networks.
6585 * <p>
6586 * If not connected and the scan results have an open network, we will
6587 * put this notification up. If we attempt to connect to a network or
6588 * the open network(s) disappear, we remove the notification. When we
6589 * show the notification, we will not show it again for
6590 * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time.
6591 */
6592 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
6593 "wifi_networks_available_notification_on";
6594 /**
6595 * {@hide}
6596 */
6597 public static final String WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON =
6598 "wimax_networks_available_notification_on";
6599
6600 /**
6601 * Delay (in seconds) before repeating the Wi-Fi networks available notification.
6602 * Connecting to a network will reset the timer.
6603 */
6604 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
6605 "wifi_networks_available_repeat_delay";
6606
6607 /**
Robert Greenwalt3ea0c992013-10-03 21:13:49 +00006608 * 802.11 country code in ISO 3166 format
6609 * @hide
6610 */
6611 public static final String WIFI_COUNTRY_CODE = "wifi_country_code";
6612
6613 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006614 * The interval in milliseconds to issue wake up scans when wifi needs
6615 * to connect. This is necessary to connect to an access point when
6616 * device is on the move and the screen is off.
6617 * @hide
6618 */
6619 public static final String WIFI_FRAMEWORK_SCAN_INTERVAL_MS =
6620 "wifi_framework_scan_interval_ms";
6621
6622 /**
6623 * The interval in milliseconds after which Wi-Fi is considered idle.
6624 * When idle, it is possible for the device to be switched from Wi-Fi to
6625 * the mobile data network.
6626 * @hide
6627 */
6628 public static final String WIFI_IDLE_MS = "wifi_idle_ms";
6629
6630 /**
6631 * When the number of open networks exceeds this number, the
6632 * least-recently-used excess networks will be removed.
6633 */
6634 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept";
6635
6636 /**
6637 * Whether the Wi-Fi should be on. Only the Wi-Fi service should touch this.
6638 */
6639 public static final String WIFI_ON = "wifi_on";
6640
6641 /**
Irfan Sheriff11aefad2013-03-06 07:57:41 -08006642 * Setting to allow scans to be enabled even wifi is turned off for connectivity.
6643 * @hide
6644 */
6645 public static final String WIFI_SCAN_ALWAYS_AVAILABLE =
6646 "wifi_scan_always_enabled";
6647
6648 /**
Wei Wangd91f1932015-03-19 15:09:56 -07006649 * Settings to allow BLE scans to be enabled even when Bluetooth is turned off for
6650 * connectivity.
6651 * @hide
6652 */
6653 public static final String BLE_SCAN_ALWAYS_AVAILABLE =
6654 "ble_scan_always_enabled";
6655
6656 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006657 * Used to save the Wifi_ON state prior to tethering.
6658 * This state will be checked to restore Wifi after
6659 * the user turns off tethering.
6660 *
6661 * @hide
6662 */
6663 public static final String WIFI_SAVED_STATE = "wifi_saved_state";
6664
6665 /**
6666 * The interval in milliseconds to scan as used by the wifi supplicant
6667 * @hide
6668 */
6669 public static final String WIFI_SUPPLICANT_SCAN_INTERVAL_MS =
6670 "wifi_supplicant_scan_interval_ms";
6671
vandwalle7c3606c2014-03-31 19:12:07 -07006672 /**
6673 * whether frameworks handles wifi auto-join
6674 * @hide
6675 */
6676 public static final String WIFI_ENHANCED_AUTO_JOIN =
6677 "wifi_enhanced_auto_join";
6678
6679 /**
6680 * whether settings show RSSI
6681 * @hide
6682 */
6683 public static final String WIFI_NETWORK_SHOW_RSSI =
6684 "wifi_network_show_rssi";
6685
6686 /**
Irfan Sheriff3809f502012-09-17 16:04:57 -07006687 * The interval in milliseconds to scan at supplicant when p2p is connected
6688 * @hide
6689 */
6690 public static final String WIFI_SCAN_INTERVAL_WHEN_P2P_CONNECTED_MS =
6691 "wifi_scan_interval_p2p_connected_ms";
6692
6693 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006694 * Whether the Wi-Fi watchdog is enabled.
6695 */
6696 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
6697
6698 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006699 * Setting to turn off poor network avoidance on Wi-Fi. Feature is enabled by default and
6700 * the setting needs to be set to 0 to disable it.
6701 * @hide
6702 */
6703 public static final String WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED =
6704 "wifi_watchdog_poor_network_test_enabled";
6705
6706 /**
6707 * Setting to turn on suspend optimizations at screen off on Wi-Fi. Enabled by default and
6708 * needs to be set to 0 to disable it.
6709 * @hide
6710 */
6711 public static final String WIFI_SUSPEND_OPTIMIZATIONS_ENABLED =
6712 "wifi_suspend_optimizations_enabled";
6713
6714 /**
6715 * The maximum number of times we will retry a connection to an access
6716 * point for which we have failed in acquiring an IP address from DHCP.
6717 * A value of N means that we will make N+1 connection attempts in all.
6718 */
6719 public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count";
6720
6721 /**
6722 * Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile
6723 * data connectivity to be established after a disconnect from Wi-Fi.
6724 */
6725 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
6726 "wifi_mobile_data_transition_wakelock_timeout_ms";
6727
6728 /**
Zoltan Szatmary-Ban4045d242015-05-27 12:42:39 +01006729 * This setting controls whether WiFi configurations created by a Device Owner app
6730 * should be locked down (that is, be editable or removable only by the Device Owner App,
6731 * not even by Settings app).
6732 * This setting takes integer values. Non-zero values mean DO created configurations
6733 * are locked down. Value of zero means they are not. Default value in the absence of
6734 * actual value to this setting is 0.
6735 */
6736 public static final String WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN =
6737 "wifi_device_owner_configs_lockdown";
6738
6739 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006740 * The operational wifi frequency band
6741 * Set to one of {@link WifiManager#WIFI_FREQUENCY_BAND_AUTO},
6742 * {@link WifiManager#WIFI_FREQUENCY_BAND_5GHZ} or
6743 * {@link WifiManager#WIFI_FREQUENCY_BAND_2GHZ}
6744 *
6745 * @hide
6746 */
6747 public static final String WIFI_FREQUENCY_BAND = "wifi_frequency_band";
6748
6749 /**
6750 * The Wi-Fi peer-to-peer device name
6751 * @hide
6752 */
6753 public static final String WIFI_P2P_DEVICE_NAME = "wifi_p2p_device_name";
6754
6755 /**
Robert Greenwaltc12783a2013-05-16 12:48:20 -07006756 * The min time between wifi disable and wifi enable
6757 * @hide
6758 */
6759 public static final String WIFI_REENABLE_DELAY_MS = "wifi_reenable_delay";
6760
6761 /**
Jeff Davidsona20ca67d2014-12-16 11:48:54 -08006762 * Timeout for ephemeral networks when all known BSSIDs go out of range. We will disconnect
6763 * from an ephemeral network if there is no BSSID for that network with a non-null score that
6764 * has been seen in this time period.
6765 *
6766 * If this is less than or equal to zero, we use a more conservative behavior and only check
6767 * for a non-null score from the currently connected or target BSSID.
6768 * @hide
6769 */
6770 public static final String WIFI_EPHEMERAL_OUT_OF_RANGE_TIMEOUT_MS =
6771 "wifi_ephemeral_out_of_range_timeout_ms";
6772
6773 /**
Christopher Tatec868b642012-09-12 17:41:04 -07006774 * The number of milliseconds to delay when checking for data stalls during
6775 * non-aggressive detection. (screen is turned off.)
6776 * @hide
6777 */
6778 public static final String DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS =
6779 "data_stall_alarm_non_aggressive_delay_in_ms";
6780
6781 /**
6782 * The number of milliseconds to delay when checking for data stalls during
6783 * aggressive detection. (screen on or suspected data stall)
6784 * @hide
6785 */
6786 public static final String DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS =
6787 "data_stall_alarm_aggressive_delay_in_ms";
6788
6789 /**
Wink Savillece1e3792013-09-03 16:41:44 -07006790 * The number of milliseconds to allow the provisioning apn to remain active
6791 * @hide
6792 */
6793 public static final String PROVISIONING_APN_ALARM_DELAY_IN_MS =
6794 "provisioning_apn_alarm_delay_in_ms";
6795
6796 /**
Christopher Tatec868b642012-09-12 17:41:04 -07006797 * The interval in milliseconds at which to check gprs registration
6798 * after the first registration mismatch of gprs and voice service,
6799 * to detect possible data network registration problems.
6800 *
6801 * @hide
6802 */
6803 public static final String GPRS_REGISTER_CHECK_PERIOD_MS =
6804 "gprs_register_check_period_ms";
6805
6806 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006807 * Nonzero causes Log.wtf() to crash.
6808 * @hide
6809 */
6810 public static final String WTF_IS_FATAL = "wtf_is_fatal";
6811
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07006812 /**
6813 * Ringer mode. This is used internally, changing this value will not
6814 * change the ringer mode. See AudioManager.
6815 */
6816 public static final String MODE_RINGER = "mode_ringer";
Christopher Tate06efb532012-08-24 15:29:27 -07006817
Jeff Brownd4935962012-09-25 13:27:20 -07006818 /**
6819 * Overlay display devices setting.
6820 * The associated value is a specially formatted string that describes the
6821 * size and density of simulated secondary display devices.
6822 * <p>
6823 * Format: {width}x{height}/{dpi};...
6824 * </p><p>
6825 * Example:
6826 * <ul>
6827 * <li><code>1280x720/213</code>: make one overlay that is 1280x720 at 213dpi.</li>
6828 * <li><code>1920x1080/320;1280x720/213</code>: make two overlays, the first
6829 * at 1080p and the second at 720p.</li>
6830 * <li>If the value is empty, then no overlay display devices are created.</li>
6831 * </ul></p>
6832 *
6833 * @hide
6834 */
6835 public static final String OVERLAY_DISPLAY_DEVICES = "overlay_display_devices";
Christopher Tate06efb532012-08-24 15:29:27 -07006836
Jeff Sharkey625239a2012-09-26 22:03:49 -07006837 /**
6838 * Threshold values for the duration and level of a discharge cycle,
6839 * under which we log discharge cycle info.
6840 *
6841 * @hide
6842 */
6843 public static final String
6844 BATTERY_DISCHARGE_DURATION_THRESHOLD = "battery_discharge_duration_threshold";
6845
6846 /** @hide */
6847 public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold";
6848
6849 /**
6850 * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR
6851 * intents on application crashes and ANRs. If this is disabled, the
6852 * crash/ANR dialog will never display the "Report" button.
6853 * <p>
6854 * Type: int (0 = disallow, 1 = allow)
6855 *
6856 * @hide
6857 */
6858 public static final String SEND_ACTION_APP_ERROR = "send_action_app_error";
6859
6860 /**
6861 * Maximum age of entries kept by {@link DropBoxManager}.
6862 *
6863 * @hide
6864 */
6865 public static final String DROPBOX_AGE_SECONDS = "dropbox_age_seconds";
6866
6867 /**
6868 * Maximum number of entry files which {@link DropBoxManager} will keep
6869 * around.
6870 *
6871 * @hide
6872 */
6873 public static final String DROPBOX_MAX_FILES = "dropbox_max_files";
6874
6875 /**
6876 * Maximum amount of disk space used by {@link DropBoxManager} no matter
6877 * what.
6878 *
6879 * @hide
6880 */
6881 public static final String DROPBOX_QUOTA_KB = "dropbox_quota_kb";
6882
6883 /**
6884 * Percent of free disk (excluding reserve) which {@link DropBoxManager}
6885 * will use.
6886 *
6887 * @hide
6888 */
6889 public static final String DROPBOX_QUOTA_PERCENT = "dropbox_quota_percent";
6890
6891 /**
6892 * Percent of total disk which {@link DropBoxManager} will never dip
6893 * into.
6894 *
6895 * @hide
6896 */
6897 public static final String DROPBOX_RESERVE_PERCENT = "dropbox_reserve_percent";
6898
6899 /**
6900 * Prefix for per-tag dropbox disable/enable settings.
6901 *
6902 * @hide
6903 */
6904 public static final String DROPBOX_TAG_PREFIX = "dropbox:";
6905
6906 /**
6907 * Lines of logcat to include with system crash/ANR/etc. reports, as a
6908 * prefix of the dropbox tag of the report type. For example,
6909 * "logcat_for_system_server_anr" controls the lines of logcat captured
6910 * with system server ANR reports. 0 to disable.
6911 *
6912 * @hide
6913 */
6914 public static final String ERROR_LOGCAT_PREFIX = "logcat_for_";
6915
6916 /**
6917 * The interval in minutes after which the amount of free storage left
6918 * on the device is logged to the event log
6919 *
6920 * @hide
6921 */
6922 public static final String SYS_FREE_STORAGE_LOG_INTERVAL = "sys_free_storage_log_interval";
6923
6924 /**
6925 * Threshold for the amount of change in disk free space required to
6926 * report the amount of free space. Used to prevent spamming the logs
6927 * when the disk free space isn't changing frequently.
6928 *
6929 * @hide
6930 */
6931 public static final String
6932 DISK_FREE_CHANGE_REPORTING_THRESHOLD = "disk_free_change_reporting_threshold";
6933
6934 /**
6935 * Minimum percentage of free storage on the device that is used to
6936 * determine if the device is running low on storage. The default is 10.
6937 * <p>
6938 * Say this value is set to 10, the device is considered running low on
6939 * storage if 90% or more of the device storage is filled up.
6940 *
6941 * @hide
6942 */
6943 public static final String
6944 SYS_STORAGE_THRESHOLD_PERCENTAGE = "sys_storage_threshold_percentage";
6945
6946 /**
6947 * Maximum byte size of the low storage threshold. This is to ensure
6948 * that {@link #SYS_STORAGE_THRESHOLD_PERCENTAGE} does not result in an
6949 * overly large threshold for large storage devices. Currently this must
6950 * be less than 2GB. This default is 500MB.
6951 *
6952 * @hide
6953 */
6954 public static final String
6955 SYS_STORAGE_THRESHOLD_MAX_BYTES = "sys_storage_threshold_max_bytes";
6956
6957 /**
6958 * Minimum bytes of free storage on the device before the data partition
6959 * is considered full. By default, 1 MB is reserved to avoid system-wide
6960 * SQLite disk full exceptions.
6961 *
6962 * @hide
6963 */
6964 public static final String
6965 SYS_STORAGE_FULL_THRESHOLD_BYTES = "sys_storage_full_threshold_bytes";
6966
6967 /**
6968 * The maximum reconnect delay for short network outages or when the
6969 * network is suspended due to phone use.
6970 *
6971 * @hide
6972 */
6973 public static final String
6974 SYNC_MAX_RETRY_DELAY_IN_SECONDS = "sync_max_retry_delay_in_seconds";
6975
6976 /**
6977 * The number of milliseconds to delay before sending out
Erik Kline8f29dcf2014-12-08 16:25:20 +09006978 * {@link ConnectivityManager#CONNECTIVITY_ACTION} broadcasts. Ignored.
Jeff Sharkey625239a2012-09-26 22:03:49 -07006979 *
6980 * @hide
6981 */
6982 public static final String CONNECTIVITY_CHANGE_DELAY = "connectivity_change_delay";
6983
Vinit Deshapnde1f12cb52013-08-21 13:09:01 -07006984
6985 /**
6986 * Network sampling interval, in seconds. We'll generate link information
6987 * about bytes/packets sent and error rates based on data sampled in this interval
6988 *
6989 * @hide
6990 */
6991
6992 public static final String CONNECTIVITY_SAMPLING_INTERVAL_IN_SECONDS =
6993 "connectivity_sampling_interval_in_seconds";
6994
Jeff Sharkey625239a2012-09-26 22:03:49 -07006995 /**
Jason Monk602b2322013-07-03 17:04:33 -04006996 * The series of successively longer delays used in retrying to download PAC file.
6997 * Last delay is used between successful PAC downloads.
6998 *
6999 * @hide
7000 */
7001 public static final String PAC_CHANGE_DELAY = "pac_change_delay";
7002
7003 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07007004 * Setting to turn off captive portal detection. Feature is enabled by
7005 * default and the setting needs to be set to 0 to disable it.
7006 *
7007 * @hide
7008 */
7009 public static final String
7010 CAPTIVE_PORTAL_DETECTION_ENABLED = "captive_portal_detection_enabled";
7011
7012 /**
7013 * The server used for captive portal detection upon a new conection. A
7014 * 204 response code from the server is used for validation.
7015 *
7016 * @hide
7017 */
7018 public static final String CAPTIVE_PORTAL_SERVER = "captive_portal_server";
7019
7020 /**
7021 * Whether network service discovery is enabled.
7022 *
7023 * @hide
7024 */
7025 public static final String NSD_ON = "nsd_on";
7026
7027 /**
7028 * Let user pick default install location.
7029 *
7030 * @hide
7031 */
7032 public static final String SET_INSTALL_LOCATION = "set_install_location";
7033
7034 /**
7035 * Default install location value.
7036 * 0 = auto, let system decide
7037 * 1 = internal
7038 * 2 = sdcard
7039 * @hide
7040 */
7041 public static final String DEFAULT_INSTALL_LOCATION = "default_install_location";
7042
7043 /**
7044 * ms during which to consume extra events related to Inet connection
7045 * condition after a transtion to fully-connected
7046 *
7047 * @hide
7048 */
7049 public static final String
7050 INET_CONDITION_DEBOUNCE_UP_DELAY = "inet_condition_debounce_up_delay";
7051
7052 /**
7053 * ms during which to consume extra events related to Inet connection
7054 * condtion after a transtion to partly-connected
7055 *
7056 * @hide
7057 */
7058 public static final String
7059 INET_CONDITION_DEBOUNCE_DOWN_DELAY = "inet_condition_debounce_down_delay";
7060
7061 /** {@hide} */
7062 public static final String
7063 READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT = "read_external_storage_enforced_default";
7064
7065 /**
7066 * Host name and port for global http proxy. Uses ':' seperator for
7067 * between host and port.
7068 */
7069 public static final String HTTP_PROXY = "http_proxy";
7070
7071 /**
7072 * Host name for global http proxy. Set via ConnectivityManager.
7073 *
7074 * @hide
7075 */
7076 public static final String GLOBAL_HTTP_PROXY_HOST = "global_http_proxy_host";
7077
7078 /**
7079 * Integer host port for global http proxy. Set via ConnectivityManager.
7080 *
7081 * @hide
7082 */
7083 public static final String GLOBAL_HTTP_PROXY_PORT = "global_http_proxy_port";
7084
7085 /**
7086 * Exclusion list for global proxy. This string contains a list of
7087 * comma-separated domains where the global proxy does not apply.
7088 * Domains should be listed in a comma- separated list. Example of
7089 * acceptable formats: ".domain1.com,my.domain2.com" Use
7090 * ConnectivityManager to set/get.
7091 *
7092 * @hide
7093 */
7094 public static final String
7095 GLOBAL_HTTP_PROXY_EXCLUSION_LIST = "global_http_proxy_exclusion_list";
7096
7097 /**
Jason Monk602b2322013-07-03 17:04:33 -04007098 * The location PAC File for the proxy.
7099 * @hide
7100 */
7101 public static final String
7102 GLOBAL_HTTP_PROXY_PAC = "global_proxy_pac_url";
7103
7104 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07007105 * Enables the UI setting to allow the user to specify the global HTTP
7106 * proxy and associated exclusion list.
7107 *
7108 * @hide
7109 */
7110 public static final String SET_GLOBAL_HTTP_PROXY = "set_global_http_proxy";
7111
7112 /**
7113 * Setting for default DNS in case nobody suggests one
7114 *
7115 * @hide
7116 */
7117 public static final String DEFAULT_DNS_SERVER = "default_dns_server";
7118
Jeff Sharkey0ac10282012-10-01 12:50:22 -07007119 /** {@hide} */
7120 public static final String
7121 BLUETOOTH_HEADSET_PRIORITY_PREFIX = "bluetooth_headset_priority_";
7122 /** {@hide} */
7123 public static final String
7124 BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX = "bluetooth_a2dp_sink_priority_";
7125 /** {@hide} */
7126 public static final String
7127 BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX = "bluetooth_input_device_priority_";
Kim Schulz0d376052013-08-22 11:18:02 +02007128 /** {@hide} */
7129 public static final String
7130 BLUETOOTH_MAP_PRIORITY_PREFIX = "bluetooth_map_priority_";
Casper Bonde2a5f6082015-03-19 10:36:45 +01007131 /** {@hide} */
7132 public static final String
7133 BLUETOOTH_SAP_PRIORITY_PREFIX = "bluetooth_sap_priority_";
Jeff Sharkey0ac10282012-10-01 12:50:22 -07007134
7135 /**
Adam Lesinski31c05d12015-06-09 17:34:04 -07007136 * Device Idle (Doze) specific settings.
7137 * This is encoded as a key=value list, separated by commas. Ex:
7138 *
7139 * "inactive_timeout=60000,sensing_timeout=400000"
7140 *
7141 * The following keys are supported:
7142 *
7143 * <pre>
7144 * inactive_to (long)
7145 * sensing_to (long)
7146 * motion_inactive_to (long)
7147 * idle_after_inactive_to (long)
7148 * idle_pending_to (long)
7149 * max_idle_pending_to (long)
7150 * idle_pending_factor (float)
7151 * idle_to (long)
7152 * max_idle_to (long)
7153 * idle_factor (float)
7154 * min_time_to_alarm (long)
7155 * max_temp_app_whitelist_duration (long)
7156 * </pre>
7157 *
7158 * <p>
7159 * Type: string
7160 * @hide
7161 * @see com.android.server.DeviceIdleController.Constants
7162 */
7163 public static final String DEVICE_IDLE_CONSTANTS = "device_idle_constants";
7164
7165 /**
Adam Lesinskia6232df2015-06-11 18:16:41 -07007166 * App standby (app idle) specific settings.
7167 * This is encoded as a key=value list, separated by commas. Ex:
7168 *
7169 * "idle_duration=5000,parole_interval=4500"
7170 *
7171 * The following keys are supported:
7172 *
7173 * <pre>
7174 * idle_duration (long)
7175 * wallclock_threshold (long)
7176 * parole_interval (long)
7177 * parole_duration (long)
7178 * </pre>
7179 *
7180 * <p>
7181 * Type: string
7182 * @hide
7183 * @see com.android.server.usage.UsageStatsService.SettingsObserver
7184 */
7185 public static final String APP_IDLE_CONSTANTS = "app_idle_constants";
7186
7187 /**
Dianne Hackborna750a632015-06-16 17:18:23 -07007188 * Alarm manager specific settings.
7189 * This is encoded as a key=value list, separated by commas. Ex:
7190 *
7191 * "min_futurity=5000,allow_while_idle_short_time=4500"
7192 *
7193 * The following keys are supported:
7194 *
7195 * <pre>
7196 * min_futurity (long)
7197 * min_interval (long)
7198 * allow_while_idle_short_time (long)
7199 * allow_while_idle_long_time (long)
7200 * allow_while_idle_whitelist_duration (long)
7201 * </pre>
7202 *
7203 * <p>
7204 * Type: string
7205 * @hide
7206 * @see com.android.server.AlarmManagerService.Constants
7207 */
7208 public static final String ALARM_MANAGER_CONSTANTS = "alarm_manager_constants";
7209
7210 /**
Jeff Sharkey0ac10282012-10-01 12:50:22 -07007211 * Get the key that retrieves a bluetooth headset's priority.
7212 * @hide
7213 */
7214 public static final String getBluetoothHeadsetPriorityKey(String address) {
Elliott Hughescb64d432013-08-02 10:00:44 -07007215 return BLUETOOTH_HEADSET_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
Jeff Sharkey0ac10282012-10-01 12:50:22 -07007216 }
7217
7218 /**
7219 * Get the key that retrieves a bluetooth a2dp sink's priority.
7220 * @hide
7221 */
7222 public static final String getBluetoothA2dpSinkPriorityKey(String address) {
Elliott Hughescb64d432013-08-02 10:00:44 -07007223 return BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
Jeff Sharkey0ac10282012-10-01 12:50:22 -07007224 }
7225
7226 /**
7227 * Get the key that retrieves a bluetooth Input Device's priority.
7228 * @hide
7229 */
7230 public static final String getBluetoothInputDevicePriorityKey(String address) {
Elliott Hughescb64d432013-08-02 10:00:44 -07007231 return BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
Jeff Sharkey0ac10282012-10-01 12:50:22 -07007232 }
7233
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07007234 /**
Kim Schulz0d376052013-08-22 11:18:02 +02007235 * Get the key that retrieves a bluetooth map priority.
7236 * @hide
7237 */
7238 public static final String getBluetoothMapPriorityKey(String address) {
7239 return BLUETOOTH_MAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
7240 }
Casper Bonde2a5f6082015-03-19 10:36:45 +01007241
7242 /**
7243 * Get the key that retrieves a bluetooth map priority.
7244 * @hide
7245 */
7246 public static final String getBluetoothSapPriorityKey(String address) {
7247 return BLUETOOTH_SAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
7248 }
7249
Kim Schulz0d376052013-08-22 11:18:02 +02007250 /**
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07007251 * Scaling factor for normal window animations. Setting to 0 will
7252 * disable window animations.
7253 */
7254 public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale";
7255
7256 /**
7257 * Scaling factor for activity transition animations. Setting to 0 will
7258 * disable window animations.
7259 */
7260 public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale";
7261
7262 /**
7263 * Scaling factor for Animator-based animations. This affects both the
7264 * start delay and duration of all such animations. Setting to 0 will
7265 * cause animations to end immediately. The default value is 1.
7266 */
7267 public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale";
7268
7269 /**
7270 * Scaling factor for normal window animations. Setting to 0 will
7271 * disable window animations.
7272 *
7273 * @hide
7274 */
7275 public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations";
7276
7277 /**
7278 * If 0, the compatibility mode is off for all applications.
7279 * If 1, older applications run under compatibility mode.
7280 * TODO: remove this settings before code freeze (bug/1907571)
7281 * @hide
7282 */
7283 public static final String COMPATIBILITY_MODE = "compatibility_mode";
7284
7285 /**
7286 * CDMA only settings
7287 * Emergency Tone 0 = Off
7288 * 1 = Alert
7289 * 2 = Vibrate
7290 * @hide
7291 */
7292 public static final String EMERGENCY_TONE = "emergency_tone";
7293
7294 /**
7295 * CDMA only settings
7296 * Whether the auto retry is enabled. The value is
7297 * boolean (1 or 0).
7298 * @hide
7299 */
7300 public static final String CALL_AUTO_RETRY = "call_auto_retry";
7301
7302 /**
Sungmin Choie099ab12014-06-09 14:45:51 +09007303 * See RIL_PreferredNetworkType in ril.h
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07007304 * @hide
7305 */
7306 public static final String PREFERRED_NETWORK_MODE =
7307 "preferred_network_mode";
7308
7309 /**
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07007310 * Name of an application package to be debugged.
7311 */
7312 public static final String DEBUG_APP = "debug_app";
7313
7314 /**
7315 * If 1, when launching DEBUG_APP it will wait for the debugger before
7316 * starting user code. If 0, it will run normally.
7317 */
7318 public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger";
7319
7320 /**
7321 * Control whether the process CPU usage meter should be shown.
7322 */
7323 public static final String SHOW_PROCESSES = "show_processes";
7324
7325 /**
Ruchi Kandoi62b8a492014-04-17 18:01:40 -07007326 * If 1 low power mode is enabled.
7327 * @hide
7328 */
7329 public static final String LOW_POWER_MODE = "low_power";
7330
John Spurlockf8f524c2014-06-10 14:47:29 -04007331 /**
7332 * Battery level [1-99] at which low power mode automatically turns on.
Dianne Hackborn14272302014-06-10 23:13:02 -07007333 * If 0, it will not automatically turn on.
John Spurlockf8f524c2014-06-10 14:47:29 -04007334 * @hide
7335 */
7336 public static final String LOW_POWER_MODE_TRIGGER_LEVEL = "low_power_trigger_level";
7337
Ruchi Kandoi62b8a492014-04-17 18:01:40 -07007338 /**
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07007339 * If 1, the activity manager will aggressively finish activities and
7340 * processes as soon as they are no longer needed. If 0, the normal
7341 * extended lifetime is used.
7342 */
Dianne Hackborn89ad4562014-08-24 16:45:38 -07007343 public static final String ALWAYS_FINISH_ACTIVITIES = "always_finish_activities";
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07007344
Christopher Tate66488d62012-10-02 11:58:01 -07007345 /**
Eric Laurent7ee1e4f2012-10-26 18:11:21 -07007346 * Use Dock audio output for media:
7347 * 0 = disabled
7348 * 1 = enabled
7349 * @hide
7350 */
7351 public static final String DOCK_AUDIO_MEDIA_ENABLED = "dock_audio_media_enabled";
7352
7353 /**
Eric Laurent05274f32012-11-29 12:48:18 -08007354 * Persisted safe headphone volume management state by AudioService
7355 * @hide
7356 */
7357 public static final String AUDIO_SAFE_VOLUME_STATE = "audio_safe_volume_state";
7358
7359 /**
Geremy Condraa0735112013-03-26 21:49:26 -07007360 * URL for tzinfo (time zone) updates
7361 * @hide
7362 */
7363 public static final String TZINFO_UPDATE_CONTENT_URL = "tzinfo_content_url";
7364
7365 /**
7366 * URL for tzinfo (time zone) update metadata
7367 * @hide
7368 */
7369 public static final String TZINFO_UPDATE_METADATA_URL = "tzinfo_metadata_url";
7370
7371 /**
7372 * URL for selinux (mandatory access control) updates
7373 * @hide
7374 */
7375 public static final String SELINUX_UPDATE_CONTENT_URL = "selinux_content_url";
7376
7377 /**
7378 * URL for selinux (mandatory access control) update metadata
7379 * @hide
7380 */
7381 public static final String SELINUX_UPDATE_METADATA_URL = "selinux_metadata_url";
7382
7383 /**
7384 * URL for sms short code updates
7385 * @hide
7386 */
7387 public static final String SMS_SHORT_CODES_UPDATE_CONTENT_URL =
7388 "sms_short_codes_content_url";
7389
7390 /**
7391 * URL for sms short code update metadata
7392 * @hide
7393 */
7394 public static final String SMS_SHORT_CODES_UPDATE_METADATA_URL =
7395 "sms_short_codes_metadata_url";
7396
7397 /**
Amit Mahajan9069fab2015-05-01 11:05:47 -07007398 * URL for apn_db updates
7399 * @hide
7400 */
7401 public static final String APN_DB_UPDATE_CONTENT_URL = "apn_db_content_url";
7402
7403 /**
7404 * URL for apn_db update metadata
7405 * @hide
7406 */
7407 public static final String APN_DB_UPDATE_METADATA_URL = "apn_db_metadata_url";
7408
7409 /**
Geremy Condraa0735112013-03-26 21:49:26 -07007410 * URL for cert pinlist updates
7411 * @hide
7412 */
7413 public static final String CERT_PIN_UPDATE_CONTENT_URL = "cert_pin_content_url";
7414
7415 /**
7416 * URL for cert pinlist updates
7417 * @hide
7418 */
7419 public static final String CERT_PIN_UPDATE_METADATA_URL = "cert_pin_metadata_url";
7420
Geremy Condra757ee522013-03-29 16:39:45 -07007421 /**
Ben Gruver633dc9b2013-04-04 12:05:49 -07007422 * URL for intent firewall updates
7423 * @hide
7424 */
7425 public static final String INTENT_FIREWALL_UPDATE_CONTENT_URL =
7426 "intent_firewall_content_url";
7427
7428 /**
7429 * URL for intent firewall update metadata
7430 * @hide
7431 */
7432 public static final String INTENT_FIREWALL_UPDATE_METADATA_URL =
7433 "intent_firewall_metadata_url";
7434
7435 /**
Geremy Condra4e7f7e82013-03-26 21:09:01 -07007436 * SELinux enforcement status. If 0, permissive; if 1, enforcing.
7437 * @hide
7438 */
7439 public static final String SELINUX_STATUS = "selinux_status";
7440
Geremy Condraa0735112013-03-26 21:49:26 -07007441 /**
Amith Yamasanid8415f42013-08-07 20:15:10 -07007442 * Developer setting to force RTL layout.
7443 * @hide
7444 */
7445 public static final String DEVELOPMENT_FORCE_RTL = "debug.force_rtl";
7446
7447 /**
Daniel Sandlerdea64622013-09-23 16:05:57 -04007448 * Milliseconds after screen-off after which low battery sounds will be silenced.
7449 *
7450 * If zero, battery sounds will always play.
7451 * Defaults to @integer/def_low_battery_sound_timeout in SettingsProvider.
7452 *
7453 * @hide
7454 */
7455 public static final String LOW_BATTERY_SOUND_TIMEOUT = "low_battery_sound_timeout";
7456
7457 /**
Evan Charltoncc7b0432014-01-14 14:47:11 -08007458 * Milliseconds to wait before bouncing Wi-Fi after settings is restored. Note that after
Dianne Hackborna3fb40d2014-08-12 15:06:50 -07007459 * the caller is done with this, they should call {@link ContentResolver#delete} to
Evan Charltoncc7b0432014-01-14 14:47:11 -08007460 * clean up any value that they may have written.
7461 *
7462 * @hide
7463 */
7464 public static final String WIFI_BOUNCE_DELAY_OVERRIDE_MS = "wifi_bounce_delay_override_ms";
7465
John Spurlockc6d1c602014-01-17 15:22:06 -05007466 /**
7467 * Defines global runtime overrides to window policy.
7468 *
Jorim Jaggib10e33f2015-02-04 21:57:40 +01007469 * See {@link com.android.server.policy.PolicyControl} for value format.
John Spurlockc6d1c602014-01-17 15:22:06 -05007470 *
7471 * @hide
7472 */
7473 public static final String POLICY_CONTROL = "policy_control";
Evan Charltoncc7b0432014-01-14 14:47:11 -08007474
7475 /**
John Spurlockae641c92014-06-30 18:11:40 -04007476 * Defines global zen mode. ZEN_MODE_OFF, ZEN_MODE_IMPORTANT_INTERRUPTIONS,
7477 * or ZEN_MODE_NO_INTERRUPTIONS.
John Spurlocke677d712014-02-13 12:52:19 -05007478 *
7479 * @hide
7480 */
7481 public static final String ZEN_MODE = "zen_mode";
7482
7483 /** @hide */ public static final int ZEN_MODE_OFF = 0;
John Spurlockae641c92014-06-30 18:11:40 -04007484 /** @hide */ public static final int ZEN_MODE_IMPORTANT_INTERRUPTIONS = 1;
7485 /** @hide */ public static final int ZEN_MODE_NO_INTERRUPTIONS = 2;
John Spurlock4f1163c2015-04-02 17:41:21 -04007486 /** @hide */ public static final int ZEN_MODE_ALARMS = 3;
John Spurlocke677d712014-02-13 12:52:19 -05007487
7488 /** @hide */ public static String zenModeToString(int mode) {
John Spurlockae641c92014-06-30 18:11:40 -04007489 if (mode == ZEN_MODE_IMPORTANT_INTERRUPTIONS) return "ZEN_MODE_IMPORTANT_INTERRUPTIONS";
John Spurlock4f1163c2015-04-02 17:41:21 -04007490 if (mode == ZEN_MODE_ALARMS) return "ZEN_MODE_ALARMS";
John Spurlockae641c92014-06-30 18:11:40 -04007491 if (mode == ZEN_MODE_NO_INTERRUPTIONS) return "ZEN_MODE_NO_INTERRUPTIONS";
7492 return "ZEN_MODE_OFF";
John Spurlocke677d712014-02-13 12:52:19 -05007493 }
7494
John Spurlockb2278d62015-04-07 12:47:12 -04007495 /** @hide */ public static boolean isValidZenMode(int value) {
7496 switch (value) {
7497 case Global.ZEN_MODE_OFF:
7498 case Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS:
7499 case Global.ZEN_MODE_ALARMS:
7500 case Global.ZEN_MODE_NO_INTERRUPTIONS:
7501 return true;
7502 default:
7503 return false;
7504 }
7505 }
7506
John Spurlocke677d712014-02-13 12:52:19 -05007507 /**
John Spurlock056c5192014-04-20 21:52:01 -04007508 * Opaque value, changes when persisted zen mode configuration changes.
7509 *
7510 * @hide
7511 */
7512 public static final String ZEN_MODE_CONFIG_ETAG = "zen_mode_config_etag";
7513
7514 /**
Chris Wren7bd241232014-02-28 16:25:05 -05007515 * Defines global heads up toggle. One of HEADS_UP_OFF, HEADS_UP_ON.
7516 *
7517 * @hide
7518 */
Chris Wren10d82df2014-03-01 10:34:51 -05007519 public static final String HEADS_UP_NOTIFICATIONS_ENABLED =
7520 "heads_up_notifications_enabled";
Chris Wren7bd241232014-02-28 16:25:05 -05007521
7522 /** @hide */ public static final int HEADS_UP_OFF = 0;
7523 /** @hide */ public static final int HEADS_UP_ON = 1;
7524
7525 /**
Jerome Poichet147b4d72014-05-12 18:13:27 -07007526 * The name of the device
7527 *
7528 * @hide
7529 */
7530 public static final String DEVICE_NAME = "device_name";
7531
7532 /**
Amith Yamasani1e9c2182014-06-11 17:25:51 -07007533 * Whether it should be possible to create a guest user on the device.
7534 * <p>
7535 * Type: int (0 for disabled, 1 for enabled)
7536 * @hide
7537 */
7538 public static final String GUEST_USER_ENABLED = "guest_user_enabled";
7539
7540 /**
Jeff Davidson56f9f732014-08-14 16:47:23 -07007541 * Whether the NetworkScoringService has been first initialized.
7542 * <p>
7543 * Type: int (0 for false, 1 for true)
7544 * @hide
7545 */
7546 public static final String NETWORK_SCORING_PROVISIONED = "network_scoring_provisioned";
7547
7548 /**
Jim Miller6848dc82014-10-13 18:51:53 -07007549 * Whether the user wants to be prompted for password to decrypt the device on boot.
7550 * This only matters if the storage is encrypted.
7551 * <p>
7552 * Type: int (0 for false, 1 for true)
7553 * @hide
7554 */
7555 public static final String REQUIRE_PASSWORD_TO_DECRYPT = "require_password_to_decrypt";
7556
7557 /**
Libin.Tang@motorola.com0499bb52014-10-10 14:55:57 -05007558 * Whether the Volte/VT is enabled
7559 * <p>
7560 * Type: int (0 for false, 1 for true)
7561 * @hide
7562 */
Etan Cohene41a9cf2014-10-22 10:50:46 -07007563 public static final String ENHANCED_4G_MODE_ENABLED = "volte_vt_enabled";
Libin.Tang@motorola.com0499bb52014-10-10 14:55:57 -05007564
7565 /**
Etan Cohen9c8f21b2014-12-23 15:02:19 -08007566 * Whether WFC is enabled
7567 * <p>
7568 * Type: int (0 for false, 1 for true)
7569 *
7570 * @hide
7571 */
7572 public static final String WFC_IMS_ENABLED = "wfc_ims_enabled";
7573
7574 /**
7575 * WFC Mode.
7576 * <p>
7577 * Type: int - 2=Wi-Fi preferred, 1=Cellular preferred, 0=Wi-Fi only
7578 *
7579 * @hide
7580 */
7581 public static final String WFC_IMS_MODE = "wfc_ims_mode";
7582
7583 /**
7584 * Whether WFC roaming is enabled
7585 * <p>
7586 * Type: int (0 for false, 1 for true)
7587 *
7588 * @hide
7589 */
7590 public static final String WFC_IMS_ROAMING_ENABLED = "wfc_ims_roaming_enabled";
7591
7592 /**
Amit Mahajan4fea0922014-11-18 12:56:28 -08007593 * Whether user can enable/disable LTE as a preferred network. A carrier might control
7594 * this via gservices, OMA-DM, carrier app, etc.
7595 * <p>
7596 * Type: int (0 for false, 1 for true)
7597 * @hide
7598 */
7599 public static final String LTE_SERVICE_FORCED = "lte_service_forced";
7600
7601 /**
Christopher Tate66488d62012-10-02 11:58:01 -07007602 * Settings to backup. This is here so that it's in the same place as the settings
7603 * keys and easy to update.
7604 *
7605 * These keys may be mentioned in the SETTINGS_TO_BACKUP arrays in System
7606 * and Secure as well. This is because those tables drive both backup and
7607 * restore, and restore needs to properly whitelist keys that used to live
7608 * in those namespaces. The keys will only actually be backed up / restored
7609 * if they are also mentioned in this table (Global.SETTINGS_TO_BACKUP).
7610 *
7611 * NOTE: Settings are backed up and restored in the order they appear
7612 * in this array. If you have one setting depending on another,
7613 * make sure that they are ordered appropriately.
7614 *
7615 * @hide
7616 */
7617 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate58f41ec2013-01-11 15:40:36 -08007618 BUGREPORT_IN_POWER_MENU,
Christopher Tate66488d62012-10-02 11:58:01 -07007619 STAY_ON_WHILE_PLUGGED_IN,
Christopher Tate66488d62012-10-02 11:58:01 -07007620 AUTO_TIME,
7621 AUTO_TIME_ZONE,
7622 POWER_SOUNDS_ENABLED,
7623 DOCK_SOUNDS_ENABLED,
7624 USB_MASS_STORAGE_ENABLED,
7625 ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED,
7626 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
7627 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY,
Christopher Tate16eb7cd2012-10-09 15:26:30 -07007628 WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED,
Christopher Tate66488d62012-10-02 11:58:01 -07007629 WIFI_NUM_OPEN_NETWORKS_KEPT,
7630 EMERGENCY_TONE,
7631 CALL_AUTO_RETRY,
Amith Yamasani94005242014-10-31 11:35:13 -07007632 DOCK_AUDIO_MEDIA_ENABLED,
7633 LOW_POWER_MODE_TRIGGER_LEVEL
Christopher Tate66488d62012-10-02 11:58:01 -07007634 };
7635
Christopher Tate06efb532012-08-24 15:29:27 -07007636 // Populated lazily, guarded by class object:
Dianne Hackborn139748f2012-09-24 11:36:57 -07007637 private static NameValueCache sNameValueCache = new NameValueCache(
7638 SYS_PROP_SETTING_VERSION,
7639 CONTENT_URI,
7640 CALL_METHOD_GET_GLOBAL,
7641 CALL_METHOD_PUT_GLOBAL);
Christopher Tate06efb532012-08-24 15:29:27 -07007642
Christopher Tateaa036a22014-05-19 16:33:27 -07007643 // Certain settings have been moved from global to the per-user secure namespace
7644 private static final HashSet<String> MOVED_TO_SECURE;
7645 static {
7646 MOVED_TO_SECURE = new HashSet<String>(1);
7647 MOVED_TO_SECURE.add(Settings.Global.INSTALL_NON_MARKET_APPS);
7648 }
7649
Svetoslav683914b2015-01-15 14:22:26 -08007650 /** @hide */
7651 public static void getMovedToSecureSettings(Set<String> outKeySet) {
7652 outKeySet.addAll(MOVED_TO_SECURE);
7653 }
7654
Christopher Tate06efb532012-08-24 15:29:27 -07007655 /**
7656 * Look up a name in the database.
7657 * @param resolver to access the database with
7658 * @param name to look up in the table
7659 * @return the corresponding value, or null if not present
7660 */
Dianne Hackborn139748f2012-09-24 11:36:57 -07007661 public static String getString(ContentResolver resolver, String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07007662 return getStringForUser(resolver, name, UserHandle.myUserId());
7663 }
7664
7665 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -07007666 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -07007667 int userHandle) {
Christopher Tateaa036a22014-05-19 16:33:27 -07007668 if (MOVED_TO_SECURE.contains(name)) {
7669 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
7670 + " to android.provider.Settings.Secure, returning read-only value.");
7671 return Secure.getStringForUser(resolver, name, userHandle);
7672 }
Christopher Tate06efb532012-08-24 15:29:27 -07007673 return sNameValueCache.getStringForUser(resolver, name, userHandle);
7674 }
7675
7676 /**
7677 * Store a name/value pair into the database.
7678 * @param resolver to access the database with
7679 * @param name to store
7680 * @param value to associate with the name
7681 * @return true if the value was set, false on database errors
7682 */
7683 public static boolean putString(ContentResolver resolver,
7684 String name, String value) {
7685 return putStringForUser(resolver, name, value, UserHandle.myUserId());
7686 }
7687
7688 /** @hide */
7689 public static boolean putStringForUser(ContentResolver resolver,
7690 String name, String value, int userHandle) {
Christopher Tate06efb532012-08-24 15:29:27 -07007691 if (LOCAL_LOGV) {
7692 Log.v(TAG, "Global.putString(name=" + name + ", value=" + value
7693 + " for " + userHandle);
7694 }
Christopher Tateaa036a22014-05-19 16:33:27 -07007695 // Global and Secure have the same access policy so we can forward writes
7696 if (MOVED_TO_SECURE.contains(name)) {
7697 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
7698 + " to android.provider.Settings.Secure, value is unchanged.");
7699 return Secure.putStringForUser(resolver, name, value, userHandle);
7700 }
Christopher Tate06efb532012-08-24 15:29:27 -07007701 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
7702 }
7703
7704 /**
7705 * Construct the content URI for a particular name/value pair,
7706 * useful for monitoring changes with a ContentObserver.
7707 * @param name to look up in the table
7708 * @return the corresponding content URI, or null if not present
7709 */
7710 public static Uri getUriFor(String name) {
7711 return getUriFor(CONTENT_URI, name);
7712 }
7713
7714 /**
7715 * Convenience function for retrieving a single secure settings value
7716 * as an integer. Note that internally setting values are always
7717 * stored as strings; this function converts the string to an integer
7718 * for you. The default value will be returned if the setting is
7719 * not defined or not an integer.
7720 *
7721 * @param cr The ContentResolver to access.
7722 * @param name The name of the setting to retrieve.
7723 * @param def Value to return if the setting is not defined.
7724 *
7725 * @return The setting's current value, or 'def' if it is not defined
7726 * or not a valid integer.
7727 */
7728 public static int getInt(ContentResolver cr, String name, int def) {
7729 String v = getString(cr, name);
7730 try {
7731 return v != null ? Integer.parseInt(v) : def;
7732 } catch (NumberFormatException e) {
7733 return def;
7734 }
7735 }
7736
7737 /**
7738 * Convenience function for retrieving a single secure settings value
7739 * as an integer. Note that internally setting values are always
7740 * stored as strings; this function converts the string to an integer
7741 * for you.
7742 * <p>
7743 * This version does not take a default value. If the setting has not
7744 * been set, or the string value is not a number,
7745 * it throws {@link SettingNotFoundException}.
7746 *
7747 * @param cr The ContentResolver to access.
7748 * @param name The name of the setting to retrieve.
7749 *
7750 * @throws SettingNotFoundException Thrown if a setting by the given
7751 * name can't be found or the setting value is not an integer.
7752 *
7753 * @return The setting's current value.
7754 */
7755 public static int getInt(ContentResolver cr, String name)
7756 throws SettingNotFoundException {
7757 String v = getString(cr, name);
7758 try {
7759 return Integer.parseInt(v);
7760 } catch (NumberFormatException e) {
7761 throw new SettingNotFoundException(name);
7762 }
7763 }
7764
7765 /**
7766 * Convenience function for updating a single settings value as an
7767 * integer. This will either create a new entry in the table if the
7768 * given name does not exist, or modify the value of the existing row
7769 * with that name. Note that internally setting values are always
7770 * stored as strings, so this function converts the given value to a
7771 * string before storing it.
7772 *
7773 * @param cr The ContentResolver to access.
7774 * @param name The name of the setting to modify.
7775 * @param value The new value for the setting.
7776 * @return true if the value was set, false on database errors
7777 */
7778 public static boolean putInt(ContentResolver cr, String name, int value) {
7779 return putString(cr, name, Integer.toString(value));
7780 }
7781
7782 /**
7783 * Convenience function for retrieving a single secure settings value
7784 * as a {@code long}. Note that internally setting values are always
7785 * stored as strings; this function converts the string to a {@code long}
7786 * for you. The default value will be returned if the setting is
7787 * not defined or not a {@code long}.
7788 *
7789 * @param cr The ContentResolver to access.
7790 * @param name The name of the setting to retrieve.
7791 * @param def Value to return if the setting is not defined.
7792 *
7793 * @return The setting's current value, or 'def' if it is not defined
7794 * or not a valid {@code long}.
7795 */
7796 public static long getLong(ContentResolver cr, String name, long def) {
7797 String valString = getString(cr, name);
7798 long value;
7799 try {
7800 value = valString != null ? Long.parseLong(valString) : def;
7801 } catch (NumberFormatException e) {
7802 value = def;
7803 }
7804 return value;
7805 }
7806
7807 /**
7808 * Convenience function for retrieving a single secure settings value
7809 * as a {@code long}. Note that internally setting values are always
7810 * stored as strings; this function converts the string to a {@code long}
7811 * for you.
7812 * <p>
7813 * This version does not take a default value. If the setting has not
7814 * been set, or the string value is not a number,
7815 * it throws {@link SettingNotFoundException}.
7816 *
7817 * @param cr The ContentResolver to access.
7818 * @param name The name of the setting to retrieve.
7819 *
7820 * @return The setting's current value.
7821 * @throws SettingNotFoundException Thrown if a setting by the given
7822 * name can't be found or the setting value is not an integer.
7823 */
7824 public static long getLong(ContentResolver cr, String name)
7825 throws SettingNotFoundException {
7826 String valString = getString(cr, name);
7827 try {
7828 return Long.parseLong(valString);
7829 } catch (NumberFormatException e) {
7830 throw new SettingNotFoundException(name);
7831 }
7832 }
7833
7834 /**
7835 * Convenience function for updating a secure settings value as a long
7836 * integer. This will either create a new entry in the table if the
7837 * given name does not exist, or modify the value of the existing row
7838 * with that name. Note that internally setting values are always
7839 * stored as strings, so this function converts the given value to a
7840 * string before storing it.
7841 *
7842 * @param cr The ContentResolver to access.
7843 * @param name The name of the setting to modify.
7844 * @param value The new value for the setting.
7845 * @return true if the value was set, false on database errors
7846 */
7847 public static boolean putLong(ContentResolver cr, String name, long value) {
7848 return putString(cr, name, Long.toString(value));
7849 }
7850
7851 /**
7852 * Convenience function for retrieving a single secure settings value
7853 * as a floating point number. Note that internally setting values are
7854 * always stored as strings; this function converts the string to an
7855 * float for you. The default value will be returned if the setting
7856 * is not defined or not a valid float.
7857 *
7858 * @param cr The ContentResolver to access.
7859 * @param name The name of the setting to retrieve.
7860 * @param def Value to return if the setting is not defined.
7861 *
7862 * @return The setting's current value, or 'def' if it is not defined
7863 * or not a valid float.
7864 */
7865 public static float getFloat(ContentResolver cr, String name, float def) {
7866 String v = getString(cr, name);
7867 try {
7868 return v != null ? Float.parseFloat(v) : def;
7869 } catch (NumberFormatException e) {
7870 return def;
7871 }
7872 }
7873
7874 /**
7875 * Convenience function for retrieving a single secure settings value
7876 * as a float. Note that internally setting values are always
7877 * stored as strings; this function converts the string to a float
7878 * for you.
7879 * <p>
7880 * This version does not take a default value. If the setting has not
7881 * been set, or the string value is not a number,
7882 * it throws {@link SettingNotFoundException}.
7883 *
7884 * @param cr The ContentResolver to access.
7885 * @param name The name of the setting to retrieve.
7886 *
7887 * @throws SettingNotFoundException Thrown if a setting by the given
7888 * name can't be found or the setting value is not a float.
7889 *
7890 * @return The setting's current value.
7891 */
7892 public static float getFloat(ContentResolver cr, String name)
7893 throws SettingNotFoundException {
7894 String v = getString(cr, name);
7895 if (v == null) {
7896 throw new SettingNotFoundException(name);
7897 }
7898 try {
7899 return Float.parseFloat(v);
7900 } catch (NumberFormatException e) {
7901 throw new SettingNotFoundException(name);
7902 }
7903 }
7904
7905 /**
7906 * Convenience function for updating a single settings value as a
7907 * floating point number. This will either create a new entry in the
7908 * table if the given name does not exist, or modify the value of the
7909 * existing row with that name. Note that internally setting values
7910 * are always stored as strings, so this function converts the given
7911 * value to a string before storing it.
7912 *
7913 * @param cr The ContentResolver to access.
7914 * @param name The name of the setting to modify.
7915 * @param value The new value for the setting.
7916 * @return true if the value was set, false on database errors
7917 */
7918 public static boolean putFloat(ContentResolver cr, String name, float value) {
7919 return putString(cr, name, Float.toString(value));
7920 }
Wink Savillefb40dd42014-06-12 17:02:31 -07007921
7922
7923 /**
7924 * Subscription to be used for voice call on a multi sim device. The supported values
7925 * are 0 = SUB1, 1 = SUB2 and etc.
7926 * @hide
7927 */
7928 public static final String MULTI_SIM_VOICE_CALL_SUBSCRIPTION = "multi_sim_voice_call";
7929
7930 /**
7931 * Used to provide option to user to select subscription during dial.
7932 * The supported values are 0 = disable or 1 = enable prompt.
7933 * @hide
7934 */
7935 public static final String MULTI_SIM_VOICE_PROMPT = "multi_sim_voice_prompt";
7936
7937 /**
7938 * Subscription to be used for data call on a multi sim device. The supported values
7939 * are 0 = SUB1, 1 = SUB2 and etc.
7940 * @hide
7941 */
7942 public static final String MULTI_SIM_DATA_CALL_SUBSCRIPTION = "multi_sim_data_call";
7943
7944 /**
7945 * Subscription to be used for SMS on a multi sim device. The supported values
7946 * are 0 = SUB1, 1 = SUB2 and etc.
7947 * @hide
7948 */
7949 public static final String MULTI_SIM_SMS_SUBSCRIPTION = "multi_sim_sms";
7950
7951 /**
7952 * Used to provide option to user to select subscription during send SMS.
7953 * The value 1 - enable, 0 - disable
7954 * @hide
7955 */
7956 public static final String MULTI_SIM_SMS_PROMPT = "multi_sim_sms_prompt";
7957
7958
7959
7960 /** User preferred subscriptions setting.
7961 * This holds the details of the user selected subscription from the card and
7962 * the activation status. Each settings string have the coma separated values
7963 * iccId,appType,appId,activationStatus,3gppIndex,3gpp2Index
7964 * @hide
7965 */
7966 public static final String[] MULTI_SIM_USER_PREFERRED_SUBS = {"user_preferred_sub1",
7967 "user_preferred_sub2","user_preferred_sub3"};
Zheng Fub218ff42015-04-13 16:31:16 -07007968
7969 /**
7970 * Whether to enable new contacts aggregator or not.
7971 * The value 1 - enable, 0 - disable
7972 * @hide
7973 */
7974 public static final String NEW_CONTACT_AGGREGATOR = "new_contact_aggregator";
Zheng Fu31ce78c2015-04-15 16:57:53 -07007975
7976 /**
7977 * Whether to enable contacts metadata syncing or not
7978 * The value 1 - enable, 0 - disable
7979 * @hide
7980 */
7981 public static final String CONTACT_METADATA_SYNC = "contact_metadata_sync";
Christopher Tate06efb532012-08-24 15:29:27 -07007982 }
7983
7984 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007985 * User-defined bookmarks and shortcuts. The target of each bookmark is an
7986 * Intent URL, allowing it to be either a web page or a particular
7987 * application activity.
7988 *
7989 * @hide
7990 */
7991 public static final class Bookmarks implements BaseColumns
7992 {
7993 private static final String TAG = "Bookmarks";
7994
7995 /**
7996 * The content:// style URL for this table
7997 */
7998 public static final Uri CONTENT_URI =
7999 Uri.parse("content://" + AUTHORITY + "/bookmarks");
8000
8001 /**
8002 * The row ID.
8003 * <p>Type: INTEGER</p>
8004 */
8005 public static final String ID = "_id";
8006
8007 /**
8008 * Descriptive name of the bookmark that can be displayed to the user.
8009 * If this is empty, the title should be resolved at display time (use
8010 * {@link #getTitle(Context, Cursor)} any time you want to display the
8011 * title of a bookmark.)
8012 * <P>
8013 * Type: TEXT
8014 * </P>
8015 */
8016 public static final String TITLE = "title";
8017
8018 /**
8019 * Arbitrary string (displayed to the user) that allows bookmarks to be
8020 * organized into categories. There are some special names for
8021 * standard folders, which all start with '@'. The label displayed for
8022 * the folder changes with the locale (via {@link #getLabelForFolder}) but
8023 * the folder name does not change so you can consistently query for
8024 * the folder regardless of the current locale.
8025 *
8026 * <P>Type: TEXT</P>
8027 *
8028 */
8029 public static final String FOLDER = "folder";
8030
8031 /**
8032 * The Intent URL of the bookmark, describing what it points to. This
8033 * value is given to {@link android.content.Intent#getIntent} to create
8034 * an Intent that can be launched.
8035 * <P>Type: TEXT</P>
8036 */
8037 public static final String INTENT = "intent";
8038
8039 /**
8040 * Optional shortcut character associated with this bookmark.
8041 * <P>Type: INTEGER</P>
8042 */
8043 public static final String SHORTCUT = "shortcut";
8044
8045 /**
8046 * The order in which the bookmark should be displayed
8047 * <P>Type: INTEGER</P>
8048 */
8049 public static final String ORDERING = "ordering";
8050
8051 private static final String[] sIntentProjection = { INTENT };
8052 private static final String[] sShortcutProjection = { ID, SHORTCUT };
8053 private static final String sShortcutSelection = SHORTCUT + "=?";
8054
8055 /**
8056 * Convenience function to retrieve the bookmarked Intent for a
8057 * particular shortcut key.
8058 *
8059 * @param cr The ContentResolver to query.
8060 * @param shortcut The shortcut key.
8061 *
8062 * @return Intent The bookmarked URL, or null if there is no bookmark
8063 * matching the given shortcut.
8064 */
8065 public static Intent getIntentForShortcut(ContentResolver cr, char shortcut)
8066 {
8067 Intent intent = null;
8068
8069 Cursor c = cr.query(CONTENT_URI,
8070 sIntentProjection, sShortcutSelection,
8071 new String[] { String.valueOf((int) shortcut) }, ORDERING);
8072 // Keep trying until we find a valid shortcut
8073 try {
8074 while (intent == null && c.moveToNext()) {
8075 try {
8076 String intentURI = c.getString(c.getColumnIndexOrThrow(INTENT));
Christian Mehlmauera34d2c92010-05-25 19:04:20 +02008077 intent = Intent.parseUri(intentURI, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008078 } catch (java.net.URISyntaxException e) {
8079 // The stored URL is bad... ignore it.
8080 } catch (IllegalArgumentException e) {
8081 // Column not found
Dianne Hackborna33e3f72009-09-29 17:28:24 -07008082 Log.w(TAG, "Intent column not found", e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008083 }
8084 }
8085 } finally {
8086 if (c != null) c.close();
8087 }
8088
8089 return intent;
8090 }
8091
8092 /**
8093 * Add a new bookmark to the system.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07008094 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008095 * @param cr The ContentResolver to query.
8096 * @param intent The desired target of the bookmark.
8097 * @param title Bookmark title that is shown to the user; null if none
8098 * or it should be resolved to the intent's title.
8099 * @param folder Folder in which to place the bookmark; null if none.
8100 * @param shortcut Shortcut that will invoke the bookmark; 0 if none. If
8101 * this is non-zero and there is an existing bookmark entry
8102 * with this same shortcut, then that existing shortcut is
8103 * cleared (the bookmark is not removed).
8104 * @return The unique content URL for the new bookmark entry.
8105 */
8106 public static Uri add(ContentResolver cr,
8107 Intent intent,
8108 String title,
8109 String folder,
8110 char shortcut,
8111 int ordering)
8112 {
8113 // If a shortcut is supplied, and it is already defined for
8114 // another bookmark, then remove the old definition.
8115 if (shortcut != 0) {
Jeff Hamilton7cd51ef2010-05-12 17:30:27 -05008116 cr.delete(CONTENT_URI, sShortcutSelection,
8117 new String[] { String.valueOf((int) shortcut) });
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008118 }
8119
8120 ContentValues values = new ContentValues();
8121 if (title != null) values.put(TITLE, title);
8122 if (folder != null) values.put(FOLDER, folder);
Jean-Baptiste Queru3b9f0a32010-06-21 13:46:59 -07008123 values.put(INTENT, intent.toUri(0));
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008124 if (shortcut != 0) values.put(SHORTCUT, (int) shortcut);
8125 values.put(ORDERING, ordering);
8126 return cr.insert(CONTENT_URI, values);
8127 }
8128
8129 /**
8130 * Return the folder name as it should be displayed to the user. This
8131 * takes care of localizing special folders.
8132 *
8133 * @param r Resources object for current locale; only need access to
8134 * system resources.
8135 * @param folder The value found in the {@link #FOLDER} column.
8136 *
8137 * @return CharSequence The label for this folder that should be shown
8138 * to the user.
8139 */
8140 public static CharSequence getLabelForFolder(Resources r, String folder) {
8141 return folder;
8142 }
8143
8144 /**
8145 * Return the title as it should be displayed to the user. This takes
8146 * care of localizing bookmarks that point to activities.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07008147 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008148 * @param context A context.
8149 * @param cursor A cursor pointing to the row whose title should be
8150 * returned. The cursor must contain at least the {@link #TITLE}
8151 * and {@link #INTENT} columns.
8152 * @return A title that is localized and can be displayed to the user,
8153 * or the empty string if one could not be found.
8154 */
8155 public static CharSequence getTitle(Context context, Cursor cursor) {
8156 int titleColumn = cursor.getColumnIndex(TITLE);
8157 int intentColumn = cursor.getColumnIndex(INTENT);
8158 if (titleColumn == -1 || intentColumn == -1) {
8159 throw new IllegalArgumentException(
8160 "The cursor must contain the TITLE and INTENT columns.");
8161 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07008162
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008163 String title = cursor.getString(titleColumn);
8164 if (!TextUtils.isEmpty(title)) {
8165 return title;
8166 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07008167
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008168 String intentUri = cursor.getString(intentColumn);
8169 if (TextUtils.isEmpty(intentUri)) {
8170 return "";
8171 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07008172
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008173 Intent intent;
8174 try {
Christian Mehlmauera34d2c92010-05-25 19:04:20 +02008175 intent = Intent.parseUri(intentUri, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008176 } catch (URISyntaxException e) {
8177 return "";
8178 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07008179
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008180 PackageManager packageManager = context.getPackageManager();
8181 ResolveInfo info = packageManager.resolveActivity(intent, 0);
8182 return info != null ? info.loadLabel(packageManager) : "";
8183 }
8184 }
8185
8186 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008187 * Returns the device ID that we should use when connecting to the mobile gtalk server.
8188 * This is a string like "android-0x1242", where the hex string is the Android ID obtained
8189 * from the GoogleLoginService.
8190 *
8191 * @param androidId The Android ID for this device.
8192 * @return The device ID that should be used when connecting to the mobile gtalk server.
8193 * @hide
8194 */
8195 public static String getGTalkDeviceId(long androidId) {
8196 return "android-" + Long.toHexString(androidId);
8197 }
8198}