blob: bc6fb04eb43f4348e579a4aa39dc8543cdc9648a [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;
Jeff Sharkeya73b8fd2016-01-06 17:02:08 -070022import android.annotation.TestApi;
Adrian Roos7811d9f2015-07-27 15:10:13 -070023import android.app.ActivityThread;
Billy Lau6ad2d662015-07-18 00:26:58 +010024import android.app.AppOpsManager;
Adrian Roos7811d9f2015-07-27 15:10:13 -070025import android.app.Application;
Narayan Kamathee69ff42011-06-28 12:07:18 +010026import android.app.SearchManager;
Jeff Sharkey6e2bee72012-10-01 13:39:08 -070027import android.app.WallpaperManager;
Mike LeBeau5d34e9b2010-02-10 19:34:56 -080028import android.content.ComponentName;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080029import android.content.ContentResolver;
30import android.content.ContentValues;
31import android.content.Context;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -080032import android.content.IContentProvider;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080033import android.content.Intent;
Dianne Hackbornb8b11a02010-03-10 15:53:11 -080034import android.content.pm.ActivityInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080035import android.content.pm.PackageManager;
36import android.content.pm.ResolveInfo;
37import android.content.res.Configuration;
38import android.content.res.Resources;
39import android.database.Cursor;
40import android.database.SQLException;
David Christie3f7b6522013-08-06 19:19:08 -070041import android.location.LocationManager;
Jeff Sharkey625239a2012-09-26 22:03:49 -070042import android.net.ConnectivityManager;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080043import android.net.Uri;
Irfan Sheriff36f74132010-11-04 16:57:37 -070044import android.net.wifi.WifiManager;
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -070045import android.os.BatteryManager;
Billy Lau6ad2d662015-07-18 00:26:58 +010046import android.os.Binder;
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -070047import android.os.Bundle;
Jeff Sharkey625239a2012-09-26 22:03:49 -070048import android.os.DropBoxManager;
Amith Yamasani52c489c2012-03-28 11:42:42 -070049import android.os.IBinder;
Amith Yamasani7ab8c4a2012-04-06 09:27:12 -070050import android.os.Process;
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -070051import android.os.RemoteException;
Amith Yamasani52c489c2012-03-28 11:42:42 -070052import android.os.ServiceManager;
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -070053import android.os.SystemProperties;
Dianne Hackbornf02b60a2012-08-16 10:48:27 -070054import android.os.UserHandle;
Jeff Sharkey625239a2012-09-26 22:03:49 -070055import android.os.Build.VERSION_CODES;
Narayan Kamath6d632962011-08-24 11:51:37 +010056import android.speech.tts.TextToSpeech;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080057import android.text.TextUtils;
58import android.util.AndroidException;
Svetoslav683914b2015-01-15 14:22:26 -080059import android.util.ArrayMap;
60import android.util.ArraySet;
Seigo Nonakabd5cbdd2016-01-25 19:40:28 +090061import android.util.LocaleList;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080062import android.util.Log;
63
Svetoslav683914b2015-01-15 14:22:26 -080064import com.android.internal.util.ArrayUtils;
Amith Yamasani52c489c2012-03-28 11:42:42 -070065import com.android.internal.widget.ILockSettings;
66
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080067import java.net.URISyntaxException;
Svetoslav683914b2015-01-15 14:22:26 -080068import java.text.SimpleDateFormat;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080069import java.util.HashMap;
70import java.util.HashSet;
Elliott Hughescb64d432013-08-02 10:00:44 -070071import java.util.Locale;
Svetoslav683914b2015-01-15 14:22:26 -080072import java.util.Map;
73import java.util.Set;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080074
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080075/**
76 * The Settings provider contains global system-level device preferences.
77 */
78public final class Settings {
79
80 // Intent actions for Settings
81
82 /**
83 * Activity Action: Show system settings.
84 * <p>
85 * Input: Nothing.
86 * <p>
Gilles Debunnee90bed12011-08-30 14:28:27 -070087 * Output: Nothing.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080088 */
89 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
90 public static final String ACTION_SETTINGS = "android.settings.SETTINGS";
91
92 /**
93 * Activity Action: Show settings to allow configuration of APNs.
94 * <p>
95 * Input: Nothing.
96 * <p>
Gilles Debunnee90bed12011-08-30 14:28:27 -070097 * Output: Nothing.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080098 */
99 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
100 public static final String ACTION_APN_SETTINGS = "android.settings.APN_SETTINGS";
101
102 /**
103 * Activity Action: Show settings to allow configuration of current location
104 * sources.
105 * <p>
106 * In some cases, a matching Activity may not exist, so ensure you
107 * safeguard against this.
108 * <p>
109 * Input: Nothing.
110 * <p>
111 * Output: Nothing.
112 */
113 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
114 public static final String ACTION_LOCATION_SOURCE_SETTINGS =
115 "android.settings.LOCATION_SOURCE_SETTINGS";
116
117 /**
Jason Monk76c67aa2016-02-19 14:49:42 -0500118 * Activity Action: Show settings to allow configuration of users.
119 * <p>
120 * In some cases, a matching Activity may not exist, so ensure you
121 * safeguard against this.
122 * <p>
123 * Input: Nothing.
124 * <p>
125 * Output: Nothing.
126 * @hide
127 */
128 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
129 public static final String ACTION_USER_SETTINGS =
130 "android.settings.USER_SETTINGS";
131
132 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800133 * Activity Action: Show settings to allow configuration of wireless controls
134 * such as Wi-Fi, Bluetooth and Mobile networks.
135 * <p>
136 * In some cases, a matching Activity may not exist, so ensure you
137 * safeguard against this.
138 * <p>
139 * Input: Nothing.
140 * <p>
141 * Output: Nothing.
142 */
143 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
144 public static final String ACTION_WIRELESS_SETTINGS =
145 "android.settings.WIRELESS_SETTINGS";
146
147 /**
Jeremy Klein15f3d212016-01-24 17:01:09 -0800148 * Activity Action: Show tether provisioning activity.
149 *
150 * <p>
151 * In some cases, a matching Activity may not exist, so ensure you
152 * safeguard against this.
153 * <p>
154 * Input: {@link ConnectivityManager.EXTRA_TETHER_TYPE} should be included to specify which type
155 * of tethering should be checked. {@link ConnectivityManager.EXTRA_PROVISION_CALLBACK} should
156 * contain a {@link ResultReceiver} which will be called back with a tether result code.
157 * <p>
158 * Output: The result of the provisioning check.
159 * {@link ConnectivityManager.TETHER_ERROR_NO_ERROR} if successful,
160 * {@link ConnectivityManager.TETHER_ERROR_PROVISION_FAILED} for failure.
161 *
162 * @hide
163 */
164 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
165 public static final String ACTION_TETHER_PROVISIONING =
166 "android.settings.TETHER_PROVISIONING_UI";
167
168 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800169 * Activity Action: Show settings to allow entering/exiting airplane mode.
170 * <p>
171 * In some cases, a matching Activity may not exist, so ensure you
172 * safeguard against this.
173 * <p>
174 * Input: Nothing.
175 * <p>
176 * Output: Nothing.
177 */
178 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
179 public static final String ACTION_AIRPLANE_MODE_SETTINGS =
180 "android.settings.AIRPLANE_MODE_SETTINGS";
181
182 /**
Barnaby Jamesb3006d32015-04-02 17:49:54 -0700183 * Activity Action: Modify Airplane mode settings using a voice command.
Barnaby James48f35522014-07-16 14:27:39 -0700184 * <p>
185 * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
186 * <p>
187 * This intent MUST be started using
188 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
189 * startVoiceActivity}.
190 * <p>
Barnaby Jamesb3006d32015-04-02 17:49:54 -0700191 * Note: The activity implementing this intent MUST verify that
Barnaby James48f35522014-07-16 14:27:39 -0700192 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before
193 * modifying the setting.
194 * <p>
Barnaby Jamesb3006d32015-04-02 17:49:54 -0700195 * Input: To tell which state airplane mode should be set to, add the
196 * {@link #EXTRA_AIRPLANE_MODE_ENABLED} extra to this Intent with the state specified.
197 * If the extra is not included, no changes will be made.
Barnaby James48f35522014-07-16 14:27:39 -0700198 * <p>
199 * Output: Nothing.
200 */
201 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
202 public static final String ACTION_VOICE_CONTROL_AIRPLANE_MODE =
203 "android.settings.VOICE_CONTROL_AIRPLANE_MODE";
204
205 /**
Dianne Hackborndd9b82c2009-09-03 00:18:47 -0700206 * Activity Action: Show settings for accessibility modules.
207 * <p>
208 * In some cases, a matching Activity may not exist, so ensure you
209 * safeguard against this.
210 * <p>
211 * Input: Nothing.
212 * <p>
213 * Output: Nothing.
214 */
215 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
216 public static final String ACTION_ACCESSIBILITY_SETTINGS =
217 "android.settings.ACCESSIBILITY_SETTINGS";
218
219 /**
Dianne Hackborna3fb40d2014-08-12 15:06:50 -0700220 * Activity Action: Show settings to control access to usage information.
221 * <p>
222 * In some cases, a matching Activity may not exist, so ensure you
223 * safeguard against this.
224 * <p>
225 * Input: Nothing.
226 * <p>
227 * Output: Nothing.
228 */
229 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
230 public static final String ACTION_USAGE_ACCESS_SETTINGS =
231 "android.settings.USAGE_ACCESS_SETTINGS";
232
233 /**
Jason Monk6f909782015-04-17 14:30:25 -0400234 * Activity Category: Show application settings related to usage access.
235 * <p>
236 * An activity that provides a user interface for adjusting usage access related
237 * preferences for its containing application. Optional but recommended for apps that
238 * use {@link android.Manifest.permission#PACKAGE_USAGE_STATS}.
239 * <p>
240 * The activity may define meta-data to describe what usage access is
241 * used for within their app with {@link #METADATA_USAGE_ACCESS_REASON}, which
242 * will be displayed in Settings.
243 * <p>
244 * Input: Nothing.
245 * <p>
246 * Output: Nothing.
247 */
248 @SdkConstant(SdkConstantType.INTENT_CATEGORY)
249 public static final String INTENT_CATEGORY_USAGE_ACCESS_CONFIG =
250 "android.intent.category.USAGE_ACCESS_CONFIG";
251
252 /**
253 * Metadata key: Reason for needing usage access.
254 * <p>
255 * A key for metadata attached to an activity that receives action
256 * {@link #INTENT_CATEGORY_USAGE_ACCESS_CONFIG}, shown to the
257 * user as description of how the app uses usage access.
258 * <p>
259 */
260 public static final String METADATA_USAGE_ACCESS_REASON =
261 "android.settings.metadata.USAGE_ACCESS_REASON";
262
263 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800264 * Activity Action: Show settings to allow configuration of security and
265 * location privacy.
266 * <p>
267 * In some cases, a matching Activity may not exist, so ensure you
268 * safeguard against this.
269 * <p>
270 * Input: Nothing.
271 * <p>
272 * Output: Nothing.
273 */
274 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
275 public static final String ACTION_SECURITY_SETTINGS =
276 "android.settings.SECURITY_SETTINGS";
277
278 /**
Maggie Benthall0469f412013-09-05 15:30:26 -0400279 * Activity Action: Show trusted credentials settings, opening to the user tab,
280 * to allow management of installed credentials.
281 * <p>
282 * In some cases, a matching Activity may not exist, so ensure you
283 * safeguard against this.
284 * <p>
285 * Input: Nothing.
286 * <p>
287 * Output: Nothing.
288 * @hide
289 */
290 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
291 public static final String ACTION_TRUSTED_CREDENTIALS_USER =
292 "com.android.settings.TRUSTED_CREDENTIALS_USER";
293
294 /**
295 * Activity Action: Show dialog explaining that an installed CA cert may enable
296 * monitoring of encrypted network traffic.
297 * <p>
298 * In some cases, a matching Activity may not exist, so ensure you
Victor Chang355d4762016-04-07 21:23:15 +0100299 * safeguard against this. Add {@link #EXTRA_NUMBER_OF_CERTIFICATES} extra to indicate the
300 * number of certificates.
Maggie Benthall0469f412013-09-05 15:30:26 -0400301 * <p>
302 * Input: Nothing.
303 * <p>
304 * Output: Nothing.
305 * @hide
306 */
307 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
308 public static final String ACTION_MONITORING_CERT_INFO =
309 "com.android.settings.MONITORING_CERT_INFO";
310
311 /**
Amith Yamasanic15255a2009-09-23 15:33:19 -0700312 * Activity Action: Show settings to allow configuration of privacy options.
313 * <p>
314 * In some cases, a matching Activity may not exist, so ensure you
315 * safeguard against this.
316 * <p>
317 * Input: Nothing.
318 * <p>
319 * Output: Nothing.
320 */
321 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
322 public static final String ACTION_PRIVACY_SETTINGS =
323 "android.settings.PRIVACY_SETTINGS";
324
325 /**
Robin Leea249aee2016-02-03 13:42:56 +0000326 * Activity Action: Show settings to allow configuration of VPN.
327 * <p>
328 * In some cases, a matching Activity may not exist, so ensure you
329 * safeguard against this.
330 * <p>
331 * Input: Nothing.
332 * <p>
333 * Output: Nothing.
334 */
335 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
336 public static final String ACTION_VPN_SETTINGS =
337 "android.settings.VPN_SETTINGS";
338
339 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800340 * Activity Action: Show settings to allow configuration of Wi-Fi.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800341 * <p>
342 * In some cases, a matching Activity may not exist, so ensure you
343 * safeguard against this.
344 * <p>
345 * Input: Nothing.
346 * <p>
347 * Output: Nothing.
348
349 */
350 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
351 public static final String ACTION_WIFI_SETTINGS =
352 "android.settings.WIFI_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700353
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800354 /**
355 * Activity Action: Show settings to allow configuration of a static IP
356 * address for Wi-Fi.
357 * <p>
358 * In some cases, a matching Activity may not exist, so ensure you safeguard
359 * against this.
360 * <p>
361 * Input: Nothing.
362 * <p>
363 * Output: Nothing.
364 */
365 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
366 public static final String ACTION_WIFI_IP_SETTINGS =
367 "android.settings.WIFI_IP_SETTINGS";
368
369 /**
370 * Activity Action: Show settings to allow configuration of Bluetooth.
371 * <p>
372 * In some cases, a matching Activity may not exist, so ensure you
373 * safeguard against this.
374 * <p>
375 * Input: Nothing.
376 * <p>
377 * Output: Nothing.
378 */
379 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
380 public static final String ACTION_BLUETOOTH_SETTINGS =
381 "android.settings.BLUETOOTH_SETTINGS";
382
383 /**
Jeff Brownc05c1ae2015-05-05 13:46:30 -0700384 * Activity Action: Show settings to allow configuration of cast endpoints.
Jeff Brown1a937b02014-07-01 22:13:04 -0700385 * <p>
386 * In some cases, a matching Activity may not exist, so ensure you
387 * safeguard against this.
388 * <p>
389 * Input: Nothing.
390 * <p>
391 * Output: Nothing.
392 */
393 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
394 public static final String ACTION_CAST_SETTINGS =
395 "android.settings.CAST_SETTINGS";
396
397 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800398 * Activity Action: Show settings to allow configuration of date and time.
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)
408 public static final String ACTION_DATE_SETTINGS =
409 "android.settings.DATE_SETTINGS";
410
411 /**
412 * Activity Action: Show settings to allow configuration of sound and volume.
413 * <p>
414 * In some cases, a matching Activity may not exist, so ensure you
415 * safeguard against this.
416 * <p>
417 * Input: Nothing.
418 * <p>
419 * Output: Nothing.
420 */
421 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
422 public static final String ACTION_SOUND_SETTINGS =
423 "android.settings.SOUND_SETTINGS";
424
425 /**
426 * Activity Action: Show settings to allow configuration of display.
427 * <p>
428 * In some cases, a matching Activity may not exist, so ensure you
429 * safeguard against this.
430 * <p>
431 * Input: Nothing.
432 * <p>
433 * Output: Nothing.
434 */
435 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
436 public static final String ACTION_DISPLAY_SETTINGS =
437 "android.settings.DISPLAY_SETTINGS";
438
439 /**
440 * Activity Action: Show settings to allow configuration of locale.
441 * <p>
442 * In some cases, a matching Activity may not exist, so ensure you
443 * safeguard against this.
444 * <p>
445 * Input: Nothing.
446 * <p>
447 * Output: Nothing.
448 */
449 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
450 public static final String ACTION_LOCALE_SETTINGS =
451 "android.settings.LOCALE_SETTINGS";
452
453 /**
454 * Activity Action: Show settings to configure input methods, in particular
455 * allowing the user to enable input methods.
456 * <p>
457 * In some cases, a matching Activity may not exist, so ensure you
458 * safeguard against this.
459 * <p>
460 * Input: Nothing.
461 * <p>
462 * Output: Nothing.
463 */
464 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
Dianne Hackborna3fb40d2014-08-12 15:06:50 -0700465 public static final String ACTION_VOICE_INPUT_SETTINGS =
466 "android.settings.VOICE_INPUT_SETTINGS";
467
468 /**
469 * Activity Action: Show settings to configure input methods, in particular
470 * allowing the user to enable input methods.
471 * <p>
472 * In some cases, a matching Activity may not exist, so ensure you
473 * safeguard against this.
474 * <p>
475 * Input: Nothing.
476 * <p>
477 * Output: Nothing.
478 */
479 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800480 public static final String ACTION_INPUT_METHOD_SETTINGS =
481 "android.settings.INPUT_METHOD_SETTINGS";
482
483 /**
Tadashi G. Takaokaf49688f2011-01-20 17:56:13 +0900484 * Activity Action: Show settings to enable/disable input method subtypes.
satok86417ea2010-10-27 14:11:03 +0900485 * <p>
486 * In some cases, a matching Activity may not exist, so ensure you
487 * safeguard against this.
488 * <p>
Tadashi G. Takaoka25480202011-01-20 23:13:02 +0900489 * To tell which input method's subtypes are displayed in the settings, add
490 * {@link #EXTRA_INPUT_METHOD_ID} extra to this Intent with the input method id.
491 * If there is no extra in this Intent, subtypes from all installed input methods
492 * will be displayed in the settings.
493 *
494 * @see android.view.inputmethod.InputMethodInfo#getId
495 * <p>
satok86417ea2010-10-27 14:11:03 +0900496 * Input: Nothing.
497 * <p>
498 * Output: Nothing.
499 */
500 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
Tadashi G. Takaokaf49688f2011-01-20 17:56:13 +0900501 public static final String ACTION_INPUT_METHOD_SUBTYPE_SETTINGS =
502 "android.settings.INPUT_METHOD_SUBTYPE_SETTINGS";
satok86417ea2010-10-27 14:11:03 +0900503
504 /**
satok7cfc0ed2011-06-20 21:29:36 +0900505 * Activity Action: Show a dialog to select input method.
506 * <p>
507 * In some cases, a matching Activity may not exist, so ensure you
508 * safeguard against this.
509 * <p>
510 * Input: Nothing.
511 * <p>
512 * Output: Nothing.
513 * @hide
514 */
515 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
516 public static final String ACTION_SHOW_INPUT_METHOD_PICKER =
517 "android.settings.SHOW_INPUT_METHOD_PICKER";
518
519 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800520 * Activity Action: Show settings to manage the user input dictionary.
521 * <p>
Chet Haasee8222dd2013-09-05 07:44:18 -0700522 * Starting with {@link android.os.Build.VERSION_CODES#KITKAT},
Satoshi Kataoka2aa2bc52013-07-30 14:25:11 +0900523 * it is guaranteed there will always be an appropriate implementation for this Intent action.
524 * 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 -0800525 * <p>
526 * Input: Nothing.
527 * <p>
528 * Output: Nothing.
529 */
530 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
531 public static final String ACTION_USER_DICTIONARY_SETTINGS =
532 "android.settings.USER_DICTIONARY_SETTINGS";
533
534 /**
Abodunrinwa Toki07177142016-03-22 16:25:48 +0000535 * Activity Action: Show settings to configure the hardware keyboard.
Yohei Yukawad8701bf2016-01-27 16:15:01 -0800536 * <p>
537 * In some cases, a matching Activity may not exist, so ensure you
538 * safeguard against this.
539 * <p>
Yohei Yukawad8701bf2016-01-27 16:15:01 -0800540 * Input: Nothing.
541 * <p>
542 * Output: Nothing.
543 */
544 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
Abodunrinwa Toki07177142016-03-22 16:25:48 +0000545 public static final String ACTION_HARD_KEYBOARD_SETTINGS =
546 "android.settings.HARD_KEYBOARD_SETTINGS";
Yohei Yukawad8701bf2016-01-27 16:15:01 -0800547
548 /**
Gilles Debunnee90bed12011-08-30 14:28:27 -0700549 * Activity Action: Adds a word to the user dictionary.
550 * <p>
551 * In some cases, a matching Activity may not exist, so ensure you
552 * safeguard against this.
553 * <p>
554 * Input: An extra with key <code>word</code> that contains the word
555 * that should be added to the dictionary.
556 * <p>
557 * Output: Nothing.
558 *
559 * @hide
560 */
561 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
562 public static final String ACTION_USER_DICTIONARY_INSERT =
563 "com.android.settings.USER_DICTIONARY_INSERT";
564
565 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800566 * Activity Action: Show settings to allow configuration of application-related settings.
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_APPLICATION_SETTINGS =
577 "android.settings.APPLICATION_SETTINGS";
578
579 /**
580 * Activity Action: Show settings to allow configuration of application
Dianne Hackborn8d866e52012-10-10 18:39:45 -0700581 * development-related settings. As of
582 * {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1} this action is
583 * a required part of the platform.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800584 * <p>
585 * Input: Nothing.
586 * <p>
587 * Output: Nothing.
588 */
589 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
590 public static final String ACTION_APPLICATION_DEVELOPMENT_SETTINGS =
591 "android.settings.APPLICATION_DEVELOPMENT_SETTINGS";
592
593 /**
594 * Activity Action: Show settings to allow configuration of quick launch shortcuts.
595 * <p>
596 * In some cases, a matching Activity may not exist, so ensure you
597 * safeguard against this.
598 * <p>
599 * Input: Nothing.
600 * <p>
601 * Output: Nothing.
602 */
603 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
604 public static final String ACTION_QUICK_LAUNCH_SETTINGS =
605 "android.settings.QUICK_LAUNCH_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700606
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800607 /**
608 * Activity Action: Show settings to manage installed applications.
609 * <p>
610 * In some cases, a matching Activity may not exist, so ensure you
611 * safeguard against this.
612 * <p>
613 * Input: Nothing.
614 * <p>
615 * Output: Nothing.
616 */
617 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
618 public static final String ACTION_MANAGE_APPLICATIONS_SETTINGS =
619 "android.settings.MANAGE_APPLICATIONS_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700620
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800621 /**
Winson Chung44e8ff92010-09-27 14:36:52 -0700622 * Activity Action: Show settings to manage all applications.
623 * <p>
624 * In some cases, a matching Activity may not exist, so ensure you
625 * safeguard against this.
626 * <p>
627 * Input: Nothing.
628 * <p>
629 * Output: Nothing.
630 */
631 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
632 public static final String ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS =
633 "android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS";
634
635 /**
Billy Lau6ad2d662015-07-18 00:26:58 +0100636 * Activity Action: Show screen for controlling which apps can draw on top of other apps.
Billy Laucbe540f2015-06-25 01:51:44 +0100637 * <p>
638 * In some cases, a matching Activity may not exist, so ensure you
639 * safeguard against this.
640 * <p>
Billy Lau6ad2d662015-07-18 00:26:58 +0100641 * Input: Optionally, the Intent's data URI can specify the application package name to
642 * directly invoke the management GUI specific to the package name. For example
643 * "package:com.my.app".
Billy Laucbe540f2015-06-25 01:51:44 +0100644 * <p>
645 * Output: Nothing.
646 */
647 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
648 public static final String ACTION_MANAGE_OVERLAY_PERMISSION =
Billy Lau22b3f4c2015-07-08 00:31:01 +0100649 "android.settings.action.MANAGE_OVERLAY_PERMISSION";
650
651 /**
Billy Lau6ad2d662015-07-18 00:26:58 +0100652 * Activity Action: Show screen for controlling which apps are allowed to write/modify
653 * system settings.
Billy Lau22b3f4c2015-07-08 00:31:01 +0100654 * <p>
655 * In some cases, a matching Activity may not exist, so ensure you
656 * safeguard against this.
657 * <p>
Billy Lau6ad2d662015-07-18 00:26:58 +0100658 * Input: Optionally, the Intent's data URI can specify the application package name to
659 * directly invoke the management GUI specific to the package name. For example
660 * "package:com.my.app".
Billy Lau22b3f4c2015-07-08 00:31:01 +0100661 * <p>
662 * Output: Nothing.
663 */
664 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
665 public static final String ACTION_MANAGE_WRITE_SETTINGS =
666 "android.settings.action.MANAGE_WRITE_SETTINGS";
Billy Laucbe540f2015-06-25 01:51:44 +0100667
668 /**
Dianne Hackbornb7bb3b32010-06-06 22:47:50 -0700669 * Activity Action: Show screen of details about a particular application.
670 * <p>
671 * In some cases, a matching Activity may not exist, so ensure you
672 * safeguard against this.
673 * <p>
674 * Input: The Intent's data URI specifies the application package name
675 * to be shown, with the "package" scheme. That is "package:com.my.app".
676 * <p>
677 * Output: Nothing.
678 */
679 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
680 public static final String ACTION_APPLICATION_DETAILS_SETTINGS =
681 "android.settings.APPLICATION_DETAILS_SETTINGS";
682
683 /**
Jason Monk287b8892015-06-10 10:39:23 -0400684 * Activity Action: Show screen for controlling which apps can ignore battery optimizations.
685 * <p>
Dianne Hackbornc7b57b12015-08-10 14:52:52 -0700686 * Input: Nothing.
687 * <p>
688 * Output: Nothing.
689 * <p>
690 * You can use {@link android.os.PowerManager#isIgnoringBatteryOptimizations
691 * PowerManager.isIgnoringBatteryOptimizations()} to determine if an application is
692 * already ignoring optimizations. You can use
693 * {@link #ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS} to ask the user to put you
694 * on this list.
695 */
696 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
697 public static final String ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS =
698 "android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS";
699
700 /**
Felipe Leme5f5d7072016-01-27 10:41:22 -0800701 * Activity Action: Ask the user to allow an app to ignore battery optimizations (that is,
Dianne Hackbornc7b57b12015-08-10 14:52:52 -0700702 * put them on the whitelist of apps shown by
703 * {@link #ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS}). For an app to use this, it also
704 * must hold the {@link android.Manifest.permission#REQUEST_IGNORE_BATTERY_OPTIMIZATIONS}
705 * permission.
706 * <p><b>Note:</b> most applications should <em>not</em> use this; there are many facilities
707 * provided by the platform for applications to operate correctly in the various power
Felipe Leme5f5d7072016-01-27 10:41:22 -0800708 * saving modes. This is only for unusual applications that need to deeply control their own
Dianne Hackbornc7b57b12015-08-10 14:52:52 -0700709 * execution, at the potential expense of the user's battery life. Note that these applications
Kweku Adamseb80f7c2016-01-12 11:46:52 -0800710 * greatly run the risk of showing to the user as high power consumers on their device.</p>
Dianne Hackbornc7b57b12015-08-10 14:52:52 -0700711 * <p>
712 * Input: The Intent's data URI must specify the application package name
Jason Monk287b8892015-06-10 10:39:23 -0400713 * to be shown, with the "package" scheme. That is "package:com.my.app".
714 * <p>
715 * Output: Nothing.
Dianne Hackborn1958e5e2015-06-12 18:11:41 -0700716 * <p>
717 * You can use {@link android.os.PowerManager#isIgnoringBatteryOptimizations
718 * PowerManager.isIgnoringBatteryOptimizations()} to determine if an application is
719 * already ignoring optimizations.
Jason Monk287b8892015-06-10 10:39:23 -0400720 */
721 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
Dianne Hackbornc7b57b12015-08-10 14:52:52 -0700722 public static final String ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS =
723 "android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS";
Jason Monk287b8892015-06-10 10:39:23 -0400724
725 /**
Felipe Leme5f5d7072016-01-27 10:41:22 -0800726 * Activity Action: Show screen for controlling which apps can ignore background data
727 * restrictions.
728 * <p>
729 * Input: if the Intent's data URI is set with an application name (using the "package" schema,
730 * like "package:com.my.app"), then when the screen is displayed it will focus on such app. If
731 * the data is not set, it will just open the screen.
732 * <p>
733 * Output: Nothing.
734 * <p>
735 * Applications can also use {@link android.net.ConnectivityManager#getRestrictBackgroundStatus
736 * ConnectivityManager#getRestrictBackgroundStatus()} to determine the status of the background
737 * data restrictions for them.
738 */
739 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
740 public static final String ACTION_IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS =
741 "android.settings.IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS";
742
743 /**
Dianne Hackborn35654b62013-01-14 17:38:02 -0800744 * @hide
745 * Activity Action: Show the "app ops" settings screen.
746 * <p>
747 * Input: Nothing.
748 * <p>
749 * Output: Nothing.
750 */
751 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
752 public static final String ACTION_APP_OPS_SETTINGS =
753 "android.settings.APP_OPS_SETTINGS";
754
755 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800756 * Activity Action: Show settings for system update functionality.
757 * <p>
758 * In some cases, a matching Activity may not exist, so ensure you
759 * safeguard against this.
760 * <p>
761 * Input: Nothing.
762 * <p>
763 * Output: Nothing.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700764 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800765 * @hide
766 */
767 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
768 public static final String ACTION_SYSTEM_UPDATE_SETTINGS =
769 "android.settings.SYSTEM_UPDATE_SETTINGS";
770
771 /**
772 * Activity Action: Show settings to allow configuration of sync settings.
773 * <p>
774 * In some cases, a matching Activity may not exist, so ensure you
775 * safeguard against this.
776 * <p>
Erikeebc8e22010-02-18 13:27:19 -0800777 * The account types available to add via the add account button may be restricted by adding an
778 * {@link #EXTRA_AUTHORITIES} extra to this Intent with one or more syncable content provider's
779 * authorities. Only account types which can sync with that content provider will be offered to
780 * the user.
781 * <p>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800782 * Input: Nothing.
783 * <p>
784 * Output: Nothing.
785 */
786 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
787 public static final String ACTION_SYNC_SETTINGS =
788 "android.settings.SYNC_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700789
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800790 /**
Erikeebc8e22010-02-18 13:27:19 -0800791 * Activity Action: Show add account screen for creating a new account.
792 * <p>
793 * In some cases, a matching Activity may not exist, so ensure you
794 * safeguard against this.
795 * <p>
796 * The account types available to add may be restricted by adding an {@link #EXTRA_AUTHORITIES}
797 * extra to the Intent with one or more syncable content provider's authorities. Only account
798 * types which can sync with that content provider will be offered to the user.
799 * <p>
Alon Albert50359c22013-02-26 14:47:48 -0800800 * Account types can also be filtered by adding an {@link #EXTRA_ACCOUNT_TYPES} extra to the
801 * Intent with one or more account types.
802 * <p>
Erikeebc8e22010-02-18 13:27:19 -0800803 * Input: Nothing.
804 * <p>
805 * Output: Nothing.
806 */
807 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
808 public static final String ACTION_ADD_ACCOUNT =
809 "android.settings.ADD_ACCOUNT_SETTINGS";
810
811 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800812 * Activity Action: Show settings for selecting the network operator.
813 * <p>
814 * In some cases, a matching Activity may not exist, so ensure you
815 * safeguard against this.
816 * <p>
817 * Input: Nothing.
818 * <p>
819 * Output: Nothing.
820 */
821 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
822 public static final String ACTION_NETWORK_OPERATOR_SETTINGS =
823 "android.settings.NETWORK_OPERATOR_SETTINGS";
824
825 /**
826 * Activity Action: Show settings for selection of 2G/3G.
827 * <p>
828 * In some cases, a matching Activity may not exist, so ensure you
829 * safeguard against this.
830 * <p>
831 * Input: Nothing.
832 * <p>
833 * Output: Nothing.
834 */
835 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
836 public static final String ACTION_DATA_ROAMING_SETTINGS =
837 "android.settings.DATA_ROAMING_SETTINGS";
838
839 /**
840 * Activity Action: Show settings for internal storage.
841 * <p>
842 * In some cases, a matching Activity may not exist, so ensure you
843 * safeguard against this.
844 * <p>
845 * Input: Nothing.
846 * <p>
847 * Output: Nothing.
848 */
849 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
850 public static final String ACTION_INTERNAL_STORAGE_SETTINGS =
851 "android.settings.INTERNAL_STORAGE_SETTINGS";
852 /**
853 * Activity Action: Show settings for memory card storage.
854 * <p>
855 * In some cases, a matching Activity may not exist, so ensure you
856 * safeguard against this.
857 * <p>
858 * Input: Nothing.
859 * <p>
860 * Output: Nothing.
861 */
862 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
863 public static final String ACTION_MEMORY_CARD_SETTINGS =
864 "android.settings.MEMORY_CARD_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700865
Justin Mattsonef340352010-01-13 21:05:46 -0800866 /**
867 * Activity Action: Show settings for global search.
868 * <p>
869 * In some cases, a matching Activity may not exist, so ensure you
870 * safeguard against this.
871 * <p>
872 * Input: Nothing.
873 * <p>
874 * Output: Nothing
875 */
876 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
877 public static final String ACTION_SEARCH_SETTINGS =
878 "android.search.action.SEARCH_SETTINGS";
879
Daniel Sandler9d8b8762010-01-22 20:50:15 -0500880 /**
881 * Activity Action: Show general device information settings (serial
882 * number, software version, phone number, etc.).
883 * <p>
884 * In some cases, a matching Activity may not exist, so ensure you
885 * safeguard against this.
886 * <p>
887 * Input: Nothing.
888 * <p>
889 * Output: Nothing
890 */
891 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
892 public static final String ACTION_DEVICE_INFO_SETTINGS =
893 "android.settings.DEVICE_INFO_SETTINGS";
894
Martijn Coenen9b3c83f2011-07-28 11:21:39 -0500895 /**
Nick Pellycccf01d2011-10-31 14:49:40 -0700896 * Activity Action: Show NFC settings.
897 * <p>
898 * This shows UI that allows NFC to be turned on or off.
Martijn Coenen9b3c83f2011-07-28 11:21:39 -0500899 * <p>
900 * In some cases, a matching Activity may not exist, so ensure you
901 * safeguard against this.
902 * <p>
903 * Input: Nothing.
904 * <p>
905 * Output: Nothing
Nick Pellycccf01d2011-10-31 14:49:40 -0700906 * @see android.nfc.NfcAdapter#isEnabled()
907 */
908 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
909 public static final String ACTION_NFC_SETTINGS = "android.settings.NFC_SETTINGS";
910
911 /**
912 * Activity Action: Show NFC Sharing settings.
913 * <p>
914 * This shows UI that allows NDEF Push (Android Beam) to be turned on or
915 * off.
916 * <p>
917 * In some cases, a matching Activity may not exist, so ensure you
918 * safeguard against this.
919 * <p>
920 * Input: Nothing.
921 * <p>
922 * Output: Nothing
923 * @see android.nfc.NfcAdapter#isNdefPushEnabled()
Martijn Coenen9b3c83f2011-07-28 11:21:39 -0500924 */
925 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
926 public static final String ACTION_NFCSHARING_SETTINGS =
927 "android.settings.NFCSHARING_SETTINGS";
928
Daniel Sandlerc08cd022012-11-27 22:47:37 -0500929 /**
Martijn Coenen62c196a2013-08-09 13:43:34 -0700930 * Activity Action: Show NFC Tap & Pay settings
931 * <p>
932 * This shows UI that allows the user to configure Tap&Pay
933 * settings.
934 * <p>
935 * In some cases, a matching Activity may not exist, so ensure you
936 * safeguard against this.
937 * <p>
938 * Input: Nothing.
939 * <p>
940 * Output: Nothing
941 */
942 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
943 public static final String ACTION_NFC_PAYMENT_SETTINGS =
944 "android.settings.NFC_PAYMENT_SETTINGS";
945
946 /**
Daniel Sandlerc08cd022012-11-27 22:47:37 -0500947 * Activity Action: Show Daydream settings.
948 * <p>
949 * In some cases, a matching Activity may not exist, so ensure you
950 * safeguard against this.
951 * <p>
952 * Input: Nothing.
953 * <p>
954 * Output: Nothing.
955 * @see android.service.dreams.DreamService
Daniel Sandlerc08cd022012-11-27 22:47:37 -0500956 */
957 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
958 public static final String ACTION_DREAM_SETTINGS = "android.settings.DREAM_SETTINGS";
959
Daniel Sandler5feceeb2013-03-22 18:29:23 -0700960 /**
961 * Activity Action: Show Notification listener settings.
962 * <p>
963 * In some cases, a matching Activity may not exist, so ensure you
964 * safeguard against this.
965 * <p>
966 * Input: Nothing.
967 * <p>
968 * Output: Nothing.
969 * @see android.service.notification.NotificationListenerService
Daniel Sandler5feceeb2013-03-22 18:29:23 -0700970 */
971 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
972 public static final String ACTION_NOTIFICATION_LISTENER_SETTINGS
Chris Wren8326a8a2014-10-22 14:13:32 -0400973 = "android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS";
Daniel Sandler5feceeb2013-03-22 18:29:23 -0700974
Alan Viverette69ce69b2013-08-29 12:23:48 -0700975 /**
John Spurlock80774932015-05-07 17:38:50 -0400976 * Activity Action: Show Do Not Disturb access settings.
977 * <p>
John Spurlock7c74f782015-06-04 13:01:42 -0400978 * Users can grant and deny access to Do Not Disturb configuration from here.
979 * See {@link android.app.NotificationManager#isNotificationPolicyAccessGranted()} for more
980 * details.
John Spurlock80774932015-05-07 17:38:50 -0400981 * <p>
982 * Input: Nothing.
983 * <p>
984 * Output: Nothing.
985 */
986 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
John Spurlock7c74f782015-06-04 13:01:42 -0400987 public static final String ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS
988 = "android.settings.NOTIFICATION_POLICY_ACCESS_SETTINGS";
John Spurlock80774932015-05-07 17:38:50 -0400989
990 /**
John Spurlock7340fc82014-04-24 18:50:12 -0400991 * @hide
992 */
993 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
994 public static final String ACTION_CONDITION_PROVIDER_SETTINGS
995 = "android.settings.ACTION_CONDITION_PROVIDER_SETTINGS";
996
997 /**
Alan Viverette69ce69b2013-08-29 12:23:48 -0700998 * Activity Action: Show settings for video captioning.
999 * <p>
1000 * In some cases, a matching Activity may not exist, so ensure you safeguard
1001 * against this.
1002 * <p>
1003 * Input: Nothing.
1004 * <p>
1005 * Output: Nothing.
1006 */
1007 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1008 public static final String ACTION_CAPTIONING_SETTINGS = "android.settings.CAPTIONING_SETTINGS";
1009
Svetoslav773f54d2013-09-03 14:01:43 -07001010 /**
1011 * Activity Action: Show the top level print settings.
1012 * <p>
1013 * In some cases, a matching Activity may not exist, so ensure you
1014 * safeguard against this.
1015 * <p>
1016 * Input: Nothing.
1017 * <p>
1018 * Output: Nothing.
1019 */
1020 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1021 public static final String ACTION_PRINT_SETTINGS =
1022 "android.settings.ACTION_PRINT_SETTINGS";
1023
John Spurlockde547002014-02-28 17:50:39 -05001024 /**
1025 * Activity Action: Show Zen Mode configuration settings.
1026 *
1027 * @hide
1028 */
1029 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1030 public static final String ACTION_ZEN_MODE_SETTINGS = "android.settings.ZEN_MODE_SETTINGS";
1031
Santos Cordona4c75242014-07-09 12:07:51 -07001032 /**
John Spurlockfc746f82015-04-03 13:47:14 -04001033 * Activity Action: Show Zen Mode priority configuration settings.
1034 *
1035 * @hide
1036 */
1037 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1038 public static final String ACTION_ZEN_MODE_PRIORITY_SETTINGS
1039 = "android.settings.ZEN_MODE_PRIORITY_SETTINGS";
1040
1041 /**
John Spurlock7af10182015-04-03 15:10:31 -04001042 * Activity Action: Show Zen Mode automation configuration settings.
1043 *
1044 * @hide
1045 */
1046 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1047 public static final String ACTION_ZEN_MODE_AUTOMATION_SETTINGS
1048 = "android.settings.ZEN_MODE_AUTOMATION_SETTINGS";
1049
1050 /**
Barnaby Jamesb3006d32015-04-02 17:49:54 -07001051 * Activity Action: Modify do not disturb mode settings.
1052 * <p>
1053 * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
1054 * <p>
1055 * This intent MUST be started using
1056 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
1057 * startVoiceActivity}.
1058 * <p>
1059 * Note: The Activity implementing this intent MUST verify that
1060 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction}.
1061 * returns true before modifying the setting.
1062 * <p>
1063 * Input: The optional {@link #EXTRA_DO_NOT_DISTURB_MODE_MINUTES} extra can be used to indicate
1064 * how long the user wishes to avoid interruptions for. The optional
1065 * {@link #EXTRA_DO_NOT_DISTURB_MODE_ENABLED} extra can be to indicate if the user is
1066 * enabling or disabling do not disturb mode. If either extra is not included, the
1067 * user maybe asked to provide the value.
1068 * <p>
1069 * Output: Nothing.
1070 */
1071 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1072 public static final String ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE =
1073 "android.settings.VOICE_CONTROL_DO_NOT_DISTURB_MODE";
1074
1075 /**
John Spurlockb2278d62015-04-07 12:47:12 -04001076 * Activity Action: Show Zen Mode schedule rule configuration settings.
1077 *
1078 * @hide
1079 */
1080 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1081 public static final String ACTION_ZEN_MODE_SCHEDULE_RULE_SETTINGS
1082 = "android.settings.ZEN_MODE_SCHEDULE_RULE_SETTINGS";
1083
1084 /**
John Spurlockd60258f2015-04-30 09:30:52 -04001085 * Activity Action: Show Zen Mode event rule configuration settings.
1086 *
1087 * @hide
1088 */
1089 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1090 public static final String ACTION_ZEN_MODE_EVENT_RULE_SETTINGS
1091 = "android.settings.ZEN_MODE_EVENT_RULE_SETTINGS";
1092
1093 /**
John Spurlock39581cc2015-04-10 11:59:01 -04001094 * Activity Action: Show Zen Mode external rule configuration settings.
1095 *
1096 * @hide
1097 */
1098 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1099 public static final String ACTION_ZEN_MODE_EXTERNAL_RULE_SETTINGS
1100 = "android.settings.ZEN_MODE_EXTERNAL_RULE_SETTINGS";
1101
1102 /**
Santos Cordona4c75242014-07-09 12:07:51 -07001103 * Activity Action: Show the regulatory information screen for the device.
1104 * <p>
1105 * In some cases, a matching Activity may not exist, so ensure you safeguard
1106 * against this.
1107 * <p>
1108 * Input: Nothing.
1109 * <p>
1110 * Output: Nothing.
1111 */
Jeff Sharkeydd77fda2014-04-16 17:23:08 -07001112 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1113 public static final String
1114 ACTION_SHOW_REGULATORY_INFO = "android.settings.SHOW_REGULATORY_INFO";
1115
Jerome Poichet7974cb32014-05-14 12:04:43 -07001116 /**
1117 * Activity Action: Show Device Name Settings.
1118 * <p>
1119 * In some cases, a matching Activity may not exist, so ensure you safeguard
Tim Kilbourn87cd0dc2014-04-14 15:37:51 -07001120 * against this.
Jerome Poichet7974cb32014-05-14 12:04:43 -07001121 *
1122 * @hide
1123 */
1124 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1125 public static final String DEVICE_NAME_SETTINGS = "android.settings.DEVICE_NAME";
1126
Tim Kilbourn87cd0dc2014-04-14 15:37:51 -07001127 /**
1128 * Activity Action: Show pairing settings.
1129 * <p>
1130 * In some cases, a matching Activity may not exist, so ensure you safeguard
1131 * against this.
1132 *
1133 * @hide
1134 */
1135 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1136 public static final String ACTION_PAIRING_SETTINGS = "android.settings.PAIRING_SETTINGS";
1137
John Spurlockf8f524c2014-06-10 14:47:29 -04001138 /**
1139 * Activity Action: Show battery saver settings.
John Spurlock73466662014-10-30 13:42:05 -04001140 * <p>
1141 * In some cases, a matching Activity may not exist, so ensure you safeguard
1142 * against this.
John Spurlockf8f524c2014-06-10 14:47:29 -04001143 */
1144 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1145 public static final String ACTION_BATTERY_SAVER_SETTINGS
1146 = "android.settings.BATTERY_SAVER_SETTINGS";
1147
Amith Yamasanieb7b94a2014-07-14 18:02:08 -07001148 /**
Barnaby Jamesb3006d32015-04-02 17:49:54 -07001149 * Activity Action: Modify Battery Saver mode setting using a voice command.
1150 * <p>
1151 * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
1152 * <p>
1153 * This intent MUST be started using
1154 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
1155 * startVoiceActivity}.
1156 * <p>
1157 * Note: The activity implementing this intent MUST verify that
1158 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before
1159 * modifying the setting.
1160 * <p>
1161 * Input: To tell which state batter saver mode should be set to, add the
1162 * {@link #EXTRA_BATTERY_SAVER_MODE_ENABLED} extra to this Intent with the state specified.
1163 * If the extra is not included, no changes will be made.
1164 * <p>
1165 * Output: Nothing.
1166 */
1167 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1168 public static final String ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE =
1169 "android.settings.VOICE_CONTROL_BATTERY_SAVER_MODE";
1170
1171 /**
Amith Yamasanieb7b94a2014-07-14 18:02:08 -07001172 * Activity Action: Show Home selection settings. If there are multiple activities
1173 * that can satisfy the {@link Intent#CATEGORY_HOME} intent, this screen allows you
1174 * to pick your preferred activity.
1175 */
1176 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1177 public static final String ACTION_HOME_SETTINGS
1178 = "android.settings.HOME_SETTINGS";
1179
Julia Reynolds7eba5932015-12-11 16:40:39 -05001180
1181
1182 /**
1183 * Activity Action: Show Default apps settings.
1184 * <p>
1185 * In some cases, a matching Activity may not exist, so ensure you
1186 * safeguard against this.
1187 * <p>
1188 * Input: Nothing.
1189 * <p>
1190 * Output: Nothing.
1191 */
1192 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1193 public static final String ACTION_MANAGE_DEFAULT_APPS_SETTINGS
1194 = "android.settings.MANAGE_DEFAULT_APPS_SETTINGS";
1195
John Spurlock2b0e09c2014-07-27 13:27:47 -04001196 /**
1197 * Activity Action: Show notification settings.
1198 *
1199 * @hide
1200 */
1201 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1202 public static final String ACTION_NOTIFICATION_SETTINGS
1203 = "android.settings.NOTIFICATION_SETTINGS";
1204
1205 /**
1206 * Activity Action: Show notification settings for a single app.
1207 *
1208 * @hide
1209 */
1210 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1211 public static final String ACTION_APP_NOTIFICATION_SETTINGS
1212 = "android.settings.APP_NOTIFICATION_SETTINGS";
1213
Chris Wrencd8f4f72014-08-27 18:48:13 -04001214 /**
1215 * Activity Action: Show notification redaction settings.
1216 *
1217 * @hide
1218 */
1219 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1220 public static final String ACTION_APP_NOTIFICATION_REDACTION
1221 = "android.settings.ACTION_APP_NOTIFICATION_REDACTION";
1222
John Spurlock2b0e09c2014-07-27 13:27:47 -04001223 /** @hide */ public static final String EXTRA_APP_UID = "app_uid";
1224 /** @hide */ public static final String EXTRA_APP_PACKAGE = "app_package";
1225
Sudheer Shanka410e6bd2015-12-31 15:29:50 +00001226 /**
1227 * Activity Action: Show a dialog with disabled by policy message.
1228 * <p> If an user action is disabled by policy, this dialog can be triggered to let
1229 * the user know about this.
1230 * <p>
1231 * Input: Nothing.
1232 * <p>
1233 * Output: Nothing.
Sudheer Shankaaebd5dd2016-02-18 12:37:14 +00001234 *
1235 * @hide
Sudheer Shanka410e6bd2015-12-31 15:29:50 +00001236 */
1237 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1238 public static final String ACTION_SHOW_ADMIN_SUPPORT_DETAILS
1239 = "android.settings.SHOW_ADMIN_SUPPORT_DETAILS";
1240
Michal Karpinskiba244092016-02-25 17:28:24 +00001241 /**
1242 * Activity Action: Show a dialog for remote bugreport flow.
1243 * <p>
1244 * Input: Nothing.
1245 * <p>
1246 * Output: Nothing.
1247 *
1248 * @hide
1249 */
1250 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1251 public static final String ACTION_SHOW_REMOTE_BUGREPORT_DIALOG
1252 = "android.settings.SHOW_REMOTE_BUGREPORT_DIALOG";
1253
Ruben Brunke24b9a62016-02-16 21:38:24 -08001254 /**
1255 * Activity Action: Show VR listener settings.
1256 * <p>
1257 * Input: Nothing.
1258 * <p>
1259 * Output: Nothing.
1260 *
1261 * @see android.service.vr.VrListenerService
1262 */
1263 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1264 public static final String ACTION_VR_LISTENER_SETTINGS
1265 = "android.settings.VR_LISTENER_SETTINGS";
1266
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001267 // End of Intent actions for Settings
1268
Erikeebc8e22010-02-18 13:27:19 -08001269 /**
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001270 * @hide - Private call() method on SettingsProvider to read from 'system' table.
1271 */
1272 public static final String CALL_METHOD_GET_SYSTEM = "GET_system";
1273
1274 /**
1275 * @hide - Private call() method on SettingsProvider to read from 'secure' table.
1276 */
1277 public static final String CALL_METHOD_GET_SECURE = "GET_secure";
1278
1279 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001280 * @hide - Private call() method on SettingsProvider to read from 'global' table.
1281 */
1282 public static final String CALL_METHOD_GET_GLOBAL = "GET_global";
1283
1284 /**
1285 * @hide - User handle argument extra to the fast-path call()-based requests
1286 */
1287 public static final String CALL_METHOD_USER_KEY = "_user";
1288
1289 /** @hide - Private call() method to write to 'system' table */
1290 public static final String CALL_METHOD_PUT_SYSTEM = "PUT_system";
1291
1292 /** @hide - Private call() method to write to 'secure' table */
1293 public static final String CALL_METHOD_PUT_SECURE = "PUT_secure";
1294
1295 /** @hide - Private call() method to write to 'global' table */
1296 public static final String CALL_METHOD_PUT_GLOBAL= "PUT_global";
1297
1298 /**
Erikeebc8e22010-02-18 13:27:19 -08001299 * Activity Extra: Limit available options in launched activity based on the given authority.
1300 * <p>
1301 * This can be passed as an extra field in an Activity Intent with one or more syncable content
1302 * provider's authorities as a String[]. This field is used by some intents to alter the
1303 * behavior of the called activity.
1304 * <p>
1305 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types available based
1306 * on the authority given.
1307 */
Alon Albert50359c22013-02-26 14:47:48 -08001308 public static final String EXTRA_AUTHORITIES = "authorities";
1309
Alon Albertd35bf1f2013-04-18 14:26:51 -07001310 /**
1311 * Activity Extra: Limit available options in launched activity based on the given account
1312 * types.
1313 * <p>
1314 * This can be passed as an extra field in an Activity Intent with one or more account types
1315 * as a String[]. This field is used by some intents to alter the behavior of the called
1316 * activity.
1317 * <p>
1318 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types to the specified
1319 * list.
1320 */
Alon Albert50359c22013-02-26 14:47:48 -08001321 public static final String EXTRA_ACCOUNT_TYPES = "account_types";
Erikeebc8e22010-02-18 13:27:19 -08001322
Tadashi G. Takaoka25480202011-01-20 23:13:02 +09001323 public static final String EXTRA_INPUT_METHOD_ID = "input_method_id";
1324
Barnaby James48f35522014-07-16 14:27:39 -07001325 /**
Michael Wrightc93fbd12014-09-22 20:07:59 -07001326 * Activity Extra: The device identifier to act upon.
1327 * <p>
1328 * This can be passed as an extra field in an Activity Intent with a single
1329 * InputDeviceIdentifier. This field is used by some activities to jump straight into the
1330 * settings for the given device.
1331 * <p>
Dianne Hackbornad6a99b2014-11-18 10:11:10 -08001332 * Example: The {@link #ACTION_INPUT_METHOD_SETTINGS} intent opens the keyboard layout
1333 * dialog for the given device.
Michael Wrightc93fbd12014-09-22 20:07:59 -07001334 * @hide
1335 */
1336 public static final String EXTRA_INPUT_DEVICE_IDENTIFIER = "input_device_identifier";
1337
1338 /**
Barnaby James48f35522014-07-16 14:27:39 -07001339 * Activity Extra: Enable or disable Airplane Mode.
1340 * <p>
1341 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_AIRPLANE_MODE}
Barnaby Jamesb3006d32015-04-02 17:49:54 -07001342 * intent as a boolean to indicate if it should be enabled.
Barnaby James48f35522014-07-16 14:27:39 -07001343 */
1344 public static final String EXTRA_AIRPLANE_MODE_ENABLED = "airplane_mode_enabled";
1345
Barnaby Jamesb3006d32015-04-02 17:49:54 -07001346 /**
1347 * Activity Extra: Enable or disable Battery saver mode.
1348 * <p>
1349 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE}
1350 * intent as a boolean to indicate if it should be enabled.
1351 */
1352 public static final String EXTRA_BATTERY_SAVER_MODE_ENABLED =
1353 "android.settings.extra.battery_saver_mode_enabled";
1354
1355 /**
1356 * Activity Extra: Enable or disable Do Not Disturb mode.
1357 * <p>
1358 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE}
1359 * intent as a boolean to indicate if it should be enabled.
1360 */
1361 public static final String EXTRA_DO_NOT_DISTURB_MODE_ENABLED =
1362 "android.settings.extra.do_not_disturb_mode_enabled";
1363
1364 /**
1365 * Activity Extra: How many minutes to enable do not disturb mode for.
1366 * <p>
1367 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE}
1368 * intent to indicate how long do not disturb mode should be enabled for.
1369 */
1370 public static final String EXTRA_DO_NOT_DISTURB_MODE_MINUTES =
1371 "android.settings.extra.do_not_disturb_mode_minutes";
1372
Victor Chang355d4762016-04-07 21:23:15 +01001373 /**
1374 * Activity Extra: Number of certificates
1375 * <p>
1376 * This can be passed as an extra field to the {@link #ACTION_MONITORING_CERT_INFO}
1377 * intent to indicate the number of certificates
1378 * @hide
1379 */
1380 public static final String EXTRA_NUMBER_OF_CERTIFICATES =
1381 "android.settings.extra.number_of_certificates";
1382
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001383 private static final String JID_RESOURCE_PREFIX = "android";
1384
1385 public static final String AUTHORITY = "settings";
1386
1387 private static final String TAG = "Settings";
Christopher Tate06efb532012-08-24 15:29:27 -07001388 private static final boolean LOCAL_LOGV = false;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001389
David Christie3f7b6522013-08-06 19:19:08 -07001390 // Lock ensures that when enabling/disabling the master location switch, we don't end up
1391 // with a partial enable/disable state in multi-threaded situations.
1392 private static final Object mLocationSettingsLock = new Object();
1393
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001394 public static class SettingNotFoundException extends AndroidException {
1395 public SettingNotFoundException(String msg) {
1396 super(msg);
1397 }
1398 }
1399
1400 /**
1401 * Common base for tables of name/value settings.
1402 */
1403 public static class NameValueTable implements BaseColumns {
1404 public static final String NAME = "name";
1405 public static final String VALUE = "value";
1406
1407 protected static boolean putString(ContentResolver resolver, Uri uri,
1408 String name, String value) {
1409 // The database will take care of replacing duplicates.
1410 try {
1411 ContentValues values = new ContentValues();
1412 values.put(NAME, name);
1413 values.put(VALUE, value);
1414 resolver.insert(uri, values);
1415 return true;
1416 } catch (SQLException e) {
Dianne Hackborna33e3f72009-09-29 17:28:24 -07001417 Log.w(TAG, "Can't set key " + name + " in " + uri, e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001418 return false;
1419 }
1420 }
1421
1422 public static Uri getUriFor(Uri uri, String name) {
1423 return Uri.withAppendedPath(uri, name);
1424 }
1425 }
1426
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001427 // Thread-safe.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001428 private static class NameValueCache {
1429 private final String mVersionSystemProperty;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001430 private final Uri mUri;
1431
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001432 private static final String[] SELECT_VALUE =
1433 new String[] { Settings.NameValueTable.VALUE };
1434 private static final String NAME_EQ_PLACEHOLDER = "name=?";
1435
1436 // Must synchronize on 'this' to access mValues and mValuesVersion.
Dan Egnor799f7212009-11-24 16:24:44 -08001437 private final HashMap<String, String> mValues = new HashMap<String, String>();
1438 private long mValuesVersion = 0;
1439
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001440 // Initially null; set lazily and held forever. Synchronized on 'this'.
1441 private IContentProvider mContentProvider = null;
1442
1443 // The method we'll call (or null, to not use) on the provider
1444 // for the fast path of retrieving settings.
Christopher Tate06efb532012-08-24 15:29:27 -07001445 private final String mCallGetCommand;
1446 private final String mCallSetCommand;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001447
Christopher Tate06efb532012-08-24 15:29:27 -07001448 public NameValueCache(String versionSystemProperty, Uri uri,
1449 String getCommand, String setCommand) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001450 mVersionSystemProperty = versionSystemProperty;
1451 mUri = uri;
Christopher Tate06efb532012-08-24 15:29:27 -07001452 mCallGetCommand = getCommand;
1453 mCallSetCommand = setCommand;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001454 }
1455
Christopher Tate06efb532012-08-24 15:29:27 -07001456 private IContentProvider lazyGetProvider(ContentResolver cr) {
1457 IContentProvider cp = null;
1458 synchronized (this) {
1459 cp = mContentProvider;
1460 if (cp == null) {
1461 cp = mContentProvider = cr.acquireProvider(mUri.getAuthority());
1462 }
1463 }
1464 return cp;
1465 }
1466
1467 public boolean putStringForUser(ContentResolver cr, String name, String value,
1468 final int userHandle) {
1469 try {
1470 Bundle arg = new Bundle();
1471 arg.putString(Settings.NameValueTable.VALUE, value);
Christopher Tated5fe1472012-09-10 15:48:38 -07001472 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
Christopher Tate06efb532012-08-24 15:29:27 -07001473 IContentProvider cp = lazyGetProvider(cr);
Dianne Hackborn35654b62013-01-14 17:38:02 -08001474 cp.call(cr.getPackageName(), mCallSetCommand, name, arg);
Christopher Tate06efb532012-08-24 15:29:27 -07001475 } catch (RemoteException e) {
1476 Log.w(TAG, "Can't set key " + name + " in " + mUri, e);
1477 return false;
1478 }
1479 return true;
1480 }
1481
Christopher Tate06efb532012-08-24 15:29:27 -07001482 public String getStringForUser(ContentResolver cr, String name, final int userHandle) {
Christopher Tate78d2a662012-09-13 16:19:44 -07001483 final boolean isSelf = (userHandle == UserHandle.myUserId());
1484 if (isSelf) {
1485 long newValuesVersion = SystemProperties.getLong(mVersionSystemProperty, 0);
Dan Egnor799f7212009-11-24 16:24:44 -08001486
Christopher Tate78d2a662012-09-13 16:19:44 -07001487 // Our own user's settings data uses a client-side cache
1488 synchronized (this) {
1489 if (mValuesVersion != newValuesVersion) {
1490 if (LOCAL_LOGV || false) {
1491 Log.v(TAG, "invalidate [" + mUri.getLastPathSegment() + "]: current "
1492 + newValuesVersion + " != cached " + mValuesVersion);
1493 }
1494
1495 mValues.clear();
1496 mValuesVersion = newValuesVersion;
Dan Egnor799f7212009-11-24 16:24:44 -08001497 }
1498
Christopher Tate78d2a662012-09-13 16:19:44 -07001499 if (mValues.containsKey(name)) {
1500 return mValues.get(name); // Could be null, that's OK -- negative caching
1501 }
Dan Egnor799f7212009-11-24 16:24:44 -08001502 }
Christopher Tate78d2a662012-09-13 16:19:44 -07001503 } else {
1504 if (LOCAL_LOGV) Log.v(TAG, "get setting for user " + userHandle
1505 + " by user " + UserHandle.myUserId() + " so skipping cache");
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001506 }
Dan Egnor799f7212009-11-24 16:24:44 -08001507
Christopher Tate06efb532012-08-24 15:29:27 -07001508 IContentProvider cp = lazyGetProvider(cr);
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001509
1510 // Try the fast path first, not using query(). If this
1511 // fails (alternate Settings provider that doesn't support
1512 // this interface?) then we fall back to the query/table
1513 // interface.
Christopher Tate06efb532012-08-24 15:29:27 -07001514 if (mCallGetCommand != null) {
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001515 try {
Christopher Tate06efb532012-08-24 15:29:27 -07001516 Bundle args = null;
Christopher Tate5e08af02012-09-21 17:17:22 -07001517 if (!isSelf) {
Christopher Tate06efb532012-08-24 15:29:27 -07001518 args = new Bundle();
1519 args.putInt(CALL_METHOD_USER_KEY, userHandle);
1520 }
Dianne Hackborn35654b62013-01-14 17:38:02 -08001521 Bundle b = cp.call(cr.getPackageName(), mCallGetCommand, name, args);
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001522 if (b != null) {
1523 String value = b.getPairValue();
Christopher Tate78d2a662012-09-13 16:19:44 -07001524 // Don't update our cache for reads of other users' data
1525 if (isSelf) {
1526 synchronized (this) {
1527 mValues.put(name, value);
1528 }
1529 } else {
1530 if (LOCAL_LOGV) Log.i(TAG, "call-query of user " + userHandle
1531 + " by " + UserHandle.myUserId()
1532 + " so not updating cache");
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001533 }
1534 return value;
1535 }
1536 // If the response Bundle is null, we fall through
1537 // to the query interface below.
1538 } catch (RemoteException e) {
1539 // Not supported by the remote side? Fall through
1540 // to query().
1541 }
1542 }
1543
Dan Egnor799f7212009-11-24 16:24:44 -08001544 Cursor c = null;
1545 try {
Dianne Hackborn35654b62013-01-14 17:38:02 -08001546 c = cp.query(cr.getPackageName(), mUri, SELECT_VALUE, NAME_EQ_PLACEHOLDER,
Jeff Brown75ea64f2012-01-25 19:37:13 -08001547 new String[]{name}, null, null);
Dan Egnor799f7212009-11-24 16:24:44 -08001548 if (c == null) {
1549 Log.w(TAG, "Can't get key " + name + " from " + mUri);
1550 return null;
1551 }
1552
1553 String value = c.moveToNext() ? c.getString(0) : null;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001554 synchronized (this) {
Dan Egnor799f7212009-11-24 16:24:44 -08001555 mValues.put(name, value);
1556 }
1557 if (LOCAL_LOGV) {
1558 Log.v(TAG, "cache miss [" + mUri.getLastPathSegment() + "]: " +
1559 name + " = " + (value == null ? "(null)" : value));
1560 }
1561 return value;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001562 } catch (RemoteException e) {
Dan Egnor799f7212009-11-24 16:24:44 -08001563 Log.w(TAG, "Can't get key " + name + " from " + mUri, e);
1564 return null; // Return null, but don't cache it.
1565 } finally {
1566 if (c != null) c.close();
1567 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001568 }
1569 }
1570
1571 /**
Billy Lau6ad2d662015-07-18 00:26:58 +01001572 * An app can use this method to check if it is currently allowed to draw on top of other
1573 * apps. In order to be allowed to do so, an app must first declare the
1574 * {@link android.Manifest.permission#SYSTEM_ALERT_WINDOW} permission in its manifest. If it
1575 * is currently disallowed, it can prompt the user to grant it this capability through a
1576 * management UI by sending an Intent with action
1577 * {@link android.provider.Settings#ACTION_MANAGE_OVERLAY_PERMISSION}.
1578 *
1579 * @param context A context
1580 * @return true if the calling app can draw on top of other apps, false otherwise.
1581 */
1582 public static boolean canDrawOverlays(Context context) {
Svet Ganov94ba40172016-04-03 22:04:22 -07001583 return Settings.isCallingPackageAllowedToDrawOverlays(context, Process.myUid(),
1584 context.getOpPackageName(), false);
Billy Lau6ad2d662015-07-18 00:26:58 +01001585 }
1586
1587 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001588 * System settings, containing miscellaneous system preferences. This
1589 * table holds simple name/value pairs. There are convenience
1590 * functions for accessing individual settings entries.
1591 */
1592 public static final class System extends NameValueTable {
1593 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_system_version";
1594
Svetoslav683914b2015-01-15 14:22:26 -08001595 /** @hide */
1596 public static interface Validator {
1597 public boolean validate(String value);
1598 }
1599
Dianne Hackborn139748f2012-09-24 11:36:57 -07001600 /**
1601 * The content:// style URL for this table
1602 */
1603 public static final Uri CONTENT_URI =
1604 Uri.parse("content://" + AUTHORITY + "/system");
1605
1606 private static final NameValueCache sNameValueCache = new NameValueCache(
1607 SYS_PROP_SETTING_VERSION,
1608 CONTENT_URI,
1609 CALL_METHOD_GET_SYSTEM,
1610 CALL_METHOD_PUT_SYSTEM);
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001611
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001612 private static final HashSet<String> MOVED_TO_SECURE;
1613 static {
1614 MOVED_TO_SECURE = new HashSet<String>(30);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001615 MOVED_TO_SECURE.add(Secure.ANDROID_ID);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001616 MOVED_TO_SECURE.add(Secure.HTTP_PROXY);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001617 MOVED_TO_SECURE.add(Secure.LOCATION_PROVIDERS_ALLOWED);
Danielle Millett925a7d82012-03-19 18:02:20 -04001618 MOVED_TO_SECURE.add(Secure.LOCK_BIOMETRIC_WEAK_FLAGS);
Amith Yamasani156c4352010-03-05 17:10:03 -08001619 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_ENABLED);
1620 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_VISIBLE);
1621 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001622 MOVED_TO_SECURE.add(Secure.LOGGING_ID);
1623 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_ENABLED);
1624 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_LAST_UPDATE);
1625 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_REDIRECT_URL);
1626 MOVED_TO_SECURE.add(Secure.SETTINGS_CLASSNAME);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001627 MOVED_TO_SECURE.add(Secure.USE_GOOGLE_MAIL);
1628 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
1629 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
1630 MOVED_TO_SECURE.add(Secure.WIFI_NUM_OPEN_NETWORKS_KEPT);
1631 MOVED_TO_SECURE.add(Secure.WIFI_ON);
1632 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE);
1633 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_AP_COUNT);
1634 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS);
1635 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED);
1636 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS);
1637 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT);
1638 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_MAX_AP_CHECKS);
1639 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ON);
1640 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_COUNT);
1641 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_DELAY_MS);
1642 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS);
Christopher Tateaa036a22014-05-19 16:33:27 -07001643
1644 // At one time in System, then Global, but now back in Secure
1645 MOVED_TO_SECURE.add(Secure.INSTALL_NON_MARKET_APPS);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001646 }
1647
Christopher Tate06efb532012-08-24 15:29:27 -07001648 private static final HashSet<String> MOVED_TO_GLOBAL;
Christopher Tate66488d62012-10-02 11:58:01 -07001649 private static final HashSet<String> MOVED_TO_SECURE_THEN_GLOBAL;
Christopher Tate06efb532012-08-24 15:29:27 -07001650 static {
1651 MOVED_TO_GLOBAL = new HashSet<String>();
Christopher Tate66488d62012-10-02 11:58:01 -07001652 MOVED_TO_SECURE_THEN_GLOBAL = new HashSet<String>();
1653
Christopher Tate92198742012-09-07 12:00:13 -07001654 // these were originally in system but migrated to secure in the past,
1655 // so are duplicated in the Secure.* namespace
Christopher Tate66488d62012-10-02 11:58:01 -07001656 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.ADB_ENABLED);
1657 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.BLUETOOTH_ON);
1658 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DATA_ROAMING);
1659 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DEVICE_PROVISIONED);
Christopher Tate66488d62012-10-02 11:58:01 -07001660 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.USB_MASS_STORAGE_ENABLED);
1661 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.HTTP_PROXY);
Christopher Tate06efb532012-08-24 15:29:27 -07001662
Christopher Tate92198742012-09-07 12:00:13 -07001663 // these are moving directly from system to global
Christopher Tate06efb532012-08-24 15:29:27 -07001664 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_ON);
1665 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_RADIOS);
1666 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS);
1667 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME);
1668 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME_ZONE);
1669 MOVED_TO_GLOBAL.add(Settings.Global.CAR_DOCK_SOUND);
1670 MOVED_TO_GLOBAL.add(Settings.Global.CAR_UNDOCK_SOUND);
1671 MOVED_TO_GLOBAL.add(Settings.Global.DESK_DOCK_SOUND);
1672 MOVED_TO_GLOBAL.add(Settings.Global.DESK_UNDOCK_SOUND);
1673 MOVED_TO_GLOBAL.add(Settings.Global.DOCK_SOUNDS_ENABLED);
1674 MOVED_TO_GLOBAL.add(Settings.Global.LOCK_SOUND);
1675 MOVED_TO_GLOBAL.add(Settings.Global.UNLOCK_SOUND);
1676 MOVED_TO_GLOBAL.add(Settings.Global.LOW_BATTERY_SOUND);
1677 MOVED_TO_GLOBAL.add(Settings.Global.POWER_SOUNDS_ENABLED);
1678 MOVED_TO_GLOBAL.add(Settings.Global.STAY_ON_WHILE_PLUGGED_IN);
1679 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SLEEP_POLICY);
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07001680 MOVED_TO_GLOBAL.add(Settings.Global.MODE_RINGER);
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001681 MOVED_TO_GLOBAL.add(Settings.Global.WINDOW_ANIMATION_SCALE);
1682 MOVED_TO_GLOBAL.add(Settings.Global.TRANSITION_ANIMATION_SCALE);
1683 MOVED_TO_GLOBAL.add(Settings.Global.ANIMATOR_DURATION_SCALE);
1684 MOVED_TO_GLOBAL.add(Settings.Global.FANCY_IME_ANIMATIONS);
1685 MOVED_TO_GLOBAL.add(Settings.Global.COMPATIBILITY_MODE);
1686 MOVED_TO_GLOBAL.add(Settings.Global.EMERGENCY_TONE);
1687 MOVED_TO_GLOBAL.add(Settings.Global.CALL_AUTO_RETRY);
1688 MOVED_TO_GLOBAL.add(Settings.Global.DEBUG_APP);
1689 MOVED_TO_GLOBAL.add(Settings.Global.WAIT_FOR_DEBUGGER);
1690 MOVED_TO_GLOBAL.add(Settings.Global.SHOW_PROCESSES);
1691 MOVED_TO_GLOBAL.add(Settings.Global.ALWAYS_FINISH_ACTIVITIES);
Geremy Condraa0735112013-03-26 21:49:26 -07001692 MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_CONTENT_URL);
1693 MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_METADATA_URL);
1694 MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_CONTENT_URL);
1695 MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_METADATA_URL);
1696 MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_CONTENT_URL);
1697 MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_METADATA_URL);
1698 MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_CONTENT_URL);
1699 MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_METADATA_URL);
Christopher Tate06efb532012-08-24 15:29:27 -07001700 }
1701
Svetoslav683914b2015-01-15 14:22:26 -08001702 private static final Validator sBooleanValidator =
1703 new DiscreteValueValidator(new String[] {"0", "1"});
1704
1705 private static final Validator sNonNegativeIntegerValidator = new Validator() {
1706 @Override
1707 public boolean validate(String value) {
1708 try {
1709 return Integer.parseInt(value) >= 0;
1710 } catch (NumberFormatException e) {
1711 return false;
1712 }
1713 }
1714 };
1715
Svetoslav683914b2015-01-15 14:22:26 -08001716 private static final Validator sUriValidator = new Validator() {
1717 @Override
1718 public boolean validate(String value) {
1719 try {
1720 Uri.decode(value);
1721 return true;
1722 } catch (IllegalArgumentException e) {
1723 return false;
1724 }
1725 }
1726 };
1727
1728 private static final Validator sLenientIpAddressValidator = new Validator() {
1729 private static final int MAX_IPV6_LENGTH = 45;
1730
1731 @Override
1732 public boolean validate(String value) {
1733 return value.length() <= MAX_IPV6_LENGTH;
1734 }
1735 };
1736
Christopher Tate66488d62012-10-02 11:58:01 -07001737 /** @hide */
Svetoslav683914b2015-01-15 14:22:26 -08001738 public static void getMovedToGlobalSettings(Set<String> outKeySet) {
Christopher Tate66488d62012-10-02 11:58:01 -07001739 outKeySet.addAll(MOVED_TO_GLOBAL);
1740 outKeySet.addAll(MOVED_TO_SECURE_THEN_GLOBAL);
1741 }
1742
1743 /** @hide */
Svetoslav683914b2015-01-15 14:22:26 -08001744 public static void getMovedToSecureSettings(Set<String> outKeySet) {
1745 outKeySet.addAll(MOVED_TO_SECURE);
1746 }
1747
1748 /** @hide */
Christopher Tate66488d62012-10-02 11:58:01 -07001749 public static void getNonLegacyMovedKeys(HashSet<String> outKeySet) {
1750 outKeySet.addAll(MOVED_TO_GLOBAL);
1751 }
1752
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001753 /**
1754 * Look up a name in the database.
1755 * @param resolver to access the database with
1756 * @param name to look up in the table
1757 * @return the corresponding value, or null if not present
1758 */
Dianne Hackborn139748f2012-09-24 11:36:57 -07001759 public static String getString(ContentResolver resolver, String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07001760 return getStringForUser(resolver, name, UserHandle.myUserId());
1761 }
1762
1763 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -07001764 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -07001765 int userHandle) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001766 if (MOVED_TO_SECURE.contains(name)) {
1767 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1768 + " to android.provider.Settings.Secure, returning read-only value.");
Christopher Tate06efb532012-08-24 15:29:27 -07001769 return Secure.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001770 }
Christopher Tate66488d62012-10-02 11:58:01 -07001771 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07001772 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1773 + " to android.provider.Settings.Global, returning read-only value.");
1774 return Global.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001775 }
Christopher Tate06efb532012-08-24 15:29:27 -07001776 return sNameValueCache.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001777 }
1778
1779 /**
1780 * Store a name/value pair into the database.
1781 * @param resolver to access the database with
1782 * @param name to store
1783 * @param value to associate with the name
1784 * @return true if the value was set, false on database errors
1785 */
1786 public static boolean putString(ContentResolver resolver, String name, String value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001787 return putStringForUser(resolver, name, value, UserHandle.myUserId());
1788 }
1789
1790 /** @hide */
1791 public static boolean putStringForUser(ContentResolver resolver, String name, String value,
1792 int userHandle) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001793 if (MOVED_TO_SECURE.contains(name)) {
1794 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1795 + " to android.provider.Settings.Secure, value is unchanged.");
1796 return false;
1797 }
Christopher Tate66488d62012-10-02 11:58:01 -07001798 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07001799 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1800 + " to android.provider.Settings.Global, value is unchanged.");
1801 return false;
1802 }
Christopher Tate06efb532012-08-24 15:29:27 -07001803 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001804 }
1805
1806 /**
1807 * Construct the content URI for a particular name/value pair,
1808 * useful for monitoring changes with a ContentObserver.
1809 * @param name to look up in the table
1810 * @return the corresponding content URI, or null if not present
1811 */
1812 public static Uri getUriFor(String name) {
1813 if (MOVED_TO_SECURE.contains(name)) {
1814 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1815 + " to android.provider.Settings.Secure, returning Secure URI.");
1816 return Secure.getUriFor(Secure.CONTENT_URI, name);
1817 }
Christopher Tate66488d62012-10-02 11:58:01 -07001818 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07001819 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1820 + " to android.provider.Settings.Global, returning read-only global URI.");
1821 return Global.getUriFor(Global.CONTENT_URI, name);
1822 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001823 return getUriFor(CONTENT_URI, name);
1824 }
1825
1826 /**
1827 * Convenience function for retrieving a single system settings value
1828 * as an integer. Note that internally setting values are always
1829 * stored as strings; this function converts the string to an integer
1830 * for you. The default value will be returned if the setting is
1831 * not defined or not an integer.
1832 *
1833 * @param cr The ContentResolver to access.
1834 * @param name The name of the setting to retrieve.
1835 * @param def Value to return if the setting is not defined.
1836 *
1837 * @return The setting's current value, or 'def' if it is not defined
1838 * or not a valid integer.
1839 */
1840 public static int getInt(ContentResolver cr, String name, int def) {
Christopher Tate06efb532012-08-24 15:29:27 -07001841 return getIntForUser(cr, name, def, UserHandle.myUserId());
1842 }
1843
1844 /** @hide */
1845 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
1846 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001847 try {
1848 return v != null ? Integer.parseInt(v) : def;
1849 } catch (NumberFormatException e) {
1850 return def;
1851 }
1852 }
1853
1854 /**
1855 * Convenience function for retrieving a single system settings value
1856 * as an integer. Note that internally setting values are always
1857 * stored as strings; this function converts the string to an integer
1858 * for you.
1859 * <p>
1860 * This version does not take a default value. If the setting has not
1861 * been set, or the string value is not a number,
1862 * it throws {@link SettingNotFoundException}.
1863 *
1864 * @param cr The ContentResolver to access.
1865 * @param name The name of the setting to retrieve.
1866 *
1867 * @throws SettingNotFoundException Thrown if a setting by the given
1868 * name can't be found or the setting value is not an integer.
1869 *
1870 * @return The setting's current value.
1871 */
1872 public static int getInt(ContentResolver cr, String name)
1873 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07001874 return getIntForUser(cr, name, UserHandle.myUserId());
1875 }
1876
1877 /** @hide */
1878 public static int getIntForUser(ContentResolver cr, String name, int userHandle)
1879 throws SettingNotFoundException {
1880 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001881 try {
1882 return Integer.parseInt(v);
1883 } catch (NumberFormatException e) {
1884 throw new SettingNotFoundException(name);
1885 }
1886 }
1887
1888 /**
1889 * Convenience function for updating a single settings value as an
1890 * integer. This will either create a new entry in the table if the
1891 * given name does not exist, or modify the value of the existing row
1892 * with that name. Note that internally setting values are always
1893 * stored as strings, so this function converts the given value to a
1894 * string before storing it.
1895 *
1896 * @param cr The ContentResolver to access.
1897 * @param name The name of the setting to modify.
1898 * @param value The new value for the setting.
1899 * @return true if the value was set, false on database errors
1900 */
1901 public static boolean putInt(ContentResolver cr, String name, int value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001902 return putIntForUser(cr, name, value, UserHandle.myUserId());
1903 }
1904
1905 /** @hide */
1906 public static boolean putIntForUser(ContentResolver cr, String name, int value,
1907 int userHandle) {
1908 return putStringForUser(cr, name, Integer.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001909 }
1910
1911 /**
1912 * Convenience function for retrieving a single system settings value
1913 * as a {@code long}. Note that internally setting values are always
1914 * stored as strings; this function converts the string to a {@code long}
1915 * for you. The default value will be returned if the setting is
1916 * not defined or not a {@code long}.
1917 *
1918 * @param cr The ContentResolver to access.
1919 * @param name The name of the setting to retrieve.
1920 * @param def Value to return if the setting is not defined.
1921 *
1922 * @return The setting's current value, or 'def' if it is not defined
1923 * or not a valid {@code long}.
1924 */
1925 public static long getLong(ContentResolver cr, String name, long def) {
Christopher Tate06efb532012-08-24 15:29:27 -07001926 return getLongForUser(cr, name, def, UserHandle.myUserId());
1927 }
1928
1929 /** @hide */
1930 public static long getLongForUser(ContentResolver cr, String name, long def,
1931 int userHandle) {
1932 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001933 long value;
1934 try {
1935 value = valString != null ? Long.parseLong(valString) : def;
1936 } catch (NumberFormatException e) {
1937 value = def;
1938 }
1939 return value;
1940 }
1941
1942 /**
1943 * Convenience function for retrieving a single system settings value
1944 * as a {@code long}. Note that internally setting values are always
1945 * stored as strings; this function converts the string to a {@code long}
1946 * for you.
1947 * <p>
1948 * This version does not take a default value. If the setting has not
1949 * been set, or the string value is not a number,
1950 * it throws {@link SettingNotFoundException}.
1951 *
1952 * @param cr The ContentResolver to access.
1953 * @param name The name of the setting to retrieve.
1954 *
1955 * @return The setting's current value.
1956 * @throws SettingNotFoundException Thrown if a setting by the given
1957 * name can't be found or the setting value is not an integer.
1958 */
1959 public static long getLong(ContentResolver cr, String name)
1960 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07001961 return getLongForUser(cr, name, UserHandle.myUserId());
1962 }
1963
1964 /** @hide */
1965 public static long getLongForUser(ContentResolver cr, String name, int userHandle)
1966 throws SettingNotFoundException {
1967 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001968 try {
1969 return Long.parseLong(valString);
1970 } catch (NumberFormatException e) {
1971 throw new SettingNotFoundException(name);
1972 }
1973 }
1974
1975 /**
1976 * Convenience function for updating a single settings value as a long
1977 * integer. This will either create a new entry in the table if the
1978 * given name does not exist, or modify the value of the existing row
1979 * with that name. Note that internally setting values are always
1980 * stored as strings, so this function converts the given value to a
1981 * string before storing it.
1982 *
1983 * @param cr The ContentResolver to access.
1984 * @param name The name of the setting to modify.
1985 * @param value The new value for the setting.
1986 * @return true if the value was set, false on database errors
1987 */
1988 public static boolean putLong(ContentResolver cr, String name, long value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001989 return putLongForUser(cr, name, value, UserHandle.myUserId());
1990 }
1991
1992 /** @hide */
1993 public static boolean putLongForUser(ContentResolver cr, String name, long value,
1994 int userHandle) {
1995 return putStringForUser(cr, name, Long.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001996 }
1997
1998 /**
1999 * Convenience function for retrieving a single system settings value
2000 * as a floating point number. Note that internally setting values are
2001 * always stored as strings; this function converts the string to an
2002 * float for you. The default value will be returned if the setting
2003 * is not defined or not a valid float.
2004 *
2005 * @param cr The ContentResolver to access.
2006 * @param name The name of the setting to retrieve.
2007 * @param def Value to return if the setting is not defined.
2008 *
2009 * @return The setting's current value, or 'def' if it is not defined
2010 * or not a valid float.
2011 */
2012 public static float getFloat(ContentResolver cr, String name, float def) {
Christopher Tate06efb532012-08-24 15:29:27 -07002013 return getFloatForUser(cr, name, def, UserHandle.myUserId());
2014 }
2015
2016 /** @hide */
2017 public static float getFloatForUser(ContentResolver cr, String name, float def,
2018 int userHandle) {
2019 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002020 try {
2021 return v != null ? Float.parseFloat(v) : def;
2022 } catch (NumberFormatException e) {
2023 return def;
2024 }
2025 }
2026
2027 /**
2028 * Convenience function for retrieving a single system settings value
2029 * as a float. Note that internally setting values are always
2030 * stored as strings; this function converts the string to a float
2031 * for you.
2032 * <p>
2033 * This version does not take a default value. If the setting has not
2034 * been set, or the string value is not a number,
2035 * it throws {@link SettingNotFoundException}.
2036 *
2037 * @param cr The ContentResolver to access.
2038 * @param name The name of the setting to retrieve.
2039 *
2040 * @throws SettingNotFoundException Thrown if a setting by the given
2041 * name can't be found or the setting value is not a float.
2042 *
2043 * @return The setting's current value.
2044 */
2045 public static float getFloat(ContentResolver cr, String name)
2046 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07002047 return getFloatForUser(cr, name, UserHandle.myUserId());
2048 }
2049
2050 /** @hide */
2051 public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
2052 throws SettingNotFoundException {
2053 String v = getStringForUser(cr, name, userHandle);
Brian Muramatsue1d46982010-12-06 17:34:20 -08002054 if (v == null) {
2055 throw new SettingNotFoundException(name);
2056 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002057 try {
2058 return Float.parseFloat(v);
2059 } catch (NumberFormatException e) {
2060 throw new SettingNotFoundException(name);
2061 }
2062 }
2063
2064 /**
2065 * Convenience function for updating a single settings value as a
2066 * floating point number. This will either create a new entry in the
2067 * table if the given name does not exist, or modify the value of the
2068 * existing row with that name. Note that internally setting values
2069 * are always stored as strings, so this function converts the given
2070 * value to a string before storing it.
2071 *
2072 * @param cr The ContentResolver to access.
2073 * @param name The name of the setting to modify.
2074 * @param value The new value for the setting.
2075 * @return true if the value was set, false on database errors
2076 */
2077 public static boolean putFloat(ContentResolver cr, String name, float value) {
Christopher Tate06efb532012-08-24 15:29:27 -07002078 return putFloatForUser(cr, name, value, UserHandle.myUserId());
2079 }
2080
2081 /** @hide */
2082 public static boolean putFloatForUser(ContentResolver cr, String name, float value,
2083 int userHandle) {
2084 return putStringForUser(cr, name, Float.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002085 }
2086
2087 /**
2088 * Convenience function to read all of the current
2089 * configuration-related settings into a
2090 * {@link Configuration} object.
2091 *
2092 * @param cr The ContentResolver to access.
2093 * @param outConfig Where to place the configuration settings.
2094 */
2095 public static void getConfiguration(ContentResolver cr, Configuration outConfig) {
Christopher Tate06efb532012-08-24 15:29:27 -07002096 getConfigurationForUser(cr, outConfig, UserHandle.myUserId());
2097 }
2098
2099 /** @hide */
2100 public static void getConfigurationForUser(ContentResolver cr, Configuration outConfig,
2101 int userHandle) {
2102 outConfig.fontScale = Settings.System.getFloatForUser(
2103 cr, FONT_SCALE, outConfig.fontScale, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002104 if (outConfig.fontScale < 0) {
2105 outConfig.fontScale = 1;
2106 }
Seigo Nonakabd5cbdd2016-01-25 19:40:28 +09002107 outConfig.setLocales(LocaleList.forLanguageTags(
2108 Settings.System.getStringForUser(cr, SYSTEM_LOCALES, userHandle)));
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002109 }
2110
2111 /**
Dianne Hackborn31ca8542011-07-19 14:58:28 -07002112 * @hide Erase the fields in the Configuration that should be applied
2113 * by the settings.
2114 */
2115 public static void clearConfiguration(Configuration inoutConfig) {
2116 inoutConfig.fontScale = 0;
Seigo Nonakad4031512016-03-17 21:18:53 +09002117 if (!inoutConfig.userSetLocale && !inoutConfig.getLocales().isEmpty()) {
Seigo Nonakabd5cbdd2016-01-25 19:40:28 +09002118 inoutConfig.setLocales(LocaleList.getEmptyLocaleList());
2119 }
Dianne Hackborn31ca8542011-07-19 14:58:28 -07002120 }
Narayan Kamath6d632962011-08-24 11:51:37 +01002121
Dianne Hackborn31ca8542011-07-19 14:58:28 -07002122 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002123 * Convenience function to write a batch of configuration-related
2124 * settings from a {@link Configuration} object.
2125 *
2126 * @param cr The ContentResolver to access.
2127 * @param config The settings to write.
2128 * @return true if the values were set, false on database errors
2129 */
2130 public static boolean putConfiguration(ContentResolver cr, Configuration config) {
Christopher Tate06efb532012-08-24 15:29:27 -07002131 return putConfigurationForUser(cr, config, UserHandle.myUserId());
2132 }
2133
2134 /** @hide */
2135 public static boolean putConfigurationForUser(ContentResolver cr, Configuration config,
2136 int userHandle) {
Seigo Nonakabd5cbdd2016-01-25 19:40:28 +09002137 return Settings.System.putFloatForUser(cr, FONT_SCALE, config.fontScale, userHandle) &&
2138 Settings.System.putStringForUser(
2139 cr, SYSTEM_LOCALES, config.getLocales().toLanguageTags(), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002140 }
2141
Dianne Hackbornb8b11a02010-03-10 15:53:11 -08002142 /** @hide */
2143 public static boolean hasInterestingConfigurationChanges(int changes) {
Seigo Nonakabd5cbdd2016-01-25 19:40:28 +09002144 return (changes & ActivityInfo.CONFIG_FONT_SCALE) != 0 ||
2145 (changes & ActivityInfo.CONFIG_LOCALE) != 0;
Dianne Hackbornb8b11a02010-03-10 15:53:11 -08002146 }
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07002147
Christopher Tate06efb532012-08-24 15:29:27 -07002148 /** @deprecated - Do not use */
2149 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002150 public static boolean getShowGTalkServiceStatus(ContentResolver cr) {
Christopher Tate06efb532012-08-24 15:29:27 -07002151 return getShowGTalkServiceStatusForUser(cr, UserHandle.myUserId());
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002152 }
2153
Christopher Tate06efb532012-08-24 15:29:27 -07002154 /**
2155 * @hide
2156 * @deprecated - Do not use
2157 */
2158 public static boolean getShowGTalkServiceStatusForUser(ContentResolver cr,
2159 int userHandle) {
2160 return getIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, 0, userHandle) != 0;
2161 }
2162
2163 /** @deprecated - Do not use */
2164 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002165 public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag) {
Christopher Tatec8c08382012-09-19 17:18:18 -07002166 setShowGTalkServiceStatusForUser(cr, flag, UserHandle.myUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07002167 }
2168
2169 /**
2170 * @hide
2171 * @deprecated - Do not use
2172 */
2173 @Deprecated
2174 public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean flag,
2175 int userHandle) {
2176 putIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, flag ? 1 : 0, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002177 }
2178
Svetoslav683914b2015-01-15 14:22:26 -08002179 private static final class DiscreteValueValidator implements Validator {
2180 private final String[] mValues;
2181
2182 public DiscreteValueValidator(String[] values) {
2183 mValues = values;
2184 }
2185
Svetoslav1b71ea92015-02-17 18:20:29 -08002186 @Override
Svetoslav683914b2015-01-15 14:22:26 -08002187 public boolean validate(String value) {
2188 return ArrayUtils.contains(mValues, value);
2189 }
2190 }
2191
2192 private static final class InclusiveIntegerRangeValidator implements Validator {
2193 private final int mMin;
2194 private final int mMax;
2195
2196 public InclusiveIntegerRangeValidator(int min, int max) {
2197 mMin = min;
2198 mMax = max;
2199 }
2200
Svetoslav1b71ea92015-02-17 18:20:29 -08002201 @Override
Svetoslav683914b2015-01-15 14:22:26 -08002202 public boolean validate(String value) {
2203 try {
2204 final int intValue = Integer.parseInt(value);
2205 return intValue >= mMin && intValue <= mMax;
2206 } catch (NumberFormatException e) {
2207 return false;
2208 }
2209 }
2210 }
2211
2212 private static final class InclusiveFloatRangeValidator implements Validator {
2213 private final float mMin;
2214 private final float mMax;
2215
2216 public InclusiveFloatRangeValidator(float min, float max) {
2217 mMin = min;
2218 mMax = max;
2219 }
2220
Svetoslav1b71ea92015-02-17 18:20:29 -08002221 @Override
Svetoslav683914b2015-01-15 14:22:26 -08002222 public boolean validate(String value) {
2223 try {
2224 final float floatValue = Float.parseFloat(value);
2225 return floatValue >= mMin && floatValue <= mMax;
2226 } catch (NumberFormatException e) {
2227 return false;
2228 }
2229 }
2230 }
2231
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002232 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002233 * @deprecated Use {@link android.provider.Settings.Global#STAY_ON_WHILE_PLUGGED_IN} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002234 */
Christopher Tate06efb532012-08-24 15:29:27 -07002235 @Deprecated
2236 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 -08002237
2238 /**
2239 * What happens when the user presses the end call button if they're not
2240 * on a call.<br/>
2241 * <b>Values:</b><br/>
2242 * 0 - The end button does nothing.<br/>
2243 * 1 - The end button goes to the home screen.<br/>
2244 * 2 - The end button puts the device to sleep and locks the keyguard.<br/>
2245 * 3 - The end button goes to the home screen. If the user is already on the
2246 * home screen, it puts the device to sleep.
2247 */
2248 public static final String END_BUTTON_BEHAVIOR = "end_button_behavior";
2249
Svetoslav683914b2015-01-15 14:22:26 -08002250 private static final Validator END_BUTTON_BEHAVIOR_VALIDATOR =
2251 new InclusiveIntegerRangeValidator(0, 3);
2252
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002253 /**
David Brown458e8062010-03-08 21:52:11 -08002254 * END_BUTTON_BEHAVIOR value for "go home".
2255 * @hide
2256 */
2257 public static final int END_BUTTON_BEHAVIOR_HOME = 0x1;
2258
2259 /**
2260 * END_BUTTON_BEHAVIOR value for "go to sleep".
2261 * @hide
2262 */
2263 public static final int END_BUTTON_BEHAVIOR_SLEEP = 0x2;
2264
2265 /**
2266 * END_BUTTON_BEHAVIOR default value.
2267 * @hide
2268 */
2269 public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_SLEEP;
2270
2271 /**
Joe Onorato9cdffa12011-04-06 18:27:27 -07002272 * Is advanced settings mode turned on. 0 == no, 1 == yes
2273 * @hide
2274 */
2275 public static final String ADVANCED_SETTINGS = "advanced_settings";
2276
Svetoslav683914b2015-01-15 14:22:26 -08002277 private static final Validator ADVANCED_SETTINGS_VALIDATOR = sBooleanValidator;
2278
Joe Onorato9cdffa12011-04-06 18:27:27 -07002279 /**
2280 * ADVANCED_SETTINGS default value.
2281 * @hide
2282 */
2283 public static final int ADVANCED_SETTINGS_DEFAULT = 0;
2284
2285 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002286 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002287 */
Christopher Tate06efb532012-08-24 15:29:27 -07002288 @Deprecated
2289 public static final String AIRPLANE_MODE_ON = Global.AIRPLANE_MODE_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002290
2291 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002292 * @deprecated Use {@link android.provider.Settings.Global#RADIO_BLUETOOTH} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002293 */
Christopher Tate06efb532012-08-24 15:29:27 -07002294 @Deprecated
2295 public static final String RADIO_BLUETOOTH = Global.RADIO_BLUETOOTH;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002296
2297 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002298 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIFI} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002299 */
Christopher Tate06efb532012-08-24 15:29:27 -07002300 @Deprecated
2301 public static final String RADIO_WIFI = Global.RADIO_WIFI;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002302
Robert Greenwalt8588e472011-11-08 10:12:25 -08002303 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002304 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIMAX} instead
Robert Greenwalt8588e472011-11-08 10:12:25 -08002305 * {@hide}
2306 */
Christopher Tate06efb532012-08-24 15:29:27 -07002307 @Deprecated
2308 public static final String RADIO_WIMAX = Global.RADIO_WIMAX;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002309
2310 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002311 * @deprecated Use {@link android.provider.Settings.Global#RADIO_CELL} instead
Nick Pelly8d32a012011-08-09 07:03:49 -07002312 */
Christopher Tate06efb532012-08-24 15:29:27 -07002313 @Deprecated
2314 public static final String RADIO_CELL = Global.RADIO_CELL;
Nick Pelly8d32a012011-08-09 07:03:49 -07002315
2316 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002317 * @deprecated Use {@link android.provider.Settings.Global#RADIO_NFC} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002318 */
Christopher Tate06efb532012-08-24 15:29:27 -07002319 @Deprecated
2320 public static final String RADIO_NFC = Global.RADIO_NFC;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002321
2322 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002323 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_RADIOS} instead
2324 */
2325 @Deprecated
2326 public static final String AIRPLANE_MODE_RADIOS = Global.AIRPLANE_MODE_RADIOS;
2327
2328 /**
2329 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_TOGGLEABLE_RADIOS} instead
Mike Lockwoodbd5ddf02009-07-29 21:37:14 -07002330 *
2331 * {@hide}
2332 */
Christopher Tate06efb532012-08-24 15:29:27 -07002333 @Deprecated
2334 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS =
2335 Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS;
Mike Lockwoodbd5ddf02009-07-29 21:37:14 -07002336
2337 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002338 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002339 */
Christopher Tate06efb532012-08-24 15:29:27 -07002340 @Deprecated
2341 public static final String WIFI_SLEEP_POLICY = Global.WIFI_SLEEP_POLICY;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002342
2343 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002344 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_DEFAULT} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002345 */
Christopher Tate06efb532012-08-24 15:29:27 -07002346 @Deprecated
2347 public static final int WIFI_SLEEP_POLICY_DEFAULT = Global.WIFI_SLEEP_POLICY_DEFAULT;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002348
2349 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002350 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002351 */
Christopher Tate06efb532012-08-24 15:29:27 -07002352 @Deprecated
2353 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED =
2354 Global.WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002355
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002356 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002357 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002358 */
Christopher Tate06efb532012-08-24 15:29:27 -07002359 @Deprecated
2360 public static final int WIFI_SLEEP_POLICY_NEVER = Global.WIFI_SLEEP_POLICY_NEVER;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002361
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07002362 /**
2363 * @deprecated Use {@link android.provider.Settings.Global#MODE_RINGER} instead
2364 */
2365 @Deprecated
2366 public static final String MODE_RINGER = Global.MODE_RINGER;
2367
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002368 /**
2369 * Whether to use static IP and other static network attributes.
2370 * <p>
2371 * Set to 1 for true and 0 for false.
Jeff Sharkey625239a2012-09-26 22:03:49 -07002372 *
2373 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002374 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002375 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002376 public static final String WIFI_USE_STATIC_IP = "wifi_use_static_ip";
2377
Svetoslav683914b2015-01-15 14:22:26 -08002378 private static final Validator WIFI_USE_STATIC_IP_VALIDATOR = sBooleanValidator;
2379
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002380 /**
2381 * The static IP address.
2382 * <p>
2383 * Example: "192.168.1.51"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002384 *
2385 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002386 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002387 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002388 public static final String WIFI_STATIC_IP = "wifi_static_ip";
2389
Svetoslav683914b2015-01-15 14:22:26 -08002390 private static final Validator WIFI_STATIC_IP_VALIDATOR = sLenientIpAddressValidator;
2391
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002392 /**
2393 * If using static IP, the gateway's IP address.
2394 * <p>
2395 * Example: "192.168.1.1"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002396 *
2397 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002398 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002399 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002400 public static final String WIFI_STATIC_GATEWAY = "wifi_static_gateway";
2401
Svetoslav683914b2015-01-15 14:22:26 -08002402 private static final Validator WIFI_STATIC_GATEWAY_VALIDATOR = sLenientIpAddressValidator;
2403
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002404 /**
2405 * If using static IP, the net mask.
2406 * <p>
2407 * Example: "255.255.255.0"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002408 *
2409 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002410 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002411 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002412 public static final String WIFI_STATIC_NETMASK = "wifi_static_netmask";
2413
Svetoslav683914b2015-01-15 14:22:26 -08002414 private static final Validator WIFI_STATIC_NETMASK_VALIDATOR = sLenientIpAddressValidator;
2415
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002416 /**
2417 * If using static IP, the primary DNS's IP address.
2418 * <p>
2419 * Example: "192.168.1.1"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002420 *
2421 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002422 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002423 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002424 public static final String WIFI_STATIC_DNS1 = "wifi_static_dns1";
2425
Svetoslav683914b2015-01-15 14:22:26 -08002426 private static final Validator WIFI_STATIC_DNS1_VALIDATOR = sLenientIpAddressValidator;
2427
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002428 /**
2429 * If using static IP, the secondary DNS's IP address.
2430 * <p>
2431 * Example: "192.168.1.2"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002432 *
2433 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002434 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002435 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002436 public static final String WIFI_STATIC_DNS2 = "wifi_static_dns2";
2437
Svetoslav683914b2015-01-15 14:22:26 -08002438 private static final Validator WIFI_STATIC_DNS2_VALIDATOR = sLenientIpAddressValidator;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002439
2440 /**
2441 * Determines whether remote devices may discover and/or connect to
2442 * this device.
2443 * <P>Type: INT</P>
2444 * 2 -- discoverable and connectable
2445 * 1 -- connectable but not discoverable
2446 * 0 -- neither connectable nor discoverable
2447 */
2448 public static final String BLUETOOTH_DISCOVERABILITY =
2449 "bluetooth_discoverability";
2450
Svetoslav683914b2015-01-15 14:22:26 -08002451 private static final Validator BLUETOOTH_DISCOVERABILITY_VALIDATOR =
2452 new InclusiveIntegerRangeValidator(0, 2);
2453
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002454 /**
2455 * Bluetooth discoverability timeout. If this value is nonzero, then
2456 * Bluetooth becomes discoverable for a certain number of seconds,
2457 * after which is becomes simply connectable. The value is in seconds.
2458 */
2459 public static final String BLUETOOTH_DISCOVERABILITY_TIMEOUT =
2460 "bluetooth_discoverability_timeout";
2461
Svetoslav683914b2015-01-15 14:22:26 -08002462 private static final Validator BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR =
2463 sNonNegativeIntegerValidator;
2464
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002465 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08002466 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_ENABLED}
2467 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002468 */
Amith Yamasani156c4352010-03-05 17:10:03 -08002469 @Deprecated
2470 public static final String LOCK_PATTERN_ENABLED = Secure.LOCK_PATTERN_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002471
2472 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08002473 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_VISIBLE}
2474 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002475 */
Amith Yamasani156c4352010-03-05 17:10:03 -08002476 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002477 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
2478
2479 /**
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07002480 * @deprecated Use
Amith Yamasani156c4352010-03-05 17:10:03 -08002481 * {@link android.provider.Settings.Secure#LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED}
2482 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002483 */
Amith Yamasani156c4352010-03-05 17:10:03 -08002484 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002485 public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED =
2486 "lock_pattern_tactile_feedback_enabled";
2487
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002488 /**
2489 * A formatted string of the next alarm that is set, or the empty string
2490 * if there is no alarm set.
Adrian Roosc42a1e12014-07-07 23:35:53 +02002491 *
2492 * @deprecated Use {@link android.app.AlarmManager#getNextAlarmClock()}.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002493 */
Adrian Roosc42a1e12014-07-07 23:35:53 +02002494 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002495 public static final String NEXT_ALARM_FORMATTED = "next_alarm_formatted";
2496
Svetoslav683914b2015-01-15 14:22:26 -08002497 private static final Validator NEXT_ALARM_FORMATTED_VALIDATOR = new Validator() {
2498 private static final int MAX_LENGTH = 1000;
Svetoslav1b71ea92015-02-17 18:20:29 -08002499
Svetoslav683914b2015-01-15 14:22:26 -08002500 @Override
2501 public boolean validate(String value) {
2502 // TODO: No idea what the correct format is.
Svetoslav64d6e9c2015-02-12 11:30:36 -08002503 return value == null || value.length() < MAX_LENGTH;
Svetoslav683914b2015-01-15 14:22:26 -08002504 }
2505 };
2506
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002507 /**
2508 * Scaling factor for fonts, float.
2509 */
2510 public static final String FONT_SCALE = "font_scale";
2511
Svetoslav683914b2015-01-15 14:22:26 -08002512 private static final Validator FONT_SCALE_VALIDATOR = new Validator() {
2513 @Override
2514 public boolean validate(String value) {
2515 try {
2516 return Float.parseFloat(value) >= 0;
2517 } catch (NumberFormatException e) {
2518 return false;
2519 }
2520 }
2521 };
2522
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002523 /**
Seigo Nonakabd5cbdd2016-01-25 19:40:28 +09002524 * The serialized system locale value.
2525 *
2526 * Do not use this value directory.
2527 * To get system locale, use {@link android.util.LocaleList#getDefault} instead.
2528 * To update system locale, use {@link com.android.internal.app.LocalePicker#updateLocales}
2529 * instead.
2530 * @hide
2531 */
2532 public static final String SYSTEM_LOCALES = "system_locales";
2533
2534
2535 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002536 * Name of an application package to be debugged.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002537 *
2538 * @deprecated Use {@link Global#DEBUG_APP} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002539 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002540 @Deprecated
2541 public static final String DEBUG_APP = Global.DEBUG_APP;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002542
2543 /**
2544 * If 1, when launching DEBUG_APP it will wait for the debugger before
2545 * starting user code. If 0, it will run normally.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002546 *
2547 * @deprecated Use {@link Global#WAIT_FOR_DEBUGGER} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002548 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002549 @Deprecated
2550 public static final String WAIT_FOR_DEBUGGER = Global.WAIT_FOR_DEBUGGER;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002551
2552 /**
2553 * Whether or not to dim the screen. 0=no 1=yes
Jeff Brown96307042012-07-27 15:51:34 -07002554 * @deprecated This setting is no longer used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002555 */
Jeff Brown96307042012-07-27 15:51:34 -07002556 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002557 public static final String DIM_SCREEN = "dim_screen";
2558
Svetoslav683914b2015-01-15 14:22:26 -08002559 private static final Validator DIM_SCREEN_VALIDATOR = sBooleanValidator;
2560
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002561 /**
Jeff Brown05af6ad2014-09-30 20:54:30 -07002562 * The amount of time in milliseconds before the device goes to sleep or begins
2563 * to dream after a period of inactivity. This value is also known as the
2564 * user activity timeout period since the screen isn't necessarily turned off
2565 * when it expires.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002566 */
2567 public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout";
2568
Svetoslav683914b2015-01-15 14:22:26 -08002569 private static final Validator SCREEN_OFF_TIMEOUT_VALIDATOR = sNonNegativeIntegerValidator;
2570
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002571 /**
2572 * The screen backlight brightness between 0 and 255.
2573 */
2574 public static final String SCREEN_BRIGHTNESS = "screen_brightness";
2575
Svetoslav683914b2015-01-15 14:22:26 -08002576 private static final Validator SCREEN_BRIGHTNESS_VALIDATOR =
2577 new InclusiveIntegerRangeValidator(0, 255);
2578
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002579 /**
Dan Murphy951764b2009-08-27 14:59:03 -05002580 * Control whether to enable automatic brightness mode.
Dan Murphy951764b2009-08-27 14:59:03 -05002581 */
2582 public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode";
2583
Svetoslav683914b2015-01-15 14:22:26 -08002584 private static final Validator SCREEN_BRIGHTNESS_MODE_VALIDATOR = sBooleanValidator;
2585
Dan Murphy951764b2009-08-27 14:59:03 -05002586 /**
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08002587 * Adjustment to auto-brightness to make it generally more (>0.0 <1.0)
2588 * or less (<0.0 >-1.0) bright.
Dianne Hackborn518a3d82012-05-09 16:30:49 -07002589 * @hide
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08002590 */
2591 public static final String SCREEN_AUTO_BRIGHTNESS_ADJ = "screen_auto_brightness_adj";
2592
Svetoslav683914b2015-01-15 14:22:26 -08002593 private static final Validator SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR =
2594 new InclusiveFloatRangeValidator(-1, 1);
2595
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08002596 /**
Mike Lockwooddc3494e2009-10-14 21:17:09 -07002597 * SCREEN_BRIGHTNESS_MODE value for manual mode.
Mike Lockwooddc3494e2009-10-14 21:17:09 -07002598 */
2599 public static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0;
2600
2601 /**
Scott Main52bfc242012-02-09 10:09:14 -08002602 * SCREEN_BRIGHTNESS_MODE value for automatic mode.
Mike Lockwooddc3494e2009-10-14 21:17:09 -07002603 */
2604 public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1;
2605
2606 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002607 * Control whether the process CPU usage meter should be shown.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002608 *
2609 * @deprecated Use {@link Global#SHOW_PROCESSES} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002610 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002611 @Deprecated
2612 public static final String SHOW_PROCESSES = Global.SHOW_PROCESSES;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002613
2614 /**
2615 * If 1, the activity manager will aggressively finish activities and
2616 * processes as soon as they are no longer needed. If 0, the normal
2617 * extended lifetime is used.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002618 *
2619 * @deprecated Use {@link Global#ALWAYS_FINISH_ACTIVITIES} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002620 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002621 @Deprecated
2622 public static final String ALWAYS_FINISH_ACTIVITIES = Global.ALWAYS_FINISH_ACTIVITIES;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002623
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002624 /**
2625 * Determines which streams are affected by ringer mode changes. The
2626 * stream type's bit should be set to 1 if it should be muted when going
2627 * into an inaudible ringer mode.
2628 */
2629 public static final String MODE_RINGER_STREAMS_AFFECTED = "mode_ringer_streams_affected";
2630
Svetoslav683914b2015-01-15 14:22:26 -08002631 private static final Validator MODE_RINGER_STREAMS_AFFECTED_VALIDATOR =
2632 sNonNegativeIntegerValidator;
2633
2634 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002635 * Determines which streams are affected by mute. The
2636 * stream type's bit should be set to 1 if it should be muted when a mute request
2637 * is received.
2638 */
Svetoslav683914b2015-01-15 14:22:26 -08002639 public static final String MUTE_STREAMS_AFFECTED = "mute_streams_affected";
2640
2641 private static final Validator MUTE_STREAMS_AFFECTED_VALIDATOR =
2642 sNonNegativeIntegerValidator;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002643
2644 /**
2645 * Whether vibrate is on for different events. This is used internally,
2646 * changing this value will not change the vibrate. See AudioManager.
2647 */
2648 public static final String VIBRATE_ON = "vibrate_on";
2649
Svetoslav683914b2015-01-15 14:22:26 -08002650 private static final Validator VIBRATE_ON_VALIDATOR = sBooleanValidator;
2651
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002652 /**
Jeff Brown7f6c2312012-04-13 20:38:38 -07002653 * If 1, redirects the system vibrator to all currently attached input devices
2654 * that support vibration. If there are no such input devices, then the system
2655 * vibrator is used instead.
2656 * If 0, does not register the system vibrator.
2657 *
2658 * This setting is mainly intended to provide a compatibility mechanism for
2659 * applications that only know about the system vibrator and do not use the
2660 * input device vibrator API.
2661 *
2662 * @hide
2663 */
2664 public static final String VIBRATE_INPUT_DEVICES = "vibrate_input_devices";
2665
Svetoslav683914b2015-01-15 14:22:26 -08002666 private static final Validator VIBRATE_INPUT_DEVICES_VALIDATOR = sBooleanValidator;
2667
Jeff Brown7f6c2312012-04-13 20:38:38 -07002668 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002669 * Ringer volume. This is used internally, changing this value will not
2670 * change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002671 *
2672 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002673 */
2674 public static final String VOLUME_RING = "volume_ring";
2675
2676 /**
2677 * System/notifications volume. This is used internally, changing this
2678 * value will not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002679 *
2680 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002681 */
2682 public static final String VOLUME_SYSTEM = "volume_system";
2683
2684 /**
2685 * Voice call volume. This is used internally, changing this value will
2686 * not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002687 *
2688 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002689 */
2690 public static final String VOLUME_VOICE = "volume_voice";
2691
2692 /**
2693 * Music/media/gaming volume. This is used internally, changing this
2694 * value will not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002695 *
2696 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002697 */
2698 public static final String VOLUME_MUSIC = "volume_music";
2699
2700 /**
2701 * Alarm volume. This is used internally, changing this
2702 * value will not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002703 *
2704 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002705 */
2706 public static final String VOLUME_ALARM = "volume_alarm";
2707
2708 /**
2709 * Notification volume. This is used internally, changing this
2710 * value will not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002711 *
2712 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002713 */
2714 public static final String VOLUME_NOTIFICATION = "volume_notification";
2715
2716 /**
Eric Laurent484d2882009-12-08 09:05:45 -08002717 * Bluetooth Headset volume. This is used internally, changing this value will
2718 * not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002719 *
2720 * @removed Not used by anything since API 2.
Eric Laurent484d2882009-12-08 09:05:45 -08002721 */
2722 public static final String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco";
2723
2724 /**
Mike Lockwood8517e462011-10-25 14:47:19 -04002725 * Master volume (float in the range 0.0f to 1.0f).
Svetoslavdbbeeb32015-02-18 19:16:25 -08002726 *
Mike Lockwood8517e462011-10-25 14:47:19 -04002727 * @hide
2728 */
2729 public static final String VOLUME_MASTER = "volume_master";
2730
2731 /**
Andy Hungf04b84d2015-12-18 17:33:27 -08002732 * Master mono (int 1 = mono, 0 = normal).
2733 *
2734 * @hide
2735 */
2736 public static final String MASTER_MONO = "master_mono";
2737
2738 private static final Validator MASTER_MONO_VALIDATOR = sBooleanValidator;
2739
2740 /**
Justin Koh57978ed2012-04-03 17:37:58 -07002741 * Whether the notifications should use the ring volume (value of 1) or
2742 * a separate notification volume (value of 0). In most cases, users
2743 * will have this enabled so the notification and ringer volumes will be
2744 * the same. However, power users can disable this and use the separate
2745 * notification volume control.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002746 * <p>
Justin Koh57978ed2012-04-03 17:37:58 -07002747 * Note: This is a one-off setting that will be removed in the future
2748 * when there is profile support. For this reason, it is kept hidden
2749 * from the public APIs.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002750 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002751 * @hide
Amith Yamasani42722bf2011-07-22 10:34:27 -07002752 * @deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002753 */
Gilles Debunnee90bed12011-08-30 14:28:27 -07002754 @Deprecated
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002755 public static final String NOTIFICATIONS_USE_RING_VOLUME =
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002756 "notifications_use_ring_volume";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002757
Svetoslav683914b2015-01-15 14:22:26 -08002758 private static final Validator NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR = sBooleanValidator;
2759
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002760 /**
Daniel Sandler6329bf72010-02-26 15:17:44 -05002761 * Whether silent mode should allow vibration feedback. This is used
2762 * internally in AudioService and the Sound settings activity to
2763 * coordinate decoupling of vibrate and silent modes. This setting
2764 * will likely be removed in a future release with support for
2765 * audio/vibe feedback profiles.
2766 *
Eric Laurentbffc3d12012-05-07 17:43:49 -07002767 * Not used anymore. On devices with vibrator, the user explicitly selects
2768 * silent or vibrate mode.
2769 * Kept for use by legacy database upgrade code in DatabaseHelper.
Daniel Sandler6329bf72010-02-26 15:17:44 -05002770 * @hide
2771 */
2772 public static final String VIBRATE_IN_SILENT = "vibrate_in_silent";
2773
Svetoslav683914b2015-01-15 14:22:26 -08002774 private static final Validator VIBRATE_IN_SILENT_VALIDATOR = sBooleanValidator;
2775
Daniel Sandler6329bf72010-02-26 15:17:44 -05002776 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002777 * The mapping of stream type (integer) to its setting.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002778 *
2779 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002780 */
2781 public static final String[] VOLUME_SETTINGS = {
2782 VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC,
Eric Laurent484d2882009-12-08 09:05:45 -08002783 VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002784 };
2785
2786 /**
2787 * Appended to various volume related settings to record the previous
2788 * values before they the settings were affected by a silent/vibrate
2789 * ringer mode change.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002790 *
2791 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002792 */
2793 public static final String APPEND_FOR_LAST_AUDIBLE = "_last_audible";
2794
2795 /**
2796 * Persistent store for the system-wide default ringtone URI.
2797 * <p>
2798 * If you need to play the default ringtone at any given time, it is recommended
2799 * you give {@link #DEFAULT_RINGTONE_URI} to the media player. It will resolve
2800 * to the set default ringtone at the time of playing.
2801 *
2802 * @see #DEFAULT_RINGTONE_URI
2803 */
2804 public static final String RINGTONE = "ringtone";
2805
Svetoslav683914b2015-01-15 14:22:26 -08002806 private static final Validator RINGTONE_VALIDATOR = sUriValidator;
2807
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002808 /**
2809 * A {@link Uri} that will point to the current default ringtone at any
2810 * given time.
2811 * <p>
2812 * If the current default ringtone is in the DRM provider and the caller
2813 * does not have permission, the exception will be a
2814 * FileNotFoundException.
2815 */
2816 public static final Uri DEFAULT_RINGTONE_URI = getUriFor(RINGTONE);
2817
Jeff Sharkey413573a2016-02-22 17:52:45 -07002818 /** {@hide} */
2819 public static final String RINGTONE_CACHE = "ringtone_cache";
2820 /** {@hide} */
2821 public static final Uri RINGTONE_CACHE_URI = getUriFor(RINGTONE_CACHE);
2822
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002823 /**
2824 * Persistent store for the system-wide default notification sound.
2825 *
2826 * @see #RINGTONE
2827 * @see #DEFAULT_NOTIFICATION_URI
2828 */
2829 public static final String NOTIFICATION_SOUND = "notification_sound";
2830
Svetoslav683914b2015-01-15 14:22:26 -08002831 private static final Validator NOTIFICATION_SOUND_VALIDATOR = sUriValidator;
2832
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002833 /**
2834 * A {@link Uri} that will point to the current default notification
2835 * sound at any given time.
2836 *
2837 * @see #DEFAULT_RINGTONE_URI
2838 */
2839 public static final Uri DEFAULT_NOTIFICATION_URI = getUriFor(NOTIFICATION_SOUND);
2840
Jeff Sharkey413573a2016-02-22 17:52:45 -07002841 /** {@hide} */
2842 public static final String NOTIFICATION_SOUND_CACHE = "notification_sound_cache";
2843 /** {@hide} */
2844 public static final Uri NOTIFICATION_SOUND_CACHE_URI = getUriFor(NOTIFICATION_SOUND_CACHE);
2845
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002846 /**
Patrick Scott3156bb002009-04-13 09:57:38 -07002847 * Persistent store for the system-wide default alarm alert.
2848 *
2849 * @see #RINGTONE
2850 * @see #DEFAULT_ALARM_ALERT_URI
2851 */
2852 public static final String ALARM_ALERT = "alarm_alert";
2853
Svetoslav683914b2015-01-15 14:22:26 -08002854 private static final Validator ALARM_ALERT_VALIDATOR = sUriValidator;
2855
Patrick Scott3156bb002009-04-13 09:57:38 -07002856 /**
2857 * A {@link Uri} that will point to the current default alarm alert at
2858 * any given time.
2859 *
2860 * @see #DEFAULT_ALARM_ALERT_URI
2861 */
2862 public static final Uri DEFAULT_ALARM_ALERT_URI = getUriFor(ALARM_ALERT);
2863
Jeff Sharkey413573a2016-02-22 17:52:45 -07002864 /** {@hide} */
2865 public static final String ALARM_ALERT_CACHE = "alarm_alert_cache";
2866 /** {@hide} */
2867 public static final Uri ALARM_ALERT_CACHE_URI = getUriFor(ALARM_ALERT_CACHE);
2868
Patrick Scott3156bb002009-04-13 09:57:38 -07002869 /**
Jean-Michel Trivid589fea2011-04-15 11:28:10 -07002870 * Persistent store for the system default media button event receiver.
2871 *
2872 * @hide
2873 */
2874 public static final String MEDIA_BUTTON_RECEIVER = "media_button_receiver";
2875
Svetoslav683914b2015-01-15 14:22:26 -08002876 private static final Validator MEDIA_BUTTON_RECEIVER_VALIDATOR = new Validator() {
2877 @Override
2878 public boolean validate(String value) {
2879 try {
2880 ComponentName.unflattenFromString(value);
2881 return true;
2882 } catch (NullPointerException e) {
2883 return false;
2884 }
2885 }
2886 };
2887
Jean-Michel Trivid589fea2011-04-15 11:28:10 -07002888 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002889 * Setting to enable Auto Replace (AutoText) in text editors. 1 = On, 0 = Off
2890 */
2891 public static final String TEXT_AUTO_REPLACE = "auto_replace";
2892
Svetoslav683914b2015-01-15 14:22:26 -08002893 private static final Validator TEXT_AUTO_REPLACE_VALIDATOR = sBooleanValidator;
2894
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002895 /**
2896 * Setting to enable Auto Caps in text editors. 1 = On, 0 = Off
2897 */
2898 public static final String TEXT_AUTO_CAPS = "auto_caps";
2899
Svetoslav683914b2015-01-15 14:22:26 -08002900 private static final Validator TEXT_AUTO_CAPS_VALIDATOR = sBooleanValidator;
2901
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002902 /**
2903 * Setting to enable Auto Punctuate in text editors. 1 = On, 0 = Off. This
2904 * feature converts two spaces to a "." and space.
2905 */
2906 public static final String TEXT_AUTO_PUNCTUATE = "auto_punctuate";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002907
Svetoslav683914b2015-01-15 14:22:26 -08002908 private static final Validator TEXT_AUTO_PUNCTUATE_VALIDATOR = sBooleanValidator;
2909
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002910 /**
2911 * Setting to showing password characters in text editors. 1 = On, 0 = Off
2912 */
2913 public static final String TEXT_SHOW_PASSWORD = "show_password";
2914
Svetoslav683914b2015-01-15 14:22:26 -08002915 private static final Validator TEXT_SHOW_PASSWORD_VALIDATOR = sBooleanValidator;
2916
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002917 public static final String SHOW_GTALK_SERVICE_STATUS =
2918 "SHOW_GTALK_SERVICE_STATUS";
2919
Svetoslav683914b2015-01-15 14:22:26 -08002920 private static final Validator SHOW_GTALK_SERVICE_STATUS_VALIDATOR = sBooleanValidator;
2921
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002922 /**
2923 * Name of activity to use for wallpaper on the home screen.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002924 *
2925 * @deprecated Use {@link WallpaperManager} instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002926 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002927 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002928 public static final String WALLPAPER_ACTIVITY = "wallpaper_activity";
2929
Svetoslav683914b2015-01-15 14:22:26 -08002930 private static final Validator WALLPAPER_ACTIVITY_VALIDATOR = new Validator() {
2931 private static final int MAX_LENGTH = 1000;
2932
2933 @Override
2934 public boolean validate(String value) {
2935 if (value != null && value.length() > MAX_LENGTH) {
2936 return false;
2937 }
2938 return ComponentName.unflattenFromString(value) != null;
2939 }
2940 };
2941
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002942 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002943 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME}
2944 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002945 */
Christopher Tate06efb532012-08-24 15:29:27 -07002946 @Deprecated
2947 public static final String AUTO_TIME = Global.AUTO_TIME;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002948
2949 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002950 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME_ZONE}
2951 * instead
Amith Yamasaniad450be2010-09-16 16:47:00 -07002952 */
Christopher Tate06efb532012-08-24 15:29:27 -07002953 @Deprecated
2954 public static final String AUTO_TIME_ZONE = Global.AUTO_TIME_ZONE;
Amith Yamasaniad450be2010-09-16 16:47:00 -07002955
2956 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002957 * Display times as 12 or 24 hours
2958 * 12
2959 * 24
2960 */
2961 public static final String TIME_12_24 = "time_12_24";
2962
Svetoslav683914b2015-01-15 14:22:26 -08002963 /** @hide */
2964 public static final Validator TIME_12_24_VALIDATOR =
2965 new DiscreteValueValidator(new String[] {"12", "24"});
2966
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002967 /**
2968 * Date format string
2969 * mm/dd/yyyy
2970 * dd/mm/yyyy
2971 * yyyy/mm/dd
2972 */
2973 public static final String DATE_FORMAT = "date_format";
2974
Svetoslav683914b2015-01-15 14:22:26 -08002975 /** @hide */
2976 public static final Validator DATE_FORMAT_VALIDATOR = new Validator() {
2977 @Override
2978 public boolean validate(String value) {
2979 try {
2980 new SimpleDateFormat(value);
2981 return true;
2982 } catch (IllegalArgumentException e) {
2983 return false;
2984 }
2985 }
2986 };
2987
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002988 /**
2989 * Whether the setup wizard has been run before (on first boot), or if
2990 * it still needs to be run.
2991 *
2992 * nonzero = it has been run in the past
2993 * 0 = it has not been run in the past
2994 */
2995 public static final String SETUP_WIZARD_HAS_RUN = "setup_wizard_has_run";
2996
Svetoslav683914b2015-01-15 14:22:26 -08002997 /** @hide */
2998 public static final Validator SETUP_WIZARD_HAS_RUN_VALIDATOR = sBooleanValidator;
2999
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003000 /**
3001 * Scaling factor for normal window animations. Setting to 0 will disable window
3002 * animations.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003003 *
3004 * @deprecated Use {@link Global#WINDOW_ANIMATION_SCALE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003005 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003006 @Deprecated
3007 public static final String WINDOW_ANIMATION_SCALE = Global.WINDOW_ANIMATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003008
3009 /**
3010 * Scaling factor for activity transition animations. Setting to 0 will disable window
3011 * animations.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003012 *
3013 * @deprecated Use {@link Global#TRANSITION_ANIMATION_SCALE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003014 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003015 @Deprecated
3016 public static final String TRANSITION_ANIMATION_SCALE = Global.TRANSITION_ANIMATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003017
3018 /**
Chet Haasec38fa1f2012-02-01 16:37:46 -08003019 * Scaling factor for Animator-based animations. This affects both the start delay and
3020 * duration of all such animations. Setting to 0 will cause animations to end immediately.
3021 * The default value is 1.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003022 *
3023 * @deprecated Use {@link Global#ANIMATOR_DURATION_SCALE} instead
Chet Haasec38fa1f2012-02-01 16:37:46 -08003024 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003025 @Deprecated
3026 public static final String ANIMATOR_DURATION_SCALE = Global.ANIMATOR_DURATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003027
3028 /**
3029 * Control whether the accelerometer will be used to change screen
3030 * orientation. If 0, it will not be used unless explicitly requested
3031 * by the application; if 1, it will be used by default unless explicitly
3032 * disabled by the application.
3033 */
3034 public static final String ACCELEROMETER_ROTATION = "accelerometer_rotation";
3035
Svetoslav683914b2015-01-15 14:22:26 -08003036 /** @hide */
3037 public static final Validator ACCELEROMETER_ROTATION_VALIDATOR = sBooleanValidator;
3038
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003039 /**
Daniel Sandlerb73617d2010-08-17 00:41:00 -04003040 * Default screen rotation when no other policy applies.
3041 * When {@link #ACCELEROMETER_ROTATION} is zero and no on-screen Activity expresses a
3042 * preference, this rotation value will be used. Must be one of the
Brian Muramatsue1d46982010-12-06 17:34:20 -08003043 * {@link android.view.Surface#ROTATION_0 Surface rotation constants}.
Daniel Sandlerb73617d2010-08-17 00:41:00 -04003044 *
Dianne Hackborn16ec0802014-08-15 18:32:33 -07003045 * @see android.view.Display#getRotation
Daniel Sandlerb73617d2010-08-17 00:41:00 -04003046 */
3047 public static final String USER_ROTATION = "user_rotation";
3048
Svetoslav683914b2015-01-15 14:22:26 -08003049 /** @hide */
3050 public static final Validator USER_ROTATION_VALIDATOR =
3051 new InclusiveIntegerRangeValidator(0, 3);
3052
Daniel Sandlerb73617d2010-08-17 00:41:00 -04003053 /**
Jeff Brown207673cd2012-06-05 17:47:11 -07003054 * Control whether the rotation lock toggle in the System UI should be hidden.
3055 * Typically this is done for accessibility purposes to make it harder for
3056 * the user to accidentally toggle the rotation lock while the display rotation
3057 * has been locked for accessibility.
3058 *
3059 * If 0, then rotation lock toggle is not hidden for accessibility (although it may be
3060 * unavailable for other reasons). If 1, then the rotation lock toggle is hidden.
3061 *
3062 * @hide
3063 */
3064 public static final String HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY =
3065 "hide_rotation_lock_toggle_for_accessibility";
3066
Svetoslav683914b2015-01-15 14:22:26 -08003067 /** @hide */
3068 public static final Validator HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR =
3069 sBooleanValidator;
3070
Jeff Brown207673cd2012-06-05 17:47:11 -07003071 /**
Daisuke Miyakawa3c60eeb2012-05-08 12:08:25 -07003072 * Whether the phone vibrates when it is ringing due to an incoming call. This will
3073 * be used by Phone and Setting apps; it shouldn't affect other apps.
3074 * The value is boolean (1 or 0).
3075 *
3076 * Note: this is not same as "vibrate on ring", which had been available until ICS.
3077 * It was about AudioManager's setting and thus affected all the applications which
3078 * relied on the setting, while this is purely about the vibration setting for incoming
3079 * calls.
Daisuke Miyakawa3c60eeb2012-05-08 12:08:25 -07003080 */
3081 public static final String VIBRATE_WHEN_RINGING = "vibrate_when_ringing";
3082
Svetoslav683914b2015-01-15 14:22:26 -08003083 /** @hide */
3084 public static final Validator VIBRATE_WHEN_RINGING_VALIDATOR = sBooleanValidator;
3085
Daisuke Miyakawa3c60eeb2012-05-08 12:08:25 -07003086 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003087 * Whether the audible DTMF tones are played by the dialer when dialing. The value is
3088 * boolean (1 or 0).
3089 */
3090 public static final String DTMF_TONE_WHEN_DIALING = "dtmf_tone";
3091
Svetoslav683914b2015-01-15 14:22:26 -08003092 /** @hide */
3093 public static final Validator DTMF_TONE_WHEN_DIALING_VALIDATOR = sBooleanValidator;
3094
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003095 /**
David Kraused0f67152009-06-13 18:01:13 -05003096 * CDMA only settings
3097 * DTMF tone type played by the dialer when dialing.
3098 * 0 = Normal
3099 * 1 = Long
David Kraused0f67152009-06-13 18:01:13 -05003100 */
3101 public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type";
3102
Svetoslav683914b2015-01-15 14:22:26 -08003103 /** @hide */
3104 public static final Validator DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR = sBooleanValidator;
3105
David Kraused0f67152009-06-13 18:01:13 -05003106 /**
David Kraused0f67152009-06-13 18:01:13 -05003107 * Whether the hearing aid is enabled. The value is
3108 * boolean (1 or 0).
3109 * @hide
3110 */
3111 public static final String HEARING_AID = "hearing_aid";
3112
Svetoslav683914b2015-01-15 14:22:26 -08003113 /** @hide */
3114 public static final Validator HEARING_AID_VALIDATOR = sBooleanValidator;
3115
David Kraused0f67152009-06-13 18:01:13 -05003116 /**
3117 * CDMA only settings
3118 * TTY Mode
3119 * 0 = OFF
3120 * 1 = FULL
3121 * 2 = VCO
3122 * 3 = HCO
3123 * @hide
3124 */
3125 public static final String TTY_MODE = "tty_mode";
3126
Svetoslav683914b2015-01-15 14:22:26 -08003127 /** @hide */
3128 public static final Validator TTY_MODE_VALIDATOR = new InclusiveIntegerRangeValidator(0, 3);
3129
David Kraused0f67152009-06-13 18:01:13 -05003130 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003131 * Whether the sounds effects (key clicks, lid open ...) are enabled. The value is
3132 * boolean (1 or 0).
3133 */
3134 public static final String SOUND_EFFECTS_ENABLED = "sound_effects_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003135
Svetoslav683914b2015-01-15 14:22:26 -08003136 /** @hide */
3137 public static final Validator SOUND_EFFECTS_ENABLED_VALIDATOR = sBooleanValidator;
3138
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003139 /**
3140 * Whether the haptic feedback (long presses, ...) are enabled. The value is
3141 * boolean (1 or 0).
3142 */
3143 public static final String HAPTIC_FEEDBACK_ENABLED = "haptic_feedback_enabled";
Sanjay Jeyakumar21bf2412009-07-09 13:31:48 -07003144
Svetoslav683914b2015-01-15 14:22:26 -08003145 /** @hide */
3146 public static final Validator HAPTIC_FEEDBACK_ENABLED_VALIDATOR = sBooleanValidator;
3147
Mike LeBeau48603e72009-06-05 00:27:00 +01003148 /**
Bjorn Bringert24abb662010-09-21 12:21:18 +01003149 * @deprecated Each application that shows web suggestions should have its own
3150 * setting for this.
Mike LeBeau48603e72009-06-05 00:27:00 +01003151 */
Bjorn Bringert24abb662010-09-21 12:21:18 +01003152 @Deprecated
Mike LeBeau48603e72009-06-05 00:27:00 +01003153 public static final String SHOW_WEB_SUGGESTIONS = "show_web_suggestions";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003154
Svetoslav683914b2015-01-15 14:22:26 -08003155 /** @hide */
3156 public static final Validator SHOW_WEB_SUGGESTIONS_VALIDATOR = sBooleanValidator;
3157
-b master501eec92009-07-06 13:53:11 -07003158 /**
Amith Yamasaniae3ed702009-12-01 19:02:05 -08003159 * Whether the notification LED should repeatedly flash when a notification is
3160 * pending. The value is boolean (1 or 0).
3161 * @hide
3162 */
3163 public static final String NOTIFICATION_LIGHT_PULSE = "notification_light_pulse";
3164
Svetoslav683914b2015-01-15 14:22:26 -08003165 /** @hide */
3166 public static final Validator NOTIFICATION_LIGHT_PULSE_VALIDATOR = sBooleanValidator;
3167
Amith Yamasaniae3ed702009-12-01 19:02:05 -08003168 /**
Dianne Hackborn90d2db32010-02-11 22:19:06 -08003169 * Show pointer location on screen?
3170 * 0 = no
3171 * 1 = yes
3172 * @hide
3173 */
3174 public static final String POINTER_LOCATION = "pointer_location";
3175
Svetoslav683914b2015-01-15 14:22:26 -08003176 /** @hide */
3177 public static final Validator POINTER_LOCATION_VALIDATOR = sBooleanValidator;
3178
Dianne Hackborn90d2db32010-02-11 22:19:06 -08003179 /**
Jeff Browndaf4a122011-08-26 17:14:14 -07003180 * Show touch positions on screen?
3181 * 0 = no
3182 * 1 = yes
3183 * @hide
3184 */
3185 public static final String SHOW_TOUCHES = "show_touches";
3186
Svetoslav683914b2015-01-15 14:22:26 -08003187 /** @hide */
3188 public static final Validator SHOW_TOUCHES_VALIDATOR = sBooleanValidator;
3189
Jeff Browndaf4a122011-08-26 17:14:14 -07003190 /**
Dianne Hackborn16ec0802014-08-15 18:32:33 -07003191 * Log raw orientation data from
Jorim Jaggib10e33f2015-02-04 21:57:40 +01003192 * {@link com.android.server.policy.WindowOrientationListener} for use with the
Jeff Brown4519f072011-01-23 13:16:01 -08003193 * orientationplot.py tool.
3194 * 0 = no
3195 * 1 = yes
3196 * @hide
3197 */
3198 public static final String WINDOW_ORIENTATION_LISTENER_LOG =
3199 "window_orientation_listener_log";
3200
Svetoslav683914b2015-01-15 14:22:26 -08003201 /** @hide */
3202 public static final Validator WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR = sBooleanValidator;
3203
Jeff Brown4519f072011-01-23 13:16:01 -08003204 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003205 * @deprecated Use {@link android.provider.Settings.Global#POWER_SOUNDS_ENABLED}
3206 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003207 * @hide
3208 */
Christopher Tate06efb532012-08-24 15:29:27 -07003209 @Deprecated
3210 public static final String POWER_SOUNDS_ENABLED = Global.POWER_SOUNDS_ENABLED;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003211
3212 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003213 * @deprecated Use {@link android.provider.Settings.Global#DOCK_SOUNDS_ENABLED}
3214 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003215 * @hide
3216 */
Christopher Tate06efb532012-08-24 15:29:27 -07003217 @Deprecated
3218 public static final String DOCK_SOUNDS_ENABLED = Global.DOCK_SOUNDS_ENABLED;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003219
3220 /**
3221 * Whether to play sounds when the keyguard is shown and dismissed.
3222 * @hide
3223 */
3224 public static final String LOCKSCREEN_SOUNDS_ENABLED = "lockscreen_sounds_enabled";
3225
Svetoslav683914b2015-01-15 14:22:26 -08003226 /** @hide */
3227 public static final Validator LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR = sBooleanValidator;
3228
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003229 /**
Mike Lockwood7bef7392011-10-20 16:51:53 -04003230 * Whether the lockscreen should be completely disabled.
3231 * @hide
3232 */
3233 public static final String LOCKSCREEN_DISABLED = "lockscreen.disabled";
3234
Svetoslav683914b2015-01-15 14:22:26 -08003235 /** @hide */
3236 public static final Validator LOCKSCREEN_DISABLED_VALIDATOR = sBooleanValidator;
3237
Mike Lockwood7bef7392011-10-20 16:51:53 -04003238 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003239 * @deprecated Use {@link android.provider.Settings.Global#LOW_BATTERY_SOUND}
3240 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003241 * @hide
3242 */
Christopher Tate06efb532012-08-24 15:29:27 -07003243 @Deprecated
3244 public static final String LOW_BATTERY_SOUND = Global.LOW_BATTERY_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003245
3246 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003247 * @deprecated Use {@link android.provider.Settings.Global#DESK_DOCK_SOUND}
3248 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003249 * @hide
3250 */
Christopher Tate06efb532012-08-24 15:29:27 -07003251 @Deprecated
3252 public static final String DESK_DOCK_SOUND = Global.DESK_DOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003253
3254 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003255 * @deprecated Use {@link android.provider.Settings.Global#DESK_UNDOCK_SOUND}
3256 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003257 * @hide
3258 */
Christopher Tate06efb532012-08-24 15:29:27 -07003259 @Deprecated
3260 public static final String DESK_UNDOCK_SOUND = Global.DESK_UNDOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003261
3262 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003263 * @deprecated Use {@link android.provider.Settings.Global#CAR_DOCK_SOUND}
3264 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003265 * @hide
3266 */
Christopher Tate06efb532012-08-24 15:29:27 -07003267 @Deprecated
3268 public static final String CAR_DOCK_SOUND = Global.CAR_DOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003269
3270 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003271 * @deprecated Use {@link android.provider.Settings.Global#CAR_UNDOCK_SOUND}
3272 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003273 * @hide
3274 */
Christopher Tate06efb532012-08-24 15:29:27 -07003275 @Deprecated
3276 public static final String CAR_UNDOCK_SOUND = Global.CAR_UNDOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003277
3278 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003279 * @deprecated Use {@link android.provider.Settings.Global#LOCK_SOUND}
3280 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003281 * @hide
3282 */
Christopher Tate06efb532012-08-24 15:29:27 -07003283 @Deprecated
3284 public static final String LOCK_SOUND = Global.LOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003285
3286 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003287 * @deprecated Use {@link android.provider.Settings.Global#UNLOCK_SOUND}
3288 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003289 * @hide
3290 */
Christopher Tate06efb532012-08-24 15:29:27 -07003291 @Deprecated
3292 public static final String UNLOCK_SOUND = Global.UNLOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003293
3294 /**
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003295 * Receive incoming SIP calls?
3296 * 0 = no
3297 * 1 = yes
3298 * @hide
3299 */
3300 public static final String SIP_RECEIVE_CALLS = "sip_receive_calls";
3301
Svetoslav683914b2015-01-15 14:22:26 -08003302 /** @hide */
3303 public static final Validator SIP_RECEIVE_CALLS_VALIDATOR = sBooleanValidator;
3304
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003305 /**
3306 * Call Preference String.
3307 * "SIP_ALWAYS" : Always use SIP with network access
3308 * "SIP_ADDRESS_ONLY" : Only if destination is a SIP address
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003309 * @hide
3310 */
3311 public static final String SIP_CALL_OPTIONS = "sip_call_options";
3312
Svetoslav683914b2015-01-15 14:22:26 -08003313 /** @hide */
3314 public static final Validator SIP_CALL_OPTIONS_VALIDATOR = new DiscreteValueValidator(
3315 new String[] {"SIP_ALWAYS", "SIP_ADDRESS_ONLY"});
3316
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003317 /**
3318 * One of the sip call options: Always use SIP with network access.
3319 * @hide
3320 */
3321 public static final String SIP_ALWAYS = "SIP_ALWAYS";
3322
Svetoslav683914b2015-01-15 14:22:26 -08003323 /** @hide */
3324 public static final Validator SIP_ALWAYS_VALIDATOR = sBooleanValidator;
3325
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003326 /**
3327 * One of the sip call options: Only if destination is a SIP address.
3328 * @hide
3329 */
3330 public static final String SIP_ADDRESS_ONLY = "SIP_ADDRESS_ONLY";
3331
Svetoslav683914b2015-01-15 14:22:26 -08003332 /** @hide */
3333 public static final Validator SIP_ADDRESS_ONLY_VALIDATOR = sBooleanValidator;
3334
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003335 /**
Tyler Gunn2c830a22014-09-02 08:39:35 -07003336 * @deprecated Use SIP_ALWAYS or SIP_ADDRESS_ONLY instead. Formerly used to indicate that
3337 * the user should be prompted each time a call is made whether it should be placed using
3338 * SIP. The {@link com.android.providers.settings.DatabaseHelper} replaces this with
3339 * SIP_ADDRESS_ONLY.
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003340 * @hide
3341 */
Tyler Gunn2c830a22014-09-02 08:39:35 -07003342 @Deprecated
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003343 public static final String SIP_ASK_ME_EACH_TIME = "SIP_ASK_ME_EACH_TIME";
3344
Svetoslav683914b2015-01-15 14:22:26 -08003345 /** @hide */
3346 public static final Validator SIP_ASK_ME_EACH_TIME_VALIDATOR = sBooleanValidator;
3347
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003348 /**
Jeff Brown1a84fd12011-06-02 01:26:32 -07003349 * Pointer speed setting.
3350 * This is an integer value in a range between -7 and +7, so there are 15 possible values.
3351 * -7 = slowest
3352 * 0 = default speed
3353 * +7 = fastest
3354 * @hide
3355 */
3356 public static final String POINTER_SPEED = "pointer_speed";
3357
Svetoslav683914b2015-01-15 14:22:26 -08003358 /** @hide */
3359 public static final Validator POINTER_SPEED_VALIDATOR =
3360 new InclusiveFloatRangeValidator(-7, 7);
3361
Jeff Brown1a84fd12011-06-02 01:26:32 -07003362 /**
Jason Monk56e09b42014-07-18 10:29:14 -04003363 * Whether lock-to-app will be triggered by long-press on recents.
3364 * @hide
3365 */
3366 public static final String LOCK_TO_APP_ENABLED = "lock_to_app_enabled";
3367
Svetoslav683914b2015-01-15 14:22:26 -08003368 /** @hide */
3369 public static final Validator LOCK_TO_APP_ENABLED_VALIDATOR = sBooleanValidator;
3370
Jason Monk56e09b42014-07-18 10:29:14 -04003371 /**
Daniel Sandler2fdb68b2013-10-03 00:12:11 -04003372 * I am the lolrus.
3373 * <p>
3374 * Nonzero values indicate that the user has a bukkit.
3375 * Backward-compatible with <code>PrefGetPreference(prefAllowEasterEggs)</code>.
3376 * @hide
3377 */
3378 public static final String EGG_MODE = "egg_mode";
3379
Svetoslav683914b2015-01-15 14:22:26 -08003380 /** @hide */
Svet Ganovb1918a02015-05-15 09:32:55 -07003381 public static final Validator EGG_MODE_VALIDATOR = new Validator() {
3382 @Override
3383 public boolean validate(String value) {
3384 try {
3385 return Long.parseLong(value) >= 0;
3386 } catch (NumberFormatException e) {
3387 return false;
3388 }
3389 }
3390 };
Svetoslav683914b2015-01-15 14:22:26 -08003391
3392 /**
3393 * IMPORTANT: If you add a new public settings you also have to add it to
3394 * PUBLIC_SETTINGS below. If the new setting is hidden you have to add
3395 * it to PRIVATE_SETTINGS below. Also add a validator that can validate
3396 * the setting value. See an example above.
3397 */
3398
Daniel Sandler2fdb68b2013-10-03 00:12:11 -04003399 /**
-b master501eec92009-07-06 13:53:11 -07003400 * Settings to backup. This is here so that it's in the same place as the settings
3401 * keys and easy to update.
Svetoslav Ganova571a582011-09-20 18:32:20 -07003402 *
3403 * NOTE: Settings are backed up and restored in the order they appear
3404 * in this array. If you have one setting depending on another,
3405 * make sure that they are ordered appropriately.
3406 *
-b master501eec92009-07-06 13:53:11 -07003407 * @hide
3408 */
3409 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate66488d62012-10-02 11:58:01 -07003410 STAY_ON_WHILE_PLUGGED_IN, // moved to global
-b master501eec92009-07-06 13:53:11 -07003411 WIFI_USE_STATIC_IP,
3412 WIFI_STATIC_IP,
3413 WIFI_STATIC_GATEWAY,
3414 WIFI_STATIC_NETMASK,
3415 WIFI_STATIC_DNS1,
3416 WIFI_STATIC_DNS2,
3417 BLUETOOTH_DISCOVERABILITY,
3418 BLUETOOTH_DISCOVERABILITY_TIMEOUT,
Casey Burkhardt86b867f2015-12-29 18:03:36 -08003419 FONT_SCALE,
-b master501eec92009-07-06 13:53:11 -07003420 DIM_SCREEN,
3421 SCREEN_OFF_TIMEOUT,
3422 SCREEN_BRIGHTNESS,
Christopher Tate362aca62009-09-25 15:58:03 -07003423 SCREEN_BRIGHTNESS_MODE,
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08003424 SCREEN_AUTO_BRIGHTNESS_ADJ,
Jeff Brown7f6c2312012-04-13 20:38:38 -07003425 VIBRATE_INPUT_DEVICES,
Amith Yamasani8823c0a82009-07-07 14:30:17 -07003426 MODE_RINGER_STREAMS_AFFECTED,
-b master501eec92009-07-06 13:53:11 -07003427 TEXT_AUTO_REPLACE,
3428 TEXT_AUTO_CAPS,
3429 TEXT_AUTO_PUNCTUATE,
3430 TEXT_SHOW_PASSWORD,
Christopher Tate66488d62012-10-02 11:58:01 -07003431 AUTO_TIME, // moved to global
3432 AUTO_TIME_ZONE, // moved to global
-b master501eec92009-07-06 13:53:11 -07003433 TIME_12_24,
3434 DATE_FORMAT,
-b master501eec92009-07-06 13:53:11 -07003435 DTMF_TONE_WHEN_DIALING,
3436 DTMF_TONE_TYPE_WHEN_DIALING,
-b master501eec92009-07-06 13:53:11 -07003437 HEARING_AID,
3438 TTY_MODE,
3439 SOUND_EFFECTS_ENABLED,
3440 HAPTIC_FEEDBACK_ENABLED,
Christopher Tate66488d62012-10-02 11:58:01 -07003441 POWER_SOUNDS_ENABLED, // moved to global
3442 DOCK_SOUNDS_ENABLED, // moved to global
Christopher Tate14c2d792010-02-25 16:49:44 -08003443 LOCKSCREEN_SOUNDS_ENABLED,
Amith Yamasaniae3ed702009-12-01 19:02:05 -08003444 SHOW_WEB_SUGGESTIONS,
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003445 SIP_CALL_OPTIONS,
Nick Pelly038cabe2010-09-23 16:12:11 -07003446 SIP_RECEIVE_CALLS,
Jeff Brown1a84fd12011-06-02 01:26:32 -07003447 POINTER_SPEED,
Amith Yamasani622bf2222013-09-06 13:54:28 -07003448 VIBRATE_WHEN_RINGING,
3449 RINGTONE,
Jason Monk94cfd9d2014-10-31 13:18:21 -04003450 LOCK_TO_APP_ENABLED,
Anna Galuszafa7786c2015-12-22 10:53:44 -08003451 NOTIFICATION_SOUND,
3452 ACCELEROMETER_ROTATION
-b master501eec92009-07-06 13:53:11 -07003453 };
3454
Sailesh Nepal1bd78762014-02-11 22:32:21 -08003455 /**
Amith Yamasanib0ff3222015-03-04 09:56:14 -08003456 * These are all public system settings
Svetoslav683914b2015-01-15 14:22:26 -08003457 *
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07003458 * @hide
3459 */
Svetoslav683914b2015-01-15 14:22:26 -08003460 public static final Set<String> PUBLIC_SETTINGS = new ArraySet<>();
3461 static {
3462 PUBLIC_SETTINGS.add(END_BUTTON_BEHAVIOR);
3463 PUBLIC_SETTINGS.add(WIFI_USE_STATIC_IP);
3464 PUBLIC_SETTINGS.add(WIFI_STATIC_IP);
3465 PUBLIC_SETTINGS.add(WIFI_STATIC_GATEWAY);
3466 PUBLIC_SETTINGS.add(WIFI_STATIC_NETMASK);
3467 PUBLIC_SETTINGS.add(WIFI_STATIC_DNS1);
3468 PUBLIC_SETTINGS.add(WIFI_STATIC_DNS2);
3469 PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY);
3470 PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY_TIMEOUT);
3471 PUBLIC_SETTINGS.add(NEXT_ALARM_FORMATTED);
3472 PUBLIC_SETTINGS.add(FONT_SCALE);
3473 PUBLIC_SETTINGS.add(DIM_SCREEN);
3474 PUBLIC_SETTINGS.add(SCREEN_OFF_TIMEOUT);
3475 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS);
3476 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_MODE);
3477 PUBLIC_SETTINGS.add(MODE_RINGER_STREAMS_AFFECTED);
3478 PUBLIC_SETTINGS.add(MUTE_STREAMS_AFFECTED);
3479 PUBLIC_SETTINGS.add(VIBRATE_ON);
3480 PUBLIC_SETTINGS.add(VOLUME_RING);
3481 PUBLIC_SETTINGS.add(VOLUME_SYSTEM);
3482 PUBLIC_SETTINGS.add(VOLUME_VOICE);
3483 PUBLIC_SETTINGS.add(VOLUME_MUSIC);
3484 PUBLIC_SETTINGS.add(VOLUME_ALARM);
3485 PUBLIC_SETTINGS.add(VOLUME_NOTIFICATION);
3486 PUBLIC_SETTINGS.add(VOLUME_BLUETOOTH_SCO);
3487 PUBLIC_SETTINGS.add(RINGTONE);
3488 PUBLIC_SETTINGS.add(NOTIFICATION_SOUND);
3489 PUBLIC_SETTINGS.add(ALARM_ALERT);
3490 PUBLIC_SETTINGS.add(TEXT_AUTO_REPLACE);
3491 PUBLIC_SETTINGS.add(TEXT_AUTO_CAPS);
3492 PUBLIC_SETTINGS.add(TEXT_AUTO_PUNCTUATE);
3493 PUBLIC_SETTINGS.add(TEXT_SHOW_PASSWORD);
3494 PUBLIC_SETTINGS.add(SHOW_GTALK_SERVICE_STATUS);
3495 PUBLIC_SETTINGS.add(WALLPAPER_ACTIVITY);
3496 PUBLIC_SETTINGS.add(TIME_12_24);
3497 PUBLIC_SETTINGS.add(DATE_FORMAT);
3498 PUBLIC_SETTINGS.add(SETUP_WIZARD_HAS_RUN);
3499 PUBLIC_SETTINGS.add(ACCELEROMETER_ROTATION);
3500 PUBLIC_SETTINGS.add(USER_ROTATION);
3501 PUBLIC_SETTINGS.add(DTMF_TONE_WHEN_DIALING);
3502 PUBLIC_SETTINGS.add(SOUND_EFFECTS_ENABLED);
3503 PUBLIC_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED);
3504 PUBLIC_SETTINGS.add(SHOW_WEB_SUGGESTIONS);
Svetoslav Ganovd2631632015-12-09 16:29:22 -08003505 PUBLIC_SETTINGS.add(VIBRATE_WHEN_RINGING);
Svetoslav683914b2015-01-15 14:22:26 -08003506 }
3507
3508 /**
3509 * These are all hidden system settings.
3510 *
3511 * @hide
3512 */
3513 public static final Set<String> PRIVATE_SETTINGS = new ArraySet<>();
3514 static {
3515 PRIVATE_SETTINGS.add(WIFI_USE_STATIC_IP);
3516 PRIVATE_SETTINGS.add(END_BUTTON_BEHAVIOR);
3517 PRIVATE_SETTINGS.add(ADVANCED_SETTINGS);
3518 PRIVATE_SETTINGS.add(SCREEN_AUTO_BRIGHTNESS_ADJ);
3519 PRIVATE_SETTINGS.add(VIBRATE_INPUT_DEVICES);
3520 PRIVATE_SETTINGS.add(VOLUME_MASTER);
Andy Hungf04b84d2015-12-18 17:33:27 -08003521 PRIVATE_SETTINGS.add(MASTER_MONO);
Svetoslav683914b2015-01-15 14:22:26 -08003522 PRIVATE_SETTINGS.add(NOTIFICATIONS_USE_RING_VOLUME);
3523 PRIVATE_SETTINGS.add(VIBRATE_IN_SILENT);
3524 PRIVATE_SETTINGS.add(MEDIA_BUTTON_RECEIVER);
3525 PRIVATE_SETTINGS.add(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY);
Svetoslav683914b2015-01-15 14:22:26 -08003526 PRIVATE_SETTINGS.add(DTMF_TONE_TYPE_WHEN_DIALING);
3527 PRIVATE_SETTINGS.add(HEARING_AID);
3528 PRIVATE_SETTINGS.add(TTY_MODE);
3529 PRIVATE_SETTINGS.add(NOTIFICATION_LIGHT_PULSE);
3530 PRIVATE_SETTINGS.add(POINTER_LOCATION);
3531 PRIVATE_SETTINGS.add(SHOW_TOUCHES);
3532 PRIVATE_SETTINGS.add(WINDOW_ORIENTATION_LISTENER_LOG);
3533 PRIVATE_SETTINGS.add(POWER_SOUNDS_ENABLED);
3534 PRIVATE_SETTINGS.add(DOCK_SOUNDS_ENABLED);
3535 PRIVATE_SETTINGS.add(LOCKSCREEN_SOUNDS_ENABLED);
3536 PRIVATE_SETTINGS.add(LOCKSCREEN_DISABLED);
3537 PRIVATE_SETTINGS.add(LOW_BATTERY_SOUND);
3538 PRIVATE_SETTINGS.add(DESK_DOCK_SOUND);
3539 PRIVATE_SETTINGS.add(DESK_UNDOCK_SOUND);
3540 PRIVATE_SETTINGS.add(CAR_DOCK_SOUND);
3541 PRIVATE_SETTINGS.add(CAR_UNDOCK_SOUND);
3542 PRIVATE_SETTINGS.add(LOCK_SOUND);
3543 PRIVATE_SETTINGS.add(UNLOCK_SOUND);
3544 PRIVATE_SETTINGS.add(SIP_RECEIVE_CALLS);
3545 PRIVATE_SETTINGS.add(SIP_CALL_OPTIONS);
3546 PRIVATE_SETTINGS.add(SIP_ALWAYS);
3547 PRIVATE_SETTINGS.add(SIP_ADDRESS_ONLY);
3548 PRIVATE_SETTINGS.add(SIP_ASK_ME_EACH_TIME);
3549 PRIVATE_SETTINGS.add(POINTER_SPEED);
3550 PRIVATE_SETTINGS.add(LOCK_TO_APP_ENABLED);
3551 PRIVATE_SETTINGS.add(EGG_MODE);
3552 }
3553
3554 /**
Amith Yamasanib0ff3222015-03-04 09:56:14 -08003555 * These are all public system settings
Svetoslav683914b2015-01-15 14:22:26 -08003556 *
3557 * @hide
3558 */
3559 public static final Map<String, Validator> VALIDATORS = new ArrayMap<>();
3560 static {
3561 VALIDATORS.put(END_BUTTON_BEHAVIOR,END_BUTTON_BEHAVIOR_VALIDATOR);
3562 VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR);
3563 VALIDATORS.put(BLUETOOTH_DISCOVERABILITY, BLUETOOTH_DISCOVERABILITY_VALIDATOR);
3564 VALIDATORS.put(BLUETOOTH_DISCOVERABILITY_TIMEOUT,
3565 BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR);
3566 VALIDATORS.put(NEXT_ALARM_FORMATTED, NEXT_ALARM_FORMATTED_VALIDATOR);
3567 VALIDATORS.put(FONT_SCALE, FONT_SCALE_VALIDATOR);
3568 VALIDATORS.put(DIM_SCREEN, DIM_SCREEN_VALIDATOR);
3569 VALIDATORS.put(SCREEN_OFF_TIMEOUT, SCREEN_OFF_TIMEOUT_VALIDATOR);
3570 VALIDATORS.put(SCREEN_BRIGHTNESS, SCREEN_BRIGHTNESS_VALIDATOR);
3571 VALIDATORS.put(SCREEN_BRIGHTNESS_MODE, SCREEN_BRIGHTNESS_MODE_VALIDATOR);
3572 VALIDATORS.put(MODE_RINGER_STREAMS_AFFECTED, MODE_RINGER_STREAMS_AFFECTED_VALIDATOR);
3573 VALIDATORS.put(MUTE_STREAMS_AFFECTED, MUTE_STREAMS_AFFECTED_VALIDATOR);
3574 VALIDATORS.put(VIBRATE_ON, VIBRATE_ON_VALIDATOR);
Svetoslav683914b2015-01-15 14:22:26 -08003575 VALIDATORS.put(RINGTONE, RINGTONE_VALIDATOR);
3576 VALIDATORS.put(NOTIFICATION_SOUND, NOTIFICATION_SOUND_VALIDATOR);
3577 VALIDATORS.put(ALARM_ALERT, ALARM_ALERT_VALIDATOR);
3578 VALIDATORS.put(TEXT_AUTO_REPLACE, TEXT_AUTO_REPLACE_VALIDATOR);
3579 VALIDATORS.put(TEXT_AUTO_CAPS, TEXT_AUTO_CAPS_VALIDATOR);
3580 VALIDATORS.put(TEXT_AUTO_PUNCTUATE, TEXT_AUTO_PUNCTUATE_VALIDATOR);
3581 VALIDATORS.put(TEXT_SHOW_PASSWORD, TEXT_SHOW_PASSWORD_VALIDATOR);
3582 VALIDATORS.put(SHOW_GTALK_SERVICE_STATUS, SHOW_GTALK_SERVICE_STATUS_VALIDATOR);
3583 VALIDATORS.put(WALLPAPER_ACTIVITY, WALLPAPER_ACTIVITY_VALIDATOR);
3584 VALIDATORS.put(TIME_12_24, TIME_12_24_VALIDATOR);
3585 VALIDATORS.put(DATE_FORMAT, DATE_FORMAT_VALIDATOR);
3586 VALIDATORS.put(SETUP_WIZARD_HAS_RUN, SETUP_WIZARD_HAS_RUN_VALIDATOR);
3587 VALIDATORS.put(ACCELEROMETER_ROTATION, ACCELEROMETER_ROTATION_VALIDATOR);
3588 VALIDATORS.put(USER_ROTATION, USER_ROTATION_VALIDATOR);
3589 VALIDATORS.put(DTMF_TONE_WHEN_DIALING, DTMF_TONE_WHEN_DIALING_VALIDATOR);
3590 VALIDATORS.put(SOUND_EFFECTS_ENABLED, SOUND_EFFECTS_ENABLED_VALIDATOR);
3591 VALIDATORS.put(HAPTIC_FEEDBACK_ENABLED, HAPTIC_FEEDBACK_ENABLED_VALIDATOR);
3592 VALIDATORS.put(SHOW_WEB_SUGGESTIONS, SHOW_WEB_SUGGESTIONS_VALIDATOR);
3593 VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR);
3594 VALIDATORS.put(END_BUTTON_BEHAVIOR, END_BUTTON_BEHAVIOR_VALIDATOR);
3595 VALIDATORS.put(ADVANCED_SETTINGS, ADVANCED_SETTINGS_VALIDATOR);
3596 VALIDATORS.put(SCREEN_AUTO_BRIGHTNESS_ADJ, SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR);
3597 VALIDATORS.put(VIBRATE_INPUT_DEVICES, VIBRATE_INPUT_DEVICES_VALIDATOR);
Andy Hungf04b84d2015-12-18 17:33:27 -08003598 VALIDATORS.put(MASTER_MONO, MASTER_MONO_VALIDATOR);
Svetoslav683914b2015-01-15 14:22:26 -08003599 VALIDATORS.put(NOTIFICATIONS_USE_RING_VOLUME, NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR);
3600 VALIDATORS.put(VIBRATE_IN_SILENT, VIBRATE_IN_SILENT_VALIDATOR);
3601 VALIDATORS.put(MEDIA_BUTTON_RECEIVER, MEDIA_BUTTON_RECEIVER_VALIDATOR);
3602 VALIDATORS.put(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY,
3603 HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR);
3604 VALIDATORS.put(VIBRATE_WHEN_RINGING, VIBRATE_WHEN_RINGING_VALIDATOR);
3605 VALIDATORS.put(DTMF_TONE_TYPE_WHEN_DIALING, DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR);
3606 VALIDATORS.put(HEARING_AID, HEARING_AID_VALIDATOR);
3607 VALIDATORS.put(TTY_MODE, TTY_MODE_VALIDATOR);
3608 VALIDATORS.put(NOTIFICATION_LIGHT_PULSE, NOTIFICATION_LIGHT_PULSE_VALIDATOR);
3609 VALIDATORS.put(POINTER_LOCATION, POINTER_LOCATION_VALIDATOR);
3610 VALIDATORS.put(SHOW_TOUCHES, SHOW_TOUCHES_VALIDATOR);
3611 VALIDATORS.put(WINDOW_ORIENTATION_LISTENER_LOG,
3612 WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR);
3613 VALIDATORS.put(LOCKSCREEN_SOUNDS_ENABLED, LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR);
3614 VALIDATORS.put(LOCKSCREEN_DISABLED, LOCKSCREEN_DISABLED_VALIDATOR);
3615 VALIDATORS.put(SIP_RECEIVE_CALLS, SIP_RECEIVE_CALLS_VALIDATOR);
3616 VALIDATORS.put(SIP_CALL_OPTIONS, SIP_CALL_OPTIONS_VALIDATOR);
3617 VALIDATORS.put(SIP_ALWAYS, SIP_ALWAYS_VALIDATOR);
3618 VALIDATORS.put(SIP_ADDRESS_ONLY, SIP_ADDRESS_ONLY_VALIDATOR);
3619 VALIDATORS.put(SIP_ASK_ME_EACH_TIME, SIP_ASK_ME_EACH_TIME_VALIDATOR);
3620 VALIDATORS.put(POINTER_SPEED, POINTER_SPEED_VALIDATOR);
3621 VALIDATORS.put(LOCK_TO_APP_ENABLED, LOCK_TO_APP_ENABLED_VALIDATOR);
3622 VALIDATORS.put(EGG_MODE, EGG_MODE_VALIDATOR);
3623 VALIDATORS.put(WIFI_STATIC_IP, WIFI_STATIC_IP_VALIDATOR);
3624 VALIDATORS.put(WIFI_STATIC_GATEWAY, WIFI_STATIC_GATEWAY_VALIDATOR);
3625 VALIDATORS.put(WIFI_STATIC_NETMASK, WIFI_STATIC_NETMASK_VALIDATOR);
3626 VALIDATORS.put(WIFI_STATIC_DNS1, WIFI_STATIC_DNS1_VALIDATOR);
3627 VALIDATORS.put(WIFI_STATIC_DNS2, WIFI_STATIC_DNS2_VALIDATOR);
3628 }
3629
3630 /**
3631 * These entries are considered common between the personal and the managed profile,
3632 * since the managed profile doesn't get to change them.
3633 */
3634 private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>();
3635 static {
3636 CLONE_TO_MANAGED_PROFILE.add(DATE_FORMAT);
3637 CLONE_TO_MANAGED_PROFILE.add(HAPTIC_FEEDBACK_ENABLED);
3638 CLONE_TO_MANAGED_PROFILE.add(SOUND_EFFECTS_ENABLED);
3639 CLONE_TO_MANAGED_PROFILE.add(TEXT_SHOW_PASSWORD);
3640 CLONE_TO_MANAGED_PROFILE.add(TIME_12_24);
3641 }
3642
3643 /** @hide */
3644 public static void getCloneToManagedProfileSettings(Set<String> outKeySet) {
3645 outKeySet.addAll(CLONE_TO_MANAGED_PROFILE);
3646 }
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07003647
3648 /**
Sailesh Nepal1bd78762014-02-11 22:32:21 -08003649 * When to use Wi-Fi calling
3650 *
3651 * @see android.telephony.TelephonyManager.WifiCallingChoices
3652 * @hide
3653 */
3654 public static final String WHEN_TO_MAKE_WIFI_CALLS = "when_to_make_wifi_calls";
3655
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003656 // Settings moved to Settings.Secure
3657
3658 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003659 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003660 * instead
3661 */
3662 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003663 public static final String ADB_ENABLED = Global.ADB_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003664
3665 /**
3666 * @deprecated Use {@link android.provider.Settings.Secure#ANDROID_ID} instead
3667 */
3668 @Deprecated
3669 public static final String ANDROID_ID = Secure.ANDROID_ID;
3670
3671 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003672 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003673 */
3674 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003675 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003676
3677 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003678 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003679 */
3680 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003681 public static final String DATA_ROAMING = Global.DATA_ROAMING;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003682
3683 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003684 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003685 */
3686 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003687 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003688
3689 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07003690 * @deprecated Use {@link android.provider.Settings.Global#HTTP_PROXY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003691 */
3692 @Deprecated
Jeff Sharkey625239a2012-09-26 22:03:49 -07003693 public static final String HTTP_PROXY = Global.HTTP_PROXY;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003694
3695 /**
Christopher Tateaa036a22014-05-19 16:33:27 -07003696 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003697 */
3698 @Deprecated
Christopher Tateaa036a22014-05-19 16:33:27 -07003699 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003700
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003701 /**
3702 * @deprecated Use {@link android.provider.Settings.Secure#LOCATION_PROVIDERS_ALLOWED}
3703 * instead
3704 */
3705 @Deprecated
3706 public static final String LOCATION_PROVIDERS_ALLOWED = Secure.LOCATION_PROVIDERS_ALLOWED;
3707
3708 /**
3709 * @deprecated Use {@link android.provider.Settings.Secure#LOGGING_ID} instead
3710 */
3711 @Deprecated
3712 public static final String LOGGING_ID = Secure.LOGGING_ID;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003713
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003714 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003715 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003716 */
3717 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003718 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003719
3720 /**
3721 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_ENABLED}
3722 * instead
3723 */
3724 @Deprecated
3725 public static final String PARENTAL_CONTROL_ENABLED = Secure.PARENTAL_CONTROL_ENABLED;
3726
3727 /**
3728 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_LAST_UPDATE}
3729 * instead
3730 */
3731 @Deprecated
3732 public static final String PARENTAL_CONTROL_LAST_UPDATE = Secure.PARENTAL_CONTROL_LAST_UPDATE;
3733
3734 /**
3735 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_REDIRECT_URL}
3736 * instead
3737 */
3738 @Deprecated
3739 public static final String PARENTAL_CONTROL_REDIRECT_URL =
3740 Secure.PARENTAL_CONTROL_REDIRECT_URL;
3741
3742 /**
3743 * @deprecated Use {@link android.provider.Settings.Secure#SETTINGS_CLASSNAME} instead
3744 */
3745 @Deprecated
3746 public static final String SETTINGS_CLASSNAME = Secure.SETTINGS_CLASSNAME;
3747
3748 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003749 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003750 */
3751 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003752 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003753
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003754 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003755 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003756 */
3757 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003758 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003759
Dianne Hackborn4a51c202009-08-21 15:14:02 -07003760 /**
3761 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07003762 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
Dianne Hackborn4a51c202009-08-21 15:14:02 -07003763 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003764 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003765 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 -08003766
Dianne Hackborn4a51c202009-08-21 15:14:02 -07003767 /**
3768 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07003769 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
Dianne Hackborn4a51c202009-08-21 15:14:02 -07003770 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003771 @Deprecated
3772 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
Christopher Tate06efb532012-08-24 15:29:27 -07003773 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003774
3775 /**
3776 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07003777 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003778 */
3779 @Deprecated
3780 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
Christopher Tate06efb532012-08-24 15:29:27 -07003781 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003782
3783 /**
3784 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07003785 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003786 */
3787 @Deprecated
3788 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
Christopher Tate06efb532012-08-24 15:29:27 -07003789 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003790
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003791 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003792 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003793 * instead
3794 */
3795 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003796 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 -08003797
3798 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003799 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003800 */
3801 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003802 public static final String WIFI_ON = Global.WIFI_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003803
3804 /**
3805 * @deprecated Use
3806 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE}
3807 * instead
3808 */
3809 @Deprecated
3810 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
3811 Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE;
3812
3813 /**
3814 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_AP_COUNT} instead
3815 */
3816 @Deprecated
3817 public static final String WIFI_WATCHDOG_AP_COUNT = Secure.WIFI_WATCHDOG_AP_COUNT;
3818
3819 /**
3820 * @deprecated Use
3821 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS} instead
3822 */
3823 @Deprecated
3824 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
3825 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003826
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003827 /**
3828 * @deprecated Use
3829 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED} instead
3830 */
3831 @Deprecated
3832 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
3833 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED;
3834
3835 /**
3836 * @deprecated Use
3837 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS}
3838 * instead
3839 */
3840 @Deprecated
3841 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
3842 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS;
3843
3844 /**
3845 * @deprecated Use
3846 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT} instead
3847 */
3848 @Deprecated
3849 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
3850 Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT;
3851
3852 /**
3853 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_MAX_AP_CHECKS}
3854 * instead
3855 */
3856 @Deprecated
3857 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = Secure.WIFI_WATCHDOG_MAX_AP_CHECKS;
3858
3859 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003860 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003861 */
3862 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003863 public static final String WIFI_WATCHDOG_ON = Global.WIFI_WATCHDOG_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003864
3865 /**
3866 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_COUNT} instead
3867 */
3868 @Deprecated
3869 public static final String WIFI_WATCHDOG_PING_COUNT = Secure.WIFI_WATCHDOG_PING_COUNT;
3870
3871 /**
3872 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_DELAY_MS}
3873 * instead
3874 */
3875 @Deprecated
3876 public static final String WIFI_WATCHDOG_PING_DELAY_MS = Secure.WIFI_WATCHDOG_PING_DELAY_MS;
3877
3878 /**
3879 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_TIMEOUT_MS}
3880 * instead
3881 */
3882 @Deprecated
3883 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS =
3884 Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS;
Billy Lau6ad2d662015-07-18 00:26:58 +01003885
3886 /**
3887 * An app can use this method to check if it is currently allowed to write or modify system
3888 * settings. In order to gain write access to the system settings, an app must declare the
3889 * {@link android.Manifest.permission#WRITE_SETTINGS} permission in its manifest. If it is
3890 * currently disallowed, it can prompt the user to grant it this capability through a
3891 * management UI by sending an Intent with action
3892 * {@link android.provider.Settings#ACTION_MANAGE_WRITE_SETTINGS}.
3893 *
3894 * @param context A context
3895 * @return true if the calling app can write to system settings, false otherwise
3896 */
3897 public static boolean canWrite(Context context) {
Svet Ganov94ba40172016-04-03 22:04:22 -07003898 return isCallingPackageAllowedToWriteSettings(context, Process.myUid(),
3899 context.getOpPackageName(), false);
Billy Lau6ad2d662015-07-18 00:26:58 +01003900 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003901 }
3902
3903 /**
3904 * Secure system settings, containing system preferences that applications
3905 * can read but are not allowed to write. These are for preferences that
3906 * the user must explicitly modify through the system UI or specialized
3907 * APIs for those values, not modified directly by applications.
3908 */
3909 public static final class Secure extends NameValueTable {
3910 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_secure_version";
3911
Dianne Hackborn139748f2012-09-24 11:36:57 -07003912 /**
3913 * The content:// style URL for this table
3914 */
3915 public static final Uri CONTENT_URI =
3916 Uri.parse("content://" + AUTHORITY + "/secure");
3917
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08003918 // Populated lazily, guarded by class object:
Dianne Hackborn139748f2012-09-24 11:36:57 -07003919 private static final NameValueCache sNameValueCache = new NameValueCache(
3920 SYS_PROP_SETTING_VERSION,
3921 CONTENT_URI,
3922 CALL_METHOD_GET_SECURE,
3923 CALL_METHOD_PUT_SECURE);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003924
Amith Yamasani52c489c2012-03-28 11:42:42 -07003925 private static ILockSettings sLockSettings = null;
3926
Amith Yamasani7ab8c4a2012-04-06 09:27:12 -07003927 private static boolean sIsSystemProcess;
Amith Yamasani52c489c2012-03-28 11:42:42 -07003928 private static final HashSet<String> MOVED_TO_LOCK_SETTINGS;
Christopher Tate06efb532012-08-24 15:29:27 -07003929 private static final HashSet<String> MOVED_TO_GLOBAL;
Amith Yamasani52c489c2012-03-28 11:42:42 -07003930 static {
3931 MOVED_TO_LOCK_SETTINGS = new HashSet<String>(3);
3932 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_ENABLED);
3933 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_VISIBLE);
3934 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
Christopher Tate06efb532012-08-24 15:29:27 -07003935
3936 MOVED_TO_GLOBAL = new HashSet<String>();
3937 MOVED_TO_GLOBAL.add(Settings.Global.ADB_ENABLED);
3938 MOVED_TO_GLOBAL.add(Settings.Global.ASSISTED_GPS_ENABLED);
3939 MOVED_TO_GLOBAL.add(Settings.Global.BLUETOOTH_ON);
Christopher Tate58f41ec2013-01-11 15:40:36 -08003940 MOVED_TO_GLOBAL.add(Settings.Global.BUGREPORT_IN_POWER_MENU);
Christopher Tate06efb532012-08-24 15:29:27 -07003941 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_CELL_BROADCAST_SMS);
3942 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_ROAMING_MODE);
3943 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_SUBSCRIPTION_MODE);
3944 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_MOBILE);
3945 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_WIFI);
3946 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ROAMING);
3947 MOVED_TO_GLOBAL.add(Settings.Global.DEVELOPMENT_SETTINGS_ENABLED);
3948 MOVED_TO_GLOBAL.add(Settings.Global.DEVICE_PROVISIONED);
Christopher Tate06efb532012-08-24 15:29:27 -07003949 MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_SIZE_FORCED);
3950 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_MAX_BYTES_OVER_MOBILE);
3951 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE);
Christopher Tate06efb532012-08-24 15:29:27 -07003952 MOVED_TO_GLOBAL.add(Settings.Global.MOBILE_DATA);
3953 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_BUCKET_DURATION);
3954 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_DELETE_AGE);
3955 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_PERSIST_BYTES);
3956 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_ROTATE_AGE);
3957 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_ENABLED);
3958 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_GLOBAL_ALERT_BYTES);
3959 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_POLL_INTERVAL);
Christopher Tate06efb532012-08-24 15:29:27 -07003960 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_SAMPLE_ENABLED);
3961 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_TIME_CACHE_MAX_AGE);
3962 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_BUCKET_DURATION);
3963 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_DELETE_AGE);
3964 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_PERSIST_BYTES);
3965 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_ROTATE_AGE);
3966 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_BUCKET_DURATION);
3967 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_DELETE_AGE);
3968 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_PERSIST_BYTES);
3969 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_ROTATE_AGE);
3970 MOVED_TO_GLOBAL.add(Settings.Global.NETWORK_PREFERENCE);
3971 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_DIFF);
3972 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_SPACING);
3973 MOVED_TO_GLOBAL.add(Settings.Global.NTP_SERVER);
3974 MOVED_TO_GLOBAL.add(Settings.Global.NTP_TIMEOUT);
3975 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_ERROR_POLL_COUNT);
3976 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_LONG_POLL_INTERVAL_MS);
3977 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT);
3978 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_POLL_INTERVAL_MS);
3979 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_TRIGGER_PACKET_COUNT);
3980 MOVED_TO_GLOBAL.add(Settings.Global.SAMPLING_PROFILER_MS);
3981 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DATA_SERVICE_URL);
3982 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_REDIR_HOST);
3983 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_TARGET_URL);
3984 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_APN);
3985 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_REQUIRED);
3986 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_SUPPORTED);
Christopher Tate06efb532012-08-24 15:29:27 -07003987 MOVED_TO_GLOBAL.add(Settings.Global.USB_MASS_STORAGE_ENABLED);
3988 MOVED_TO_GLOBAL.add(Settings.Global.USE_GOOGLE_MAIL);
Robert Greenwalt3ea0c992013-10-03 21:13:49 +00003989 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_COUNTRY_CODE);
Christopher Tate06efb532012-08-24 15:29:27 -07003990 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FRAMEWORK_SCAN_INTERVAL_MS);
3991 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FREQUENCY_BAND);
3992 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_IDLE_MS);
3993 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MAX_DHCP_RETRY_COUNT);
3994 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS);
3995 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
3996 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
3997 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NUM_OPEN_NETWORKS_KEPT);
3998 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ON);
3999 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_P2P_DEVICE_NAME);
4000 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SAVED_STATE);
4001 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUPPLICANT_SCAN_INTERVAL_MS);
4002 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUSPEND_OPTIMIZATIONS_ENABLED);
Nathan Harold29589fc2016-03-30 21:53:48 -07004003 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_VERBOSE_LOGGING_ENABLED);
vandwalle7c3606c2014-03-31 19:12:07 -07004004 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ENHANCED_AUTO_JOIN);
4005 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORK_SHOW_RSSI);
Christopher Tate06efb532012-08-24 15:29:27 -07004006 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_ON);
4007 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED);
Christopher Tate06efb532012-08-24 15:29:27 -07004008 MOVED_TO_GLOBAL.add(Settings.Global.WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON);
Christopher Tatec868b642012-09-12 17:41:04 -07004009 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_ENABLE);
4010 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_TIMEOUT);
4011 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_DEFAULT_RESPONSE);
4012 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS);
4013 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS);
4014 MOVED_TO_GLOBAL.add(Settings.Global.GPRS_REGISTER_CHECK_PERIOD_MS);
Christopher Tate06efb532012-08-24 15:29:27 -07004015 MOVED_TO_GLOBAL.add(Settings.Global.WTF_IS_FATAL);
Jeff Sharkey625239a2012-09-26 22:03:49 -07004016 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_DURATION_THRESHOLD);
4017 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_THRESHOLD);
4018 MOVED_TO_GLOBAL.add(Settings.Global.SEND_ACTION_APP_ERROR);
4019 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_AGE_SECONDS);
4020 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_MAX_FILES);
4021 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_KB);
4022 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_PERCENT);
4023 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_RESERVE_PERCENT);
4024 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_TAG_PREFIX);
4025 MOVED_TO_GLOBAL.add(Settings.Global.ERROR_LOGCAT_PREFIX);
4026 MOVED_TO_GLOBAL.add(Settings.Global.SYS_FREE_STORAGE_LOG_INTERVAL);
4027 MOVED_TO_GLOBAL.add(Settings.Global.DISK_FREE_CHANGE_REPORTING_THRESHOLD);
4028 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_PERCENTAGE);
4029 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_MAX_BYTES);
4030 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_FULL_THRESHOLD_BYTES);
4031 MOVED_TO_GLOBAL.add(Settings.Global.SYNC_MAX_RETRY_DELAY_IN_SECONDS);
4032 MOVED_TO_GLOBAL.add(Settings.Global.CONNECTIVITY_CHANGE_DELAY);
4033 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED);
4034 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_SERVER);
4035 MOVED_TO_GLOBAL.add(Settings.Global.NSD_ON);
4036 MOVED_TO_GLOBAL.add(Settings.Global.SET_INSTALL_LOCATION);
4037 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_INSTALL_LOCATION);
4038 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_UP_DELAY);
4039 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_DOWN_DELAY);
4040 MOVED_TO_GLOBAL.add(Settings.Global.READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT);
4041 MOVED_TO_GLOBAL.add(Settings.Global.HTTP_PROXY);
4042 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_HOST);
4043 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_PORT);
4044 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST);
4045 MOVED_TO_GLOBAL.add(Settings.Global.SET_GLOBAL_HTTP_PROXY);
4046 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_DNS_SERVER);
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07004047 MOVED_TO_GLOBAL.add(Settings.Global.PREFERRED_NETWORK_MODE);
Hui Shu22671772014-10-01 21:41:07 +00004048 MOVED_TO_GLOBAL.add(Settings.Global.WEBVIEW_DATA_REDUCTION_PROXY_KEY);
Christopher Tate06efb532012-08-24 15:29:27 -07004049 }
4050
Christopher Tate66488d62012-10-02 11:58:01 -07004051 /** @hide */
Svetoslav683914b2015-01-15 14:22:26 -08004052 public static void getMovedToGlobalSettings(Set<String> outKeySet) {
Christopher Tate66488d62012-10-02 11:58:01 -07004053 outKeySet.addAll(MOVED_TO_GLOBAL);
4054 }
4055
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004056 /**
4057 * Look up a name in the database.
4058 * @param resolver to access the database with
4059 * @param name to look up in the table
4060 * @return the corresponding value, or null if not present
4061 */
Dianne Hackborn139748f2012-09-24 11:36:57 -07004062 public static String getString(ContentResolver resolver, String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07004063 return getStringForUser(resolver, name, UserHandle.myUserId());
4064 }
4065
4066 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -07004067 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -07004068 int userHandle) {
4069 if (MOVED_TO_GLOBAL.contains(name)) {
4070 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
4071 + " to android.provider.Settings.Global.");
4072 return Global.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004073 }
Amith Yamasani52c489c2012-03-28 11:42:42 -07004074
Dianne Hackborn139748f2012-09-24 11:36:57 -07004075 if (MOVED_TO_LOCK_SETTINGS.contains(name)) {
4076 synchronized (Secure.class) {
4077 if (sLockSettings == null) {
4078 sLockSettings = ILockSettings.Stub.asInterface(
4079 (IBinder) ServiceManager.getService("lock_settings"));
4080 sIsSystemProcess = Process.myUid() == Process.SYSTEM_UID;
4081 }
4082 }
4083 if (sLockSettings != null && !sIsSystemProcess) {
Adrian Roos7811d9f2015-07-27 15:10:13 -07004084 // No context; use the ActivityThread's context as an approximation for
4085 // determining the target API level.
4086 Application application = ActivityThread.currentApplication();
4087
4088 boolean isPreMnc = application != null
4089 && application.getApplicationInfo() != null
4090 && application.getApplicationInfo().targetSdkVersion
4091 <= VERSION_CODES.LOLLIPOP_MR1;
4092 if (isPreMnc) {
4093 try {
4094 return sLockSettings.getString(name, "0", userHandle);
4095 } catch (RemoteException re) {
4096 // Fall through
4097 }
4098 } else {
4099 throw new SecurityException("Settings.Secure." + name
4100 + " is deprecated and no longer accessible."
4101 + " See API documentation for potential replacements.");
Dianne Hackborn139748f2012-09-24 11:36:57 -07004102 }
Amith Yamasani52c489c2012-03-28 11:42:42 -07004103 }
4104 }
4105
Christopher Tate06efb532012-08-24 15:29:27 -07004106 return sNameValueCache.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004107 }
4108
4109 /**
4110 * Store a name/value pair into the database.
4111 * @param resolver to access the database with
4112 * @param name to store
4113 * @param value to associate with the name
4114 * @return true if the value was set, false on database errors
4115 */
Christopher Tate06efb532012-08-24 15:29:27 -07004116 public static boolean putString(ContentResolver resolver, String name, String value) {
4117 return putStringForUser(resolver, name, value, UserHandle.myUserId());
4118 }
4119
4120 /** @hide */
4121 public static boolean putStringForUser(ContentResolver resolver, String name, String value,
4122 int userHandle) {
Julia Reynolds82735bc2014-09-04 16:43:30 -04004123 if (LOCATION_MODE.equals(name)) {
4124 // HACK ALERT: temporary hack to work around b/10491283.
4125 // TODO: once b/10491283 fixed, remove this hack
4126 return setLocationModeForUser(resolver, Integer.parseInt(value), userHandle);
4127 }
Christopher Tate06efb532012-08-24 15:29:27 -07004128 if (MOVED_TO_GLOBAL.contains(name)) {
4129 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
4130 + " to android.provider.Settings.Global");
4131 return Global.putStringForUser(resolver, name, value, userHandle);
4132 }
Christopher Tate06efb532012-08-24 15:29:27 -07004133 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004134 }
4135
4136 /**
4137 * Construct the content URI for a particular name/value pair,
4138 * useful for monitoring changes with a ContentObserver.
4139 * @param name to look up in the table
4140 * @return the corresponding content URI, or null if not present
4141 */
4142 public static Uri getUriFor(String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07004143 if (MOVED_TO_GLOBAL.contains(name)) {
4144 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
4145 + " to android.provider.Settings.Global, returning global URI.");
4146 return Global.getUriFor(Global.CONTENT_URI, name);
4147 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004148 return getUriFor(CONTENT_URI, name);
4149 }
4150
4151 /**
4152 * Convenience function for retrieving a single secure settings value
4153 * as an integer. Note that internally setting values are always
4154 * stored as strings; this function converts the string to an integer
4155 * for you. The default value will be returned if the setting is
4156 * not defined or not an integer.
4157 *
4158 * @param cr The ContentResolver to access.
4159 * @param name The name of the setting to retrieve.
4160 * @param def Value to return if the setting is not defined.
4161 *
4162 * @return The setting's current value, or 'def' if it is not defined
4163 * or not a valid integer.
4164 */
4165 public static int getInt(ContentResolver cr, String name, int def) {
Christopher Tate06efb532012-08-24 15:29:27 -07004166 return getIntForUser(cr, name, def, UserHandle.myUserId());
4167 }
4168
4169 /** @hide */
4170 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
Tom O'Neill7f6f4572013-08-27 10:53:15 -07004171 if (LOCATION_MODE.equals(name)) {
4172 // HACK ALERT: temporary hack to work around b/10491283.
4173 // TODO: once b/10491283 fixed, remove this hack
4174 return getLocationModeForUser(cr, userHandle);
4175 }
Christopher Tate06efb532012-08-24 15:29:27 -07004176 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004177 try {
4178 return v != null ? Integer.parseInt(v) : def;
4179 } catch (NumberFormatException e) {
4180 return def;
4181 }
4182 }
4183
4184 /**
4185 * Convenience function for retrieving a single secure settings value
4186 * as an integer. Note that internally setting values are always
4187 * stored as strings; this function converts the string to an integer
4188 * for you.
4189 * <p>
4190 * This version does not take a default value. If the setting has not
4191 * been set, or the string value is not a number,
4192 * it throws {@link SettingNotFoundException}.
4193 *
4194 * @param cr The ContentResolver to access.
4195 * @param name The name of the setting to retrieve.
4196 *
4197 * @throws SettingNotFoundException Thrown if a setting by the given
4198 * name can't be found or the setting value is not an integer.
4199 *
4200 * @return The setting's current value.
4201 */
4202 public static int getInt(ContentResolver cr, String name)
4203 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07004204 return getIntForUser(cr, name, UserHandle.myUserId());
4205 }
4206
4207 /** @hide */
4208 public static int getIntForUser(ContentResolver cr, String name, int userHandle)
4209 throws SettingNotFoundException {
Tom O'Neill7f6f4572013-08-27 10:53:15 -07004210 if (LOCATION_MODE.equals(name)) {
4211 // HACK ALERT: temporary hack to work around b/10491283.
4212 // TODO: once b/10491283 fixed, remove this hack
4213 return getLocationModeForUser(cr, userHandle);
4214 }
Christopher Tate06efb532012-08-24 15:29:27 -07004215 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004216 try {
4217 return Integer.parseInt(v);
4218 } catch (NumberFormatException e) {
4219 throw new SettingNotFoundException(name);
4220 }
4221 }
4222
4223 /**
4224 * Convenience function for updating a single settings value as an
4225 * integer. This will either create a new entry in the table if the
4226 * given name does not exist, or modify the value of the existing row
4227 * with that name. Note that internally setting values are always
4228 * stored as strings, so this function converts the given value to a
4229 * string before storing it.
4230 *
4231 * @param cr The ContentResolver to access.
4232 * @param name The name of the setting to modify.
4233 * @param value The new value for the setting.
4234 * @return true if the value was set, false on database errors
4235 */
4236 public static boolean putInt(ContentResolver cr, String name, int value) {
Christopher Tate06efb532012-08-24 15:29:27 -07004237 return putIntForUser(cr, name, value, UserHandle.myUserId());
4238 }
4239
4240 /** @hide */
4241 public static boolean putIntForUser(ContentResolver cr, String name, int value,
4242 int userHandle) {
4243 return putStringForUser(cr, name, Integer.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004244 }
4245
4246 /**
4247 * Convenience function for retrieving a single secure settings value
4248 * as a {@code long}. Note that internally setting values are always
4249 * stored as strings; this function converts the string to a {@code long}
4250 * for you. The default value will be returned if the setting is
4251 * not defined or not a {@code long}.
4252 *
4253 * @param cr The ContentResolver to access.
4254 * @param name The name of the setting to retrieve.
4255 * @param def Value to return if the setting is not defined.
4256 *
4257 * @return The setting's current value, or 'def' if it is not defined
4258 * or not a valid {@code long}.
4259 */
4260 public static long getLong(ContentResolver cr, String name, long def) {
Christopher Tate06efb532012-08-24 15:29:27 -07004261 return getLongForUser(cr, name, def, UserHandle.myUserId());
4262 }
4263
4264 /** @hide */
4265 public static long getLongForUser(ContentResolver cr, String name, long def,
4266 int userHandle) {
4267 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004268 long value;
4269 try {
4270 value = valString != null ? Long.parseLong(valString) : def;
4271 } catch (NumberFormatException e) {
4272 value = def;
4273 }
4274 return value;
4275 }
4276
4277 /**
4278 * Convenience function for retrieving a single secure settings value
4279 * as a {@code long}. Note that internally setting values are always
4280 * stored as strings; this function converts the string to a {@code long}
4281 * for you.
4282 * <p>
4283 * This version does not take a default value. If the setting has not
4284 * been set, or the string value is not a number,
4285 * it throws {@link SettingNotFoundException}.
4286 *
4287 * @param cr The ContentResolver to access.
4288 * @param name The name of the setting to retrieve.
4289 *
4290 * @return The setting's current value.
4291 * @throws SettingNotFoundException Thrown if a setting by the given
4292 * name can't be found or the setting value is not an integer.
4293 */
4294 public static long getLong(ContentResolver cr, String name)
4295 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07004296 return getLongForUser(cr, name, UserHandle.myUserId());
4297 }
4298
4299 /** @hide */
4300 public static long getLongForUser(ContentResolver cr, String name, int userHandle)
4301 throws SettingNotFoundException {
4302 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004303 try {
4304 return Long.parseLong(valString);
4305 } catch (NumberFormatException e) {
4306 throw new SettingNotFoundException(name);
4307 }
4308 }
4309
4310 /**
4311 * Convenience function for updating a secure settings value as a long
4312 * integer. This will either create a new entry in the table if the
4313 * given name does not exist, or modify the value of the existing row
4314 * with that name. Note that internally setting values are always
4315 * stored as strings, so this function converts the given value to a
4316 * string before storing it.
4317 *
4318 * @param cr The ContentResolver to access.
4319 * @param name The name of the setting to modify.
4320 * @param value The new value for the setting.
4321 * @return true if the value was set, false on database errors
4322 */
4323 public static boolean putLong(ContentResolver cr, String name, long value) {
Christopher Tate06efb532012-08-24 15:29:27 -07004324 return putLongForUser(cr, name, value, UserHandle.myUserId());
4325 }
4326
4327 /** @hide */
4328 public static boolean putLongForUser(ContentResolver cr, String name, long value,
4329 int userHandle) {
4330 return putStringForUser(cr, name, Long.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004331 }
4332
4333 /**
4334 * Convenience function for retrieving a single secure settings value
4335 * as a floating point number. Note that internally setting values are
4336 * always stored as strings; this function converts the string to an
4337 * float for you. The default value will be returned if the setting
4338 * is not defined or not a valid float.
4339 *
4340 * @param cr The ContentResolver to access.
4341 * @param name The name of the setting to retrieve.
4342 * @param def Value to return if the setting is not defined.
4343 *
4344 * @return The setting's current value, or 'def' if it is not defined
4345 * or not a valid float.
4346 */
4347 public static float getFloat(ContentResolver cr, String name, float def) {
Christopher Tate06efb532012-08-24 15:29:27 -07004348 return getFloatForUser(cr, name, def, UserHandle.myUserId());
4349 }
4350
4351 /** @hide */
4352 public static float getFloatForUser(ContentResolver cr, String name, float def,
4353 int userHandle) {
4354 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004355 try {
4356 return v != null ? Float.parseFloat(v) : def;
4357 } catch (NumberFormatException e) {
4358 return def;
4359 }
4360 }
4361
4362 /**
4363 * Convenience function for retrieving a single secure settings value
4364 * as a float. Note that internally setting values are always
4365 * stored as strings; this function converts the string to a float
4366 * for you.
4367 * <p>
4368 * This version does not take a default value. If the setting has not
4369 * been set, or the string value is not a number,
4370 * it throws {@link SettingNotFoundException}.
4371 *
4372 * @param cr The ContentResolver to access.
4373 * @param name The name of the setting to retrieve.
4374 *
4375 * @throws SettingNotFoundException Thrown if a setting by the given
4376 * name can't be found or the setting value is not a float.
4377 *
4378 * @return The setting's current value.
4379 */
4380 public static float getFloat(ContentResolver cr, String name)
4381 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07004382 return getFloatForUser(cr, name, UserHandle.myUserId());
4383 }
4384
4385 /** @hide */
4386 public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
4387 throws SettingNotFoundException {
4388 String v = getStringForUser(cr, name, userHandle);
Brian Muramatsue1d46982010-12-06 17:34:20 -08004389 if (v == null) {
4390 throw new SettingNotFoundException(name);
4391 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004392 try {
4393 return Float.parseFloat(v);
4394 } catch (NumberFormatException e) {
4395 throw new SettingNotFoundException(name);
4396 }
4397 }
4398
4399 /**
4400 * Convenience function for updating a single settings value as a
4401 * floating point number. This will either create a new entry in the
4402 * table if the given name does not exist, or modify the value of the
4403 * existing row with that name. Note that internally setting values
4404 * are always stored as strings, so this function converts the given
4405 * value to a string before storing it.
4406 *
4407 * @param cr The ContentResolver to access.
4408 * @param name The name of the setting to modify.
4409 * @param value The new value for the setting.
4410 * @return true if the value was set, false on database errors
4411 */
4412 public static boolean putFloat(ContentResolver cr, String name, float value) {
Christopher Tate06efb532012-08-24 15:29:27 -07004413 return putFloatForUser(cr, name, value, UserHandle.myUserId());
4414 }
4415
4416 /** @hide */
4417 public static boolean putFloatForUser(ContentResolver cr, String name, float value,
4418 int userHandle) {
4419 return putStringForUser(cr, name, Float.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004420 }
4421
4422 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004423 * @deprecated Use {@link android.provider.Settings.Global#DEVELOPMENT_SETTINGS_ENABLED}
4424 * instead
Dianne Hackborn895f99e2012-02-02 11:49:12 -08004425 */
Christopher Tate06efb532012-08-24 15:29:27 -07004426 @Deprecated
4427 public static final String DEVELOPMENT_SETTINGS_ENABLED =
4428 Global.DEVELOPMENT_SETTINGS_ENABLED;
Dianne Hackborn895f99e2012-02-02 11:49:12 -08004429
4430 /**
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07004431 * When the user has enable the option to have a "bug report" command
4432 * in the power menu.
Christopher Tate58f41ec2013-01-11 15:40:36 -08004433 * @deprecated Use {@link android.provider.Settings.Global#BUGREPORT_IN_POWER_MENU} instead
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07004434 * @hide
4435 */
Christopher Tate58f41ec2013-01-11 15:40:36 -08004436 @Deprecated
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07004437 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
4438
4439 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004440 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004441 */
Christopher Tate06efb532012-08-24 15:29:27 -07004442 @Deprecated
4443 public static final String ADB_ENABLED = Global.ADB_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004444
4445 /**
4446 * Setting to allow mock locations and location provider status to be injected into the
4447 * LocationManager service for testing purposes during application development. These
4448 * locations and status values override actual location and status information generated
4449 * by network, gps, or other location providers.
Svet Ganovf7e9cf42015-05-13 10:40:31 -07004450 *
4451 * @deprecated This settings is not used anymore.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004452 */
Svet Ganovf7e9cf42015-05-13 10:40:31 -07004453 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004454 public static final String ALLOW_MOCK_LOCATION = "mock_location";
4455
4456 /**
Doug Zongkerd8893db2010-01-26 12:29:44 -08004457 * A 64-bit number (as a hex string) that is randomly
Scott Main44895332013-11-12 09:23:13 -08004458 * generated when the user first sets up the device and should remain
4459 * constant for the lifetime of the user's device. The value may
4460 * change if a factory reset is performed on the device.
4461 * <p class="note"><strong>Note:</strong> When a device has <a
4462 * href="{@docRoot}about/versions/android-4.2.html#MultipleUsers">multiple users</a>
4463 * (available on certain devices running Android 4.2 or higher), each user appears as a
4464 * completely separate device, so the {@code ANDROID_ID} value is unique to each
4465 * user.</p>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004466 */
4467 public static final String ANDROID_ID = "android_id";
4468
4469 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004470 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004471 */
Christopher Tate06efb532012-08-24 15:29:27 -07004472 @Deprecated
4473 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004474
4475 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004476 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004477 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07004478 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07004479 public static final String DATA_ROAMING = Global.DATA_ROAMING;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004480
4481 /**
4482 * Setting to record the input method used by default, holding the ID
4483 * of the desired method.
4484 */
4485 public static final String DEFAULT_INPUT_METHOD = "default_input_method";
4486
4487 /**
satokab751aa2010-09-14 19:17:36 +09004488 * Setting to record the input method subtype used by default, holding the ID
4489 * of the desired method.
4490 */
4491 public static final String SELECTED_INPUT_METHOD_SUBTYPE =
4492 "selected_input_method_subtype";
4493
4494 /**
satok723a27e2010-11-11 14:58:11 +09004495 * Setting to record the history of input method subtype, holding the pair of ID of IME
4496 * and its last used subtype.
4497 * @hide
4498 */
4499 public static final String INPUT_METHODS_SUBTYPE_HISTORY =
4500 "input_methods_subtype_history";
4501
4502 /**
satok5c58dfc2010-12-14 21:54:47 +09004503 * Setting to record the visibility of input method selector
4504 */
4505 public static final String INPUT_METHOD_SELECTOR_VISIBILITY =
4506 "input_method_selector_visibility";
4507
4508 /**
Dianne Hackborn91097de2014-04-04 18:02:06 -07004509 * The currently selected voice interaction service flattened ComponentName.
4510 * @hide
4511 */
Jeff Sharkeya73b8fd2016-01-06 17:02:08 -07004512 @TestApi
Dianne Hackborn91097de2014-04-04 18:02:06 -07004513 public static final String VOICE_INTERACTION_SERVICE = "voice_interaction_service";
4514
4515 /**
Zhihai Xuaf5971e2013-06-10 20:28:31 -07004516 * bluetooth HCI snoop log configuration
4517 * @hide
4518 */
4519 public static final String BLUETOOTH_HCI_LOG =
4520 "bluetooth_hci_log";
4521
4522 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004523 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004524 */
Christopher Tate06efb532012-08-24 15:29:27 -07004525 @Deprecated
4526 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004527
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004528 /**
Russell Brennerde6ae442012-09-26 20:53:10 -07004529 * Whether the current user has been set up via setup wizard (0 = false, 1 = true)
4530 * @hide
4531 */
4532 public static final String USER_SETUP_COMPLETE = "user_setup_complete";
4533
4534 /**
Ido Ofird193c672016-03-01 13:27:54 -08004535 * Prefix for category name that marks whether a suggested action from that category was
4536 * completed.
4537 * @hide
4538 */
4539 public static final String COMPLETED_CATEGORY_PREFIX = "suggested.completed_category.";
4540
4541 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004542 * List of input methods that are currently enabled. This is a string
4543 * containing the IDs of all enabled input methods, each ID separated
4544 * by ':'.
4545 */
4546 public static final String ENABLED_INPUT_METHODS = "enabled_input_methods";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004547
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004548 /**
Amith Yamasanie861ec12010-03-24 21:39:27 -07004549 * List of system input methods that are currently disabled. This is a string
4550 * containing the IDs of all disabled input methods, each ID separated
4551 * by ':'.
4552 * @hide
4553 */
4554 public static final String DISABLED_SYSTEM_INPUT_METHODS = "disabled_system_input_methods";
4555
4556 /**
Michael Wright7b5a96b2014-08-09 19:28:42 -07004557 * Whether to show the IME when a hard keyboard is connected. This is a boolean that
4558 * determines if the IME should be shown when a hard keyboard is attached.
4559 * @hide
4560 */
4561 public static final String SHOW_IME_WITH_HARD_KEYBOARD = "show_ime_with_hard_keyboard";
4562
4563 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07004564 * Host name and port for global http proxy. Uses ':' seperator for
4565 * between host and port.
4566 *
4567 * @deprecated Use {@link Global#HTTP_PROXY}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004568 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07004569 @Deprecated
4570 public static final String HTTP_PROXY = Global.HTTP_PROXY;
Robert Greenwalte90aa5e2010-09-01 11:34:05 -07004571
4572 /**
Robin Lee244ce8e2016-01-05 18:03:46 +00004573 * Package designated as always-on VPN provider.
4574 *
4575 * @hide
4576 */
4577 public static final String ALWAYS_ON_VPN_APP = "always_on_vpn_app";
4578
4579 /**
Christopher Tateaa036a22014-05-19 16:33:27 -07004580 * Whether applications can be installed for this user via the system's
4581 * {@link Intent#ACTION_INSTALL_PACKAGE} mechanism.
4582 *
4583 * <p>1 = permit app installation via the system package installer intent
4584 * <p>0 = do not allow use of the package installer
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004585 */
Christopher Tateaa036a22014-05-19 16:33:27 -07004586 public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004587
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004588 /**
Tom O'Neill923c0dc2014-03-03 11:07:55 -08004589 * Comma-separated list of location providers that activities may access. Do not rely on
4590 * this value being present in settings.db or on ContentObserver notifications on the
4591 * corresponding Uri.
Tom O'Neilla324ac72013-08-26 14:40:23 -07004592 *
Tom O'Neill923c0dc2014-03-03 11:07:55 -08004593 * @deprecated use {@link #LOCATION_MODE} and
4594 * {@link LocationManager#MODE_CHANGED_ACTION} (or
4595 * {@link LocationManager#PROVIDERS_CHANGED_ACTION})
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004596 */
Tom O'Neilla324ac72013-08-26 14:40:23 -07004597 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004598 public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004599
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004600 /**
Tom O'Neill7f6f4572013-08-27 10:53:15 -07004601 * The degree of location access enabled by the user.
Tom O'Neill923c0dc2014-03-03 11:07:55 -08004602 * <p>
Tom O'Neill7f6f4572013-08-27 10:53:15 -07004603 * When used with {@link #putInt(ContentResolver, String, int)}, must be one of {@link
4604 * #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY}, {@link
4605 * #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}. When used with {@link
4606 * #getInt(ContentResolver, String)}, the caller must gracefully handle additional location
4607 * modes that might be added in the future.
Tom O'Neill923c0dc2014-03-03 11:07:55 -08004608 * <p>
4609 * Note: do not rely on this value being present in settings.db or on ContentObserver
4610 * notifications for the corresponding Uri. Use {@link LocationManager#MODE_CHANGED_ACTION}
4611 * to receive changes in this value.
Tom O'Neilla324ac72013-08-26 14:40:23 -07004612 */
4613 public static final String LOCATION_MODE = "location_mode";
Lifu Tangd1fa1d62015-11-25 21:42:44 -08004614 /**
4615 * Stores the previous location mode when {@link #LOCATION_MODE} is set to
4616 * {@link #LOCATION_MODE_OFF}
4617 * @hide
4618 */
4619 public static final String LOCATION_PREVIOUS_MODE = "location_previous_mode";
Tom O'Neilla324ac72013-08-26 14:40:23 -07004620
4621 /**
Lifu Tangd1fa1d62015-11-25 21:42:44 -08004622 * Sets all location providers to the previous states before location was turned off.
4623 * @hide
4624 */
4625 public static final int LOCATION_MODE_PREVIOUS = -1;
4626 /**
Tom O'Neill7f6f4572013-08-27 10:53:15 -07004627 * Location access disabled.
Tom O'Neill1f48b782013-08-19 18:14:56 -07004628 */
4629 public static final int LOCATION_MODE_OFF = 0;
4630 /**
4631 * Network Location Provider disabled, but GPS and other sensors enabled.
4632 */
4633 public static final int LOCATION_MODE_SENSORS_ONLY = 1;
4634 /**
Tom O'Neilld5759432013-09-11 11:03:03 -07004635 * Reduced power usage, such as limiting the number of GPS updates per hour. Requests
4636 * with {@link android.location.Criteria#POWER_HIGH} may be downgraded to
4637 * {@link android.location.Criteria#POWER_MEDIUM}.
Tom O'Neill1f48b782013-08-19 18:14:56 -07004638 */
4639 public static final int LOCATION_MODE_BATTERY_SAVING = 2;
4640 /**
4641 * Best-effort location computation allowed.
4642 */
4643 public static final int LOCATION_MODE_HIGH_ACCURACY = 3;
4644
4645 /**
Danielle Millett925a7d82012-03-19 18:02:20 -04004646 * A flag containing settings used for biometric weak
4647 * @hide
4648 */
Adrian Roos230635e2015-01-07 20:50:29 +01004649 @Deprecated
Danielle Millett925a7d82012-03-19 18:02:20 -04004650 public static final String LOCK_BIOMETRIC_WEAK_FLAGS =
4651 "lock_biometric_weak_flags";
4652
4653 /**
Jason Monk94cfd9d2014-10-31 13:18:21 -04004654 * Whether lock-to-app will lock the keyguard when exiting.
4655 * @hide
4656 */
4657 public static final String LOCK_TO_APP_EXIT_LOCKED = "lock_to_app_exit_locked";
4658
4659 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08004660 * Whether autolock is enabled (0 = false, 1 = true)
Adrian Roos9dd16eb2015-01-08 16:20:49 +01004661 *
4662 * @deprecated Use {@link android.app.KeyguardManager} to determine the state and security
Adrian Roos7811d9f2015-07-27 15:10:13 -07004663 * level of the keyguard. Accessing this setting from an app that is targeting
Deepanshu Guptae836a222015-07-31 12:11:07 -07004664 * {@link VERSION_CODES#M} or later throws a {@code SecurityException}.
Amith Yamasani156c4352010-03-05 17:10:03 -08004665 */
Adrian Roos9dd16eb2015-01-08 16:20:49 +01004666 @Deprecated
Amith Yamasani156c4352010-03-05 17:10:03 -08004667 public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock";
4668
4669 /**
4670 * Whether lock pattern is visible as user enters (0 = false, 1 = true)
Adrian Roos7811d9f2015-07-27 15:10:13 -07004671 *
4672 * @deprecated Accessing this setting from an app that is targeting
Deepanshu Guptae836a222015-07-31 12:11:07 -07004673 * {@link VERSION_CODES#M} or later throws a {@code SecurityException}.
Amith Yamasani156c4352010-03-05 17:10:03 -08004674 */
Adrian Roos7811d9f2015-07-27 15:10:13 -07004675 @Deprecated
Amith Yamasani156c4352010-03-05 17:10:03 -08004676 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
4677
4678 /**
Jeff Sharkey5ed9d682012-10-10 14:28:27 -07004679 * Whether lock pattern will vibrate as user enters (0 = false, 1 =
4680 * true)
4681 *
4682 * @deprecated Starting in {@link VERSION_CODES#JELLY_BEAN_MR1} the
4683 * lockscreen uses
4684 * {@link Settings.System#HAPTIC_FEEDBACK_ENABLED}.
Adrian Roos7811d9f2015-07-27 15:10:13 -07004685 * Accessing this setting from an app that is targeting
Deepanshu Guptae836a222015-07-31 12:11:07 -07004686 * {@link VERSION_CODES#M} or later throws a {@code SecurityException}.
Amith Yamasani156c4352010-03-05 17:10:03 -08004687 */
Jeff Sharkey5ed9d682012-10-10 14:28:27 -07004688 @Deprecated
4689 public static final String
4690 LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = "lock_pattern_tactile_feedback_enabled";
Amith Yamasani156c4352010-03-05 17:10:03 -08004691
4692 /**
Jim Millerbc4603b2010-08-30 21:21:34 -07004693 * This preference allows the device to be locked given time after screen goes off,
4694 * subject to current DeviceAdmin policy limits.
4695 * @hide
4696 */
4697 public static final String LOCK_SCREEN_LOCK_AFTER_TIMEOUT = "lock_screen_lock_after_timeout";
4698
4699
4700 /**
John Spurlock5f050e52012-10-27 10:44:19 -04004701 * This preference contains the string that shows for owner info on LockScreen.
Jim Miller253a5ef2010-10-13 20:57:29 -07004702 * @hide
Jim Miller187ec582013-04-15 18:27:54 -07004703 * @deprecated
Jim Miller253a5ef2010-10-13 20:57:29 -07004704 */
4705 public static final String LOCK_SCREEN_OWNER_INFO = "lock_screen_owner_info";
4706
4707 /**
John Spurlock5f050e52012-10-27 10:44:19 -04004708 * Ids of the user-selected appwidgets on the lockscreen (comma-delimited).
Jim Millerf229e4d2012-09-12 20:32:50 -07004709 * @hide
4710 */
Adrian Roos230635e2015-01-07 20:50:29 +01004711 @Deprecated
Michael Jurkaaa2859a2012-10-24 12:46:49 -07004712 public static final String LOCK_SCREEN_APPWIDGET_IDS =
4713 "lock_screen_appwidget_ids";
Jim Millerf229e4d2012-09-12 20:32:50 -07004714
4715 /**
Jim Miller51117262012-11-04 17:58:09 -08004716 * Id of the appwidget shown on the lock screen when appwidgets are disabled.
4717 * @hide
4718 */
Adrian Roos230635e2015-01-07 20:50:29 +01004719 @Deprecated
Jim Miller51117262012-11-04 17:58:09 -08004720 public static final String LOCK_SCREEN_FALLBACK_APPWIDGET_ID =
4721 "lock_screen_fallback_appwidget_id";
4722
4723 /**
John Spurlock5f050e52012-10-27 10:44:19 -04004724 * Index of the lockscreen appwidget to restore, -1 if none.
4725 * @hide
4726 */
Adrian Roos230635e2015-01-07 20:50:29 +01004727 @Deprecated
John Spurlock5f050e52012-10-27 10:44:19 -04004728 public static final String LOCK_SCREEN_STICKY_APPWIDGET =
4729 "lock_screen_sticky_appwidget";
4730
4731 /**
4732 * This preference enables showing the owner info on LockScreen.
Jim Miller253a5ef2010-10-13 20:57:29 -07004733 * @hide
Jim Miller187ec582013-04-15 18:27:54 -07004734 * @deprecated
Jim Miller253a5ef2010-10-13 20:57:29 -07004735 */
4736 public static final String LOCK_SCREEN_OWNER_INFO_ENABLED =
4737 "lock_screen_owner_info_enabled";
4738
4739 /**
Dan Sandler5d7c3cc2014-02-18 17:35:15 -05004740 * When set by a user, allows notifications to be shown atop a securely locked screen
4741 * in their full "private" form (same as when the device is unlocked).
Dan Sandlerfd16d562014-02-13 18:43:31 -08004742 * @hide
4743 */
4744 public static final String LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS =
4745 "lock_screen_allow_private_notifications";
4746
4747 /**
Adrian Roos3aec6382016-02-05 14:19:01 -08004748 * When set by a user, allows notification remote input atop a securely locked screen
4749 * without having to unlock
4750 * @hide
4751 */
4752 public static final String LOCK_SCREEN_ALLOW_REMOTE_INPUT =
4753 "lock_screen_allow_remote_input";
4754
4755 /**
Chris Wrencd8f4f72014-08-27 18:48:13 -04004756 * Set by the system to track if the user needs to see the call to action for
4757 * the lockscreen notification policy.
4758 * @hide
4759 */
4760 public static final String SHOW_NOTE_ABOUT_NOTIFICATION_HIDING =
4761 "show_note_about_notification_hiding";
4762
4763 /**
Adrian Roos3870d452014-09-05 18:22:28 +02004764 * Set to 1 by the system after trust agents have been initialized.
4765 * @hide
4766 */
4767 public static final String TRUST_AGENTS_INITIALIZED =
4768 "trust_agents_initialized";
4769
4770 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004771 * The Logging ID (a unique 64-bit value) as a hex string.
4772 * Used as a pseudonymous identifier for logging.
4773 * @deprecated This identifier is poorly initialized and has
4774 * many collisions. It should not be used.
4775 */
4776 @Deprecated
4777 public static final String LOGGING_ID = "logging_id";
4778
4779 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004780 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004781 */
Christopher Tate06efb532012-08-24 15:29:27 -07004782 @Deprecated
4783 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004784
4785 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08004786 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004787 */
4788 public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004789
4790 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08004791 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004792 */
4793 public static final String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004794
4795 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08004796 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004797 */
4798 public static final String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004799
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004800 /**
4801 * Settings classname to launch when Settings is clicked from All
4802 * Applications. Needed because of user testing between the old
4803 * and new Settings apps.
4804 */
4805 // TODO: 881807
4806 public static final String SETTINGS_CLASSNAME = "settings_classname";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004807
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004808 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004809 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004810 */
Christopher Tate06efb532012-08-24 15:29:27 -07004811 @Deprecated
4812 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004813
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004814 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004815 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004816 */
Christopher Tate06efb532012-08-24 15:29:27 -07004817 @Deprecated
4818 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004819
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004820 /**
svetoslavganov75986cf2009-05-14 22:28:01 -07004821 * If accessibility is enabled.
4822 */
4823 public static final String ACCESSIBILITY_ENABLED = "accessibility_enabled";
4824
4825 /**
Svetoslav Ganov00aabf72011-07-21 11:35:03 -07004826 * If touch exploration is enabled.
Svetoslav Ganov35bfede2011-07-14 17:57:06 -07004827 */
Svetoslav Ganov00aabf72011-07-21 11:35:03 -07004828 public static final String TOUCH_EXPLORATION_ENABLED = "touch_exploration_enabled";
Svetoslav Ganov35bfede2011-07-14 17:57:06 -07004829
4830 /**
svetoslavganov75986cf2009-05-14 22:28:01 -07004831 * List of the enabled accessibility providers.
4832 */
4833 public static final String ENABLED_ACCESSIBILITY_SERVICES =
4834 "enabled_accessibility_services";
4835
4836 /**
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07004837 * List of the accessibility services to which the user has granted
Svetoslav Ganov9a4c5cd2012-05-30 14:06:32 -07004838 * permission to put the device into touch exploration mode.
4839 *
4840 * @hide
4841 */
4842 public static final String TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES =
4843 "touch_exploration_granted_accessibility_services";
4844
4845 /**
Svetoslav Ganov55f937a2011-12-05 11:42:07 -08004846 * Whether to speak passwords while in accessibility mode.
4847 */
4848 public static final String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password";
4849
4850 /**
Chris Craikcce47eb2014-07-16 15:12:15 -07004851 * Whether to draw text with high contrast while in accessibility mode.
4852 *
4853 * @hide
4854 */
4855 public static final String ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED =
4856 "high_text_contrast_enabled";
4857
4858 /**
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08004859 * If injection of accessibility enhancing JavaScript screen-reader
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07004860 * is enabled.
4861 * <p>
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08004862 * Note: The JavaScript based screen-reader is served by the
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07004863 * Google infrastructure and enable users with disabilities to
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07004864 * efficiently navigate in and explore web content.
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07004865 * </p>
4866 * <p>
4867 * This property represents a boolean value.
4868 * </p>
4869 * @hide
4870 */
4871 public static final String ACCESSIBILITY_SCRIPT_INJECTION =
4872 "accessibility_script_injection";
4873
4874 /**
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08004875 * The URL for the injected JavaScript based screen-reader used
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07004876 * for providing accessibility of content in WebView.
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08004877 * <p>
4878 * Note: The JavaScript based screen-reader is served by the
4879 * Google infrastructure and enable users with disabilities to
4880 * efficiently navigate in and explore web content.
4881 * </p>
4882 * <p>
4883 * This property represents a string value.
4884 * </p>
4885 * @hide
4886 */
4887 public static final String ACCESSIBILITY_SCREEN_READER_URL =
4888 "accessibility_script_injection_url";
4889
4890 /**
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07004891 * Key bindings for navigation in built-in accessibility support for web content.
4892 * <p>
4893 * Note: These key bindings are for the built-in accessibility navigation for
4894 * web content which is used as a fall back solution if JavaScript in a WebView
4895 * is not enabled or the user has not opted-in script injection from Google.
4896 * </p>
4897 * <p>
4898 * The bindings are separated by semi-colon. A binding is a mapping from
4899 * a key to a sequence of actions (for more details look at
4900 * android.webkit.AccessibilityInjector). A key is represented as the hexademical
4901 * string representation of an integer obtained from a meta state (optional) shifted
4902 * sixteen times left and bitwise ored with a key code. An action is represented
4903 * as a hexademical string representation of an integer where the first two digits
4904 * are navigation action index, the second, the third, and the fourth digit pairs
4905 * represent the action arguments. The separate actions in a binding are colon
4906 * separated. The key and the action sequence it maps to are separated by equals.
4907 * </p>
4908 * <p>
4909 * For example, the binding below maps the DPAD right button to traverse the
4910 * current navigation axis once without firing an accessibility event and to
4911 * perform the same traversal again but to fire an event:
4912 * <code>
4913 * 0x16=0x01000100:0x01000101;
4914 * </code>
4915 * </p>
4916 * <p>
4917 * The goal of this binding is to enable dynamic rebinding of keys to
4918 * navigation actions for web content without requiring a framework change.
4919 * </p>
4920 * <p>
4921 * This property represents a string value.
4922 * </p>
4923 * @hide
4924 */
4925 public static final String ACCESSIBILITY_WEB_CONTENT_KEY_BINDINGS =
4926 "accessibility_web_content_key_bindings";
4927
4928 /**
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07004929 * Setting that specifies whether the display magnification is enabled.
4930 * Display magnifications allows the user to zoom in the display content
4931 * and is targeted to low vision users. The current magnification scale
4932 * is controlled by {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}.
4933 *
4934 * @hide
4935 */
4936 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED =
4937 "accessibility_display_magnification_enabled";
4938
4939 /**
4940 * Setting that specifies what the display magnification scale is.
4941 * Display magnifications allows the user to zoom in the display
4942 * content and is targeted to low vision users. Whether a display
4943 * magnification is performed is controlled by
4944 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED}
4945 *
4946 * @hide
4947 */
4948 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE =
4949 "accessibility_display_magnification_scale";
4950
4951 /**
4952 * Setting that specifies whether the display magnification should be
4953 * automatically updated. If this fearture is enabled the system will
4954 * exit magnification mode or pan the viewport when a context change
4955 * occurs. For example, on staring a new activity or rotating the screen,
4956 * the system may zoom out so the user can see the new context he is in.
4957 * Another example is on showing a window that is not visible in the
4958 * magnified viewport the system may pan the viewport to make the window
4959 * the has popped up so the user knows that the context has changed.
4960 * Whether a screen magnification is performed is controlled by
4961 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED}
4962 *
4963 * @hide
4964 */
4965 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE =
4966 "accessibility_display_magnification_auto_update";
4967
4968 /**
Anna Galusza9b278112016-01-04 11:37:37 -08004969 * Setting that specifies what mode the soft keyboard is in (default or hidden). Can be
4970 * modified from an AccessibilityService using the SoftKeyboardController.
4971 *
4972 * @hide
4973 */
4974 public static final String ACCESSIBILITY_SOFT_KEYBOARD_MODE =
4975 "accessibility_soft_keyboard_mode";
4976
4977 /**
4978 * Default soft keyboard behavior.
4979 *
4980 * @hide
4981 */
4982 public static final int SHOW_MODE_AUTO = 0;
4983
4984 /**
4985 * Soft keyboard is never shown.
4986 *
4987 * @hide
4988 */
4989 public static final int SHOW_MODE_HIDDEN = 1;
4990
4991 /**
Alan Viveretteef793802013-07-23 14:15:28 -07004992 * Setting that specifies whether timed text (captions) should be
4993 * displayed in video content. Text display properties are controlled by
4994 * the following settings:
4995 * <ul>
4996 * <li>{@link #ACCESSIBILITY_CAPTIONING_LOCALE}
4997 * <li>{@link #ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR}
4998 * <li>{@link #ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR}
4999 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_COLOR}
5000 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_TYPE}
5001 * <li>{@link #ACCESSIBILITY_CAPTIONING_TYPEFACE}
Alan Viverette69ce69b2013-08-29 12:23:48 -07005002 * <li>{@link #ACCESSIBILITY_CAPTIONING_FONT_SCALE}
Alan Viveretteef793802013-07-23 14:15:28 -07005003 * </ul>
5004 *
5005 * @hide
5006 */
5007 public static final String ACCESSIBILITY_CAPTIONING_ENABLED =
5008 "accessibility_captioning_enabled";
5009
5010 /**
5011 * Setting that specifies the language for captions as a locale string,
5012 * e.g. en_US.
5013 *
5014 * @see java.util.Locale#toString
5015 * @hide
5016 */
5017 public static final String ACCESSIBILITY_CAPTIONING_LOCALE =
5018 "accessibility_captioning_locale";
5019
5020 /**
Alan Viverette43a1e3d2013-08-02 16:45:03 -07005021 * Integer property that specifies the preset style for captions, one
5022 * of:
5023 * <ul>
Alan Viverette69ce69b2013-08-29 12:23:48 -07005024 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESET_CUSTOM}
5025 * <li>a valid index of {@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESETS}
Alan Viverette43a1e3d2013-08-02 16:45:03 -07005026 * </ul>
5027 *
5028 * @see java.util.Locale#toString
5029 * @hide
5030 */
5031 public static final String ACCESSIBILITY_CAPTIONING_PRESET =
5032 "accessibility_captioning_preset";
5033
5034 /**
Alan Viveretteef793802013-07-23 14:15:28 -07005035 * Integer property that specifes the background color for captions as a
5036 * packed 32-bit color.
5037 *
5038 * @see android.graphics.Color#argb
5039 * @hide
5040 */
5041 public static final String ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR =
5042 "accessibility_captioning_background_color";
5043
5044 /**
5045 * Integer property that specifes the foreground color for captions as a
5046 * packed 32-bit color.
5047 *
5048 * @see android.graphics.Color#argb
5049 * @hide
5050 */
5051 public static final String ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR =
5052 "accessibility_captioning_foreground_color";
5053
5054 /**
5055 * Integer property that specifes the edge type for captions, one of:
5056 * <ul>
Alan Viverette69ce69b2013-08-29 12:23:48 -07005057 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_NONE}
5058 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_OUTLINE}
5059 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_DROP_SHADOW}
Alan Viveretteef793802013-07-23 14:15:28 -07005060 * </ul>
5061 *
5062 * @see #ACCESSIBILITY_CAPTIONING_EDGE_COLOR
5063 * @hide
5064 */
5065 public static final String ACCESSIBILITY_CAPTIONING_EDGE_TYPE =
5066 "accessibility_captioning_edge_type";
5067
5068 /**
5069 * Integer property that specifes the edge color for captions as a
5070 * packed 32-bit color.
5071 *
5072 * @see #ACCESSIBILITY_CAPTIONING_EDGE_TYPE
5073 * @see android.graphics.Color#argb
5074 * @hide
5075 */
5076 public static final String ACCESSIBILITY_CAPTIONING_EDGE_COLOR =
5077 "accessibility_captioning_edge_color";
5078
5079 /**
Alan Viverette55d70622013-12-11 15:22:14 -08005080 * Integer property that specifes the window color for captions as a
5081 * packed 32-bit color.
5082 *
5083 * @see android.graphics.Color#argb
5084 * @hide
5085 */
5086 public static final String ACCESSIBILITY_CAPTIONING_WINDOW_COLOR =
5087 "accessibility_captioning_window_color";
5088
5089 /**
Alan Viveretteef793802013-07-23 14:15:28 -07005090 * String property that specifies the typeface for captions, one of:
5091 * <ul>
5092 * <li>DEFAULT
5093 * <li>MONOSPACE
5094 * <li>SANS_SERIF
5095 * <li>SERIF
5096 * </ul>
5097 *
5098 * @see android.graphics.Typeface
5099 * @hide
5100 */
5101 public static final String ACCESSIBILITY_CAPTIONING_TYPEFACE =
5102 "accessibility_captioning_typeface";
5103
5104 /**
Alan Viverette69ce69b2013-08-29 12:23:48 -07005105 * Floating point property that specifies font scaling for captions.
Alan Viveretteef793802013-07-23 14:15:28 -07005106 *
5107 * @hide
5108 */
Alan Viverette69ce69b2013-08-29 12:23:48 -07005109 public static final String ACCESSIBILITY_CAPTIONING_FONT_SCALE =
5110 "accessibility_captioning_font_scale";
Alan Viveretteef793802013-07-23 14:15:28 -07005111
5112 /**
Alan Viverette410d4e32013-09-30 15:37:38 -07005113 * Setting that specifies whether display color inversion is enabled.
Alan Viverette410d4e32013-09-30 15:37:38 -07005114 */
5115 public static final String ACCESSIBILITY_DISPLAY_INVERSION_ENABLED =
5116 "accessibility_display_inversion_enabled";
5117
5118 /**
Alan Viverette410d4e32013-09-30 15:37:38 -07005119 * Setting that specifies whether display color space adjustment is
5120 * enabled.
5121 *
5122 * @hide
5123 */
5124 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED =
5125 "accessibility_display_daltonizer_enabled";
5126
5127 /**
5128 * Integer property that specifies the type of color space adjustment to
5129 * perform. Valid values are defined in AccessibilityManager.
5130 *
5131 * @hide
5132 */
5133 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER =
5134 "accessibility_display_daltonizer";
5135
5136 /**
Jason Monk08e7fa92015-12-07 20:05:08 -05005137 * Float list that specifies the color matrix to apply to
5138 * the display. Valid values are defined in AccessibilityManager.
5139 *
5140 * @hide
5141 */
5142 public static final String ACCESSIBILITY_DISPLAY_COLOR_MATRIX =
5143 "accessibility_display_color_matrix";
5144
5145 /**
Toni Barzic386f8342015-09-09 12:30:41 -07005146 * Setting that specifies whether automatic click when the mouse pointer stops moving is
5147 * enabled.
5148 *
5149 * @hide
5150 */
5151 public static final String ACCESSIBILITY_AUTOCLICK_ENABLED =
5152 "accessibility_autoclick_enabled";
5153
5154 /**
5155 * Integer setting specifying amount of time in ms the mouse pointer has to stay still
5156 * before performing click when {@link #ACCESSIBILITY_AUTOCLICK_ENABLED} is set.
5157 *
5158 * @see #ACCESSIBILITY_AUTOCLICK_ENABLED
5159 * @hide
5160 */
5161 public static final String ACCESSIBILITY_AUTOCLICK_DELAY =
5162 "accessibility_autoclick_delay";
5163
5164 /**
Jun Mukai19a56012015-11-24 11:25:52 -08005165 * Whether or not larger size icons are used for the pointer of mouse/trackpad for
5166 * accessibility.
5167 * (0 = false, 1 = true)
5168 * @hide
5169 */
5170 public static final String ACCESSIBILITY_LARGE_POINTER_ICON =
5171 "accessibility_large_pointer_icon";
5172
5173 /**
Toni Barzic386f8342015-09-09 12:30:41 -07005174 * The timeout for considering a press to be a long press in milliseconds.
Svetoslav Ganov54d068e2011-03-02 12:58:40 -08005175 * @hide
5176 */
5177 public static final String LONG_PRESS_TIMEOUT = "long_press_timeout";
5178
5179 /**
Svetoslav Ganov6bd20bc2013-09-02 15:24:45 -07005180 * List of the enabled print services.
Philip P. Moltmann8141bdf2015-12-21 17:03:05 -08005181 *
5182 * N and beyond uses {@link #DISABLED_PRINT_SERVICES}. But this might be used in an upgrade
5183 * from pre-N.
5184 *
Svetoslav Ganov4b9a4d12013-06-11 15:20:06 -07005185 * @hide
5186 */
5187 public static final String ENABLED_PRINT_SERVICES =
5188 "enabled_print_services";
5189
5190 /**
Philip P. Moltmann8141bdf2015-12-21 17:03:05 -08005191 * List of the disabled print services.
5192 *
Svetoslav Ganov6bd20bc2013-09-02 15:24:45 -07005193 * @hide
5194 */
Philip P. Moltmann8141bdf2015-12-21 17:03:05 -08005195 public static final String DISABLED_PRINT_SERVICES =
5196 "disabled_print_services";
Svetoslav Ganov6bd20bc2013-09-02 15:24:45 -07005197
5198 /**
Alan Viverette5e8d8372016-02-03 15:38:59 -05005199 * The saved value for WindowManagerService.setForcedDisplayDensity()
5200 * formatted as a single integer representing DPI. If unset, then use
5201 * the real display density.
5202 *
5203 * @hide
5204 */
5205 public static final String DISPLAY_DENSITY_FORCED = "display_density_forced";
5206
5207 /**
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07005208 * Setting to always use the default text-to-speech settings regardless
5209 * of the application settings.
5210 * 1 = override application settings,
5211 * 0 = use application settings (if specified).
Narayan Kamath6d632962011-08-24 11:51:37 +01005212 *
5213 * @deprecated The value of this setting is no longer respected by
5214 * the framework text to speech APIs as of the Ice Cream Sandwich release.
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07005215 */
Narayan Kamath6d632962011-08-24 11:51:37 +01005216 @Deprecated
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07005217 public static final String TTS_USE_DEFAULTS = "tts_use_defaults";
5218
5219 /**
5220 * Default text-to-speech engine speech rate. 100 = 1x
5221 */
5222 public static final String TTS_DEFAULT_RATE = "tts_default_rate";
5223
5224 /**
5225 * Default text-to-speech engine pitch. 100 = 1x
5226 */
5227 public static final String TTS_DEFAULT_PITCH = "tts_default_pitch";
5228
5229 /**
5230 * Default text-to-speech engine.
5231 */
5232 public static final String TTS_DEFAULT_SYNTH = "tts_default_synth";
5233
5234 /**
Jean-Michel Trivif4782672009-06-09 16:22:48 -07005235 * Default text-to-speech language.
Narayan Kamath6d632962011-08-24 11:51:37 +01005236 *
5237 * @deprecated this setting is no longer in use, as of the Ice Cream
5238 * Sandwich release. Apps should never need to read this setting directly,
5239 * instead can query the TextToSpeech framework classes for the default
5240 * locale. {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivif4782672009-06-09 16:22:48 -07005241 */
Narayan Kamath6d632962011-08-24 11:51:37 +01005242 @Deprecated
Jean-Michel Trivif4782672009-06-09 16:22:48 -07005243 public static final String TTS_DEFAULT_LANG = "tts_default_lang";
5244
5245 /**
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07005246 * Default text-to-speech country.
Narayan Kamath6d632962011-08-24 11:51:37 +01005247 *
5248 * @deprecated this setting is no longer in use, as of the Ice Cream
5249 * Sandwich release. Apps should never need to read this setting directly,
5250 * instead can query the TextToSpeech framework classes for the default
5251 * locale. {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07005252 */
Narayan Kamath6d632962011-08-24 11:51:37 +01005253 @Deprecated
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07005254 public static final String TTS_DEFAULT_COUNTRY = "tts_default_country";
5255
5256 /**
5257 * Default text-to-speech locale variant.
Narayan Kamath6d632962011-08-24 11:51:37 +01005258 *
5259 * @deprecated this setting is no longer in use, as of the Ice Cream
5260 * Sandwich release. Apps should never need to read this setting directly,
5261 * instead can query the TextToSpeech framework classes for the
5262 * locale that is in use {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07005263 */
Narayan Kamath6d632962011-08-24 11:51:37 +01005264 @Deprecated
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07005265 public static final String TTS_DEFAULT_VARIANT = "tts_default_variant";
5266
5267 /**
Narayan Kamathe5b8c4d2011-08-22 15:37:47 +01005268 * Stores the default tts locales on a per engine basis. Stored as
5269 * a comma seperated list of values, each value being of the form
5270 * {@code engine_name:locale} for example,
Narayan Kamath6d632962011-08-24 11:51:37 +01005271 * {@code com.foo.ttsengine:eng-USA,com.bar.ttsengine:esp-ESP}. This
5272 * supersedes {@link #TTS_DEFAULT_LANG}, {@link #TTS_DEFAULT_COUNTRY} and
5273 * {@link #TTS_DEFAULT_VARIANT}. Apps should never need to read this
5274 * setting directly, and can query the TextToSpeech framework classes
5275 * for the locale that is in use.
Narayan Kamathe5b8c4d2011-08-22 15:37:47 +01005276 *
5277 * @hide
5278 */
5279 public static final String TTS_DEFAULT_LOCALE = "tts_default_locale";
5280
5281 /**
Charles Chenceffa152010-03-16 21:18:10 -07005282 * Space delimited list of plugin packages that are enabled.
5283 */
5284 public static final String TTS_ENABLED_PLUGINS = "tts_enabled_plugins";
5285
5286 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07005287 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON}
5288 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005289 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07005290 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005291 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
Christopher Tate6f5a9a92012-09-14 17:24:28 -07005292 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005293
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005294 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07005295 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY}
5296 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005297 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07005298 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005299 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
Christopher Tate6f5a9a92012-09-14 17:24:28 -07005300 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005301
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005302 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07005303 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
5304 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005305 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07005306 @Deprecated
5307 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT =
5308 Global.WIFI_NUM_OPEN_NETWORKS_KEPT;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005309
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005310 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07005311 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON}
5312 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005313 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07005314 @Deprecated
5315 public static final String WIFI_ON = Global.WIFI_ON;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005316
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005317 /**
5318 * The acceptable packet loss percentage (range 0 - 100) before trying
5319 * another AP on the same network.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07005320 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005321 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07005322 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005323 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
5324 "wifi_watchdog_acceptable_packet_loss_percentage";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005325
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005326 /**
5327 * The number of access points required for a network in order for the
5328 * watchdog to monitor it.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07005329 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005330 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07005331 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005332 public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005333
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005334 /**
5335 * The delay between background checks.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07005336 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005337 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07005338 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005339 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
5340 "wifi_watchdog_background_check_delay_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005341
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005342 /**
5343 * Whether the Wi-Fi watchdog is enabled for background checking even
5344 * after it thinks the user has connected to a good access point.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07005345 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005346 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07005347 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005348 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
5349 "wifi_watchdog_background_check_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005350
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005351 /**
5352 * The timeout for a background ping
Jeff Brownbf6f6f92012-09-25 15:03:20 -07005353 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005354 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07005355 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005356 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
5357 "wifi_watchdog_background_check_timeout_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005358
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005359 /**
5360 * The number of initial pings to perform that *may* be ignored if they
5361 * fail. Again, if these fail, they will *not* be used in packet loss
5362 * calculation. For example, one network always seemed to time out for
5363 * the first couple pings, so this is set to 3 by default.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07005364 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005365 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07005366 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005367 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
5368 "wifi_watchdog_initial_ignored_ping_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005369
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005370 /**
5371 * The maximum number of access points (per network) to attempt to test.
5372 * If this number is reached, the watchdog will no longer monitor the
5373 * initial connection state for the network. This is a safeguard for
5374 * networks containing multiple APs whose DNS does not respond to pings.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07005375 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005376 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07005377 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005378 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = "wifi_watchdog_max_ap_checks";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005379
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005380 /**
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07005381 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005382 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07005383 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005384 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
5385
5386 /**
5387 * A comma-separated list of SSIDs for which the Wi-Fi watchdog should be enabled.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07005388 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005389 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07005390 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005391 public static final String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list";
5392
5393 /**
5394 * The number of pings to test if an access point is a good connection.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07005395 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005396 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07005397 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005398 public static final String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005399
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005400 /**
5401 * The delay between pings.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07005402 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005403 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07005404 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005405 public static final String WIFI_WATCHDOG_PING_DELAY_MS = "wifi_watchdog_ping_delay_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005406
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005407 /**
5408 * The timeout per ping.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07005409 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005410 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07005411 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005412 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005413
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005414 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005415 * @deprecated Use
5416 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005417 */
Christopher Tate06efb532012-08-24 15:29:27 -07005418 @Deprecated
5419 public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005420
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005421 /**
Jeff Brownbf6f6f92012-09-25 15:03:20 -07005422 * @deprecated Use
5423 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005424 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07005425 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005426 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
Jeff Brownbf6f6f92012-09-25 15:03:20 -07005427 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005428
5429 /**
Jeremy Joslin79294842014-12-03 17:15:28 -08005430 * The number of milliseconds to hold on to a PendingIntent based request. This delay gives
5431 * the receivers of the PendingIntent an opportunity to make a new network request before
5432 * the Network satisfying the request is potentially removed.
5433 *
5434 * @hide
5435 */
5436 public static final String CONNECTIVITY_RELEASE_PENDING_INTENT_DELAY_MS =
5437 "connectivity_release_pending_intent_delay_ms";
5438
5439 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07005440 * Whether background data usage is allowed.
5441 *
5442 * @deprecated As of {@link VERSION_CODES#ICE_CREAM_SANDWICH},
5443 * availability of background data depends on several
5444 * combined factors. When background data is unavailable,
5445 * {@link ConnectivityManager#getActiveNetworkInfo()} will
5446 * now appear disconnected.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005447 */
Jeff Sharkey3a844fc2011-08-16 14:37:57 -07005448 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005449 public static final String BACKGROUND_DATA = "background_data";
Wink Saville04e71b32009-04-02 11:00:54 -07005450
5451 /**
Bjorn Bringert98bfa392010-03-24 10:59:48 +00005452 * Origins for which browsers should allow geolocation by default.
5453 * The value is a space-separated list of origins.
5454 */
5455 public static final String ALLOWED_GEOLOCATION_ORIGINS
5456 = "allowed_geolocation_origins";
5457
5458 /**
Wink Savillee9b06d72009-05-18 21:47:50 -07005459 * The preferred TTY mode 0 = TTy Off, CDMA default
5460 * 1 = TTY Full
5461 * 2 = TTY HCO
5462 * 3 = TTY VCO
5463 * @hide
5464 */
5465 public static final String PREFERRED_TTY_MODE =
5466 "preferred_tty_mode";
5467
Wink Saville04e71b32009-04-02 11:00:54 -07005468 /**
Wink Saville04e71b32009-04-02 11:00:54 -07005469 * Whether the enhanced voice privacy mode is enabled.
5470 * 0 = normal voice privacy
5471 * 1 = enhanced voice privacy
5472 * @hide
5473 */
5474 public static final String ENHANCED_VOICE_PRIVACY_ENABLED = "enhanced_voice_privacy_enabled";
5475
5476 /**
5477 * Whether the TTY mode mode is enabled.
5478 * 0 = disabled
5479 * 1 = enabled
5480 * @hide
5481 */
5482 public static final String TTY_MODE_ENABLED = "tty_mode_enabled";
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005483
5484 /**
Christopher Tate8031a3d2009-07-06 16:36:05 -07005485 * Controls whether settings backup is enabled.
Dianne Hackborncf098292009-07-01 19:55:20 -07005486 * Type: int ( 0 = disabled, 1 = enabled )
5487 * @hide
5488 */
5489 public static final String BACKUP_ENABLED = "backup_enabled";
5490
5491 /**
Christopher Tatecce9da52010-02-03 15:11:15 -08005492 * Controls whether application data is automatically restored from backup
5493 * at install time.
5494 * Type: int ( 0 = disabled, 1 = enabled )
5495 * @hide
5496 */
5497 public static final String BACKUP_AUTO_RESTORE = "backup_auto_restore";
5498
5499 /**
Christopher Tate8031a3d2009-07-06 16:36:05 -07005500 * Indicates whether settings backup has been fully provisioned.
5501 * Type: int ( 0 = unprovisioned, 1 = fully provisioned )
5502 * @hide
5503 */
5504 public static final String BACKUP_PROVISIONED = "backup_provisioned";
5505
5506 /**
Dianne Hackborncf098292009-07-01 19:55:20 -07005507 * Component of the transport to use for backup/restore.
5508 * @hide
5509 */
5510 public static final String BACKUP_TRANSPORT = "backup_transport";
Sanjay Jeyakumar21bf2412009-07-09 13:31:48 -07005511
Dianne Hackbornd7cd29d2009-07-01 11:22:45 -07005512 /**
5513 * Version for which the setup wizard was last shown. Bumped for
5514 * each release when there is new setup information to show.
5515 * @hide
5516 */
5517 public static final String LAST_SETUP_SHOWN = "last_setup_shown";
Dianne Hackborncf098292009-07-01 19:55:20 -07005518
5519 /**
Doug Zongker43866e02010-01-07 12:09:54 -08005520 * The interval in milliseconds after which Wi-Fi is considered idle.
5521 * When idle, it is possible for the device to be switched from Wi-Fi to
5522 * the mobile data network.
5523 * @hide
Jeff Brownbf6f6f92012-09-25 15:03:20 -07005524 * @deprecated Use {@link android.provider.Settings.Global#WIFI_IDLE_MS}
5525 * instead.
Doug Zongker43866e02010-01-07 12:09:54 -08005526 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07005527 @Deprecated
5528 public static final String WIFI_IDLE_MS = Global.WIFI_IDLE_MS;
Doug Zongker43866e02010-01-07 12:09:54 -08005529
5530 /**
Narayan Kamathee69ff42011-06-28 12:07:18 +01005531 * The global search provider chosen by the user (if multiple global
5532 * search providers are installed). This will be the provider returned
5533 * by {@link SearchManager#getGlobalSearchActivity()} if it's still
5534 * installed. This setting is stored as a flattened component name as
5535 * per {@link ComponentName#flattenToString()}.
5536 *
5537 * @hide
5538 */
5539 public static final String SEARCH_GLOBAL_SEARCH_ACTIVITY =
5540 "search_global_search_activity";
5541
5542 /**
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08005543 * The number of promoted sources in GlobalSearch.
5544 * @hide
5545 */
5546 public static final String SEARCH_NUM_PROMOTED_SOURCES = "search_num_promoted_sources";
5547 /**
5548 * The maximum number of suggestions returned by GlobalSearch.
5549 * @hide
5550 */
5551 public static final String SEARCH_MAX_RESULTS_TO_DISPLAY = "search_max_results_to_display";
5552 /**
5553 * The number of suggestions GlobalSearch will ask each non-web search source for.
5554 * @hide
5555 */
5556 public static final String SEARCH_MAX_RESULTS_PER_SOURCE = "search_max_results_per_source";
5557 /**
5558 * The number of suggestions the GlobalSearch will ask the web search source for.
5559 * @hide
5560 */
5561 public static final String SEARCH_WEB_RESULTS_OVERRIDE_LIMIT =
5562 "search_web_results_override_limit";
5563 /**
5564 * The number of milliseconds that GlobalSearch will wait for suggestions from
5565 * promoted sources before continuing with all other sources.
5566 * @hide
5567 */
5568 public static final String SEARCH_PROMOTED_SOURCE_DEADLINE_MILLIS =
5569 "search_promoted_source_deadline_millis";
5570 /**
5571 * The number of milliseconds before GlobalSearch aborts search suggesiton queries.
5572 * @hide
5573 */
5574 public static final String SEARCH_SOURCE_TIMEOUT_MILLIS = "search_source_timeout_millis";
5575 /**
5576 * The maximum number of milliseconds that GlobalSearch shows the previous results
5577 * after receiving a new query.
5578 * @hide
5579 */
5580 public static final String SEARCH_PREFILL_MILLIS = "search_prefill_millis";
5581 /**
5582 * The maximum age of log data used for shortcuts in GlobalSearch.
5583 * @hide
5584 */
5585 public static final String SEARCH_MAX_STAT_AGE_MILLIS = "search_max_stat_age_millis";
5586 /**
5587 * The maximum age of log data used for source ranking in GlobalSearch.
5588 * @hide
5589 */
5590 public static final String SEARCH_MAX_SOURCE_EVENT_AGE_MILLIS =
5591 "search_max_source_event_age_millis";
5592 /**
5593 * The minimum number of impressions needed to rank a source in GlobalSearch.
5594 * @hide
5595 */
5596 public static final String SEARCH_MIN_IMPRESSIONS_FOR_SOURCE_RANKING =
5597 "search_min_impressions_for_source_ranking";
5598 /**
5599 * The minimum number of clicks needed to rank a source in GlobalSearch.
5600 * @hide
5601 */
5602 public static final String SEARCH_MIN_CLICKS_FOR_SOURCE_RANKING =
5603 "search_min_clicks_for_source_ranking";
5604 /**
5605 * The maximum number of shortcuts shown by GlobalSearch.
5606 * @hide
5607 */
5608 public static final String SEARCH_MAX_SHORTCUTS_RETURNED = "search_max_shortcuts_returned";
5609 /**
5610 * The size of the core thread pool for suggestion queries in GlobalSearch.
5611 * @hide
5612 */
5613 public static final String SEARCH_QUERY_THREAD_CORE_POOL_SIZE =
5614 "search_query_thread_core_pool_size";
5615 /**
5616 * The maximum size of the thread pool for suggestion queries in GlobalSearch.
5617 * @hide
5618 */
5619 public static final String SEARCH_QUERY_THREAD_MAX_POOL_SIZE =
5620 "search_query_thread_max_pool_size";
5621 /**
5622 * The size of the core thread pool for shortcut refreshing in GlobalSearch.
5623 * @hide
5624 */
5625 public static final String SEARCH_SHORTCUT_REFRESH_CORE_POOL_SIZE =
5626 "search_shortcut_refresh_core_pool_size";
5627 /**
5628 * The maximum size of the thread pool for shortcut refreshing in GlobalSearch.
5629 * @hide
5630 */
5631 public static final String SEARCH_SHORTCUT_REFRESH_MAX_POOL_SIZE =
5632 "search_shortcut_refresh_max_pool_size";
5633 /**
5634 * The maximun time that excess threads in the GlobalSeach thread pools will
5635 * wait before terminating.
5636 * @hide
5637 */
5638 public static final String SEARCH_THREAD_KEEPALIVE_SECONDS =
5639 "search_thread_keepalive_seconds";
5640 /**
5641 * The maximum number of concurrent suggestion queries to each source.
5642 * @hide
5643 */
5644 public static final String SEARCH_PER_SOURCE_CONCURRENT_QUERY_LIMIT =
5645 "search_per_source_concurrent_query_limit";
5646
San Mehat87734d32010-01-08 12:53:06 -08005647 /**
5648 * Whether or not alert sounds are played on MountService events. (0 = false, 1 = true)
5649 * @hide
5650 */
5651 public static final String MOUNT_PLAY_NOTIFICATION_SND = "mount_play_not_snd";
5652
5653 /**
5654 * Whether or not UMS auto-starts on UMS host detection. (0 = false, 1 = true)
5655 * @hide
5656 */
5657 public static final String MOUNT_UMS_AUTOSTART = "mount_ums_autostart";
5658
5659 /**
5660 * Whether or not a notification is displayed on UMS host detection. (0 = false, 1 = true)
5661 * @hide
5662 */
5663 public static final String MOUNT_UMS_PROMPT = "mount_ums_prompt";
5664
5665 /**
5666 * Whether or not a notification is displayed while UMS is enabled. (0 = false, 1 = true)
5667 * @hide
5668 */
5669 public static final String MOUNT_UMS_NOTIFY_ENABLED = "mount_ums_notify_enabled";
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08005670
Dan Egnor42471dd2010-01-07 17:25:22 -08005671 /**
5672 * If nonzero, ANRs in invisible background processes bring up a dialog.
5673 * Otherwise, the process will be silently killed.
5674 * @hide
5675 */
5676 public static final String ANR_SHOW_BACKGROUND = "anr_show_background";
Erikeebc8e22010-02-18 13:27:19 -08005677
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08005678 /**
5679 * The {@link ComponentName} string of the service to be used as the voice recognition
5680 * service.
Erikeebc8e22010-02-18 13:27:19 -08005681 *
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08005682 * @hide
5683 */
5684 public static final String VOICE_RECOGNITION_SERVICE = "voice_recognition_service";
Dan Egnor42471dd2010-01-07 17:25:22 -08005685
William Luh623a4282013-06-24 12:14:18 -07005686 /**
5687 * Stores whether an user has consented to have apps verified through PAM.
5688 * The value is boolean (1 or 0).
5689 *
5690 * @hide
5691 */
5692 public static final String PACKAGE_VERIFIER_USER_CONSENT =
5693 "package_verifier_user_consent";
satok988323c2011-06-22 16:38:13 +09005694
5695 /**
satokada8c4e2011-08-23 14:56:56 +09005696 * The {@link ComponentName} string of the selected spell checker service which is
5697 * one of the services managed by the text service manager.
5698 *
5699 * @hide
5700 */
5701 public static final String SELECTED_SPELL_CHECKER = "selected_spell_checker";
5702
5703 /**
5704 * The {@link ComponentName} string of the selected subtype of the selected spell checker
satok988323c2011-06-22 16:38:13 +09005705 * service which is one of the services managed by the text service manager.
5706 *
5707 * @hide
5708 */
satokada8c4e2011-08-23 14:56:56 +09005709 public static final String SELECTED_SPELL_CHECKER_SUBTYPE =
5710 "selected_spell_checker_subtype";
satok988323c2011-06-22 16:38:13 +09005711
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08005712 /**
satoka33c4fc2011-08-25 16:50:11 +09005713 * The {@link ComponentName} string whether spell checker is enabled or not.
5714 *
5715 * @hide
5716 */
5717 public static final String SPELL_CHECKER_ENABLED = "spell_checker_enabled";
5718
5719 /**
David Brown458e8062010-03-08 21:52:11 -08005720 * What happens when the user presses the Power button while in-call
5721 * and the screen is on.<br/>
5722 * <b>Values:</b><br/>
5723 * 1 - The Power button turns off the screen and locks the device. (Default behavior)<br/>
5724 * 2 - The Power button hangs up the current call.<br/>
5725 *
5726 * @hide
5727 */
5728 public static final String INCALL_POWER_BUTTON_BEHAVIOR = "incall_power_button_behavior";
5729
5730 /**
5731 * INCALL_POWER_BUTTON_BEHAVIOR value for "turn off screen".
5732 * @hide
5733 */
5734 public static final int INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF = 0x1;
5735
5736 /**
5737 * INCALL_POWER_BUTTON_BEHAVIOR value for "hang up".
5738 * @hide
5739 */
5740 public static final int INCALL_POWER_BUTTON_BEHAVIOR_HANGUP = 0x2;
5741
5742 /**
5743 * INCALL_POWER_BUTTON_BEHAVIOR default value.
5744 * @hide
5745 */
5746 public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT =
5747 INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF;
5748
5749 /**
Jeff Browna20dda42014-05-27 20:57:24 -07005750 * Whether the device should wake when the wake gesture sensor detects motion.
5751 * @hide
5752 */
5753 public static final String WAKE_GESTURE_ENABLED = "wake_gesture_enabled";
5754
5755 /**
John Spurlocka4215ce2014-08-04 14:50:38 -04005756 * Whether the device should doze if configured.
5757 * @hide
5758 */
5759 public static final String DOZE_ENABLED = "doze_enabled";
5760
5761 /**
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07005762 * The current night mode that has been selected by the user. Owned
5763 * and controlled by UiModeManagerService. Constants are as per
5764 * UiModeManager.
5765 * @hide
5766 */
5767 public static final String UI_NIGHT_MODE = "ui_night_mode";
Suchi Amalapurapu40e47252010-04-07 16:15:50 -07005768
5769 /**
John Spurlock1a868b72012-08-22 09:56:51 -04005770 * Whether screensavers are enabled.
Daniel Sandler0601eb72011-04-13 01:01:32 -04005771 * @hide
5772 */
Daniel Sandler2d545362011-11-17 10:38:37 -08005773 public static final String SCREENSAVER_ENABLED = "screensaver_enabled";
Daniel Sandler0601eb72011-04-13 01:01:32 -04005774
5775 /**
John Spurlock1a868b72012-08-22 09:56:51 -04005776 * The user's chosen screensaver components.
Daniel Sandler2d545362011-11-17 10:38:37 -08005777 *
John Spurlock1a868b72012-08-22 09:56:51 -04005778 * These will be launched by the PhoneWindowManager after a timeout when not on
Daniel Sandler2d545362011-11-17 10:38:37 -08005779 * battery, or upon dock insertion (if SCREENSAVER_ACTIVATE_ON_DOCK is set to 1).
Daniel Sandler0601eb72011-04-13 01:01:32 -04005780 * @hide
5781 */
John Spurlock1a868b72012-08-22 09:56:51 -04005782 public static final String SCREENSAVER_COMPONENTS = "screensaver_components";
Daniel Sandler2d545362011-11-17 10:38:37 -08005783
5784 /**
John Spurlock1a868b72012-08-22 09:56:51 -04005785 * If screensavers are enabled, whether the screensaver should be automatically launched
5786 * when the device is inserted into a (desk) dock.
Daniel Sandler2d545362011-11-17 10:38:37 -08005787 * @hide
5788 */
5789 public static final String SCREENSAVER_ACTIVATE_ON_DOCK = "screensaver_activate_on_dock";
Daniel Sandler0601eb72011-04-13 01:01:32 -04005790
John Spurlock1a868b72012-08-22 09:56:51 -04005791 /**
5792 * If screensavers are enabled, whether the screensaver should be automatically launched
5793 * when the screen times out when not on battery.
5794 * @hide
5795 */
5796 public static final String SCREENSAVER_ACTIVATE_ON_SLEEP = "screensaver_activate_on_sleep";
5797
5798 /**
5799 * If screensavers are enabled, the default screensaver component.
5800 * @hide
5801 */
5802 public static final String SCREENSAVER_DEFAULT_COMPONENT = "screensaver_default_component";
5803
Daniel Sandler0601eb72011-04-13 01:01:32 -04005804 /**
Martijn Coenena7397882013-07-30 20:07:47 -07005805 * The default NFC payment component
5806 * @hide
5807 */
5808 public static final String NFC_PAYMENT_DEFAULT_COMPONENT = "nfc_payment_default_component";
5809
5810 /**
Martijn Coenen2f6f3a012014-04-25 17:00:21 -07005811 * Whether NFC payment is handled by the foreground application or a default.
5812 * @hide
5813 */
5814 public static final String NFC_PAYMENT_FOREGROUND = "nfc_payment_foreground";
5815
5816 /**
David Braunf5d83192013-09-16 13:43:51 -07005817 * Specifies the package name currently configured to be the primary sms application
5818 * @hide
5819 */
5820 public static final String SMS_DEFAULT_APPLICATION = "sms_default_application";
5821
5822 /**
Yorke Lee014de022015-04-21 17:15:47 -07005823 * Specifies the package name currently configured to be the default dialer application
5824 * @hide
5825 */
5826 public static final String DIALER_DEFAULT_APPLICATION = "dialer_default_application";
5827
5828 /**
Adrian Roos943eb862015-03-26 12:31:16 -07005829 * Specifies the package name currently configured to be the emergency assistance application
5830 *
5831 * @see android.telephony.TelephonyManager#ACTION_EMERGENCY_ASSISTANCE
5832 *
5833 * @hide
5834 */
5835 public static final String EMERGENCY_ASSISTANCE_APPLICATION = "emergency_assistance_application";
5836
5837 /**
Jorim Jaggi9d910832015-05-18 17:35:26 -07005838 * Specifies whether the current app context on scren (assist data) will be sent to the
5839 * assist application (active voice interaction service).
5840 *
5841 * @hide
5842 */
5843 public static final String ASSIST_STRUCTURE_ENABLED = "assist_structure_enabled";
5844
5845 /**
Jorim Jaggia133f0b2015-06-26 16:40:00 -07005846 * Specifies whether a screenshot of the screen contents will be sent to the assist
5847 * application (active voice interaction service).
5848 *
5849 * @hide
5850 */
5851 public static final String ASSIST_SCREENSHOT_ENABLED = "assist_screenshot_enabled";
5852
5853 /**
John Spurlock7c74f782015-06-04 13:01:42 -04005854 * Names of the service components that the current user has explicitly allowed to
Chris Wren8326a8a2014-10-22 14:13:32 -04005855 * see all of the user's notifications, separated by ':'.
Daniel Sandler4b749ef2013-03-18 21:53:04 -04005856 *
5857 * @hide
5858 */
5859 public static final String ENABLED_NOTIFICATION_LISTENERS = "enabled_notification_listeners";
5860
John Spurlock7340fc82014-04-24 18:50:12 -04005861 /**
John Spurlock7c74f782015-06-04 13:01:42 -04005862 * Names of the packages that the current user has explicitly allowed to
5863 * manage notification policy configuration, separated by ':'.
John Spurlock7c74f782015-06-04 13:01:42 -04005864 */
5865 public static final String ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES =
5866 "enabled_notification_policy_access_packages";
5867
John Spurlock5c454122013-06-17 07:35:46 -04005868 /** @hide */
5869 public static final String BAR_SERVICE_COMPONENT = "bar_service_component";
5870
John Spurlockd67ec252013-09-05 11:31:54 -04005871 /** @hide */
John Spurlockcdb57ae2015-02-11 19:04:11 -05005872 public static final String VOLUME_CONTROLLER_SERVICE_COMPONENT
5873 = "volume_controller_service_component";
5874
5875 /** @hide */
John Spurlockf1a36642013-10-12 17:50:42 -04005876 public static final String IMMERSIVE_MODE_CONFIRMATIONS = "immersive_mode_confirmations";
John Spurlockd67ec252013-09-05 11:31:54 -04005877
Yorke Lee647f8f32013-05-07 10:49:44 -07005878 /**
Svetoslavf43e8512013-09-30 17:33:05 -07005879 * This is the query URI for finding a print service to install.
5880 *
5881 * @hide
5882 */
5883 public static final String PRINT_SERVICE_SEARCH_URI = "print_service_search_uri";
5884
5885 /**
5886 * This is the query URI for finding a NFC payment service to install.
5887 *
5888 * @hide
5889 */
5890 public static final String PAYMENT_SERVICE_SEARCH_URI = "payment_service_search_uri";
5891
5892 /**
Amith Yamasani1e9c2182014-06-11 17:25:51 -07005893 * If enabled, apps should try to skip any introductory hints on first launch. This might
Amith Yamasani0c416392014-06-13 15:54:39 -07005894 * apply to users that are already familiar with the environment or temporary users.
Amith Yamasani1e9c2182014-06-11 17:25:51 -07005895 * <p>
5896 * Type : int (0 to show hints, 1 to skip showing hints)
Amith Yamasani1e9c2182014-06-11 17:25:51 -07005897 */
5898 public static final String SKIP_FIRST_USE_HINTS = "skip_first_use_hints";
5899
5900 /**
John Spurlockaa5ee4d2014-07-25 13:05:12 -04005901 * Persisted playback time after a user confirmation of an unsafe volume level.
5902 *
5903 * @hide
5904 */
5905 public static final String UNSAFE_VOLUME_MUSIC_ACTIVE_MS = "unsafe_volume_music_active_ms";
5906
5907 /**
Dan Sandler52e5701e2014-07-22 23:14:54 -04005908 * This preference enables notification display on the lockscreen.
5909 * @hide
5910 */
5911 public static final String LOCK_SCREEN_SHOW_NOTIFICATIONS =
5912 "lock_screen_show_notifications";
5913
5914 /**
Dongwon Kang4d933a02014-08-07 22:51:47 -07005915 * List of TV inputs that are currently hidden. This is a string
Jaewan Kimf0e530e2014-08-22 00:43:31 +09005916 * containing the IDs of all hidden TV inputs. Each ID is encoded by
5917 * {@link android.net.Uri#encode(String)} and separated by ':'.
Dongwon Kang4d933a02014-08-07 22:51:47 -07005918 * @hide
5919 */
5920 public static final String TV_INPUT_HIDDEN_INPUTS = "tv_input_hidden_inputs";
5921
5922 /**
5923 * List of custom TV input labels. This is a string containing <TV input id, custom name>
Jaewan Kimf0e530e2014-08-22 00:43:31 +09005924 * pairs. TV input id and custom name are encoded by {@link android.net.Uri#encode(String)}
5925 * and separated by ','. Each pair is separated by ':'.
Dongwon Kang4d933a02014-08-07 22:51:47 -07005926 * @hide
5927 */
5928 public static final String TV_INPUT_CUSTOM_LABELS = "tv_input_custom_labels";
5929
5930 /**
Glenn Kasten34cc4db2014-08-13 10:56:38 -07005931 * Whether automatic routing of system audio to USB audio peripheral is disabled.
5932 * The value is boolean (1 or 0), where 1 means automatic routing is disabled,
5933 * and 0 means automatic routing is enabled.
5934 *
5935 * @hide
5936 */
5937 public static final String USB_AUDIO_AUTOMATIC_ROUTING_DISABLED =
5938 "usb_audio_automatic_routing_disabled";
5939
5940 /**
Jeff Brown05af6ad2014-09-30 20:54:30 -07005941 * The timeout in milliseconds before the device fully goes to sleep after
5942 * a period of inactivity. This value sets an upper bound on how long the device
5943 * will stay awake or dreaming without user activity. It should generally
Dianne Hackbornad6a99b2014-11-18 10:11:10 -08005944 * be longer than {@link Settings.System#SCREEN_OFF_TIMEOUT} as otherwise the device
Jeff Brown05af6ad2014-09-30 20:54:30 -07005945 * will sleep before it ever has a chance to dream.
5946 * <p>
5947 * Use -1 to disable this timeout.
5948 * </p>
5949 *
5950 * @hide
5951 */
5952 public static final String SLEEP_TIMEOUT = "sleep_timeout";
5953
5954 /**
Jason Monk27bbb2d2015-03-31 16:46:39 -04005955 * Controls whether double tap to wake is enabled.
5956 * @hide
5957 */
5958 public static final String DOUBLE_TAP_TO_WAKE = "double_tap_to_wake";
5959
5960 /**
Xiyuan Xiae6de8b92015-06-06 22:18:05 -07005961 * The current assistant component. It could be a voice interaction service,
5962 * or an activity that handles ACTION_ASSIST, or empty which means using the default
5963 * handling.
5964 *
5965 * @hide
5966 */
5967 public static final String ASSISTANT = "assistant";
5968
5969 /**
Jason Monk5a5e7d62015-08-04 11:20:25 -04005970 * Whether the camera launch gesture should be disabled.
5971 *
5972 * @hide
5973 */
5974 public static final String CAMERA_GESTURE_DISABLED = "camera_gesture_disabled";
5975
5976 /**
Adrian Roos5941c982015-09-03 15:59:49 -07005977 * Whether the camera launch gesture to double tap the power button when the screen is off
5978 * should be disabled.
5979 *
5980 * @hide
5981 */
5982 public static final String CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED =
5983 "camera_double_tap_power_gesture_disabled";
5984
5985 /**
Jason Monk5dbd4aa2016-02-07 13:13:39 -05005986
5987 /**
5988 * Behavior of twilight on the device.
5989 * One of {@link #TWILIGHT_MODE_LOCKED_OFF}, {@link #TWILIGHT_MODE_LOCKED_ON}
5990 * or {@link #TWILIGHT_MODE_AUTO}.
5991 * @hide
5992 */
5993 public static final String TWILIGHT_MODE = "twilight_mode";
5994
5995 /**
5996 * Twilight mode always off.
5997 * @hide
5998 */
5999 public static final int TWILIGHT_MODE_LOCKED_OFF = 0;
6000
6001 /**
6002 * Twilight mode always on.
6003 * @hide
6004 */
6005 public static final int TWILIGHT_MODE_LOCKED_ON = 1;
6006
6007 /**
6008 * Twilight mode auto.
6009 * @hide
6010 */
6011 public static final int TWILIGHT_MODE_AUTO = 2;
6012
6013 /**
6014 * Twilight mode auto, temporarily overriden to on.
6015 * @hide
6016 */
6017 public static final int TWILIGHT_MODE_AUTO_OVERRIDE_OFF = 3;
6018
6019 /**
6020 * Twilight mode auto, temporarily overriden to off.
6021 * @hide
6022 */
6023 public static final int TWILIGHT_MODE_AUTO_OVERRIDE_ON = 4;
6024
6025 /**
6026 * Whether brightness should automatically adjust based on twilight state.
6027 * @hide
6028 */
6029 public static final String BRIGHTNESS_USE_TWILIGHT = "brightness_use_twilight";
6030
6031 /**
Ruben Brunke24b9a62016-02-16 21:38:24 -08006032 * Names of the service components that the current user has explicitly allowed to
6033 * be a VR mode listener, separated by ':'.
6034 *
6035 * @hide
6036 */
6037 public static final String ENABLED_VR_LISTENERS = "enabled_vr_listeners";
6038
6039 /**
Svetoslav Ganova571a582011-09-20 18:32:20 -07006040 * This are the settings to be backed up.
6041 *
6042 * NOTE: Settings are backed up and restored in the order they appear
6043 * in this array. If you have one setting depending on another,
6044 * make sure that they are ordered appropriately.
6045 *
-b master501eec92009-07-06 13:53:11 -07006046 * @hide
6047 */
6048 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate58f41ec2013-01-11 15:40:36 -08006049 BUGREPORT_IN_POWER_MENU, // moved to global
Amith Yamasani8823c0a82009-07-07 14:30:17 -07006050 ALLOW_MOCK_LOCATION,
-b master501eec92009-07-06 13:53:11 -07006051 PARENTAL_CONTROL_ENABLED,
6052 PARENTAL_CONTROL_REDIRECT_URL,
Christopher Tate66488d62012-10-02 11:58:01 -07006053 USB_MASS_STORAGE_ENABLED, // moved to global
Anna Galuszafa7786c2015-12-22 10:53:44 -08006054 ACCESSIBILITY_DISPLAY_INVERSION_ENABLED,
6055 ACCESSIBILITY_DISPLAY_DALTONIZER,
6056 ACCESSIBILITY_DISPLAY_COLOR_MATRIX,
6057 ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED,
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07006058 ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED,
6059 ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE,
6060 ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE,
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07006061 ACCESSIBILITY_SCRIPT_INJECTION,
Anna Galuszafa7786c2015-12-22 10:53:44 -08006062 ACCESSIBILITY_WEB_CONTENT_KEY_BINDINGS,
Christopher Tate14c2d792010-02-25 16:49:44 -08006063 BACKUP_AUTO_RESTORE,
-b master501eec92009-07-06 13:53:11 -07006064 ENABLED_ACCESSIBILITY_SERVICES,
Christopher Tate6597e342015-02-17 12:15:25 -08006065 ENABLED_NOTIFICATION_LISTENERS,
Ruben Brunke24b9a62016-02-16 21:38:24 -08006066 ENABLED_VR_LISTENERS,
Christopher Tate7b9a28c2015-03-18 13:06:16 -07006067 ENABLED_INPUT_METHODS,
Svetoslav Ganov9a4c5cd2012-05-30 14:06:32 -07006068 TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES,
Svetoslav Ganova28a16d2011-07-28 11:24:21 -07006069 TOUCH_EXPLORATION_ENABLED,
Svetoslav Ganova571a582011-09-20 18:32:20 -07006070 ACCESSIBILITY_ENABLED,
Svetoslav Ganov55f937a2011-12-05 11:42:07 -08006071 ACCESSIBILITY_SPEAK_PASSWORD,
Chris Craikcce47eb2014-07-16 15:12:15 -07006072 ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED,
Anna Galuszafa7786c2015-12-22 10:53:44 -08006073 ACCESSIBILITY_CAPTIONING_PRESET,
Alan Viveretteef793802013-07-23 14:15:28 -07006074 ACCESSIBILITY_CAPTIONING_ENABLED,
6075 ACCESSIBILITY_CAPTIONING_LOCALE,
6076 ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR,
6077 ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR,
6078 ACCESSIBILITY_CAPTIONING_EDGE_TYPE,
6079 ACCESSIBILITY_CAPTIONING_EDGE_COLOR,
6080 ACCESSIBILITY_CAPTIONING_TYPEFACE,
Alan Viverette69ce69b2013-08-29 12:23:48 -07006081 ACCESSIBILITY_CAPTIONING_FONT_SCALE,
Anna Galuszafa7786c2015-12-22 10:53:44 -08006082 ACCESSIBILITY_CAPTIONING_WINDOW_COLOR,
-b master501eec92009-07-06 13:53:11 -07006083 TTS_USE_DEFAULTS,
6084 TTS_DEFAULT_RATE,
6085 TTS_DEFAULT_PITCH,
6086 TTS_DEFAULT_SYNTH,
6087 TTS_DEFAULT_LANG,
6088 TTS_DEFAULT_COUNTRY,
Charles Chenceffa152010-03-16 21:18:10 -07006089 TTS_ENABLED_PLUGINS,
Narayan Kamath6d632962011-08-24 11:51:37 +01006090 TTS_DEFAULT_LOCALE,
Anna Galuszafa7786c2015-12-22 10:53:44 -08006091 SHOW_IME_WITH_HARD_KEYBOARD,
Christopher Tate66488d62012-10-02 11:58:01 -07006092 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, // moved to global
6093 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, // moved to global
6094 WIFI_NUM_OPEN_NETWORKS_KEPT, // moved to global
Christopher Tate06cbadd2015-03-16 18:29:42 -07006095 SELECTED_SPELL_CHECKER,
6096 SELECTED_SPELL_CHECKER_SUBTYPE,
6097 SPELL_CHECKER_ENABLED,
San Mehat87734d32010-01-08 12:53:06 -08006098 MOUNT_PLAY_NOTIFICATION_SND,
6099 MOUNT_UMS_AUTOSTART,
6100 MOUNT_UMS_PROMPT,
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07006101 MOUNT_UMS_NOTIFY_ENABLED,
Jason Monk27bbb2d2015-03-31 16:46:39 -04006102 SLEEP_TIMEOUT,
6103 DOUBLE_TAP_TO_WAKE,
Anna Galuszafa7786c2015-12-22 10:53:44 -08006104 WAKE_GESTURE_ENABLED,
6105 LONG_PRESS_TIMEOUT,
Jason Monk5a5e7d62015-08-04 11:20:25 -04006106 CAMERA_GESTURE_DISABLED,
Toni Barzic386f8342015-09-09 12:30:41 -07006107 ACCESSIBILITY_AUTOCLICK_ENABLED,
Anna Galuszafa7786c2015-12-22 10:53:44 -08006108 ACCESSIBILITY_AUTOCLICK_DELAY,
6109 ACCESSIBILITY_LARGE_POINTER_ICON,
6110 PREFERRED_TTY_MODE,
6111 ENHANCED_VOICE_PRIVACY_ENABLED,
6112 TTY_MODE_ENABLED,
6113 INCALL_POWER_BUTTON_BEHAVIOR
-b master501eec92009-07-06 13:53:11 -07006114 };
6115
6116 /**
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07006117 * These entries are considered common between the personal and the managed profile,
6118 * since the managed profile doesn't get to change them.
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07006119 */
Svetoslav683914b2015-01-15 14:22:26 -08006120 private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>();
Amith Yamasanib0ff3222015-03-04 09:56:14 -08006121
Svetoslav683914b2015-01-15 14:22:26 -08006122 static {
6123 CLONE_TO_MANAGED_PROFILE.add(ACCESSIBILITY_ENABLED);
6124 CLONE_TO_MANAGED_PROFILE.add(ALLOW_MOCK_LOCATION);
6125 CLONE_TO_MANAGED_PROFILE.add(ALLOWED_GEOLOCATION_ORIGINS);
6126 CLONE_TO_MANAGED_PROFILE.add(DEFAULT_INPUT_METHOD);
6127 CLONE_TO_MANAGED_PROFILE.add(ENABLED_ACCESSIBILITY_SERVICES);
6128 CLONE_TO_MANAGED_PROFILE.add(ENABLED_INPUT_METHODS);
6129 CLONE_TO_MANAGED_PROFILE.add(LOCATION_MODE);
Lifu Tangd1fa1d62015-11-25 21:42:44 -08006130 CLONE_TO_MANAGED_PROFILE.add(LOCATION_PREVIOUS_MODE);
Svetoslav683914b2015-01-15 14:22:26 -08006131 CLONE_TO_MANAGED_PROFILE.add(LOCATION_PROVIDERS_ALLOWED);
Svetoslav683914b2015-01-15 14:22:26 -08006132 CLONE_TO_MANAGED_PROFILE.add(SELECTED_INPUT_METHOD_SUBTYPE);
6133 CLONE_TO_MANAGED_PROFILE.add(SELECTED_SPELL_CHECKER);
6134 CLONE_TO_MANAGED_PROFILE.add(SELECTED_SPELL_CHECKER_SUBTYPE);
6135 }
6136
6137 /** @hide */
6138 public static void getCloneToManagedProfileSettings(Set<String> outKeySet) {
6139 outKeySet.addAll(CLONE_TO_MANAGED_PROFILE);
6140 }
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07006141
6142 /**
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07006143 * Helper method for determining if a location provider is enabled.
Tom O'Neilld5759432013-09-11 11:03:03 -07006144 *
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07006145 * @param cr the content resolver to use
6146 * @param provider the location provider to query
6147 * @return true if the provider is enabled
Tom O'Neilld5759432013-09-11 11:03:03 -07006148 *
6149 * @deprecated use {@link #LOCATION_MODE} or
6150 * {@link LocationManager#isProviderEnabled(String)}
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07006151 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07006152 @Deprecated
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07006153 public static final boolean isLocationProviderEnabled(ContentResolver cr, String provider) {
Victoria Leaseb711d572012-10-02 13:14:11 -07006154 return isLocationProviderEnabledForUser(cr, provider, UserHandle.myUserId());
6155 }
6156
6157 /**
6158 * Helper method for determining if a location provider is enabled.
6159 * @param cr the content resolver to use
6160 * @param provider the location provider to query
6161 * @param userId the userId to query
6162 * @return true if the provider is enabled
Tom O'Neilld5759432013-09-11 11:03:03 -07006163 * @deprecated use {@link #LOCATION_MODE} or
6164 * {@link LocationManager#isProviderEnabled(String)}
Victoria Leaseb711d572012-10-02 13:14:11 -07006165 * @hide
6166 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07006167 @Deprecated
Victoria Leaseb711d572012-10-02 13:14:11 -07006168 public static final boolean isLocationProviderEnabledForUser(ContentResolver cr, String provider, int userId) {
6169 String allowedProviders = Settings.Secure.getStringForUser(cr,
6170 LOCATION_PROVIDERS_ALLOWED, userId);
Brad Fitzpatrick11fe1812010-09-10 16:07:52 -07006171 return TextUtils.delimitedStringContains(allowedProviders, ',', provider);
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07006172 }
6173
6174 /**
6175 * Thread-safe method for enabling or disabling a single location provider.
6176 * @param cr the content resolver to use
6177 * @param provider the location provider to enable or disable
6178 * @param enabled true if the provider should be enabled
Tom O'Neilla324ac72013-08-26 14:40:23 -07006179 * @deprecated use {@link #putInt(ContentResolver, String, int)} and {@link #LOCATION_MODE}
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07006180 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07006181 @Deprecated
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07006182 public static final void setLocationProviderEnabled(ContentResolver cr,
6183 String provider, boolean enabled) {
Victoria Leaseb711d572012-10-02 13:14:11 -07006184 setLocationProviderEnabledForUser(cr, provider, enabled, UserHandle.myUserId());
6185 }
6186
6187 /**
6188 * Thread-safe method for enabling or disabling a single location provider.
Tom O'Neilla324ac72013-08-26 14:40:23 -07006189 *
Victoria Leaseb711d572012-10-02 13:14:11 -07006190 * @param cr the content resolver to use
6191 * @param provider the location provider to enable or disable
6192 * @param enabled true if the provider should be enabled
6193 * @param userId the userId for which to enable/disable providers
Tom O'Neilla324ac72013-08-26 14:40:23 -07006194 * @return true if the value was set, false on database errors
6195 * @deprecated use {@link #putIntForUser(ContentResolver, String, int, int)} and
6196 * {@link #LOCATION_MODE}
Victoria Leaseb711d572012-10-02 13:14:11 -07006197 * @hide
6198 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07006199 @Deprecated
Tom O'Neilla324ac72013-08-26 14:40:23 -07006200 public static final boolean setLocationProviderEnabledForUser(ContentResolver cr,
Victoria Leaseb711d572012-10-02 13:14:11 -07006201 String provider, boolean enabled, int userId) {
David Christie3f7b6522013-08-06 19:19:08 -07006202 synchronized (mLocationSettingsLock) {
6203 // to ensure thread safety, we write the provider name with a '+' or '-'
6204 // and let the SettingsProvider handle it rather than reading and modifying
6205 // the list of enabled providers.
6206 if (enabled) {
6207 provider = "+" + provider;
6208 } else {
6209 provider = "-" + provider;
6210 }
Tom O'Neilla324ac72013-08-26 14:40:23 -07006211 return putStringForUser(cr, Settings.Secure.LOCATION_PROVIDERS_ALLOWED, provider,
David Christie3f7b6522013-08-06 19:19:08 -07006212 userId);
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07006213 }
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07006214 }
Tom O'Neill1f48b782013-08-19 18:14:56 -07006215
6216 /**
Lifu Tangd1fa1d62015-11-25 21:42:44 -08006217 * Saves the current location mode into {@link #LOCATION_PREVIOUS_MODE}.
6218 */
6219 private static final boolean saveLocationModeForUser(ContentResolver cr, int userId) {
6220 final int mode = getLocationModeForUser(cr, userId);
6221 return putIntForUser(cr, Settings.Secure.LOCATION_PREVIOUS_MODE, mode, userId);
6222 }
6223
6224 /**
6225 * Restores the current location mode from {@link #LOCATION_PREVIOUS_MODE}.
6226 */
6227 private static final boolean restoreLocationModeForUser(ContentResolver cr, int userId) {
6228 int mode = getIntForUser(cr, Settings.Secure.LOCATION_PREVIOUS_MODE,
6229 LOCATION_MODE_HIGH_ACCURACY, userId);
6230 // Make sure that the previous mode is never "off". Otherwise the user won't be able to
6231 // turn on location any longer.
6232 if (mode == LOCATION_MODE_OFF) {
6233 mode = LOCATION_MODE_HIGH_ACCURACY;
6234 }
6235 return setLocationModeForUser(cr, mode, userId);
6236 }
6237
6238 /**
Tom O'Neill1f48b782013-08-19 18:14:56 -07006239 * Thread-safe method for setting the location mode to one of
6240 * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY},
6241 * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}.
6242 *
Tom O'Neill1f48b782013-08-19 18:14:56 -07006243 * @param cr the content resolver to use
6244 * @param mode such as {@link #LOCATION_MODE_HIGH_ACCURACY}
6245 * @param userId the userId for which to change mode
Tom O'Neilla324ac72013-08-26 14:40:23 -07006246 * @return true if the value was set, false on database errors
Tom O'Neill1f48b782013-08-19 18:14:56 -07006247 *
6248 * @throws IllegalArgumentException if mode is not one of the supported values
6249 */
Tom O'Neill7f6f4572013-08-27 10:53:15 -07006250 private static final boolean setLocationModeForUser(ContentResolver cr, int mode,
6251 int userId) {
Tom O'Neill1f48b782013-08-19 18:14:56 -07006252 synchronized (mLocationSettingsLock) {
6253 boolean gps = false;
6254 boolean network = false;
6255 switch (mode) {
Lifu Tangd1fa1d62015-11-25 21:42:44 -08006256 case LOCATION_MODE_PREVIOUS:
6257 // Retrieve the actual mode and set to that mode.
6258 return restoreLocationModeForUser(cr, userId);
Tom O'Neill1f48b782013-08-19 18:14:56 -07006259 case LOCATION_MODE_OFF:
Lifu Tangd1fa1d62015-11-25 21:42:44 -08006260 saveLocationModeForUser(cr, userId);
Tom O'Neill1f48b782013-08-19 18:14:56 -07006261 break;
6262 case LOCATION_MODE_SENSORS_ONLY:
6263 gps = true;
6264 break;
6265 case LOCATION_MODE_BATTERY_SAVING:
6266 network = true;
6267 break;
6268 case LOCATION_MODE_HIGH_ACCURACY:
6269 gps = true;
6270 network = true;
6271 break;
6272 default:
6273 throw new IllegalArgumentException("Invalid location mode: " + mode);
6274 }
Tom O'Neill7731a992014-10-09 11:30:49 -07006275 // Note it's important that we set the NLP mode first. The Google implementation
6276 // of NLP clears its NLP consent setting any time it receives a
6277 // LocationManager.PROVIDERS_CHANGED_ACTION broadcast and NLP is disabled. Also,
6278 // it shows an NLP consent dialog any time it receives the broadcast, NLP is
6279 // enabled, and the NLP consent is not set. If 1) we were to enable GPS first,
6280 // 2) a setup wizard has its own NLP consent UI that sets the NLP consent setting,
6281 // and 3) the receiver happened to complete before we enabled NLP, then the Google
6282 // NLP would detect the attempt to enable NLP and show a redundant NLP consent
6283 // dialog. Then the people who wrote the setup wizard would be sad.
Tom O'Neilla324ac72013-08-26 14:40:23 -07006284 boolean nlpSuccess = Settings.Secure.setLocationProviderEnabledForUser(
Tom O'Neill1f48b782013-08-19 18:14:56 -07006285 cr, LocationManager.NETWORK_PROVIDER, network, userId);
Tom O'Neill7731a992014-10-09 11:30:49 -07006286 boolean gpsSuccess = Settings.Secure.setLocationProviderEnabledForUser(
6287 cr, LocationManager.GPS_PROVIDER, gps, userId);
Tom O'Neilla324ac72013-08-26 14:40:23 -07006288 return gpsSuccess && nlpSuccess;
Tom O'Neill1f48b782013-08-19 18:14:56 -07006289 }
6290 }
6291
6292 /**
Tom O'Neill1f48b782013-08-19 18:14:56 -07006293 * Thread-safe method for reading the location mode, returns one of
6294 * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY},
6295 * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}.
6296 *
6297 * @param cr the content resolver to use
6298 * @param userId the userId for which to read the mode
6299 * @return the location mode
6300 */
Tom O'Neill7f6f4572013-08-27 10:53:15 -07006301 private static final int getLocationModeForUser(ContentResolver cr, int userId) {
Tom O'Neill1f48b782013-08-19 18:14:56 -07006302 synchronized (mLocationSettingsLock) {
6303 boolean gpsEnabled = Settings.Secure.isLocationProviderEnabledForUser(
6304 cr, LocationManager.GPS_PROVIDER, userId);
6305 boolean networkEnabled = Settings.Secure.isLocationProviderEnabledForUser(
6306 cr, LocationManager.NETWORK_PROVIDER, userId);
6307 if (gpsEnabled && networkEnabled) {
6308 return LOCATION_MODE_HIGH_ACCURACY;
6309 } else if (gpsEnabled) {
6310 return LOCATION_MODE_SENSORS_ONLY;
6311 } else if (networkEnabled) {
6312 return LOCATION_MODE_BATTERY_SAVING;
6313 } else {
6314 return LOCATION_MODE_OFF;
6315 }
6316 }
6317 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006318 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006319
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006320 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006321 * Global system settings, containing preferences that always apply identically
6322 * to all defined users. Applications can read these but are not allowed to write;
6323 * like the "Secure" settings, these are for preferences that the user must
6324 * explicitly modify through the system UI or specialized APIs for those values.
6325 */
6326 public static final class Global extends NameValueTable {
6327 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_global_version";
6328
6329 /**
6330 * The content:// style URL for global secure settings items. Not public.
6331 */
6332 public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/global");
6333
6334 /**
Amith Yamasani23a0f052014-07-25 12:26:53 -07006335 * Whether users are allowed to add more users or guest from lockscreen.
6336 * <p>
6337 * Type: int
6338 * @hide
6339 */
6340 public static final String ADD_USERS_WHEN_LOCKED = "add_users_when_locked";
6341
6342 /**
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07006343 * Setting whether the global gesture for enabling accessibility is enabled.
6344 * If this gesture is enabled the user will be able to perfrom it to enable
6345 * the accessibility state without visiting the settings app.
6346 * @hide
6347 */
6348 public static final String ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED =
6349 "enable_accessibility_global_gesture_enabled";
6350
6351 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006352 * Whether Airplane Mode is on.
6353 */
6354 public static final String AIRPLANE_MODE_ON = "airplane_mode_on";
6355
6356 /**
Bryce Lee584a4452014-10-21 15:55:55 -07006357 * Whether Theater Mode is on.
6358 * {@hide}
6359 */
Bryce Leecdfebd62015-02-02 08:19:11 -08006360 @SystemApi
Bryce Lee584a4452014-10-21 15:55:55 -07006361 public static final String THEATER_MODE_ON = "theater_mode_on";
6362
6363 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006364 * Constant for use in AIRPLANE_MODE_RADIOS to specify Bluetooth radio.
6365 */
6366 public static final String RADIO_BLUETOOTH = "bluetooth";
6367
6368 /**
6369 * Constant for use in AIRPLANE_MODE_RADIOS to specify Wi-Fi radio.
6370 */
6371 public static final String RADIO_WIFI = "wifi";
6372
6373 /**
6374 * {@hide}
6375 */
6376 public static final String RADIO_WIMAX = "wimax";
6377 /**
6378 * Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio.
6379 */
6380 public static final String RADIO_CELL = "cell";
6381
6382 /**
6383 * Constant for use in AIRPLANE_MODE_RADIOS to specify NFC radio.
6384 */
6385 public static final String RADIO_NFC = "nfc";
6386
6387 /**
6388 * A comma separated list of radios that need to be disabled when airplane mode
6389 * is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are
6390 * included in the comma separated list.
6391 */
6392 public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios";
6393
6394 /**
6395 * A comma separated list of radios that should to be disabled when airplane mode
6396 * is on, but can be manually reenabled by the user. For example, if RADIO_WIFI is
6397 * added to both AIRPLANE_MODE_RADIOS and AIRPLANE_MODE_TOGGLEABLE_RADIOS, then Wifi
6398 * will be turned off when entering airplane mode, but the user will be able to reenable
6399 * Wifi in the Settings app.
6400 *
6401 * {@hide}
6402 */
6403 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios";
6404
6405 /**
Bryce Leeec85f342015-12-16 13:32:28 -08006406 * A Long representing a bitmap of profiles that should be disabled when bluetooth starts.
6407 * See {@link android.bluetooth.BluetoothProfile}.
6408 * {@hide}
6409 */
6410 public static final String BLUETOOTH_DISABLED_PROFILES = "bluetooth_disabled_profiles";
6411
6412 /**
Andre Eisenbach82a94d92016-01-14 14:20:34 -08006413 * A semi-colon separated list of Bluetooth interoperability workarounds.
6414 * Each entry is a partial Bluetooth device address string and an integer representing
6415 * the feature to be disabled, separated by a comma. The integer must correspond
6416 * to a interoperability feature as defined in "interop.h" in /system/bt.
6417 * <p>
6418 * Example: <br/>
6419 * "00:11:22,0;01:02:03:04,2"
6420 * @hide
6421 */
6422 public static final String BLUETOOTH_INTEROPERABILITY_LIST = "bluetooth_interoperability_list";
6423
6424 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006425 * The policy for deciding when Wi-Fi should go to sleep (which will in
6426 * turn switch to using the mobile data as an Internet connection).
6427 * <p>
6428 * Set to one of {@link #WIFI_SLEEP_POLICY_DEFAULT},
6429 * {@link #WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED}, or
6430 * {@link #WIFI_SLEEP_POLICY_NEVER}.
6431 */
6432 public static final String WIFI_SLEEP_POLICY = "wifi_sleep_policy";
6433
6434 /**
6435 * Value for {@link #WIFI_SLEEP_POLICY} to use the default Wi-Fi sleep
6436 * policy, which is to sleep shortly after the turning off
6437 * according to the {@link #STAY_ON_WHILE_PLUGGED_IN} setting.
6438 */
6439 public static final int WIFI_SLEEP_POLICY_DEFAULT = 0;
6440
6441 /**
6442 * Value for {@link #WIFI_SLEEP_POLICY} to use the default policy when
6443 * the device is on battery, and never go to sleep when the device is
6444 * plugged in.
6445 */
6446 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1;
6447
6448 /**
6449 * Value for {@link #WIFI_SLEEP_POLICY} to never go to sleep.
6450 */
6451 public static final int WIFI_SLEEP_POLICY_NEVER = 2;
6452
6453 /**
6454 * Value to specify if the user prefers the date, time and time zone
6455 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
6456 */
6457 public static final String AUTO_TIME = "auto_time";
6458
6459 /**
6460 * Value to specify if the user prefers the time zone
6461 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
6462 */
6463 public static final String AUTO_TIME_ZONE = "auto_time_zone";
6464
6465 /**
6466 * URI for the car dock "in" event sound.
6467 * @hide
6468 */
6469 public static final String CAR_DOCK_SOUND = "car_dock_sound";
6470
6471 /**
6472 * URI for the car dock "out" event sound.
6473 * @hide
6474 */
6475 public static final String CAR_UNDOCK_SOUND = "car_undock_sound";
6476
6477 /**
6478 * URI for the desk dock "in" event sound.
6479 * @hide
6480 */
6481 public static final String DESK_DOCK_SOUND = "desk_dock_sound";
6482
6483 /**
6484 * URI for the desk dock "out" event sound.
6485 * @hide
6486 */
6487 public static final String DESK_UNDOCK_SOUND = "desk_undock_sound";
6488
6489 /**
6490 * Whether to play a sound for dock events.
6491 * @hide
6492 */
6493 public static final String DOCK_SOUNDS_ENABLED = "dock_sounds_enabled";
6494
6495 /**
6496 * URI for the "device locked" (keyguard shown) sound.
6497 * @hide
6498 */
6499 public static final String LOCK_SOUND = "lock_sound";
6500
6501 /**
6502 * URI for the "device unlocked" sound.
6503 * @hide
6504 */
6505 public static final String UNLOCK_SOUND = "unlock_sound";
6506
6507 /**
Adrian Roos49e057d2014-08-13 17:14:51 +02006508 * URI for the "device is trusted" sound, which is played when the device enters the trusted
6509 * state without unlocking.
6510 * @hide
6511 */
6512 public static final String TRUSTED_SOUND = "trusted_sound";
6513
6514 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006515 * URI for the low battery sound file.
6516 * @hide
6517 */
6518 public static final String LOW_BATTERY_SOUND = "low_battery_sound";
6519
6520 /**
6521 * Whether to play a sound for low-battery alerts.
6522 * @hide
6523 */
6524 public static final String POWER_SOUNDS_ENABLED = "power_sounds_enabled";
6525
6526 /**
Jeff Brown84e27562012-12-07 13:56:34 -08006527 * URI for the "wireless charging started" sound.
6528 * @hide
6529 */
6530 public static final String WIRELESS_CHARGING_STARTED_SOUND =
6531 "wireless_charging_started_sound";
6532
6533 /**
John Spurlock51a871d2015-05-06 17:41:30 -04006534 * Whether to play a sound for charging events.
6535 * @hide
6536 */
6537 public static final String CHARGING_SOUNDS_ENABLED = "charging_sounds_enabled";
6538
6539 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006540 * Whether we keep the device on while the device is plugged in.
6541 * Supported values are:
6542 * <ul>
6543 * <li>{@code 0} to never stay on while plugged in</li>
6544 * <li>{@link BatteryManager#BATTERY_PLUGGED_AC} to stay on for AC charger</li>
6545 * <li>{@link BatteryManager#BATTERY_PLUGGED_USB} to stay on for USB charger</li>
6546 * <li>{@link BatteryManager#BATTERY_PLUGGED_WIRELESS} to stay on for wireless charger</li>
6547 * </ul>
6548 * These values can be OR-ed together.
6549 */
6550 public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in";
6551
6552 /**
Christopher Tate58f41ec2013-01-11 15:40:36 -08006553 * When the user has enable the option to have a "bug report" command
6554 * in the power menu.
6555 * @hide
6556 */
6557 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
6558
6559 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006560 * Whether ADB is enabled.
6561 */
6562 public static final String ADB_ENABLED = "adb_enabled";
6563
6564 /**
Jon Miranda836c0a82014-08-11 12:32:26 -07006565 * Whether Views are allowed to save their attribute data.
6566 * @hide
6567 */
6568 public static final String DEBUG_VIEW_ATTRIBUTES = "debug_view_attributes";
6569
6570 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006571 * Whether assisted GPS should be enabled or not.
6572 * @hide
6573 */
6574 public static final String ASSISTED_GPS_ENABLED = "assisted_gps_enabled";
6575
6576 /**
6577 * Whether bluetooth is enabled/disabled
6578 * 0=disabled. 1=enabled.
6579 */
6580 public static final String BLUETOOTH_ON = "bluetooth_on";
6581
6582 /**
6583 * CDMA Cell Broadcast SMS
6584 * 0 = CDMA Cell Broadcast SMS disabled
6585 * 1 = CDMA Cell Broadcast SMS enabled
6586 * @hide
6587 */
6588 public static final String CDMA_CELL_BROADCAST_SMS =
6589 "cdma_cell_broadcast_sms";
6590
6591 /**
6592 * The CDMA roaming mode 0 = Home Networks, CDMA default
6593 * 1 = Roaming on Affiliated networks
6594 * 2 = Roaming on any networks
6595 * @hide
6596 */
6597 public static final String CDMA_ROAMING_MODE = "roaming_settings";
6598
6599 /**
6600 * The CDMA subscription mode 0 = RUIM/SIM (default)
6601 * 1 = NV
6602 * @hide
6603 */
6604 public static final String CDMA_SUBSCRIPTION_MODE = "subscription_mode";
6605
6606 /** Inactivity timeout to track mobile data activity.
6607 *
6608 * If set to a positive integer, it indicates the inactivity timeout value in seconds to
6609 * infer the data activity of mobile network. After a period of no activity on mobile
6610 * networks with length specified by the timeout, an {@code ACTION_DATA_ACTIVITY_CHANGE}
6611 * intent is fired to indicate a transition of network status from "active" to "idle". Any
6612 * subsequent activity on mobile networks triggers the firing of {@code
6613 * ACTION_DATA_ACTIVITY_CHANGE} intent indicating transition from "idle" to "active".
6614 *
6615 * Network activity refers to transmitting or receiving data on the network interfaces.
6616 *
6617 * Tracking is disabled if set to zero or negative value.
6618 *
6619 * @hide
6620 */
6621 public static final String DATA_ACTIVITY_TIMEOUT_MOBILE = "data_activity_timeout_mobile";
6622
6623 /** Timeout to tracking Wifi data activity. Same as {@code DATA_ACTIVITY_TIMEOUT_MOBILE}
6624 * but for Wifi network.
6625 * @hide
6626 */
6627 public static final String DATA_ACTIVITY_TIMEOUT_WIFI = "data_activity_timeout_wifi";
6628
6629 /**
6630 * Whether or not data roaming is enabled. (0 = false, 1 = true)
6631 */
6632 public static final String DATA_ROAMING = "data_roaming";
6633
6634 /**
Wink Saville75c1e692013-03-20 17:06:50 -07006635 * The value passed to a Mobile DataConnection via bringUp which defines the
6636 * number of retries to preform when setting up the initial connection. The default
6637 * value defined in DataConnectionTrackerBase#DEFAULT_MDC_INITIAL_RETRY is currently 1.
6638 * @hide
6639 */
6640 public static final String MDC_INITIAL_MAX_RETRY = "mdc_initial_max_retry";
6641
6642 /**
Todd Kennedyf39ca8f2015-08-07 14:15:07 -07006643 * Whether any package can be on external storage. When this is true, any
6644 * package, regardless of manifest values, is a candidate for installing
6645 * or moving onto external storage. (0 = false, 1 = true)
6646 * @hide
6647 */
6648 public static final String FORCE_ALLOW_ON_EXTERNAL = "force_allow_on_external";
6649
Jorim Jaggi8ccdf3a2015-10-22 12:50:31 +02006650 /**
6651 * Whether any activity can be resized. When this is true, any
6652 * activity, regardless of manifest values, can be resized for multi-window.
6653 * (0 = false, 1 = true)
6654 * @hide
6655 */
6656 public static final String DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES
6657 = "force_resizable_activities";
6658
Jorim Jaggi6f2efd32015-12-23 12:04:39 +01006659 /**
6660 * Whether to enable experimental freeform support for windows.
6661 * @hide
6662 */
6663 public static final String DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT
6664 = "enable_freeform_support";
6665
Todd Kennedyf39ca8f2015-08-07 14:15:07 -07006666 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006667 * Whether user has enabled development settings.
6668 */
6669 public static final String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled";
6670
6671 /**
Amith Yamasanicb15d662015-11-10 11:11:15 -08006672 * Whether the device has been provisioned (0 = false, 1 = true).
6673 * <p>On a multiuser device with a separate system user, the screen may be locked
6674 * as soon as this is set to true and further activities cannot be launched on the
6675 * system user unless they are marked to show over keyguard.
Christopher Tate06efb532012-08-24 15:29:27 -07006676 */
6677 public static final String DEVICE_PROVISIONED = "device_provisioned";
6678
6679 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006680 * The saved value for WindowManagerService.setForcedDisplaySize().
6681 * Two integers separated by a comma. If unset, then use the real display size.
6682 * @hide
6683 */
6684 public static final String DISPLAY_SIZE_FORCED = "display_size_forced";
6685
6686 /**
Jeff Brownd46747a2015-04-15 19:02:36 -07006687 * The saved value for WindowManagerService.setForcedDisplayScalingMode().
6688 * 0 or unset if scaling is automatic, 1 if scaling is disabled.
6689 * @hide
6690 */
6691 public static final String DISPLAY_SCALING_FORCE = "display_scaling_force";
6692
6693 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006694 * The maximum size, in bytes, of a download that the download manager will transfer over
6695 * a non-wifi connection.
6696 * @hide
6697 */
6698 public static final String DOWNLOAD_MAX_BYTES_OVER_MOBILE =
6699 "download_manager_max_bytes_over_mobile";
6700
6701 /**
6702 * The recommended maximum size, in bytes, of a download that the download manager should
6703 * transfer over a non-wifi connection. Over this size, the use will be warned, but will
6704 * have the option to start the download over the mobile connection anyway.
6705 * @hide
6706 */
6707 public static final String DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE =
6708 "download_manager_recommended_max_bytes_over_mobile";
6709
6710 /**
Christopher Tateaa036a22014-05-19 16:33:27 -07006711 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
Christopher Tate06efb532012-08-24 15:29:27 -07006712 */
Christopher Tateaa036a22014-05-19 16:33:27 -07006713 @Deprecated
6714 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
Christopher Tate06efb532012-08-24 15:29:27 -07006715
6716 /**
Jinsuk Kimb3d91772014-07-10 12:48:54 +09006717 * Whether HDMI control shall be enabled. If disabled, no CEC/MHL command will be
6718 * sent or processed. (0 = false, 1 = true)
6719 * @hide
6720 */
6721 public static final String HDMI_CONTROL_ENABLED = "hdmi_control_enabled";
6722
6723 /**
6724 * Whether HDMI system audio is enabled. If enabled, TV internal speaker is muted,
6725 * and the output is redirected to AV Receiver connected via
6726 * {@Global#HDMI_SYSTEM_AUDIO_OUTPUT}.
6727 * @hide
6728 */
6729 public static final String HDMI_SYSTEM_AUDIO_ENABLED = "hdmi_system_audio_enabled";
6730
6731 /**
Jinsuk Kimb3d91772014-07-10 12:48:54 +09006732 * Whether TV will automatically turn on upon reception of the CEC command
6733 * &lt;Text View On&gt; or &lt;Image View On&gt;. (0 = false, 1 = true)
6734 * @hide
6735 */
6736 public static final String HDMI_CONTROL_AUTO_WAKEUP_ENABLED =
6737 "hdmi_control_auto_wakeup_enabled";
6738
6739 /**
6740 * Whether TV will also turn off other CEC devices when it goes to standby mode.
6741 * (0 = false, 1 = true)
6742 * @hide
6743 */
6744 public static final String HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED =
6745 "hdmi_control_auto_device_off_enabled";
6746
6747 /**
Lorenzo Colitti06d7e532015-03-16 23:46:24 +09006748 * Whether to use the DHCP client from Lollipop and earlier instead of the newer Android DHCP
6749 * client.
6750 * (0 = false, 1 = true)
6751 * @hide
6752 */
6753 public static final String LEGACY_DHCP_CLIENT = "legacy_dhcp_client";
6754
6755 /**
Jinsuk Kimb3d91772014-07-10 12:48:54 +09006756 * Whether TV will switch to MHL port when a mobile device is plugged in.
6757 * (0 = false, 1 = true)
6758 * @hide
6759 */
6760 public static final String MHL_INPUT_SWITCHING_ENABLED = "mhl_input_switching_enabled";
6761
6762 /**
6763 * Whether TV will charge the mobile device connected at MHL port. (0 = false, 1 = true)
6764 * @hide
6765 */
6766 public static final String MHL_POWER_CHARGE_ENABLED = "mhl_power_charge_enabled";
6767
6768 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006769 * Whether mobile data connections are allowed by the user. See
6770 * ConnectivityManager for more info.
6771 * @hide
6772 */
6773 public static final String MOBILE_DATA = "mobile_data";
6774
Erik Klineda4bfa82015-04-30 12:58:40 +09006775 /**
6776 * Whether the mobile data connection should remain active even when higher
6777 * priority networks like WiFi are active, to help make network switching faster.
6778 *
6779 * See ConnectivityService for more info.
6780 *
6781 * (0 = disabled, 1 = enabled)
6782 * @hide
6783 */
6784 public static final String MOBILE_DATA_ALWAYS_ON = "mobile_data_always_on";
6785
Christopher Tate06efb532012-08-24 15:29:27 -07006786 /** {@hide} */
6787 public static final String NETSTATS_ENABLED = "netstats_enabled";
6788 /** {@hide} */
6789 public static final String NETSTATS_POLL_INTERVAL = "netstats_poll_interval";
6790 /** {@hide} */
6791 public static final String NETSTATS_TIME_CACHE_MAX_AGE = "netstats_time_cache_max_age";
6792 /** {@hide} */
6793 public static final String NETSTATS_GLOBAL_ALERT_BYTES = "netstats_global_alert_bytes";
6794 /** {@hide} */
6795 public static final String NETSTATS_SAMPLE_ENABLED = "netstats_sample_enabled";
Christopher Tate06efb532012-08-24 15:29:27 -07006796
6797 /** {@hide} */
6798 public static final String NETSTATS_DEV_BUCKET_DURATION = "netstats_dev_bucket_duration";
6799 /** {@hide} */
6800 public static final String NETSTATS_DEV_PERSIST_BYTES = "netstats_dev_persist_bytes";
6801 /** {@hide} */
6802 public static final String NETSTATS_DEV_ROTATE_AGE = "netstats_dev_rotate_age";
6803 /** {@hide} */
6804 public static final String NETSTATS_DEV_DELETE_AGE = "netstats_dev_delete_age";
6805
6806 /** {@hide} */
6807 public static final String NETSTATS_UID_BUCKET_DURATION = "netstats_uid_bucket_duration";
6808 /** {@hide} */
6809 public static final String NETSTATS_UID_PERSIST_BYTES = "netstats_uid_persist_bytes";
6810 /** {@hide} */
6811 public static final String NETSTATS_UID_ROTATE_AGE = "netstats_uid_rotate_age";
6812 /** {@hide} */
6813 public static final String NETSTATS_UID_DELETE_AGE = "netstats_uid_delete_age";
6814
6815 /** {@hide} */
6816 public static final String NETSTATS_UID_TAG_BUCKET_DURATION = "netstats_uid_tag_bucket_duration";
6817 /** {@hide} */
6818 public static final String NETSTATS_UID_TAG_PERSIST_BYTES = "netstats_uid_tag_persist_bytes";
6819 /** {@hide} */
6820 public static final String NETSTATS_UID_TAG_ROTATE_AGE = "netstats_uid_tag_rotate_age";
6821 /** {@hide} */
6822 public static final String NETSTATS_UID_TAG_DELETE_AGE = "netstats_uid_tag_delete_age";
6823
6824 /**
6825 * User preference for which network(s) should be used. Only the
6826 * connectivity service should touch this.
6827 */
6828 public static final String NETWORK_PREFERENCE = "network_preference";
6829
6830 /**
Jeff Davidsondd6fd1e2014-04-14 15:14:30 -07006831 * Which package name to use for network scoring. If null, or if the package is not a valid
6832 * scorer app, external network scores will neither be requested nor accepted.
6833 * @hide
6834 */
6835 public static final String NETWORK_SCORER_APP = "network_scorer_app";
6836
6837 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006838 * If the NITZ_UPDATE_DIFF time is exceeded then an automatic adjustment
6839 * to SystemClock will be allowed even if NITZ_UPDATE_SPACING has not been
6840 * exceeded.
6841 * @hide
6842 */
6843 public static final String NITZ_UPDATE_DIFF = "nitz_update_diff";
6844
6845 /**
6846 * The length of time in milli-seconds that automatic small adjustments to
6847 * SystemClock are ignored if NITZ_UPDATE_DIFF is not exceeded.
6848 * @hide
6849 */
6850 public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing";
6851
6852 /** Preferred NTP server. {@hide} */
6853 public static final String NTP_SERVER = "ntp_server";
6854 /** Timeout in milliseconds to wait for NTP server. {@hide} */
6855 public static final String NTP_TIMEOUT = "ntp_timeout";
6856
Jeff Sharkeye8a4b662015-06-27 15:43:45 -07006857 /** {@hide} */
6858 public static final String STORAGE_BENCHMARK_INTERVAL = "storage_benchmark_interval";
6859
Christopher Tate06efb532012-08-24 15:29:27 -07006860 /**
Tao Baofdf7c5d2016-02-15 20:59:15 -08006861 * Whether to disable the automatic scheduling of system updates.
6862 * 1 = system updates won't be automatically scheduled (will always
6863 * present notification instead).
6864 * 0 = system updates will be automatically scheduled. (default)
6865 * @hide
6866 */
6867 @SystemApi
6868 public static final String OTA_DISABLE_AUTOMATIC_UPDATE = "ota_disable_automatic_update";
6869
6870 /**
rich cannings4d8fc792012-09-07 14:43:43 -07006871 * Whether the package manager should send package verification broadcasts for verifiers to
6872 * review apps prior to installation.
6873 * 1 = request apps to be verified prior to installation, if a verifier exists.
6874 * 0 = do not verify apps before installation
rich cannings4e5753f2012-09-19 16:03:56 -07006875 * @hide
rich cannings4d8fc792012-09-07 14:43:43 -07006876 */
6877 public static final String PACKAGE_VERIFIER_ENABLE = "package_verifier_enable";
6878
6879 /** Timeout for package verification.
rich cannings4e5753f2012-09-19 16:03:56 -07006880 * @hide */
rich cannings4d8fc792012-09-07 14:43:43 -07006881 public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout";
6882
6883 /** Default response code for package verification.
rich cannings4e5753f2012-09-19 16:03:56 -07006884 * @hide */
rich cannings4d8fc792012-09-07 14:43:43 -07006885 public static final String PACKAGE_VERIFIER_DEFAULT_RESPONSE = "verifier_default_response";
6886
rich cannings4e5753f2012-09-19 16:03:56 -07006887 /**
6888 * Show package verification setting in the Settings app.
rich canningse6686b32012-09-16 14:02:20 -07006889 * 1 = show (default)
6890 * 0 = hide
rich cannings4e5753f2012-09-19 16:03:56 -07006891 * @hide
rich canningse6686b32012-09-16 14:02:20 -07006892 */
6893 public static final String PACKAGE_VERIFIER_SETTING_VISIBLE = "verifier_setting_visible";
6894
rich cannings4d8fc792012-09-07 14:43:43 -07006895 /**
Fabrice Di Meglio1c1b4712014-11-19 17:12:32 -08006896 * Run package verification on apps installed through ADB/ADT/USB
rich cannings4e5753f2012-09-19 16:03:56 -07006897 * 1 = perform package verification on ADB installs (default)
6898 * 0 = bypass package verification on ADB installs
6899 * @hide
6900 */
6901 public static final String PACKAGE_VERIFIER_INCLUDE_ADB = "verifier_verify_adb_installs";
6902
6903 /**
Christopher Tate7265abe2014-11-21 13:54:45 -08006904 * Time since last fstrim (milliseconds) after which we force one to happen
6905 * during device startup. If unset, the default is 3 days.
6906 * @hide
6907 */
6908 public static final String FSTRIM_MANDATORY_INTERVAL = "fstrim_mandatory_interval";
6909
6910 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006911 * The interval in milliseconds at which to check packet counts on the
6912 * mobile data interface when screen is on, to detect possible data
6913 * connection problems.
6914 * @hide
6915 */
6916 public static final String PDP_WATCHDOG_POLL_INTERVAL_MS =
6917 "pdp_watchdog_poll_interval_ms";
6918
6919 /**
6920 * The interval in milliseconds at which to check packet counts on the
6921 * mobile data interface when screen is off, to detect possible data
6922 * connection problems.
6923 * @hide
6924 */
6925 public static final String PDP_WATCHDOG_LONG_POLL_INTERVAL_MS =
6926 "pdp_watchdog_long_poll_interval_ms";
6927
6928 /**
6929 * The interval in milliseconds at which to check packet counts on the
6930 * mobile data interface after {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT}
6931 * outgoing packets has been reached without incoming packets.
6932 * @hide
6933 */
6934 public static final String PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS =
6935 "pdp_watchdog_error_poll_interval_ms";
6936
6937 /**
6938 * The number of outgoing packets sent without seeing an incoming packet
6939 * that triggers a countdown (of {@link #PDP_WATCHDOG_ERROR_POLL_COUNT}
6940 * device is logged to the event log
6941 * @hide
6942 */
6943 public static final String PDP_WATCHDOG_TRIGGER_PACKET_COUNT =
6944 "pdp_watchdog_trigger_packet_count";
6945
6946 /**
6947 * The number of polls to perform (at {@link #PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS})
6948 * after hitting {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} before
6949 * attempting data connection recovery.
6950 * @hide
6951 */
6952 public static final String PDP_WATCHDOG_ERROR_POLL_COUNT =
6953 "pdp_watchdog_error_poll_count";
6954
6955 /**
6956 * The number of failed PDP reset attempts before moving to something more
6957 * drastic: re-registering to the network.
6958 * @hide
6959 */
6960 public static final String PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT =
6961 "pdp_watchdog_max_pdp_reset_fail_count";
6962
6963 /**
6964 * A positive value indicates how often the SamplingProfiler
6965 * should take snapshots. Zero value means SamplingProfiler
6966 * is disabled.
6967 *
6968 * @hide
6969 */
6970 public static final String SAMPLING_PROFILER_MS = "sampling_profiler_ms";
6971
6972 /**
6973 * URL to open browser on to allow user to manage a prepay account
6974 * @hide
6975 */
6976 public static final String SETUP_PREPAID_DATA_SERVICE_URL =
6977 "setup_prepaid_data_service_url";
6978
6979 /**
6980 * URL to attempt a GET on to see if this is a prepay device
6981 * @hide
6982 */
6983 public static final String SETUP_PREPAID_DETECTION_TARGET_URL =
6984 "setup_prepaid_detection_target_url";
6985
6986 /**
6987 * Host to check for a redirect to after an attempt to GET
6988 * SETUP_PREPAID_DETECTION_TARGET_URL. (If we redirected there,
6989 * this is a prepaid device with zero balance.)
6990 * @hide
6991 */
6992 public static final String SETUP_PREPAID_DETECTION_REDIR_HOST =
6993 "setup_prepaid_detection_redir_host";
6994
6995 /**
Jake Hamby76a61422012-09-06 17:40:21 -07006996 * The interval in milliseconds at which to check the number of SMS sent out without asking
6997 * for use permit, to limit the un-authorized SMS usage.
6998 *
6999 * @hide
7000 */
7001 public static final String SMS_OUTGOING_CHECK_INTERVAL_MS =
7002 "sms_outgoing_check_interval_ms";
7003
7004 /**
7005 * The number of outgoing SMS sent without asking for user permit (of {@link
7006 * #SMS_OUTGOING_CHECK_INTERVAL_MS}
7007 *
7008 * @hide
7009 */
7010 public static final String SMS_OUTGOING_CHECK_MAX_COUNT =
7011 "sms_outgoing_check_max_count";
7012
7013 /**
7014 * Used to disable SMS short code confirmation - defaults to true.
Robert Greenwalt026efcc2012-09-24 10:03:21 -07007015 * True indcates we will do the check, etc. Set to false to disable.
Jake Hamby76a61422012-09-06 17:40:21 -07007016 * @see com.android.internal.telephony.SmsUsageMonitor
7017 * @hide
7018 */
7019 public static final String SMS_SHORT_CODE_CONFIRMATION = "sms_short_code_confirmation";
7020
Robert Greenwalt026efcc2012-09-24 10:03:21 -07007021 /**
7022 * Used to select which country we use to determine premium sms codes.
7023 * One of com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_SIM,
7024 * com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_NETWORK,
7025 * or com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_BOTH.
7026 * @hide
7027 */
7028 public static final String SMS_SHORT_CODE_RULE = "sms_short_code_rule";
7029
Jake Hamby76a61422012-09-06 17:40:21 -07007030 /**
JP Abgrall32d1ac4d2014-02-21 12:05:20 -08007031 * Used to select TCP's default initial receiver window size in segments - defaults to a build config value
7032 * @hide
7033 */
7034 public static final String TCP_DEFAULT_INIT_RWND = "tcp_default_init_rwnd";
7035
7036 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007037 * Used to disable Tethering on a device - defaults to true
7038 * @hide
7039 */
7040 public static final String TETHER_SUPPORTED = "tether_supported";
7041
7042 /**
7043 * Used to require DUN APN on the device or not - defaults to a build config value
7044 * which defaults to false
7045 * @hide
7046 */
7047 public static final String TETHER_DUN_REQUIRED = "tether_dun_required";
7048
7049 /**
7050 * Used to hold a gservices-provisioned apn value for DUN. If set, or the
7051 * corresponding build config values are set it will override the APN DB
7052 * values.
7053 * Consists of a comma seperated list of strings:
7054 * "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type"
7055 * note that empty fields can be ommitted: "name,apn,,,,,,,,,310,260,,DUN"
7056 * @hide
7057 */
7058 public static final String TETHER_DUN_APN = "tether_dun_apn";
7059
7060 /**
Junda Liu0c35fbc2016-01-19 23:20:15 -08007061 * List of carrier apps which are whitelisted to prompt the user for install when
7062 * a sim card with matching uicc carrier privilege rules is inserted.
7063 *
7064 * The value is "package1;package2;..."
7065 * @hide
7066 */
7067 public static final String CARRIER_APP_WHITELIST = "carrier_app_whitelist";
7068
7069 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007070 * USB Mass Storage Enabled
7071 */
7072 public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled";
7073
7074 /**
7075 * If this setting is set (to anything), then all references
7076 * to Gmail on the device must change to Google Mail.
7077 */
7078 public static final String USE_GOOGLE_MAIL = "use_google_mail";
7079
Hui Shu22671772014-10-01 21:41:07 +00007080 /**
7081 * Webview Data reduction proxy key.
7082 * @hide
7083 */
7084 public static final String WEBVIEW_DATA_REDUCTION_PROXY_KEY =
7085 "webview_data_reduction_proxy_key";
7086
Gustav Sennton14c033c2016-02-11 12:51:27 +00007087 /**
Gustav Senntonc83e3fa2016-02-18 12:19:13 +00007088 * Whether or not the WebView fallback mechanism should be enabled.
7089 * 0=disabled, 1=enabled.
7090 * @hide
7091 */
7092 public static final String WEBVIEW_FALLBACK_LOGIC_ENABLED =
7093 "webview_fallback_logic_enabled";
7094
7095 /**
Gustav Sennton14c033c2016-02-11 12:51:27 +00007096 * Name of the package used as WebView provider (if unset the provider is instead determined
7097 * by the system).
7098 * @hide
7099 */
7100 public static final String WEBVIEW_PROVIDER = "webview_provider";
7101
Tobias Sargeantda857102016-02-11 14:52:28 +00007102 /**
7103 * Developer setting to enable WebView multiprocess rendering.
7104 * @hide
7105 */
Tobias Sargeantadfded12016-02-22 13:45:34 +00007106 @SystemApi
Tobias Sargeantda857102016-02-11 14:52:28 +00007107 public static final String WEBVIEW_MULTIPROCESS = "webview_multiprocess";
7108
Christopher Tate06efb532012-08-24 15:29:27 -07007109 /**
Jeff Brown89d55462012-09-19 11:33:42 -07007110 * Whether Wifi display is enabled/disabled
7111 * 0=disabled. 1=enabled.
7112 * @hide
7113 */
7114 public static final String WIFI_DISPLAY_ON = "wifi_display_on";
7115
7116 /**
Chong Zhang1f3ecaa2013-05-03 15:55:36 -07007117 * Whether Wifi display certification mode is enabled/disabled
7118 * 0=disabled. 1=enabled.
7119 * @hide
7120 */
7121 public static final String WIFI_DISPLAY_CERTIFICATION_ON =
7122 "wifi_display_certification_on";
7123
7124 /**
Chong Zhange38af812013-08-29 17:25:17 -07007125 * WPS Configuration method used by Wifi display, this setting only
7126 * takes effect when WIFI_DISPLAY_CERTIFICATION_ON is 1 (enabled).
7127 *
7128 * Possible values are:
7129 *
7130 * WpsInfo.INVALID: use default WPS method chosen by framework
7131 * WpsInfo.PBC : use Push button
7132 * WpsInfo.KEYPAD : use Keypad
7133 * WpsInfo.DISPLAY: use Display
7134 * @hide
7135 */
7136 public static final String WIFI_DISPLAY_WPS_CONFIG =
7137 "wifi_display_wps_config";
7138
7139 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007140 * Whether to notify the user of open networks.
7141 * <p>
7142 * If not connected and the scan results have an open network, we will
7143 * put this notification up. If we attempt to connect to a network or
7144 * the open network(s) disappear, we remove the notification. When we
7145 * show the notification, we will not show it again for
7146 * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time.
7147 */
7148 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
7149 "wifi_networks_available_notification_on";
7150 /**
7151 * {@hide}
7152 */
7153 public static final String WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON =
7154 "wimax_networks_available_notification_on";
7155
7156 /**
7157 * Delay (in seconds) before repeating the Wi-Fi networks available notification.
7158 * Connecting to a network will reset the timer.
7159 */
7160 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
7161 "wifi_networks_available_repeat_delay";
7162
7163 /**
Robert Greenwalt3ea0c992013-10-03 21:13:49 +00007164 * 802.11 country code in ISO 3166 format
7165 * @hide
7166 */
7167 public static final String WIFI_COUNTRY_CODE = "wifi_country_code";
7168
7169 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007170 * The interval in milliseconds to issue wake up scans when wifi needs
7171 * to connect. This is necessary to connect to an access point when
7172 * device is on the move and the screen is off.
7173 * @hide
7174 */
7175 public static final String WIFI_FRAMEWORK_SCAN_INTERVAL_MS =
7176 "wifi_framework_scan_interval_ms";
7177
7178 /**
7179 * The interval in milliseconds after which Wi-Fi is considered idle.
7180 * When idle, it is possible for the device to be switched from Wi-Fi to
7181 * the mobile data network.
7182 * @hide
7183 */
7184 public static final String WIFI_IDLE_MS = "wifi_idle_ms";
7185
7186 /**
7187 * When the number of open networks exceeds this number, the
7188 * least-recently-used excess networks will be removed.
7189 */
7190 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept";
7191
7192 /**
7193 * Whether the Wi-Fi should be on. Only the Wi-Fi service should touch this.
7194 */
7195 public static final String WIFI_ON = "wifi_on";
7196
7197 /**
Irfan Sheriff11aefad2013-03-06 07:57:41 -08007198 * Setting to allow scans to be enabled even wifi is turned off for connectivity.
7199 * @hide
7200 */
7201 public static final String WIFI_SCAN_ALWAYS_AVAILABLE =
7202 "wifi_scan_always_enabled";
7203
7204 /**
Wei Wangd91f1932015-03-19 15:09:56 -07007205 * Settings to allow BLE scans to be enabled even when Bluetooth is turned off for
7206 * connectivity.
7207 * @hide
7208 */
7209 public static final String BLE_SCAN_ALWAYS_AVAILABLE =
7210 "ble_scan_always_enabled";
7211
7212 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007213 * Used to save the Wifi_ON state prior to tethering.
7214 * This state will be checked to restore Wifi after
7215 * the user turns off tethering.
7216 *
7217 * @hide
7218 */
7219 public static final String WIFI_SAVED_STATE = "wifi_saved_state";
7220
7221 /**
7222 * The interval in milliseconds to scan as used by the wifi supplicant
7223 * @hide
7224 */
7225 public static final String WIFI_SUPPLICANT_SCAN_INTERVAL_MS =
7226 "wifi_supplicant_scan_interval_ms";
7227
vandwalle7c3606c2014-03-31 19:12:07 -07007228 /**
7229 * whether frameworks handles wifi auto-join
7230 * @hide
7231 */
7232 public static final String WIFI_ENHANCED_AUTO_JOIN =
7233 "wifi_enhanced_auto_join";
7234
7235 /**
7236 * whether settings show RSSI
7237 * @hide
7238 */
7239 public static final String WIFI_NETWORK_SHOW_RSSI =
7240 "wifi_network_show_rssi";
7241
7242 /**
Irfan Sheriff3809f502012-09-17 16:04:57 -07007243 * The interval in milliseconds to scan at supplicant when p2p is connected
7244 * @hide
7245 */
7246 public static final String WIFI_SCAN_INTERVAL_WHEN_P2P_CONNECTED_MS =
7247 "wifi_scan_interval_p2p_connected_ms";
7248
7249 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007250 * Whether the Wi-Fi watchdog is enabled.
7251 */
7252 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
7253
7254 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007255 * Setting to turn off poor network avoidance on Wi-Fi. Feature is enabled by default and
7256 * the setting needs to be set to 0 to disable it.
7257 * @hide
7258 */
7259 public static final String WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED =
7260 "wifi_watchdog_poor_network_test_enabled";
7261
7262 /**
7263 * Setting to turn on suspend optimizations at screen off on Wi-Fi. Enabled by default and
7264 * needs to be set to 0 to disable it.
7265 * @hide
7266 */
7267 public static final String WIFI_SUSPEND_OPTIMIZATIONS_ENABLED =
7268 "wifi_suspend_optimizations_enabled";
7269
7270 /**
Nathan Harold29589fc2016-03-30 21:53:48 -07007271 * Setting to enable verbose logging in Wi-Fi; disabled by default, and setting to 1
7272 * will enable it. In the future, additional values may be supported.
7273 * @hide
7274 */
7275 public static final String WIFI_VERBOSE_LOGGING_ENABLED =
7276 "wifi_verbose_logging_enabled";
7277
7278 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007279 * The maximum number of times we will retry a connection to an access
7280 * point for which we have failed in acquiring an IP address from DHCP.
7281 * A value of N means that we will make N+1 connection attempts in all.
7282 */
7283 public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count";
7284
7285 /**
7286 * Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile
7287 * data connectivity to be established after a disconnect from Wi-Fi.
7288 */
7289 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
7290 "wifi_mobile_data_transition_wakelock_timeout_ms";
7291
7292 /**
Zoltan Szatmary-Ban4045d242015-05-27 12:42:39 +01007293 * This setting controls whether WiFi configurations created by a Device Owner app
7294 * should be locked down (that is, be editable or removable only by the Device Owner App,
7295 * not even by Settings app).
7296 * This setting takes integer values. Non-zero values mean DO created configurations
7297 * are locked down. Value of zero means they are not. Default value in the absence of
7298 * actual value to this setting is 0.
7299 */
7300 public static final String WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN =
7301 "wifi_device_owner_configs_lockdown";
7302
7303 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007304 * The operational wifi frequency band
7305 * Set to one of {@link WifiManager#WIFI_FREQUENCY_BAND_AUTO},
7306 * {@link WifiManager#WIFI_FREQUENCY_BAND_5GHZ} or
7307 * {@link WifiManager#WIFI_FREQUENCY_BAND_2GHZ}
7308 *
7309 * @hide
7310 */
7311 public static final String WIFI_FREQUENCY_BAND = "wifi_frequency_band";
7312
7313 /**
7314 * The Wi-Fi peer-to-peer device name
7315 * @hide
7316 */
7317 public static final String WIFI_P2P_DEVICE_NAME = "wifi_p2p_device_name";
7318
7319 /**
Robert Greenwaltc12783a2013-05-16 12:48:20 -07007320 * The min time between wifi disable and wifi enable
7321 * @hide
7322 */
7323 public static final String WIFI_REENABLE_DELAY_MS = "wifi_reenable_delay";
7324
7325 /**
Jeff Davidsona20ca67d2014-12-16 11:48:54 -08007326 * Timeout for ephemeral networks when all known BSSIDs go out of range. We will disconnect
7327 * from an ephemeral network if there is no BSSID for that network with a non-null score that
7328 * has been seen in this time period.
7329 *
7330 * If this is less than or equal to zero, we use a more conservative behavior and only check
7331 * for a non-null score from the currently connected or target BSSID.
7332 * @hide
7333 */
7334 public static final String WIFI_EPHEMERAL_OUT_OF_RANGE_TIMEOUT_MS =
7335 "wifi_ephemeral_out_of_range_timeout_ms";
7336
7337 /**
Christopher Tatec868b642012-09-12 17:41:04 -07007338 * The number of milliseconds to delay when checking for data stalls during
7339 * non-aggressive detection. (screen is turned off.)
7340 * @hide
7341 */
7342 public static final String DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS =
7343 "data_stall_alarm_non_aggressive_delay_in_ms";
7344
7345 /**
7346 * The number of milliseconds to delay when checking for data stalls during
7347 * aggressive detection. (screen on or suspected data stall)
7348 * @hide
7349 */
7350 public static final String DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS =
7351 "data_stall_alarm_aggressive_delay_in_ms";
7352
7353 /**
Wink Savillece1e3792013-09-03 16:41:44 -07007354 * The number of milliseconds to allow the provisioning apn to remain active
7355 * @hide
7356 */
7357 public static final String PROVISIONING_APN_ALARM_DELAY_IN_MS =
7358 "provisioning_apn_alarm_delay_in_ms";
7359
7360 /**
Christopher Tatec868b642012-09-12 17:41:04 -07007361 * The interval in milliseconds at which to check gprs registration
7362 * after the first registration mismatch of gprs and voice service,
7363 * to detect possible data network registration problems.
7364 *
7365 * @hide
7366 */
7367 public static final String GPRS_REGISTER_CHECK_PERIOD_MS =
7368 "gprs_register_check_period_ms";
7369
7370 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007371 * Nonzero causes Log.wtf() to crash.
7372 * @hide
7373 */
7374 public static final String WTF_IS_FATAL = "wtf_is_fatal";
7375
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07007376 /**
7377 * Ringer mode. This is used internally, changing this value will not
7378 * change the ringer mode. See AudioManager.
7379 */
7380 public static final String MODE_RINGER = "mode_ringer";
Christopher Tate06efb532012-08-24 15:29:27 -07007381
Jeff Brownd4935962012-09-25 13:27:20 -07007382 /**
7383 * Overlay display devices setting.
7384 * The associated value is a specially formatted string that describes the
7385 * size and density of simulated secondary display devices.
7386 * <p>
7387 * Format: {width}x{height}/{dpi};...
7388 * </p><p>
7389 * Example:
7390 * <ul>
7391 * <li><code>1280x720/213</code>: make one overlay that is 1280x720 at 213dpi.</li>
7392 * <li><code>1920x1080/320;1280x720/213</code>: make two overlays, the first
7393 * at 1080p and the second at 720p.</li>
7394 * <li>If the value is empty, then no overlay display devices are created.</li>
7395 * </ul></p>
7396 *
7397 * @hide
7398 */
7399 public static final String OVERLAY_DISPLAY_DEVICES = "overlay_display_devices";
Christopher Tate06efb532012-08-24 15:29:27 -07007400
Jeff Sharkey625239a2012-09-26 22:03:49 -07007401 /**
7402 * Threshold values for the duration and level of a discharge cycle,
7403 * under which we log discharge cycle info.
7404 *
7405 * @hide
7406 */
7407 public static final String
7408 BATTERY_DISCHARGE_DURATION_THRESHOLD = "battery_discharge_duration_threshold";
7409
7410 /** @hide */
7411 public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold";
7412
7413 /**
7414 * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR
7415 * intents on application crashes and ANRs. If this is disabled, the
7416 * crash/ANR dialog will never display the "Report" button.
7417 * <p>
7418 * Type: int (0 = disallow, 1 = allow)
7419 *
7420 * @hide
7421 */
7422 public static final String SEND_ACTION_APP_ERROR = "send_action_app_error";
7423
7424 /**
7425 * Maximum age of entries kept by {@link DropBoxManager}.
7426 *
7427 * @hide
7428 */
7429 public static final String DROPBOX_AGE_SECONDS = "dropbox_age_seconds";
7430
7431 /**
7432 * Maximum number of entry files which {@link DropBoxManager} will keep
7433 * around.
7434 *
7435 * @hide
7436 */
7437 public static final String DROPBOX_MAX_FILES = "dropbox_max_files";
7438
7439 /**
7440 * Maximum amount of disk space used by {@link DropBoxManager} no matter
7441 * what.
7442 *
7443 * @hide
7444 */
7445 public static final String DROPBOX_QUOTA_KB = "dropbox_quota_kb";
7446
7447 /**
7448 * Percent of free disk (excluding reserve) which {@link DropBoxManager}
7449 * will use.
7450 *
7451 * @hide
7452 */
7453 public static final String DROPBOX_QUOTA_PERCENT = "dropbox_quota_percent";
7454
7455 /**
7456 * Percent of total disk which {@link DropBoxManager} will never dip
7457 * into.
7458 *
7459 * @hide
7460 */
7461 public static final String DROPBOX_RESERVE_PERCENT = "dropbox_reserve_percent";
7462
7463 /**
7464 * Prefix for per-tag dropbox disable/enable settings.
7465 *
7466 * @hide
7467 */
7468 public static final String DROPBOX_TAG_PREFIX = "dropbox:";
7469
7470 /**
7471 * Lines of logcat to include with system crash/ANR/etc. reports, as a
7472 * prefix of the dropbox tag of the report type. For example,
7473 * "logcat_for_system_server_anr" controls the lines of logcat captured
7474 * with system server ANR reports. 0 to disable.
7475 *
7476 * @hide
7477 */
7478 public static final String ERROR_LOGCAT_PREFIX = "logcat_for_";
7479
7480 /**
7481 * The interval in minutes after which the amount of free storage left
7482 * on the device is logged to the event log
7483 *
7484 * @hide
7485 */
7486 public static final String SYS_FREE_STORAGE_LOG_INTERVAL = "sys_free_storage_log_interval";
7487
7488 /**
7489 * Threshold for the amount of change in disk free space required to
7490 * report the amount of free space. Used to prevent spamming the logs
7491 * when the disk free space isn't changing frequently.
7492 *
7493 * @hide
7494 */
7495 public static final String
7496 DISK_FREE_CHANGE_REPORTING_THRESHOLD = "disk_free_change_reporting_threshold";
7497
7498 /**
7499 * Minimum percentage of free storage on the device that is used to
7500 * determine if the device is running low on storage. The default is 10.
7501 * <p>
7502 * Say this value is set to 10, the device is considered running low on
7503 * storage if 90% or more of the device storage is filled up.
7504 *
7505 * @hide
7506 */
7507 public static final String
7508 SYS_STORAGE_THRESHOLD_PERCENTAGE = "sys_storage_threshold_percentage";
7509
7510 /**
7511 * Maximum byte size of the low storage threshold. This is to ensure
7512 * that {@link #SYS_STORAGE_THRESHOLD_PERCENTAGE} does not result in an
7513 * overly large threshold for large storage devices. Currently this must
7514 * be less than 2GB. This default is 500MB.
7515 *
7516 * @hide
7517 */
7518 public static final String
7519 SYS_STORAGE_THRESHOLD_MAX_BYTES = "sys_storage_threshold_max_bytes";
7520
7521 /**
7522 * Minimum bytes of free storage on the device before the data partition
7523 * is considered full. By default, 1 MB is reserved to avoid system-wide
7524 * SQLite disk full exceptions.
7525 *
7526 * @hide
7527 */
7528 public static final String
7529 SYS_STORAGE_FULL_THRESHOLD_BYTES = "sys_storage_full_threshold_bytes";
7530
7531 /**
7532 * The maximum reconnect delay for short network outages or when the
7533 * network is suspended due to phone use.
7534 *
7535 * @hide
7536 */
7537 public static final String
7538 SYNC_MAX_RETRY_DELAY_IN_SECONDS = "sync_max_retry_delay_in_seconds";
7539
7540 /**
7541 * The number of milliseconds to delay before sending out
Erik Kline8f29dcf2014-12-08 16:25:20 +09007542 * {@link ConnectivityManager#CONNECTIVITY_ACTION} broadcasts. Ignored.
Jeff Sharkey625239a2012-09-26 22:03:49 -07007543 *
7544 * @hide
7545 */
7546 public static final String CONNECTIVITY_CHANGE_DELAY = "connectivity_change_delay";
7547
Vinit Deshapnde1f12cb52013-08-21 13:09:01 -07007548
7549 /**
7550 * Network sampling interval, in seconds. We'll generate link information
7551 * about bytes/packets sent and error rates based on data sampled in this interval
7552 *
7553 * @hide
7554 */
7555
7556 public static final String CONNECTIVITY_SAMPLING_INTERVAL_IN_SECONDS =
7557 "connectivity_sampling_interval_in_seconds";
7558
Jeff Sharkey625239a2012-09-26 22:03:49 -07007559 /**
Jason Monk602b2322013-07-03 17:04:33 -04007560 * The series of successively longer delays used in retrying to download PAC file.
7561 * Last delay is used between successful PAC downloads.
7562 *
7563 * @hide
7564 */
7565 public static final String PAC_CHANGE_DELAY = "pac_change_delay";
7566
7567 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07007568 * Setting to turn off captive portal detection. Feature is enabled by
7569 * default and the setting needs to be set to 0 to disable it.
7570 *
7571 * @hide
7572 */
7573 public static final String
7574 CAPTIVE_PORTAL_DETECTION_ENABLED = "captive_portal_detection_enabled";
7575
7576 /**
7577 * The server used for captive portal detection upon a new conection. A
7578 * 204 response code from the server is used for validation.
7579 *
7580 * @hide
7581 */
7582 public static final String CAPTIVE_PORTAL_SERVER = "captive_portal_server";
7583
7584 /**
7585 * Whether network service discovery is enabled.
7586 *
7587 * @hide
7588 */
7589 public static final String NSD_ON = "nsd_on";
7590
7591 /**
7592 * Let user pick default install location.
7593 *
7594 * @hide
7595 */
7596 public static final String SET_INSTALL_LOCATION = "set_install_location";
7597
7598 /**
7599 * Default install location value.
7600 * 0 = auto, let system decide
7601 * 1 = internal
7602 * 2 = sdcard
7603 * @hide
7604 */
7605 public static final String DEFAULT_INSTALL_LOCATION = "default_install_location";
7606
7607 /**
7608 * ms during which to consume extra events related to Inet connection
7609 * condition after a transtion to fully-connected
7610 *
7611 * @hide
7612 */
7613 public static final String
7614 INET_CONDITION_DEBOUNCE_UP_DELAY = "inet_condition_debounce_up_delay";
7615
7616 /**
7617 * ms during which to consume extra events related to Inet connection
7618 * condtion after a transtion to partly-connected
7619 *
7620 * @hide
7621 */
7622 public static final String
7623 INET_CONDITION_DEBOUNCE_DOWN_DELAY = "inet_condition_debounce_down_delay";
7624
7625 /** {@hide} */
7626 public static final String
7627 READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT = "read_external_storage_enforced_default";
7628
7629 /**
7630 * Host name and port for global http proxy. Uses ':' seperator for
7631 * between host and port.
7632 */
7633 public static final String HTTP_PROXY = "http_proxy";
7634
7635 /**
7636 * Host name for global http proxy. Set via ConnectivityManager.
7637 *
7638 * @hide
7639 */
7640 public static final String GLOBAL_HTTP_PROXY_HOST = "global_http_proxy_host";
7641
7642 /**
7643 * Integer host port for global http proxy. Set via ConnectivityManager.
7644 *
7645 * @hide
7646 */
7647 public static final String GLOBAL_HTTP_PROXY_PORT = "global_http_proxy_port";
7648
7649 /**
7650 * Exclusion list for global proxy. This string contains a list of
7651 * comma-separated domains where the global proxy does not apply.
7652 * Domains should be listed in a comma- separated list. Example of
7653 * acceptable formats: ".domain1.com,my.domain2.com" Use
7654 * ConnectivityManager to set/get.
7655 *
7656 * @hide
7657 */
7658 public static final String
7659 GLOBAL_HTTP_PROXY_EXCLUSION_LIST = "global_http_proxy_exclusion_list";
7660
7661 /**
Jason Monk602b2322013-07-03 17:04:33 -04007662 * The location PAC File for the proxy.
7663 * @hide
7664 */
7665 public static final String
7666 GLOBAL_HTTP_PROXY_PAC = "global_proxy_pac_url";
7667
7668 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07007669 * Enables the UI setting to allow the user to specify the global HTTP
7670 * proxy and associated exclusion list.
7671 *
7672 * @hide
7673 */
7674 public static final String SET_GLOBAL_HTTP_PROXY = "set_global_http_proxy";
7675
7676 /**
7677 * Setting for default DNS in case nobody suggests one
7678 *
7679 * @hide
7680 */
7681 public static final String DEFAULT_DNS_SERVER = "default_dns_server";
7682
Jeff Sharkey0ac10282012-10-01 12:50:22 -07007683 /** {@hide} */
7684 public static final String
7685 BLUETOOTH_HEADSET_PRIORITY_PREFIX = "bluetooth_headset_priority_";
7686 /** {@hide} */
7687 public static final String
7688 BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX = "bluetooth_a2dp_sink_priority_";
7689 /** {@hide} */
7690 public static final String
Sanket Agarwal1bec6a52015-10-21 18:23:27 -07007691 BLUETOOTH_A2DP_SRC_PRIORITY_PREFIX = "bluetooth_a2dp_src_priority_";
7692 /** {@hide} */
7693 public static final String
Jeff Sharkey0ac10282012-10-01 12:50:22 -07007694 BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX = "bluetooth_input_device_priority_";
Kim Schulz0d376052013-08-22 11:18:02 +02007695 /** {@hide} */
7696 public static final String
7697 BLUETOOTH_MAP_PRIORITY_PREFIX = "bluetooth_map_priority_";
Casper Bonde2a5f6082015-03-19 10:36:45 +01007698 /** {@hide} */
7699 public static final String
Joseph Pirozzo563c7002016-03-21 15:49:48 -07007700 BLUETOOTH_PBAP_CLIENT_PRIORITY_PREFIX = "bluetooth_pbap_client_priority_";
7701 /** {@hide} */
7702 public static final String
Casper Bonde2a5f6082015-03-19 10:36:45 +01007703 BLUETOOTH_SAP_PRIORITY_PREFIX = "bluetooth_sap_priority_";
Jeff Sharkey0ac10282012-10-01 12:50:22 -07007704
7705 /**
Adam Lesinski31c05d12015-06-09 17:34:04 -07007706 * Device Idle (Doze) specific settings.
7707 * This is encoded as a key=value list, separated by commas. Ex:
7708 *
7709 * "inactive_timeout=60000,sensing_timeout=400000"
7710 *
7711 * The following keys are supported:
7712 *
7713 * <pre>
7714 * inactive_to (long)
7715 * sensing_to (long)
7716 * motion_inactive_to (long)
7717 * idle_after_inactive_to (long)
7718 * idle_pending_to (long)
7719 * max_idle_pending_to (long)
7720 * idle_pending_factor (float)
7721 * idle_to (long)
7722 * max_idle_to (long)
7723 * idle_factor (float)
7724 * min_time_to_alarm (long)
7725 * max_temp_app_whitelist_duration (long)
7726 * </pre>
7727 *
7728 * <p>
7729 * Type: string
7730 * @hide
7731 * @see com.android.server.DeviceIdleController.Constants
7732 */
7733 public static final String DEVICE_IDLE_CONSTANTS = "device_idle_constants";
7734
7735 /**
Joe LaPennaf33b5bf2016-03-23 15:19:47 -07007736 * Device Idle (Doze) specific settings for watches. See {@code #DEVICE_IDLE_CONSTANTS}
7737 *
7738 * <p>
7739 * Type: string
7740 * @hide
7741 * @see com.android.server.DeviceIdleController.Constants
7742 */
7743 public static final String DEVICE_IDLE_CONSTANTS_WATCH = "device_idle_constants_watch";
7744
7745 /**
Adam Lesinskia6232df2015-06-11 18:16:41 -07007746 * App standby (app idle) specific settings.
7747 * This is encoded as a key=value list, separated by commas. Ex:
7748 *
7749 * "idle_duration=5000,parole_interval=4500"
7750 *
7751 * The following keys are supported:
7752 *
7753 * <pre>
Adam Lesinskif0ef3c12016-01-13 12:26:07 -08007754 * idle_duration2 (long)
Adam Lesinskia6232df2015-06-11 18:16:41 -07007755 * wallclock_threshold (long)
7756 * parole_interval (long)
7757 * parole_duration (long)
Adam Lesinskif0ef3c12016-01-13 12:26:07 -08007758 *
7759 * idle_duration (long) // This is deprecated and used to circumvent b/26355386.
Adam Lesinskia6232df2015-06-11 18:16:41 -07007760 * </pre>
7761 *
7762 * <p>
7763 * Type: string
7764 * @hide
7765 * @see com.android.server.usage.UsageStatsService.SettingsObserver
7766 */
7767 public static final String APP_IDLE_CONSTANTS = "app_idle_constants";
7768
7769 /**
Dianne Hackborna750a632015-06-16 17:18:23 -07007770 * Alarm manager specific settings.
7771 * This is encoded as a key=value list, separated by commas. Ex:
7772 *
7773 * "min_futurity=5000,allow_while_idle_short_time=4500"
7774 *
7775 * The following keys are supported:
7776 *
7777 * <pre>
7778 * min_futurity (long)
7779 * min_interval (long)
7780 * allow_while_idle_short_time (long)
7781 * allow_while_idle_long_time (long)
7782 * allow_while_idle_whitelist_duration (long)
7783 * </pre>
7784 *
7785 * <p>
7786 * Type: string
7787 * @hide
7788 * @see com.android.server.AlarmManagerService.Constants
7789 */
7790 public static final String ALARM_MANAGER_CONSTANTS = "alarm_manager_constants";
7791
7792 /**
Makoto Onuki4362a662016-03-08 18:59:09 -08007793 * ShortcutManager specific settings.
7794 * This is encoded as a key=value list, separated by commas. Ex:
7795 *
7796 * "reset_interval_sec=86400,max_daily_updates=5"
7797 *
7798 * The following keys are supported:
7799 *
7800 * <pre>
7801 * reset_interval_sec (long)
7802 * max_daily_updates (int)
7803 * max_icon_dimension_dp (int, DP)
7804 * max_icon_dimension_dp_lowram (int, DP)
7805 * max_shortcuts (int)
7806 * icon_quality (int, 0-100)
7807 * icon_format (String)
7808 * </pre>
7809 *
7810 * <p>
7811 * Type: string
7812 * @hide
7813 * @see com.android.server.pm.ShortcutService.ConfigConstants
7814 */
7815 public static final String SHORTCUT_MANAGER_CONSTANTS = "shortcut_manager_constants";
7816
7817 /**
Jeff Sharkey0ac10282012-10-01 12:50:22 -07007818 * Get the key that retrieves a bluetooth headset's priority.
7819 * @hide
7820 */
7821 public static final String getBluetoothHeadsetPriorityKey(String address) {
Elliott Hughescb64d432013-08-02 10:00:44 -07007822 return BLUETOOTH_HEADSET_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
Jeff Sharkey0ac10282012-10-01 12:50:22 -07007823 }
7824
7825 /**
7826 * Get the key that retrieves a bluetooth a2dp sink's priority.
7827 * @hide
7828 */
7829 public static final String getBluetoothA2dpSinkPriorityKey(String address) {
Elliott Hughescb64d432013-08-02 10:00:44 -07007830 return BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
Jeff Sharkey0ac10282012-10-01 12:50:22 -07007831 }
7832
7833 /**
Sanket Agarwal1bec6a52015-10-21 18:23:27 -07007834 * Get the key that retrieves a bluetooth a2dp src's priority.
7835 * @hide
7836 */
7837 public static final String getBluetoothA2dpSrcPriorityKey(String address) {
7838 return BLUETOOTH_A2DP_SRC_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
7839 }
7840
7841 /**
Jeff Sharkey0ac10282012-10-01 12:50:22 -07007842 * Get the key that retrieves a bluetooth Input Device's priority.
7843 * @hide
7844 */
7845 public static final String getBluetoothInputDevicePriorityKey(String address) {
Elliott Hughescb64d432013-08-02 10:00:44 -07007846 return BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
Jeff Sharkey0ac10282012-10-01 12:50:22 -07007847 }
7848
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07007849 /**
Kim Schulz0d376052013-08-22 11:18:02 +02007850 * Get the key that retrieves a bluetooth map priority.
7851 * @hide
7852 */
7853 public static final String getBluetoothMapPriorityKey(String address) {
7854 return BLUETOOTH_MAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
7855 }
Casper Bonde2a5f6082015-03-19 10:36:45 +01007856
7857 /**
Joseph Pirozzo563c7002016-03-21 15:49:48 -07007858 * Get the key that retrieves a bluetooth pbap client priority.
7859 * @hide
7860 */
7861 public static final String getBluetoothPbapClientPriorityKey(String address) {
7862 return BLUETOOTH_PBAP_CLIENT_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
7863 }
7864
7865 /**
Casper Bonde2a5f6082015-03-19 10:36:45 +01007866 * Get the key that retrieves a bluetooth map priority.
7867 * @hide
7868 */
7869 public static final String getBluetoothSapPriorityKey(String address) {
7870 return BLUETOOTH_SAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
7871 }
7872
Kim Schulz0d376052013-08-22 11:18:02 +02007873 /**
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07007874 * Scaling factor for normal window animations. Setting to 0 will
7875 * disable window animations.
7876 */
7877 public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale";
7878
7879 /**
7880 * Scaling factor for activity transition animations. Setting to 0 will
7881 * disable window animations.
7882 */
7883 public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale";
7884
7885 /**
7886 * Scaling factor for Animator-based animations. This affects both the
7887 * start delay and duration of all such animations. Setting to 0 will
7888 * cause animations to end immediately. The default value is 1.
7889 */
7890 public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale";
7891
7892 /**
7893 * Scaling factor for normal window animations. Setting to 0 will
7894 * disable window animations.
7895 *
7896 * @hide
7897 */
7898 public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations";
7899
7900 /**
7901 * If 0, the compatibility mode is off for all applications.
7902 * If 1, older applications run under compatibility mode.
7903 * TODO: remove this settings before code freeze (bug/1907571)
7904 * @hide
7905 */
7906 public static final String COMPATIBILITY_MODE = "compatibility_mode";
7907
7908 /**
7909 * CDMA only settings
7910 * Emergency Tone 0 = Off
7911 * 1 = Alert
7912 * 2 = Vibrate
7913 * @hide
7914 */
7915 public static final String EMERGENCY_TONE = "emergency_tone";
7916
7917 /**
7918 * CDMA only settings
7919 * Whether the auto retry is enabled. The value is
7920 * boolean (1 or 0).
7921 * @hide
7922 */
7923 public static final String CALL_AUTO_RETRY = "call_auto_retry";
7924
7925 /**
Sungmin Choie099ab12014-06-09 14:45:51 +09007926 * See RIL_PreferredNetworkType in ril.h
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07007927 * @hide
7928 */
7929 public static final String PREFERRED_NETWORK_MODE =
7930 "preferred_network_mode";
7931
7932 /**
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07007933 * Name of an application package to be debugged.
7934 */
7935 public static final String DEBUG_APP = "debug_app";
7936
7937 /**
7938 * If 1, when launching DEBUG_APP it will wait for the debugger before
7939 * starting user code. If 0, it will run normally.
7940 */
7941 public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger";
7942
7943 /**
7944 * Control whether the process CPU usage meter should be shown.
7945 */
7946 public static final String SHOW_PROCESSES = "show_processes";
7947
7948 /**
Ruchi Kandoi62b8a492014-04-17 18:01:40 -07007949 * If 1 low power mode is enabled.
7950 * @hide
7951 */
7952 public static final String LOW_POWER_MODE = "low_power";
7953
John Spurlockf8f524c2014-06-10 14:47:29 -04007954 /**
7955 * Battery level [1-99] at which low power mode automatically turns on.
Dianne Hackborn14272302014-06-10 23:13:02 -07007956 * If 0, it will not automatically turn on.
John Spurlockf8f524c2014-06-10 14:47:29 -04007957 * @hide
7958 */
7959 public static final String LOW_POWER_MODE_TRIGGER_LEVEL = "low_power_trigger_level";
7960
Ruchi Kandoi62b8a492014-04-17 18:01:40 -07007961 /**
Dianne Hackbornb2117d12016-02-16 18:26:35 -08007962 * If not 0, the activity manager will aggressively finish activities and
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07007963 * processes as soon as they are no longer needed. If 0, the normal
7964 * extended lifetime is used.
7965 */
Dianne Hackborn89ad4562014-08-24 16:45:38 -07007966 public static final String ALWAYS_FINISH_ACTIVITIES = "always_finish_activities";
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07007967
Christopher Tate66488d62012-10-02 11:58:01 -07007968 /**
Dianne Hackbornb2117d12016-02-16 18:26:35 -08007969 * @hide
7970 * If not 0, the activity manager will implement a looser version of background
7971 * check that is more compatible with existing apps.
7972 */
7973 public static final String LENIENT_BACKGROUND_CHECK = "lenient_background_check";
7974
7975 /**
Eric Laurent7ee1e4f2012-10-26 18:11:21 -07007976 * Use Dock audio output for media:
7977 * 0 = disabled
7978 * 1 = enabled
7979 * @hide
7980 */
7981 public static final String DOCK_AUDIO_MEDIA_ENABLED = "dock_audio_media_enabled";
7982
7983 /**
Phil Burkdeaa8d92016-02-23 17:12:04 -08007984 * The surround sound formats AC3, DTS or IEC61937 are
7985 * available for use if they are detected.
7986 * This is the default mode.
7987 *
7988 * Note that AUTO is equivalent to ALWAYS for Android TVs and other
7989 * devices that have an S/PDIF output. This is because S/PDIF
7990 * is unidirectional and the TV cannot know if a decoder is
7991 * connected. So it assumes they are always available.
7992 * @hide
7993 */
7994 public static final int ENCODED_SURROUND_OUTPUT_AUTO = 0;
7995
7996 /**
7997 * AC3, DTS or IEC61937 are NEVER available, even if they
7998 * are detected by the hardware. Those formats will not be
7999 * reported.
8000 *
8001 * An example use case would be an AVR reports that it is capable of
8002 * surround sound decoding but is broken. If NEVER is chosen
8003 * then apps must use PCM output instead of encoded output.
8004 * @hide
8005 */
8006 public static final int ENCODED_SURROUND_OUTPUT_NEVER = 1;
8007
8008 /**
8009 * AC3, DTS or IEC61937 are ALWAYS available, even if they
8010 * are not detected by the hardware. Those formats will be
8011 * reported as part of the HDMI output capability. Applications
8012 * are then free to use either PCM or encoded output.
8013 *
8014 * An example use case would be a when TV was connected over
8015 * TOS-link to an AVR. But the TV could not see it because TOS-link
8016 * is unidirectional.
8017 * @hide
8018 */
8019 public static final int ENCODED_SURROUND_OUTPUT_ALWAYS = 2;
8020
8021 /**
8022 * Set to ENCODED_SURROUND_OUTPUT_AUTO,
8023 * ENCODED_SURROUND_OUTPUT_NEVER or
8024 * ENCODED_SURROUND_OUTPUT_ALWAYS
8025 * @hide
8026 */
8027 public static final String ENCODED_SURROUND_OUTPUT = "encoded_surround_output";
8028
8029 /**
Eric Laurent05274f32012-11-29 12:48:18 -08008030 * Persisted safe headphone volume management state by AudioService
8031 * @hide
8032 */
8033 public static final String AUDIO_SAFE_VOLUME_STATE = "audio_safe_volume_state";
8034
8035 /**
Geremy Condraa0735112013-03-26 21:49:26 -07008036 * URL for tzinfo (time zone) updates
8037 * @hide
8038 */
8039 public static final String TZINFO_UPDATE_CONTENT_URL = "tzinfo_content_url";
8040
8041 /**
8042 * URL for tzinfo (time zone) update metadata
8043 * @hide
8044 */
8045 public static final String TZINFO_UPDATE_METADATA_URL = "tzinfo_metadata_url";
8046
8047 /**
8048 * URL for selinux (mandatory access control) updates
8049 * @hide
8050 */
8051 public static final String SELINUX_UPDATE_CONTENT_URL = "selinux_content_url";
8052
8053 /**
8054 * URL for selinux (mandatory access control) update metadata
8055 * @hide
8056 */
8057 public static final String SELINUX_UPDATE_METADATA_URL = "selinux_metadata_url";
8058
8059 /**
8060 * URL for sms short code updates
8061 * @hide
8062 */
8063 public static final String SMS_SHORT_CODES_UPDATE_CONTENT_URL =
8064 "sms_short_codes_content_url";
8065
8066 /**
8067 * URL for sms short code update metadata
8068 * @hide
8069 */
8070 public static final String SMS_SHORT_CODES_UPDATE_METADATA_URL =
8071 "sms_short_codes_metadata_url";
8072
8073 /**
Amit Mahajan9069fab2015-05-01 11:05:47 -07008074 * URL for apn_db updates
8075 * @hide
8076 */
8077 public static final String APN_DB_UPDATE_CONTENT_URL = "apn_db_content_url";
8078
8079 /**
8080 * URL for apn_db update metadata
8081 * @hide
8082 */
8083 public static final String APN_DB_UPDATE_METADATA_URL = "apn_db_metadata_url";
8084
8085 /**
Geremy Condraa0735112013-03-26 21:49:26 -07008086 * URL for cert pinlist updates
8087 * @hide
8088 */
8089 public static final String CERT_PIN_UPDATE_CONTENT_URL = "cert_pin_content_url";
8090
8091 /**
8092 * URL for cert pinlist updates
8093 * @hide
8094 */
8095 public static final String CERT_PIN_UPDATE_METADATA_URL = "cert_pin_metadata_url";
8096
Geremy Condra757ee522013-03-29 16:39:45 -07008097 /**
Ben Gruver633dc9b2013-04-04 12:05:49 -07008098 * URL for intent firewall updates
8099 * @hide
8100 */
8101 public static final String INTENT_FIREWALL_UPDATE_CONTENT_URL =
8102 "intent_firewall_content_url";
8103
8104 /**
8105 * URL for intent firewall update metadata
8106 * @hide
8107 */
8108 public static final String INTENT_FIREWALL_UPDATE_METADATA_URL =
8109 "intent_firewall_metadata_url";
8110
8111 /**
Geremy Condra4e7f7e82013-03-26 21:09:01 -07008112 * SELinux enforcement status. If 0, permissive; if 1, enforcing.
8113 * @hide
8114 */
8115 public static final String SELINUX_STATUS = "selinux_status";
8116
Geremy Condraa0735112013-03-26 21:49:26 -07008117 /**
Amith Yamasanid8415f42013-08-07 20:15:10 -07008118 * Developer setting to force RTL layout.
8119 * @hide
8120 */
8121 public static final String DEVELOPMENT_FORCE_RTL = "debug.force_rtl";
8122
8123 /**
Daniel Sandlerdea64622013-09-23 16:05:57 -04008124 * Milliseconds after screen-off after which low battery sounds will be silenced.
8125 *
8126 * If zero, battery sounds will always play.
8127 * Defaults to @integer/def_low_battery_sound_timeout in SettingsProvider.
8128 *
8129 * @hide
8130 */
8131 public static final String LOW_BATTERY_SOUND_TIMEOUT = "low_battery_sound_timeout";
8132
8133 /**
Evan Charltoncc7b0432014-01-14 14:47:11 -08008134 * Milliseconds to wait before bouncing Wi-Fi after settings is restored. Note that after
Dianne Hackborna3fb40d2014-08-12 15:06:50 -07008135 * the caller is done with this, they should call {@link ContentResolver#delete} to
Evan Charltoncc7b0432014-01-14 14:47:11 -08008136 * clean up any value that they may have written.
8137 *
8138 * @hide
8139 */
8140 public static final String WIFI_BOUNCE_DELAY_OVERRIDE_MS = "wifi_bounce_delay_override_ms";
8141
John Spurlockc6d1c602014-01-17 15:22:06 -05008142 /**
8143 * Defines global runtime overrides to window policy.
8144 *
Jorim Jaggib10e33f2015-02-04 21:57:40 +01008145 * See {@link com.android.server.policy.PolicyControl} for value format.
John Spurlockc6d1c602014-01-17 15:22:06 -05008146 *
8147 * @hide
8148 */
8149 public static final String POLICY_CONTROL = "policy_control";
Evan Charltoncc7b0432014-01-14 14:47:11 -08008150
8151 /**
John Spurlockae641c92014-06-30 18:11:40 -04008152 * Defines global zen mode. ZEN_MODE_OFF, ZEN_MODE_IMPORTANT_INTERRUPTIONS,
8153 * or ZEN_MODE_NO_INTERRUPTIONS.
John Spurlocke677d712014-02-13 12:52:19 -05008154 *
8155 * @hide
8156 */
8157 public static final String ZEN_MODE = "zen_mode";
8158
8159 /** @hide */ public static final int ZEN_MODE_OFF = 0;
John Spurlockae641c92014-06-30 18:11:40 -04008160 /** @hide */ public static final int ZEN_MODE_IMPORTANT_INTERRUPTIONS = 1;
8161 /** @hide */ public static final int ZEN_MODE_NO_INTERRUPTIONS = 2;
John Spurlock4f1163c2015-04-02 17:41:21 -04008162 /** @hide */ public static final int ZEN_MODE_ALARMS = 3;
John Spurlocke677d712014-02-13 12:52:19 -05008163
8164 /** @hide */ public static String zenModeToString(int mode) {
John Spurlockae641c92014-06-30 18:11:40 -04008165 if (mode == ZEN_MODE_IMPORTANT_INTERRUPTIONS) return "ZEN_MODE_IMPORTANT_INTERRUPTIONS";
John Spurlock4f1163c2015-04-02 17:41:21 -04008166 if (mode == ZEN_MODE_ALARMS) return "ZEN_MODE_ALARMS";
John Spurlockae641c92014-06-30 18:11:40 -04008167 if (mode == ZEN_MODE_NO_INTERRUPTIONS) return "ZEN_MODE_NO_INTERRUPTIONS";
8168 return "ZEN_MODE_OFF";
John Spurlocke677d712014-02-13 12:52:19 -05008169 }
8170
John Spurlockb2278d62015-04-07 12:47:12 -04008171 /** @hide */ public static boolean isValidZenMode(int value) {
8172 switch (value) {
8173 case Global.ZEN_MODE_OFF:
8174 case Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS:
8175 case Global.ZEN_MODE_ALARMS:
8176 case Global.ZEN_MODE_NO_INTERRUPTIONS:
8177 return true;
8178 default:
8179 return false;
8180 }
8181 }
8182
John Spurlocke677d712014-02-13 12:52:19 -05008183 /**
Julia Reynolds9b11fdb2015-07-31 09:49:55 -04008184 * Value of the ringer before entering zen mode.
8185 *
8186 * @hide
8187 */
8188 public static final String ZEN_MODE_RINGER_LEVEL = "zen_mode_ringer_level";
8189
8190 /**
John Spurlock056c5192014-04-20 21:52:01 -04008191 * Opaque value, changes when persisted zen mode configuration changes.
8192 *
8193 * @hide
8194 */
8195 public static final String ZEN_MODE_CONFIG_ETAG = "zen_mode_config_etag";
8196
8197 /**
Chris Wren7bd241232014-02-28 16:25:05 -05008198 * Defines global heads up toggle. One of HEADS_UP_OFF, HEADS_UP_ON.
8199 *
8200 * @hide
8201 */
Chris Wren10d82df2014-03-01 10:34:51 -05008202 public static final String HEADS_UP_NOTIFICATIONS_ENABLED =
8203 "heads_up_notifications_enabled";
Chris Wren7bd241232014-02-28 16:25:05 -05008204
8205 /** @hide */ public static final int HEADS_UP_OFF = 0;
8206 /** @hide */ public static final int HEADS_UP_ON = 1;
8207
8208 /**
Jerome Poichet147b4d72014-05-12 18:13:27 -07008209 * The name of the device
8210 *
8211 * @hide
8212 */
8213 public static final String DEVICE_NAME = "device_name";
8214
8215 /**
Jeff Davidson56f9f732014-08-14 16:47:23 -07008216 * Whether the NetworkScoringService has been first initialized.
8217 * <p>
8218 * Type: int (0 for false, 1 for true)
8219 * @hide
8220 */
8221 public static final String NETWORK_SCORING_PROVISIONED = "network_scoring_provisioned";
8222
8223 /**
Jim Miller6848dc82014-10-13 18:51:53 -07008224 * Whether the user wants to be prompted for password to decrypt the device on boot.
8225 * This only matters if the storage is encrypted.
8226 * <p>
8227 * Type: int (0 for false, 1 for true)
8228 * @hide
8229 */
8230 public static final String REQUIRE_PASSWORD_TO_DECRYPT = "require_password_to_decrypt";
8231
8232 /**
Etan Cohen93bbf272015-05-04 18:01:47 -07008233 * Whether the Volte is enabled
Libin.Tang@motorola.com0499bb52014-10-10 14:55:57 -05008234 * <p>
8235 * Type: int (0 for false, 1 for true)
8236 * @hide
8237 */
Etan Cohene41a9cf2014-10-22 10:50:46 -07008238 public static final String ENHANCED_4G_MODE_ENABLED = "volte_vt_enabled";
Libin.Tang@motorola.com0499bb52014-10-10 14:55:57 -05008239
8240 /**
Etan Cohen93bbf272015-05-04 18:01:47 -07008241 * Whether VT (Video Telephony over IMS) is enabled
8242 * <p>
8243 * Type: int (0 for false, 1 for true)
8244 *
8245 * @hide
8246 */
8247 public static final String VT_IMS_ENABLED = "vt_ims_enabled";
8248
8249 /**
Etan Cohen9c8f21b2014-12-23 15:02:19 -08008250 * Whether WFC is enabled
8251 * <p>
8252 * Type: int (0 for false, 1 for true)
8253 *
8254 * @hide
8255 */
8256 public static final String WFC_IMS_ENABLED = "wfc_ims_enabled";
8257
8258 /**
8259 * WFC Mode.
8260 * <p>
8261 * Type: int - 2=Wi-Fi preferred, 1=Cellular preferred, 0=Wi-Fi only
8262 *
8263 * @hide
8264 */
8265 public static final String WFC_IMS_MODE = "wfc_ims_mode";
8266
8267 /**
8268 * Whether WFC roaming is enabled
8269 * <p>
8270 * Type: int (0 for false, 1 for true)
8271 *
8272 * @hide
8273 */
8274 public static final String WFC_IMS_ROAMING_ENABLED = "wfc_ims_roaming_enabled";
8275
8276 /**
Amit Mahajan4fea0922014-11-18 12:56:28 -08008277 * Whether user can enable/disable LTE as a preferred network. A carrier might control
8278 * this via gservices, OMA-DM, carrier app, etc.
8279 * <p>
8280 * Type: int (0 for false, 1 for true)
8281 * @hide
8282 */
8283 public static final String LTE_SERVICE_FORCED = "lte_service_forced";
8284
8285 /**
Svet Ganov2acf0632015-11-24 19:10:59 -08008286 * Ephemeral app cookie max size in bytes.
8287 * <p>
8288 * Type: int
8289 * @hide
8290 */
8291 public static final String EPHEMERAL_COOKIE_MAX_SIZE_BYTES =
8292 "ephemeral_cookie_max_size_bytes";
8293
8294 /**
8295 * The duration for caching uninstalled ephemeral apps.
8296 * <p>
8297 * Type: long
8298 * @hide
8299 */
8300 public static final String UNINSTALLED_EPHEMERAL_APP_CACHE_DURATION_MILLIS =
8301 "uninstalled_ephemeral_app_cache_duration_millis";
8302
8303 /**
Fyodor Kupolov07140f72016-02-17 10:46:11 -08008304 * Allows switching users when system user is locked.
8305 * <p>
8306 * Type: int
8307 * @hide
8308 */
8309 public static final String ALLOW_USER_SWITCHING_WHEN_SYSTEM_USER_LOCKED =
8310 "allow_user_switching_when_system_user_locked";
8311
8312 /**
Daichi Hirono82ab9802016-03-02 13:23:29 +09008313 * Boot count since the device starts running APK level 24.
8314 * <p>
8315 * Type: int
8316 */
8317 public static final String BOOT_COUNT = "boot_count";
8318
8319 /**
Christopher Tate66488d62012-10-02 11:58:01 -07008320 * Settings to backup. This is here so that it's in the same place as the settings
8321 * keys and easy to update.
8322 *
8323 * These keys may be mentioned in the SETTINGS_TO_BACKUP arrays in System
8324 * and Secure as well. This is because those tables drive both backup and
8325 * restore, and restore needs to properly whitelist keys that used to live
8326 * in those namespaces. The keys will only actually be backed up / restored
8327 * if they are also mentioned in this table (Global.SETTINGS_TO_BACKUP).
8328 *
8329 * NOTE: Settings are backed up and restored in the order they appear
8330 * in this array. If you have one setting depending on another,
8331 * make sure that they are ordered appropriately.
8332 *
8333 * @hide
8334 */
8335 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate58f41ec2013-01-11 15:40:36 -08008336 BUGREPORT_IN_POWER_MENU,
Christopher Tate66488d62012-10-02 11:58:01 -07008337 STAY_ON_WHILE_PLUGGED_IN,
Christopher Tate66488d62012-10-02 11:58:01 -07008338 AUTO_TIME,
8339 AUTO_TIME_ZONE,
8340 POWER_SOUNDS_ENABLED,
8341 DOCK_SOUNDS_ENABLED,
Ritesh Reddyf8f12132015-11-20 16:43:28 +00008342 CHARGING_SOUNDS_ENABLED,
Christopher Tate66488d62012-10-02 11:58:01 -07008343 USB_MASS_STORAGE_ENABLED,
8344 ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED,
8345 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
8346 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY,
Christopher Tate16eb7cd2012-10-09 15:26:30 -07008347 WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED,
Christopher Tate66488d62012-10-02 11:58:01 -07008348 WIFI_NUM_OPEN_NETWORKS_KEPT,
8349 EMERGENCY_TONE,
8350 CALL_AUTO_RETRY,
Amith Yamasani94005242014-10-31 11:35:13 -07008351 DOCK_AUDIO_MEDIA_ENABLED,
Phil Burkdeaa8d92016-02-23 17:12:04 -08008352 ENCODED_SURROUND_OUTPUT,
Amith Yamasani94005242014-10-31 11:35:13 -07008353 LOW_POWER_MODE_TRIGGER_LEVEL
Christopher Tate66488d62012-10-02 11:58:01 -07008354 };
8355
Christopher Tate06efb532012-08-24 15:29:27 -07008356 // Populated lazily, guarded by class object:
Dianne Hackborn139748f2012-09-24 11:36:57 -07008357 private static NameValueCache sNameValueCache = new NameValueCache(
8358 SYS_PROP_SETTING_VERSION,
8359 CONTENT_URI,
8360 CALL_METHOD_GET_GLOBAL,
8361 CALL_METHOD_PUT_GLOBAL);
Christopher Tate06efb532012-08-24 15:29:27 -07008362
Christopher Tateaa036a22014-05-19 16:33:27 -07008363 // Certain settings have been moved from global to the per-user secure namespace
8364 private static final HashSet<String> MOVED_TO_SECURE;
8365 static {
8366 MOVED_TO_SECURE = new HashSet<String>(1);
8367 MOVED_TO_SECURE.add(Settings.Global.INSTALL_NON_MARKET_APPS);
8368 }
8369
Svetoslav683914b2015-01-15 14:22:26 -08008370 /** @hide */
8371 public static void getMovedToSecureSettings(Set<String> outKeySet) {
8372 outKeySet.addAll(MOVED_TO_SECURE);
8373 }
8374
Christopher Tate06efb532012-08-24 15:29:27 -07008375 /**
8376 * Look up a name in the database.
8377 * @param resolver to access the database with
8378 * @param name to look up in the table
8379 * @return the corresponding value, or null if not present
8380 */
Dianne Hackborn139748f2012-09-24 11:36:57 -07008381 public static String getString(ContentResolver resolver, String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07008382 return getStringForUser(resolver, name, UserHandle.myUserId());
8383 }
8384
8385 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -07008386 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -07008387 int userHandle) {
Christopher Tateaa036a22014-05-19 16:33:27 -07008388 if (MOVED_TO_SECURE.contains(name)) {
8389 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
8390 + " to android.provider.Settings.Secure, returning read-only value.");
8391 return Secure.getStringForUser(resolver, name, userHandle);
8392 }
Christopher Tate06efb532012-08-24 15:29:27 -07008393 return sNameValueCache.getStringForUser(resolver, name, userHandle);
8394 }
8395
8396 /**
8397 * Store a name/value pair into the database.
8398 * @param resolver to access the database with
8399 * @param name to store
8400 * @param value to associate with the name
8401 * @return true if the value was set, false on database errors
8402 */
8403 public static boolean putString(ContentResolver resolver,
8404 String name, String value) {
8405 return putStringForUser(resolver, name, value, UserHandle.myUserId());
8406 }
8407
8408 /** @hide */
8409 public static boolean putStringForUser(ContentResolver resolver,
8410 String name, String value, int userHandle) {
Christopher Tate06efb532012-08-24 15:29:27 -07008411 if (LOCAL_LOGV) {
8412 Log.v(TAG, "Global.putString(name=" + name + ", value=" + value
8413 + " for " + userHandle);
8414 }
Christopher Tateaa036a22014-05-19 16:33:27 -07008415 // Global and Secure have the same access policy so we can forward writes
8416 if (MOVED_TO_SECURE.contains(name)) {
8417 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
8418 + " to android.provider.Settings.Secure, value is unchanged.");
8419 return Secure.putStringForUser(resolver, name, value, userHandle);
8420 }
Christopher Tate06efb532012-08-24 15:29:27 -07008421 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
8422 }
8423
8424 /**
8425 * Construct the content URI for a particular name/value pair,
8426 * useful for monitoring changes with a ContentObserver.
8427 * @param name to look up in the table
8428 * @return the corresponding content URI, or null if not present
8429 */
8430 public static Uri getUriFor(String name) {
8431 return getUriFor(CONTENT_URI, name);
8432 }
8433
8434 /**
8435 * Convenience function for retrieving a single secure settings value
8436 * as an integer. Note that internally setting values are always
8437 * stored as strings; this function converts the string to an integer
8438 * for you. The default value will be returned if the setting is
8439 * not defined or not an integer.
8440 *
8441 * @param cr The ContentResolver to access.
8442 * @param name The name of the setting to retrieve.
8443 * @param def Value to return if the setting is not defined.
8444 *
8445 * @return The setting's current value, or 'def' if it is not defined
8446 * or not a valid integer.
8447 */
8448 public static int getInt(ContentResolver cr, String name, int def) {
8449 String v = getString(cr, name);
8450 try {
8451 return v != null ? Integer.parseInt(v) : def;
8452 } catch (NumberFormatException e) {
8453 return def;
8454 }
8455 }
8456
8457 /**
8458 * Convenience function for retrieving a single secure settings value
8459 * as an integer. Note that internally setting values are always
8460 * stored as strings; this function converts the string to an integer
8461 * for you.
8462 * <p>
8463 * This version does not take a default value. If the setting has not
8464 * been set, or the string value is not a number,
8465 * it throws {@link SettingNotFoundException}.
8466 *
8467 * @param cr The ContentResolver to access.
8468 * @param name The name of the setting to retrieve.
8469 *
8470 * @throws SettingNotFoundException Thrown if a setting by the given
8471 * name can't be found or the setting value is not an integer.
8472 *
8473 * @return The setting's current value.
8474 */
8475 public static int getInt(ContentResolver cr, String name)
8476 throws SettingNotFoundException {
8477 String v = getString(cr, name);
8478 try {
8479 return Integer.parseInt(v);
8480 } catch (NumberFormatException e) {
8481 throw new SettingNotFoundException(name);
8482 }
8483 }
8484
8485 /**
8486 * Convenience function for updating a single settings value as an
8487 * integer. This will either create a new entry in the table if the
8488 * given name does not exist, or modify the value of the existing row
8489 * with that name. Note that internally setting values are always
8490 * stored as strings, so this function converts the given value to a
8491 * string before storing it.
8492 *
8493 * @param cr The ContentResolver to access.
8494 * @param name The name of the setting to modify.
8495 * @param value The new value for the setting.
8496 * @return true if the value was set, false on database errors
8497 */
8498 public static boolean putInt(ContentResolver cr, String name, int value) {
8499 return putString(cr, name, Integer.toString(value));
8500 }
8501
8502 /**
8503 * Convenience function for retrieving a single secure settings value
8504 * as a {@code long}. Note that internally setting values are always
8505 * stored as strings; this function converts the string to a {@code long}
8506 * for you. The default value will be returned if the setting is
8507 * not defined or not a {@code long}.
8508 *
8509 * @param cr The ContentResolver to access.
8510 * @param name The name of the setting to retrieve.
8511 * @param def Value to return if the setting is not defined.
8512 *
8513 * @return The setting's current value, or 'def' if it is not defined
8514 * or not a valid {@code long}.
8515 */
8516 public static long getLong(ContentResolver cr, String name, long def) {
8517 String valString = getString(cr, name);
8518 long value;
8519 try {
8520 value = valString != null ? Long.parseLong(valString) : def;
8521 } catch (NumberFormatException e) {
8522 value = def;
8523 }
8524 return value;
8525 }
8526
8527 /**
8528 * Convenience function for retrieving a single secure settings value
8529 * as a {@code long}. Note that internally setting values are always
8530 * stored as strings; this function converts the string to a {@code long}
8531 * for you.
8532 * <p>
8533 * This version does not take a default value. If the setting has not
8534 * been set, or the string value is not a number,
8535 * it throws {@link SettingNotFoundException}.
8536 *
8537 * @param cr The ContentResolver to access.
8538 * @param name The name of the setting to retrieve.
8539 *
8540 * @return The setting's current value.
8541 * @throws SettingNotFoundException Thrown if a setting by the given
8542 * name can't be found or the setting value is not an integer.
8543 */
8544 public static long getLong(ContentResolver cr, String name)
8545 throws SettingNotFoundException {
8546 String valString = getString(cr, name);
8547 try {
8548 return Long.parseLong(valString);
8549 } catch (NumberFormatException e) {
8550 throw new SettingNotFoundException(name);
8551 }
8552 }
8553
8554 /**
8555 * Convenience function for updating a secure settings value as a long
8556 * integer. This will either create a new entry in the table if the
8557 * given name does not exist, or modify the value of the existing row
8558 * with that name. Note that internally setting values are always
8559 * stored as strings, so this function converts the given value to a
8560 * string before storing it.
8561 *
8562 * @param cr The ContentResolver to access.
8563 * @param name The name of the setting to modify.
8564 * @param value The new value for the setting.
8565 * @return true if the value was set, false on database errors
8566 */
8567 public static boolean putLong(ContentResolver cr, String name, long value) {
8568 return putString(cr, name, Long.toString(value));
8569 }
8570
8571 /**
8572 * Convenience function for retrieving a single secure settings value
8573 * as a floating point number. Note that internally setting values are
8574 * always stored as strings; this function converts the string to an
8575 * float for you. The default value will be returned if the setting
8576 * is not defined or not a valid float.
8577 *
8578 * @param cr The ContentResolver to access.
8579 * @param name The name of the setting to retrieve.
8580 * @param def Value to return if the setting is not defined.
8581 *
8582 * @return The setting's current value, or 'def' if it is not defined
8583 * or not a valid float.
8584 */
8585 public static float getFloat(ContentResolver cr, String name, float def) {
8586 String v = getString(cr, name);
8587 try {
8588 return v != null ? Float.parseFloat(v) : def;
8589 } catch (NumberFormatException e) {
8590 return def;
8591 }
8592 }
8593
8594 /**
8595 * Convenience function for retrieving a single secure settings value
8596 * as a float. Note that internally setting values are always
8597 * stored as strings; this function converts the string to a float
8598 * for you.
8599 * <p>
8600 * This version does not take a default value. If the setting has not
8601 * been set, or the string value is not a number,
8602 * it throws {@link SettingNotFoundException}.
8603 *
8604 * @param cr The ContentResolver to access.
8605 * @param name The name of the setting to retrieve.
8606 *
8607 * @throws SettingNotFoundException Thrown if a setting by the given
8608 * name can't be found or the setting value is not a float.
8609 *
8610 * @return The setting's current value.
8611 */
8612 public static float getFloat(ContentResolver cr, String name)
8613 throws SettingNotFoundException {
8614 String v = getString(cr, name);
8615 if (v == null) {
8616 throw new SettingNotFoundException(name);
8617 }
8618 try {
8619 return Float.parseFloat(v);
8620 } catch (NumberFormatException e) {
8621 throw new SettingNotFoundException(name);
8622 }
8623 }
8624
8625 /**
8626 * Convenience function for updating a single settings value as a
8627 * floating point number. This will either create a new entry in the
8628 * table if the given name does not exist, or modify the value of the
8629 * existing row with that name. Note that internally setting values
8630 * are always stored as strings, so this function converts the given
8631 * value to a string before storing it.
8632 *
8633 * @param cr The ContentResolver to access.
8634 * @param name The name of the setting to modify.
8635 * @param value The new value for the setting.
8636 * @return true if the value was set, false on database errors
8637 */
8638 public static boolean putFloat(ContentResolver cr, String name, float value) {
8639 return putString(cr, name, Float.toString(value));
8640 }
Wink Savillefb40dd42014-06-12 17:02:31 -07008641
8642
8643 /**
8644 * Subscription to be used for voice call on a multi sim device. The supported values
8645 * are 0 = SUB1, 1 = SUB2 and etc.
8646 * @hide
8647 */
8648 public static final String MULTI_SIM_VOICE_CALL_SUBSCRIPTION = "multi_sim_voice_call";
8649
8650 /**
8651 * Used to provide option to user to select subscription during dial.
8652 * The supported values are 0 = disable or 1 = enable prompt.
8653 * @hide
8654 */
8655 public static final String MULTI_SIM_VOICE_PROMPT = "multi_sim_voice_prompt";
8656
8657 /**
8658 * Subscription to be used for data call on a multi sim device. The supported values
8659 * are 0 = SUB1, 1 = SUB2 and etc.
8660 * @hide
8661 */
8662 public static final String MULTI_SIM_DATA_CALL_SUBSCRIPTION = "multi_sim_data_call";
8663
8664 /**
8665 * Subscription to be used for SMS on a multi sim device. The supported values
8666 * are 0 = SUB1, 1 = SUB2 and etc.
8667 * @hide
8668 */
8669 public static final String MULTI_SIM_SMS_SUBSCRIPTION = "multi_sim_sms";
8670
8671 /**
8672 * Used to provide option to user to select subscription during send SMS.
8673 * The value 1 - enable, 0 - disable
8674 * @hide
8675 */
8676 public static final String MULTI_SIM_SMS_PROMPT = "multi_sim_sms_prompt";
8677
8678
8679
8680 /** User preferred subscriptions setting.
8681 * This holds the details of the user selected subscription from the card and
8682 * the activation status. Each settings string have the coma separated values
8683 * iccId,appType,appId,activationStatus,3gppIndex,3gpp2Index
8684 * @hide
8685 */
8686 public static final String[] MULTI_SIM_USER_PREFERRED_SUBS = {"user_preferred_sub1",
8687 "user_preferred_sub2","user_preferred_sub3"};
Zheng Fub218ff42015-04-13 16:31:16 -07008688
8689 /**
8690 * Whether to enable new contacts aggregator or not.
8691 * The value 1 - enable, 0 - disable
8692 * @hide
8693 */
8694 public static final String NEW_CONTACT_AGGREGATOR = "new_contact_aggregator";
Zheng Fu31ce78c2015-04-15 16:57:53 -07008695
8696 /**
8697 * Whether to enable contacts metadata syncing or not
8698 * The value 1 - enable, 0 - disable
Zheng Fu31ce78c2015-04-15 16:57:53 -07008699 */
8700 public static final String CONTACT_METADATA_SYNC = "contact_metadata_sync";
Wei Liua1817702015-08-11 21:21:12 -07008701
8702 /**
8703 * Whether to enable cellular on boot.
8704 * The value 1 - enable, 0 - disable
8705 * @hide
8706 */
8707 public static final String ENABLE_CELLULAR_ON_BOOT = "enable_cellular_on_boot";
Christopher Tate06efb532012-08-24 15:29:27 -07008708 }
8709
8710 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008711 * User-defined bookmarks and shortcuts. The target of each bookmark is an
8712 * Intent URL, allowing it to be either a web page or a particular
8713 * application activity.
8714 *
8715 * @hide
8716 */
8717 public static final class Bookmarks implements BaseColumns
8718 {
8719 private static final String TAG = "Bookmarks";
8720
8721 /**
8722 * The content:// style URL for this table
8723 */
8724 public static final Uri CONTENT_URI =
8725 Uri.parse("content://" + AUTHORITY + "/bookmarks");
8726
8727 /**
8728 * The row ID.
8729 * <p>Type: INTEGER</p>
8730 */
8731 public static final String ID = "_id";
8732
8733 /**
8734 * Descriptive name of the bookmark that can be displayed to the user.
8735 * If this is empty, the title should be resolved at display time (use
8736 * {@link #getTitle(Context, Cursor)} any time you want to display the
8737 * title of a bookmark.)
8738 * <P>
8739 * Type: TEXT
8740 * </P>
8741 */
8742 public static final String TITLE = "title";
8743
8744 /**
8745 * Arbitrary string (displayed to the user) that allows bookmarks to be
8746 * organized into categories. There are some special names for
8747 * standard folders, which all start with '@'. The label displayed for
8748 * the folder changes with the locale (via {@link #getLabelForFolder}) but
8749 * the folder name does not change so you can consistently query for
8750 * the folder regardless of the current locale.
8751 *
8752 * <P>Type: TEXT</P>
8753 *
8754 */
8755 public static final String FOLDER = "folder";
8756
8757 /**
8758 * The Intent URL of the bookmark, describing what it points to. This
8759 * value is given to {@link android.content.Intent#getIntent} to create
8760 * an Intent that can be launched.
8761 * <P>Type: TEXT</P>
8762 */
8763 public static final String INTENT = "intent";
8764
8765 /**
8766 * Optional shortcut character associated with this bookmark.
8767 * <P>Type: INTEGER</P>
8768 */
8769 public static final String SHORTCUT = "shortcut";
8770
8771 /**
8772 * The order in which the bookmark should be displayed
8773 * <P>Type: INTEGER</P>
8774 */
8775 public static final String ORDERING = "ordering";
8776
8777 private static final String[] sIntentProjection = { INTENT };
8778 private static final String[] sShortcutProjection = { ID, SHORTCUT };
8779 private static final String sShortcutSelection = SHORTCUT + "=?";
8780
8781 /**
8782 * Convenience function to retrieve the bookmarked Intent for a
8783 * particular shortcut key.
8784 *
8785 * @param cr The ContentResolver to query.
8786 * @param shortcut The shortcut key.
8787 *
8788 * @return Intent The bookmarked URL, or null if there is no bookmark
8789 * matching the given shortcut.
8790 */
8791 public static Intent getIntentForShortcut(ContentResolver cr, char shortcut)
8792 {
8793 Intent intent = null;
8794
8795 Cursor c = cr.query(CONTENT_URI,
8796 sIntentProjection, sShortcutSelection,
8797 new String[] { String.valueOf((int) shortcut) }, ORDERING);
8798 // Keep trying until we find a valid shortcut
8799 try {
8800 while (intent == null && c.moveToNext()) {
8801 try {
8802 String intentURI = c.getString(c.getColumnIndexOrThrow(INTENT));
Christian Mehlmauera34d2c92010-05-25 19:04:20 +02008803 intent = Intent.parseUri(intentURI, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008804 } catch (java.net.URISyntaxException e) {
8805 // The stored URL is bad... ignore it.
8806 } catch (IllegalArgumentException e) {
8807 // Column not found
Dianne Hackborna33e3f72009-09-29 17:28:24 -07008808 Log.w(TAG, "Intent column not found", e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008809 }
8810 }
8811 } finally {
8812 if (c != null) c.close();
8813 }
8814
8815 return intent;
8816 }
8817
8818 /**
8819 * Add a new bookmark to the system.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07008820 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008821 * @param cr The ContentResolver to query.
8822 * @param intent The desired target of the bookmark.
8823 * @param title Bookmark title that is shown to the user; null if none
8824 * or it should be resolved to the intent's title.
8825 * @param folder Folder in which to place the bookmark; null if none.
8826 * @param shortcut Shortcut that will invoke the bookmark; 0 if none. If
8827 * this is non-zero and there is an existing bookmark entry
8828 * with this same shortcut, then that existing shortcut is
8829 * cleared (the bookmark is not removed).
8830 * @return The unique content URL for the new bookmark entry.
8831 */
8832 public static Uri add(ContentResolver cr,
8833 Intent intent,
8834 String title,
8835 String folder,
8836 char shortcut,
8837 int ordering)
8838 {
8839 // If a shortcut is supplied, and it is already defined for
8840 // another bookmark, then remove the old definition.
8841 if (shortcut != 0) {
Jeff Hamilton7cd51ef2010-05-12 17:30:27 -05008842 cr.delete(CONTENT_URI, sShortcutSelection,
8843 new String[] { String.valueOf((int) shortcut) });
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008844 }
8845
8846 ContentValues values = new ContentValues();
8847 if (title != null) values.put(TITLE, title);
8848 if (folder != null) values.put(FOLDER, folder);
Jean-Baptiste Queru3b9f0a32010-06-21 13:46:59 -07008849 values.put(INTENT, intent.toUri(0));
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008850 if (shortcut != 0) values.put(SHORTCUT, (int) shortcut);
8851 values.put(ORDERING, ordering);
8852 return cr.insert(CONTENT_URI, values);
8853 }
8854
8855 /**
8856 * Return the folder name as it should be displayed to the user. This
8857 * takes care of localizing special folders.
8858 *
8859 * @param r Resources object for current locale; only need access to
8860 * system resources.
8861 * @param folder The value found in the {@link #FOLDER} column.
8862 *
8863 * @return CharSequence The label for this folder that should be shown
8864 * to the user.
8865 */
8866 public static CharSequence getLabelForFolder(Resources r, String folder) {
8867 return folder;
8868 }
8869
8870 /**
8871 * Return the title as it should be displayed to the user. This takes
8872 * care of localizing bookmarks that point to activities.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07008873 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008874 * @param context A context.
8875 * @param cursor A cursor pointing to the row whose title should be
8876 * returned. The cursor must contain at least the {@link #TITLE}
8877 * and {@link #INTENT} columns.
8878 * @return A title that is localized and can be displayed to the user,
8879 * or the empty string if one could not be found.
8880 */
8881 public static CharSequence getTitle(Context context, Cursor cursor) {
8882 int titleColumn = cursor.getColumnIndex(TITLE);
8883 int intentColumn = cursor.getColumnIndex(INTENT);
8884 if (titleColumn == -1 || intentColumn == -1) {
8885 throw new IllegalArgumentException(
8886 "The cursor must contain the TITLE and INTENT columns.");
8887 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07008888
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008889 String title = cursor.getString(titleColumn);
8890 if (!TextUtils.isEmpty(title)) {
8891 return title;
8892 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07008893
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008894 String intentUri = cursor.getString(intentColumn);
8895 if (TextUtils.isEmpty(intentUri)) {
8896 return "";
8897 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07008898
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008899 Intent intent;
8900 try {
Christian Mehlmauera34d2c92010-05-25 19:04:20 +02008901 intent = Intent.parseUri(intentUri, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008902 } catch (URISyntaxException e) {
8903 return "";
8904 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07008905
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008906 PackageManager packageManager = context.getPackageManager();
8907 ResolveInfo info = packageManager.resolveActivity(intent, 0);
8908 return info != null ? info.loadLabel(packageManager) : "";
8909 }
8910 }
8911
8912 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008913 * Returns the device ID that we should use when connecting to the mobile gtalk server.
8914 * This is a string like "android-0x1242", where the hex string is the Android ID obtained
8915 * from the GoogleLoginService.
8916 *
8917 * @param androidId The Android ID for this device.
8918 * @return The device ID that should be used when connecting to the mobile gtalk server.
8919 * @hide
8920 */
8921 public static String getGTalkDeviceId(long androidId) {
8922 return "android-" + Long.toHexString(androidId);
8923 }
Billy Lau6ad2d662015-07-18 00:26:58 +01008924
Billy Laua7238a32015-08-01 12:45:02 +01008925 private static final String[] PM_WRITE_SETTINGS = {
8926 android.Manifest.permission.WRITE_SETTINGS
8927 };
8928 private static final String[] PM_CHANGE_NETWORK_STATE = {
8929 android.Manifest.permission.CHANGE_NETWORK_STATE,
8930 android.Manifest.permission.WRITE_SETTINGS
8931 };
8932 private static final String[] PM_SYSTEM_ALERT_WINDOW = {
8933 android.Manifest.permission.SYSTEM_ALERT_WINDOW
8934 };
8935
Billy Lau6ad2d662015-07-18 00:26:58 +01008936 /**
8937 * Performs a strict and comprehensive check of whether a calling package is allowed to
8938 * write/modify system settings, as the condition differs for pre-M, M+, and
8939 * privileged/preinstalled apps. If the provided uid does not match the
8940 * callingPackage, a negative result will be returned.
8941 * @hide
8942 */
8943 public static boolean isCallingPackageAllowedToWriteSettings(Context context, int uid,
8944 String callingPackage, boolean throwException) {
8945 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
8946 callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS,
Billy Laua7238a32015-08-01 12:45:02 +01008947 PM_WRITE_SETTINGS, false);
Billy Lau6ad2d662015-07-18 00:26:58 +01008948 }
8949
8950 /**
8951 * Performs a strict and comprehensive check of whether a calling package is allowed to
8952 * write/modify system settings, as the condition differs for pre-M, M+, and
8953 * privileged/preinstalled apps. If the provided uid does not match the
Billy Laua7238a32015-08-01 12:45:02 +01008954 * callingPackage, a negative result will be returned. The caller is expected to have
Lorenzo Colittid5427052015-10-15 16:29:00 +09008955 * the WRITE_SETTINGS permission declared.
Billy Lau6ad2d662015-07-18 00:26:58 +01008956 *
8957 * Note: if the check is successful, the operation of this app will be updated to the
8958 * current time.
8959 * @hide
8960 */
8961 public static boolean checkAndNoteWriteSettingsOperation(Context context, int uid,
8962 String callingPackage, boolean throwException) {
8963 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
8964 callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS,
Billy Laua7238a32015-08-01 12:45:02 +01008965 PM_WRITE_SETTINGS, true);
8966 }
8967
8968 /**
8969 * Performs a strict and comprehensive check of whether a calling package is allowed to
8970 * change the state of network, as the condition differs for pre-M, M+, and
Lorenzo Colittid5427052015-10-15 16:29:00 +09008971 * privileged/preinstalled apps. The caller is expected to have either the
8972 * CHANGE_NETWORK_STATE or the WRITE_SETTINGS permission declared. Either of these
8973 * permissions allow changing network state; WRITE_SETTINGS is a runtime permission and
8974 * can be revoked, but (except in M, excluding M MRs), CHANGE_NETWORK_STATE is a normal
8975 * permission and cannot be revoked. See http://b/23597341
Billy Laua7238a32015-08-01 12:45:02 +01008976 *
Lorenzo Colittid5427052015-10-15 16:29:00 +09008977 * Note: if the check succeeds because the application holds WRITE_SETTINGS, the operation
8978 * of this app will be updated to the current time.
Billy Laua7238a32015-08-01 12:45:02 +01008979 * @hide
8980 */
8981 public static boolean checkAndNoteChangeNetworkStateOperation(Context context, int uid,
8982 String callingPackage, boolean throwException) {
Lorenzo Colittid5427052015-10-15 16:29:00 +09008983 if (context.checkCallingOrSelfPermission(android.Manifest.permission.CHANGE_NETWORK_STATE)
8984 == PackageManager.PERMISSION_GRANTED) {
8985 return true;
8986 }
Billy Laua7238a32015-08-01 12:45:02 +01008987 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
8988 callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS,
8989 PM_CHANGE_NETWORK_STATE, true);
Billy Lau6ad2d662015-07-18 00:26:58 +01008990 }
8991
8992 /**
8993 * Performs a strict and comprehensive check of whether a calling package is allowed to
8994 * draw on top of other apps, as the conditions differs for pre-M, M+, and
8995 * privileged/preinstalled apps. If the provided uid does not match the callingPackage,
8996 * a negative result will be returned.
8997 * @hide
8998 */
8999 public static boolean isCallingPackageAllowedToDrawOverlays(Context context, int uid,
9000 String callingPackage, boolean throwException) {
9001 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
9002 callingPackage, throwException, AppOpsManager.OP_SYSTEM_ALERT_WINDOW,
Billy Laua7238a32015-08-01 12:45:02 +01009003 PM_SYSTEM_ALERT_WINDOW, false);
Billy Lau6ad2d662015-07-18 00:26:58 +01009004 }
9005
9006 /**
9007 * Performs a strict and comprehensive check of whether a calling package is allowed to
9008 * draw on top of other apps, as the conditions differs for pre-M, M+, and
9009 * privileged/preinstalled apps. If the provided uid does not match the callingPackage,
9010 * a negative result will be returned.
9011 *
9012 * Note: if the check is successful, the operation of this app will be updated to the
9013 * current time.
9014 * @hide
9015 */
9016 public static boolean checkAndNoteDrawOverlaysOperation(Context context, int uid, String
9017 callingPackage, boolean throwException) {
9018 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
9019 callingPackage, throwException, AppOpsManager.OP_SYSTEM_ALERT_WINDOW,
Billy Laua7238a32015-08-01 12:45:02 +01009020 PM_SYSTEM_ALERT_WINDOW, true);
Billy Lau6ad2d662015-07-18 00:26:58 +01009021 }
9022
9023 /**
9024 * Helper method to perform a general and comprehensive check of whether an operation that is
9025 * protected by appops can be performed by a caller or not. e.g. OP_SYSTEM_ALERT_WINDOW and
9026 * OP_WRITE_SETTINGS
9027 * @hide
9028 */
9029 public static boolean isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context context,
Billy Laua7238a32015-08-01 12:45:02 +01009030 int uid, String callingPackage, boolean throwException, int appOpsOpCode, String[]
9031 permissions, boolean makeNote) {
Billy Lau6ad2d662015-07-18 00:26:58 +01009032 if (callingPackage == null) {
9033 return false;
9034 }
9035
9036 AppOpsManager appOpsMgr = (AppOpsManager)context.getSystemService(Context.APP_OPS_SERVICE);
9037 int mode = AppOpsManager.MODE_DEFAULT;
9038 if (makeNote) {
9039 mode = appOpsMgr.noteOpNoThrow(appOpsOpCode, uid, callingPackage);
9040 } else {
9041 mode = appOpsMgr.checkOpNoThrow(appOpsOpCode, uid, callingPackage);
9042 }
9043
9044 switch (mode) {
9045 case AppOpsManager.MODE_ALLOWED:
9046 return true;
Billy Laua7238a32015-08-01 12:45:02 +01009047
Billy Lau6ad2d662015-07-18 00:26:58 +01009048 case AppOpsManager.MODE_DEFAULT:
9049 // this is the default operating mode after an app's installation
Billy Laua7238a32015-08-01 12:45:02 +01009050 // In this case we will check all associated static permission to see
9051 // if it is granted during install time.
9052 for (String permission : permissions) {
9053 if (context.checkCallingOrSelfPermission(permission) == PackageManager
9054 .PERMISSION_GRANTED) {
9055 // if either of the permissions are granted, we will allow it
9056 return true;
9057 }
Billy Lau6ad2d662015-07-18 00:26:58 +01009058 }
Billy Laua7238a32015-08-01 12:45:02 +01009059
Billy Lau6ad2d662015-07-18 00:26:58 +01009060 default:
9061 // this is for all other cases trickled down here...
9062 if (!throwException) {
9063 return false;
9064 }
9065 }
Billy Laua7238a32015-08-01 12:45:02 +01009066
9067 // prepare string to throw SecurityException
9068 StringBuilder exceptionMessage = new StringBuilder();
9069 exceptionMessage.append(callingPackage);
9070 exceptionMessage.append(" was not granted ");
9071 if (permissions.length > 1) {
9072 exceptionMessage.append(" either of these permissions: ");
9073 } else {
9074 exceptionMessage.append(" this permission: ");
9075 }
9076 for (int i = 0; i < permissions.length; i++) {
9077 exceptionMessage.append(permissions[i]);
9078 exceptionMessage.append((i == permissions.length - 1) ? "." : ", ");
9079 }
9080
9081 throw new SecurityException(exceptionMessage.toString());
Billy Lau6ad2d662015-07-18 00:26:58 +01009082 }
9083
9084 /**
9085 * Retrieves a correponding package name for a given uid. It will query all
9086 * packages that are associated with the given uid, but it will return only
9087 * the zeroth result.
9088 * Note: If package could not be found, a null is returned.
9089 * @hide
9090 */
9091 public static String getPackageNameForUid(Context context, int uid) {
9092 String[] packages = context.getPackageManager().getPackagesForUid(uid);
9093 if (packages == null) {
9094 return null;
9095 }
9096 return packages[0];
9097 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08009098}