blob: 05157cbd885577cc33e5a519f339b25420569a57 [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
Svet Ganov53a441c2016-04-19 19:38:00 -070019import android.annotation.NonNull;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080020import android.annotation.SdkConstant;
21import android.annotation.SdkConstant.SdkConstantType;
Bryce Leecdfebd62015-02-02 08:19:11 -080022import android.annotation.SystemApi;
Jeff Sharkeya73b8fd2016-01-06 17:02:08 -070023import android.annotation.TestApi;
Adrian Roos7811d9f2015-07-27 15:10:13 -070024import android.app.ActivityThread;
Billy Lau6ad2d662015-07-18 00:26:58 +010025import android.app.AppOpsManager;
Adrian Roos7811d9f2015-07-27 15:10:13 -070026import android.app.Application;
Narayan Kamathee69ff42011-06-28 12:07:18 +010027import android.app.SearchManager;
Jeff Sharkey6e2bee72012-10-01 13:39:08 -070028import android.app.WallpaperManager;
Mike LeBeau5d34e9b2010-02-10 19:34:56 -080029import android.content.ComponentName;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080030import android.content.ContentResolver;
31import android.content.ContentValues;
32import android.content.Context;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -080033import android.content.IContentProvider;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080034import android.content.Intent;
Dianne Hackbornb8b11a02010-03-10 15:53:11 -080035import android.content.pm.ActivityInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080036import android.content.pm.PackageManager;
37import android.content.pm.ResolveInfo;
38import android.content.res.Configuration;
39import android.content.res.Resources;
40import android.database.Cursor;
41import android.database.SQLException;
David Christie3f7b6522013-08-06 19:19:08 -070042import android.location.LocationManager;
Jeff Sharkey625239a2012-09-26 22:03:49 -070043import android.net.ConnectivityManager;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080044import android.net.Uri;
Irfan Sheriff36f74132010-11-04 16:57:37 -070045import android.net.wifi.WifiManager;
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -070046import android.os.BatteryManager;
47import 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;
Yohei Yukawa23cbe852016-05-17 16:42:58 -070050import android.os.LocaleList;
Amith Yamasani7ab8c4a2012-04-06 09:27:12 -070051import android.os.Process;
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -070052import android.os.RemoteException;
Amith Yamasani52c489c2012-03-28 11:42:42 -070053import android.os.ServiceManager;
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;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080061import android.util.Log;
Svet Ganov53a441c2016-04-19 19:38:00 -070062import android.util.MemoryIntArray;
Felipe Lemea1b79bf2016-05-24 13:06:54 -070063
Svet Ganov53a441c2016-04-19 19:38:00 -070064import com.android.internal.annotations.GuardedBy;
Svetoslav683914b2015-01-15 14:22:26 -080065import com.android.internal.util.ArrayUtils;
Amith Yamasani52c489c2012-03-28 11:42:42 -070066import com.android.internal.widget.ILockSettings;
67
Svet Ganov53a441c2016-04-19 19:38:00 -070068import java.io.IOException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080069import java.net.URISyntaxException;
Svetoslav683914b2015-01-15 14:22:26 -080070import java.text.SimpleDateFormat;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080071import java.util.HashMap;
72import java.util.HashSet;
Elliott Hughescb64d432013-08-02 10:00:44 -070073import java.util.Locale;
Svetoslav683914b2015-01-15 14:22:26 -080074import java.util.Map;
75import java.util.Set;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080076
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080077/**
78 * The Settings provider contains global system-level device preferences.
79 */
80public final class Settings {
81
82 // Intent actions for Settings
83
84 /**
85 * Activity Action: Show system settings.
86 * <p>
87 * Input: Nothing.
88 * <p>
Gilles Debunnee90bed12011-08-30 14:28:27 -070089 * Output: Nothing.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080090 */
91 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
92 public static final String ACTION_SETTINGS = "android.settings.SETTINGS";
93
94 /**
95 * Activity Action: Show settings to allow configuration of APNs.
96 * <p>
97 * Input: Nothing.
98 * <p>
Gilles Debunnee90bed12011-08-30 14:28:27 -070099 * Output: Nothing.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800100 */
101 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
102 public static final String ACTION_APN_SETTINGS = "android.settings.APN_SETTINGS";
103
104 /**
105 * Activity Action: Show settings to allow configuration of current location
106 * sources.
107 * <p>
108 * In some cases, a matching Activity may not exist, so ensure you
109 * safeguard against this.
110 * <p>
111 * Input: Nothing.
112 * <p>
113 * Output: Nothing.
114 */
115 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
116 public static final String ACTION_LOCATION_SOURCE_SETTINGS =
117 "android.settings.LOCATION_SOURCE_SETTINGS";
118
119 /**
Jason Monk76c67aa2016-02-19 14:49:42 -0500120 * Activity Action: Show settings to allow configuration of users.
121 * <p>
122 * In some cases, a matching Activity may not exist, so ensure you
123 * safeguard against this.
124 * <p>
125 * Input: Nothing.
126 * <p>
127 * Output: Nothing.
128 * @hide
129 */
130 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
131 public static final String ACTION_USER_SETTINGS =
132 "android.settings.USER_SETTINGS";
133
134 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800135 * Activity Action: Show settings to allow configuration of wireless controls
136 * such as Wi-Fi, Bluetooth and Mobile networks.
137 * <p>
138 * In some cases, a matching Activity may not exist, so ensure you
139 * safeguard against this.
140 * <p>
141 * Input: Nothing.
142 * <p>
143 * Output: Nothing.
144 */
145 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
146 public static final String ACTION_WIRELESS_SETTINGS =
147 "android.settings.WIRELESS_SETTINGS";
148
149 /**
Jeremy Klein15f3d212016-01-24 17:01:09 -0800150 * Activity Action: Show tether provisioning activity.
151 *
152 * <p>
153 * In some cases, a matching Activity may not exist, so ensure you
154 * safeguard against this.
155 * <p>
156 * Input: {@link ConnectivityManager.EXTRA_TETHER_TYPE} should be included to specify which type
157 * of tethering should be checked. {@link ConnectivityManager.EXTRA_PROVISION_CALLBACK} should
158 * contain a {@link ResultReceiver} which will be called back with a tether result code.
159 * <p>
160 * Output: The result of the provisioning check.
161 * {@link ConnectivityManager.TETHER_ERROR_NO_ERROR} if successful,
162 * {@link ConnectivityManager.TETHER_ERROR_PROVISION_FAILED} for failure.
163 *
164 * @hide
165 */
166 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
167 public static final String ACTION_TETHER_PROVISIONING =
168 "android.settings.TETHER_PROVISIONING_UI";
169
170 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800171 * Activity Action: Show settings to allow entering/exiting airplane mode.
172 * <p>
173 * In some cases, a matching Activity may not exist, so ensure you
174 * safeguard against this.
175 * <p>
176 * Input: Nothing.
177 * <p>
178 * Output: Nothing.
179 */
180 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
181 public static final String ACTION_AIRPLANE_MODE_SETTINGS =
182 "android.settings.AIRPLANE_MODE_SETTINGS";
183
184 /**
Barnaby Jamesb3006d32015-04-02 17:49:54 -0700185 * Activity Action: Modify Airplane mode settings using a voice command.
Barnaby James48f35522014-07-16 14:27:39 -0700186 * <p>
187 * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
188 * <p>
189 * This intent MUST be started using
190 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
191 * startVoiceActivity}.
192 * <p>
Barnaby Jamesb3006d32015-04-02 17:49:54 -0700193 * Note: The activity implementing this intent MUST verify that
Barnaby James48f35522014-07-16 14:27:39 -0700194 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before
195 * modifying the setting.
196 * <p>
Barnaby Jamesb3006d32015-04-02 17:49:54 -0700197 * Input: To tell which state airplane mode should be set to, add the
198 * {@link #EXTRA_AIRPLANE_MODE_ENABLED} extra to this Intent with the state specified.
199 * If the extra is not included, no changes will be made.
Barnaby James48f35522014-07-16 14:27:39 -0700200 * <p>
201 * Output: Nothing.
202 */
203 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
204 public static final String ACTION_VOICE_CONTROL_AIRPLANE_MODE =
205 "android.settings.VOICE_CONTROL_AIRPLANE_MODE";
206
207 /**
Dianne Hackborndd9b82c2009-09-03 00:18:47 -0700208 * Activity Action: Show settings for accessibility modules.
209 * <p>
210 * In some cases, a matching Activity may not exist, so ensure you
211 * safeguard against this.
212 * <p>
213 * Input: Nothing.
214 * <p>
215 * Output: Nothing.
216 */
217 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
218 public static final String ACTION_ACCESSIBILITY_SETTINGS =
219 "android.settings.ACCESSIBILITY_SETTINGS";
220
221 /**
Dianne Hackborna3fb40d2014-08-12 15:06:50 -0700222 * Activity Action: Show settings to control access to usage information.
223 * <p>
224 * In some cases, a matching Activity may not exist, so ensure you
225 * safeguard against this.
226 * <p>
227 * Input: Nothing.
228 * <p>
229 * Output: Nothing.
230 */
231 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
232 public static final String ACTION_USAGE_ACCESS_SETTINGS =
233 "android.settings.USAGE_ACCESS_SETTINGS";
234
235 /**
Jason Monk6f909782015-04-17 14:30:25 -0400236 * Activity Category: Show application settings related to usage access.
237 * <p>
238 * An activity that provides a user interface for adjusting usage access related
239 * preferences for its containing application. Optional but recommended for apps that
240 * use {@link android.Manifest.permission#PACKAGE_USAGE_STATS}.
241 * <p>
242 * The activity may define meta-data to describe what usage access is
243 * used for within their app with {@link #METADATA_USAGE_ACCESS_REASON}, which
244 * will be displayed in Settings.
245 * <p>
246 * Input: Nothing.
247 * <p>
248 * Output: Nothing.
249 */
250 @SdkConstant(SdkConstantType.INTENT_CATEGORY)
251 public static final String INTENT_CATEGORY_USAGE_ACCESS_CONFIG =
252 "android.intent.category.USAGE_ACCESS_CONFIG";
253
254 /**
255 * Metadata key: Reason for needing usage access.
256 * <p>
257 * A key for metadata attached to an activity that receives action
258 * {@link #INTENT_CATEGORY_USAGE_ACCESS_CONFIG}, shown to the
259 * user as description of how the app uses usage access.
260 * <p>
261 */
262 public static final String METADATA_USAGE_ACCESS_REASON =
263 "android.settings.metadata.USAGE_ACCESS_REASON";
264
265 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800266 * Activity Action: Show settings to allow configuration of security and
267 * location privacy.
268 * <p>
269 * In some cases, a matching Activity may not exist, so ensure you
270 * safeguard against this.
271 * <p>
272 * Input: Nothing.
273 * <p>
274 * Output: Nothing.
275 */
276 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
277 public static final String ACTION_SECURITY_SETTINGS =
278 "android.settings.SECURITY_SETTINGS";
279
280 /**
Maggie Benthall0469f412013-09-05 15:30:26 -0400281 * Activity Action: Show trusted credentials settings, opening to the user tab,
282 * to allow management of installed credentials.
283 * <p>
284 * In some cases, a matching Activity may not exist, so ensure you
285 * safeguard against this.
286 * <p>
287 * Input: Nothing.
288 * <p>
289 * Output: Nothing.
290 * @hide
291 */
292 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
293 public static final String ACTION_TRUSTED_CREDENTIALS_USER =
294 "com.android.settings.TRUSTED_CREDENTIALS_USER";
295
296 /**
297 * Activity Action: Show dialog explaining that an installed CA cert may enable
298 * monitoring of encrypted network traffic.
299 * <p>
300 * In some cases, a matching Activity may not exist, so ensure you
Victor Chang355d4762016-04-07 21:23:15 +0100301 * safeguard against this. Add {@link #EXTRA_NUMBER_OF_CERTIFICATES} extra to indicate the
302 * number of certificates.
Maggie Benthall0469f412013-09-05 15:30:26 -0400303 * <p>
304 * Input: Nothing.
305 * <p>
306 * Output: Nothing.
307 * @hide
308 */
309 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
310 public static final String ACTION_MONITORING_CERT_INFO =
311 "com.android.settings.MONITORING_CERT_INFO";
312
313 /**
Amith Yamasanic15255a2009-09-23 15:33:19 -0700314 * Activity Action: Show settings to allow configuration of privacy options.
315 * <p>
316 * In some cases, a matching Activity may not exist, so ensure you
317 * safeguard against this.
318 * <p>
319 * Input: Nothing.
320 * <p>
321 * Output: Nothing.
322 */
323 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
324 public static final String ACTION_PRIVACY_SETTINGS =
325 "android.settings.PRIVACY_SETTINGS";
326
327 /**
Robin Leea249aee2016-02-03 13:42:56 +0000328 * Activity Action: Show settings to allow configuration of VPN.
329 * <p>
330 * In some cases, a matching Activity may not exist, so ensure you
331 * safeguard against this.
332 * <p>
333 * Input: Nothing.
334 * <p>
335 * Output: Nothing.
336 */
337 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
338 public static final String ACTION_VPN_SETTINGS =
339 "android.settings.VPN_SETTINGS";
340
341 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800342 * Activity Action: Show settings to allow configuration of Wi-Fi.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800343 * <p>
344 * In some cases, a matching Activity may not exist, so ensure you
345 * safeguard against this.
346 * <p>
347 * Input: Nothing.
348 * <p>
349 * Output: Nothing.
350
351 */
352 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
353 public static final String ACTION_WIFI_SETTINGS =
354 "android.settings.WIFI_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700355
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800356 /**
357 * Activity Action: Show settings to allow configuration of a static IP
358 * address for Wi-Fi.
359 * <p>
360 * In some cases, a matching Activity may not exist, so ensure you safeguard
361 * against this.
362 * <p>
363 * Input: Nothing.
364 * <p>
365 * Output: Nothing.
366 */
367 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
368 public static final String ACTION_WIFI_IP_SETTINGS =
369 "android.settings.WIFI_IP_SETTINGS";
370
371 /**
Stephen Chen767e4532016-11-14 15:59:33 -0800372 * Activity Action: Show settings to allow configuration of Wi-Fi saved networks.
373 * <p>
374 * In some cases, a matching Activity may not exist, so ensure you
375 * safeguard against this.
376 * <p>
377 * Input: Nothing.
378 * <p>
379 * Output: Nothing.
380 * @hide
381 */
382 @SystemApi
383 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
384 public static final String ACTION_WIFI_SAVED_NETWORK_SETTINGS =
385 "android.settings.WIFI_SAVED_NETWORK_SETTINGS";
386
387 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800388 * Activity Action: Show settings to allow configuration of Bluetooth.
389 * <p>
390 * In some cases, a matching Activity may not exist, so ensure you
391 * safeguard against this.
392 * <p>
393 * Input: Nothing.
394 * <p>
395 * Output: Nothing.
396 */
397 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
398 public static final String ACTION_BLUETOOTH_SETTINGS =
399 "android.settings.BLUETOOTH_SETTINGS";
400
401 /**
Jeff Brownc05c1ae2015-05-05 13:46:30 -0700402 * Activity Action: Show settings to allow configuration of cast endpoints.
Jeff Brown1a937b02014-07-01 22:13:04 -0700403 * <p>
404 * In some cases, a matching Activity may not exist, so ensure you
405 * safeguard against this.
406 * <p>
407 * Input: Nothing.
408 * <p>
409 * Output: Nothing.
410 */
411 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
412 public static final String ACTION_CAST_SETTINGS =
413 "android.settings.CAST_SETTINGS";
414
415 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800416 * Activity Action: Show settings to allow configuration of date and time.
417 * <p>
418 * In some cases, a matching Activity may not exist, so ensure you
419 * safeguard against this.
420 * <p>
421 * Input: Nothing.
422 * <p>
423 * Output: Nothing.
424 */
425 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
426 public static final String ACTION_DATE_SETTINGS =
427 "android.settings.DATE_SETTINGS";
428
429 /**
430 * Activity Action: Show settings to allow configuration of sound and volume.
431 * <p>
432 * In some cases, a matching Activity may not exist, so ensure you
433 * safeguard against this.
434 * <p>
435 * Input: Nothing.
436 * <p>
437 * Output: Nothing.
438 */
439 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
440 public static final String ACTION_SOUND_SETTINGS =
441 "android.settings.SOUND_SETTINGS";
442
443 /**
444 * Activity Action: Show settings to allow configuration of display.
445 * <p>
446 * In some cases, a matching Activity may not exist, so ensure you
447 * safeguard against this.
448 * <p>
449 * Input: Nothing.
450 * <p>
451 * Output: Nothing.
452 */
453 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
454 public static final String ACTION_DISPLAY_SETTINGS =
455 "android.settings.DISPLAY_SETTINGS";
456
457 /**
Justin Klaassen06c0cb72016-07-21 19:22:09 -0700458 * Activity Action: Show settings to allow configuration of Night display.
459 * <p>
460 * In some cases, a matching Activity may not exist, so ensure you
461 * safeguard against this.
462 * <p>
463 * Input: Nothing.
464 * <p>
465 * Output: Nothing.
466 *
467 * @hide
468 */
469 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
470 public static final String ACTION_NIGHT_DISPLAY_SETTINGS =
471 "android.settings.NIGHT_DISPLAY_SETTINGS";
472
473 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800474 * Activity Action: Show settings to allow configuration of locale.
475 * <p>
476 * In some cases, a matching Activity may not exist, so ensure you
477 * safeguard against this.
478 * <p>
479 * Input: Nothing.
480 * <p>
481 * Output: Nothing.
482 */
483 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
484 public static final String ACTION_LOCALE_SETTINGS =
485 "android.settings.LOCALE_SETTINGS";
486
487 /**
488 * Activity Action: Show settings to configure input methods, in particular
489 * allowing the user to enable input methods.
490 * <p>
491 * In some cases, a matching Activity may not exist, so ensure you
492 * safeguard against this.
493 * <p>
494 * Input: Nothing.
495 * <p>
496 * Output: Nothing.
497 */
498 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
Dianne Hackborna3fb40d2014-08-12 15:06:50 -0700499 public static final String ACTION_VOICE_INPUT_SETTINGS =
500 "android.settings.VOICE_INPUT_SETTINGS";
501
502 /**
503 * Activity Action: Show settings to configure input methods, in particular
504 * allowing the user to enable input methods.
505 * <p>
506 * In some cases, a matching Activity may not exist, so ensure you
507 * safeguard against this.
508 * <p>
509 * Input: Nothing.
510 * <p>
511 * Output: Nothing.
512 */
513 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800514 public static final String ACTION_INPUT_METHOD_SETTINGS =
515 "android.settings.INPUT_METHOD_SETTINGS";
516
517 /**
Tadashi G. Takaokaf49688f2011-01-20 17:56:13 +0900518 * Activity Action: Show settings to enable/disable input method subtypes.
satok86417ea2010-10-27 14:11:03 +0900519 * <p>
520 * In some cases, a matching Activity may not exist, so ensure you
521 * safeguard against this.
522 * <p>
Tadashi G. Takaoka25480202011-01-20 23:13:02 +0900523 * To tell which input method's subtypes are displayed in the settings, add
524 * {@link #EXTRA_INPUT_METHOD_ID} extra to this Intent with the input method id.
525 * If there is no extra in this Intent, subtypes from all installed input methods
526 * will be displayed in the settings.
527 *
528 * @see android.view.inputmethod.InputMethodInfo#getId
529 * <p>
satok86417ea2010-10-27 14:11:03 +0900530 * Input: Nothing.
531 * <p>
532 * Output: Nothing.
533 */
534 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
Tadashi G. Takaokaf49688f2011-01-20 17:56:13 +0900535 public static final String ACTION_INPUT_METHOD_SUBTYPE_SETTINGS =
536 "android.settings.INPUT_METHOD_SUBTYPE_SETTINGS";
satok86417ea2010-10-27 14:11:03 +0900537
538 /**
satok7cfc0ed2011-06-20 21:29:36 +0900539 * Activity Action: Show a dialog to select input method.
540 * <p>
541 * In some cases, a matching Activity may not exist, so ensure you
542 * safeguard against this.
543 * <p>
544 * Input: Nothing.
545 * <p>
546 * Output: Nothing.
547 * @hide
548 */
549 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
550 public static final String ACTION_SHOW_INPUT_METHOD_PICKER =
551 "android.settings.SHOW_INPUT_METHOD_PICKER";
552
553 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800554 * Activity Action: Show settings to manage the user input dictionary.
555 * <p>
Chet Haasee8222dd2013-09-05 07:44:18 -0700556 * Starting with {@link android.os.Build.VERSION_CODES#KITKAT},
Satoshi Kataoka2aa2bc52013-07-30 14:25:11 +0900557 * it is guaranteed there will always be an appropriate implementation for this Intent action.
558 * 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 -0800559 * <p>
560 * Input: Nothing.
561 * <p>
562 * Output: Nothing.
563 */
564 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
565 public static final String ACTION_USER_DICTIONARY_SETTINGS =
566 "android.settings.USER_DICTIONARY_SETTINGS";
567
568 /**
Abodunrinwa Toki07177142016-03-22 16:25:48 +0000569 * Activity Action: Show settings to configure the hardware keyboard.
Yohei Yukawad8701bf2016-01-27 16:15:01 -0800570 * <p>
571 * In some cases, a matching Activity may not exist, so ensure you
572 * safeguard against this.
573 * <p>
Yohei Yukawad8701bf2016-01-27 16:15:01 -0800574 * Input: Nothing.
575 * <p>
576 * Output: Nothing.
577 */
578 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
Abodunrinwa Toki07177142016-03-22 16:25:48 +0000579 public static final String ACTION_HARD_KEYBOARD_SETTINGS =
580 "android.settings.HARD_KEYBOARD_SETTINGS";
Yohei Yukawad8701bf2016-01-27 16:15:01 -0800581
582 /**
Gilles Debunnee90bed12011-08-30 14:28:27 -0700583 * Activity Action: Adds a word to the user dictionary.
584 * <p>
585 * In some cases, a matching Activity may not exist, so ensure you
586 * safeguard against this.
587 * <p>
588 * Input: An extra with key <code>word</code> that contains the word
589 * that should be added to the dictionary.
590 * <p>
591 * Output: Nothing.
592 *
593 * @hide
594 */
595 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
596 public static final String ACTION_USER_DICTIONARY_INSERT =
597 "com.android.settings.USER_DICTIONARY_INSERT";
598
599 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800600 * Activity Action: Show settings to allow configuration of application-related settings.
601 * <p>
602 * In some cases, a matching Activity may not exist, so ensure you
603 * safeguard against this.
604 * <p>
605 * Input: Nothing.
606 * <p>
607 * Output: Nothing.
608 */
609 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
610 public static final String ACTION_APPLICATION_SETTINGS =
611 "android.settings.APPLICATION_SETTINGS";
612
613 /**
614 * Activity Action: Show settings to allow configuration of application
Dianne Hackborn8d866e52012-10-10 18:39:45 -0700615 * development-related settings. As of
616 * {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1} this action is
617 * a required part of the platform.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800618 * <p>
619 * Input: Nothing.
620 * <p>
621 * Output: Nothing.
622 */
623 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
624 public static final String ACTION_APPLICATION_DEVELOPMENT_SETTINGS =
625 "android.settings.APPLICATION_DEVELOPMENT_SETTINGS";
626
627 /**
628 * Activity Action: Show settings to allow configuration of quick launch shortcuts.
629 * <p>
630 * In some cases, a matching Activity may not exist, so ensure you
631 * safeguard against this.
632 * <p>
633 * Input: Nothing.
634 * <p>
635 * Output: Nothing.
636 */
637 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
638 public static final String ACTION_QUICK_LAUNCH_SETTINGS =
639 "android.settings.QUICK_LAUNCH_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700640
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800641 /**
642 * Activity Action: Show settings to manage installed applications.
643 * <p>
644 * In some cases, a matching Activity may not exist, so ensure you
645 * safeguard against this.
646 * <p>
647 * Input: Nothing.
648 * <p>
649 * Output: Nothing.
650 */
651 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
652 public static final String ACTION_MANAGE_APPLICATIONS_SETTINGS =
653 "android.settings.MANAGE_APPLICATIONS_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700654
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800655 /**
Winson Chung44e8ff92010-09-27 14:36:52 -0700656 * Activity Action: Show settings to manage all applications.
657 * <p>
658 * In some cases, a matching Activity may not exist, so ensure you
659 * safeguard against this.
660 * <p>
661 * Input: Nothing.
662 * <p>
663 * Output: Nothing.
664 */
665 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
666 public static final String ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS =
667 "android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS";
668
669 /**
Billy Lau6ad2d662015-07-18 00:26:58 +0100670 * Activity Action: Show screen for controlling which apps can draw on top of other apps.
Billy Laucbe540f2015-06-25 01:51:44 +0100671 * <p>
672 * In some cases, a matching Activity may not exist, so ensure you
673 * safeguard against this.
674 * <p>
Billy Lau6ad2d662015-07-18 00:26:58 +0100675 * Input: Optionally, the Intent's data URI can specify the application package name to
676 * directly invoke the management GUI specific to the package name. For example
677 * "package:com.my.app".
Billy Laucbe540f2015-06-25 01:51:44 +0100678 * <p>
679 * Output: Nothing.
680 */
681 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
682 public static final String ACTION_MANAGE_OVERLAY_PERMISSION =
Billy Lau22b3f4c2015-07-08 00:31:01 +0100683 "android.settings.action.MANAGE_OVERLAY_PERMISSION";
684
685 /**
Billy Lau6ad2d662015-07-18 00:26:58 +0100686 * Activity Action: Show screen for controlling which apps are allowed to write/modify
687 * system settings.
Billy Lau22b3f4c2015-07-08 00:31:01 +0100688 * <p>
689 * In some cases, a matching Activity may not exist, so ensure you
690 * safeguard against this.
691 * <p>
Billy Lau6ad2d662015-07-18 00:26:58 +0100692 * Input: Optionally, the Intent's data URI can specify the application package name to
693 * directly invoke the management GUI specific to the package name. For example
694 * "package:com.my.app".
Billy Lau22b3f4c2015-07-08 00:31:01 +0100695 * <p>
696 * Output: Nothing.
697 */
698 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
699 public static final String ACTION_MANAGE_WRITE_SETTINGS =
700 "android.settings.action.MANAGE_WRITE_SETTINGS";
Billy Laucbe540f2015-06-25 01:51:44 +0100701
702 /**
Dianne Hackbornb7bb3b32010-06-06 22:47:50 -0700703 * Activity Action: Show screen of details about a particular application.
704 * <p>
705 * In some cases, a matching Activity may not exist, so ensure you
706 * safeguard against this.
707 * <p>
708 * Input: The Intent's data URI specifies the application package name
709 * to be shown, with the "package" scheme. That is "package:com.my.app".
710 * <p>
711 * Output: Nothing.
712 */
713 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
714 public static final String ACTION_APPLICATION_DETAILS_SETTINGS =
715 "android.settings.APPLICATION_DETAILS_SETTINGS";
716
717 /**
Jason Monk287b8892015-06-10 10:39:23 -0400718 * Activity Action: Show screen for controlling which apps can ignore battery optimizations.
719 * <p>
Dianne Hackbornc7b57b12015-08-10 14:52:52 -0700720 * Input: Nothing.
721 * <p>
722 * Output: Nothing.
723 * <p>
724 * You can use {@link android.os.PowerManager#isIgnoringBatteryOptimizations
725 * PowerManager.isIgnoringBatteryOptimizations()} to determine if an application is
726 * already ignoring optimizations. You can use
727 * {@link #ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS} to ask the user to put you
728 * on this list.
729 */
730 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
731 public static final String ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS =
732 "android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS";
733
734 /**
Felipe Leme5f5d7072016-01-27 10:41:22 -0800735 * Activity Action: Ask the user to allow an app to ignore battery optimizations (that is,
Dianne Hackbornc7b57b12015-08-10 14:52:52 -0700736 * put them on the whitelist of apps shown by
737 * {@link #ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS}). For an app to use this, it also
738 * must hold the {@link android.Manifest.permission#REQUEST_IGNORE_BATTERY_OPTIMIZATIONS}
739 * permission.
740 * <p><b>Note:</b> most applications should <em>not</em> use this; there are many facilities
741 * provided by the platform for applications to operate correctly in the various power
Felipe Leme5f5d7072016-01-27 10:41:22 -0800742 * saving modes. This is only for unusual applications that need to deeply control their own
Dianne Hackbornc7b57b12015-08-10 14:52:52 -0700743 * execution, at the potential expense of the user's battery life. Note that these applications
Kweku Adamseb80f7c2016-01-12 11:46:52 -0800744 * greatly run the risk of showing to the user as high power consumers on their device.</p>
Dianne Hackbornc7b57b12015-08-10 14:52:52 -0700745 * <p>
746 * Input: The Intent's data URI must specify the application package name
Jason Monk287b8892015-06-10 10:39:23 -0400747 * to be shown, with the "package" scheme. That is "package:com.my.app".
748 * <p>
749 * Output: Nothing.
Dianne Hackborn1958e5e2015-06-12 18:11:41 -0700750 * <p>
751 * You can use {@link android.os.PowerManager#isIgnoringBatteryOptimizations
752 * PowerManager.isIgnoringBatteryOptimizations()} to determine if an application is
753 * already ignoring optimizations.
Jason Monk287b8892015-06-10 10:39:23 -0400754 */
755 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
Dianne Hackbornc7b57b12015-08-10 14:52:52 -0700756 public static final String ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS =
757 "android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS";
Jason Monk287b8892015-06-10 10:39:23 -0400758
759 /**
Felipe Leme2850b562016-04-21 17:58:47 -0700760 * Activity Action: Show screen for controlling background data
761 * restrictions for a particular application.
Felipe Leme5f5d7072016-01-27 10:41:22 -0800762 * <p>
Felipe Leme2850b562016-04-21 17:58:47 -0700763 * Input: Intent's data URI set with an application name, using the
764 * "package" schema (like "package:com.my.app").
765 *
Felipe Leme5f5d7072016-01-27 10:41:22 -0800766 * <p>
767 * Output: Nothing.
768 * <p>
769 * Applications can also use {@link android.net.ConnectivityManager#getRestrictBackgroundStatus
Felipe Leme2850b562016-04-21 17:58:47 -0700770 * ConnectivityManager#getRestrictBackgroundStatus()} to determine the
771 * status of the background data restrictions for them.
Felipe Leme5f5d7072016-01-27 10:41:22 -0800772 */
773 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
774 public static final String ACTION_IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS =
775 "android.settings.IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS";
776
777 /**
Dianne Hackborn35654b62013-01-14 17:38:02 -0800778 * @hide
779 * Activity Action: Show the "app ops" settings screen.
780 * <p>
781 * Input: Nothing.
782 * <p>
783 * Output: Nothing.
784 */
785 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
786 public static final String ACTION_APP_OPS_SETTINGS =
787 "android.settings.APP_OPS_SETTINGS";
788
789 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800790 * Activity Action: Show settings for system update functionality.
791 * <p>
792 * In some cases, a matching Activity may not exist, so ensure you
793 * safeguard against this.
794 * <p>
795 * Input: Nothing.
796 * <p>
797 * Output: Nothing.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700798 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800799 * @hide
800 */
801 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
802 public static final String ACTION_SYSTEM_UPDATE_SETTINGS =
803 "android.settings.SYSTEM_UPDATE_SETTINGS";
804
805 /**
806 * Activity Action: Show settings to allow configuration of sync settings.
807 * <p>
808 * In some cases, a matching Activity may not exist, so ensure you
809 * safeguard against this.
810 * <p>
Erikeebc8e22010-02-18 13:27:19 -0800811 * The account types available to add via the add account button may be restricted by adding an
812 * {@link #EXTRA_AUTHORITIES} extra to this Intent with one or more syncable content provider's
813 * authorities. Only account types which can sync with that content provider will be offered to
814 * the user.
815 * <p>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800816 * Input: Nothing.
817 * <p>
818 * Output: Nothing.
819 */
820 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
821 public static final String ACTION_SYNC_SETTINGS =
822 "android.settings.SYNC_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700823
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800824 /**
Erikeebc8e22010-02-18 13:27:19 -0800825 * Activity Action: Show add account screen for creating a new account.
826 * <p>
827 * In some cases, a matching Activity may not exist, so ensure you
828 * safeguard against this.
829 * <p>
830 * The account types available to add may be restricted by adding an {@link #EXTRA_AUTHORITIES}
831 * extra to the Intent with one or more syncable content provider's authorities. Only account
832 * types which can sync with that content provider will be offered to the user.
833 * <p>
Alon Albert50359c22013-02-26 14:47:48 -0800834 * Account types can also be filtered by adding an {@link #EXTRA_ACCOUNT_TYPES} extra to the
835 * Intent with one or more account types.
836 * <p>
Erikeebc8e22010-02-18 13:27:19 -0800837 * Input: Nothing.
838 * <p>
839 * Output: Nothing.
840 */
841 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
842 public static final String ACTION_ADD_ACCOUNT =
843 "android.settings.ADD_ACCOUNT_SETTINGS";
844
845 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800846 * Activity Action: Show settings for selecting the network operator.
847 * <p>
848 * In some cases, a matching Activity may not exist, so ensure you
849 * safeguard against this.
850 * <p>
851 * Input: Nothing.
852 * <p>
853 * Output: Nothing.
854 */
855 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
856 public static final String ACTION_NETWORK_OPERATOR_SETTINGS =
857 "android.settings.NETWORK_OPERATOR_SETTINGS";
858
859 /**
860 * Activity Action: Show settings for selection of 2G/3G.
861 * <p>
862 * In some cases, a matching Activity may not exist, so ensure you
863 * safeguard against this.
864 * <p>
865 * Input: Nothing.
866 * <p>
867 * Output: Nothing.
868 */
869 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
870 public static final String ACTION_DATA_ROAMING_SETTINGS =
871 "android.settings.DATA_ROAMING_SETTINGS";
872
873 /**
874 * Activity Action: Show settings for internal storage.
875 * <p>
876 * In some cases, a matching Activity may not exist, so ensure you
877 * safeguard against this.
878 * <p>
879 * Input: Nothing.
880 * <p>
881 * Output: Nothing.
882 */
883 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
884 public static final String ACTION_INTERNAL_STORAGE_SETTINGS =
885 "android.settings.INTERNAL_STORAGE_SETTINGS";
886 /**
887 * Activity Action: Show settings for memory card storage.
888 * <p>
889 * In some cases, a matching Activity may not exist, so ensure you
890 * safeguard against this.
891 * <p>
892 * Input: Nothing.
893 * <p>
894 * Output: Nothing.
895 */
896 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
897 public static final String ACTION_MEMORY_CARD_SETTINGS =
898 "android.settings.MEMORY_CARD_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700899
Justin Mattsonef340352010-01-13 21:05:46 -0800900 /**
901 * Activity Action: Show settings for global search.
902 * <p>
903 * In some cases, a matching Activity may not exist, so ensure you
904 * safeguard against this.
905 * <p>
906 * Input: Nothing.
907 * <p>
908 * Output: Nothing
909 */
910 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
911 public static final String ACTION_SEARCH_SETTINGS =
912 "android.search.action.SEARCH_SETTINGS";
913
Daniel Sandler9d8b8762010-01-22 20:50:15 -0500914 /**
915 * Activity Action: Show general device information settings (serial
916 * number, software version, phone number, etc.).
917 * <p>
918 * In some cases, a matching Activity may not exist, so ensure you
919 * safeguard against this.
920 * <p>
921 * Input: Nothing.
922 * <p>
923 * Output: Nothing
924 */
925 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
926 public static final String ACTION_DEVICE_INFO_SETTINGS =
927 "android.settings.DEVICE_INFO_SETTINGS";
928
Martijn Coenen9b3c83f2011-07-28 11:21:39 -0500929 /**
Nick Pellycccf01d2011-10-31 14:49:40 -0700930 * Activity Action: Show NFC settings.
931 * <p>
932 * This shows UI that allows NFC to be turned on or off.
Martijn Coenen9b3c83f2011-07-28 11:21:39 -0500933 * <p>
934 * In some cases, a matching Activity may not exist, so ensure you
935 * safeguard against this.
936 * <p>
937 * Input: Nothing.
938 * <p>
939 * Output: Nothing
Nick Pellycccf01d2011-10-31 14:49:40 -0700940 * @see android.nfc.NfcAdapter#isEnabled()
941 */
942 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
943 public static final String ACTION_NFC_SETTINGS = "android.settings.NFC_SETTINGS";
944
945 /**
946 * Activity Action: Show NFC Sharing settings.
947 * <p>
948 * This shows UI that allows NDEF Push (Android Beam) to be turned on or
949 * off.
950 * <p>
951 * In some cases, a matching Activity may not exist, so ensure you
952 * safeguard against this.
953 * <p>
954 * Input: Nothing.
955 * <p>
956 * Output: Nothing
957 * @see android.nfc.NfcAdapter#isNdefPushEnabled()
Martijn Coenen9b3c83f2011-07-28 11:21:39 -0500958 */
959 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
960 public static final String ACTION_NFCSHARING_SETTINGS =
961 "android.settings.NFCSHARING_SETTINGS";
962
Daniel Sandlerc08cd022012-11-27 22:47:37 -0500963 /**
Martijn Coenen62c196a2013-08-09 13:43:34 -0700964 * Activity Action: Show NFC Tap & Pay settings
965 * <p>
966 * This shows UI that allows the user to configure Tap&Pay
967 * settings.
968 * <p>
969 * In some cases, a matching Activity may not exist, so ensure you
970 * safeguard against this.
971 * <p>
972 * Input: Nothing.
973 * <p>
974 * Output: Nothing
975 */
976 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
977 public static final String ACTION_NFC_PAYMENT_SETTINGS =
978 "android.settings.NFC_PAYMENT_SETTINGS";
979
980 /**
Daniel Sandlerc08cd022012-11-27 22:47:37 -0500981 * Activity Action: Show Daydream settings.
982 * <p>
983 * In some cases, a matching Activity may not exist, so ensure you
984 * safeguard against this.
985 * <p>
986 * Input: Nothing.
987 * <p>
988 * Output: Nothing.
989 * @see android.service.dreams.DreamService
Daniel Sandlerc08cd022012-11-27 22:47:37 -0500990 */
991 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
992 public static final String ACTION_DREAM_SETTINGS = "android.settings.DREAM_SETTINGS";
993
Daniel Sandler5feceeb2013-03-22 18:29:23 -0700994 /**
995 * Activity Action: Show Notification listener settings.
996 * <p>
997 * In some cases, a matching Activity may not exist, so ensure you
998 * safeguard against this.
999 * <p>
1000 * Input: Nothing.
1001 * <p>
1002 * Output: Nothing.
1003 * @see android.service.notification.NotificationListenerService
Daniel Sandler5feceeb2013-03-22 18:29:23 -07001004 */
1005 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1006 public static final String ACTION_NOTIFICATION_LISTENER_SETTINGS
Chris Wren8326a8a2014-10-22 14:13:32 -04001007 = "android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS";
Daniel Sandler5feceeb2013-03-22 18:29:23 -07001008
Alan Viverette69ce69b2013-08-29 12:23:48 -07001009 /**
John Spurlock80774932015-05-07 17:38:50 -04001010 * Activity Action: Show Do Not Disturb access settings.
1011 * <p>
John Spurlock7c74f782015-06-04 13:01:42 -04001012 * Users can grant and deny access to Do Not Disturb configuration from here.
1013 * See {@link android.app.NotificationManager#isNotificationPolicyAccessGranted()} for more
1014 * details.
John Spurlock80774932015-05-07 17:38:50 -04001015 * <p>
1016 * Input: Nothing.
1017 * <p>
1018 * Output: Nothing.
1019 */
1020 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
John Spurlock7c74f782015-06-04 13:01:42 -04001021 public static final String ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS
1022 = "android.settings.NOTIFICATION_POLICY_ACCESS_SETTINGS";
John Spurlock80774932015-05-07 17:38:50 -04001023
1024 /**
John Spurlock7340fc82014-04-24 18:50:12 -04001025 * @hide
1026 */
1027 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1028 public static final String ACTION_CONDITION_PROVIDER_SETTINGS
1029 = "android.settings.ACTION_CONDITION_PROVIDER_SETTINGS";
1030
1031 /**
Alan Viverette69ce69b2013-08-29 12:23:48 -07001032 * Activity Action: Show settings for video captioning.
1033 * <p>
1034 * In some cases, a matching Activity may not exist, so ensure you safeguard
1035 * against this.
1036 * <p>
1037 * Input: Nothing.
1038 * <p>
1039 * Output: Nothing.
1040 */
1041 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1042 public static final String ACTION_CAPTIONING_SETTINGS = "android.settings.CAPTIONING_SETTINGS";
1043
Svetoslav773f54d2013-09-03 14:01:43 -07001044 /**
1045 * Activity Action: Show the top level print settings.
1046 * <p>
1047 * In some cases, a matching Activity may not exist, so ensure you
1048 * safeguard against this.
1049 * <p>
1050 * Input: Nothing.
1051 * <p>
1052 * Output: Nothing.
1053 */
1054 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1055 public static final String ACTION_PRINT_SETTINGS =
1056 "android.settings.ACTION_PRINT_SETTINGS";
1057
John Spurlockde547002014-02-28 17:50:39 -05001058 /**
1059 * Activity Action: Show Zen Mode configuration settings.
1060 *
1061 * @hide
1062 */
1063 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1064 public static final String ACTION_ZEN_MODE_SETTINGS = "android.settings.ZEN_MODE_SETTINGS";
1065
Santos Cordona4c75242014-07-09 12:07:51 -07001066 /**
John Spurlockfc746f82015-04-03 13:47:14 -04001067 * Activity Action: Show Zen Mode priority configuration settings.
1068 *
1069 * @hide
1070 */
1071 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1072 public static final String ACTION_ZEN_MODE_PRIORITY_SETTINGS
1073 = "android.settings.ZEN_MODE_PRIORITY_SETTINGS";
1074
1075 /**
John Spurlock7af10182015-04-03 15:10:31 -04001076 * Activity Action: Show Zen Mode automation configuration settings.
1077 *
1078 * @hide
1079 */
1080 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1081 public static final String ACTION_ZEN_MODE_AUTOMATION_SETTINGS
1082 = "android.settings.ZEN_MODE_AUTOMATION_SETTINGS";
1083
1084 /**
Barnaby Jamesb3006d32015-04-02 17:49:54 -07001085 * Activity Action: Modify do not disturb mode settings.
1086 * <p>
1087 * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
1088 * <p>
1089 * This intent MUST be started using
1090 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
1091 * startVoiceActivity}.
1092 * <p>
1093 * Note: The Activity implementing this intent MUST verify that
1094 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction}.
1095 * returns true before modifying the setting.
1096 * <p>
1097 * Input: The optional {@link #EXTRA_DO_NOT_DISTURB_MODE_MINUTES} extra can be used to indicate
1098 * how long the user wishes to avoid interruptions for. The optional
1099 * {@link #EXTRA_DO_NOT_DISTURB_MODE_ENABLED} extra can be to indicate if the user is
1100 * enabling or disabling do not disturb mode. If either extra is not included, the
1101 * user maybe asked to provide the value.
1102 * <p>
1103 * Output: Nothing.
1104 */
1105 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1106 public static final String ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE =
1107 "android.settings.VOICE_CONTROL_DO_NOT_DISTURB_MODE";
1108
1109 /**
John Spurlockb2278d62015-04-07 12:47:12 -04001110 * Activity Action: Show Zen Mode schedule rule configuration settings.
1111 *
1112 * @hide
1113 */
1114 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1115 public static final String ACTION_ZEN_MODE_SCHEDULE_RULE_SETTINGS
1116 = "android.settings.ZEN_MODE_SCHEDULE_RULE_SETTINGS";
1117
1118 /**
John Spurlockd60258f2015-04-30 09:30:52 -04001119 * Activity Action: Show Zen Mode event rule configuration settings.
1120 *
1121 * @hide
1122 */
1123 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1124 public static final String ACTION_ZEN_MODE_EVENT_RULE_SETTINGS
1125 = "android.settings.ZEN_MODE_EVENT_RULE_SETTINGS";
1126
1127 /**
John Spurlock39581cc2015-04-10 11:59:01 -04001128 * Activity Action: Show Zen Mode external rule configuration settings.
1129 *
1130 * @hide
1131 */
1132 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1133 public static final String ACTION_ZEN_MODE_EXTERNAL_RULE_SETTINGS
1134 = "android.settings.ZEN_MODE_EXTERNAL_RULE_SETTINGS";
1135
1136 /**
Santos Cordona4c75242014-07-09 12:07:51 -07001137 * Activity Action: Show the regulatory information screen for the device.
1138 * <p>
1139 * In some cases, a matching Activity may not exist, so ensure you safeguard
1140 * against this.
1141 * <p>
1142 * Input: Nothing.
1143 * <p>
1144 * Output: Nothing.
1145 */
Jeff Sharkeydd77fda2014-04-16 17:23:08 -07001146 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1147 public static final String
1148 ACTION_SHOW_REGULATORY_INFO = "android.settings.SHOW_REGULATORY_INFO";
1149
Jerome Poichet7974cb32014-05-14 12:04:43 -07001150 /**
1151 * Activity Action: Show Device Name Settings.
1152 * <p>
1153 * In some cases, a matching Activity may not exist, so ensure you safeguard
Tim Kilbourn87cd0dc2014-04-14 15:37:51 -07001154 * against this.
Jerome Poichet7974cb32014-05-14 12:04:43 -07001155 *
1156 * @hide
1157 */
1158 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1159 public static final String DEVICE_NAME_SETTINGS = "android.settings.DEVICE_NAME";
1160
Tim Kilbourn87cd0dc2014-04-14 15:37:51 -07001161 /**
1162 * Activity Action: Show pairing settings.
1163 * <p>
1164 * In some cases, a matching Activity may not exist, so ensure you safeguard
1165 * against this.
1166 *
1167 * @hide
1168 */
1169 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1170 public static final String ACTION_PAIRING_SETTINGS = "android.settings.PAIRING_SETTINGS";
1171
John Spurlockf8f524c2014-06-10 14:47:29 -04001172 /**
1173 * Activity Action: Show battery saver settings.
John Spurlock73466662014-10-30 13:42:05 -04001174 * <p>
1175 * In some cases, a matching Activity may not exist, so ensure you safeguard
1176 * against this.
John Spurlockf8f524c2014-06-10 14:47:29 -04001177 */
1178 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1179 public static final String ACTION_BATTERY_SAVER_SETTINGS
1180 = "android.settings.BATTERY_SAVER_SETTINGS";
1181
Amith Yamasanieb7b94a2014-07-14 18:02:08 -07001182 /**
Barnaby Jamesb3006d32015-04-02 17:49:54 -07001183 * Activity Action: Modify Battery Saver mode setting using a voice command.
1184 * <p>
1185 * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
1186 * <p>
1187 * This intent MUST be started using
1188 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
1189 * startVoiceActivity}.
1190 * <p>
1191 * Note: The activity implementing this intent MUST verify that
1192 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before
1193 * modifying the setting.
1194 * <p>
1195 * Input: To tell which state batter saver mode should be set to, add the
1196 * {@link #EXTRA_BATTERY_SAVER_MODE_ENABLED} extra to this Intent with the state specified.
1197 * If the extra is not included, no changes will be made.
1198 * <p>
1199 * Output: Nothing.
1200 */
1201 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1202 public static final String ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE =
1203 "android.settings.VOICE_CONTROL_BATTERY_SAVER_MODE";
1204
1205 /**
Amith Yamasanieb7b94a2014-07-14 18:02:08 -07001206 * Activity Action: Show Home selection settings. If there are multiple activities
1207 * that can satisfy the {@link Intent#CATEGORY_HOME} intent, this screen allows you
1208 * to pick your preferred activity.
1209 */
1210 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1211 public static final String ACTION_HOME_SETTINGS
1212 = "android.settings.HOME_SETTINGS";
1213
Julia Reynolds7eba5932015-12-11 16:40:39 -05001214
1215
1216 /**
1217 * Activity Action: Show Default apps settings.
1218 * <p>
1219 * In some cases, a matching Activity may not exist, so ensure you
1220 * safeguard against this.
1221 * <p>
1222 * Input: Nothing.
1223 * <p>
1224 * Output: Nothing.
1225 */
1226 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1227 public static final String ACTION_MANAGE_DEFAULT_APPS_SETTINGS
1228 = "android.settings.MANAGE_DEFAULT_APPS_SETTINGS";
1229
John Spurlock2b0e09c2014-07-27 13:27:47 -04001230 /**
1231 * Activity Action: Show notification settings.
1232 *
1233 * @hide
1234 */
1235 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1236 public static final String ACTION_NOTIFICATION_SETTINGS
1237 = "android.settings.NOTIFICATION_SETTINGS";
1238
1239 /**
1240 * Activity Action: Show notification settings for a single app.
1241 *
1242 * @hide
1243 */
1244 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1245 public static final String ACTION_APP_NOTIFICATION_SETTINGS
1246 = "android.settings.APP_NOTIFICATION_SETTINGS";
1247
Chris Wrencd8f4f72014-08-27 18:48:13 -04001248 /**
1249 * Activity Action: Show notification redaction settings.
1250 *
1251 * @hide
1252 */
1253 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1254 public static final String ACTION_APP_NOTIFICATION_REDACTION
1255 = "android.settings.ACTION_APP_NOTIFICATION_REDACTION";
1256
John Spurlock2b0e09c2014-07-27 13:27:47 -04001257 /** @hide */ public static final String EXTRA_APP_UID = "app_uid";
1258 /** @hide */ public static final String EXTRA_APP_PACKAGE = "app_package";
1259
Sudheer Shanka410e6bd2015-12-31 15:29:50 +00001260 /**
1261 * Activity Action: Show a dialog with disabled by policy message.
1262 * <p> If an user action is disabled by policy, this dialog can be triggered to let
1263 * the user know about this.
1264 * <p>
1265 * Input: Nothing.
1266 * <p>
1267 * Output: Nothing.
Sudheer Shankaaebd5dd2016-02-18 12:37:14 +00001268 *
1269 * @hide
Sudheer Shanka410e6bd2015-12-31 15:29:50 +00001270 */
1271 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1272 public static final String ACTION_SHOW_ADMIN_SUPPORT_DETAILS
1273 = "android.settings.SHOW_ADMIN_SUPPORT_DETAILS";
1274
Michal Karpinskiba244092016-02-25 17:28:24 +00001275 /**
1276 * Activity Action: Show a dialog for remote bugreport flow.
1277 * <p>
1278 * Input: Nothing.
1279 * <p>
1280 * Output: Nothing.
1281 *
1282 * @hide
1283 */
1284 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1285 public static final String ACTION_SHOW_REMOTE_BUGREPORT_DIALOG
1286 = "android.settings.SHOW_REMOTE_BUGREPORT_DIALOG";
1287
Ruben Brunke24b9a62016-02-16 21:38:24 -08001288 /**
1289 * Activity Action: Show VR listener settings.
1290 * <p>
1291 * Input: Nothing.
1292 * <p>
1293 * Output: Nothing.
1294 *
1295 * @see android.service.vr.VrListenerService
1296 */
1297 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1298 public static final String ACTION_VR_LISTENER_SETTINGS
1299 = "android.settings.VR_LISTENER_SETTINGS";
1300
Jason Monk42d01212016-05-03 14:16:56 -04001301 /**
Daniel Nishi4bd88df2016-09-20 16:42:19 -07001302 * Activity Action: Show Storage Manager settings.
1303 * <p>
1304 * Input: Nothing.
1305 * <p>
1306 * Output: Nothing.
1307 *
1308 * @hide
1309 */
1310 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1311 public static final String ACTION_STORAGE_MANAGER_SETTINGS
1312 = "android.settings.STORAGE_MANAGER_SETTINGS";
1313
1314 /**
Jason Monk42d01212016-05-03 14:16:56 -04001315 * Activity Action: Allows user to select current webview implementation.
1316 * <p>
1317 * Input: Nothing.
1318 * <p>
1319 * Output: Nothing.
1320 */
1321 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1322 public static final String ACTION_WEBVIEW_SETTINGS = "android.settings.WEBVIEW_SETTINGS";
1323
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001324 // End of Intent actions for Settings
1325
Erikeebc8e22010-02-18 13:27:19 -08001326 /**
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001327 * @hide - Private call() method on SettingsProvider to read from 'system' table.
1328 */
1329 public static final String CALL_METHOD_GET_SYSTEM = "GET_system";
1330
1331 /**
1332 * @hide - Private call() method on SettingsProvider to read from 'secure' table.
1333 */
1334 public static final String CALL_METHOD_GET_SECURE = "GET_secure";
1335
1336 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001337 * @hide - Private call() method on SettingsProvider to read from 'global' table.
1338 */
1339 public static final String CALL_METHOD_GET_GLOBAL = "GET_global";
1340
1341 /**
Svet Ganov53a441c2016-04-19 19:38:00 -07001342 * @hide - Specifies that the caller of the fast-path call()-based flow tracks
1343 * the settings generation in order to cache values locally. If this key is
1344 * mapped to a <code>null</code> string extra in the request bundle, the response
1345 * bundle will contain the same key mapped to a parcelable extra which would be
1346 * an {@link android.util.MemoryIntArray}. The response will also contain an
1347 * integer mapped to the {@link #CALL_METHOD_GENERATION_INDEX_KEY} which is the
1348 * index in the array clients should use to lookup the generation. For efficiency
1349 * the caller should request the generation tracking memory array only if it
1350 * doesn't already have it.
1351 *
1352 * @see #CALL_METHOD_GENERATION_INDEX_KEY
1353 */
1354 public static final String CALL_METHOD_TRACK_GENERATION_KEY = "_track_generation";
1355
1356 /**
1357 * @hide Key with the location in the {@link android.util.MemoryIntArray} where
Svetoslav Ganov8c35dcc2016-06-17 15:27:43 -07001358 * to look up the generation id of the backing table. The value is an integer.
Svet Ganov53a441c2016-04-19 19:38:00 -07001359 *
1360 * @see #CALL_METHOD_TRACK_GENERATION_KEY
1361 */
1362 public static final String CALL_METHOD_GENERATION_INDEX_KEY = "_generation_index";
1363
1364 /**
Svetoslav Ganov8c35dcc2016-06-17 15:27:43 -07001365 * @hide Key with the settings table generation. The value is an integer.
1366 *
1367 * @see #CALL_METHOD_TRACK_GENERATION_KEY
1368 */
1369 public static final String CALL_METHOD_GENERATION_KEY = "_generation";
1370
1371 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001372 * @hide - User handle argument extra to the fast-path call()-based requests
1373 */
1374 public static final String CALL_METHOD_USER_KEY = "_user";
1375
1376 /** @hide - Private call() method to write to 'system' table */
1377 public static final String CALL_METHOD_PUT_SYSTEM = "PUT_system";
1378
1379 /** @hide - Private call() method to write to 'secure' table */
1380 public static final String CALL_METHOD_PUT_SECURE = "PUT_secure";
1381
1382 /** @hide - Private call() method to write to 'global' table */
1383 public static final String CALL_METHOD_PUT_GLOBAL= "PUT_global";
1384
1385 /**
Erikeebc8e22010-02-18 13:27:19 -08001386 * Activity Extra: Limit available options in launched activity based on the given authority.
1387 * <p>
1388 * This can be passed as an extra field in an Activity Intent with one or more syncable content
1389 * provider's authorities as a String[]. This field is used by some intents to alter the
1390 * behavior of the called activity.
1391 * <p>
1392 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types available based
1393 * on the authority given.
1394 */
Alon Albert50359c22013-02-26 14:47:48 -08001395 public static final String EXTRA_AUTHORITIES = "authorities";
1396
Alon Albertd35bf1f2013-04-18 14:26:51 -07001397 /**
1398 * Activity Extra: Limit available options in launched activity based on the given account
1399 * types.
1400 * <p>
1401 * This can be passed as an extra field in an Activity Intent with one or more account types
1402 * as a String[]. This field is used by some intents to alter the behavior of the called
1403 * activity.
1404 * <p>
1405 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types to the specified
1406 * list.
1407 */
Alon Albert50359c22013-02-26 14:47:48 -08001408 public static final String EXTRA_ACCOUNT_TYPES = "account_types";
Erikeebc8e22010-02-18 13:27:19 -08001409
Tadashi G. Takaoka25480202011-01-20 23:13:02 +09001410 public static final String EXTRA_INPUT_METHOD_ID = "input_method_id";
1411
Barnaby James48f35522014-07-16 14:27:39 -07001412 /**
Michael Wrightc93fbd12014-09-22 20:07:59 -07001413 * Activity Extra: The device identifier to act upon.
1414 * <p>
1415 * This can be passed as an extra field in an Activity Intent with a single
1416 * InputDeviceIdentifier. This field is used by some activities to jump straight into the
1417 * settings for the given device.
1418 * <p>
Dianne Hackbornad6a99b2014-11-18 10:11:10 -08001419 * Example: The {@link #ACTION_INPUT_METHOD_SETTINGS} intent opens the keyboard layout
1420 * dialog for the given device.
Michael Wrightc93fbd12014-09-22 20:07:59 -07001421 * @hide
1422 */
1423 public static final String EXTRA_INPUT_DEVICE_IDENTIFIER = "input_device_identifier";
1424
1425 /**
Barnaby James48f35522014-07-16 14:27:39 -07001426 * Activity Extra: Enable or disable Airplane Mode.
1427 * <p>
1428 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_AIRPLANE_MODE}
Barnaby Jamesb3006d32015-04-02 17:49:54 -07001429 * intent as a boolean to indicate if it should be enabled.
Barnaby James48f35522014-07-16 14:27:39 -07001430 */
1431 public static final String EXTRA_AIRPLANE_MODE_ENABLED = "airplane_mode_enabled";
1432
Barnaby Jamesb3006d32015-04-02 17:49:54 -07001433 /**
1434 * Activity Extra: Enable or disable Battery saver mode.
1435 * <p>
1436 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE}
1437 * intent as a boolean to indicate if it should be enabled.
1438 */
1439 public static final String EXTRA_BATTERY_SAVER_MODE_ENABLED =
1440 "android.settings.extra.battery_saver_mode_enabled";
1441
1442 /**
1443 * Activity Extra: Enable or disable Do Not Disturb mode.
1444 * <p>
1445 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE}
1446 * intent as a boolean to indicate if it should be enabled.
1447 */
1448 public static final String EXTRA_DO_NOT_DISTURB_MODE_ENABLED =
1449 "android.settings.extra.do_not_disturb_mode_enabled";
1450
1451 /**
1452 * Activity Extra: How many minutes to enable do not disturb mode for.
1453 * <p>
1454 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE}
1455 * intent to indicate how long do not disturb mode should be enabled for.
1456 */
1457 public static final String EXTRA_DO_NOT_DISTURB_MODE_MINUTES =
1458 "android.settings.extra.do_not_disturb_mode_minutes";
1459
Victor Chang355d4762016-04-07 21:23:15 +01001460 /**
1461 * Activity Extra: Number of certificates
1462 * <p>
1463 * This can be passed as an extra field to the {@link #ACTION_MONITORING_CERT_INFO}
1464 * intent to indicate the number of certificates
1465 * @hide
1466 */
1467 public static final String EXTRA_NUMBER_OF_CERTIFICATES =
1468 "android.settings.extra.number_of_certificates";
1469
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001470 private static final String JID_RESOURCE_PREFIX = "android";
1471
1472 public static final String AUTHORITY = "settings";
1473
1474 private static final String TAG = "Settings";
Christopher Tate06efb532012-08-24 15:29:27 -07001475 private static final boolean LOCAL_LOGV = false;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001476
David Christie3f7b6522013-08-06 19:19:08 -07001477 // Lock ensures that when enabling/disabling the master location switch, we don't end up
1478 // with a partial enable/disable state in multi-threaded situations.
1479 private static final Object mLocationSettingsLock = new Object();
1480
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001481 public static class SettingNotFoundException extends AndroidException {
1482 public SettingNotFoundException(String msg) {
1483 super(msg);
1484 }
1485 }
1486
1487 /**
1488 * Common base for tables of name/value settings.
1489 */
1490 public static class NameValueTable implements BaseColumns {
1491 public static final String NAME = "name";
1492 public static final String VALUE = "value";
1493
1494 protected static boolean putString(ContentResolver resolver, Uri uri,
1495 String name, String value) {
1496 // The database will take care of replacing duplicates.
1497 try {
1498 ContentValues values = new ContentValues();
1499 values.put(NAME, name);
1500 values.put(VALUE, value);
1501 resolver.insert(uri, values);
1502 return true;
1503 } catch (SQLException e) {
Dianne Hackborna33e3f72009-09-29 17:28:24 -07001504 Log.w(TAG, "Can't set key " + name + " in " + uri, e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001505 return false;
1506 }
1507 }
1508
1509 public static Uri getUriFor(Uri uri, String name) {
1510 return Uri.withAppendedPath(uri, name);
1511 }
1512 }
1513
Svet Ganov53a441c2016-04-19 19:38:00 -07001514 private static final class GenerationTracker {
1515 private final MemoryIntArray mArray;
Svetoslav Ganov04df7382016-05-10 18:55:47 -07001516 private final Runnable mErrorHandler;
Svet Ganov53a441c2016-04-19 19:38:00 -07001517 private final int mIndex;
1518 private int mCurrentGeneration;
1519
Svetoslav Ganov04df7382016-05-10 18:55:47 -07001520 public GenerationTracker(@NonNull MemoryIntArray array, int index,
Svetoslav Ganov8c35dcc2016-06-17 15:27:43 -07001521 int generation, Runnable errorHandler) {
Svet Ganov53a441c2016-04-19 19:38:00 -07001522 mArray = array;
1523 mIndex = index;
Svetoslav Ganov04df7382016-05-10 18:55:47 -07001524 mErrorHandler = errorHandler;
Svetoslav Ganov8c35dcc2016-06-17 15:27:43 -07001525 mCurrentGeneration = generation;
Svet Ganov53a441c2016-04-19 19:38:00 -07001526 }
1527
1528 public boolean isGenerationChanged() {
1529 final int currentGeneration = readCurrentGeneration();
1530 if (currentGeneration >= 0) {
1531 if (currentGeneration == mCurrentGeneration) {
1532 return false;
1533 }
1534 mCurrentGeneration = currentGeneration;
1535 }
1536 return true;
1537 }
1538
1539 private int readCurrentGeneration() {
1540 try {
1541 return mArray.get(mIndex);
1542 } catch (IOException e) {
1543 Log.e(TAG, "Error getting current generation", e);
Svetoslav Ganov04df7382016-05-10 18:55:47 -07001544 if (mErrorHandler != null) {
1545 mErrorHandler.run();
1546 }
Svet Ganov53a441c2016-04-19 19:38:00 -07001547 }
1548 return -1;
1549 }
Svetoslav Ganov04df7382016-05-10 18:55:47 -07001550
1551 public void destroy() {
1552 try {
1553 mArray.close();
1554 } catch (IOException e) {
1555 Log.e(TAG, "Error closing backing array", e);
1556 if (mErrorHandler != null) {
1557 mErrorHandler.run();
1558 }
1559 }
1560 }
Svet Ganov53a441c2016-04-19 19:38:00 -07001561 }
1562
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001563 // Thread-safe.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001564 private static class NameValueCache {
Svet Ganov53a441c2016-04-19 19:38:00 -07001565 private static final boolean DEBUG = false;
1566
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001567 private final Uri mUri;
1568
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001569 private static final String[] SELECT_VALUE =
1570 new String[] { Settings.NameValueTable.VALUE };
1571 private static final String NAME_EQ_PLACEHOLDER = "name=?";
1572
1573 // Must synchronize on 'this' to access mValues and mValuesVersion.
Dan Egnor799f7212009-11-24 16:24:44 -08001574 private final HashMap<String, String> mValues = new HashMap<String, String>();
Dan Egnor799f7212009-11-24 16:24:44 -08001575
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001576 // Initially null; set lazily and held forever. Synchronized on 'this'.
1577 private IContentProvider mContentProvider = null;
1578
1579 // The method we'll call (or null, to not use) on the provider
1580 // for the fast path of retrieving settings.
Christopher Tate06efb532012-08-24 15:29:27 -07001581 private final String mCallGetCommand;
1582 private final String mCallSetCommand;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001583
Svet Ganov53a441c2016-04-19 19:38:00 -07001584 @GuardedBy("this")
1585 private GenerationTracker mGenerationTracker;
1586
1587 public NameValueCache(Uri uri, String getCommand, String setCommand) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001588 mUri = uri;
Christopher Tate06efb532012-08-24 15:29:27 -07001589 mCallGetCommand = getCommand;
1590 mCallSetCommand = setCommand;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001591 }
1592
Christopher Tate06efb532012-08-24 15:29:27 -07001593 private IContentProvider lazyGetProvider(ContentResolver cr) {
1594 IContentProvider cp = null;
Svet Ganov51b83952016-07-06 12:16:53 -07001595 synchronized (NameValueCache.this) {
Christopher Tate06efb532012-08-24 15:29:27 -07001596 cp = mContentProvider;
1597 if (cp == null) {
1598 cp = mContentProvider = cr.acquireProvider(mUri.getAuthority());
1599 }
1600 }
1601 return cp;
1602 }
1603
1604 public boolean putStringForUser(ContentResolver cr, String name, String value,
1605 final int userHandle) {
1606 try {
1607 Bundle arg = new Bundle();
1608 arg.putString(Settings.NameValueTable.VALUE, value);
Christopher Tated5fe1472012-09-10 15:48:38 -07001609 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
Christopher Tate06efb532012-08-24 15:29:27 -07001610 IContentProvider cp = lazyGetProvider(cr);
Dianne Hackborn35654b62013-01-14 17:38:02 -08001611 cp.call(cr.getPackageName(), mCallSetCommand, name, arg);
Christopher Tate06efb532012-08-24 15:29:27 -07001612 } catch (RemoteException e) {
1613 Log.w(TAG, "Can't set key " + name + " in " + mUri, e);
1614 return false;
1615 }
1616 return true;
1617 }
1618
Christopher Tate06efb532012-08-24 15:29:27 -07001619 public String getStringForUser(ContentResolver cr, String name, final int userHandle) {
Christopher Tate78d2a662012-09-13 16:19:44 -07001620 final boolean isSelf = (userHandle == UserHandle.myUserId());
1621 if (isSelf) {
Svet Ganov51b83952016-07-06 12:16:53 -07001622 synchronized (NameValueCache.this) {
Svet Ganov53a441c2016-04-19 19:38:00 -07001623 if (mGenerationTracker != null) {
1624 if (mGenerationTracker.isGenerationChanged()) {
1625 if (DEBUG) {
1626 Log.i(TAG, "Generation changed for type:"
1627 + mUri.getPath() + " in package:"
1628 + cr.getPackageName() +" and user:" + userHandle);
1629 }
1630 mValues.clear();
1631 } else if (mValues.containsKey(name)) {
1632 return mValues.get(name);
Christopher Tate78d2a662012-09-13 16:19:44 -07001633 }
Christopher Tate78d2a662012-09-13 16:19:44 -07001634 }
Dan Egnor799f7212009-11-24 16:24:44 -08001635 }
Christopher Tate78d2a662012-09-13 16:19:44 -07001636 } else {
1637 if (LOCAL_LOGV) Log.v(TAG, "get setting for user " + userHandle
1638 + " by user " + UserHandle.myUserId() + " so skipping cache");
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001639 }
Dan Egnor799f7212009-11-24 16:24:44 -08001640
Christopher Tate06efb532012-08-24 15:29:27 -07001641 IContentProvider cp = lazyGetProvider(cr);
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001642
1643 // Try the fast path first, not using query(). If this
1644 // fails (alternate Settings provider that doesn't support
1645 // this interface?) then we fall back to the query/table
1646 // interface.
Christopher Tate06efb532012-08-24 15:29:27 -07001647 if (mCallGetCommand != null) {
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001648 try {
Christopher Tate06efb532012-08-24 15:29:27 -07001649 Bundle args = null;
Christopher Tate5e08af02012-09-21 17:17:22 -07001650 if (!isSelf) {
Christopher Tate06efb532012-08-24 15:29:27 -07001651 args = new Bundle();
1652 args.putInt(CALL_METHOD_USER_KEY, userHandle);
1653 }
Svet Ganov53a441c2016-04-19 19:38:00 -07001654 boolean needsGenerationTracker = false;
Svet Ganov51b83952016-07-06 12:16:53 -07001655 synchronized (NameValueCache.this) {
Svet Ganov53a441c2016-04-19 19:38:00 -07001656 if (isSelf && mGenerationTracker == null) {
1657 needsGenerationTracker = true;
1658 if (args == null) {
1659 args = new Bundle();
1660 }
1661 args.putString(CALL_METHOD_TRACK_GENERATION_KEY, null);
1662 if (DEBUG) {
1663 Log.i(TAG, "Requested generation tracker for type: "+ mUri.getPath()
1664 + " in package:" + cr.getPackageName() +" and user:"
1665 + userHandle);
1666 }
1667 }
1668 }
Dianne Hackborn35654b62013-01-14 17:38:02 -08001669 Bundle b = cp.call(cr.getPackageName(), mCallGetCommand, name, args);
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001670 if (b != null) {
Svet Ganov53a441c2016-04-19 19:38:00 -07001671 String value = b.getString(Settings.NameValueTable.VALUE);
Christopher Tate78d2a662012-09-13 16:19:44 -07001672 // Don't update our cache for reads of other users' data
1673 if (isSelf) {
Svet Ganov51b83952016-07-06 12:16:53 -07001674 synchronized (NameValueCache.this) {
Svet Ganov53a441c2016-04-19 19:38:00 -07001675 if (needsGenerationTracker) {
1676 MemoryIntArray array = b.getParcelable(
1677 CALL_METHOD_TRACK_GENERATION_KEY);
1678 final int index = b.getInt(
1679 CALL_METHOD_GENERATION_INDEX_KEY, -1);
1680 if (array != null && index >= 0) {
Svetoslav Ganov8c35dcc2016-06-17 15:27:43 -07001681 final int generation = b.getInt(
1682 CALL_METHOD_GENERATION_KEY, 0);
Svet Ganov53a441c2016-04-19 19:38:00 -07001683 if (DEBUG) {
1684 Log.i(TAG, "Received generation tracker for type:"
1685 + mUri.getPath() + " in package:"
1686 + cr.getPackageName() + " and user:"
1687 + userHandle + " with index:" + index);
1688 }
Svetoslav Ganov04df7382016-05-10 18:55:47 -07001689 mGenerationTracker = new GenerationTracker(array, index,
Svetoslav Ganov8c35dcc2016-06-17 15:27:43 -07001690 generation, () -> {
Svet Ganov51b83952016-07-06 12:16:53 -07001691 synchronized (NameValueCache.this) {
Svetoslav Ganov04df7382016-05-10 18:55:47 -07001692 Log.e(TAG, "Error accessing generation"
1693 + " tracker - removing");
1694 if (mGenerationTracker != null) {
1695 GenerationTracker generationTracker =
1696 mGenerationTracker;
1697 mGenerationTracker = null;
1698 generationTracker.destroy();
1699 mValues.clear();
1700 }
1701 }
1702 });
Svet Ganov53a441c2016-04-19 19:38:00 -07001703 }
1704 }
Christopher Tate78d2a662012-09-13 16:19:44 -07001705 mValues.put(name, value);
1706 }
1707 } else {
1708 if (LOCAL_LOGV) Log.i(TAG, "call-query of user " + userHandle
1709 + " by " + UserHandle.myUserId()
1710 + " so not updating cache");
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001711 }
1712 return value;
1713 }
1714 // If the response Bundle is null, we fall through
1715 // to the query interface below.
1716 } catch (RemoteException e) {
1717 // Not supported by the remote side? Fall through
1718 // to query().
1719 }
1720 }
1721
Dan Egnor799f7212009-11-24 16:24:44 -08001722 Cursor c = null;
1723 try {
Dianne Hackborn35654b62013-01-14 17:38:02 -08001724 c = cp.query(cr.getPackageName(), mUri, SELECT_VALUE, NAME_EQ_PLACEHOLDER,
Jeff Brown75ea64f2012-01-25 19:37:13 -08001725 new String[]{name}, null, null);
Dan Egnor799f7212009-11-24 16:24:44 -08001726 if (c == null) {
1727 Log.w(TAG, "Can't get key " + name + " from " + mUri);
1728 return null;
1729 }
1730
1731 String value = c.moveToNext() ? c.getString(0) : null;
Svet Ganov51b83952016-07-06 12:16:53 -07001732 synchronized (NameValueCache.this) {
Dan Egnor799f7212009-11-24 16:24:44 -08001733 mValues.put(name, value);
1734 }
1735 if (LOCAL_LOGV) {
1736 Log.v(TAG, "cache miss [" + mUri.getLastPathSegment() + "]: " +
1737 name + " = " + (value == null ? "(null)" : value));
1738 }
1739 return value;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001740 } catch (RemoteException e) {
Dan Egnor799f7212009-11-24 16:24:44 -08001741 Log.w(TAG, "Can't get key " + name + " from " + mUri, e);
1742 return null; // Return null, but don't cache it.
1743 } finally {
1744 if (c != null) c.close();
1745 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001746 }
1747 }
1748
1749 /**
Trevor Johns682c24e2016-04-12 10:13:47 -07001750 * Checks if the specified context can draw on top of other apps. As of API
1751 * level 23, an app cannot draw on top of other apps unless it declares the
1752 * {@link android.Manifest.permission#SYSTEM_ALERT_WINDOW} permission in its
1753 * manifest, <em>and</em> the user specifically grants the app this
1754 * capability. To prompt the user to grant this approval, the app must send an
1755 * intent with the action
1756 * {@link android.provider.Settings#ACTION_MANAGE_OVERLAY_PERMISSION}, which
1757 * causes the system to display a permission management screen.
Billy Lau6ad2d662015-07-18 00:26:58 +01001758 *
Trevor Johns682c24e2016-04-12 10:13:47 -07001759 * @param context App context.
1760 * @return true if the specified context can draw on top of other apps, false otherwise
Billy Lau6ad2d662015-07-18 00:26:58 +01001761 */
1762 public static boolean canDrawOverlays(Context context) {
Svet Ganov94ba40172016-04-03 22:04:22 -07001763 return Settings.isCallingPackageAllowedToDrawOverlays(context, Process.myUid(),
1764 context.getOpPackageName(), false);
Billy Lau6ad2d662015-07-18 00:26:58 +01001765 }
1766
1767 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001768 * System settings, containing miscellaneous system preferences. This
1769 * table holds simple name/value pairs. There are convenience
1770 * functions for accessing individual settings entries.
1771 */
1772 public static final class System extends NameValueTable {
Alan Viverette04fd67c2016-04-12 10:54:04 -04001773 private static final float DEFAULT_FONT_SCALE = 1.0f;
1774
Svetoslav683914b2015-01-15 14:22:26 -08001775 /** @hide */
1776 public static interface Validator {
1777 public boolean validate(String value);
1778 }
1779
Dianne Hackborn139748f2012-09-24 11:36:57 -07001780 /**
1781 * The content:// style URL for this table
1782 */
1783 public static final Uri CONTENT_URI =
1784 Uri.parse("content://" + AUTHORITY + "/system");
1785
1786 private static final NameValueCache sNameValueCache = new NameValueCache(
Dianne Hackborn139748f2012-09-24 11:36:57 -07001787 CONTENT_URI,
1788 CALL_METHOD_GET_SYSTEM,
1789 CALL_METHOD_PUT_SYSTEM);
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001790
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001791 private static final HashSet<String> MOVED_TO_SECURE;
1792 static {
1793 MOVED_TO_SECURE = new HashSet<String>(30);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001794 MOVED_TO_SECURE.add(Secure.ANDROID_ID);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001795 MOVED_TO_SECURE.add(Secure.HTTP_PROXY);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001796 MOVED_TO_SECURE.add(Secure.LOCATION_PROVIDERS_ALLOWED);
Danielle Millett925a7d82012-03-19 18:02:20 -04001797 MOVED_TO_SECURE.add(Secure.LOCK_BIOMETRIC_WEAK_FLAGS);
Amith Yamasani156c4352010-03-05 17:10:03 -08001798 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_ENABLED);
1799 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_VISIBLE);
1800 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001801 MOVED_TO_SECURE.add(Secure.LOGGING_ID);
1802 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_ENABLED);
1803 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_LAST_UPDATE);
1804 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_REDIRECT_URL);
1805 MOVED_TO_SECURE.add(Secure.SETTINGS_CLASSNAME);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001806 MOVED_TO_SECURE.add(Secure.USE_GOOGLE_MAIL);
1807 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
1808 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
1809 MOVED_TO_SECURE.add(Secure.WIFI_NUM_OPEN_NETWORKS_KEPT);
1810 MOVED_TO_SECURE.add(Secure.WIFI_ON);
1811 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE);
1812 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_AP_COUNT);
1813 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS);
1814 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED);
1815 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS);
1816 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT);
1817 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_MAX_AP_CHECKS);
1818 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ON);
1819 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_COUNT);
1820 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_DELAY_MS);
1821 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS);
Christopher Tateaa036a22014-05-19 16:33:27 -07001822
1823 // At one time in System, then Global, but now back in Secure
1824 MOVED_TO_SECURE.add(Secure.INSTALL_NON_MARKET_APPS);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001825 }
1826
Christopher Tate06efb532012-08-24 15:29:27 -07001827 private static final HashSet<String> MOVED_TO_GLOBAL;
Christopher Tate66488d62012-10-02 11:58:01 -07001828 private static final HashSet<String> MOVED_TO_SECURE_THEN_GLOBAL;
Christopher Tate06efb532012-08-24 15:29:27 -07001829 static {
1830 MOVED_TO_GLOBAL = new HashSet<String>();
Christopher Tate66488d62012-10-02 11:58:01 -07001831 MOVED_TO_SECURE_THEN_GLOBAL = new HashSet<String>();
1832
Christopher Tate92198742012-09-07 12:00:13 -07001833 // these were originally in system but migrated to secure in the past,
1834 // so are duplicated in the Secure.* namespace
Christopher Tate66488d62012-10-02 11:58:01 -07001835 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.ADB_ENABLED);
1836 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.BLUETOOTH_ON);
1837 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DATA_ROAMING);
1838 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DEVICE_PROVISIONED);
Christopher Tate66488d62012-10-02 11:58:01 -07001839 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.USB_MASS_STORAGE_ENABLED);
1840 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.HTTP_PROXY);
Christopher Tate06efb532012-08-24 15:29:27 -07001841
Christopher Tate92198742012-09-07 12:00:13 -07001842 // these are moving directly from system to global
Christopher Tate06efb532012-08-24 15:29:27 -07001843 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_ON);
1844 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_RADIOS);
1845 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS);
1846 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME);
1847 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME_ZONE);
1848 MOVED_TO_GLOBAL.add(Settings.Global.CAR_DOCK_SOUND);
1849 MOVED_TO_GLOBAL.add(Settings.Global.CAR_UNDOCK_SOUND);
1850 MOVED_TO_GLOBAL.add(Settings.Global.DESK_DOCK_SOUND);
1851 MOVED_TO_GLOBAL.add(Settings.Global.DESK_UNDOCK_SOUND);
1852 MOVED_TO_GLOBAL.add(Settings.Global.DOCK_SOUNDS_ENABLED);
1853 MOVED_TO_GLOBAL.add(Settings.Global.LOCK_SOUND);
1854 MOVED_TO_GLOBAL.add(Settings.Global.UNLOCK_SOUND);
1855 MOVED_TO_GLOBAL.add(Settings.Global.LOW_BATTERY_SOUND);
1856 MOVED_TO_GLOBAL.add(Settings.Global.POWER_SOUNDS_ENABLED);
1857 MOVED_TO_GLOBAL.add(Settings.Global.STAY_ON_WHILE_PLUGGED_IN);
1858 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SLEEP_POLICY);
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07001859 MOVED_TO_GLOBAL.add(Settings.Global.MODE_RINGER);
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001860 MOVED_TO_GLOBAL.add(Settings.Global.WINDOW_ANIMATION_SCALE);
1861 MOVED_TO_GLOBAL.add(Settings.Global.TRANSITION_ANIMATION_SCALE);
1862 MOVED_TO_GLOBAL.add(Settings.Global.ANIMATOR_DURATION_SCALE);
1863 MOVED_TO_GLOBAL.add(Settings.Global.FANCY_IME_ANIMATIONS);
1864 MOVED_TO_GLOBAL.add(Settings.Global.COMPATIBILITY_MODE);
1865 MOVED_TO_GLOBAL.add(Settings.Global.EMERGENCY_TONE);
1866 MOVED_TO_GLOBAL.add(Settings.Global.CALL_AUTO_RETRY);
1867 MOVED_TO_GLOBAL.add(Settings.Global.DEBUG_APP);
1868 MOVED_TO_GLOBAL.add(Settings.Global.WAIT_FOR_DEBUGGER);
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001869 MOVED_TO_GLOBAL.add(Settings.Global.ALWAYS_FINISH_ACTIVITIES);
Geremy Condraa0735112013-03-26 21:49:26 -07001870 MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_CONTENT_URL);
1871 MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_METADATA_URL);
1872 MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_CONTENT_URL);
1873 MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_METADATA_URL);
1874 MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_CONTENT_URL);
1875 MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_METADATA_URL);
1876 MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_CONTENT_URL);
1877 MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_METADATA_URL);
Christopher Tate06efb532012-08-24 15:29:27 -07001878 }
1879
Svetoslav683914b2015-01-15 14:22:26 -08001880 private static final Validator sBooleanValidator =
1881 new DiscreteValueValidator(new String[] {"0", "1"});
1882
1883 private static final Validator sNonNegativeIntegerValidator = new Validator() {
1884 @Override
1885 public boolean validate(String value) {
1886 try {
1887 return Integer.parseInt(value) >= 0;
1888 } catch (NumberFormatException e) {
1889 return false;
1890 }
1891 }
1892 };
1893
Svetoslav683914b2015-01-15 14:22:26 -08001894 private static final Validator sUriValidator = new Validator() {
1895 @Override
1896 public boolean validate(String value) {
1897 try {
1898 Uri.decode(value);
1899 return true;
1900 } catch (IllegalArgumentException e) {
1901 return false;
1902 }
1903 }
1904 };
1905
1906 private static final Validator sLenientIpAddressValidator = new Validator() {
1907 private static final int MAX_IPV6_LENGTH = 45;
1908
1909 @Override
1910 public boolean validate(String value) {
1911 return value.length() <= MAX_IPV6_LENGTH;
1912 }
1913 };
1914
Christopher Tate66488d62012-10-02 11:58:01 -07001915 /** @hide */
Svetoslav683914b2015-01-15 14:22:26 -08001916 public static void getMovedToGlobalSettings(Set<String> outKeySet) {
Christopher Tate66488d62012-10-02 11:58:01 -07001917 outKeySet.addAll(MOVED_TO_GLOBAL);
1918 outKeySet.addAll(MOVED_TO_SECURE_THEN_GLOBAL);
1919 }
1920
1921 /** @hide */
Svetoslav683914b2015-01-15 14:22:26 -08001922 public static void getMovedToSecureSettings(Set<String> outKeySet) {
1923 outKeySet.addAll(MOVED_TO_SECURE);
1924 }
1925
1926 /** @hide */
Christopher Tate66488d62012-10-02 11:58:01 -07001927 public static void getNonLegacyMovedKeys(HashSet<String> outKeySet) {
1928 outKeySet.addAll(MOVED_TO_GLOBAL);
1929 }
1930
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001931 /**
1932 * Look up a name in the database.
1933 * @param resolver to access the database with
1934 * @param name to look up in the table
1935 * @return the corresponding value, or null if not present
1936 */
Dianne Hackborn139748f2012-09-24 11:36:57 -07001937 public static String getString(ContentResolver resolver, String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07001938 return getStringForUser(resolver, name, UserHandle.myUserId());
1939 }
1940
1941 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -07001942 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -07001943 int userHandle) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001944 if (MOVED_TO_SECURE.contains(name)) {
1945 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1946 + " to android.provider.Settings.Secure, returning read-only value.");
Christopher Tate06efb532012-08-24 15:29:27 -07001947 return Secure.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001948 }
Christopher Tate66488d62012-10-02 11:58:01 -07001949 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07001950 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1951 + " to android.provider.Settings.Global, returning read-only value.");
1952 return Global.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001953 }
Christopher Tate06efb532012-08-24 15:29:27 -07001954 return sNameValueCache.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001955 }
1956
1957 /**
1958 * Store a name/value pair into the database.
1959 * @param resolver to access the database with
1960 * @param name to store
1961 * @param value to associate with the name
1962 * @return true if the value was set, false on database errors
1963 */
1964 public static boolean putString(ContentResolver resolver, String name, String value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001965 return putStringForUser(resolver, name, value, UserHandle.myUserId());
1966 }
1967
1968 /** @hide */
1969 public static boolean putStringForUser(ContentResolver resolver, String name, String value,
1970 int userHandle) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001971 if (MOVED_TO_SECURE.contains(name)) {
1972 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1973 + " to android.provider.Settings.Secure, value is unchanged.");
1974 return false;
1975 }
Christopher Tate66488d62012-10-02 11:58:01 -07001976 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07001977 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1978 + " to android.provider.Settings.Global, value is unchanged.");
1979 return false;
1980 }
Christopher Tate06efb532012-08-24 15:29:27 -07001981 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001982 }
1983
1984 /**
1985 * Construct the content URI for a particular name/value pair,
1986 * useful for monitoring changes with a ContentObserver.
1987 * @param name to look up in the table
1988 * @return the corresponding content URI, or null if not present
1989 */
1990 public static Uri getUriFor(String name) {
1991 if (MOVED_TO_SECURE.contains(name)) {
1992 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1993 + " to android.provider.Settings.Secure, returning Secure URI.");
1994 return Secure.getUriFor(Secure.CONTENT_URI, name);
1995 }
Christopher Tate66488d62012-10-02 11:58:01 -07001996 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07001997 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1998 + " to android.provider.Settings.Global, returning read-only global URI.");
1999 return Global.getUriFor(Global.CONTENT_URI, name);
2000 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002001 return getUriFor(CONTENT_URI, name);
2002 }
2003
2004 /**
2005 * Convenience function for retrieving a single system settings value
2006 * as an integer. Note that internally setting values are always
2007 * stored as strings; this function converts the string to an integer
2008 * for you. The default value will be returned if the setting is
2009 * not defined or not an integer.
2010 *
2011 * @param cr The ContentResolver to access.
2012 * @param name The name of the setting to retrieve.
2013 * @param def Value to return if the setting is not defined.
2014 *
2015 * @return The setting's current value, or 'def' if it is not defined
2016 * or not a valid integer.
2017 */
2018 public static int getInt(ContentResolver cr, String name, int def) {
Christopher Tate06efb532012-08-24 15:29:27 -07002019 return getIntForUser(cr, name, def, UserHandle.myUserId());
2020 }
2021
2022 /** @hide */
2023 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
2024 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002025 try {
2026 return v != null ? Integer.parseInt(v) : def;
2027 } catch (NumberFormatException e) {
2028 return def;
2029 }
2030 }
2031
2032 /**
2033 * Convenience function for retrieving a single system settings value
2034 * as an integer. Note that internally setting values are always
2035 * stored as strings; this function converts the string to an integer
2036 * for you.
2037 * <p>
2038 * This version does not take a default value. If the setting has not
2039 * been set, or the string value is not a number,
2040 * it throws {@link SettingNotFoundException}.
2041 *
2042 * @param cr The ContentResolver to access.
2043 * @param name The name of the setting to retrieve.
2044 *
2045 * @throws SettingNotFoundException Thrown if a setting by the given
2046 * name can't be found or the setting value is not an integer.
2047 *
2048 * @return The setting's current value.
2049 */
2050 public static int getInt(ContentResolver cr, String name)
2051 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07002052 return getIntForUser(cr, name, UserHandle.myUserId());
2053 }
2054
2055 /** @hide */
2056 public static int getIntForUser(ContentResolver cr, String name, int userHandle)
2057 throws SettingNotFoundException {
2058 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002059 try {
2060 return Integer.parseInt(v);
2061 } catch (NumberFormatException e) {
2062 throw new SettingNotFoundException(name);
2063 }
2064 }
2065
2066 /**
2067 * Convenience function for updating a single settings value as an
2068 * integer. This will either create a new entry in the table if the
2069 * given name does not exist, or modify the value of the existing row
2070 * with that name. Note that internally setting values are always
2071 * stored as strings, so this function converts the given value to a
2072 * string before storing it.
2073 *
2074 * @param cr The ContentResolver to access.
2075 * @param name The name of the setting to modify.
2076 * @param value The new value for the setting.
2077 * @return true if the value was set, false on database errors
2078 */
2079 public static boolean putInt(ContentResolver cr, String name, int value) {
Christopher Tate06efb532012-08-24 15:29:27 -07002080 return putIntForUser(cr, name, value, UserHandle.myUserId());
2081 }
2082
2083 /** @hide */
2084 public static boolean putIntForUser(ContentResolver cr, String name, int value,
2085 int userHandle) {
2086 return putStringForUser(cr, name, Integer.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002087 }
2088
2089 /**
2090 * Convenience function for retrieving a single system settings value
2091 * as a {@code long}. Note that internally setting values are always
2092 * stored as strings; this function converts the string to a {@code long}
2093 * for you. The default value will be returned if the setting is
2094 * not defined or not a {@code long}.
2095 *
2096 * @param cr The ContentResolver to access.
2097 * @param name The name of the setting to retrieve.
2098 * @param def Value to return if the setting is not defined.
2099 *
2100 * @return The setting's current value, or 'def' if it is not defined
2101 * or not a valid {@code long}.
2102 */
2103 public static long getLong(ContentResolver cr, String name, long def) {
Christopher Tate06efb532012-08-24 15:29:27 -07002104 return getLongForUser(cr, name, def, UserHandle.myUserId());
2105 }
2106
2107 /** @hide */
2108 public static long getLongForUser(ContentResolver cr, String name, long def,
2109 int userHandle) {
2110 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002111 long value;
2112 try {
2113 value = valString != null ? Long.parseLong(valString) : def;
2114 } catch (NumberFormatException e) {
2115 value = def;
2116 }
2117 return value;
2118 }
2119
2120 /**
2121 * Convenience function for retrieving a single system settings value
2122 * as a {@code long}. Note that internally setting values are always
2123 * stored as strings; this function converts the string to a {@code long}
2124 * for you.
2125 * <p>
2126 * This version does not take a default value. If the setting has not
2127 * been set, or the string value is not a number,
2128 * it throws {@link SettingNotFoundException}.
2129 *
2130 * @param cr The ContentResolver to access.
2131 * @param name The name of the setting to retrieve.
2132 *
2133 * @return The setting's current value.
2134 * @throws SettingNotFoundException Thrown if a setting by the given
2135 * name can't be found or the setting value is not an integer.
2136 */
2137 public static long getLong(ContentResolver cr, String name)
2138 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07002139 return getLongForUser(cr, name, UserHandle.myUserId());
2140 }
2141
2142 /** @hide */
2143 public static long getLongForUser(ContentResolver cr, String name, int userHandle)
2144 throws SettingNotFoundException {
2145 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002146 try {
2147 return Long.parseLong(valString);
2148 } catch (NumberFormatException e) {
2149 throw new SettingNotFoundException(name);
2150 }
2151 }
2152
2153 /**
2154 * Convenience function for updating a single settings value as a long
2155 * integer. This will either create a new entry in the table if the
2156 * given name does not exist, or modify the value of the existing row
2157 * with that name. Note that internally setting values are always
2158 * stored as strings, so this function converts the given value to a
2159 * string before storing it.
2160 *
2161 * @param cr The ContentResolver to access.
2162 * @param name The name of the setting to modify.
2163 * @param value The new value for the setting.
2164 * @return true if the value was set, false on database errors
2165 */
2166 public static boolean putLong(ContentResolver cr, String name, long value) {
Christopher Tate06efb532012-08-24 15:29:27 -07002167 return putLongForUser(cr, name, value, UserHandle.myUserId());
2168 }
2169
2170 /** @hide */
2171 public static boolean putLongForUser(ContentResolver cr, String name, long value,
2172 int userHandle) {
2173 return putStringForUser(cr, name, Long.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002174 }
2175
2176 /**
2177 * Convenience function for retrieving a single system settings value
2178 * as a floating point number. Note that internally setting values are
2179 * always stored as strings; this function converts the string to an
2180 * float for you. The default value will be returned if the setting
2181 * is not defined or not a valid float.
2182 *
2183 * @param cr The ContentResolver to access.
2184 * @param name The name of the setting to retrieve.
2185 * @param def Value to return if the setting is not defined.
2186 *
2187 * @return The setting's current value, or 'def' if it is not defined
2188 * or not a valid float.
2189 */
2190 public static float getFloat(ContentResolver cr, String name, float def) {
Christopher Tate06efb532012-08-24 15:29:27 -07002191 return getFloatForUser(cr, name, def, UserHandle.myUserId());
2192 }
2193
2194 /** @hide */
2195 public static float getFloatForUser(ContentResolver cr, String name, float def,
2196 int userHandle) {
2197 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002198 try {
2199 return v != null ? Float.parseFloat(v) : def;
2200 } catch (NumberFormatException e) {
2201 return def;
2202 }
2203 }
2204
2205 /**
2206 * Convenience function for retrieving a single system settings value
2207 * as a float. Note that internally setting values are always
2208 * stored as strings; this function converts the string to a float
2209 * for you.
2210 * <p>
2211 * This version does not take a default value. If the setting has not
2212 * been set, or the string value is not a number,
2213 * it throws {@link SettingNotFoundException}.
2214 *
2215 * @param cr The ContentResolver to access.
2216 * @param name The name of the setting to retrieve.
2217 *
2218 * @throws SettingNotFoundException Thrown if a setting by the given
2219 * name can't be found or the setting value is not a float.
2220 *
2221 * @return The setting's current value.
2222 */
2223 public static float getFloat(ContentResolver cr, String name)
2224 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07002225 return getFloatForUser(cr, name, UserHandle.myUserId());
2226 }
2227
2228 /** @hide */
2229 public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
2230 throws SettingNotFoundException {
2231 String v = getStringForUser(cr, name, userHandle);
Brian Muramatsue1d46982010-12-06 17:34:20 -08002232 if (v == null) {
2233 throw new SettingNotFoundException(name);
2234 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002235 try {
2236 return Float.parseFloat(v);
2237 } catch (NumberFormatException e) {
2238 throw new SettingNotFoundException(name);
2239 }
2240 }
2241
2242 /**
2243 * Convenience function for updating a single settings value as a
2244 * floating point number. This will either create a new entry in the
2245 * table if the given name does not exist, or modify the value of the
2246 * existing row with that name. Note that internally setting values
2247 * are always stored as strings, so this function converts the given
2248 * value to a string before storing it.
2249 *
2250 * @param cr The ContentResolver to access.
2251 * @param name The name of the setting to modify.
2252 * @param value The new value for the setting.
2253 * @return true if the value was set, false on database errors
2254 */
2255 public static boolean putFloat(ContentResolver cr, String name, float value) {
Christopher Tate06efb532012-08-24 15:29:27 -07002256 return putFloatForUser(cr, name, value, UserHandle.myUserId());
2257 }
2258
2259 /** @hide */
2260 public static boolean putFloatForUser(ContentResolver cr, String name, float value,
2261 int userHandle) {
2262 return putStringForUser(cr, name, Float.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002263 }
2264
2265 /**
2266 * Convenience function to read all of the current
2267 * configuration-related settings into a
2268 * {@link Configuration} object.
2269 *
2270 * @param cr The ContentResolver to access.
2271 * @param outConfig Where to place the configuration settings.
2272 */
2273 public static void getConfiguration(ContentResolver cr, Configuration outConfig) {
Seigo Nonakaea906b32016-05-18 17:33:04 +09002274 adjustConfigurationForUser(cr, outConfig, UserHandle.myUserId(),
2275 false /* updateSettingsIfEmpty */);
Christopher Tate06efb532012-08-24 15:29:27 -07002276 }
2277
2278 /** @hide */
Seigo Nonakaea906b32016-05-18 17:33:04 +09002279 public static void adjustConfigurationForUser(ContentResolver cr, Configuration outConfig,
2280 int userHandle, boolean updateSettingsIfEmpty) {
Christopher Tate06efb532012-08-24 15:29:27 -07002281 outConfig.fontScale = Settings.System.getFloatForUser(
Alan Viverette04fd67c2016-04-12 10:54:04 -04002282 cr, FONT_SCALE, DEFAULT_FONT_SCALE, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002283 if (outConfig.fontScale < 0) {
Alan Viverette04fd67c2016-04-12 10:54:04 -04002284 outConfig.fontScale = DEFAULT_FONT_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002285 }
Seigo Nonakaea906b32016-05-18 17:33:04 +09002286
2287 final String localeValue =
2288 Settings.System.getStringForUser(cr, SYSTEM_LOCALES, userHandle);
2289 if (localeValue != null) {
2290 outConfig.setLocales(LocaleList.forLanguageTags(localeValue));
2291 } else {
2292 // Do not update configuration with emtpy settings since we need to take over the
2293 // locale list of previous user if the settings value is empty. This happens when a
2294 // new user is created.
2295
2296 if (updateSettingsIfEmpty) {
2297 // Make current configuration persistent. This is necessary the first time a
2298 // user log in. At the first login, the configuration settings are empty, so we
2299 // need to store the adjusted configuration as the initial settings.
2300 Settings.System.putStringForUser(
2301 cr, SYSTEM_LOCALES, outConfig.getLocales().toLanguageTags(),
2302 userHandle);
2303 }
2304 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002305 }
2306
2307 /**
Dianne Hackborn31ca8542011-07-19 14:58:28 -07002308 * @hide Erase the fields in the Configuration that should be applied
2309 * by the settings.
2310 */
2311 public static void clearConfiguration(Configuration inoutConfig) {
2312 inoutConfig.fontScale = 0;
Seigo Nonakad4031512016-03-17 21:18:53 +09002313 if (!inoutConfig.userSetLocale && !inoutConfig.getLocales().isEmpty()) {
Seigo Nonakabd5cac62016-05-13 15:11:37 +09002314 inoutConfig.clearLocales();
Seigo Nonakabd5cbdd2016-01-25 19:40:28 +09002315 }
Dianne Hackborn31ca8542011-07-19 14:58:28 -07002316 }
Narayan Kamath6d632962011-08-24 11:51:37 +01002317
Dianne Hackborn31ca8542011-07-19 14:58:28 -07002318 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002319 * Convenience function to write a batch of configuration-related
2320 * settings from a {@link Configuration} object.
2321 *
2322 * @param cr The ContentResolver to access.
2323 * @param config The settings to write.
2324 * @return true if the values were set, false on database errors
2325 */
2326 public static boolean putConfiguration(ContentResolver cr, Configuration config) {
Christopher Tate06efb532012-08-24 15:29:27 -07002327 return putConfigurationForUser(cr, config, UserHandle.myUserId());
2328 }
2329
2330 /** @hide */
2331 public static boolean putConfigurationForUser(ContentResolver cr, Configuration config,
2332 int userHandle) {
Seigo Nonakabd5cbdd2016-01-25 19:40:28 +09002333 return Settings.System.putFloatForUser(cr, FONT_SCALE, config.fontScale, userHandle) &&
2334 Settings.System.putStringForUser(
2335 cr, SYSTEM_LOCALES, config.getLocales().toLanguageTags(), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002336 }
2337
Dianne Hackbornb8b11a02010-03-10 15:53:11 -08002338 /** @hide */
2339 public static boolean hasInterestingConfigurationChanges(int changes) {
Seigo Nonakabd5cbdd2016-01-25 19:40:28 +09002340 return (changes & ActivityInfo.CONFIG_FONT_SCALE) != 0 ||
2341 (changes & ActivityInfo.CONFIG_LOCALE) != 0;
Dianne Hackbornb8b11a02010-03-10 15:53:11 -08002342 }
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07002343
Christopher Tate06efb532012-08-24 15:29:27 -07002344 /** @deprecated - Do not use */
2345 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002346 public static boolean getShowGTalkServiceStatus(ContentResolver cr) {
Christopher Tate06efb532012-08-24 15:29:27 -07002347 return getShowGTalkServiceStatusForUser(cr, UserHandle.myUserId());
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002348 }
2349
Christopher Tate06efb532012-08-24 15:29:27 -07002350 /**
2351 * @hide
2352 * @deprecated - Do not use
2353 */
2354 public static boolean getShowGTalkServiceStatusForUser(ContentResolver cr,
2355 int userHandle) {
2356 return getIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, 0, userHandle) != 0;
2357 }
2358
2359 /** @deprecated - Do not use */
2360 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002361 public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag) {
Christopher Tatec8c08382012-09-19 17:18:18 -07002362 setShowGTalkServiceStatusForUser(cr, flag, UserHandle.myUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07002363 }
2364
2365 /**
2366 * @hide
2367 * @deprecated - Do not use
2368 */
2369 @Deprecated
2370 public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean flag,
2371 int userHandle) {
2372 putIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, flag ? 1 : 0, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002373 }
2374
Svetoslav683914b2015-01-15 14:22:26 -08002375 private static final class DiscreteValueValidator implements Validator {
2376 private final String[] mValues;
2377
2378 public DiscreteValueValidator(String[] values) {
2379 mValues = values;
2380 }
2381
Svetoslav1b71ea92015-02-17 18:20:29 -08002382 @Override
Svetoslav683914b2015-01-15 14:22:26 -08002383 public boolean validate(String value) {
2384 return ArrayUtils.contains(mValues, value);
2385 }
2386 }
2387
2388 private static final class InclusiveIntegerRangeValidator implements Validator {
2389 private final int mMin;
2390 private final int mMax;
2391
2392 public InclusiveIntegerRangeValidator(int min, int max) {
2393 mMin = min;
2394 mMax = max;
2395 }
2396
Svetoslav1b71ea92015-02-17 18:20:29 -08002397 @Override
Svetoslav683914b2015-01-15 14:22:26 -08002398 public boolean validate(String value) {
2399 try {
2400 final int intValue = Integer.parseInt(value);
2401 return intValue >= mMin && intValue <= mMax;
2402 } catch (NumberFormatException e) {
2403 return false;
2404 }
2405 }
2406 }
2407
2408 private static final class InclusiveFloatRangeValidator implements Validator {
2409 private final float mMin;
2410 private final float mMax;
2411
2412 public InclusiveFloatRangeValidator(float min, float max) {
2413 mMin = min;
2414 mMax = max;
2415 }
2416
Svetoslav1b71ea92015-02-17 18:20:29 -08002417 @Override
Svetoslav683914b2015-01-15 14:22:26 -08002418 public boolean validate(String value) {
2419 try {
2420 final float floatValue = Float.parseFloat(value);
2421 return floatValue >= mMin && floatValue <= mMax;
2422 } catch (NumberFormatException e) {
2423 return false;
2424 }
2425 }
2426 }
2427
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002428 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002429 * @deprecated Use {@link android.provider.Settings.Global#STAY_ON_WHILE_PLUGGED_IN} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002430 */
Christopher Tate06efb532012-08-24 15:29:27 -07002431 @Deprecated
2432 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 -08002433
2434 /**
2435 * What happens when the user presses the end call button if they're not
2436 * on a call.<br/>
2437 * <b>Values:</b><br/>
2438 * 0 - The end button does nothing.<br/>
2439 * 1 - The end button goes to the home screen.<br/>
2440 * 2 - The end button puts the device to sleep and locks the keyguard.<br/>
2441 * 3 - The end button goes to the home screen. If the user is already on the
2442 * home screen, it puts the device to sleep.
2443 */
2444 public static final String END_BUTTON_BEHAVIOR = "end_button_behavior";
2445
Svetoslav683914b2015-01-15 14:22:26 -08002446 private static final Validator END_BUTTON_BEHAVIOR_VALIDATOR =
2447 new InclusiveIntegerRangeValidator(0, 3);
2448
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002449 /**
David Brown458e8062010-03-08 21:52:11 -08002450 * END_BUTTON_BEHAVIOR value for "go home".
2451 * @hide
2452 */
2453 public static final int END_BUTTON_BEHAVIOR_HOME = 0x1;
2454
2455 /**
2456 * END_BUTTON_BEHAVIOR value for "go to sleep".
2457 * @hide
2458 */
2459 public static final int END_BUTTON_BEHAVIOR_SLEEP = 0x2;
2460
2461 /**
2462 * END_BUTTON_BEHAVIOR default value.
2463 * @hide
2464 */
2465 public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_SLEEP;
2466
2467 /**
Joe Onorato9cdffa12011-04-06 18:27:27 -07002468 * Is advanced settings mode turned on. 0 == no, 1 == yes
2469 * @hide
2470 */
2471 public static final String ADVANCED_SETTINGS = "advanced_settings";
2472
Svetoslav683914b2015-01-15 14:22:26 -08002473 private static final Validator ADVANCED_SETTINGS_VALIDATOR = sBooleanValidator;
2474
Joe Onorato9cdffa12011-04-06 18:27:27 -07002475 /**
2476 * ADVANCED_SETTINGS default value.
2477 * @hide
2478 */
2479 public static final int ADVANCED_SETTINGS_DEFAULT = 0;
2480
2481 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002482 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002483 */
Christopher Tate06efb532012-08-24 15:29:27 -07002484 @Deprecated
2485 public static final String AIRPLANE_MODE_ON = Global.AIRPLANE_MODE_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002486
2487 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002488 * @deprecated Use {@link android.provider.Settings.Global#RADIO_BLUETOOTH} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002489 */
Christopher Tate06efb532012-08-24 15:29:27 -07002490 @Deprecated
2491 public static final String RADIO_BLUETOOTH = Global.RADIO_BLUETOOTH;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002492
2493 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002494 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIFI} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002495 */
Christopher Tate06efb532012-08-24 15:29:27 -07002496 @Deprecated
2497 public static final String RADIO_WIFI = Global.RADIO_WIFI;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002498
Robert Greenwalt8588e472011-11-08 10:12:25 -08002499 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002500 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIMAX} instead
Robert Greenwalt8588e472011-11-08 10:12:25 -08002501 * {@hide}
2502 */
Christopher Tate06efb532012-08-24 15:29:27 -07002503 @Deprecated
2504 public static final String RADIO_WIMAX = Global.RADIO_WIMAX;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002505
2506 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002507 * @deprecated Use {@link android.provider.Settings.Global#RADIO_CELL} instead
Nick Pelly8d32a012011-08-09 07:03:49 -07002508 */
Christopher Tate06efb532012-08-24 15:29:27 -07002509 @Deprecated
2510 public static final String RADIO_CELL = Global.RADIO_CELL;
Nick Pelly8d32a012011-08-09 07:03:49 -07002511
2512 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002513 * @deprecated Use {@link android.provider.Settings.Global#RADIO_NFC} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002514 */
Christopher Tate06efb532012-08-24 15:29:27 -07002515 @Deprecated
2516 public static final String RADIO_NFC = Global.RADIO_NFC;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002517
2518 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002519 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_RADIOS} instead
2520 */
2521 @Deprecated
2522 public static final String AIRPLANE_MODE_RADIOS = Global.AIRPLANE_MODE_RADIOS;
2523
2524 /**
2525 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_TOGGLEABLE_RADIOS} instead
Mike Lockwoodbd5ddf02009-07-29 21:37:14 -07002526 *
2527 * {@hide}
2528 */
Christopher Tate06efb532012-08-24 15:29:27 -07002529 @Deprecated
2530 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS =
2531 Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS;
Mike Lockwoodbd5ddf02009-07-29 21:37:14 -07002532
2533 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002534 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002535 */
Christopher Tate06efb532012-08-24 15:29:27 -07002536 @Deprecated
2537 public static final String WIFI_SLEEP_POLICY = Global.WIFI_SLEEP_POLICY;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002538
2539 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002540 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_DEFAULT} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002541 */
Christopher Tate06efb532012-08-24 15:29:27 -07002542 @Deprecated
2543 public static final int WIFI_SLEEP_POLICY_DEFAULT = Global.WIFI_SLEEP_POLICY_DEFAULT;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002544
2545 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002546 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002547 */
Christopher Tate06efb532012-08-24 15:29:27 -07002548 @Deprecated
2549 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED =
2550 Global.WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002551
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002552 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002553 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002554 */
Christopher Tate06efb532012-08-24 15:29:27 -07002555 @Deprecated
2556 public static final int WIFI_SLEEP_POLICY_NEVER = Global.WIFI_SLEEP_POLICY_NEVER;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002557
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07002558 /**
2559 * @deprecated Use {@link android.provider.Settings.Global#MODE_RINGER} instead
2560 */
2561 @Deprecated
2562 public static final String MODE_RINGER = Global.MODE_RINGER;
2563
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002564 /**
2565 * Whether to use static IP and other static network attributes.
2566 * <p>
2567 * Set to 1 for true and 0 for false.
Jeff Sharkey625239a2012-09-26 22:03:49 -07002568 *
2569 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002570 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002571 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002572 public static final String WIFI_USE_STATIC_IP = "wifi_use_static_ip";
2573
Svetoslav683914b2015-01-15 14:22:26 -08002574 private static final Validator WIFI_USE_STATIC_IP_VALIDATOR = sBooleanValidator;
2575
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002576 /**
2577 * The static IP address.
2578 * <p>
2579 * Example: "192.168.1.51"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002580 *
2581 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002582 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002583 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002584 public static final String WIFI_STATIC_IP = "wifi_static_ip";
2585
Svetoslav683914b2015-01-15 14:22:26 -08002586 private static final Validator WIFI_STATIC_IP_VALIDATOR = sLenientIpAddressValidator;
2587
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002588 /**
2589 * If using static IP, the gateway's IP address.
2590 * <p>
2591 * Example: "192.168.1.1"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002592 *
2593 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002594 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002595 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002596 public static final String WIFI_STATIC_GATEWAY = "wifi_static_gateway";
2597
Svetoslav683914b2015-01-15 14:22:26 -08002598 private static final Validator WIFI_STATIC_GATEWAY_VALIDATOR = sLenientIpAddressValidator;
2599
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002600 /**
2601 * If using static IP, the net mask.
2602 * <p>
2603 * Example: "255.255.255.0"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002604 *
2605 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002606 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002607 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002608 public static final String WIFI_STATIC_NETMASK = "wifi_static_netmask";
2609
Svetoslav683914b2015-01-15 14:22:26 -08002610 private static final Validator WIFI_STATIC_NETMASK_VALIDATOR = sLenientIpAddressValidator;
2611
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002612 /**
2613 * If using static IP, the primary DNS's IP address.
2614 * <p>
2615 * Example: "192.168.1.1"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002616 *
2617 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002618 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002619 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002620 public static final String WIFI_STATIC_DNS1 = "wifi_static_dns1";
2621
Svetoslav683914b2015-01-15 14:22:26 -08002622 private static final Validator WIFI_STATIC_DNS1_VALIDATOR = sLenientIpAddressValidator;
2623
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002624 /**
2625 * If using static IP, the secondary DNS's IP address.
2626 * <p>
2627 * Example: "192.168.1.2"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002628 *
2629 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002630 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002631 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002632 public static final String WIFI_STATIC_DNS2 = "wifi_static_dns2";
2633
Svetoslav683914b2015-01-15 14:22:26 -08002634 private static final Validator WIFI_STATIC_DNS2_VALIDATOR = sLenientIpAddressValidator;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002635
2636 /**
2637 * Determines whether remote devices may discover and/or connect to
2638 * this device.
2639 * <P>Type: INT</P>
2640 * 2 -- discoverable and connectable
2641 * 1 -- connectable but not discoverable
2642 * 0 -- neither connectable nor discoverable
2643 */
2644 public static final String BLUETOOTH_DISCOVERABILITY =
2645 "bluetooth_discoverability";
2646
Svetoslav683914b2015-01-15 14:22:26 -08002647 private static final Validator BLUETOOTH_DISCOVERABILITY_VALIDATOR =
2648 new InclusiveIntegerRangeValidator(0, 2);
2649
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002650 /**
2651 * Bluetooth discoverability timeout. If this value is nonzero, then
2652 * Bluetooth becomes discoverable for a certain number of seconds,
2653 * after which is becomes simply connectable. The value is in seconds.
2654 */
2655 public static final String BLUETOOTH_DISCOVERABILITY_TIMEOUT =
2656 "bluetooth_discoverability_timeout";
2657
Svetoslav683914b2015-01-15 14:22:26 -08002658 private static final Validator BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR =
2659 sNonNegativeIntegerValidator;
2660
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002661 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08002662 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_ENABLED}
2663 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002664 */
Amith Yamasani156c4352010-03-05 17:10:03 -08002665 @Deprecated
2666 public static final String LOCK_PATTERN_ENABLED = Secure.LOCK_PATTERN_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002667
2668 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08002669 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_VISIBLE}
2670 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002671 */
Amith Yamasani156c4352010-03-05 17:10:03 -08002672 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002673 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
2674
2675 /**
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07002676 * @deprecated Use
Amith Yamasani156c4352010-03-05 17:10:03 -08002677 * {@link android.provider.Settings.Secure#LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED}
2678 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002679 */
Amith Yamasani156c4352010-03-05 17:10:03 -08002680 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002681 public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED =
2682 "lock_pattern_tactile_feedback_enabled";
2683
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002684 /**
2685 * A formatted string of the next alarm that is set, or the empty string
2686 * if there is no alarm set.
Adrian Roosc42a1e12014-07-07 23:35:53 +02002687 *
2688 * @deprecated Use {@link android.app.AlarmManager#getNextAlarmClock()}.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002689 */
Adrian Roosc42a1e12014-07-07 23:35:53 +02002690 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002691 public static final String NEXT_ALARM_FORMATTED = "next_alarm_formatted";
2692
Svetoslav683914b2015-01-15 14:22:26 -08002693 private static final Validator NEXT_ALARM_FORMATTED_VALIDATOR = new Validator() {
2694 private static final int MAX_LENGTH = 1000;
Svetoslav1b71ea92015-02-17 18:20:29 -08002695
Svetoslav683914b2015-01-15 14:22:26 -08002696 @Override
2697 public boolean validate(String value) {
2698 // TODO: No idea what the correct format is.
Svetoslav64d6e9c2015-02-12 11:30:36 -08002699 return value == null || value.length() < MAX_LENGTH;
Svetoslav683914b2015-01-15 14:22:26 -08002700 }
2701 };
2702
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002703 /**
2704 * Scaling factor for fonts, float.
2705 */
2706 public static final String FONT_SCALE = "font_scale";
2707
Svetoslav683914b2015-01-15 14:22:26 -08002708 private static final Validator FONT_SCALE_VALIDATOR = new Validator() {
2709 @Override
2710 public boolean validate(String value) {
2711 try {
2712 return Float.parseFloat(value) >= 0;
2713 } catch (NumberFormatException e) {
2714 return false;
2715 }
2716 }
2717 };
2718
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002719 /**
Seigo Nonakabd5cbdd2016-01-25 19:40:28 +09002720 * The serialized system locale value.
2721 *
2722 * Do not use this value directory.
Yohei Yukawa23cbe852016-05-17 16:42:58 -07002723 * To get system locale, use {@link LocaleList#getDefault} instead.
Seigo Nonakabd5cbdd2016-01-25 19:40:28 +09002724 * To update system locale, use {@link com.android.internal.app.LocalePicker#updateLocales}
2725 * instead.
2726 * @hide
2727 */
2728 public static final String SYSTEM_LOCALES = "system_locales";
2729
2730
2731 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002732 * Name of an application package to be debugged.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002733 *
2734 * @deprecated Use {@link Global#DEBUG_APP} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002735 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002736 @Deprecated
2737 public static final String DEBUG_APP = Global.DEBUG_APP;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002738
2739 /**
2740 * If 1, when launching DEBUG_APP it will wait for the debugger before
2741 * starting user code. If 0, it will run normally.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002742 *
2743 * @deprecated Use {@link Global#WAIT_FOR_DEBUGGER} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002744 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002745 @Deprecated
2746 public static final String WAIT_FOR_DEBUGGER = Global.WAIT_FOR_DEBUGGER;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002747
2748 /**
2749 * Whether or not to dim the screen. 0=no 1=yes
Jeff Brown96307042012-07-27 15:51:34 -07002750 * @deprecated This setting is no longer used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002751 */
Jeff Brown96307042012-07-27 15:51:34 -07002752 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002753 public static final String DIM_SCREEN = "dim_screen";
2754
Svetoslav683914b2015-01-15 14:22:26 -08002755 private static final Validator DIM_SCREEN_VALIDATOR = sBooleanValidator;
2756
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002757 /**
Jeff Brown05af6ad2014-09-30 20:54:30 -07002758 * The amount of time in milliseconds before the device goes to sleep or begins
2759 * to dream after a period of inactivity. This value is also known as the
2760 * user activity timeout period since the screen isn't necessarily turned off
2761 * when it expires.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002762 */
2763 public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout";
2764
Svetoslav683914b2015-01-15 14:22:26 -08002765 private static final Validator SCREEN_OFF_TIMEOUT_VALIDATOR = sNonNegativeIntegerValidator;
2766
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002767 /**
2768 * The screen backlight brightness between 0 and 255.
2769 */
2770 public static final String SCREEN_BRIGHTNESS = "screen_brightness";
2771
Svetoslav683914b2015-01-15 14:22:26 -08002772 private static final Validator SCREEN_BRIGHTNESS_VALIDATOR =
2773 new InclusiveIntegerRangeValidator(0, 255);
2774
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002775 /**
Santos Cordond6a56602016-09-20 15:50:35 -07002776 * The screen backlight brightness between 0 and 255.
2777 * @hide
2778 */
2779 public static final String SCREEN_BRIGHTNESS_FOR_VR = "screen_brightness_for_vr";
2780
2781 private static final Validator SCREEN_BRIGHTNESS_FOR_VR_VALIDATOR =
2782 new InclusiveIntegerRangeValidator(0, 255);
2783
2784 /**
Dan Murphy951764b2009-08-27 14:59:03 -05002785 * Control whether to enable automatic brightness mode.
Dan Murphy951764b2009-08-27 14:59:03 -05002786 */
2787 public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode";
2788
Svetoslav683914b2015-01-15 14:22:26 -08002789 private static final Validator SCREEN_BRIGHTNESS_MODE_VALIDATOR = sBooleanValidator;
2790
Dan Murphy951764b2009-08-27 14:59:03 -05002791 /**
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08002792 * Adjustment to auto-brightness to make it generally more (>0.0 <1.0)
2793 * or less (<0.0 >-1.0) bright.
Dianne Hackborn518a3d82012-05-09 16:30:49 -07002794 * @hide
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08002795 */
2796 public static final String SCREEN_AUTO_BRIGHTNESS_ADJ = "screen_auto_brightness_adj";
2797
Svetoslav683914b2015-01-15 14:22:26 -08002798 private static final Validator SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR =
2799 new InclusiveFloatRangeValidator(-1, 1);
2800
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08002801 /**
Mike Lockwooddc3494e2009-10-14 21:17:09 -07002802 * SCREEN_BRIGHTNESS_MODE value for manual mode.
Mike Lockwooddc3494e2009-10-14 21:17:09 -07002803 */
2804 public static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0;
2805
2806 /**
Scott Main52bfc242012-02-09 10:09:14 -08002807 * SCREEN_BRIGHTNESS_MODE value for automatic mode.
Mike Lockwooddc3494e2009-10-14 21:17:09 -07002808 */
2809 public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1;
2810
2811 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002812 * Control whether the process CPU usage meter should be shown.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002813 *
Nick Kralevichfc4a5c22016-10-11 09:01:38 -07002814 * @deprecated This functionality is no longer available as of
2815 * {@link android.os.Build.VERSION_CODES#N_MR1}.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002816 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002817 @Deprecated
2818 public static final String SHOW_PROCESSES = Global.SHOW_PROCESSES;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002819
2820 /**
2821 * If 1, the activity manager will aggressively finish activities and
2822 * processes as soon as they are no longer needed. If 0, the normal
2823 * extended lifetime is used.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002824 *
2825 * @deprecated Use {@link Global#ALWAYS_FINISH_ACTIVITIES} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002826 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002827 @Deprecated
2828 public static final String ALWAYS_FINISH_ACTIVITIES = Global.ALWAYS_FINISH_ACTIVITIES;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002829
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002830 /**
2831 * Determines which streams are affected by ringer mode changes. The
2832 * stream type's bit should be set to 1 if it should be muted when going
2833 * into an inaudible ringer mode.
2834 */
2835 public static final String MODE_RINGER_STREAMS_AFFECTED = "mode_ringer_streams_affected";
2836
Svetoslav683914b2015-01-15 14:22:26 -08002837 private static final Validator MODE_RINGER_STREAMS_AFFECTED_VALIDATOR =
2838 sNonNegativeIntegerValidator;
2839
2840 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002841 * Determines which streams are affected by mute. The
2842 * stream type's bit should be set to 1 if it should be muted when a mute request
2843 * is received.
2844 */
Svetoslav683914b2015-01-15 14:22:26 -08002845 public static final String MUTE_STREAMS_AFFECTED = "mute_streams_affected";
2846
2847 private static final Validator MUTE_STREAMS_AFFECTED_VALIDATOR =
2848 sNonNegativeIntegerValidator;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002849
2850 /**
2851 * Whether vibrate is on for different events. This is used internally,
2852 * changing this value will not change the vibrate. See AudioManager.
2853 */
2854 public static final String VIBRATE_ON = "vibrate_on";
2855
Svetoslav683914b2015-01-15 14:22:26 -08002856 private static final Validator VIBRATE_ON_VALIDATOR = sBooleanValidator;
2857
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002858 /**
Jeff Brown7f6c2312012-04-13 20:38:38 -07002859 * If 1, redirects the system vibrator to all currently attached input devices
2860 * that support vibration. If there are no such input devices, then the system
2861 * vibrator is used instead.
2862 * If 0, does not register the system vibrator.
2863 *
2864 * This setting is mainly intended to provide a compatibility mechanism for
2865 * applications that only know about the system vibrator and do not use the
2866 * input device vibrator API.
2867 *
2868 * @hide
2869 */
2870 public static final String VIBRATE_INPUT_DEVICES = "vibrate_input_devices";
2871
Svetoslav683914b2015-01-15 14:22:26 -08002872 private static final Validator VIBRATE_INPUT_DEVICES_VALIDATOR = sBooleanValidator;
2873
Jeff Brown7f6c2312012-04-13 20:38:38 -07002874 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002875 * Ringer volume. This is used internally, changing this value will not
2876 * change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002877 *
2878 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002879 */
2880 public static final String VOLUME_RING = "volume_ring";
2881
2882 /**
2883 * System/notifications volume. This is used internally, changing this
2884 * value will not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002885 *
2886 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002887 */
2888 public static final String VOLUME_SYSTEM = "volume_system";
2889
2890 /**
2891 * Voice call volume. This is used internally, changing this value will
2892 * not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002893 *
2894 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002895 */
2896 public static final String VOLUME_VOICE = "volume_voice";
2897
2898 /**
2899 * Music/media/gaming volume. This is used internally, changing this
2900 * value will not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002901 *
2902 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002903 */
2904 public static final String VOLUME_MUSIC = "volume_music";
2905
2906 /**
2907 * Alarm volume. This is used internally, changing this
2908 * value will not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002909 *
2910 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002911 */
2912 public static final String VOLUME_ALARM = "volume_alarm";
2913
2914 /**
2915 * Notification volume. This is used internally, changing this
2916 * value will not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002917 *
2918 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002919 */
2920 public static final String VOLUME_NOTIFICATION = "volume_notification";
2921
2922 /**
Eric Laurent484d2882009-12-08 09:05:45 -08002923 * Bluetooth Headset volume. This is used internally, changing this value will
2924 * not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002925 *
2926 * @removed Not used by anything since API 2.
Eric Laurent484d2882009-12-08 09:05:45 -08002927 */
2928 public static final String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco";
2929
2930 /**
Mike Lockwood8517e462011-10-25 14:47:19 -04002931 * Master volume (float in the range 0.0f to 1.0f).
Svetoslavdbbeeb32015-02-18 19:16:25 -08002932 *
Mike Lockwood8517e462011-10-25 14:47:19 -04002933 * @hide
2934 */
2935 public static final String VOLUME_MASTER = "volume_master";
2936
2937 /**
Andy Hungf04b84d2015-12-18 17:33:27 -08002938 * Master mono (int 1 = mono, 0 = normal).
2939 *
2940 * @hide
2941 */
2942 public static final String MASTER_MONO = "master_mono";
2943
2944 private static final Validator MASTER_MONO_VALIDATOR = sBooleanValidator;
2945
2946 /**
Justin Koh57978ed2012-04-03 17:37:58 -07002947 * Whether the notifications should use the ring volume (value of 1) or
2948 * a separate notification volume (value of 0). In most cases, users
2949 * will have this enabled so the notification and ringer volumes will be
2950 * the same. However, power users can disable this and use the separate
2951 * notification volume control.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002952 * <p>
Justin Koh57978ed2012-04-03 17:37:58 -07002953 * Note: This is a one-off setting that will be removed in the future
2954 * when there is profile support. For this reason, it is kept hidden
2955 * from the public APIs.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002956 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002957 * @hide
Amith Yamasani42722bf2011-07-22 10:34:27 -07002958 * @deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002959 */
Gilles Debunnee90bed12011-08-30 14:28:27 -07002960 @Deprecated
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002961 public static final String NOTIFICATIONS_USE_RING_VOLUME =
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002962 "notifications_use_ring_volume";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002963
Svetoslav683914b2015-01-15 14:22:26 -08002964 private static final Validator NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR = sBooleanValidator;
2965
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002966 /**
Daniel Sandler6329bf72010-02-26 15:17:44 -05002967 * Whether silent mode should allow vibration feedback. This is used
2968 * internally in AudioService and the Sound settings activity to
2969 * coordinate decoupling of vibrate and silent modes. This setting
2970 * will likely be removed in a future release with support for
2971 * audio/vibe feedback profiles.
2972 *
Eric Laurentbffc3d12012-05-07 17:43:49 -07002973 * Not used anymore. On devices with vibrator, the user explicitly selects
2974 * silent or vibrate mode.
2975 * Kept for use by legacy database upgrade code in DatabaseHelper.
Daniel Sandler6329bf72010-02-26 15:17:44 -05002976 * @hide
2977 */
2978 public static final String VIBRATE_IN_SILENT = "vibrate_in_silent";
2979
Svetoslav683914b2015-01-15 14:22:26 -08002980 private static final Validator VIBRATE_IN_SILENT_VALIDATOR = sBooleanValidator;
2981
Daniel Sandler6329bf72010-02-26 15:17:44 -05002982 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002983 * The mapping of stream type (integer) to its setting.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002984 *
2985 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002986 */
2987 public static final String[] VOLUME_SETTINGS = {
2988 VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC,
Eric Laurent484d2882009-12-08 09:05:45 -08002989 VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002990 };
2991
2992 /**
2993 * Appended to various volume related settings to record the previous
2994 * values before they the settings were affected by a silent/vibrate
2995 * ringer mode change.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002996 *
2997 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002998 */
2999 public static final String APPEND_FOR_LAST_AUDIBLE = "_last_audible";
3000
3001 /**
3002 * Persistent store for the system-wide default ringtone URI.
3003 * <p>
3004 * If you need to play the default ringtone at any given time, it is recommended
3005 * you give {@link #DEFAULT_RINGTONE_URI} to the media player. It will resolve
3006 * to the set default ringtone at the time of playing.
3007 *
3008 * @see #DEFAULT_RINGTONE_URI
3009 */
3010 public static final String RINGTONE = "ringtone";
3011
Svetoslav683914b2015-01-15 14:22:26 -08003012 private static final Validator RINGTONE_VALIDATOR = sUriValidator;
3013
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003014 /**
3015 * A {@link Uri} that will point to the current default ringtone at any
3016 * given time.
3017 * <p>
3018 * If the current default ringtone is in the DRM provider and the caller
3019 * does not have permission, the exception will be a
3020 * FileNotFoundException.
3021 */
3022 public static final Uri DEFAULT_RINGTONE_URI = getUriFor(RINGTONE);
3023
Jeff Sharkey413573a2016-02-22 17:52:45 -07003024 /** {@hide} */
3025 public static final String RINGTONE_CACHE = "ringtone_cache";
3026 /** {@hide} */
3027 public static final Uri RINGTONE_CACHE_URI = getUriFor(RINGTONE_CACHE);
3028
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003029 /**
3030 * Persistent store for the system-wide default notification sound.
3031 *
3032 * @see #RINGTONE
3033 * @see #DEFAULT_NOTIFICATION_URI
3034 */
3035 public static final String NOTIFICATION_SOUND = "notification_sound";
3036
Svetoslav683914b2015-01-15 14:22:26 -08003037 private static final Validator NOTIFICATION_SOUND_VALIDATOR = sUriValidator;
3038
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003039 /**
3040 * A {@link Uri} that will point to the current default notification
3041 * sound at any given time.
3042 *
3043 * @see #DEFAULT_RINGTONE_URI
3044 */
3045 public static final Uri DEFAULT_NOTIFICATION_URI = getUriFor(NOTIFICATION_SOUND);
3046
Jeff Sharkey413573a2016-02-22 17:52:45 -07003047 /** {@hide} */
3048 public static final String NOTIFICATION_SOUND_CACHE = "notification_sound_cache";
3049 /** {@hide} */
3050 public static final Uri NOTIFICATION_SOUND_CACHE_URI = getUriFor(NOTIFICATION_SOUND_CACHE);
3051
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003052 /**
Patrick Scott3156bb002009-04-13 09:57:38 -07003053 * Persistent store for the system-wide default alarm alert.
3054 *
3055 * @see #RINGTONE
3056 * @see #DEFAULT_ALARM_ALERT_URI
3057 */
3058 public static final String ALARM_ALERT = "alarm_alert";
3059
Svetoslav683914b2015-01-15 14:22:26 -08003060 private static final Validator ALARM_ALERT_VALIDATOR = sUriValidator;
3061
Patrick Scott3156bb002009-04-13 09:57:38 -07003062 /**
3063 * A {@link Uri} that will point to the current default alarm alert at
3064 * any given time.
3065 *
3066 * @see #DEFAULT_ALARM_ALERT_URI
3067 */
3068 public static final Uri DEFAULT_ALARM_ALERT_URI = getUriFor(ALARM_ALERT);
3069
Jeff Sharkey413573a2016-02-22 17:52:45 -07003070 /** {@hide} */
3071 public static final String ALARM_ALERT_CACHE = "alarm_alert_cache";
3072 /** {@hide} */
3073 public static final Uri ALARM_ALERT_CACHE_URI = getUriFor(ALARM_ALERT_CACHE);
3074
Patrick Scott3156bb002009-04-13 09:57:38 -07003075 /**
Jean-Michel Trivid589fea2011-04-15 11:28:10 -07003076 * Persistent store for the system default media button event receiver.
3077 *
3078 * @hide
3079 */
3080 public static final String MEDIA_BUTTON_RECEIVER = "media_button_receiver";
3081
Svetoslav683914b2015-01-15 14:22:26 -08003082 private static final Validator MEDIA_BUTTON_RECEIVER_VALIDATOR = new Validator() {
3083 @Override
3084 public boolean validate(String value) {
3085 try {
3086 ComponentName.unflattenFromString(value);
3087 return true;
3088 } catch (NullPointerException e) {
3089 return false;
3090 }
3091 }
3092 };
3093
Jean-Michel Trivid589fea2011-04-15 11:28:10 -07003094 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003095 * Setting to enable Auto Replace (AutoText) in text editors. 1 = On, 0 = Off
3096 */
3097 public static final String TEXT_AUTO_REPLACE = "auto_replace";
3098
Svetoslav683914b2015-01-15 14:22:26 -08003099 private static final Validator TEXT_AUTO_REPLACE_VALIDATOR = sBooleanValidator;
3100
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003101 /**
3102 * Setting to enable Auto Caps in text editors. 1 = On, 0 = Off
3103 */
3104 public static final String TEXT_AUTO_CAPS = "auto_caps";
3105
Svetoslav683914b2015-01-15 14:22:26 -08003106 private static final Validator TEXT_AUTO_CAPS_VALIDATOR = sBooleanValidator;
3107
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003108 /**
3109 * Setting to enable Auto Punctuate in text editors. 1 = On, 0 = Off. This
3110 * feature converts two spaces to a "." and space.
3111 */
3112 public static final String TEXT_AUTO_PUNCTUATE = "auto_punctuate";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003113
Svetoslav683914b2015-01-15 14:22:26 -08003114 private static final Validator TEXT_AUTO_PUNCTUATE_VALIDATOR = sBooleanValidator;
3115
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003116 /**
3117 * Setting to showing password characters in text editors. 1 = On, 0 = Off
3118 */
3119 public static final String TEXT_SHOW_PASSWORD = "show_password";
3120
Svetoslav683914b2015-01-15 14:22:26 -08003121 private static final Validator TEXT_SHOW_PASSWORD_VALIDATOR = sBooleanValidator;
3122
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003123 public static final String SHOW_GTALK_SERVICE_STATUS =
3124 "SHOW_GTALK_SERVICE_STATUS";
3125
Svetoslav683914b2015-01-15 14:22:26 -08003126 private static final Validator SHOW_GTALK_SERVICE_STATUS_VALIDATOR = sBooleanValidator;
3127
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003128 /**
3129 * Name of activity to use for wallpaper on the home screen.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003130 *
3131 * @deprecated Use {@link WallpaperManager} instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003132 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003133 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003134 public static final String WALLPAPER_ACTIVITY = "wallpaper_activity";
3135
Svetoslav683914b2015-01-15 14:22:26 -08003136 private static final Validator WALLPAPER_ACTIVITY_VALIDATOR = new Validator() {
3137 private static final int MAX_LENGTH = 1000;
3138
3139 @Override
3140 public boolean validate(String value) {
3141 if (value != null && value.length() > MAX_LENGTH) {
3142 return false;
3143 }
3144 return ComponentName.unflattenFromString(value) != null;
3145 }
3146 };
3147
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003148 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003149 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME}
3150 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003151 */
Christopher Tate06efb532012-08-24 15:29:27 -07003152 @Deprecated
3153 public static final String AUTO_TIME = Global.AUTO_TIME;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003154
3155 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003156 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME_ZONE}
3157 * instead
Amith Yamasaniad450be2010-09-16 16:47:00 -07003158 */
Christopher Tate06efb532012-08-24 15:29:27 -07003159 @Deprecated
3160 public static final String AUTO_TIME_ZONE = Global.AUTO_TIME_ZONE;
Amith Yamasaniad450be2010-09-16 16:47:00 -07003161
3162 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003163 * Display times as 12 or 24 hours
3164 * 12
3165 * 24
3166 */
3167 public static final String TIME_12_24 = "time_12_24";
3168
Svetoslav683914b2015-01-15 14:22:26 -08003169 /** @hide */
3170 public static final Validator TIME_12_24_VALIDATOR =
3171 new DiscreteValueValidator(new String[] {"12", "24"});
3172
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003173 /**
3174 * Date format string
3175 * mm/dd/yyyy
3176 * dd/mm/yyyy
3177 * yyyy/mm/dd
3178 */
3179 public static final String DATE_FORMAT = "date_format";
3180
Svetoslav683914b2015-01-15 14:22:26 -08003181 /** @hide */
3182 public static final Validator DATE_FORMAT_VALIDATOR = new Validator() {
3183 @Override
3184 public boolean validate(String value) {
3185 try {
3186 new SimpleDateFormat(value);
3187 return true;
3188 } catch (IllegalArgumentException e) {
3189 return false;
3190 }
3191 }
3192 };
3193
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003194 /**
3195 * Whether the setup wizard has been run before (on first boot), or if
3196 * it still needs to be run.
3197 *
3198 * nonzero = it has been run in the past
3199 * 0 = it has not been run in the past
3200 */
3201 public static final String SETUP_WIZARD_HAS_RUN = "setup_wizard_has_run";
3202
Svetoslav683914b2015-01-15 14:22:26 -08003203 /** @hide */
3204 public static final Validator SETUP_WIZARD_HAS_RUN_VALIDATOR = sBooleanValidator;
3205
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003206 /**
3207 * Scaling factor for normal window animations. Setting to 0 will disable window
3208 * animations.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003209 *
3210 * @deprecated Use {@link Global#WINDOW_ANIMATION_SCALE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003211 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003212 @Deprecated
3213 public static final String WINDOW_ANIMATION_SCALE = Global.WINDOW_ANIMATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003214
3215 /**
3216 * Scaling factor for activity transition animations. Setting to 0 will disable window
3217 * animations.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003218 *
3219 * @deprecated Use {@link Global#TRANSITION_ANIMATION_SCALE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003220 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003221 @Deprecated
3222 public static final String TRANSITION_ANIMATION_SCALE = Global.TRANSITION_ANIMATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003223
3224 /**
Chet Haasec38fa1f2012-02-01 16:37:46 -08003225 * Scaling factor for Animator-based animations. This affects both the start delay and
3226 * duration of all such animations. Setting to 0 will cause animations to end immediately.
3227 * The default value is 1.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003228 *
3229 * @deprecated Use {@link Global#ANIMATOR_DURATION_SCALE} instead
Chet Haasec38fa1f2012-02-01 16:37:46 -08003230 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003231 @Deprecated
3232 public static final String ANIMATOR_DURATION_SCALE = Global.ANIMATOR_DURATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003233
3234 /**
3235 * Control whether the accelerometer will be used to change screen
3236 * orientation. If 0, it will not be used unless explicitly requested
3237 * by the application; if 1, it will be used by default unless explicitly
3238 * disabled by the application.
3239 */
3240 public static final String ACCELEROMETER_ROTATION = "accelerometer_rotation";
3241
Svetoslav683914b2015-01-15 14:22:26 -08003242 /** @hide */
3243 public static final Validator ACCELEROMETER_ROTATION_VALIDATOR = sBooleanValidator;
3244
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003245 /**
Daniel Sandlerb73617d2010-08-17 00:41:00 -04003246 * Default screen rotation when no other policy applies.
3247 * When {@link #ACCELEROMETER_ROTATION} is zero and no on-screen Activity expresses a
3248 * preference, this rotation value will be used. Must be one of the
Brian Muramatsue1d46982010-12-06 17:34:20 -08003249 * {@link android.view.Surface#ROTATION_0 Surface rotation constants}.
Daniel Sandlerb73617d2010-08-17 00:41:00 -04003250 *
Dianne Hackborn16ec0802014-08-15 18:32:33 -07003251 * @see android.view.Display#getRotation
Daniel Sandlerb73617d2010-08-17 00:41:00 -04003252 */
3253 public static final String USER_ROTATION = "user_rotation";
3254
Svetoslav683914b2015-01-15 14:22:26 -08003255 /** @hide */
3256 public static final Validator USER_ROTATION_VALIDATOR =
3257 new InclusiveIntegerRangeValidator(0, 3);
3258
Daniel Sandlerb73617d2010-08-17 00:41:00 -04003259 /**
Jeff Brown207673cd2012-06-05 17:47:11 -07003260 * Control whether the rotation lock toggle in the System UI should be hidden.
3261 * Typically this is done for accessibility purposes to make it harder for
3262 * the user to accidentally toggle the rotation lock while the display rotation
3263 * has been locked for accessibility.
3264 *
3265 * If 0, then rotation lock toggle is not hidden for accessibility (although it may be
3266 * unavailable for other reasons). If 1, then the rotation lock toggle is hidden.
3267 *
3268 * @hide
3269 */
3270 public static final String HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY =
3271 "hide_rotation_lock_toggle_for_accessibility";
3272
Svetoslav683914b2015-01-15 14:22:26 -08003273 /** @hide */
3274 public static final Validator HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR =
3275 sBooleanValidator;
3276
Jeff Brown207673cd2012-06-05 17:47:11 -07003277 /**
Daisuke Miyakawa3c60eeb2012-05-08 12:08:25 -07003278 * Whether the phone vibrates when it is ringing due to an incoming call. This will
3279 * be used by Phone and Setting apps; it shouldn't affect other apps.
3280 * The value is boolean (1 or 0).
3281 *
3282 * Note: this is not same as "vibrate on ring", which had been available until ICS.
3283 * It was about AudioManager's setting and thus affected all the applications which
3284 * relied on the setting, while this is purely about the vibration setting for incoming
3285 * calls.
Daisuke Miyakawa3c60eeb2012-05-08 12:08:25 -07003286 */
3287 public static final String VIBRATE_WHEN_RINGING = "vibrate_when_ringing";
3288
Svetoslav683914b2015-01-15 14:22:26 -08003289 /** @hide */
3290 public static final Validator VIBRATE_WHEN_RINGING_VALIDATOR = sBooleanValidator;
3291
Daisuke Miyakawa3c60eeb2012-05-08 12:08:25 -07003292 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003293 * Whether the audible DTMF tones are played by the dialer when dialing. The value is
3294 * boolean (1 or 0).
3295 */
3296 public static final String DTMF_TONE_WHEN_DIALING = "dtmf_tone";
3297
Svetoslav683914b2015-01-15 14:22:26 -08003298 /** @hide */
3299 public static final Validator DTMF_TONE_WHEN_DIALING_VALIDATOR = sBooleanValidator;
3300
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003301 /**
David Kraused0f67152009-06-13 18:01:13 -05003302 * CDMA only settings
3303 * DTMF tone type played by the dialer when dialing.
3304 * 0 = Normal
3305 * 1 = Long
David Kraused0f67152009-06-13 18:01:13 -05003306 */
3307 public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type";
3308
Svetoslav683914b2015-01-15 14:22:26 -08003309 /** @hide */
3310 public static final Validator DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR = sBooleanValidator;
3311
David Kraused0f67152009-06-13 18:01:13 -05003312 /**
David Kraused0f67152009-06-13 18:01:13 -05003313 * Whether the hearing aid is enabled. The value is
3314 * boolean (1 or 0).
3315 * @hide
3316 */
3317 public static final String HEARING_AID = "hearing_aid";
3318
Svetoslav683914b2015-01-15 14:22:26 -08003319 /** @hide */
3320 public static final Validator HEARING_AID_VALIDATOR = sBooleanValidator;
3321
David Kraused0f67152009-06-13 18:01:13 -05003322 /**
3323 * CDMA only settings
3324 * TTY Mode
3325 * 0 = OFF
3326 * 1 = FULL
3327 * 2 = VCO
3328 * 3 = HCO
3329 * @hide
3330 */
3331 public static final String TTY_MODE = "tty_mode";
3332
Svetoslav683914b2015-01-15 14:22:26 -08003333 /** @hide */
3334 public static final Validator TTY_MODE_VALIDATOR = new InclusiveIntegerRangeValidator(0, 3);
3335
David Kraused0f67152009-06-13 18:01:13 -05003336 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003337 * Whether the sounds effects (key clicks, lid open ...) are enabled. The value is
3338 * boolean (1 or 0).
3339 */
3340 public static final String SOUND_EFFECTS_ENABLED = "sound_effects_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003341
Svetoslav683914b2015-01-15 14:22:26 -08003342 /** @hide */
3343 public static final Validator SOUND_EFFECTS_ENABLED_VALIDATOR = sBooleanValidator;
3344
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003345 /**
3346 * Whether the haptic feedback (long presses, ...) are enabled. The value is
3347 * boolean (1 or 0).
3348 */
3349 public static final String HAPTIC_FEEDBACK_ENABLED = "haptic_feedback_enabled";
Sanjay Jeyakumar21bf2412009-07-09 13:31:48 -07003350
Svetoslav683914b2015-01-15 14:22:26 -08003351 /** @hide */
3352 public static final Validator HAPTIC_FEEDBACK_ENABLED_VALIDATOR = sBooleanValidator;
3353
Mike LeBeau48603e72009-06-05 00:27:00 +01003354 /**
Bjorn Bringert24abb662010-09-21 12:21:18 +01003355 * @deprecated Each application that shows web suggestions should have its own
3356 * setting for this.
Mike LeBeau48603e72009-06-05 00:27:00 +01003357 */
Bjorn Bringert24abb662010-09-21 12:21:18 +01003358 @Deprecated
Mike LeBeau48603e72009-06-05 00:27:00 +01003359 public static final String SHOW_WEB_SUGGESTIONS = "show_web_suggestions";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003360
Svetoslav683914b2015-01-15 14:22:26 -08003361 /** @hide */
3362 public static final Validator SHOW_WEB_SUGGESTIONS_VALIDATOR = sBooleanValidator;
3363
-b master501eec92009-07-06 13:53:11 -07003364 /**
Amith Yamasaniae3ed702009-12-01 19:02:05 -08003365 * Whether the notification LED should repeatedly flash when a notification is
3366 * pending. The value is boolean (1 or 0).
3367 * @hide
3368 */
3369 public static final String NOTIFICATION_LIGHT_PULSE = "notification_light_pulse";
3370
Svetoslav683914b2015-01-15 14:22:26 -08003371 /** @hide */
3372 public static final Validator NOTIFICATION_LIGHT_PULSE_VALIDATOR = sBooleanValidator;
3373
Amith Yamasaniae3ed702009-12-01 19:02:05 -08003374 /**
Dianne Hackborn90d2db32010-02-11 22:19:06 -08003375 * Show pointer location on screen?
3376 * 0 = no
3377 * 1 = yes
3378 * @hide
3379 */
3380 public static final String POINTER_LOCATION = "pointer_location";
3381
Svetoslav683914b2015-01-15 14:22:26 -08003382 /** @hide */
3383 public static final Validator POINTER_LOCATION_VALIDATOR = sBooleanValidator;
3384
Dianne Hackborn90d2db32010-02-11 22:19:06 -08003385 /**
Jeff Browndaf4a122011-08-26 17:14:14 -07003386 * Show touch positions on screen?
3387 * 0 = no
3388 * 1 = yes
3389 * @hide
3390 */
3391 public static final String SHOW_TOUCHES = "show_touches";
3392
Svetoslav683914b2015-01-15 14:22:26 -08003393 /** @hide */
3394 public static final Validator SHOW_TOUCHES_VALIDATOR = sBooleanValidator;
3395
Jeff Browndaf4a122011-08-26 17:14:14 -07003396 /**
Dianne Hackborn16ec0802014-08-15 18:32:33 -07003397 * Log raw orientation data from
Jorim Jaggib10e33f2015-02-04 21:57:40 +01003398 * {@link com.android.server.policy.WindowOrientationListener} for use with the
Jeff Brown4519f072011-01-23 13:16:01 -08003399 * orientationplot.py tool.
3400 * 0 = no
3401 * 1 = yes
3402 * @hide
3403 */
3404 public static final String WINDOW_ORIENTATION_LISTENER_LOG =
3405 "window_orientation_listener_log";
3406
Svetoslav683914b2015-01-15 14:22:26 -08003407 /** @hide */
3408 public static final Validator WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR = sBooleanValidator;
3409
Jeff Brown4519f072011-01-23 13:16:01 -08003410 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003411 * @deprecated Use {@link android.provider.Settings.Global#POWER_SOUNDS_ENABLED}
3412 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003413 * @hide
3414 */
Christopher Tate06efb532012-08-24 15:29:27 -07003415 @Deprecated
3416 public static final String POWER_SOUNDS_ENABLED = Global.POWER_SOUNDS_ENABLED;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003417
3418 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003419 * @deprecated Use {@link android.provider.Settings.Global#DOCK_SOUNDS_ENABLED}
3420 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003421 * @hide
3422 */
Christopher Tate06efb532012-08-24 15:29:27 -07003423 @Deprecated
3424 public static final String DOCK_SOUNDS_ENABLED = Global.DOCK_SOUNDS_ENABLED;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003425
3426 /**
3427 * Whether to play sounds when the keyguard is shown and dismissed.
3428 * @hide
3429 */
3430 public static final String LOCKSCREEN_SOUNDS_ENABLED = "lockscreen_sounds_enabled";
3431
Svetoslav683914b2015-01-15 14:22:26 -08003432 /** @hide */
3433 public static final Validator LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR = sBooleanValidator;
3434
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003435 /**
Mike Lockwood7bef7392011-10-20 16:51:53 -04003436 * Whether the lockscreen should be completely disabled.
3437 * @hide
3438 */
3439 public static final String LOCKSCREEN_DISABLED = "lockscreen.disabled";
3440
Svetoslav683914b2015-01-15 14:22:26 -08003441 /** @hide */
3442 public static final Validator LOCKSCREEN_DISABLED_VALIDATOR = sBooleanValidator;
3443
Mike Lockwood7bef7392011-10-20 16:51:53 -04003444 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003445 * @deprecated Use {@link android.provider.Settings.Global#LOW_BATTERY_SOUND}
3446 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003447 * @hide
3448 */
Christopher Tate06efb532012-08-24 15:29:27 -07003449 @Deprecated
3450 public static final String LOW_BATTERY_SOUND = Global.LOW_BATTERY_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003451
3452 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003453 * @deprecated Use {@link android.provider.Settings.Global#DESK_DOCK_SOUND}
3454 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003455 * @hide
3456 */
Christopher Tate06efb532012-08-24 15:29:27 -07003457 @Deprecated
3458 public static final String DESK_DOCK_SOUND = Global.DESK_DOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003459
3460 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003461 * @deprecated Use {@link android.provider.Settings.Global#DESK_UNDOCK_SOUND}
3462 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003463 * @hide
3464 */
Christopher Tate06efb532012-08-24 15:29:27 -07003465 @Deprecated
3466 public static final String DESK_UNDOCK_SOUND = Global.DESK_UNDOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003467
3468 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003469 * @deprecated Use {@link android.provider.Settings.Global#CAR_DOCK_SOUND}
3470 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003471 * @hide
3472 */
Christopher Tate06efb532012-08-24 15:29:27 -07003473 @Deprecated
3474 public static final String CAR_DOCK_SOUND = Global.CAR_DOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003475
3476 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003477 * @deprecated Use {@link android.provider.Settings.Global#CAR_UNDOCK_SOUND}
3478 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003479 * @hide
3480 */
Christopher Tate06efb532012-08-24 15:29:27 -07003481 @Deprecated
3482 public static final String CAR_UNDOCK_SOUND = Global.CAR_UNDOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003483
3484 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003485 * @deprecated Use {@link android.provider.Settings.Global#LOCK_SOUND}
3486 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003487 * @hide
3488 */
Christopher Tate06efb532012-08-24 15:29:27 -07003489 @Deprecated
3490 public static final String LOCK_SOUND = Global.LOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003491
3492 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003493 * @deprecated Use {@link android.provider.Settings.Global#UNLOCK_SOUND}
3494 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003495 * @hide
3496 */
Christopher Tate06efb532012-08-24 15:29:27 -07003497 @Deprecated
3498 public static final String UNLOCK_SOUND = Global.UNLOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003499
3500 /**
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003501 * Receive incoming SIP calls?
3502 * 0 = no
3503 * 1 = yes
3504 * @hide
3505 */
3506 public static final String SIP_RECEIVE_CALLS = "sip_receive_calls";
3507
Svetoslav683914b2015-01-15 14:22:26 -08003508 /** @hide */
3509 public static final Validator SIP_RECEIVE_CALLS_VALIDATOR = sBooleanValidator;
3510
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003511 /**
3512 * Call Preference String.
3513 * "SIP_ALWAYS" : Always use SIP with network access
3514 * "SIP_ADDRESS_ONLY" : Only if destination is a SIP address
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003515 * @hide
3516 */
3517 public static final String SIP_CALL_OPTIONS = "sip_call_options";
3518
Svetoslav683914b2015-01-15 14:22:26 -08003519 /** @hide */
3520 public static final Validator SIP_CALL_OPTIONS_VALIDATOR = new DiscreteValueValidator(
3521 new String[] {"SIP_ALWAYS", "SIP_ADDRESS_ONLY"});
3522
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003523 /**
3524 * One of the sip call options: Always use SIP with network access.
3525 * @hide
3526 */
3527 public static final String SIP_ALWAYS = "SIP_ALWAYS";
3528
Svetoslav683914b2015-01-15 14:22:26 -08003529 /** @hide */
3530 public static final Validator SIP_ALWAYS_VALIDATOR = sBooleanValidator;
3531
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003532 /**
3533 * One of the sip call options: Only if destination is a SIP address.
3534 * @hide
3535 */
3536 public static final String SIP_ADDRESS_ONLY = "SIP_ADDRESS_ONLY";
3537
Svetoslav683914b2015-01-15 14:22:26 -08003538 /** @hide */
3539 public static final Validator SIP_ADDRESS_ONLY_VALIDATOR = sBooleanValidator;
3540
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003541 /**
Tyler Gunn2c830a22014-09-02 08:39:35 -07003542 * @deprecated Use SIP_ALWAYS or SIP_ADDRESS_ONLY instead. Formerly used to indicate that
3543 * the user should be prompted each time a call is made whether it should be placed using
3544 * SIP. The {@link com.android.providers.settings.DatabaseHelper} replaces this with
3545 * SIP_ADDRESS_ONLY.
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003546 * @hide
3547 */
Tyler Gunn2c830a22014-09-02 08:39:35 -07003548 @Deprecated
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003549 public static final String SIP_ASK_ME_EACH_TIME = "SIP_ASK_ME_EACH_TIME";
3550
Svetoslav683914b2015-01-15 14:22:26 -08003551 /** @hide */
3552 public static final Validator SIP_ASK_ME_EACH_TIME_VALIDATOR = sBooleanValidator;
3553
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003554 /**
Jeff Brown1a84fd12011-06-02 01:26:32 -07003555 * Pointer speed setting.
3556 * This is an integer value in a range between -7 and +7, so there are 15 possible values.
3557 * -7 = slowest
3558 * 0 = default speed
3559 * +7 = fastest
3560 * @hide
3561 */
3562 public static final String POINTER_SPEED = "pointer_speed";
3563
Svetoslav683914b2015-01-15 14:22:26 -08003564 /** @hide */
3565 public static final Validator POINTER_SPEED_VALIDATOR =
3566 new InclusiveFloatRangeValidator(-7, 7);
3567
Jeff Brown1a84fd12011-06-02 01:26:32 -07003568 /**
Jason Monk56e09b42014-07-18 10:29:14 -04003569 * Whether lock-to-app will be triggered by long-press on recents.
3570 * @hide
3571 */
3572 public static final String LOCK_TO_APP_ENABLED = "lock_to_app_enabled";
3573
Svetoslav683914b2015-01-15 14:22:26 -08003574 /** @hide */
3575 public static final Validator LOCK_TO_APP_ENABLED_VALIDATOR = sBooleanValidator;
3576
Jason Monk56e09b42014-07-18 10:29:14 -04003577 /**
Daniel Sandler2fdb68b2013-10-03 00:12:11 -04003578 * I am the lolrus.
3579 * <p>
3580 * Nonzero values indicate that the user has a bukkit.
3581 * Backward-compatible with <code>PrefGetPreference(prefAllowEasterEggs)</code>.
3582 * @hide
3583 */
3584 public static final String EGG_MODE = "egg_mode";
3585
Svetoslav683914b2015-01-15 14:22:26 -08003586 /** @hide */
Svet Ganovb1918a02015-05-15 09:32:55 -07003587 public static final Validator EGG_MODE_VALIDATOR = new Validator() {
3588 @Override
3589 public boolean validate(String value) {
3590 try {
3591 return Long.parseLong(value) >= 0;
3592 } catch (NumberFormatException e) {
3593 return false;
3594 }
3595 }
3596 };
Svetoslav683914b2015-01-15 14:22:26 -08003597
3598 /**
3599 * IMPORTANT: If you add a new public settings you also have to add it to
3600 * PUBLIC_SETTINGS below. If the new setting is hidden you have to add
3601 * it to PRIVATE_SETTINGS below. Also add a validator that can validate
3602 * the setting value. See an example above.
3603 */
3604
Daniel Sandler2fdb68b2013-10-03 00:12:11 -04003605 /**
-b master501eec92009-07-06 13:53:11 -07003606 * Settings to backup. This is here so that it's in the same place as the settings
3607 * keys and easy to update.
Svetoslav Ganova571a582011-09-20 18:32:20 -07003608 *
3609 * NOTE: Settings are backed up and restored in the order they appear
3610 * in this array. If you have one setting depending on another,
3611 * make sure that they are ordered appropriately.
3612 *
-b master501eec92009-07-06 13:53:11 -07003613 * @hide
3614 */
3615 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate66488d62012-10-02 11:58:01 -07003616 STAY_ON_WHILE_PLUGGED_IN, // moved to global
-b master501eec92009-07-06 13:53:11 -07003617 WIFI_USE_STATIC_IP,
3618 WIFI_STATIC_IP,
3619 WIFI_STATIC_GATEWAY,
3620 WIFI_STATIC_NETMASK,
3621 WIFI_STATIC_DNS1,
3622 WIFI_STATIC_DNS2,
3623 BLUETOOTH_DISCOVERABILITY,
3624 BLUETOOTH_DISCOVERABILITY_TIMEOUT,
Casey Burkhardt86b867f2015-12-29 18:03:36 -08003625 FONT_SCALE,
-b master501eec92009-07-06 13:53:11 -07003626 DIM_SCREEN,
3627 SCREEN_OFF_TIMEOUT,
3628 SCREEN_BRIGHTNESS,
Christopher Tate362aca62009-09-25 15:58:03 -07003629 SCREEN_BRIGHTNESS_MODE,
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08003630 SCREEN_AUTO_BRIGHTNESS_ADJ,
Jeff Brown7f6c2312012-04-13 20:38:38 -07003631 VIBRATE_INPUT_DEVICES,
Amith Yamasani8823c0a82009-07-07 14:30:17 -07003632 MODE_RINGER_STREAMS_AFFECTED,
-b master501eec92009-07-06 13:53:11 -07003633 TEXT_AUTO_REPLACE,
3634 TEXT_AUTO_CAPS,
3635 TEXT_AUTO_PUNCTUATE,
3636 TEXT_SHOW_PASSWORD,
Christopher Tate66488d62012-10-02 11:58:01 -07003637 AUTO_TIME, // moved to global
3638 AUTO_TIME_ZONE, // moved to global
-b master501eec92009-07-06 13:53:11 -07003639 TIME_12_24,
3640 DATE_FORMAT,
-b master501eec92009-07-06 13:53:11 -07003641 DTMF_TONE_WHEN_DIALING,
3642 DTMF_TONE_TYPE_WHEN_DIALING,
-b master501eec92009-07-06 13:53:11 -07003643 HEARING_AID,
3644 TTY_MODE,
Christopher Tateea2d6e82016-05-19 16:55:49 -07003645 MASTER_MONO,
-b master501eec92009-07-06 13:53:11 -07003646 SOUND_EFFECTS_ENABLED,
3647 HAPTIC_FEEDBACK_ENABLED,
Christopher Tate66488d62012-10-02 11:58:01 -07003648 POWER_SOUNDS_ENABLED, // moved to global
3649 DOCK_SOUNDS_ENABLED, // moved to global
Christopher Tate14c2d792010-02-25 16:49:44 -08003650 LOCKSCREEN_SOUNDS_ENABLED,
Amith Yamasaniae3ed702009-12-01 19:02:05 -08003651 SHOW_WEB_SUGGESTIONS,
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003652 SIP_CALL_OPTIONS,
Nick Pelly038cabe2010-09-23 16:12:11 -07003653 SIP_RECEIVE_CALLS,
Jeff Brown1a84fd12011-06-02 01:26:32 -07003654 POINTER_SPEED,
Amith Yamasani622bf2222013-09-06 13:54:28 -07003655 VIBRATE_WHEN_RINGING,
3656 RINGTONE,
Jason Monk94cfd9d2014-10-31 13:18:21 -04003657 LOCK_TO_APP_ENABLED,
Anna Galuszafa7786c2015-12-22 10:53:44 -08003658 NOTIFICATION_SOUND,
3659 ACCELEROMETER_ROTATION
-b master501eec92009-07-06 13:53:11 -07003660 };
3661
Sailesh Nepal1bd78762014-02-11 22:32:21 -08003662 /**
Amith Yamasanib0ff3222015-03-04 09:56:14 -08003663 * These are all public system settings
Svetoslav683914b2015-01-15 14:22:26 -08003664 *
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07003665 * @hide
3666 */
Svetoslav683914b2015-01-15 14:22:26 -08003667 public static final Set<String> PUBLIC_SETTINGS = new ArraySet<>();
3668 static {
3669 PUBLIC_SETTINGS.add(END_BUTTON_BEHAVIOR);
3670 PUBLIC_SETTINGS.add(WIFI_USE_STATIC_IP);
3671 PUBLIC_SETTINGS.add(WIFI_STATIC_IP);
3672 PUBLIC_SETTINGS.add(WIFI_STATIC_GATEWAY);
3673 PUBLIC_SETTINGS.add(WIFI_STATIC_NETMASK);
3674 PUBLIC_SETTINGS.add(WIFI_STATIC_DNS1);
3675 PUBLIC_SETTINGS.add(WIFI_STATIC_DNS2);
3676 PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY);
3677 PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY_TIMEOUT);
3678 PUBLIC_SETTINGS.add(NEXT_ALARM_FORMATTED);
3679 PUBLIC_SETTINGS.add(FONT_SCALE);
3680 PUBLIC_SETTINGS.add(DIM_SCREEN);
3681 PUBLIC_SETTINGS.add(SCREEN_OFF_TIMEOUT);
3682 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS);
3683 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_MODE);
3684 PUBLIC_SETTINGS.add(MODE_RINGER_STREAMS_AFFECTED);
3685 PUBLIC_SETTINGS.add(MUTE_STREAMS_AFFECTED);
3686 PUBLIC_SETTINGS.add(VIBRATE_ON);
3687 PUBLIC_SETTINGS.add(VOLUME_RING);
3688 PUBLIC_SETTINGS.add(VOLUME_SYSTEM);
3689 PUBLIC_SETTINGS.add(VOLUME_VOICE);
3690 PUBLIC_SETTINGS.add(VOLUME_MUSIC);
3691 PUBLIC_SETTINGS.add(VOLUME_ALARM);
3692 PUBLIC_SETTINGS.add(VOLUME_NOTIFICATION);
3693 PUBLIC_SETTINGS.add(VOLUME_BLUETOOTH_SCO);
3694 PUBLIC_SETTINGS.add(RINGTONE);
3695 PUBLIC_SETTINGS.add(NOTIFICATION_SOUND);
3696 PUBLIC_SETTINGS.add(ALARM_ALERT);
3697 PUBLIC_SETTINGS.add(TEXT_AUTO_REPLACE);
3698 PUBLIC_SETTINGS.add(TEXT_AUTO_CAPS);
3699 PUBLIC_SETTINGS.add(TEXT_AUTO_PUNCTUATE);
3700 PUBLIC_SETTINGS.add(TEXT_SHOW_PASSWORD);
3701 PUBLIC_SETTINGS.add(SHOW_GTALK_SERVICE_STATUS);
3702 PUBLIC_SETTINGS.add(WALLPAPER_ACTIVITY);
3703 PUBLIC_SETTINGS.add(TIME_12_24);
3704 PUBLIC_SETTINGS.add(DATE_FORMAT);
3705 PUBLIC_SETTINGS.add(SETUP_WIZARD_HAS_RUN);
3706 PUBLIC_SETTINGS.add(ACCELEROMETER_ROTATION);
3707 PUBLIC_SETTINGS.add(USER_ROTATION);
3708 PUBLIC_SETTINGS.add(DTMF_TONE_WHEN_DIALING);
3709 PUBLIC_SETTINGS.add(SOUND_EFFECTS_ENABLED);
3710 PUBLIC_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED);
3711 PUBLIC_SETTINGS.add(SHOW_WEB_SUGGESTIONS);
Svetoslav Ganovd2631632015-12-09 16:29:22 -08003712 PUBLIC_SETTINGS.add(VIBRATE_WHEN_RINGING);
Svetoslav683914b2015-01-15 14:22:26 -08003713 }
3714
3715 /**
3716 * These are all hidden system settings.
3717 *
3718 * @hide
3719 */
3720 public static final Set<String> PRIVATE_SETTINGS = new ArraySet<>();
3721 static {
3722 PRIVATE_SETTINGS.add(WIFI_USE_STATIC_IP);
3723 PRIVATE_SETTINGS.add(END_BUTTON_BEHAVIOR);
3724 PRIVATE_SETTINGS.add(ADVANCED_SETTINGS);
3725 PRIVATE_SETTINGS.add(SCREEN_AUTO_BRIGHTNESS_ADJ);
3726 PRIVATE_SETTINGS.add(VIBRATE_INPUT_DEVICES);
3727 PRIVATE_SETTINGS.add(VOLUME_MASTER);
Andy Hungf04b84d2015-12-18 17:33:27 -08003728 PRIVATE_SETTINGS.add(MASTER_MONO);
Svetoslav683914b2015-01-15 14:22:26 -08003729 PRIVATE_SETTINGS.add(NOTIFICATIONS_USE_RING_VOLUME);
3730 PRIVATE_SETTINGS.add(VIBRATE_IN_SILENT);
3731 PRIVATE_SETTINGS.add(MEDIA_BUTTON_RECEIVER);
3732 PRIVATE_SETTINGS.add(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY);
Svetoslav683914b2015-01-15 14:22:26 -08003733 PRIVATE_SETTINGS.add(DTMF_TONE_TYPE_WHEN_DIALING);
3734 PRIVATE_SETTINGS.add(HEARING_AID);
3735 PRIVATE_SETTINGS.add(TTY_MODE);
3736 PRIVATE_SETTINGS.add(NOTIFICATION_LIGHT_PULSE);
3737 PRIVATE_SETTINGS.add(POINTER_LOCATION);
3738 PRIVATE_SETTINGS.add(SHOW_TOUCHES);
3739 PRIVATE_SETTINGS.add(WINDOW_ORIENTATION_LISTENER_LOG);
3740 PRIVATE_SETTINGS.add(POWER_SOUNDS_ENABLED);
3741 PRIVATE_SETTINGS.add(DOCK_SOUNDS_ENABLED);
3742 PRIVATE_SETTINGS.add(LOCKSCREEN_SOUNDS_ENABLED);
3743 PRIVATE_SETTINGS.add(LOCKSCREEN_DISABLED);
3744 PRIVATE_SETTINGS.add(LOW_BATTERY_SOUND);
3745 PRIVATE_SETTINGS.add(DESK_DOCK_SOUND);
3746 PRIVATE_SETTINGS.add(DESK_UNDOCK_SOUND);
3747 PRIVATE_SETTINGS.add(CAR_DOCK_SOUND);
3748 PRIVATE_SETTINGS.add(CAR_UNDOCK_SOUND);
3749 PRIVATE_SETTINGS.add(LOCK_SOUND);
3750 PRIVATE_SETTINGS.add(UNLOCK_SOUND);
3751 PRIVATE_SETTINGS.add(SIP_RECEIVE_CALLS);
3752 PRIVATE_SETTINGS.add(SIP_CALL_OPTIONS);
3753 PRIVATE_SETTINGS.add(SIP_ALWAYS);
3754 PRIVATE_SETTINGS.add(SIP_ADDRESS_ONLY);
3755 PRIVATE_SETTINGS.add(SIP_ASK_ME_EACH_TIME);
3756 PRIVATE_SETTINGS.add(POINTER_SPEED);
3757 PRIVATE_SETTINGS.add(LOCK_TO_APP_ENABLED);
3758 PRIVATE_SETTINGS.add(EGG_MODE);
3759 }
3760
3761 /**
Amith Yamasanib0ff3222015-03-04 09:56:14 -08003762 * These are all public system settings
Svetoslav683914b2015-01-15 14:22:26 -08003763 *
3764 * @hide
3765 */
3766 public static final Map<String, Validator> VALIDATORS = new ArrayMap<>();
3767 static {
3768 VALIDATORS.put(END_BUTTON_BEHAVIOR,END_BUTTON_BEHAVIOR_VALIDATOR);
3769 VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR);
3770 VALIDATORS.put(BLUETOOTH_DISCOVERABILITY, BLUETOOTH_DISCOVERABILITY_VALIDATOR);
3771 VALIDATORS.put(BLUETOOTH_DISCOVERABILITY_TIMEOUT,
3772 BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR);
3773 VALIDATORS.put(NEXT_ALARM_FORMATTED, NEXT_ALARM_FORMATTED_VALIDATOR);
3774 VALIDATORS.put(FONT_SCALE, FONT_SCALE_VALIDATOR);
3775 VALIDATORS.put(DIM_SCREEN, DIM_SCREEN_VALIDATOR);
3776 VALIDATORS.put(SCREEN_OFF_TIMEOUT, SCREEN_OFF_TIMEOUT_VALIDATOR);
3777 VALIDATORS.put(SCREEN_BRIGHTNESS, SCREEN_BRIGHTNESS_VALIDATOR);
Santos Cordond6a56602016-09-20 15:50:35 -07003778 VALIDATORS.put(SCREEN_BRIGHTNESS_FOR_VR, SCREEN_BRIGHTNESS_FOR_VR_VALIDATOR);
Svetoslav683914b2015-01-15 14:22:26 -08003779 VALIDATORS.put(SCREEN_BRIGHTNESS_MODE, SCREEN_BRIGHTNESS_MODE_VALIDATOR);
3780 VALIDATORS.put(MODE_RINGER_STREAMS_AFFECTED, MODE_RINGER_STREAMS_AFFECTED_VALIDATOR);
3781 VALIDATORS.put(MUTE_STREAMS_AFFECTED, MUTE_STREAMS_AFFECTED_VALIDATOR);
3782 VALIDATORS.put(VIBRATE_ON, VIBRATE_ON_VALIDATOR);
Svetoslav683914b2015-01-15 14:22:26 -08003783 VALIDATORS.put(RINGTONE, RINGTONE_VALIDATOR);
3784 VALIDATORS.put(NOTIFICATION_SOUND, NOTIFICATION_SOUND_VALIDATOR);
3785 VALIDATORS.put(ALARM_ALERT, ALARM_ALERT_VALIDATOR);
3786 VALIDATORS.put(TEXT_AUTO_REPLACE, TEXT_AUTO_REPLACE_VALIDATOR);
3787 VALIDATORS.put(TEXT_AUTO_CAPS, TEXT_AUTO_CAPS_VALIDATOR);
3788 VALIDATORS.put(TEXT_AUTO_PUNCTUATE, TEXT_AUTO_PUNCTUATE_VALIDATOR);
3789 VALIDATORS.put(TEXT_SHOW_PASSWORD, TEXT_SHOW_PASSWORD_VALIDATOR);
3790 VALIDATORS.put(SHOW_GTALK_SERVICE_STATUS, SHOW_GTALK_SERVICE_STATUS_VALIDATOR);
3791 VALIDATORS.put(WALLPAPER_ACTIVITY, WALLPAPER_ACTIVITY_VALIDATOR);
3792 VALIDATORS.put(TIME_12_24, TIME_12_24_VALIDATOR);
3793 VALIDATORS.put(DATE_FORMAT, DATE_FORMAT_VALIDATOR);
3794 VALIDATORS.put(SETUP_WIZARD_HAS_RUN, SETUP_WIZARD_HAS_RUN_VALIDATOR);
3795 VALIDATORS.put(ACCELEROMETER_ROTATION, ACCELEROMETER_ROTATION_VALIDATOR);
3796 VALIDATORS.put(USER_ROTATION, USER_ROTATION_VALIDATOR);
3797 VALIDATORS.put(DTMF_TONE_WHEN_DIALING, DTMF_TONE_WHEN_DIALING_VALIDATOR);
3798 VALIDATORS.put(SOUND_EFFECTS_ENABLED, SOUND_EFFECTS_ENABLED_VALIDATOR);
3799 VALIDATORS.put(HAPTIC_FEEDBACK_ENABLED, HAPTIC_FEEDBACK_ENABLED_VALIDATOR);
3800 VALIDATORS.put(SHOW_WEB_SUGGESTIONS, SHOW_WEB_SUGGESTIONS_VALIDATOR);
3801 VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR);
3802 VALIDATORS.put(END_BUTTON_BEHAVIOR, END_BUTTON_BEHAVIOR_VALIDATOR);
3803 VALIDATORS.put(ADVANCED_SETTINGS, ADVANCED_SETTINGS_VALIDATOR);
3804 VALIDATORS.put(SCREEN_AUTO_BRIGHTNESS_ADJ, SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR);
3805 VALIDATORS.put(VIBRATE_INPUT_DEVICES, VIBRATE_INPUT_DEVICES_VALIDATOR);
Andy Hungf04b84d2015-12-18 17:33:27 -08003806 VALIDATORS.put(MASTER_MONO, MASTER_MONO_VALIDATOR);
Svetoslav683914b2015-01-15 14:22:26 -08003807 VALIDATORS.put(NOTIFICATIONS_USE_RING_VOLUME, NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR);
3808 VALIDATORS.put(VIBRATE_IN_SILENT, VIBRATE_IN_SILENT_VALIDATOR);
3809 VALIDATORS.put(MEDIA_BUTTON_RECEIVER, MEDIA_BUTTON_RECEIVER_VALIDATOR);
3810 VALIDATORS.put(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY,
3811 HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR);
3812 VALIDATORS.put(VIBRATE_WHEN_RINGING, VIBRATE_WHEN_RINGING_VALIDATOR);
3813 VALIDATORS.put(DTMF_TONE_TYPE_WHEN_DIALING, DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR);
3814 VALIDATORS.put(HEARING_AID, HEARING_AID_VALIDATOR);
3815 VALIDATORS.put(TTY_MODE, TTY_MODE_VALIDATOR);
3816 VALIDATORS.put(NOTIFICATION_LIGHT_PULSE, NOTIFICATION_LIGHT_PULSE_VALIDATOR);
3817 VALIDATORS.put(POINTER_LOCATION, POINTER_LOCATION_VALIDATOR);
3818 VALIDATORS.put(SHOW_TOUCHES, SHOW_TOUCHES_VALIDATOR);
3819 VALIDATORS.put(WINDOW_ORIENTATION_LISTENER_LOG,
3820 WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR);
3821 VALIDATORS.put(LOCKSCREEN_SOUNDS_ENABLED, LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR);
3822 VALIDATORS.put(LOCKSCREEN_DISABLED, LOCKSCREEN_DISABLED_VALIDATOR);
3823 VALIDATORS.put(SIP_RECEIVE_CALLS, SIP_RECEIVE_CALLS_VALIDATOR);
3824 VALIDATORS.put(SIP_CALL_OPTIONS, SIP_CALL_OPTIONS_VALIDATOR);
3825 VALIDATORS.put(SIP_ALWAYS, SIP_ALWAYS_VALIDATOR);
3826 VALIDATORS.put(SIP_ADDRESS_ONLY, SIP_ADDRESS_ONLY_VALIDATOR);
3827 VALIDATORS.put(SIP_ASK_ME_EACH_TIME, SIP_ASK_ME_EACH_TIME_VALIDATOR);
3828 VALIDATORS.put(POINTER_SPEED, POINTER_SPEED_VALIDATOR);
3829 VALIDATORS.put(LOCK_TO_APP_ENABLED, LOCK_TO_APP_ENABLED_VALIDATOR);
3830 VALIDATORS.put(EGG_MODE, EGG_MODE_VALIDATOR);
3831 VALIDATORS.put(WIFI_STATIC_IP, WIFI_STATIC_IP_VALIDATOR);
3832 VALIDATORS.put(WIFI_STATIC_GATEWAY, WIFI_STATIC_GATEWAY_VALIDATOR);
3833 VALIDATORS.put(WIFI_STATIC_NETMASK, WIFI_STATIC_NETMASK_VALIDATOR);
3834 VALIDATORS.put(WIFI_STATIC_DNS1, WIFI_STATIC_DNS1_VALIDATOR);
3835 VALIDATORS.put(WIFI_STATIC_DNS2, WIFI_STATIC_DNS2_VALIDATOR);
3836 }
3837
3838 /**
3839 * These entries are considered common between the personal and the managed profile,
3840 * since the managed profile doesn't get to change them.
3841 */
3842 private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>();
3843 static {
3844 CLONE_TO_MANAGED_PROFILE.add(DATE_FORMAT);
3845 CLONE_TO_MANAGED_PROFILE.add(HAPTIC_FEEDBACK_ENABLED);
3846 CLONE_TO_MANAGED_PROFILE.add(SOUND_EFFECTS_ENABLED);
3847 CLONE_TO_MANAGED_PROFILE.add(TEXT_SHOW_PASSWORD);
3848 CLONE_TO_MANAGED_PROFILE.add(TIME_12_24);
3849 }
3850
3851 /** @hide */
3852 public static void getCloneToManagedProfileSettings(Set<String> outKeySet) {
3853 outKeySet.addAll(CLONE_TO_MANAGED_PROFILE);
3854 }
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07003855
3856 /**
Sailesh Nepal1bd78762014-02-11 22:32:21 -08003857 * When to use Wi-Fi calling
3858 *
3859 * @see android.telephony.TelephonyManager.WifiCallingChoices
3860 * @hide
3861 */
3862 public static final String WHEN_TO_MAKE_WIFI_CALLS = "when_to_make_wifi_calls";
3863
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003864 // Settings moved to Settings.Secure
3865
3866 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003867 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003868 * instead
3869 */
3870 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003871 public static final String ADB_ENABLED = Global.ADB_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003872
3873 /**
3874 * @deprecated Use {@link android.provider.Settings.Secure#ANDROID_ID} instead
3875 */
3876 @Deprecated
3877 public static final String ANDROID_ID = Secure.ANDROID_ID;
3878
3879 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003880 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003881 */
3882 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003883 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003884
3885 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003886 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003887 */
3888 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003889 public static final String DATA_ROAMING = Global.DATA_ROAMING;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003890
3891 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003892 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003893 */
3894 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003895 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003896
3897 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07003898 * @deprecated Use {@link android.provider.Settings.Global#HTTP_PROXY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003899 */
3900 @Deprecated
Jeff Sharkey625239a2012-09-26 22:03:49 -07003901 public static final String HTTP_PROXY = Global.HTTP_PROXY;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003902
3903 /**
Christopher Tateaa036a22014-05-19 16:33:27 -07003904 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003905 */
3906 @Deprecated
Christopher Tateaa036a22014-05-19 16:33:27 -07003907 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003908
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003909 /**
3910 * @deprecated Use {@link android.provider.Settings.Secure#LOCATION_PROVIDERS_ALLOWED}
3911 * instead
3912 */
3913 @Deprecated
3914 public static final String LOCATION_PROVIDERS_ALLOWED = Secure.LOCATION_PROVIDERS_ALLOWED;
3915
3916 /**
3917 * @deprecated Use {@link android.provider.Settings.Secure#LOGGING_ID} instead
3918 */
3919 @Deprecated
3920 public static final String LOGGING_ID = Secure.LOGGING_ID;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003921
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003922 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003923 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003924 */
3925 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003926 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003927
3928 /**
3929 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_ENABLED}
3930 * instead
3931 */
3932 @Deprecated
3933 public static final String PARENTAL_CONTROL_ENABLED = Secure.PARENTAL_CONTROL_ENABLED;
3934
3935 /**
3936 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_LAST_UPDATE}
3937 * instead
3938 */
3939 @Deprecated
3940 public static final String PARENTAL_CONTROL_LAST_UPDATE = Secure.PARENTAL_CONTROL_LAST_UPDATE;
3941
3942 /**
3943 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_REDIRECT_URL}
3944 * instead
3945 */
3946 @Deprecated
3947 public static final String PARENTAL_CONTROL_REDIRECT_URL =
3948 Secure.PARENTAL_CONTROL_REDIRECT_URL;
3949
3950 /**
3951 * @deprecated Use {@link android.provider.Settings.Secure#SETTINGS_CLASSNAME} instead
3952 */
3953 @Deprecated
3954 public static final String SETTINGS_CLASSNAME = Secure.SETTINGS_CLASSNAME;
3955
3956 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003957 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003958 */
3959 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003960 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003961
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003962 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003963 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003964 */
3965 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003966 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003967
Dianne Hackborn4a51c202009-08-21 15:14:02 -07003968 /**
3969 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07003970 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
Dianne Hackborn4a51c202009-08-21 15:14:02 -07003971 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003972 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003973 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 -08003974
Dianne Hackborn4a51c202009-08-21 15:14:02 -07003975 /**
3976 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07003977 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
Dianne Hackborn4a51c202009-08-21 15:14:02 -07003978 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003979 @Deprecated
3980 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
Christopher Tate06efb532012-08-24 15:29:27 -07003981 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003982
3983 /**
3984 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07003985 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003986 */
3987 @Deprecated
3988 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
Christopher Tate06efb532012-08-24 15:29:27 -07003989 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003990
3991 /**
3992 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07003993 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003994 */
3995 @Deprecated
3996 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
Christopher Tate06efb532012-08-24 15:29:27 -07003997 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003998
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003999 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004000 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004001 * instead
4002 */
4003 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07004004 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 -08004005
4006 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004007 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004008 */
4009 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07004010 public static final String WIFI_ON = Global.WIFI_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004011
4012 /**
4013 * @deprecated Use
4014 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE}
4015 * instead
4016 */
4017 @Deprecated
4018 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
4019 Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE;
4020
4021 /**
4022 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_AP_COUNT} instead
4023 */
4024 @Deprecated
4025 public static final String WIFI_WATCHDOG_AP_COUNT = Secure.WIFI_WATCHDOG_AP_COUNT;
4026
4027 /**
4028 * @deprecated Use
4029 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS} instead
4030 */
4031 @Deprecated
4032 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
4033 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004034
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004035 /**
4036 * @deprecated Use
4037 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED} instead
4038 */
4039 @Deprecated
4040 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
4041 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED;
4042
4043 /**
4044 * @deprecated Use
4045 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS}
4046 * instead
4047 */
4048 @Deprecated
4049 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
4050 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS;
4051
4052 /**
4053 * @deprecated Use
4054 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT} instead
4055 */
4056 @Deprecated
4057 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
4058 Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT;
4059
4060 /**
4061 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_MAX_AP_CHECKS}
4062 * instead
4063 */
4064 @Deprecated
4065 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = Secure.WIFI_WATCHDOG_MAX_AP_CHECKS;
4066
4067 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004068 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004069 */
4070 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07004071 public static final String WIFI_WATCHDOG_ON = Global.WIFI_WATCHDOG_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004072
4073 /**
4074 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_COUNT} instead
4075 */
4076 @Deprecated
4077 public static final String WIFI_WATCHDOG_PING_COUNT = Secure.WIFI_WATCHDOG_PING_COUNT;
4078
4079 /**
4080 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_DELAY_MS}
4081 * instead
4082 */
4083 @Deprecated
4084 public static final String WIFI_WATCHDOG_PING_DELAY_MS = Secure.WIFI_WATCHDOG_PING_DELAY_MS;
4085
4086 /**
4087 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_TIMEOUT_MS}
4088 * instead
4089 */
4090 @Deprecated
4091 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS =
4092 Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS;
Billy Lau6ad2d662015-07-18 00:26:58 +01004093
4094 /**
Trevor Johns682c24e2016-04-12 10:13:47 -07004095 * Checks if the specified app can modify system settings. As of API
4096 * level 23, an app cannot modify system settings unless it declares the
4097 * {@link android.Manifest.permission#WRITE_SETTINGS}
4098 * permission in its manifest, <em>and</em> the user specifically grants
4099 * the app this capability. To prompt the user to grant this approval,
4100 * the app must send an intent with the action {@link
4101 * android.provider.Settings#ACTION_MANAGE_WRITE_SETTINGS}, which causes
4102 * the system to display a permission management screen.
Billy Lau6ad2d662015-07-18 00:26:58 +01004103 *
Trevor Johns682c24e2016-04-12 10:13:47 -07004104 * @param context App context.
Billy Lau6ad2d662015-07-18 00:26:58 +01004105 * @return true if the calling app can write to system settings, false otherwise
4106 */
4107 public static boolean canWrite(Context context) {
Svet Ganov94ba40172016-04-03 22:04:22 -07004108 return isCallingPackageAllowedToWriteSettings(context, Process.myUid(),
4109 context.getOpPackageName(), false);
Billy Lau6ad2d662015-07-18 00:26:58 +01004110 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004111 }
4112
4113 /**
4114 * Secure system settings, containing system preferences that applications
4115 * can read but are not allowed to write. These are for preferences that
4116 * the user must explicitly modify through the system UI or specialized
4117 * APIs for those values, not modified directly by applications.
4118 */
4119 public static final class Secure extends NameValueTable {
Dianne Hackborn139748f2012-09-24 11:36:57 -07004120 /**
4121 * The content:// style URL for this table
4122 */
4123 public static final Uri CONTENT_URI =
4124 Uri.parse("content://" + AUTHORITY + "/secure");
4125
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08004126 // Populated lazily, guarded by class object:
Dianne Hackborn139748f2012-09-24 11:36:57 -07004127 private static final NameValueCache sNameValueCache = new NameValueCache(
Dianne Hackborn139748f2012-09-24 11:36:57 -07004128 CONTENT_URI,
4129 CALL_METHOD_GET_SECURE,
4130 CALL_METHOD_PUT_SECURE);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004131
Amith Yamasani52c489c2012-03-28 11:42:42 -07004132 private static ILockSettings sLockSettings = null;
4133
Amith Yamasani7ab8c4a2012-04-06 09:27:12 -07004134 private static boolean sIsSystemProcess;
Amith Yamasani52c489c2012-03-28 11:42:42 -07004135 private static final HashSet<String> MOVED_TO_LOCK_SETTINGS;
Christopher Tate06efb532012-08-24 15:29:27 -07004136 private static final HashSet<String> MOVED_TO_GLOBAL;
Amith Yamasani52c489c2012-03-28 11:42:42 -07004137 static {
4138 MOVED_TO_LOCK_SETTINGS = new HashSet<String>(3);
4139 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_ENABLED);
4140 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_VISIBLE);
4141 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
Christopher Tate06efb532012-08-24 15:29:27 -07004142
4143 MOVED_TO_GLOBAL = new HashSet<String>();
4144 MOVED_TO_GLOBAL.add(Settings.Global.ADB_ENABLED);
4145 MOVED_TO_GLOBAL.add(Settings.Global.ASSISTED_GPS_ENABLED);
4146 MOVED_TO_GLOBAL.add(Settings.Global.BLUETOOTH_ON);
Christopher Tate58f41ec2013-01-11 15:40:36 -08004147 MOVED_TO_GLOBAL.add(Settings.Global.BUGREPORT_IN_POWER_MENU);
Christopher Tate06efb532012-08-24 15:29:27 -07004148 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_CELL_BROADCAST_SMS);
4149 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_ROAMING_MODE);
4150 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_SUBSCRIPTION_MODE);
4151 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_MOBILE);
4152 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_WIFI);
4153 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ROAMING);
4154 MOVED_TO_GLOBAL.add(Settings.Global.DEVELOPMENT_SETTINGS_ENABLED);
4155 MOVED_TO_GLOBAL.add(Settings.Global.DEVICE_PROVISIONED);
Christopher Tate06efb532012-08-24 15:29:27 -07004156 MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_SIZE_FORCED);
4157 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_MAX_BYTES_OVER_MOBILE);
4158 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE);
Christopher Tate06efb532012-08-24 15:29:27 -07004159 MOVED_TO_GLOBAL.add(Settings.Global.MOBILE_DATA);
4160 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_BUCKET_DURATION);
4161 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_DELETE_AGE);
4162 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_PERSIST_BYTES);
4163 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_ROTATE_AGE);
4164 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_ENABLED);
4165 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_GLOBAL_ALERT_BYTES);
4166 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_POLL_INTERVAL);
Christopher Tate06efb532012-08-24 15:29:27 -07004167 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_SAMPLE_ENABLED);
4168 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_TIME_CACHE_MAX_AGE);
4169 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_BUCKET_DURATION);
4170 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_DELETE_AGE);
4171 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_PERSIST_BYTES);
4172 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_ROTATE_AGE);
4173 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_BUCKET_DURATION);
4174 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_DELETE_AGE);
4175 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_PERSIST_BYTES);
4176 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_ROTATE_AGE);
4177 MOVED_TO_GLOBAL.add(Settings.Global.NETWORK_PREFERENCE);
4178 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_DIFF);
4179 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_SPACING);
4180 MOVED_TO_GLOBAL.add(Settings.Global.NTP_SERVER);
4181 MOVED_TO_GLOBAL.add(Settings.Global.NTP_TIMEOUT);
4182 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_ERROR_POLL_COUNT);
4183 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_LONG_POLL_INTERVAL_MS);
4184 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT);
4185 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_POLL_INTERVAL_MS);
4186 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_TRIGGER_PACKET_COUNT);
4187 MOVED_TO_GLOBAL.add(Settings.Global.SAMPLING_PROFILER_MS);
4188 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DATA_SERVICE_URL);
4189 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_REDIR_HOST);
4190 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_TARGET_URL);
4191 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_APN);
4192 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_REQUIRED);
4193 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_SUPPORTED);
Christopher Tate06efb532012-08-24 15:29:27 -07004194 MOVED_TO_GLOBAL.add(Settings.Global.USB_MASS_STORAGE_ENABLED);
4195 MOVED_TO_GLOBAL.add(Settings.Global.USE_GOOGLE_MAIL);
Robert Greenwalt3ea0c992013-10-03 21:13:49 +00004196 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_COUNTRY_CODE);
Christopher Tate06efb532012-08-24 15:29:27 -07004197 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FRAMEWORK_SCAN_INTERVAL_MS);
4198 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FREQUENCY_BAND);
4199 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_IDLE_MS);
4200 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MAX_DHCP_RETRY_COUNT);
4201 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS);
4202 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
4203 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
4204 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NUM_OPEN_NETWORKS_KEPT);
4205 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ON);
4206 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_P2P_DEVICE_NAME);
4207 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SAVED_STATE);
4208 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUPPLICANT_SCAN_INTERVAL_MS);
4209 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUSPEND_OPTIMIZATIONS_ENABLED);
Nathan Harold29589fc2016-03-30 21:53:48 -07004210 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_VERBOSE_LOGGING_ENABLED);
vandwalle7c3606c2014-03-31 19:12:07 -07004211 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ENHANCED_AUTO_JOIN);
4212 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORK_SHOW_RSSI);
Christopher Tate06efb532012-08-24 15:29:27 -07004213 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_ON);
4214 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED);
Christopher Tate06efb532012-08-24 15:29:27 -07004215 MOVED_TO_GLOBAL.add(Settings.Global.WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON);
Christopher Tatec868b642012-09-12 17:41:04 -07004216 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_ENABLE);
4217 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_TIMEOUT);
4218 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_DEFAULT_RESPONSE);
4219 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS);
4220 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS);
4221 MOVED_TO_GLOBAL.add(Settings.Global.GPRS_REGISTER_CHECK_PERIOD_MS);
Christopher Tate06efb532012-08-24 15:29:27 -07004222 MOVED_TO_GLOBAL.add(Settings.Global.WTF_IS_FATAL);
Jeff Sharkey625239a2012-09-26 22:03:49 -07004223 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_DURATION_THRESHOLD);
4224 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_THRESHOLD);
4225 MOVED_TO_GLOBAL.add(Settings.Global.SEND_ACTION_APP_ERROR);
4226 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_AGE_SECONDS);
4227 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_MAX_FILES);
4228 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_KB);
4229 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_PERCENT);
4230 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_RESERVE_PERCENT);
4231 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_TAG_PREFIX);
4232 MOVED_TO_GLOBAL.add(Settings.Global.ERROR_LOGCAT_PREFIX);
4233 MOVED_TO_GLOBAL.add(Settings.Global.SYS_FREE_STORAGE_LOG_INTERVAL);
4234 MOVED_TO_GLOBAL.add(Settings.Global.DISK_FREE_CHANGE_REPORTING_THRESHOLD);
4235 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_PERCENTAGE);
4236 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_MAX_BYTES);
4237 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_FULL_THRESHOLD_BYTES);
4238 MOVED_TO_GLOBAL.add(Settings.Global.SYNC_MAX_RETRY_DELAY_IN_SECONDS);
4239 MOVED_TO_GLOBAL.add(Settings.Global.CONNECTIVITY_CHANGE_DELAY);
4240 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED);
4241 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_SERVER);
4242 MOVED_TO_GLOBAL.add(Settings.Global.NSD_ON);
4243 MOVED_TO_GLOBAL.add(Settings.Global.SET_INSTALL_LOCATION);
4244 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_INSTALL_LOCATION);
4245 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_UP_DELAY);
4246 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_DOWN_DELAY);
4247 MOVED_TO_GLOBAL.add(Settings.Global.READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT);
4248 MOVED_TO_GLOBAL.add(Settings.Global.HTTP_PROXY);
4249 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_HOST);
4250 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_PORT);
4251 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST);
4252 MOVED_TO_GLOBAL.add(Settings.Global.SET_GLOBAL_HTTP_PROXY);
4253 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_DNS_SERVER);
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07004254 MOVED_TO_GLOBAL.add(Settings.Global.PREFERRED_NETWORK_MODE);
Hui Shu22671772014-10-01 21:41:07 +00004255 MOVED_TO_GLOBAL.add(Settings.Global.WEBVIEW_DATA_REDUCTION_PROXY_KEY);
Christopher Tate06efb532012-08-24 15:29:27 -07004256 }
4257
Christopher Tate66488d62012-10-02 11:58:01 -07004258 /** @hide */
Svetoslav683914b2015-01-15 14:22:26 -08004259 public static void getMovedToGlobalSettings(Set<String> outKeySet) {
Christopher Tate66488d62012-10-02 11:58:01 -07004260 outKeySet.addAll(MOVED_TO_GLOBAL);
4261 }
4262
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004263 /**
4264 * Look up a name in the database.
4265 * @param resolver to access the database with
4266 * @param name to look up in the table
4267 * @return the corresponding value, or null if not present
4268 */
Dianne Hackborn139748f2012-09-24 11:36:57 -07004269 public static String getString(ContentResolver resolver, String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07004270 return getStringForUser(resolver, name, UserHandle.myUserId());
4271 }
4272
4273 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -07004274 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -07004275 int userHandle) {
4276 if (MOVED_TO_GLOBAL.contains(name)) {
4277 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
4278 + " to android.provider.Settings.Global.");
4279 return Global.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004280 }
Amith Yamasani52c489c2012-03-28 11:42:42 -07004281
Dianne Hackborn139748f2012-09-24 11:36:57 -07004282 if (MOVED_TO_LOCK_SETTINGS.contains(name)) {
4283 synchronized (Secure.class) {
4284 if (sLockSettings == null) {
4285 sLockSettings = ILockSettings.Stub.asInterface(
4286 (IBinder) ServiceManager.getService("lock_settings"));
4287 sIsSystemProcess = Process.myUid() == Process.SYSTEM_UID;
4288 }
4289 }
4290 if (sLockSettings != null && !sIsSystemProcess) {
Adrian Roos7811d9f2015-07-27 15:10:13 -07004291 // No context; use the ActivityThread's context as an approximation for
4292 // determining the target API level.
4293 Application application = ActivityThread.currentApplication();
4294
4295 boolean isPreMnc = application != null
4296 && application.getApplicationInfo() != null
4297 && application.getApplicationInfo().targetSdkVersion
4298 <= VERSION_CODES.LOLLIPOP_MR1;
4299 if (isPreMnc) {
4300 try {
4301 return sLockSettings.getString(name, "0", userHandle);
4302 } catch (RemoteException re) {
4303 // Fall through
4304 }
4305 } else {
4306 throw new SecurityException("Settings.Secure." + name
4307 + " is deprecated and no longer accessible."
4308 + " See API documentation for potential replacements.");
Dianne Hackborn139748f2012-09-24 11:36:57 -07004309 }
Amith Yamasani52c489c2012-03-28 11:42:42 -07004310 }
4311 }
4312
Christopher Tate06efb532012-08-24 15:29:27 -07004313 return sNameValueCache.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004314 }
4315
4316 /**
4317 * Store a name/value pair into the database.
4318 * @param resolver to access the database with
4319 * @param name to store
4320 * @param value to associate with the name
4321 * @return true if the value was set, false on database errors
4322 */
Christopher Tate06efb532012-08-24 15:29:27 -07004323 public static boolean putString(ContentResolver resolver, String name, String value) {
4324 return putStringForUser(resolver, name, value, UserHandle.myUserId());
4325 }
4326
4327 /** @hide */
4328 public static boolean putStringForUser(ContentResolver resolver, String name, String value,
4329 int userHandle) {
Julia Reynolds82735bc2014-09-04 16:43:30 -04004330 if (LOCATION_MODE.equals(name)) {
4331 // HACK ALERT: temporary hack to work around b/10491283.
4332 // TODO: once b/10491283 fixed, remove this hack
4333 return setLocationModeForUser(resolver, Integer.parseInt(value), userHandle);
4334 }
Christopher Tate06efb532012-08-24 15:29:27 -07004335 if (MOVED_TO_GLOBAL.contains(name)) {
4336 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
4337 + " to android.provider.Settings.Global");
4338 return Global.putStringForUser(resolver, name, value, userHandle);
4339 }
Christopher Tate06efb532012-08-24 15:29:27 -07004340 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004341 }
4342
4343 /**
4344 * Construct the content URI for a particular name/value pair,
4345 * useful for monitoring changes with a ContentObserver.
4346 * @param name to look up in the table
4347 * @return the corresponding content URI, or null if not present
4348 */
4349 public static Uri getUriFor(String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07004350 if (MOVED_TO_GLOBAL.contains(name)) {
4351 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
4352 + " to android.provider.Settings.Global, returning global URI.");
4353 return Global.getUriFor(Global.CONTENT_URI, name);
4354 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004355 return getUriFor(CONTENT_URI, name);
4356 }
4357
4358 /**
4359 * Convenience function for retrieving a single secure settings value
4360 * as an integer. Note that internally setting values are always
4361 * stored as strings; this function converts the string to an integer
4362 * for you. The default value will be returned if the setting is
4363 * not defined or not an integer.
4364 *
4365 * @param cr The ContentResolver to access.
4366 * @param name The name of the setting to retrieve.
4367 * @param def Value to return if the setting is not defined.
4368 *
4369 * @return The setting's current value, or 'def' if it is not defined
4370 * or not a valid integer.
4371 */
4372 public static int getInt(ContentResolver cr, String name, int def) {
Christopher Tate06efb532012-08-24 15:29:27 -07004373 return getIntForUser(cr, name, def, UserHandle.myUserId());
4374 }
4375
4376 /** @hide */
4377 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
Tom O'Neill7f6f4572013-08-27 10:53:15 -07004378 if (LOCATION_MODE.equals(name)) {
4379 // HACK ALERT: temporary hack to work around b/10491283.
4380 // TODO: once b/10491283 fixed, remove this hack
4381 return getLocationModeForUser(cr, userHandle);
4382 }
Christopher Tate06efb532012-08-24 15:29:27 -07004383 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004384 try {
4385 return v != null ? Integer.parseInt(v) : def;
4386 } catch (NumberFormatException e) {
4387 return def;
4388 }
4389 }
4390
4391 /**
4392 * Convenience function for retrieving a single secure settings value
4393 * as an integer. Note that internally setting values are always
4394 * stored as strings; this function converts the string to an integer
4395 * for you.
4396 * <p>
4397 * This version does not take a default value. If the setting has not
4398 * been set, or the string value is not a number,
4399 * it throws {@link SettingNotFoundException}.
4400 *
4401 * @param cr The ContentResolver to access.
4402 * @param name The name of the setting to retrieve.
4403 *
4404 * @throws SettingNotFoundException Thrown if a setting by the given
4405 * name can't be found or the setting value is not an integer.
4406 *
4407 * @return The setting's current value.
4408 */
4409 public static int getInt(ContentResolver cr, String name)
4410 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07004411 return getIntForUser(cr, name, UserHandle.myUserId());
4412 }
4413
4414 /** @hide */
4415 public static int getIntForUser(ContentResolver cr, String name, int userHandle)
4416 throws SettingNotFoundException {
Tom O'Neill7f6f4572013-08-27 10:53:15 -07004417 if (LOCATION_MODE.equals(name)) {
4418 // HACK ALERT: temporary hack to work around b/10491283.
4419 // TODO: once b/10491283 fixed, remove this hack
4420 return getLocationModeForUser(cr, userHandle);
4421 }
Christopher Tate06efb532012-08-24 15:29:27 -07004422 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004423 try {
4424 return Integer.parseInt(v);
4425 } catch (NumberFormatException e) {
4426 throw new SettingNotFoundException(name);
4427 }
4428 }
4429
4430 /**
4431 * Convenience function for updating a single settings value as an
4432 * integer. This will either create a new entry in the table if the
4433 * given name does not exist, or modify the value of the existing row
4434 * with that name. Note that internally setting values are always
4435 * stored as strings, so this function converts the given value to a
4436 * string before storing it.
4437 *
4438 * @param cr The ContentResolver to access.
4439 * @param name The name of the setting to modify.
4440 * @param value The new value for the setting.
4441 * @return true if the value was set, false on database errors
4442 */
4443 public static boolean putInt(ContentResolver cr, String name, int value) {
Christopher Tate06efb532012-08-24 15:29:27 -07004444 return putIntForUser(cr, name, value, UserHandle.myUserId());
4445 }
4446
4447 /** @hide */
4448 public static boolean putIntForUser(ContentResolver cr, String name, int value,
4449 int userHandle) {
4450 return putStringForUser(cr, name, Integer.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004451 }
4452
4453 /**
4454 * Convenience function for retrieving a single secure settings value
4455 * as a {@code long}. Note that internally setting values are always
4456 * stored as strings; this function converts the string to a {@code long}
4457 * for you. The default value will be returned if the setting is
4458 * not defined or not a {@code long}.
4459 *
4460 * @param cr The ContentResolver to access.
4461 * @param name The name of the setting to retrieve.
4462 * @param def Value to return if the setting is not defined.
4463 *
4464 * @return The setting's current value, or 'def' if it is not defined
4465 * or not a valid {@code long}.
4466 */
4467 public static long getLong(ContentResolver cr, String name, long def) {
Christopher Tate06efb532012-08-24 15:29:27 -07004468 return getLongForUser(cr, name, def, UserHandle.myUserId());
4469 }
4470
4471 /** @hide */
4472 public static long getLongForUser(ContentResolver cr, String name, long def,
4473 int userHandle) {
4474 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004475 long value;
4476 try {
4477 value = valString != null ? Long.parseLong(valString) : def;
4478 } catch (NumberFormatException e) {
4479 value = def;
4480 }
4481 return value;
4482 }
4483
4484 /**
4485 * Convenience function for retrieving a single secure settings value
4486 * as a {@code long}. Note that internally setting values are always
4487 * stored as strings; this function converts the string to a {@code long}
4488 * for you.
4489 * <p>
4490 * This version does not take a default value. If the setting has not
4491 * been set, or the string value is not a number,
4492 * it throws {@link SettingNotFoundException}.
4493 *
4494 * @param cr The ContentResolver to access.
4495 * @param name The name of the setting to retrieve.
4496 *
4497 * @return The setting's current value.
4498 * @throws SettingNotFoundException Thrown if a setting by the given
4499 * name can't be found or the setting value is not an integer.
4500 */
4501 public static long getLong(ContentResolver cr, String name)
4502 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07004503 return getLongForUser(cr, name, UserHandle.myUserId());
4504 }
4505
4506 /** @hide */
4507 public static long getLongForUser(ContentResolver cr, String name, int userHandle)
4508 throws SettingNotFoundException {
4509 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004510 try {
4511 return Long.parseLong(valString);
4512 } catch (NumberFormatException e) {
4513 throw new SettingNotFoundException(name);
4514 }
4515 }
4516
4517 /**
4518 * Convenience function for updating a secure settings value as a long
4519 * integer. This will either create a new entry in the table if the
4520 * given name does not exist, or modify the value of the existing row
4521 * with that name. Note that internally setting values are always
4522 * stored as strings, so this function converts the given value to a
4523 * string before storing it.
4524 *
4525 * @param cr The ContentResolver to access.
4526 * @param name The name of the setting to modify.
4527 * @param value The new value for the setting.
4528 * @return true if the value was set, false on database errors
4529 */
4530 public static boolean putLong(ContentResolver cr, String name, long value) {
Christopher Tate06efb532012-08-24 15:29:27 -07004531 return putLongForUser(cr, name, value, UserHandle.myUserId());
4532 }
4533
4534 /** @hide */
4535 public static boolean putLongForUser(ContentResolver cr, String name, long value,
4536 int userHandle) {
4537 return putStringForUser(cr, name, Long.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004538 }
4539
4540 /**
4541 * Convenience function for retrieving a single secure settings value
4542 * as a floating point number. Note that internally setting values are
4543 * always stored as strings; this function converts the string to an
4544 * float for you. The default value will be returned if the setting
4545 * is not defined or not a valid float.
4546 *
4547 * @param cr The ContentResolver to access.
4548 * @param name The name of the setting to retrieve.
4549 * @param def Value to return if the setting is not defined.
4550 *
4551 * @return The setting's current value, or 'def' if it is not defined
4552 * or not a valid float.
4553 */
4554 public static float getFloat(ContentResolver cr, String name, float def) {
Christopher Tate06efb532012-08-24 15:29:27 -07004555 return getFloatForUser(cr, name, def, UserHandle.myUserId());
4556 }
4557
4558 /** @hide */
4559 public static float getFloatForUser(ContentResolver cr, String name, float def,
4560 int userHandle) {
4561 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004562 try {
4563 return v != null ? Float.parseFloat(v) : def;
4564 } catch (NumberFormatException e) {
4565 return def;
4566 }
4567 }
4568
4569 /**
4570 * Convenience function for retrieving a single secure settings value
4571 * as a float. Note that internally setting values are always
4572 * stored as strings; this function converts the string to a float
4573 * for you.
4574 * <p>
4575 * This version does not take a default value. If the setting has not
4576 * been set, or the string value is not a number,
4577 * it throws {@link SettingNotFoundException}.
4578 *
4579 * @param cr The ContentResolver to access.
4580 * @param name The name of the setting to retrieve.
4581 *
4582 * @throws SettingNotFoundException Thrown if a setting by the given
4583 * name can't be found or the setting value is not a float.
4584 *
4585 * @return The setting's current value.
4586 */
4587 public static float getFloat(ContentResolver cr, String name)
4588 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07004589 return getFloatForUser(cr, name, UserHandle.myUserId());
4590 }
4591
4592 /** @hide */
4593 public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
4594 throws SettingNotFoundException {
4595 String v = getStringForUser(cr, name, userHandle);
Brian Muramatsue1d46982010-12-06 17:34:20 -08004596 if (v == null) {
4597 throw new SettingNotFoundException(name);
4598 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004599 try {
4600 return Float.parseFloat(v);
4601 } catch (NumberFormatException e) {
4602 throw new SettingNotFoundException(name);
4603 }
4604 }
4605
4606 /**
4607 * Convenience function for updating a single settings value as a
4608 * floating point number. This will either create a new entry in the
4609 * table if the given name does not exist, or modify the value of the
4610 * existing row with that name. Note that internally setting values
4611 * are always stored as strings, so this function converts the given
4612 * value to a string before storing it.
4613 *
4614 * @param cr The ContentResolver to access.
4615 * @param name The name of the setting to modify.
4616 * @param value The new value for the setting.
4617 * @return true if the value was set, false on database errors
4618 */
4619 public static boolean putFloat(ContentResolver cr, String name, float value) {
Christopher Tate06efb532012-08-24 15:29:27 -07004620 return putFloatForUser(cr, name, value, UserHandle.myUserId());
4621 }
4622
4623 /** @hide */
4624 public static boolean putFloatForUser(ContentResolver cr, String name, float value,
4625 int userHandle) {
4626 return putStringForUser(cr, name, Float.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004627 }
4628
4629 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004630 * @deprecated Use {@link android.provider.Settings.Global#DEVELOPMENT_SETTINGS_ENABLED}
4631 * instead
Dianne Hackborn895f99e2012-02-02 11:49:12 -08004632 */
Christopher Tate06efb532012-08-24 15:29:27 -07004633 @Deprecated
4634 public static final String DEVELOPMENT_SETTINGS_ENABLED =
4635 Global.DEVELOPMENT_SETTINGS_ENABLED;
Dianne Hackborn895f99e2012-02-02 11:49:12 -08004636
4637 /**
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07004638 * When the user has enable the option to have a "bug report" command
4639 * in the power menu.
Christopher Tate58f41ec2013-01-11 15:40:36 -08004640 * @deprecated Use {@link android.provider.Settings.Global#BUGREPORT_IN_POWER_MENU} instead
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07004641 * @hide
4642 */
Christopher Tate58f41ec2013-01-11 15:40:36 -08004643 @Deprecated
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07004644 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
4645
4646 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004647 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004648 */
Christopher Tate06efb532012-08-24 15:29:27 -07004649 @Deprecated
4650 public static final String ADB_ENABLED = Global.ADB_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004651
4652 /**
4653 * Setting to allow mock locations and location provider status to be injected into the
4654 * LocationManager service for testing purposes during application development. These
4655 * locations and status values override actual location and status information generated
4656 * by network, gps, or other location providers.
Svet Ganovf7e9cf42015-05-13 10:40:31 -07004657 *
4658 * @deprecated This settings is not used anymore.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004659 */
Svet Ganovf7e9cf42015-05-13 10:40:31 -07004660 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004661 public static final String ALLOW_MOCK_LOCATION = "mock_location";
4662
4663 /**
Doug Zongkerd8893db2010-01-26 12:29:44 -08004664 * A 64-bit number (as a hex string) that is randomly
Scott Main44895332013-11-12 09:23:13 -08004665 * generated when the user first sets up the device and should remain
4666 * constant for the lifetime of the user's device. The value may
4667 * change if a factory reset is performed on the device.
4668 * <p class="note"><strong>Note:</strong> When a device has <a
4669 * href="{@docRoot}about/versions/android-4.2.html#MultipleUsers">multiple users</a>
4670 * (available on certain devices running Android 4.2 or higher), each user appears as a
4671 * completely separate device, so the {@code ANDROID_ID} value is unique to each
4672 * user.</p>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004673 */
4674 public static final String ANDROID_ID = "android_id";
4675
4676 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004677 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004678 */
Christopher Tate06efb532012-08-24 15:29:27 -07004679 @Deprecated
4680 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004681
4682 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004683 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004684 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07004685 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07004686 public static final String DATA_ROAMING = Global.DATA_ROAMING;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004687
4688 /**
4689 * Setting to record the input method used by default, holding the ID
4690 * of the desired method.
4691 */
4692 public static final String DEFAULT_INPUT_METHOD = "default_input_method";
4693
4694 /**
satokab751aa2010-09-14 19:17:36 +09004695 * Setting to record the input method subtype used by default, holding the ID
4696 * of the desired method.
4697 */
4698 public static final String SELECTED_INPUT_METHOD_SUBTYPE =
4699 "selected_input_method_subtype";
4700
4701 /**
satok723a27e2010-11-11 14:58:11 +09004702 * Setting to record the history of input method subtype, holding the pair of ID of IME
4703 * and its last used subtype.
4704 * @hide
4705 */
4706 public static final String INPUT_METHODS_SUBTYPE_HISTORY =
4707 "input_methods_subtype_history";
4708
4709 /**
satok5c58dfc2010-12-14 21:54:47 +09004710 * Setting to record the visibility of input method selector
4711 */
4712 public static final String INPUT_METHOD_SELECTOR_VISIBILITY =
4713 "input_method_selector_visibility";
4714
4715 /**
Dianne Hackborn91097de2014-04-04 18:02:06 -07004716 * The currently selected voice interaction service flattened ComponentName.
4717 * @hide
4718 */
Jeff Sharkeya73b8fd2016-01-06 17:02:08 -07004719 @TestApi
Dianne Hackborn91097de2014-04-04 18:02:06 -07004720 public static final String VOICE_INTERACTION_SERVICE = "voice_interaction_service";
4721
4722 /**
Zhihai Xuaf5971e2013-06-10 20:28:31 -07004723 * bluetooth HCI snoop log configuration
4724 * @hide
4725 */
4726 public static final String BLUETOOTH_HCI_LOG =
4727 "bluetooth_hci_log";
4728
4729 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004730 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004731 */
Christopher Tate06efb532012-08-24 15:29:27 -07004732 @Deprecated
4733 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004734
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004735 /**
Russell Brennerde6ae442012-09-26 20:53:10 -07004736 * Whether the current user has been set up via setup wizard (0 = false, 1 = true)
4737 * @hide
4738 */
4739 public static final String USER_SETUP_COMPLETE = "user_setup_complete";
4740
4741 /**
Ido Ofird193c672016-03-01 13:27:54 -08004742 * Prefix for category name that marks whether a suggested action from that category was
4743 * completed.
4744 * @hide
4745 */
4746 public static final String COMPLETED_CATEGORY_PREFIX = "suggested.completed_category.";
4747
4748 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004749 * List of input methods that are currently enabled. This is a string
4750 * containing the IDs of all enabled input methods, each ID separated
4751 * by ':'.
4752 */
4753 public static final String ENABLED_INPUT_METHODS = "enabled_input_methods";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004754
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004755 /**
Amith Yamasanie861ec12010-03-24 21:39:27 -07004756 * List of system input methods that are currently disabled. This is a string
4757 * containing the IDs of all disabled input methods, each ID separated
4758 * by ':'.
4759 * @hide
4760 */
4761 public static final String DISABLED_SYSTEM_INPUT_METHODS = "disabled_system_input_methods";
4762
4763 /**
Michael Wright7b5a96b2014-08-09 19:28:42 -07004764 * Whether to show the IME when a hard keyboard is connected. This is a boolean that
4765 * determines if the IME should be shown when a hard keyboard is attached.
4766 * @hide
4767 */
4768 public static final String SHOW_IME_WITH_HARD_KEYBOARD = "show_ime_with_hard_keyboard";
4769
4770 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07004771 * Host name and port for global http proxy. Uses ':' seperator for
4772 * between host and port.
4773 *
4774 * @deprecated Use {@link Global#HTTP_PROXY}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004775 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07004776 @Deprecated
4777 public static final String HTTP_PROXY = Global.HTTP_PROXY;
Robert Greenwalte90aa5e2010-09-01 11:34:05 -07004778
4779 /**
Robin Lee244ce8e2016-01-05 18:03:46 +00004780 * Package designated as always-on VPN provider.
4781 *
4782 * @hide
4783 */
4784 public static final String ALWAYS_ON_VPN_APP = "always_on_vpn_app";
4785
4786 /**
Robin Lee17e61832016-05-09 13:46:28 +01004787 * Whether to block networking outside of VPN connections while always-on is set.
4788 * @see #ALWAYS_ON_VPN_APP
4789 *
4790 * @hide
4791 */
4792 public static final String ALWAYS_ON_VPN_LOCKDOWN = "always_on_vpn_lockdown";
4793
4794 /**
Christopher Tateaa036a22014-05-19 16:33:27 -07004795 * Whether applications can be installed for this user via the system's
4796 * {@link Intent#ACTION_INSTALL_PACKAGE} mechanism.
4797 *
4798 * <p>1 = permit app installation via the system package installer intent
4799 * <p>0 = do not allow use of the package installer
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004800 */
Christopher Tateaa036a22014-05-19 16:33:27 -07004801 public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004802
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004803 /**
Tom O'Neill923c0dc2014-03-03 11:07:55 -08004804 * Comma-separated list of location providers that activities may access. Do not rely on
4805 * this value being present in settings.db or on ContentObserver notifications on the
4806 * corresponding Uri.
Tom O'Neilla324ac72013-08-26 14:40:23 -07004807 *
Tom O'Neill923c0dc2014-03-03 11:07:55 -08004808 * @deprecated use {@link #LOCATION_MODE} and
4809 * {@link LocationManager#MODE_CHANGED_ACTION} (or
4810 * {@link LocationManager#PROVIDERS_CHANGED_ACTION})
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004811 */
Tom O'Neilla324ac72013-08-26 14:40:23 -07004812 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004813 public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004814
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004815 /**
Tom O'Neill7f6f4572013-08-27 10:53:15 -07004816 * The degree of location access enabled by the user.
Tom O'Neill923c0dc2014-03-03 11:07:55 -08004817 * <p>
Tom O'Neill7f6f4572013-08-27 10:53:15 -07004818 * When used with {@link #putInt(ContentResolver, String, int)}, must be one of {@link
4819 * #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY}, {@link
4820 * #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}. When used with {@link
4821 * #getInt(ContentResolver, String)}, the caller must gracefully handle additional location
4822 * modes that might be added in the future.
Tom O'Neill923c0dc2014-03-03 11:07:55 -08004823 * <p>
4824 * Note: do not rely on this value being present in settings.db or on ContentObserver
4825 * notifications for the corresponding Uri. Use {@link LocationManager#MODE_CHANGED_ACTION}
4826 * to receive changes in this value.
Tom O'Neilla324ac72013-08-26 14:40:23 -07004827 */
4828 public static final String LOCATION_MODE = "location_mode";
Lifu Tangd1fa1d62015-11-25 21:42:44 -08004829 /**
4830 * Stores the previous location mode when {@link #LOCATION_MODE} is set to
4831 * {@link #LOCATION_MODE_OFF}
4832 * @hide
4833 */
4834 public static final String LOCATION_PREVIOUS_MODE = "location_previous_mode";
Tom O'Neilla324ac72013-08-26 14:40:23 -07004835
4836 /**
Lifu Tangd1fa1d62015-11-25 21:42:44 -08004837 * Sets all location providers to the previous states before location was turned off.
4838 * @hide
4839 */
4840 public static final int LOCATION_MODE_PREVIOUS = -1;
4841 /**
Tom O'Neill7f6f4572013-08-27 10:53:15 -07004842 * Location access disabled.
Tom O'Neill1f48b782013-08-19 18:14:56 -07004843 */
4844 public static final int LOCATION_MODE_OFF = 0;
4845 /**
4846 * Network Location Provider disabled, but GPS and other sensors enabled.
4847 */
4848 public static final int LOCATION_MODE_SENSORS_ONLY = 1;
4849 /**
Tom O'Neilld5759432013-09-11 11:03:03 -07004850 * Reduced power usage, such as limiting the number of GPS updates per hour. Requests
4851 * with {@link android.location.Criteria#POWER_HIGH} may be downgraded to
4852 * {@link android.location.Criteria#POWER_MEDIUM}.
Tom O'Neill1f48b782013-08-19 18:14:56 -07004853 */
4854 public static final int LOCATION_MODE_BATTERY_SAVING = 2;
4855 /**
4856 * Best-effort location computation allowed.
4857 */
4858 public static final int LOCATION_MODE_HIGH_ACCURACY = 3;
4859
4860 /**
Danielle Millett925a7d82012-03-19 18:02:20 -04004861 * A flag containing settings used for biometric weak
4862 * @hide
4863 */
Adrian Roos230635e2015-01-07 20:50:29 +01004864 @Deprecated
Danielle Millett925a7d82012-03-19 18:02:20 -04004865 public static final String LOCK_BIOMETRIC_WEAK_FLAGS =
4866 "lock_biometric_weak_flags";
4867
4868 /**
Jason Monk94cfd9d2014-10-31 13:18:21 -04004869 * Whether lock-to-app will lock the keyguard when exiting.
4870 * @hide
4871 */
4872 public static final String LOCK_TO_APP_EXIT_LOCKED = "lock_to_app_exit_locked";
4873
4874 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08004875 * Whether autolock is enabled (0 = false, 1 = true)
Adrian Roos9dd16eb2015-01-08 16:20:49 +01004876 *
4877 * @deprecated Use {@link android.app.KeyguardManager} to determine the state and security
Adrian Roos7811d9f2015-07-27 15:10:13 -07004878 * level of the keyguard. Accessing this setting from an app that is targeting
Deepanshu Guptae836a222015-07-31 12:11:07 -07004879 * {@link VERSION_CODES#M} or later throws a {@code SecurityException}.
Amith Yamasani156c4352010-03-05 17:10:03 -08004880 */
Adrian Roos9dd16eb2015-01-08 16:20:49 +01004881 @Deprecated
Amith Yamasani156c4352010-03-05 17:10:03 -08004882 public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock";
4883
4884 /**
4885 * Whether lock pattern is visible as user enters (0 = false, 1 = true)
Adrian Roos7811d9f2015-07-27 15:10:13 -07004886 *
4887 * @deprecated Accessing this setting from an app that is targeting
Deepanshu Guptae836a222015-07-31 12:11:07 -07004888 * {@link VERSION_CODES#M} or later throws a {@code SecurityException}.
Amith Yamasani156c4352010-03-05 17:10:03 -08004889 */
Adrian Roos7811d9f2015-07-27 15:10:13 -07004890 @Deprecated
Amith Yamasani156c4352010-03-05 17:10:03 -08004891 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
4892
4893 /**
Jeff Sharkey5ed9d682012-10-10 14:28:27 -07004894 * Whether lock pattern will vibrate as user enters (0 = false, 1 =
4895 * true)
4896 *
4897 * @deprecated Starting in {@link VERSION_CODES#JELLY_BEAN_MR1} the
4898 * lockscreen uses
4899 * {@link Settings.System#HAPTIC_FEEDBACK_ENABLED}.
Adrian Roos7811d9f2015-07-27 15:10:13 -07004900 * Accessing this setting from an app that is targeting
Deepanshu Guptae836a222015-07-31 12:11:07 -07004901 * {@link VERSION_CODES#M} or later throws a {@code SecurityException}.
Amith Yamasani156c4352010-03-05 17:10:03 -08004902 */
Jeff Sharkey5ed9d682012-10-10 14:28:27 -07004903 @Deprecated
4904 public static final String
4905 LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = "lock_pattern_tactile_feedback_enabled";
Amith Yamasani156c4352010-03-05 17:10:03 -08004906
4907 /**
Jim Millerbc4603b2010-08-30 21:21:34 -07004908 * This preference allows the device to be locked given time after screen goes off,
4909 * subject to current DeviceAdmin policy limits.
4910 * @hide
4911 */
4912 public static final String LOCK_SCREEN_LOCK_AFTER_TIMEOUT = "lock_screen_lock_after_timeout";
4913
4914
4915 /**
John Spurlock5f050e52012-10-27 10:44:19 -04004916 * This preference contains the string that shows for owner info on LockScreen.
Jim Miller253a5ef2010-10-13 20:57:29 -07004917 * @hide
Jim Miller187ec582013-04-15 18:27:54 -07004918 * @deprecated
Jim Miller253a5ef2010-10-13 20:57:29 -07004919 */
4920 public static final String LOCK_SCREEN_OWNER_INFO = "lock_screen_owner_info";
4921
4922 /**
John Spurlock5f050e52012-10-27 10:44:19 -04004923 * Ids of the user-selected appwidgets on the lockscreen (comma-delimited).
Jim Millerf229e4d2012-09-12 20:32:50 -07004924 * @hide
4925 */
Adrian Roos230635e2015-01-07 20:50:29 +01004926 @Deprecated
Michael Jurkaaa2859a2012-10-24 12:46:49 -07004927 public static final String LOCK_SCREEN_APPWIDGET_IDS =
4928 "lock_screen_appwidget_ids";
Jim Millerf229e4d2012-09-12 20:32:50 -07004929
4930 /**
Jim Miller51117262012-11-04 17:58:09 -08004931 * Id of the appwidget shown on the lock screen when appwidgets are disabled.
4932 * @hide
4933 */
Adrian Roos230635e2015-01-07 20:50:29 +01004934 @Deprecated
Jim Miller51117262012-11-04 17:58:09 -08004935 public static final String LOCK_SCREEN_FALLBACK_APPWIDGET_ID =
4936 "lock_screen_fallback_appwidget_id";
4937
4938 /**
John Spurlock5f050e52012-10-27 10:44:19 -04004939 * Index of the lockscreen appwidget to restore, -1 if none.
4940 * @hide
4941 */
Adrian Roos230635e2015-01-07 20:50:29 +01004942 @Deprecated
John Spurlock5f050e52012-10-27 10:44:19 -04004943 public static final String LOCK_SCREEN_STICKY_APPWIDGET =
4944 "lock_screen_sticky_appwidget";
4945
4946 /**
4947 * This preference enables showing the owner info on LockScreen.
Jim Miller253a5ef2010-10-13 20:57:29 -07004948 * @hide
Jim Miller187ec582013-04-15 18:27:54 -07004949 * @deprecated
Jim Miller253a5ef2010-10-13 20:57:29 -07004950 */
4951 public static final String LOCK_SCREEN_OWNER_INFO_ENABLED =
4952 "lock_screen_owner_info_enabled";
4953
4954 /**
Dan Sandler5d7c3cc2014-02-18 17:35:15 -05004955 * When set by a user, allows notifications to be shown atop a securely locked screen
4956 * in their full "private" form (same as when the device is unlocked).
Dan Sandlerfd16d562014-02-13 18:43:31 -08004957 * @hide
4958 */
4959 public static final String LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS =
4960 "lock_screen_allow_private_notifications";
4961
4962 /**
Adrian Roos3aec6382016-02-05 14:19:01 -08004963 * When set by a user, allows notification remote input atop a securely locked screen
4964 * without having to unlock
4965 * @hide
4966 */
4967 public static final String LOCK_SCREEN_ALLOW_REMOTE_INPUT =
4968 "lock_screen_allow_remote_input";
4969
4970 /**
Chris Wrencd8f4f72014-08-27 18:48:13 -04004971 * Set by the system to track if the user needs to see the call to action for
4972 * the lockscreen notification policy.
4973 * @hide
4974 */
4975 public static final String SHOW_NOTE_ABOUT_NOTIFICATION_HIDING =
4976 "show_note_about_notification_hiding";
4977
4978 /**
Adrian Roos3870d452014-09-05 18:22:28 +02004979 * Set to 1 by the system after trust agents have been initialized.
4980 * @hide
4981 */
4982 public static final String TRUST_AGENTS_INITIALIZED =
4983 "trust_agents_initialized";
4984
4985 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004986 * The Logging ID (a unique 64-bit value) as a hex string.
4987 * Used as a pseudonymous identifier for logging.
4988 * @deprecated This identifier is poorly initialized and has
4989 * many collisions. It should not be used.
4990 */
4991 @Deprecated
4992 public static final String LOGGING_ID = "logging_id";
4993
4994 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004995 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004996 */
Christopher Tate06efb532012-08-24 15:29:27 -07004997 @Deprecated
4998 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004999
5000 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08005001 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005002 */
5003 public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005004
5005 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08005006 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005007 */
5008 public static final String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005009
5010 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08005011 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005012 */
5013 public static final String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005014
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005015 /**
5016 * Settings classname to launch when Settings is clicked from All
5017 * Applications. Needed because of user testing between the old
5018 * and new Settings apps.
5019 */
5020 // TODO: 881807
5021 public static final String SETTINGS_CLASSNAME = "settings_classname";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005022
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005023 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005024 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005025 */
Christopher Tate06efb532012-08-24 15:29:27 -07005026 @Deprecated
5027 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005028
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005029 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005030 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005031 */
Christopher Tate06efb532012-08-24 15:29:27 -07005032 @Deprecated
5033 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005034
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005035 /**
svetoslavganov75986cf2009-05-14 22:28:01 -07005036 * If accessibility is enabled.
5037 */
5038 public static final String ACCESSIBILITY_ENABLED = "accessibility_enabled";
5039
5040 /**
Svetoslav Ganov00aabf72011-07-21 11:35:03 -07005041 * If touch exploration is enabled.
Svetoslav Ganov35bfede2011-07-14 17:57:06 -07005042 */
Svetoslav Ganov00aabf72011-07-21 11:35:03 -07005043 public static final String TOUCH_EXPLORATION_ENABLED = "touch_exploration_enabled";
Svetoslav Ganov35bfede2011-07-14 17:57:06 -07005044
5045 /**
svetoslavganov75986cf2009-05-14 22:28:01 -07005046 * List of the enabled accessibility providers.
5047 */
5048 public static final String ENABLED_ACCESSIBILITY_SERVICES =
5049 "enabled_accessibility_services";
5050
5051 /**
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07005052 * List of the accessibility services to which the user has granted
Svetoslav Ganov9a4c5cd2012-05-30 14:06:32 -07005053 * permission to put the device into touch exploration mode.
5054 *
5055 * @hide
5056 */
5057 public static final String TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES =
5058 "touch_exploration_granted_accessibility_services";
5059
5060 /**
Svetoslav Ganov55f937a2011-12-05 11:42:07 -08005061 * Whether to speak passwords while in accessibility mode.
5062 */
5063 public static final String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password";
5064
5065 /**
Chris Craikcce47eb2014-07-16 15:12:15 -07005066 * Whether to draw text with high contrast while in accessibility mode.
5067 *
5068 * @hide
5069 */
5070 public static final String ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED =
5071 "high_text_contrast_enabled";
5072
5073 /**
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08005074 * If injection of accessibility enhancing JavaScript screen-reader
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07005075 * is enabled.
5076 * <p>
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08005077 * Note: The JavaScript based screen-reader is served by the
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07005078 * Google infrastructure and enable users with disabilities to
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07005079 * efficiently navigate in and explore web content.
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07005080 * </p>
5081 * <p>
5082 * This property represents a boolean value.
5083 * </p>
5084 * @hide
5085 */
5086 public static final String ACCESSIBILITY_SCRIPT_INJECTION =
5087 "accessibility_script_injection";
5088
5089 /**
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08005090 * The URL for the injected JavaScript based screen-reader used
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07005091 * for providing accessibility of content in WebView.
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08005092 * <p>
5093 * Note: The JavaScript based screen-reader is served by the
5094 * Google infrastructure and enable users with disabilities to
5095 * efficiently navigate in and explore web content.
5096 * </p>
5097 * <p>
5098 * This property represents a string value.
5099 * </p>
5100 * @hide
5101 */
5102 public static final String ACCESSIBILITY_SCREEN_READER_URL =
5103 "accessibility_script_injection_url";
5104
5105 /**
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07005106 * Key bindings for navigation in built-in accessibility support for web content.
5107 * <p>
5108 * Note: These key bindings are for the built-in accessibility navigation for
5109 * web content which is used as a fall back solution if JavaScript in a WebView
5110 * is not enabled or the user has not opted-in script injection from Google.
5111 * </p>
5112 * <p>
5113 * The bindings are separated by semi-colon. A binding is a mapping from
5114 * a key to a sequence of actions (for more details look at
5115 * android.webkit.AccessibilityInjector). A key is represented as the hexademical
5116 * string representation of an integer obtained from a meta state (optional) shifted
5117 * sixteen times left and bitwise ored with a key code. An action is represented
5118 * as a hexademical string representation of an integer where the first two digits
5119 * are navigation action index, the second, the third, and the fourth digit pairs
5120 * represent the action arguments. The separate actions in a binding are colon
5121 * separated. The key and the action sequence it maps to are separated by equals.
5122 * </p>
5123 * <p>
5124 * For example, the binding below maps the DPAD right button to traverse the
5125 * current navigation axis once without firing an accessibility event and to
5126 * perform the same traversal again but to fire an event:
5127 * <code>
5128 * 0x16=0x01000100:0x01000101;
5129 * </code>
5130 * </p>
5131 * <p>
5132 * The goal of this binding is to enable dynamic rebinding of keys to
5133 * navigation actions for web content without requiring a framework change.
5134 * </p>
5135 * <p>
5136 * This property represents a string value.
5137 * </p>
5138 * @hide
5139 */
5140 public static final String ACCESSIBILITY_WEB_CONTENT_KEY_BINDINGS =
5141 "accessibility_web_content_key_bindings";
5142
5143 /**
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07005144 * Setting that specifies whether the display magnification is enabled.
5145 * Display magnifications allows the user to zoom in the display content
5146 * and is targeted to low vision users. The current magnification scale
5147 * is controlled by {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}.
5148 *
5149 * @hide
5150 */
5151 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED =
5152 "accessibility_display_magnification_enabled";
5153
5154 /**
5155 * Setting that specifies what the display magnification scale is.
5156 * Display magnifications allows the user to zoom in the display
5157 * content and is targeted to low vision users. Whether a display
5158 * magnification is performed is controlled by
5159 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED}
5160 *
5161 * @hide
5162 */
5163 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE =
5164 "accessibility_display_magnification_scale";
5165
5166 /**
5167 * Setting that specifies whether the display magnification should be
5168 * automatically updated. If this fearture is enabled the system will
5169 * exit magnification mode or pan the viewport when a context change
5170 * occurs. For example, on staring a new activity or rotating the screen,
5171 * the system may zoom out so the user can see the new context he is in.
5172 * Another example is on showing a window that is not visible in the
5173 * magnified viewport the system may pan the viewport to make the window
5174 * the has popped up so the user knows that the context has changed.
5175 * Whether a screen magnification is performed is controlled by
5176 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED}
5177 *
5178 * @hide
5179 */
5180 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE =
5181 "accessibility_display_magnification_auto_update";
5182
5183 /**
Anna Galusza9b278112016-01-04 11:37:37 -08005184 * Setting that specifies what mode the soft keyboard is in (default or hidden). Can be
5185 * modified from an AccessibilityService using the SoftKeyboardController.
5186 *
5187 * @hide
5188 */
5189 public static final String ACCESSIBILITY_SOFT_KEYBOARD_MODE =
5190 "accessibility_soft_keyboard_mode";
5191
5192 /**
5193 * Default soft keyboard behavior.
5194 *
5195 * @hide
5196 */
5197 public static final int SHOW_MODE_AUTO = 0;
5198
5199 /**
5200 * Soft keyboard is never shown.
5201 *
5202 * @hide
5203 */
5204 public static final int SHOW_MODE_HIDDEN = 1;
5205
5206 /**
Alan Viveretteef793802013-07-23 14:15:28 -07005207 * Setting that specifies whether timed text (captions) should be
5208 * displayed in video content. Text display properties are controlled by
5209 * the following settings:
5210 * <ul>
5211 * <li>{@link #ACCESSIBILITY_CAPTIONING_LOCALE}
5212 * <li>{@link #ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR}
5213 * <li>{@link #ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR}
5214 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_COLOR}
5215 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_TYPE}
5216 * <li>{@link #ACCESSIBILITY_CAPTIONING_TYPEFACE}
Alan Viverette69ce69b2013-08-29 12:23:48 -07005217 * <li>{@link #ACCESSIBILITY_CAPTIONING_FONT_SCALE}
Alan Viveretteef793802013-07-23 14:15:28 -07005218 * </ul>
5219 *
5220 * @hide
5221 */
5222 public static final String ACCESSIBILITY_CAPTIONING_ENABLED =
5223 "accessibility_captioning_enabled";
5224
5225 /**
5226 * Setting that specifies the language for captions as a locale string,
5227 * e.g. en_US.
5228 *
5229 * @see java.util.Locale#toString
5230 * @hide
5231 */
5232 public static final String ACCESSIBILITY_CAPTIONING_LOCALE =
5233 "accessibility_captioning_locale";
5234
5235 /**
Alan Viverette43a1e3d2013-08-02 16:45:03 -07005236 * Integer property that specifies the preset style for captions, one
5237 * of:
5238 * <ul>
Alan Viverette69ce69b2013-08-29 12:23:48 -07005239 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESET_CUSTOM}
5240 * <li>a valid index of {@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESETS}
Alan Viverette43a1e3d2013-08-02 16:45:03 -07005241 * </ul>
5242 *
5243 * @see java.util.Locale#toString
5244 * @hide
5245 */
5246 public static final String ACCESSIBILITY_CAPTIONING_PRESET =
5247 "accessibility_captioning_preset";
5248
5249 /**
Alan Viveretteef793802013-07-23 14:15:28 -07005250 * Integer property that specifes the background color for captions as a
5251 * packed 32-bit color.
5252 *
5253 * @see android.graphics.Color#argb
5254 * @hide
5255 */
5256 public static final String ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR =
5257 "accessibility_captioning_background_color";
5258
5259 /**
5260 * Integer property that specifes the foreground color for captions as a
5261 * packed 32-bit color.
5262 *
5263 * @see android.graphics.Color#argb
5264 * @hide
5265 */
5266 public static final String ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR =
5267 "accessibility_captioning_foreground_color";
5268
5269 /**
5270 * Integer property that specifes the edge type for captions, one of:
5271 * <ul>
Alan Viverette69ce69b2013-08-29 12:23:48 -07005272 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_NONE}
5273 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_OUTLINE}
5274 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_DROP_SHADOW}
Alan Viveretteef793802013-07-23 14:15:28 -07005275 * </ul>
5276 *
5277 * @see #ACCESSIBILITY_CAPTIONING_EDGE_COLOR
5278 * @hide
5279 */
5280 public static final String ACCESSIBILITY_CAPTIONING_EDGE_TYPE =
5281 "accessibility_captioning_edge_type";
5282
5283 /**
5284 * Integer property that specifes the edge color for captions as a
5285 * packed 32-bit color.
5286 *
5287 * @see #ACCESSIBILITY_CAPTIONING_EDGE_TYPE
5288 * @see android.graphics.Color#argb
5289 * @hide
5290 */
5291 public static final String ACCESSIBILITY_CAPTIONING_EDGE_COLOR =
5292 "accessibility_captioning_edge_color";
5293
5294 /**
Alan Viverette55d70622013-12-11 15:22:14 -08005295 * Integer property that specifes the window color for captions as a
5296 * packed 32-bit color.
5297 *
5298 * @see android.graphics.Color#argb
5299 * @hide
5300 */
5301 public static final String ACCESSIBILITY_CAPTIONING_WINDOW_COLOR =
5302 "accessibility_captioning_window_color";
5303
5304 /**
Alan Viveretteef793802013-07-23 14:15:28 -07005305 * String property that specifies the typeface for captions, one of:
5306 * <ul>
5307 * <li>DEFAULT
5308 * <li>MONOSPACE
5309 * <li>SANS_SERIF
5310 * <li>SERIF
5311 * </ul>
5312 *
5313 * @see android.graphics.Typeface
5314 * @hide
5315 */
5316 public static final String ACCESSIBILITY_CAPTIONING_TYPEFACE =
5317 "accessibility_captioning_typeface";
5318
5319 /**
Alan Viverette69ce69b2013-08-29 12:23:48 -07005320 * Floating point property that specifies font scaling for captions.
Alan Viveretteef793802013-07-23 14:15:28 -07005321 *
5322 * @hide
5323 */
Alan Viverette69ce69b2013-08-29 12:23:48 -07005324 public static final String ACCESSIBILITY_CAPTIONING_FONT_SCALE =
5325 "accessibility_captioning_font_scale";
Alan Viveretteef793802013-07-23 14:15:28 -07005326
5327 /**
Alan Viverette410d4e32013-09-30 15:37:38 -07005328 * Setting that specifies whether display color inversion is enabled.
Alan Viverette410d4e32013-09-30 15:37:38 -07005329 */
5330 public static final String ACCESSIBILITY_DISPLAY_INVERSION_ENABLED =
5331 "accessibility_display_inversion_enabled";
5332
5333 /**
Alan Viverette410d4e32013-09-30 15:37:38 -07005334 * Setting that specifies whether display color space adjustment is
5335 * enabled.
5336 *
5337 * @hide
5338 */
5339 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED =
5340 "accessibility_display_daltonizer_enabled";
5341
5342 /**
5343 * Integer property that specifies the type of color space adjustment to
5344 * perform. Valid values are defined in AccessibilityManager.
5345 *
5346 * @hide
5347 */
5348 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER =
5349 "accessibility_display_daltonizer";
5350
5351 /**
Toni Barzic386f8342015-09-09 12:30:41 -07005352 * Setting that specifies whether automatic click when the mouse pointer stops moving is
5353 * enabled.
5354 *
5355 * @hide
5356 */
5357 public static final String ACCESSIBILITY_AUTOCLICK_ENABLED =
5358 "accessibility_autoclick_enabled";
5359
5360 /**
5361 * Integer setting specifying amount of time in ms the mouse pointer has to stay still
5362 * before performing click when {@link #ACCESSIBILITY_AUTOCLICK_ENABLED} is set.
5363 *
5364 * @see #ACCESSIBILITY_AUTOCLICK_ENABLED
5365 * @hide
5366 */
5367 public static final String ACCESSIBILITY_AUTOCLICK_DELAY =
5368 "accessibility_autoclick_delay";
5369
5370 /**
Jun Mukai19a56012015-11-24 11:25:52 -08005371 * Whether or not larger size icons are used for the pointer of mouse/trackpad for
5372 * accessibility.
5373 * (0 = false, 1 = true)
5374 * @hide
5375 */
5376 public static final String ACCESSIBILITY_LARGE_POINTER_ICON =
5377 "accessibility_large_pointer_icon";
5378
5379 /**
Toni Barzic386f8342015-09-09 12:30:41 -07005380 * The timeout for considering a press to be a long press in milliseconds.
Svetoslav Ganov54d068e2011-03-02 12:58:40 -08005381 * @hide
5382 */
5383 public static final String LONG_PRESS_TIMEOUT = "long_press_timeout";
5384
5385 /**
Anthony Hugh96e9cc52016-07-12 15:17:24 -07005386 * The duration in milliseconds between the first tap's up event and the second tap's
5387 * down event for an interaction to be considered part of the same multi-press.
5388 * @hide
5389 */
5390 public static final String MULTI_PRESS_TIMEOUT = "multi_press_timeout";
5391
5392 /**
Svetoslav Ganov6bd20bc2013-09-02 15:24:45 -07005393 * List of the enabled print services.
Philip P. Moltmann8141bdf2015-12-21 17:03:05 -08005394 *
5395 * N and beyond uses {@link #DISABLED_PRINT_SERVICES}. But this might be used in an upgrade
5396 * from pre-N.
5397 *
Svetoslav Ganov4b9a4d12013-06-11 15:20:06 -07005398 * @hide
5399 */
5400 public static final String ENABLED_PRINT_SERVICES =
5401 "enabled_print_services";
5402
5403 /**
Philip P. Moltmann8141bdf2015-12-21 17:03:05 -08005404 * List of the disabled print services.
5405 *
Svetoslav Ganov6bd20bc2013-09-02 15:24:45 -07005406 * @hide
5407 */
Philip P. Moltmann8141bdf2015-12-21 17:03:05 -08005408 public static final String DISABLED_PRINT_SERVICES =
5409 "disabled_print_services";
Svetoslav Ganov6bd20bc2013-09-02 15:24:45 -07005410
5411 /**
Alan Viverette5e8d8372016-02-03 15:38:59 -05005412 * The saved value for WindowManagerService.setForcedDisplayDensity()
5413 * formatted as a single integer representing DPI. If unset, then use
5414 * the real display density.
5415 *
5416 * @hide
5417 */
5418 public static final String DISPLAY_DENSITY_FORCED = "display_density_forced";
5419
5420 /**
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07005421 * Setting to always use the default text-to-speech settings regardless
5422 * of the application settings.
5423 * 1 = override application settings,
5424 * 0 = use application settings (if specified).
Narayan Kamath6d632962011-08-24 11:51:37 +01005425 *
5426 * @deprecated The value of this setting is no longer respected by
5427 * the framework text to speech APIs as of the Ice Cream Sandwich release.
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07005428 */
Narayan Kamath6d632962011-08-24 11:51:37 +01005429 @Deprecated
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07005430 public static final String TTS_USE_DEFAULTS = "tts_use_defaults";
5431
5432 /**
5433 * Default text-to-speech engine speech rate. 100 = 1x
5434 */
5435 public static final String TTS_DEFAULT_RATE = "tts_default_rate";
5436
5437 /**
5438 * Default text-to-speech engine pitch. 100 = 1x
5439 */
5440 public static final String TTS_DEFAULT_PITCH = "tts_default_pitch";
5441
5442 /**
5443 * Default text-to-speech engine.
5444 */
5445 public static final String TTS_DEFAULT_SYNTH = "tts_default_synth";
5446
5447 /**
Jean-Michel Trivif4782672009-06-09 16:22:48 -07005448 * Default text-to-speech language.
Narayan Kamath6d632962011-08-24 11:51:37 +01005449 *
5450 * @deprecated this setting is no longer in use, as of the Ice Cream
5451 * Sandwich release. Apps should never need to read this setting directly,
5452 * instead can query the TextToSpeech framework classes for the default
5453 * locale. {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivif4782672009-06-09 16:22:48 -07005454 */
Narayan Kamath6d632962011-08-24 11:51:37 +01005455 @Deprecated
Jean-Michel Trivif4782672009-06-09 16:22:48 -07005456 public static final String TTS_DEFAULT_LANG = "tts_default_lang";
5457
5458 /**
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07005459 * Default text-to-speech country.
Narayan Kamath6d632962011-08-24 11:51:37 +01005460 *
5461 * @deprecated this setting is no longer in use, as of the Ice Cream
5462 * Sandwich release. Apps should never need to read this setting directly,
5463 * instead can query the TextToSpeech framework classes for the default
5464 * locale. {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07005465 */
Narayan Kamath6d632962011-08-24 11:51:37 +01005466 @Deprecated
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07005467 public static final String TTS_DEFAULT_COUNTRY = "tts_default_country";
5468
5469 /**
5470 * Default text-to-speech locale variant.
Narayan Kamath6d632962011-08-24 11:51:37 +01005471 *
5472 * @deprecated this setting is no longer in use, as of the Ice Cream
5473 * Sandwich release. Apps should never need to read this setting directly,
5474 * instead can query the TextToSpeech framework classes for the
5475 * locale that is in use {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07005476 */
Narayan Kamath6d632962011-08-24 11:51:37 +01005477 @Deprecated
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07005478 public static final String TTS_DEFAULT_VARIANT = "tts_default_variant";
5479
5480 /**
Narayan Kamathe5b8c4d2011-08-22 15:37:47 +01005481 * Stores the default tts locales on a per engine basis. Stored as
5482 * a comma seperated list of values, each value being of the form
5483 * {@code engine_name:locale} for example,
Narayan Kamath6d632962011-08-24 11:51:37 +01005484 * {@code com.foo.ttsengine:eng-USA,com.bar.ttsengine:esp-ESP}. This
5485 * supersedes {@link #TTS_DEFAULT_LANG}, {@link #TTS_DEFAULT_COUNTRY} and
5486 * {@link #TTS_DEFAULT_VARIANT}. Apps should never need to read this
5487 * setting directly, and can query the TextToSpeech framework classes
5488 * for the locale that is in use.
Narayan Kamathe5b8c4d2011-08-22 15:37:47 +01005489 *
5490 * @hide
5491 */
5492 public static final String TTS_DEFAULT_LOCALE = "tts_default_locale";
5493
5494 /**
Charles Chenceffa152010-03-16 21:18:10 -07005495 * Space delimited list of plugin packages that are enabled.
5496 */
5497 public static final String TTS_ENABLED_PLUGINS = "tts_enabled_plugins";
5498
5499 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07005500 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON}
5501 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005502 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07005503 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005504 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
Christopher Tate6f5a9a92012-09-14 17:24:28 -07005505 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005506
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005507 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07005508 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY}
5509 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005510 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07005511 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005512 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
Christopher Tate6f5a9a92012-09-14 17:24:28 -07005513 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005514
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005515 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07005516 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
5517 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005518 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07005519 @Deprecated
5520 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT =
5521 Global.WIFI_NUM_OPEN_NETWORKS_KEPT;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005522
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005523 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07005524 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON}
5525 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005526 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07005527 @Deprecated
5528 public static final String WIFI_ON = Global.WIFI_ON;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005529
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005530 /**
5531 * The acceptable packet loss percentage (range 0 - 100) before trying
5532 * another AP on the same network.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07005533 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005534 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07005535 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005536 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
5537 "wifi_watchdog_acceptable_packet_loss_percentage";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005538
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005539 /**
5540 * The number of access points required for a network in order for the
5541 * watchdog to monitor it.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07005542 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005543 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07005544 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005545 public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005546
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005547 /**
5548 * The delay between background checks.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07005549 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005550 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07005551 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005552 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
5553 "wifi_watchdog_background_check_delay_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005554
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005555 /**
5556 * Whether the Wi-Fi watchdog is enabled for background checking even
5557 * after it thinks the user has connected to a good access point.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07005558 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005559 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07005560 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005561 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
5562 "wifi_watchdog_background_check_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005563
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005564 /**
5565 * The timeout for a background ping
Jeff Brownbf6f6f92012-09-25 15:03:20 -07005566 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005567 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07005568 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005569 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
5570 "wifi_watchdog_background_check_timeout_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005571
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005572 /**
5573 * The number of initial pings to perform that *may* be ignored if they
5574 * fail. Again, if these fail, they will *not* be used in packet loss
5575 * calculation. For example, one network always seemed to time out for
5576 * the first couple pings, so this is set to 3 by default.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07005577 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005578 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07005579 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005580 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
5581 "wifi_watchdog_initial_ignored_ping_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005582
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005583 /**
5584 * The maximum number of access points (per network) to attempt to test.
5585 * If this number is reached, the watchdog will no longer monitor the
5586 * initial connection state for the network. This is a safeguard for
5587 * networks containing multiple APs whose DNS does not respond to pings.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07005588 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005589 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07005590 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005591 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = "wifi_watchdog_max_ap_checks";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005592
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005593 /**
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07005594 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005595 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07005596 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005597 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
5598
5599 /**
5600 * A comma-separated list of SSIDs for which the Wi-Fi watchdog should be enabled.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07005601 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005602 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07005603 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005604 public static final String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list";
5605
5606 /**
5607 * The number of pings to test if an access point is a good connection.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07005608 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005609 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07005610 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005611 public static final String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005612
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005613 /**
5614 * The delay between pings.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07005615 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005616 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07005617 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005618 public static final String WIFI_WATCHDOG_PING_DELAY_MS = "wifi_watchdog_ping_delay_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005619
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005620 /**
5621 * The timeout per ping.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07005622 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005623 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07005624 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005625 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005626
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005627 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005628 * @deprecated Use
5629 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005630 */
Christopher Tate06efb532012-08-24 15:29:27 -07005631 @Deprecated
5632 public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005633
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005634 /**
Jeff Brownbf6f6f92012-09-25 15:03:20 -07005635 * @deprecated Use
5636 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005637 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07005638 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005639 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
Jeff Brownbf6f6f92012-09-25 15:03:20 -07005640 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005641
5642 /**
Jeremy Joslin79294842014-12-03 17:15:28 -08005643 * The number of milliseconds to hold on to a PendingIntent based request. This delay gives
5644 * the receivers of the PendingIntent an opportunity to make a new network request before
5645 * the Network satisfying the request is potentially removed.
5646 *
5647 * @hide
5648 */
5649 public static final String CONNECTIVITY_RELEASE_PENDING_INTENT_DELAY_MS =
5650 "connectivity_release_pending_intent_delay_ms";
5651
5652 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07005653 * Whether background data usage is allowed.
5654 *
5655 * @deprecated As of {@link VERSION_CODES#ICE_CREAM_SANDWICH},
5656 * availability of background data depends on several
5657 * combined factors. When background data is unavailable,
5658 * {@link ConnectivityManager#getActiveNetworkInfo()} will
5659 * now appear disconnected.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005660 */
Jeff Sharkey3a844fc2011-08-16 14:37:57 -07005661 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005662 public static final String BACKGROUND_DATA = "background_data";
Wink Saville04e71b32009-04-02 11:00:54 -07005663
5664 /**
Bjorn Bringert98bfa392010-03-24 10:59:48 +00005665 * Origins for which browsers should allow geolocation by default.
5666 * The value is a space-separated list of origins.
5667 */
5668 public static final String ALLOWED_GEOLOCATION_ORIGINS
5669 = "allowed_geolocation_origins";
5670
5671 /**
Wink Savillee9b06d72009-05-18 21:47:50 -07005672 * The preferred TTY mode 0 = TTy Off, CDMA default
5673 * 1 = TTY Full
5674 * 2 = TTY HCO
5675 * 3 = TTY VCO
5676 * @hide
5677 */
5678 public static final String PREFERRED_TTY_MODE =
5679 "preferred_tty_mode";
5680
Wink Saville04e71b32009-04-02 11:00:54 -07005681 /**
Wink Saville04e71b32009-04-02 11:00:54 -07005682 * Whether the enhanced voice privacy mode is enabled.
5683 * 0 = normal voice privacy
5684 * 1 = enhanced voice privacy
5685 * @hide
5686 */
5687 public static final String ENHANCED_VOICE_PRIVACY_ENABLED = "enhanced_voice_privacy_enabled";
5688
5689 /**
5690 * Whether the TTY mode mode is enabled.
5691 * 0 = disabled
5692 * 1 = enabled
5693 * @hide
5694 */
5695 public static final String TTY_MODE_ENABLED = "tty_mode_enabled";
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005696
5697 /**
Christopher Tate8031a3d2009-07-06 16:36:05 -07005698 * Controls whether settings backup is enabled.
Dianne Hackborncf098292009-07-01 19:55:20 -07005699 * Type: int ( 0 = disabled, 1 = enabled )
5700 * @hide
5701 */
5702 public static final String BACKUP_ENABLED = "backup_enabled";
5703
5704 /**
Christopher Tatecce9da52010-02-03 15:11:15 -08005705 * Controls whether application data is automatically restored from backup
5706 * at install time.
5707 * Type: int ( 0 = disabled, 1 = enabled )
5708 * @hide
5709 */
5710 public static final String BACKUP_AUTO_RESTORE = "backup_auto_restore";
5711
5712 /**
Christopher Tate8031a3d2009-07-06 16:36:05 -07005713 * Indicates whether settings backup has been fully provisioned.
5714 * Type: int ( 0 = unprovisioned, 1 = fully provisioned )
5715 * @hide
5716 */
5717 public static final String BACKUP_PROVISIONED = "backup_provisioned";
5718
5719 /**
Dianne Hackborncf098292009-07-01 19:55:20 -07005720 * Component of the transport to use for backup/restore.
5721 * @hide
5722 */
5723 public static final String BACKUP_TRANSPORT = "backup_transport";
Sanjay Jeyakumar21bf2412009-07-09 13:31:48 -07005724
Dianne Hackbornd7cd29d2009-07-01 11:22:45 -07005725 /**
5726 * Version for which the setup wizard was last shown. Bumped for
5727 * each release when there is new setup information to show.
5728 * @hide
5729 */
5730 public static final String LAST_SETUP_SHOWN = "last_setup_shown";
Dianne Hackborncf098292009-07-01 19:55:20 -07005731
5732 /**
Doug Zongker43866e02010-01-07 12:09:54 -08005733 * The interval in milliseconds after which Wi-Fi is considered idle.
5734 * When idle, it is possible for the device to be switched from Wi-Fi to
5735 * the mobile data network.
5736 * @hide
Jeff Brownbf6f6f92012-09-25 15:03:20 -07005737 * @deprecated Use {@link android.provider.Settings.Global#WIFI_IDLE_MS}
5738 * instead.
Doug Zongker43866e02010-01-07 12:09:54 -08005739 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07005740 @Deprecated
5741 public static final String WIFI_IDLE_MS = Global.WIFI_IDLE_MS;
Doug Zongker43866e02010-01-07 12:09:54 -08005742
5743 /**
Narayan Kamathee69ff42011-06-28 12:07:18 +01005744 * The global search provider chosen by the user (if multiple global
5745 * search providers are installed). This will be the provider returned
5746 * by {@link SearchManager#getGlobalSearchActivity()} if it's still
5747 * installed. This setting is stored as a flattened component name as
5748 * per {@link ComponentName#flattenToString()}.
5749 *
5750 * @hide
5751 */
5752 public static final String SEARCH_GLOBAL_SEARCH_ACTIVITY =
5753 "search_global_search_activity";
5754
5755 /**
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08005756 * The number of promoted sources in GlobalSearch.
5757 * @hide
5758 */
5759 public static final String SEARCH_NUM_PROMOTED_SOURCES = "search_num_promoted_sources";
5760 /**
5761 * The maximum number of suggestions returned by GlobalSearch.
5762 * @hide
5763 */
5764 public static final String SEARCH_MAX_RESULTS_TO_DISPLAY = "search_max_results_to_display";
5765 /**
5766 * The number of suggestions GlobalSearch will ask each non-web search source for.
5767 * @hide
5768 */
5769 public static final String SEARCH_MAX_RESULTS_PER_SOURCE = "search_max_results_per_source";
5770 /**
5771 * The number of suggestions the GlobalSearch will ask the web search source for.
5772 * @hide
5773 */
5774 public static final String SEARCH_WEB_RESULTS_OVERRIDE_LIMIT =
5775 "search_web_results_override_limit";
5776 /**
5777 * The number of milliseconds that GlobalSearch will wait for suggestions from
5778 * promoted sources before continuing with all other sources.
5779 * @hide
5780 */
5781 public static final String SEARCH_PROMOTED_SOURCE_DEADLINE_MILLIS =
5782 "search_promoted_source_deadline_millis";
5783 /**
5784 * The number of milliseconds before GlobalSearch aborts search suggesiton queries.
5785 * @hide
5786 */
5787 public static final String SEARCH_SOURCE_TIMEOUT_MILLIS = "search_source_timeout_millis";
5788 /**
5789 * The maximum number of milliseconds that GlobalSearch shows the previous results
5790 * after receiving a new query.
5791 * @hide
5792 */
5793 public static final String SEARCH_PREFILL_MILLIS = "search_prefill_millis";
5794 /**
5795 * The maximum age of log data used for shortcuts in GlobalSearch.
5796 * @hide
5797 */
5798 public static final String SEARCH_MAX_STAT_AGE_MILLIS = "search_max_stat_age_millis";
5799 /**
5800 * The maximum age of log data used for source ranking in GlobalSearch.
5801 * @hide
5802 */
5803 public static final String SEARCH_MAX_SOURCE_EVENT_AGE_MILLIS =
5804 "search_max_source_event_age_millis";
5805 /**
5806 * The minimum number of impressions needed to rank a source in GlobalSearch.
5807 * @hide
5808 */
5809 public static final String SEARCH_MIN_IMPRESSIONS_FOR_SOURCE_RANKING =
5810 "search_min_impressions_for_source_ranking";
5811 /**
5812 * The minimum number of clicks needed to rank a source in GlobalSearch.
5813 * @hide
5814 */
5815 public static final String SEARCH_MIN_CLICKS_FOR_SOURCE_RANKING =
5816 "search_min_clicks_for_source_ranking";
5817 /**
5818 * The maximum number of shortcuts shown by GlobalSearch.
5819 * @hide
5820 */
5821 public static final String SEARCH_MAX_SHORTCUTS_RETURNED = "search_max_shortcuts_returned";
5822 /**
5823 * The size of the core thread pool for suggestion queries in GlobalSearch.
5824 * @hide
5825 */
5826 public static final String SEARCH_QUERY_THREAD_CORE_POOL_SIZE =
5827 "search_query_thread_core_pool_size";
5828 /**
5829 * The maximum size of the thread pool for suggestion queries in GlobalSearch.
5830 * @hide
5831 */
5832 public static final String SEARCH_QUERY_THREAD_MAX_POOL_SIZE =
5833 "search_query_thread_max_pool_size";
5834 /**
5835 * The size of the core thread pool for shortcut refreshing in GlobalSearch.
5836 * @hide
5837 */
5838 public static final String SEARCH_SHORTCUT_REFRESH_CORE_POOL_SIZE =
5839 "search_shortcut_refresh_core_pool_size";
5840 /**
5841 * The maximum size of the thread pool for shortcut refreshing in GlobalSearch.
5842 * @hide
5843 */
5844 public static final String SEARCH_SHORTCUT_REFRESH_MAX_POOL_SIZE =
5845 "search_shortcut_refresh_max_pool_size";
5846 /**
5847 * The maximun time that excess threads in the GlobalSeach thread pools will
5848 * wait before terminating.
5849 * @hide
5850 */
5851 public static final String SEARCH_THREAD_KEEPALIVE_SECONDS =
5852 "search_thread_keepalive_seconds";
5853 /**
5854 * The maximum number of concurrent suggestion queries to each source.
5855 * @hide
5856 */
5857 public static final String SEARCH_PER_SOURCE_CONCURRENT_QUERY_LIMIT =
5858 "search_per_source_concurrent_query_limit";
5859
San Mehat87734d32010-01-08 12:53:06 -08005860 /**
5861 * Whether or not alert sounds are played on MountService events. (0 = false, 1 = true)
5862 * @hide
5863 */
5864 public static final String MOUNT_PLAY_NOTIFICATION_SND = "mount_play_not_snd";
5865
5866 /**
5867 * Whether or not UMS auto-starts on UMS host detection. (0 = false, 1 = true)
5868 * @hide
5869 */
5870 public static final String MOUNT_UMS_AUTOSTART = "mount_ums_autostart";
5871
5872 /**
5873 * Whether or not a notification is displayed on UMS host detection. (0 = false, 1 = true)
5874 * @hide
5875 */
5876 public static final String MOUNT_UMS_PROMPT = "mount_ums_prompt";
5877
5878 /**
5879 * Whether or not a notification is displayed while UMS is enabled. (0 = false, 1 = true)
5880 * @hide
5881 */
5882 public static final String MOUNT_UMS_NOTIFY_ENABLED = "mount_ums_notify_enabled";
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08005883
Dan Egnor42471dd2010-01-07 17:25:22 -08005884 /**
5885 * If nonzero, ANRs in invisible background processes bring up a dialog.
5886 * Otherwise, the process will be silently killed.
Adrian Roos6a7e0892016-08-23 14:26:39 +02005887 *
5888 * Also prevents ANRs and crash dialogs from being suppressed.
Dan Egnor42471dd2010-01-07 17:25:22 -08005889 * @hide
5890 */
5891 public static final String ANR_SHOW_BACKGROUND = "anr_show_background";
Erikeebc8e22010-02-18 13:27:19 -08005892
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08005893 /**
5894 * The {@link ComponentName} string of the service to be used as the voice recognition
5895 * service.
Erikeebc8e22010-02-18 13:27:19 -08005896 *
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08005897 * @hide
5898 */
5899 public static final String VOICE_RECOGNITION_SERVICE = "voice_recognition_service";
Dan Egnor42471dd2010-01-07 17:25:22 -08005900
William Luh623a4282013-06-24 12:14:18 -07005901 /**
5902 * Stores whether an user has consented to have apps verified through PAM.
5903 * The value is boolean (1 or 0).
5904 *
5905 * @hide
5906 */
5907 public static final String PACKAGE_VERIFIER_USER_CONSENT =
5908 "package_verifier_user_consent";
satok988323c2011-06-22 16:38:13 +09005909
5910 /**
satokada8c4e2011-08-23 14:56:56 +09005911 * The {@link ComponentName} string of the selected spell checker service which is
5912 * one of the services managed by the text service manager.
5913 *
5914 * @hide
5915 */
5916 public static final String SELECTED_SPELL_CHECKER = "selected_spell_checker";
5917
5918 /**
5919 * The {@link ComponentName} string of the selected subtype of the selected spell checker
satok988323c2011-06-22 16:38:13 +09005920 * service which is one of the services managed by the text service manager.
5921 *
5922 * @hide
5923 */
satokada8c4e2011-08-23 14:56:56 +09005924 public static final String SELECTED_SPELL_CHECKER_SUBTYPE =
5925 "selected_spell_checker_subtype";
satok988323c2011-06-22 16:38:13 +09005926
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08005927 /**
satoka33c4fc2011-08-25 16:50:11 +09005928 * The {@link ComponentName} string whether spell checker is enabled or not.
5929 *
5930 * @hide
5931 */
5932 public static final String SPELL_CHECKER_ENABLED = "spell_checker_enabled";
5933
5934 /**
David Brown458e8062010-03-08 21:52:11 -08005935 * What happens when the user presses the Power button while in-call
5936 * and the screen is on.<br/>
5937 * <b>Values:</b><br/>
5938 * 1 - The Power button turns off the screen and locks the device. (Default behavior)<br/>
5939 * 2 - The Power button hangs up the current call.<br/>
5940 *
5941 * @hide
5942 */
5943 public static final String INCALL_POWER_BUTTON_BEHAVIOR = "incall_power_button_behavior";
5944
5945 /**
5946 * INCALL_POWER_BUTTON_BEHAVIOR value for "turn off screen".
5947 * @hide
5948 */
5949 public static final int INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF = 0x1;
5950
5951 /**
5952 * INCALL_POWER_BUTTON_BEHAVIOR value for "hang up".
5953 * @hide
5954 */
5955 public static final int INCALL_POWER_BUTTON_BEHAVIOR_HANGUP = 0x2;
5956
5957 /**
5958 * INCALL_POWER_BUTTON_BEHAVIOR default value.
5959 * @hide
5960 */
5961 public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT =
5962 INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF;
5963
5964 /**
Bryce Leedb776ce2016-09-03 15:02:00 -07005965 * What happens when the user presses the Back button while in-call
5966 * and the screen is on.<br/>
5967 * <b>Values:</b><br/>
5968 * 0 - The Back buttons does nothing different.<br/>
5969 * 1 - The Back button hangs up the current call.<br/>
5970 *
5971 * @hide
5972 */
5973 public static final String INCALL_BACK_BUTTON_BEHAVIOR = "incall_back_button_behavior";
5974
5975 /**
5976 * INCALL_BACK_BUTTON_BEHAVIOR value for no action.
5977 * @hide
5978 */
5979 public static final int INCALL_BACK_BUTTON_BEHAVIOR_NONE = 0x0;
5980
5981 /**
5982 * INCALL_BACK_BUTTON_BEHAVIOR value for "hang up".
5983 * @hide
5984 */
5985 public static final int INCALL_BACK_BUTTON_BEHAVIOR_HANGUP = 0x1;
5986
5987 /**
5988 * INCALL_POWER_BUTTON_BEHAVIOR default value.
5989 * @hide
5990 */
5991 public static final int INCALL_BACK_BUTTON_BEHAVIOR_DEFAULT =
5992 INCALL_BACK_BUTTON_BEHAVIOR_NONE;
5993
5994 /**
Jeff Browna20dda42014-05-27 20:57:24 -07005995 * Whether the device should wake when the wake gesture sensor detects motion.
5996 * @hide
5997 */
5998 public static final String WAKE_GESTURE_ENABLED = "wake_gesture_enabled";
5999
6000 /**
John Spurlocka4215ce2014-08-04 14:50:38 -04006001 * Whether the device should doze if configured.
6002 * @hide
6003 */
6004 public static final String DOZE_ENABLED = "doze_enabled";
6005
6006 /**
Doris Ling6403b402016-09-09 14:29:19 -07006007 * Whether the device should pulse on pick up gesture.
6008 * @hide
6009 */
6010 public static final String DOZE_PULSE_ON_PICK_UP = "doze_pulse_on_pick_up";
6011
6012 /**
6013 * Whether the device should pulse on double tap gesture.
6014 * @hide
6015 */
6016 public static final String DOZE_PULSE_ON_DOUBLE_TAP = "doze_pulse_on_double_tap";
6017
6018 /**
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07006019 * The current night mode that has been selected by the user. Owned
6020 * and controlled by UiModeManagerService. Constants are as per
6021 * UiModeManager.
6022 * @hide
6023 */
6024 public static final String UI_NIGHT_MODE = "ui_night_mode";
Suchi Amalapurapu40e47252010-04-07 16:15:50 -07006025
6026 /**
John Spurlock1a868b72012-08-22 09:56:51 -04006027 * Whether screensavers are enabled.
Daniel Sandler0601eb72011-04-13 01:01:32 -04006028 * @hide
6029 */
Daniel Sandler2d545362011-11-17 10:38:37 -08006030 public static final String SCREENSAVER_ENABLED = "screensaver_enabled";
Daniel Sandler0601eb72011-04-13 01:01:32 -04006031
6032 /**
John Spurlock1a868b72012-08-22 09:56:51 -04006033 * The user's chosen screensaver components.
Daniel Sandler2d545362011-11-17 10:38:37 -08006034 *
John Spurlock1a868b72012-08-22 09:56:51 -04006035 * These will be launched by the PhoneWindowManager after a timeout when not on
Daniel Sandler2d545362011-11-17 10:38:37 -08006036 * battery, or upon dock insertion (if SCREENSAVER_ACTIVATE_ON_DOCK is set to 1).
Daniel Sandler0601eb72011-04-13 01:01:32 -04006037 * @hide
6038 */
John Spurlock1a868b72012-08-22 09:56:51 -04006039 public static final String SCREENSAVER_COMPONENTS = "screensaver_components";
Daniel Sandler2d545362011-11-17 10:38:37 -08006040
6041 /**
John Spurlock1a868b72012-08-22 09:56:51 -04006042 * If screensavers are enabled, whether the screensaver should be automatically launched
6043 * when the device is inserted into a (desk) dock.
Daniel Sandler2d545362011-11-17 10:38:37 -08006044 * @hide
6045 */
6046 public static final String SCREENSAVER_ACTIVATE_ON_DOCK = "screensaver_activate_on_dock";
Daniel Sandler0601eb72011-04-13 01:01:32 -04006047
John Spurlock1a868b72012-08-22 09:56:51 -04006048 /**
6049 * If screensavers are enabled, whether the screensaver should be automatically launched
6050 * when the screen times out when not on battery.
6051 * @hide
6052 */
6053 public static final String SCREENSAVER_ACTIVATE_ON_SLEEP = "screensaver_activate_on_sleep";
6054
6055 /**
6056 * If screensavers are enabled, the default screensaver component.
6057 * @hide
6058 */
6059 public static final String SCREENSAVER_DEFAULT_COMPONENT = "screensaver_default_component";
6060
Daniel Sandler0601eb72011-04-13 01:01:32 -04006061 /**
Martijn Coenena7397882013-07-30 20:07:47 -07006062 * The default NFC payment component
6063 * @hide
6064 */
6065 public static final String NFC_PAYMENT_DEFAULT_COMPONENT = "nfc_payment_default_component";
6066
6067 /**
Martijn Coenen2f6f3a012014-04-25 17:00:21 -07006068 * Whether NFC payment is handled by the foreground application or a default.
6069 * @hide
6070 */
6071 public static final String NFC_PAYMENT_FOREGROUND = "nfc_payment_foreground";
6072
6073 /**
David Braunf5d83192013-09-16 13:43:51 -07006074 * Specifies the package name currently configured to be the primary sms application
6075 * @hide
6076 */
6077 public static final String SMS_DEFAULT_APPLICATION = "sms_default_application";
6078
6079 /**
Yorke Lee014de022015-04-21 17:15:47 -07006080 * Specifies the package name currently configured to be the default dialer application
6081 * @hide
6082 */
6083 public static final String DIALER_DEFAULT_APPLICATION = "dialer_default_application";
6084
6085 /**
Adrian Roos943eb862015-03-26 12:31:16 -07006086 * Specifies the package name currently configured to be the emergency assistance application
6087 *
6088 * @see android.telephony.TelephonyManager#ACTION_EMERGENCY_ASSISTANCE
6089 *
6090 * @hide
6091 */
6092 public static final String EMERGENCY_ASSISTANCE_APPLICATION = "emergency_assistance_application";
6093
6094 /**
Jorim Jaggi9d910832015-05-18 17:35:26 -07006095 * Specifies whether the current app context on scren (assist data) will be sent to the
6096 * assist application (active voice interaction service).
6097 *
6098 * @hide
6099 */
6100 public static final String ASSIST_STRUCTURE_ENABLED = "assist_structure_enabled";
6101
6102 /**
Jorim Jaggia133f0b2015-06-26 16:40:00 -07006103 * Specifies whether a screenshot of the screen contents will be sent to the assist
6104 * application (active voice interaction service).
6105 *
6106 * @hide
6107 */
6108 public static final String ASSIST_SCREENSHOT_ENABLED = "assist_screenshot_enabled";
6109
6110 /**
Adrian Roos2335bd62016-08-11 15:42:40 -07006111 * Specifies whether the screen will show an animation if screen contents are sent to the
6112 * assist application (active voice interaction service).
6113 *
6114 * Note that the disclosure will be forced for third-party assistants or if the device
6115 * does not support disabling it.
6116 *
6117 * @hide
6118 */
6119 public static final String ASSIST_DISCLOSURE_ENABLED = "assist_disclosure_enabled";
6120
6121 /**
John Spurlock7c74f782015-06-04 13:01:42 -04006122 * Names of the service components that the current user has explicitly allowed to
Chris Wren8326a8a2014-10-22 14:13:32 -04006123 * see all of the user's notifications, separated by ':'.
Daniel Sandler4b749ef2013-03-18 21:53:04 -04006124 *
6125 * @hide
6126 */
6127 public static final String ENABLED_NOTIFICATION_LISTENERS = "enabled_notification_listeners";
6128
John Spurlock7340fc82014-04-24 18:50:12 -04006129 /**
John Spurlock7c74f782015-06-04 13:01:42 -04006130 * Names of the packages that the current user has explicitly allowed to
6131 * manage notification policy configuration, separated by ':'.
Julia Reynolds0aa7d612016-04-25 14:57:33 -04006132 *
6133 * @hide
John Spurlock7c74f782015-06-04 13:01:42 -04006134 */
Julia Reynolds0aa7d612016-04-25 14:57:33 -04006135 @TestApi
John Spurlock7c74f782015-06-04 13:01:42 -04006136 public static final String ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES =
6137 "enabled_notification_policy_access_packages";
6138
John Spurlock5c454122013-06-17 07:35:46 -04006139 /** @hide */
6140 public static final String BAR_SERVICE_COMPONENT = "bar_service_component";
6141
John Spurlockd67ec252013-09-05 11:31:54 -04006142 /** @hide */
John Spurlockcdb57ae2015-02-11 19:04:11 -05006143 public static final String VOLUME_CONTROLLER_SERVICE_COMPONENT
6144 = "volume_controller_service_component";
6145
6146 /** @hide */
John Spurlockf1a36642013-10-12 17:50:42 -04006147 public static final String IMMERSIVE_MODE_CONFIRMATIONS = "immersive_mode_confirmations";
John Spurlockd67ec252013-09-05 11:31:54 -04006148
Yorke Lee647f8f32013-05-07 10:49:44 -07006149 /**
Svetoslavf43e8512013-09-30 17:33:05 -07006150 * This is the query URI for finding a print service to install.
6151 *
6152 * @hide
6153 */
6154 public static final String PRINT_SERVICE_SEARCH_URI = "print_service_search_uri";
6155
6156 /**
6157 * This is the query URI for finding a NFC payment service to install.
6158 *
6159 * @hide
6160 */
6161 public static final String PAYMENT_SERVICE_SEARCH_URI = "payment_service_search_uri";
6162
6163 /**
Amith Yamasani1e9c2182014-06-11 17:25:51 -07006164 * If enabled, apps should try to skip any introductory hints on first launch. This might
Amith Yamasani0c416392014-06-13 15:54:39 -07006165 * apply to users that are already familiar with the environment or temporary users.
Amith Yamasani1e9c2182014-06-11 17:25:51 -07006166 * <p>
6167 * Type : int (0 to show hints, 1 to skip showing hints)
Amith Yamasani1e9c2182014-06-11 17:25:51 -07006168 */
6169 public static final String SKIP_FIRST_USE_HINTS = "skip_first_use_hints";
6170
6171 /**
John Spurlockaa5ee4d2014-07-25 13:05:12 -04006172 * Persisted playback time after a user confirmation of an unsafe volume level.
6173 *
6174 * @hide
6175 */
6176 public static final String UNSAFE_VOLUME_MUSIC_ACTIVE_MS = "unsafe_volume_music_active_ms";
6177
6178 /**
Dan Sandler52e5701e2014-07-22 23:14:54 -04006179 * This preference enables notification display on the lockscreen.
6180 * @hide
6181 */
6182 public static final String LOCK_SCREEN_SHOW_NOTIFICATIONS =
6183 "lock_screen_show_notifications";
6184
6185 /**
Dongwon Kang4d933a02014-08-07 22:51:47 -07006186 * List of TV inputs that are currently hidden. This is a string
Jaewan Kimf0e530e2014-08-22 00:43:31 +09006187 * containing the IDs of all hidden TV inputs. Each ID is encoded by
6188 * {@link android.net.Uri#encode(String)} and separated by ':'.
Dongwon Kang4d933a02014-08-07 22:51:47 -07006189 * @hide
6190 */
6191 public static final String TV_INPUT_HIDDEN_INPUTS = "tv_input_hidden_inputs";
6192
6193 /**
6194 * List of custom TV input labels. This is a string containing <TV input id, custom name>
Jaewan Kimf0e530e2014-08-22 00:43:31 +09006195 * pairs. TV input id and custom name are encoded by {@link android.net.Uri#encode(String)}
6196 * and separated by ','. Each pair is separated by ':'.
Dongwon Kang4d933a02014-08-07 22:51:47 -07006197 * @hide
6198 */
6199 public static final String TV_INPUT_CUSTOM_LABELS = "tv_input_custom_labels";
6200
6201 /**
Glenn Kasten34cc4db2014-08-13 10:56:38 -07006202 * Whether automatic routing of system audio to USB audio peripheral is disabled.
6203 * The value is boolean (1 or 0), where 1 means automatic routing is disabled,
6204 * and 0 means automatic routing is enabled.
6205 *
6206 * @hide
6207 */
6208 public static final String USB_AUDIO_AUTOMATIC_ROUTING_DISABLED =
6209 "usb_audio_automatic_routing_disabled";
6210
6211 /**
Jeff Brown05af6ad2014-09-30 20:54:30 -07006212 * The timeout in milliseconds before the device fully goes to sleep after
6213 * a period of inactivity. This value sets an upper bound on how long the device
6214 * will stay awake or dreaming without user activity. It should generally
Dianne Hackbornad6a99b2014-11-18 10:11:10 -08006215 * be longer than {@link Settings.System#SCREEN_OFF_TIMEOUT} as otherwise the device
Jeff Brown05af6ad2014-09-30 20:54:30 -07006216 * will sleep before it ever has a chance to dream.
6217 * <p>
6218 * Use -1 to disable this timeout.
6219 * </p>
6220 *
6221 * @hide
6222 */
6223 public static final String SLEEP_TIMEOUT = "sleep_timeout";
6224
6225 /**
Jason Monk27bbb2d2015-03-31 16:46:39 -04006226 * Controls whether double tap to wake is enabled.
6227 * @hide
6228 */
6229 public static final String DOUBLE_TAP_TO_WAKE = "double_tap_to_wake";
6230
6231 /**
Xiyuan Xiae6de8b92015-06-06 22:18:05 -07006232 * The current assistant component. It could be a voice interaction service,
6233 * or an activity that handles ACTION_ASSIST, or empty which means using the default
6234 * handling.
6235 *
6236 * @hide
6237 */
6238 public static final String ASSISTANT = "assistant";
6239
6240 /**
Jason Monk5a5e7d62015-08-04 11:20:25 -04006241 * Whether the camera launch gesture should be disabled.
6242 *
6243 * @hide
6244 */
6245 public static final String CAMERA_GESTURE_DISABLED = "camera_gesture_disabled";
6246
6247 /**
Adrian Roos5941c982015-09-03 15:59:49 -07006248 * Whether the camera launch gesture to double tap the power button when the screen is off
6249 * should be disabled.
6250 *
6251 * @hide
6252 */
6253 public static final String CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED =
6254 "camera_double_tap_power_gesture_disabled";
6255
6256 /**
Doris Linga60d31d2016-07-06 13:39:05 -07006257 * Whether the camera double twist gesture to flip between front and back mode should be
6258 * enabled.
6259 *
6260 * @hide
6261 */
6262 public static final String CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED =
6263 "camera_double_twist_to_flip_enabled";
6264
6265 /**
Justin Klaassen911e8892016-06-21 18:24:24 -07006266 * Control whether Night display is currently activated.
6267 * @hide
6268 */
6269 public static final String NIGHT_DISPLAY_ACTIVATED = "night_display_activated";
6270
6271 /**
6272 * Control whether Night display will automatically activate/deactivate.
6273 * @hide
6274 */
6275 public static final String NIGHT_DISPLAY_AUTO_MODE = "night_display_auto_mode";
6276
6277 /**
6278 * Custom time when Night display is scheduled to activate.
6279 * Represented as milliseconds from midnight (e.g. 79200000 == 10pm).
6280 * @hide
6281 */
6282 public static final String NIGHT_DISPLAY_CUSTOM_START_TIME = "night_display_custom_start_time";
6283
6284 /**
6285 * Custom time when Night display is scheduled to deactivate.
6286 * Represented as milliseconds from midnight (e.g. 21600000 == 6am).
6287 * @hide
6288 */
6289 public static final String NIGHT_DISPLAY_CUSTOM_END_TIME = "night_display_custom_end_time";
Jason Monk5dbd4aa2016-02-07 13:13:39 -05006290
6291 /**
Jason Monk5dbd4aa2016-02-07 13:13:39 -05006292 * Whether brightness should automatically adjust based on twilight state.
6293 * @hide
6294 */
6295 public static final String BRIGHTNESS_USE_TWILIGHT = "brightness_use_twilight";
6296
6297 /**
Ruben Brunke24b9a62016-02-16 21:38:24 -08006298 * Names of the service components that the current user has explicitly allowed to
6299 * be a VR mode listener, separated by ':'.
6300 *
6301 * @hide
6302 */
6303 public static final String ENABLED_VR_LISTENERS = "enabled_vr_listeners";
6304
6305 /**
Ruben Brunk49506e02016-04-18 18:10:47 -07006306 * Behavior of the display while in VR mode.
6307 *
6308 * One of {@link #VR_DISPLAY_MODE_LOW_PERSISTENCE} or {@link #VR_DISPLAY_MODE_OFF}.
6309 *
6310 * @hide
6311 */
6312 public static final String VR_DISPLAY_MODE = "vr_display_mode";
6313
6314 /**
6315 * Lower the display persistence while the system is in VR mode.
6316 *
6317 * @see PackageManager#FEATURE_VR_MODE_HIGH_PERFORMANCE
6318 *
6319 * @hide.
6320 */
6321 public static final int VR_DISPLAY_MODE_LOW_PERSISTENCE = 0;
6322
6323 /**
6324 * Do not alter the display persistence while the system is in VR mode.
6325 *
6326 * @see PackageManager#FEATURE_VR_MODE_HIGH_PERFORMANCE
6327 *
6328 * @hide.
6329 */
6330 public static final int VR_DISPLAY_MODE_OFF = 1;
6331
6332 /**
Jeff Davidson24b9d962016-07-21 12:35:10 -07006333 * Whether CarrierAppUtils#disableCarrierAppsUntilPrivileged has been executed at least
6334 * once.
6335 *
6336 * <p>This is used to ensure that we only take one pass which will disable apps that are not
6337 * privileged (if any). From then on, we only want to enable apps (when a matching SIM is
6338 * inserted), to avoid disabling an app that the user might actively be using.
6339 *
6340 * <p>Will be set to 1 once executed.
6341 *
6342 * @hide
6343 */
6344 public static final String CARRIER_APPS_HANDLED = "carrier_apps_handled";
6345
6346 /**
Tony Makc820cc52016-05-03 18:58:28 +01006347 * Whether parent user can access remote contact in managed profile.
6348 *
6349 * @hide
6350 */
6351 public static final String MANAGED_PROFILE_CONTACT_REMOTE_SEARCH =
6352 "managed_profile_contact_remote_search";
6353
6354 /**
Daniel Nishi395d3872016-05-23 13:25:21 -07006355 * Whether or not the automatic storage manager is enabled and should run on the device.
6356 *
6357 * @hide
6358 */
6359 public static final String AUTOMATIC_STORAGE_MANAGER_ENABLED =
6360 "automatic_storage_manager_enabled";
6361
6362 /**
Daniel Nishic535be12016-06-10 13:51:36 -07006363 * How many days of information for the automatic storage manager to retain on the device.
6364 *
6365 * @hide
6366 */
6367 public static final String AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN =
6368 "automatic_storage_manager_days_to_retain";
6369
6370 /**
6371 * Default number of days of information for the automatic storage manager to retain.
6372 *
6373 * @hide
6374 */
6375 public static final int AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN_DEFAULT = 90;
6376
6377 /**
Daniel Nishif678cc92016-06-24 15:49:25 -07006378 * How many bytes the automatic storage manager has cleared out.
6379 *
6380 * @hide
6381 */
6382 public static final String AUTOMATIC_STORAGE_MANAGER_BYTES_CLEARED =
6383 "automatic_storage_manager_bytes_cleared";
6384
6385
6386 /**
6387 * Last run time for the automatic storage manager.
6388 *
6389 * @hide
6390 */
6391 public static final String AUTOMATIC_STORAGE_MANAGER_LAST_RUN =
6392 "automatic_storage_manager_last_run";
6393
6394
6395 /**
Doris Linga60d31d2016-07-06 13:39:05 -07006396 * Whether SystemUI navigation keys is enabled.
6397 * @hide
6398 */
6399 public static final String SYSTEM_NAVIGATION_KEYS_ENABLED =
6400 "system_navigation_keys_enabled";
6401
Fyodor Kupolov51ce8ee2016-07-27 17:45:12 -07006402 /**
Jason Monkbaade752016-08-25 15:57:14 -04006403 * Holds comma separated list of ordering of QS tiles.
6404 * @hide
6405 */
6406 public static final String QS_TILES = "sysui_qs_tiles";
6407
6408 /**
Fyodor Kupolov51ce8ee2016-07-27 17:45:12 -07006409 * Whether preloaded APKs have been installed for the user.
6410 * @hide
6411 */
6412 public static final String DEMO_USER_SETUP_COMPLETE
6413 = "demo_user_setup_complete";
Doris Linga60d31d2016-07-06 13:39:05 -07006414
6415 /**
Todd Kennedyefc1c4d2016-07-21 07:44:33 -07006416 * Specifies whether the web action API is enabled.
6417 *
6418 * @hide
6419 */
6420 public static final String WEB_ACTION_ENABLED = "web_action_enabled";
6421
6422 /**
Greg Plesur35144042016-10-10 16:23:49 -04006423 * Has this pairable device been paired or upgraded from a previously paired system.
6424 * @hide
6425 */
6426 public static final String DEVICE_PAIRED = "device_paired";
6427
6428 /**
Svetoslav Ganova571a582011-09-20 18:32:20 -07006429 * This are the settings to be backed up.
6430 *
6431 * NOTE: Settings are backed up and restored in the order they appear
6432 * in this array. If you have one setting depending on another,
6433 * make sure that they are ordered appropriately.
6434 *
-b master501eec92009-07-06 13:53:11 -07006435 * @hide
6436 */
6437 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate58f41ec2013-01-11 15:40:36 -08006438 BUGREPORT_IN_POWER_MENU, // moved to global
Amith Yamasani8823c0a82009-07-07 14:30:17 -07006439 ALLOW_MOCK_LOCATION,
-b master501eec92009-07-06 13:53:11 -07006440 PARENTAL_CONTROL_ENABLED,
6441 PARENTAL_CONTROL_REDIRECT_URL,
Christopher Tate66488d62012-10-02 11:58:01 -07006442 USB_MASS_STORAGE_ENABLED, // moved to global
Anna Galuszafa7786c2015-12-22 10:53:44 -08006443 ACCESSIBILITY_DISPLAY_INVERSION_ENABLED,
6444 ACCESSIBILITY_DISPLAY_DALTONIZER,
Anna Galuszafa7786c2015-12-22 10:53:44 -08006445 ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED,
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07006446 ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED,
6447 ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE,
6448 ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE,
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07006449 ACCESSIBILITY_SCRIPT_INJECTION,
Anna Galuszafa7786c2015-12-22 10:53:44 -08006450 ACCESSIBILITY_WEB_CONTENT_KEY_BINDINGS,
-b master501eec92009-07-06 13:53:11 -07006451 ENABLED_ACCESSIBILITY_SERVICES,
Christopher Tate6597e342015-02-17 12:15:25 -08006452 ENABLED_NOTIFICATION_LISTENERS,
Ruben Brunke24b9a62016-02-16 21:38:24 -08006453 ENABLED_VR_LISTENERS,
Christopher Tate7b9a28c2015-03-18 13:06:16 -07006454 ENABLED_INPUT_METHODS,
Svetoslav Ganov9a4c5cd2012-05-30 14:06:32 -07006455 TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES,
Svetoslav Ganova28a16d2011-07-28 11:24:21 -07006456 TOUCH_EXPLORATION_ENABLED,
Svetoslav Ganova571a582011-09-20 18:32:20 -07006457 ACCESSIBILITY_ENABLED,
Svetoslav Ganov55f937a2011-12-05 11:42:07 -08006458 ACCESSIBILITY_SPEAK_PASSWORD,
Chris Craikcce47eb2014-07-16 15:12:15 -07006459 ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED,
Anna Galuszafa7786c2015-12-22 10:53:44 -08006460 ACCESSIBILITY_CAPTIONING_PRESET,
Alan Viveretteef793802013-07-23 14:15:28 -07006461 ACCESSIBILITY_CAPTIONING_ENABLED,
6462 ACCESSIBILITY_CAPTIONING_LOCALE,
6463 ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR,
6464 ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR,
6465 ACCESSIBILITY_CAPTIONING_EDGE_TYPE,
6466 ACCESSIBILITY_CAPTIONING_EDGE_COLOR,
6467 ACCESSIBILITY_CAPTIONING_TYPEFACE,
Alan Viverette69ce69b2013-08-29 12:23:48 -07006468 ACCESSIBILITY_CAPTIONING_FONT_SCALE,
Anna Galuszafa7786c2015-12-22 10:53:44 -08006469 ACCESSIBILITY_CAPTIONING_WINDOW_COLOR,
-b master501eec92009-07-06 13:53:11 -07006470 TTS_USE_DEFAULTS,
6471 TTS_DEFAULT_RATE,
6472 TTS_DEFAULT_PITCH,
6473 TTS_DEFAULT_SYNTH,
6474 TTS_DEFAULT_LANG,
6475 TTS_DEFAULT_COUNTRY,
Charles Chenceffa152010-03-16 21:18:10 -07006476 TTS_ENABLED_PLUGINS,
Narayan Kamath6d632962011-08-24 11:51:37 +01006477 TTS_DEFAULT_LOCALE,
Anna Galuszafa7786c2015-12-22 10:53:44 -08006478 SHOW_IME_WITH_HARD_KEYBOARD,
Christopher Tate66488d62012-10-02 11:58:01 -07006479 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, // moved to global
6480 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, // moved to global
6481 WIFI_NUM_OPEN_NETWORKS_KEPT, // moved to global
Christopher Tate06cbadd2015-03-16 18:29:42 -07006482 SELECTED_SPELL_CHECKER,
6483 SELECTED_SPELL_CHECKER_SUBTYPE,
6484 SPELL_CHECKER_ENABLED,
San Mehat87734d32010-01-08 12:53:06 -08006485 MOUNT_PLAY_NOTIFICATION_SND,
6486 MOUNT_UMS_AUTOSTART,
6487 MOUNT_UMS_PROMPT,
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07006488 MOUNT_UMS_NOTIFY_ENABLED,
Jason Monk27bbb2d2015-03-31 16:46:39 -04006489 SLEEP_TIMEOUT,
6490 DOUBLE_TAP_TO_WAKE,
Anna Galuszafa7786c2015-12-22 10:53:44 -08006491 WAKE_GESTURE_ENABLED,
6492 LONG_PRESS_TIMEOUT,
Jason Monk5a5e7d62015-08-04 11:20:25 -04006493 CAMERA_GESTURE_DISABLED,
Toni Barzic386f8342015-09-09 12:30:41 -07006494 ACCESSIBILITY_AUTOCLICK_ENABLED,
Anna Galuszafa7786c2015-12-22 10:53:44 -08006495 ACCESSIBILITY_AUTOCLICK_DELAY,
6496 ACCESSIBILITY_LARGE_POINTER_ICON,
6497 PREFERRED_TTY_MODE,
6498 ENHANCED_VOICE_PRIVACY_ENABLED,
6499 TTY_MODE_ENABLED,
Mike Tsaofc47ba72016-07-15 09:54:07 -07006500 INCALL_POWER_BUTTON_BEHAVIOR,
6501 NIGHT_DISPLAY_CUSTOM_START_TIME,
6502 NIGHT_DISPLAY_CUSTOM_END_TIME,
6503 NIGHT_DISPLAY_AUTO_MODE,
Doris Ling8a332732016-08-24 15:05:43 -07006504 NIGHT_DISPLAY_ACTIVATED,
6505 CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED,
6506 CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED,
Jason Monkbaade752016-08-25 15:57:14 -04006507 SYSTEM_NAVIGATION_KEYS_ENABLED,
6508 QS_TILES,
Doris Ling6403b402016-09-09 14:29:19 -07006509 DOZE_ENABLED,
6510 DOZE_PULSE_ON_PICK_UP,
Ruchi Kandoi104e0b42016-12-29 13:31:43 -08006511 DOZE_PULSE_ON_DOUBLE_TAP,
6512 NFC_PAYMENT_DEFAULT_COMPONENT
-b master501eec92009-07-06 13:53:11 -07006513 };
6514
6515 /**
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07006516 * These entries are considered common between the personal and the managed profile,
6517 * since the managed profile doesn't get to change them.
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07006518 */
Svetoslav683914b2015-01-15 14:22:26 -08006519 private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>();
Amith Yamasanib0ff3222015-03-04 09:56:14 -08006520
Svetoslav683914b2015-01-15 14:22:26 -08006521 static {
6522 CLONE_TO_MANAGED_PROFILE.add(ACCESSIBILITY_ENABLED);
6523 CLONE_TO_MANAGED_PROFILE.add(ALLOW_MOCK_LOCATION);
6524 CLONE_TO_MANAGED_PROFILE.add(ALLOWED_GEOLOCATION_ORIGINS);
6525 CLONE_TO_MANAGED_PROFILE.add(DEFAULT_INPUT_METHOD);
6526 CLONE_TO_MANAGED_PROFILE.add(ENABLED_ACCESSIBILITY_SERVICES);
6527 CLONE_TO_MANAGED_PROFILE.add(ENABLED_INPUT_METHODS);
6528 CLONE_TO_MANAGED_PROFILE.add(LOCATION_MODE);
Lifu Tangd1fa1d62015-11-25 21:42:44 -08006529 CLONE_TO_MANAGED_PROFILE.add(LOCATION_PREVIOUS_MODE);
Svetoslav683914b2015-01-15 14:22:26 -08006530 CLONE_TO_MANAGED_PROFILE.add(LOCATION_PROVIDERS_ALLOWED);
Svetoslav683914b2015-01-15 14:22:26 -08006531 CLONE_TO_MANAGED_PROFILE.add(SELECTED_INPUT_METHOD_SUBTYPE);
6532 CLONE_TO_MANAGED_PROFILE.add(SELECTED_SPELL_CHECKER);
6533 CLONE_TO_MANAGED_PROFILE.add(SELECTED_SPELL_CHECKER_SUBTYPE);
6534 }
6535
6536 /** @hide */
6537 public static void getCloneToManagedProfileSettings(Set<String> outKeySet) {
6538 outKeySet.addAll(CLONE_TO_MANAGED_PROFILE);
6539 }
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07006540
6541 /**
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07006542 * Helper method for determining if a location provider is enabled.
Tom O'Neilld5759432013-09-11 11:03:03 -07006543 *
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07006544 * @param cr the content resolver to use
6545 * @param provider the location provider to query
6546 * @return true if the provider is enabled
Tom O'Neilld5759432013-09-11 11:03:03 -07006547 *
6548 * @deprecated use {@link #LOCATION_MODE} or
6549 * {@link LocationManager#isProviderEnabled(String)}
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07006550 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07006551 @Deprecated
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07006552 public static final boolean isLocationProviderEnabled(ContentResolver cr, String provider) {
Victoria Leaseb711d572012-10-02 13:14:11 -07006553 return isLocationProviderEnabledForUser(cr, provider, UserHandle.myUserId());
6554 }
6555
6556 /**
6557 * Helper method for determining if a location provider is enabled.
6558 * @param cr the content resolver to use
6559 * @param provider the location provider to query
6560 * @param userId the userId to query
6561 * @return true if the provider is enabled
Tom O'Neilld5759432013-09-11 11:03:03 -07006562 * @deprecated use {@link #LOCATION_MODE} or
6563 * {@link LocationManager#isProviderEnabled(String)}
Victoria Leaseb711d572012-10-02 13:14:11 -07006564 * @hide
6565 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07006566 @Deprecated
Victoria Leaseb711d572012-10-02 13:14:11 -07006567 public static final boolean isLocationProviderEnabledForUser(ContentResolver cr, String provider, int userId) {
6568 String allowedProviders = Settings.Secure.getStringForUser(cr,
6569 LOCATION_PROVIDERS_ALLOWED, userId);
Brad Fitzpatrick11fe1812010-09-10 16:07:52 -07006570 return TextUtils.delimitedStringContains(allowedProviders, ',', provider);
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07006571 }
6572
6573 /**
6574 * Thread-safe method for enabling or disabling a single location provider.
6575 * @param cr the content resolver to use
6576 * @param provider the location provider to enable or disable
6577 * @param enabled true if the provider should be enabled
Tom O'Neilla324ac72013-08-26 14:40:23 -07006578 * @deprecated use {@link #putInt(ContentResolver, String, int)} and {@link #LOCATION_MODE}
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07006579 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07006580 @Deprecated
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07006581 public static final void setLocationProviderEnabled(ContentResolver cr,
6582 String provider, boolean enabled) {
Victoria Leaseb711d572012-10-02 13:14:11 -07006583 setLocationProviderEnabledForUser(cr, provider, enabled, UserHandle.myUserId());
6584 }
6585
6586 /**
6587 * Thread-safe method for enabling or disabling a single location provider.
Tom O'Neilla324ac72013-08-26 14:40:23 -07006588 *
Victoria Leaseb711d572012-10-02 13:14:11 -07006589 * @param cr the content resolver to use
6590 * @param provider the location provider to enable or disable
6591 * @param enabled true if the provider should be enabled
6592 * @param userId the userId for which to enable/disable providers
Tom O'Neilla324ac72013-08-26 14:40:23 -07006593 * @return true if the value was set, false on database errors
6594 * @deprecated use {@link #putIntForUser(ContentResolver, String, int, int)} and
6595 * {@link #LOCATION_MODE}
Victoria Leaseb711d572012-10-02 13:14:11 -07006596 * @hide
6597 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07006598 @Deprecated
Tom O'Neilla324ac72013-08-26 14:40:23 -07006599 public static final boolean setLocationProviderEnabledForUser(ContentResolver cr,
Victoria Leaseb711d572012-10-02 13:14:11 -07006600 String provider, boolean enabled, int userId) {
David Christie3f7b6522013-08-06 19:19:08 -07006601 synchronized (mLocationSettingsLock) {
6602 // to ensure thread safety, we write the provider name with a '+' or '-'
6603 // and let the SettingsProvider handle it rather than reading and modifying
6604 // the list of enabled providers.
6605 if (enabled) {
6606 provider = "+" + provider;
6607 } else {
6608 provider = "-" + provider;
6609 }
Tom O'Neilla324ac72013-08-26 14:40:23 -07006610 return putStringForUser(cr, Settings.Secure.LOCATION_PROVIDERS_ALLOWED, provider,
David Christie3f7b6522013-08-06 19:19:08 -07006611 userId);
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07006612 }
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07006613 }
Tom O'Neill1f48b782013-08-19 18:14:56 -07006614
6615 /**
Lifu Tangd1fa1d62015-11-25 21:42:44 -08006616 * Saves the current location mode into {@link #LOCATION_PREVIOUS_MODE}.
6617 */
6618 private static final boolean saveLocationModeForUser(ContentResolver cr, int userId) {
6619 final int mode = getLocationModeForUser(cr, userId);
6620 return putIntForUser(cr, Settings.Secure.LOCATION_PREVIOUS_MODE, mode, userId);
6621 }
6622
6623 /**
6624 * Restores the current location mode from {@link #LOCATION_PREVIOUS_MODE}.
6625 */
6626 private static final boolean restoreLocationModeForUser(ContentResolver cr, int userId) {
6627 int mode = getIntForUser(cr, Settings.Secure.LOCATION_PREVIOUS_MODE,
6628 LOCATION_MODE_HIGH_ACCURACY, userId);
6629 // Make sure that the previous mode is never "off". Otherwise the user won't be able to
6630 // turn on location any longer.
6631 if (mode == LOCATION_MODE_OFF) {
6632 mode = LOCATION_MODE_HIGH_ACCURACY;
6633 }
6634 return setLocationModeForUser(cr, mode, userId);
6635 }
6636
6637 /**
Tom O'Neill1f48b782013-08-19 18:14:56 -07006638 * Thread-safe method for setting the location mode to one of
6639 * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY},
6640 * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}.
6641 *
Tom O'Neill1f48b782013-08-19 18:14:56 -07006642 * @param cr the content resolver to use
6643 * @param mode such as {@link #LOCATION_MODE_HIGH_ACCURACY}
6644 * @param userId the userId for which to change mode
Tom O'Neilla324ac72013-08-26 14:40:23 -07006645 * @return true if the value was set, false on database errors
Tom O'Neill1f48b782013-08-19 18:14:56 -07006646 *
6647 * @throws IllegalArgumentException if mode is not one of the supported values
6648 */
Tom O'Neill7f6f4572013-08-27 10:53:15 -07006649 private static final boolean setLocationModeForUser(ContentResolver cr, int mode,
6650 int userId) {
Tom O'Neill1f48b782013-08-19 18:14:56 -07006651 synchronized (mLocationSettingsLock) {
6652 boolean gps = false;
6653 boolean network = false;
6654 switch (mode) {
Lifu Tangd1fa1d62015-11-25 21:42:44 -08006655 case LOCATION_MODE_PREVIOUS:
6656 // Retrieve the actual mode and set to that mode.
6657 return restoreLocationModeForUser(cr, userId);
Tom O'Neill1f48b782013-08-19 18:14:56 -07006658 case LOCATION_MODE_OFF:
Lifu Tangd1fa1d62015-11-25 21:42:44 -08006659 saveLocationModeForUser(cr, userId);
Tom O'Neill1f48b782013-08-19 18:14:56 -07006660 break;
6661 case LOCATION_MODE_SENSORS_ONLY:
6662 gps = true;
6663 break;
6664 case LOCATION_MODE_BATTERY_SAVING:
6665 network = true;
6666 break;
6667 case LOCATION_MODE_HIGH_ACCURACY:
6668 gps = true;
6669 network = true;
6670 break;
6671 default:
6672 throw new IllegalArgumentException("Invalid location mode: " + mode);
6673 }
Tom O'Neill7731a992014-10-09 11:30:49 -07006674 // Note it's important that we set the NLP mode first. The Google implementation
6675 // of NLP clears its NLP consent setting any time it receives a
6676 // LocationManager.PROVIDERS_CHANGED_ACTION broadcast and NLP is disabled. Also,
6677 // it shows an NLP consent dialog any time it receives the broadcast, NLP is
6678 // enabled, and the NLP consent is not set. If 1) we were to enable GPS first,
6679 // 2) a setup wizard has its own NLP consent UI that sets the NLP consent setting,
6680 // and 3) the receiver happened to complete before we enabled NLP, then the Google
6681 // NLP would detect the attempt to enable NLP and show a redundant NLP consent
6682 // dialog. Then the people who wrote the setup wizard would be sad.
Tom O'Neilla324ac72013-08-26 14:40:23 -07006683 boolean nlpSuccess = Settings.Secure.setLocationProviderEnabledForUser(
Tom O'Neill1f48b782013-08-19 18:14:56 -07006684 cr, LocationManager.NETWORK_PROVIDER, network, userId);
Tom O'Neill7731a992014-10-09 11:30:49 -07006685 boolean gpsSuccess = Settings.Secure.setLocationProviderEnabledForUser(
6686 cr, LocationManager.GPS_PROVIDER, gps, userId);
Tom O'Neilla324ac72013-08-26 14:40:23 -07006687 return gpsSuccess && nlpSuccess;
Tom O'Neill1f48b782013-08-19 18:14:56 -07006688 }
6689 }
6690
6691 /**
Tom O'Neill1f48b782013-08-19 18:14:56 -07006692 * Thread-safe method for reading the location mode, returns one of
6693 * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY},
6694 * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}.
6695 *
6696 * @param cr the content resolver to use
6697 * @param userId the userId for which to read the mode
6698 * @return the location mode
6699 */
Tom O'Neill7f6f4572013-08-27 10:53:15 -07006700 private static final int getLocationModeForUser(ContentResolver cr, int userId) {
Tom O'Neill1f48b782013-08-19 18:14:56 -07006701 synchronized (mLocationSettingsLock) {
6702 boolean gpsEnabled = Settings.Secure.isLocationProviderEnabledForUser(
6703 cr, LocationManager.GPS_PROVIDER, userId);
6704 boolean networkEnabled = Settings.Secure.isLocationProviderEnabledForUser(
6705 cr, LocationManager.NETWORK_PROVIDER, userId);
6706 if (gpsEnabled && networkEnabled) {
6707 return LOCATION_MODE_HIGH_ACCURACY;
6708 } else if (gpsEnabled) {
6709 return LOCATION_MODE_SENSORS_ONLY;
6710 } else if (networkEnabled) {
6711 return LOCATION_MODE_BATTERY_SAVING;
6712 } else {
6713 return LOCATION_MODE_OFF;
6714 }
6715 }
6716 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006717 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006718
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006719 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006720 * Global system settings, containing preferences that always apply identically
6721 * to all defined users. Applications can read these but are not allowed to write;
6722 * like the "Secure" settings, these are for preferences that the user must
6723 * explicitly modify through the system UI or specialized APIs for those values.
6724 */
6725 public static final class Global extends NameValueTable {
Christopher Tate06efb532012-08-24 15:29:27 -07006726 /**
6727 * The content:// style URL for global secure settings items. Not public.
6728 */
6729 public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/global");
6730
6731 /**
Amith Yamasani23a0f052014-07-25 12:26:53 -07006732 * Whether users are allowed to add more users or guest from lockscreen.
6733 * <p>
6734 * Type: int
6735 * @hide
6736 */
6737 public static final String ADD_USERS_WHEN_LOCKED = "add_users_when_locked";
6738
6739 /**
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07006740 * Setting whether the global gesture for enabling accessibility is enabled.
6741 * If this gesture is enabled the user will be able to perfrom it to enable
6742 * the accessibility state without visiting the settings app.
6743 * @hide
6744 */
6745 public static final String ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED =
6746 "enable_accessibility_global_gesture_enabled";
6747
6748 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006749 * Whether Airplane Mode is on.
6750 */
6751 public static final String AIRPLANE_MODE_ON = "airplane_mode_on";
6752
6753 /**
Bryce Lee584a4452014-10-21 15:55:55 -07006754 * Whether Theater Mode is on.
6755 * {@hide}
6756 */
Bryce Leecdfebd62015-02-02 08:19:11 -08006757 @SystemApi
Bryce Lee584a4452014-10-21 15:55:55 -07006758 public static final String THEATER_MODE_ON = "theater_mode_on";
6759
6760 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006761 * Constant for use in AIRPLANE_MODE_RADIOS to specify Bluetooth radio.
6762 */
6763 public static final String RADIO_BLUETOOTH = "bluetooth";
6764
6765 /**
6766 * Constant for use in AIRPLANE_MODE_RADIOS to specify Wi-Fi radio.
6767 */
6768 public static final String RADIO_WIFI = "wifi";
6769
6770 /**
6771 * {@hide}
6772 */
6773 public static final String RADIO_WIMAX = "wimax";
6774 /**
6775 * Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio.
6776 */
6777 public static final String RADIO_CELL = "cell";
6778
6779 /**
6780 * Constant for use in AIRPLANE_MODE_RADIOS to specify NFC radio.
6781 */
6782 public static final String RADIO_NFC = "nfc";
6783
6784 /**
6785 * A comma separated list of radios that need to be disabled when airplane mode
6786 * is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are
6787 * included in the comma separated list.
6788 */
6789 public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios";
6790
6791 /**
6792 * A comma separated list of radios that should to be disabled when airplane mode
6793 * is on, but can be manually reenabled by the user. For example, if RADIO_WIFI is
6794 * added to both AIRPLANE_MODE_RADIOS and AIRPLANE_MODE_TOGGLEABLE_RADIOS, then Wifi
6795 * will be turned off when entering airplane mode, but the user will be able to reenable
6796 * Wifi in the Settings app.
6797 *
6798 * {@hide}
6799 */
6800 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios";
6801
6802 /**
Bryce Leeec85f342015-12-16 13:32:28 -08006803 * A Long representing a bitmap of profiles that should be disabled when bluetooth starts.
6804 * See {@link android.bluetooth.BluetoothProfile}.
6805 * {@hide}
6806 */
6807 public static final String BLUETOOTH_DISABLED_PROFILES = "bluetooth_disabled_profiles";
6808
6809 /**
Andre Eisenbach82a94d92016-01-14 14:20:34 -08006810 * A semi-colon separated list of Bluetooth interoperability workarounds.
6811 * Each entry is a partial Bluetooth device address string and an integer representing
6812 * the feature to be disabled, separated by a comma. The integer must correspond
6813 * to a interoperability feature as defined in "interop.h" in /system/bt.
6814 * <p>
6815 * Example: <br/>
6816 * "00:11:22,0;01:02:03:04,2"
6817 * @hide
6818 */
6819 public static final String BLUETOOTH_INTEROPERABILITY_LIST = "bluetooth_interoperability_list";
6820
6821 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006822 * The policy for deciding when Wi-Fi should go to sleep (which will in
6823 * turn switch to using the mobile data as an Internet connection).
6824 * <p>
6825 * Set to one of {@link #WIFI_SLEEP_POLICY_DEFAULT},
6826 * {@link #WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED}, or
6827 * {@link #WIFI_SLEEP_POLICY_NEVER}.
6828 */
6829 public static final String WIFI_SLEEP_POLICY = "wifi_sleep_policy";
6830
6831 /**
6832 * Value for {@link #WIFI_SLEEP_POLICY} to use the default Wi-Fi sleep
6833 * policy, which is to sleep shortly after the turning off
6834 * according to the {@link #STAY_ON_WHILE_PLUGGED_IN} setting.
6835 */
6836 public static final int WIFI_SLEEP_POLICY_DEFAULT = 0;
6837
6838 /**
6839 * Value for {@link #WIFI_SLEEP_POLICY} to use the default policy when
6840 * the device is on battery, and never go to sleep when the device is
6841 * plugged in.
6842 */
6843 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1;
6844
6845 /**
6846 * Value for {@link #WIFI_SLEEP_POLICY} to never go to sleep.
6847 */
6848 public static final int WIFI_SLEEP_POLICY_NEVER = 2;
6849
6850 /**
6851 * Value to specify if the user prefers the date, time and time zone
6852 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
6853 */
6854 public static final String AUTO_TIME = "auto_time";
6855
6856 /**
6857 * Value to specify if the user prefers the time zone
6858 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
6859 */
6860 public static final String AUTO_TIME_ZONE = "auto_time_zone";
6861
6862 /**
6863 * URI for the car dock "in" event sound.
6864 * @hide
6865 */
6866 public static final String CAR_DOCK_SOUND = "car_dock_sound";
6867
6868 /**
6869 * URI for the car dock "out" event sound.
6870 * @hide
6871 */
6872 public static final String CAR_UNDOCK_SOUND = "car_undock_sound";
6873
6874 /**
6875 * URI for the desk dock "in" event sound.
6876 * @hide
6877 */
6878 public static final String DESK_DOCK_SOUND = "desk_dock_sound";
6879
6880 /**
6881 * URI for the desk dock "out" event sound.
6882 * @hide
6883 */
6884 public static final String DESK_UNDOCK_SOUND = "desk_undock_sound";
6885
6886 /**
6887 * Whether to play a sound for dock events.
6888 * @hide
6889 */
6890 public static final String DOCK_SOUNDS_ENABLED = "dock_sounds_enabled";
6891
6892 /**
Vinod Krishnancf11cea2016-10-20 22:57:02 -07006893 * Whether to play a sound for dock events, only when an accessibility service is on.
6894 * @hide
6895 */
6896 public static final String DOCK_SOUNDS_ENABLED_WHEN_ACCESSIBILITY = "dock_sounds_enabled_when_accessbility";
6897
6898 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006899 * URI for the "device locked" (keyguard shown) sound.
6900 * @hide
6901 */
6902 public static final String LOCK_SOUND = "lock_sound";
6903
6904 /**
6905 * URI for the "device unlocked" sound.
6906 * @hide
6907 */
6908 public static final String UNLOCK_SOUND = "unlock_sound";
6909
6910 /**
Adrian Roos49e057d2014-08-13 17:14:51 +02006911 * URI for the "device is trusted" sound, which is played when the device enters the trusted
6912 * state without unlocking.
6913 * @hide
6914 */
6915 public static final String TRUSTED_SOUND = "trusted_sound";
6916
6917 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006918 * URI for the low battery sound file.
6919 * @hide
6920 */
6921 public static final String LOW_BATTERY_SOUND = "low_battery_sound";
6922
6923 /**
6924 * Whether to play a sound for low-battery alerts.
6925 * @hide
6926 */
6927 public static final String POWER_SOUNDS_ENABLED = "power_sounds_enabled";
6928
6929 /**
Jeff Brown84e27562012-12-07 13:56:34 -08006930 * URI for the "wireless charging started" sound.
6931 * @hide
6932 */
6933 public static final String WIRELESS_CHARGING_STARTED_SOUND =
6934 "wireless_charging_started_sound";
6935
6936 /**
John Spurlock51a871d2015-05-06 17:41:30 -04006937 * Whether to play a sound for charging events.
6938 * @hide
6939 */
6940 public static final String CHARGING_SOUNDS_ENABLED = "charging_sounds_enabled";
6941
6942 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006943 * Whether we keep the device on while the device is plugged in.
6944 * Supported values are:
6945 * <ul>
6946 * <li>{@code 0} to never stay on while plugged in</li>
6947 * <li>{@link BatteryManager#BATTERY_PLUGGED_AC} to stay on for AC charger</li>
6948 * <li>{@link BatteryManager#BATTERY_PLUGGED_USB} to stay on for USB charger</li>
6949 * <li>{@link BatteryManager#BATTERY_PLUGGED_WIRELESS} to stay on for wireless charger</li>
6950 * </ul>
6951 * These values can be OR-ed together.
6952 */
6953 public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in";
6954
6955 /**
Christopher Tate58f41ec2013-01-11 15:40:36 -08006956 * When the user has enable the option to have a "bug report" command
6957 * in the power menu.
6958 * @hide
6959 */
6960 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
6961
6962 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006963 * Whether ADB is enabled.
6964 */
6965 public static final String ADB_ENABLED = "adb_enabled";
6966
6967 /**
Jon Miranda836c0a82014-08-11 12:32:26 -07006968 * Whether Views are allowed to save their attribute data.
6969 * @hide
6970 */
6971 public static final String DEBUG_VIEW_ATTRIBUTES = "debug_view_attributes";
6972
6973 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006974 * Whether assisted GPS should be enabled or not.
6975 * @hide
6976 */
6977 public static final String ASSISTED_GPS_ENABLED = "assisted_gps_enabled";
6978
6979 /**
6980 * Whether bluetooth is enabled/disabled
6981 * 0=disabled. 1=enabled.
6982 */
6983 public static final String BLUETOOTH_ON = "bluetooth_on";
6984
6985 /**
6986 * CDMA Cell Broadcast SMS
6987 * 0 = CDMA Cell Broadcast SMS disabled
6988 * 1 = CDMA Cell Broadcast SMS enabled
6989 * @hide
6990 */
6991 public static final String CDMA_CELL_BROADCAST_SMS =
6992 "cdma_cell_broadcast_sms";
6993
6994 /**
6995 * The CDMA roaming mode 0 = Home Networks, CDMA default
6996 * 1 = Roaming on Affiliated networks
6997 * 2 = Roaming on any networks
6998 * @hide
6999 */
7000 public static final String CDMA_ROAMING_MODE = "roaming_settings";
7001
7002 /**
7003 * The CDMA subscription mode 0 = RUIM/SIM (default)
7004 * 1 = NV
7005 * @hide
7006 */
7007 public static final String CDMA_SUBSCRIPTION_MODE = "subscription_mode";
7008
7009 /** Inactivity timeout to track mobile data activity.
7010 *
7011 * If set to a positive integer, it indicates the inactivity timeout value in seconds to
7012 * infer the data activity of mobile network. After a period of no activity on mobile
7013 * networks with length specified by the timeout, an {@code ACTION_DATA_ACTIVITY_CHANGE}
7014 * intent is fired to indicate a transition of network status from "active" to "idle". Any
7015 * subsequent activity on mobile networks triggers the firing of {@code
7016 * ACTION_DATA_ACTIVITY_CHANGE} intent indicating transition from "idle" to "active".
7017 *
7018 * Network activity refers to transmitting or receiving data on the network interfaces.
7019 *
7020 * Tracking is disabled if set to zero or negative value.
7021 *
7022 * @hide
7023 */
7024 public static final String DATA_ACTIVITY_TIMEOUT_MOBILE = "data_activity_timeout_mobile";
7025
7026 /** Timeout to tracking Wifi data activity. Same as {@code DATA_ACTIVITY_TIMEOUT_MOBILE}
7027 * but for Wifi network.
7028 * @hide
7029 */
7030 public static final String DATA_ACTIVITY_TIMEOUT_WIFI = "data_activity_timeout_wifi";
7031
7032 /**
7033 * Whether or not data roaming is enabled. (0 = false, 1 = true)
7034 */
7035 public static final String DATA_ROAMING = "data_roaming";
7036
7037 /**
Wink Saville75c1e692013-03-20 17:06:50 -07007038 * The value passed to a Mobile DataConnection via bringUp which defines the
7039 * number of retries to preform when setting up the initial connection. The default
7040 * value defined in DataConnectionTrackerBase#DEFAULT_MDC_INITIAL_RETRY is currently 1.
7041 * @hide
7042 */
7043 public static final String MDC_INITIAL_MAX_RETRY = "mdc_initial_max_retry";
7044
7045 /**
Todd Kennedyf39ca8f2015-08-07 14:15:07 -07007046 * Whether any package can be on external storage. When this is true, any
7047 * package, regardless of manifest values, is a candidate for installing
7048 * or moving onto external storage. (0 = false, 1 = true)
7049 * @hide
7050 */
7051 public static final String FORCE_ALLOW_ON_EXTERNAL = "force_allow_on_external";
7052
Jorim Jaggi8ccdf3a2015-10-22 12:50:31 +02007053 /**
7054 * Whether any activity can be resized. When this is true, any
7055 * activity, regardless of manifest values, can be resized for multi-window.
7056 * (0 = false, 1 = true)
7057 * @hide
7058 */
7059 public static final String DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES
7060 = "force_resizable_activities";
7061
Jorim Jaggi6f2efd32015-12-23 12:04:39 +01007062 /**
7063 * Whether to enable experimental freeform support for windows.
7064 * @hide
7065 */
7066 public static final String DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT
7067 = "enable_freeform_support";
7068
Todd Kennedyf39ca8f2015-08-07 14:15:07 -07007069 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007070 * Whether user has enabled development settings.
7071 */
7072 public static final String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled";
7073
7074 /**
Amith Yamasanicb15d662015-11-10 11:11:15 -08007075 * Whether the device has been provisioned (0 = false, 1 = true).
7076 * <p>On a multiuser device with a separate system user, the screen may be locked
7077 * as soon as this is set to true and further activities cannot be launched on the
7078 * system user unless they are marked to show over keyguard.
Christopher Tate06efb532012-08-24 15:29:27 -07007079 */
7080 public static final String DEVICE_PROVISIONED = "device_provisioned";
7081
7082 /**
Robert Greenwaltbeb482c2016-03-28 15:40:56 -07007083 * Whether mobile data should be allowed while the device is being provisioned.
7084 * This allows the provisioning process to turn off mobile data before the user
7085 * has an opportunity to set things up, preventing other processes from burning
7086 * precious bytes before wifi is setup.
7087 * (0 = false, 1 = true)
7088 * @hide
7089 */
7090 public static final String DEVICE_PROVISIONING_MOBILE_DATA_ENABLED =
7091 "device_provisioning_mobile_data";
7092
7093 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007094 * The saved value for WindowManagerService.setForcedDisplaySize().
7095 * Two integers separated by a comma. If unset, then use the real display size.
7096 * @hide
7097 */
7098 public static final String DISPLAY_SIZE_FORCED = "display_size_forced";
7099
7100 /**
Jeff Brownd46747a2015-04-15 19:02:36 -07007101 * The saved value for WindowManagerService.setForcedDisplayScalingMode().
7102 * 0 or unset if scaling is automatic, 1 if scaling is disabled.
7103 * @hide
7104 */
7105 public static final String DISPLAY_SCALING_FORCE = "display_scaling_force";
7106
7107 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007108 * The maximum size, in bytes, of a download that the download manager will transfer over
7109 * a non-wifi connection.
7110 * @hide
7111 */
7112 public static final String DOWNLOAD_MAX_BYTES_OVER_MOBILE =
7113 "download_manager_max_bytes_over_mobile";
7114
7115 /**
7116 * The recommended maximum size, in bytes, of a download that the download manager should
7117 * transfer over a non-wifi connection. Over this size, the use will be warned, but will
7118 * have the option to start the download over the mobile connection anyway.
7119 * @hide
7120 */
7121 public static final String DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE =
7122 "download_manager_recommended_max_bytes_over_mobile";
7123
7124 /**
Christopher Tateaa036a22014-05-19 16:33:27 -07007125 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
Christopher Tate06efb532012-08-24 15:29:27 -07007126 */
Christopher Tateaa036a22014-05-19 16:33:27 -07007127 @Deprecated
7128 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
Christopher Tate06efb532012-08-24 15:29:27 -07007129
7130 /**
Jinsuk Kimb3d91772014-07-10 12:48:54 +09007131 * Whether HDMI control shall be enabled. If disabled, no CEC/MHL command will be
7132 * sent or processed. (0 = false, 1 = true)
7133 * @hide
7134 */
7135 public static final String HDMI_CONTROL_ENABLED = "hdmi_control_enabled";
7136
7137 /**
7138 * Whether HDMI system audio is enabled. If enabled, TV internal speaker is muted,
7139 * and the output is redirected to AV Receiver connected via
7140 * {@Global#HDMI_SYSTEM_AUDIO_OUTPUT}.
7141 * @hide
7142 */
7143 public static final String HDMI_SYSTEM_AUDIO_ENABLED = "hdmi_system_audio_enabled";
7144
7145 /**
Jinsuk Kimb3d91772014-07-10 12:48:54 +09007146 * Whether TV will automatically turn on upon reception of the CEC command
7147 * &lt;Text View On&gt; or &lt;Image View On&gt;. (0 = false, 1 = true)
7148 * @hide
7149 */
7150 public static final String HDMI_CONTROL_AUTO_WAKEUP_ENABLED =
7151 "hdmi_control_auto_wakeup_enabled";
7152
7153 /**
7154 * Whether TV will also turn off other CEC devices when it goes to standby mode.
7155 * (0 = false, 1 = true)
7156 * @hide
7157 */
7158 public static final String HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED =
7159 "hdmi_control_auto_device_off_enabled";
7160
7161 /**
7162 * Whether TV will switch to MHL port when a mobile device is plugged in.
7163 * (0 = false, 1 = true)
7164 * @hide
7165 */
7166 public static final String MHL_INPUT_SWITCHING_ENABLED = "mhl_input_switching_enabled";
7167
7168 /**
7169 * Whether TV will charge the mobile device connected at MHL port. (0 = false, 1 = true)
7170 * @hide
7171 */
7172 public static final String MHL_POWER_CHARGE_ENABLED = "mhl_power_charge_enabled";
7173
7174 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007175 * Whether mobile data connections are allowed by the user. See
7176 * ConnectivityManager for more info.
7177 * @hide
7178 */
7179 public static final String MOBILE_DATA = "mobile_data";
7180
Erik Klineda4bfa82015-04-30 12:58:40 +09007181 /**
7182 * Whether the mobile data connection should remain active even when higher
7183 * priority networks like WiFi are active, to help make network switching faster.
7184 *
7185 * See ConnectivityService for more info.
7186 *
7187 * (0 = disabled, 1 = enabled)
7188 * @hide
7189 */
7190 public static final String MOBILE_DATA_ALWAYS_ON = "mobile_data_always_on";
7191
Hugo Benichiff0b5862016-10-19 11:17:28 +09007192 /**
7193 * Size of the event buffer for IP connectivity metrics.
7194 * @hide
7195 */
7196 public static final String CONNECTIVITY_METRICS_BUFFER_SIZE =
7197 "connectivity_metrics_buffer_size";
7198
Christopher Tate06efb532012-08-24 15:29:27 -07007199 /** {@hide} */
7200 public static final String NETSTATS_ENABLED = "netstats_enabled";
7201 /** {@hide} */
7202 public static final String NETSTATS_POLL_INTERVAL = "netstats_poll_interval";
7203 /** {@hide} */
7204 public static final String NETSTATS_TIME_CACHE_MAX_AGE = "netstats_time_cache_max_age";
7205 /** {@hide} */
7206 public static final String NETSTATS_GLOBAL_ALERT_BYTES = "netstats_global_alert_bytes";
7207 /** {@hide} */
7208 public static final String NETSTATS_SAMPLE_ENABLED = "netstats_sample_enabled";
Christopher Tate06efb532012-08-24 15:29:27 -07007209
7210 /** {@hide} */
7211 public static final String NETSTATS_DEV_BUCKET_DURATION = "netstats_dev_bucket_duration";
7212 /** {@hide} */
7213 public static final String NETSTATS_DEV_PERSIST_BYTES = "netstats_dev_persist_bytes";
7214 /** {@hide} */
7215 public static final String NETSTATS_DEV_ROTATE_AGE = "netstats_dev_rotate_age";
7216 /** {@hide} */
7217 public static final String NETSTATS_DEV_DELETE_AGE = "netstats_dev_delete_age";
7218
7219 /** {@hide} */
7220 public static final String NETSTATS_UID_BUCKET_DURATION = "netstats_uid_bucket_duration";
7221 /** {@hide} */
7222 public static final String NETSTATS_UID_PERSIST_BYTES = "netstats_uid_persist_bytes";
7223 /** {@hide} */
7224 public static final String NETSTATS_UID_ROTATE_AGE = "netstats_uid_rotate_age";
7225 /** {@hide} */
7226 public static final String NETSTATS_UID_DELETE_AGE = "netstats_uid_delete_age";
7227
7228 /** {@hide} */
7229 public static final String NETSTATS_UID_TAG_BUCKET_DURATION = "netstats_uid_tag_bucket_duration";
7230 /** {@hide} */
7231 public static final String NETSTATS_UID_TAG_PERSIST_BYTES = "netstats_uid_tag_persist_bytes";
7232 /** {@hide} */
7233 public static final String NETSTATS_UID_TAG_ROTATE_AGE = "netstats_uid_tag_rotate_age";
7234 /** {@hide} */
7235 public static final String NETSTATS_UID_TAG_DELETE_AGE = "netstats_uid_tag_delete_age";
7236
7237 /**
7238 * User preference for which network(s) should be used. Only the
7239 * connectivity service should touch this.
7240 */
7241 public static final String NETWORK_PREFERENCE = "network_preference";
7242
7243 /**
Jeff Davidsondd6fd1e2014-04-14 15:14:30 -07007244 * Which package name to use for network scoring. If null, or if the package is not a valid
7245 * scorer app, external network scores will neither be requested nor accepted.
7246 * @hide
7247 */
7248 public static final String NETWORK_SCORER_APP = "network_scorer_app";
7249
7250 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007251 * If the NITZ_UPDATE_DIFF time is exceeded then an automatic adjustment
7252 * to SystemClock will be allowed even if NITZ_UPDATE_SPACING has not been
7253 * exceeded.
7254 * @hide
7255 */
7256 public static final String NITZ_UPDATE_DIFF = "nitz_update_diff";
7257
7258 /**
7259 * The length of time in milli-seconds that automatic small adjustments to
7260 * SystemClock are ignored if NITZ_UPDATE_DIFF is not exceeded.
7261 * @hide
7262 */
7263 public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing";
7264
7265 /** Preferred NTP server. {@hide} */
7266 public static final String NTP_SERVER = "ntp_server";
7267 /** Timeout in milliseconds to wait for NTP server. {@hide} */
7268 public static final String NTP_TIMEOUT = "ntp_timeout";
7269
Jeff Sharkeye8a4b662015-06-27 15:43:45 -07007270 /** {@hide} */
7271 public static final String STORAGE_BENCHMARK_INTERVAL = "storage_benchmark_interval";
7272
Christopher Tate06efb532012-08-24 15:29:27 -07007273 /**
Pierre Imai8e48e672016-04-21 13:30:43 +09007274 * Sample validity in seconds to configure for the system DNS resolver.
7275 * {@hide}
7276 */
7277 public static final String DNS_RESOLVER_SAMPLE_VALIDITY_SECONDS =
7278 "dns_resolver_sample_validity_seconds";
7279
7280 /**
7281 * Success threshold in percent for use with the system DNS resolver.
7282 * {@hide}
7283 */
7284 public static final String DNS_RESOLVER_SUCCESS_THRESHOLD_PERCENT =
7285 "dns_resolver_success_threshold_percent";
7286
7287 /**
7288 * Minimum number of samples needed for statistics to be considered meaningful in the
7289 * system DNS resolver.
7290 * {@hide}
7291 */
7292 public static final String DNS_RESOLVER_MIN_SAMPLES = "dns_resolver_min_samples";
7293
7294 /**
7295 * Maximum number taken into account for statistics purposes in the system DNS resolver.
7296 * {@hide}
7297 */
7298 public static final String DNS_RESOLVER_MAX_SAMPLES = "dns_resolver_max_samples";
7299
7300 /**
Tao Baofdf7c5d2016-02-15 20:59:15 -08007301 * Whether to disable the automatic scheduling of system updates.
7302 * 1 = system updates won't be automatically scheduled (will always
7303 * present notification instead).
7304 * 0 = system updates will be automatically scheduled. (default)
7305 * @hide
7306 */
7307 @SystemApi
7308 public static final String OTA_DISABLE_AUTOMATIC_UPDATE = "ota_disable_automatic_update";
7309
7310 /**
rich cannings4d8fc792012-09-07 14:43:43 -07007311 * Whether the package manager should send package verification broadcasts for verifiers to
7312 * review apps prior to installation.
7313 * 1 = request apps to be verified prior to installation, if a verifier exists.
7314 * 0 = do not verify apps before installation
rich cannings4e5753f2012-09-19 16:03:56 -07007315 * @hide
rich cannings4d8fc792012-09-07 14:43:43 -07007316 */
7317 public static final String PACKAGE_VERIFIER_ENABLE = "package_verifier_enable";
7318
7319 /** Timeout for package verification.
rich cannings4e5753f2012-09-19 16:03:56 -07007320 * @hide */
rich cannings4d8fc792012-09-07 14:43:43 -07007321 public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout";
7322
7323 /** Default response code for package verification.
rich cannings4e5753f2012-09-19 16:03:56 -07007324 * @hide */
rich cannings4d8fc792012-09-07 14:43:43 -07007325 public static final String PACKAGE_VERIFIER_DEFAULT_RESPONSE = "verifier_default_response";
7326
rich cannings4e5753f2012-09-19 16:03:56 -07007327 /**
7328 * Show package verification setting in the Settings app.
rich canningse6686b32012-09-16 14:02:20 -07007329 * 1 = show (default)
7330 * 0 = hide
rich cannings4e5753f2012-09-19 16:03:56 -07007331 * @hide
rich canningse6686b32012-09-16 14:02:20 -07007332 */
7333 public static final String PACKAGE_VERIFIER_SETTING_VISIBLE = "verifier_setting_visible";
7334
rich cannings4d8fc792012-09-07 14:43:43 -07007335 /**
Fabrice Di Meglio1c1b4712014-11-19 17:12:32 -08007336 * Run package verification on apps installed through ADB/ADT/USB
rich cannings4e5753f2012-09-19 16:03:56 -07007337 * 1 = perform package verification on ADB installs (default)
7338 * 0 = bypass package verification on ADB installs
7339 * @hide
7340 */
7341 public static final String PACKAGE_VERIFIER_INCLUDE_ADB = "verifier_verify_adb_installs";
7342
7343 /**
Christopher Tate7265abe2014-11-21 13:54:45 -08007344 * Time since last fstrim (milliseconds) after which we force one to happen
7345 * during device startup. If unset, the default is 3 days.
7346 * @hide
7347 */
7348 public static final String FSTRIM_MANDATORY_INTERVAL = "fstrim_mandatory_interval";
7349
7350 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007351 * The interval in milliseconds at which to check packet counts on the
7352 * mobile data interface when screen is on, to detect possible data
7353 * connection problems.
7354 * @hide
7355 */
7356 public static final String PDP_WATCHDOG_POLL_INTERVAL_MS =
7357 "pdp_watchdog_poll_interval_ms";
7358
7359 /**
7360 * The interval in milliseconds at which to check packet counts on the
7361 * mobile data interface when screen is off, to detect possible data
7362 * connection problems.
7363 * @hide
7364 */
7365 public static final String PDP_WATCHDOG_LONG_POLL_INTERVAL_MS =
7366 "pdp_watchdog_long_poll_interval_ms";
7367
7368 /**
7369 * The interval in milliseconds at which to check packet counts on the
7370 * mobile data interface after {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT}
7371 * outgoing packets has been reached without incoming packets.
7372 * @hide
7373 */
7374 public static final String PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS =
7375 "pdp_watchdog_error_poll_interval_ms";
7376
7377 /**
7378 * The number of outgoing packets sent without seeing an incoming packet
7379 * that triggers a countdown (of {@link #PDP_WATCHDOG_ERROR_POLL_COUNT}
7380 * device is logged to the event log
7381 * @hide
7382 */
7383 public static final String PDP_WATCHDOG_TRIGGER_PACKET_COUNT =
7384 "pdp_watchdog_trigger_packet_count";
7385
7386 /**
7387 * The number of polls to perform (at {@link #PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS})
7388 * after hitting {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} before
7389 * attempting data connection recovery.
7390 * @hide
7391 */
7392 public static final String PDP_WATCHDOG_ERROR_POLL_COUNT =
7393 "pdp_watchdog_error_poll_count";
7394
7395 /**
7396 * The number of failed PDP reset attempts before moving to something more
7397 * drastic: re-registering to the network.
7398 * @hide
7399 */
7400 public static final String PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT =
7401 "pdp_watchdog_max_pdp_reset_fail_count";
7402
7403 /**
7404 * A positive value indicates how often the SamplingProfiler
7405 * should take snapshots. Zero value means SamplingProfiler
7406 * is disabled.
7407 *
7408 * @hide
7409 */
7410 public static final String SAMPLING_PROFILER_MS = "sampling_profiler_ms";
7411
7412 /**
7413 * URL to open browser on to allow user to manage a prepay account
7414 * @hide
7415 */
7416 public static final String SETUP_PREPAID_DATA_SERVICE_URL =
7417 "setup_prepaid_data_service_url";
7418
7419 /**
7420 * URL to attempt a GET on to see if this is a prepay device
7421 * @hide
7422 */
7423 public static final String SETUP_PREPAID_DETECTION_TARGET_URL =
7424 "setup_prepaid_detection_target_url";
7425
7426 /**
7427 * Host to check for a redirect to after an attempt to GET
7428 * SETUP_PREPAID_DETECTION_TARGET_URL. (If we redirected there,
7429 * this is a prepaid device with zero balance.)
7430 * @hide
7431 */
7432 public static final String SETUP_PREPAID_DETECTION_REDIR_HOST =
7433 "setup_prepaid_detection_redir_host";
7434
7435 /**
Jake Hamby76a61422012-09-06 17:40:21 -07007436 * The interval in milliseconds at which to check the number of SMS sent out without asking
7437 * for use permit, to limit the un-authorized SMS usage.
7438 *
7439 * @hide
7440 */
7441 public static final String SMS_OUTGOING_CHECK_INTERVAL_MS =
7442 "sms_outgoing_check_interval_ms";
7443
7444 /**
7445 * The number of outgoing SMS sent without asking for user permit (of {@link
7446 * #SMS_OUTGOING_CHECK_INTERVAL_MS}
7447 *
7448 * @hide
7449 */
7450 public static final String SMS_OUTGOING_CHECK_MAX_COUNT =
7451 "sms_outgoing_check_max_count";
7452
7453 /**
7454 * Used to disable SMS short code confirmation - defaults to true.
Robert Greenwalt026efcc2012-09-24 10:03:21 -07007455 * True indcates we will do the check, etc. Set to false to disable.
Jake Hamby76a61422012-09-06 17:40:21 -07007456 * @see com.android.internal.telephony.SmsUsageMonitor
7457 * @hide
7458 */
7459 public static final String SMS_SHORT_CODE_CONFIRMATION = "sms_short_code_confirmation";
7460
Robert Greenwalt026efcc2012-09-24 10:03:21 -07007461 /**
7462 * Used to select which country we use to determine premium sms codes.
7463 * One of com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_SIM,
7464 * com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_NETWORK,
7465 * or com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_BOTH.
7466 * @hide
7467 */
7468 public static final String SMS_SHORT_CODE_RULE = "sms_short_code_rule";
7469
Jake Hamby76a61422012-09-06 17:40:21 -07007470 /**
JP Abgrall32d1ac4d2014-02-21 12:05:20 -08007471 * Used to select TCP's default initial receiver window size in segments - defaults to a build config value
7472 * @hide
7473 */
7474 public static final String TCP_DEFAULT_INIT_RWND = "tcp_default_init_rwnd";
7475
7476 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007477 * Used to disable Tethering on a device - defaults to true
7478 * @hide
7479 */
7480 public static final String TETHER_SUPPORTED = "tether_supported";
7481
7482 /**
7483 * Used to require DUN APN on the device or not - defaults to a build config value
7484 * which defaults to false
7485 * @hide
7486 */
7487 public static final String TETHER_DUN_REQUIRED = "tether_dun_required";
7488
7489 /**
7490 * Used to hold a gservices-provisioned apn value for DUN. If set, or the
7491 * corresponding build config values are set it will override the APN DB
7492 * values.
7493 * Consists of a comma seperated list of strings:
7494 * "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type"
7495 * note that empty fields can be ommitted: "name,apn,,,,,,,,,310,260,,DUN"
7496 * @hide
7497 */
7498 public static final String TETHER_DUN_APN = "tether_dun_apn";
7499
7500 /**
Junda Liu0c35fbc2016-01-19 23:20:15 -08007501 * List of carrier apps which are whitelisted to prompt the user for install when
7502 * a sim card with matching uicc carrier privilege rules is inserted.
7503 *
7504 * The value is "package1;package2;..."
7505 * @hide
7506 */
7507 public static final String CARRIER_APP_WHITELIST = "carrier_app_whitelist";
7508
7509 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007510 * USB Mass Storage Enabled
7511 */
7512 public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled";
7513
7514 /**
7515 * If this setting is set (to anything), then all references
7516 * to Gmail on the device must change to Google Mail.
7517 */
7518 public static final String USE_GOOGLE_MAIL = "use_google_mail";
7519
Hui Shu22671772014-10-01 21:41:07 +00007520 /**
7521 * Webview Data reduction proxy key.
7522 * @hide
7523 */
7524 public static final String WEBVIEW_DATA_REDUCTION_PROXY_KEY =
7525 "webview_data_reduction_proxy_key";
7526
Lorenzo Colitti84e6f1232016-08-29 14:03:11 +09007527 /**
7528 * Whether or not the WebView fallback mechanism should be enabled.
7529 * 0=disabled, 1=enabled.
7530 * @hide
7531 */
7532 public static final String WEBVIEW_FALLBACK_LOGIC_ENABLED =
7533 "webview_fallback_logic_enabled";
Gustav Senntonc83e3fa2016-02-18 12:19:13 +00007534
Lorenzo Colitti84e6f1232016-08-29 14:03:11 +09007535 /**
7536 * Name of the package used as WebView provider (if unset the provider is instead determined
7537 * by the system).
7538 * @hide
7539 */
7540 public static final String WEBVIEW_PROVIDER = "webview_provider";
Gustav Sennton14c033c2016-02-11 12:51:27 +00007541
Lorenzo Colitti84e6f1232016-08-29 14:03:11 +09007542 /**
7543 * Developer setting to enable WebView multiprocess rendering.
7544 * @hide
7545 */
7546 @SystemApi
7547 public static final String WEBVIEW_MULTIPROCESS = "webview_multiprocess";
7548
7549 /**
7550 * The maximum number of notifications shown in 24 hours when switching networks.
7551 * @hide
7552 */
7553 public static final String NETWORK_SWITCH_NOTIFICATION_DAILY_LIMIT =
7554 "network_switch_notification_daily_limit";
7555
7556 /**
7557 * The minimum time in milliseconds between notifications when switching networks.
7558 * @hide
7559 */
7560 public static final String NETWORK_SWITCH_NOTIFICATION_RATE_LIMIT_MILLIS =
7561 "network_switch_notification_rate_limit_millis";
Tobias Sargeantda857102016-02-11 14:52:28 +00007562
Christopher Tate06efb532012-08-24 15:29:27 -07007563 /**
Hugo Benichic8e9e122016-09-14 23:23:08 +00007564 * Whether to automatically switch away from wifi networks that lose Internet access.
Lorenzo Colitti165c51c2016-09-19 01:00:19 +09007565 * Only meaningful if config_networkAvoidBadWifi is set to 0, otherwise the system always
7566 * avoids such networks. Valid values are:
7567 *
7568 * 0: Don't avoid bad wifi, don't prompt the user. Get stuck on bad wifi like it's 2013.
7569 * null: Ask the user whether to switch away from bad wifi.
7570 * 1: Avoid bad wifi.
7571 *
Hugo Benichic8e9e122016-09-14 23:23:08 +00007572 * @hide
7573 */
7574 public static final String NETWORK_AVOID_BAD_WIFI = "network_avoid_bad_wifi";
7575
7576 /**
Jeff Brown89d55462012-09-19 11:33:42 -07007577 * Whether Wifi display is enabled/disabled
7578 * 0=disabled. 1=enabled.
7579 * @hide
7580 */
7581 public static final String WIFI_DISPLAY_ON = "wifi_display_on";
7582
7583 /**
Chong Zhang1f3ecaa2013-05-03 15:55:36 -07007584 * Whether Wifi display certification mode is enabled/disabled
7585 * 0=disabled. 1=enabled.
7586 * @hide
7587 */
7588 public static final String WIFI_DISPLAY_CERTIFICATION_ON =
7589 "wifi_display_certification_on";
7590
7591 /**
Chong Zhange38af812013-08-29 17:25:17 -07007592 * WPS Configuration method used by Wifi display, this setting only
7593 * takes effect when WIFI_DISPLAY_CERTIFICATION_ON is 1 (enabled).
7594 *
7595 * Possible values are:
7596 *
7597 * WpsInfo.INVALID: use default WPS method chosen by framework
7598 * WpsInfo.PBC : use Push button
7599 * WpsInfo.KEYPAD : use Keypad
7600 * WpsInfo.DISPLAY: use Display
7601 * @hide
7602 */
7603 public static final String WIFI_DISPLAY_WPS_CONFIG =
7604 "wifi_display_wps_config";
7605
7606 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007607 * Whether to notify the user of open networks.
7608 * <p>
7609 * If not connected and the scan results have an open network, we will
7610 * put this notification up. If we attempt to connect to a network or
7611 * the open network(s) disappear, we remove the notification. When we
7612 * show the notification, we will not show it again for
7613 * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time.
7614 */
7615 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
7616 "wifi_networks_available_notification_on";
7617 /**
7618 * {@hide}
7619 */
7620 public static final String WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON =
7621 "wimax_networks_available_notification_on";
7622
7623 /**
pkanwar57f38372016-12-22 11:12:02 -08007624 * Whether we support connecting to Carrier Networks.
7625 * @hide
7626 **/
7627 public static final String WIFI_CONNECT_CARRIER_NETWORKS =
7628 "wifi_connect_carrier_networks";
7629
7630 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007631 * Delay (in seconds) before repeating the Wi-Fi networks available notification.
7632 * Connecting to a network will reset the timer.
7633 */
7634 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
7635 "wifi_networks_available_repeat_delay";
7636
7637 /**
Robert Greenwalt3ea0c992013-10-03 21:13:49 +00007638 * 802.11 country code in ISO 3166 format
7639 * @hide
7640 */
7641 public static final String WIFI_COUNTRY_CODE = "wifi_country_code";
7642
7643 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007644 * The interval in milliseconds to issue wake up scans when wifi needs
7645 * to connect. This is necessary to connect to an access point when
7646 * device is on the move and the screen is off.
7647 * @hide
7648 */
7649 public static final String WIFI_FRAMEWORK_SCAN_INTERVAL_MS =
7650 "wifi_framework_scan_interval_ms";
7651
7652 /**
7653 * The interval in milliseconds after which Wi-Fi is considered idle.
7654 * When idle, it is possible for the device to be switched from Wi-Fi to
7655 * the mobile data network.
7656 * @hide
7657 */
7658 public static final String WIFI_IDLE_MS = "wifi_idle_ms";
7659
7660 /**
7661 * When the number of open networks exceeds this number, the
7662 * least-recently-used excess networks will be removed.
7663 */
7664 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept";
7665
7666 /**
7667 * Whether the Wi-Fi should be on. Only the Wi-Fi service should touch this.
7668 */
7669 public static final String WIFI_ON = "wifi_on";
7670
7671 /**
Irfan Sheriff11aefad2013-03-06 07:57:41 -08007672 * Setting to allow scans to be enabled even wifi is turned off for connectivity.
7673 * @hide
7674 */
7675 public static final String WIFI_SCAN_ALWAYS_AVAILABLE =
7676 "wifi_scan_always_enabled";
7677
Stephen Chen8ca96c12016-11-16 15:46:51 -08007678 /**
7679 * Value to specify if Wi-Fi Wakeup feature is enabled.
Stephen Chenf1b75642016-12-06 16:08:52 -08007680 *
7681 * Type: int (0 for false, 1 for true)
Stephen Chen8ca96c12016-11-16 15:46:51 -08007682 * @hide
7683 */
7684 @SystemApi
7685 public static final String WIFI_WAKEUP_ENABLED = "wifi_wakeup_enabled";
7686
Stephen Chen6a0c8792016-11-16 15:46:51 -08007687 /**
7688 * Value to specify if network recommendations from
7689 * {@link com.android.server.NetworkScoreService} are enabled.
Stephen Chenf1b75642016-12-06 16:08:52 -08007690 *
7691 * Type: int (0 for false, 1 for true)
Stephen Chen6a0c8792016-11-16 15:46:51 -08007692 * @hide
7693 */
7694 @SystemApi
7695 public static final String NETWORK_RECOMMENDATIONS_ENABLED =
7696 "network_recommendations_enabled";
7697
Irfan Sheriff11aefad2013-03-06 07:57:41 -08007698 /**
Wei Wangd91f1932015-03-19 15:09:56 -07007699 * Settings to allow BLE scans to be enabled even when Bluetooth is turned off for
7700 * connectivity.
7701 * @hide
7702 */
7703 public static final String BLE_SCAN_ALWAYS_AVAILABLE =
7704 "ble_scan_always_enabled";
7705
7706 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007707 * Used to save the Wifi_ON state prior to tethering.
7708 * This state will be checked to restore Wifi after
7709 * the user turns off tethering.
7710 *
7711 * @hide
7712 */
7713 public static final String WIFI_SAVED_STATE = "wifi_saved_state";
7714
7715 /**
7716 * The interval in milliseconds to scan as used by the wifi supplicant
7717 * @hide
7718 */
7719 public static final String WIFI_SUPPLICANT_SCAN_INTERVAL_MS =
7720 "wifi_supplicant_scan_interval_ms";
7721
vandwalle7c3606c2014-03-31 19:12:07 -07007722 /**
7723 * whether frameworks handles wifi auto-join
7724 * @hide
7725 */
7726 public static final String WIFI_ENHANCED_AUTO_JOIN =
7727 "wifi_enhanced_auto_join";
7728
7729 /**
7730 * whether settings show RSSI
7731 * @hide
7732 */
7733 public static final String WIFI_NETWORK_SHOW_RSSI =
7734 "wifi_network_show_rssi";
7735
7736 /**
Irfan Sheriff3809f502012-09-17 16:04:57 -07007737 * The interval in milliseconds to scan at supplicant when p2p is connected
7738 * @hide
7739 */
7740 public static final String WIFI_SCAN_INTERVAL_WHEN_P2P_CONNECTED_MS =
7741 "wifi_scan_interval_p2p_connected_ms";
7742
7743 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007744 * Whether the Wi-Fi watchdog is enabled.
7745 */
7746 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
7747
7748 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007749 * Setting to turn off poor network avoidance on Wi-Fi. Feature is enabled by default and
7750 * the setting needs to be set to 0 to disable it.
7751 * @hide
7752 */
7753 public static final String WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED =
7754 "wifi_watchdog_poor_network_test_enabled";
7755
7756 /**
7757 * Setting to turn on suspend optimizations at screen off on Wi-Fi. Enabled by default and
7758 * needs to be set to 0 to disable it.
7759 * @hide
7760 */
7761 public static final String WIFI_SUSPEND_OPTIMIZATIONS_ENABLED =
7762 "wifi_suspend_optimizations_enabled";
7763
7764 /**
Nathan Harold29589fc2016-03-30 21:53:48 -07007765 * Setting to enable verbose logging in Wi-Fi; disabled by default, and setting to 1
7766 * will enable it. In the future, additional values may be supported.
7767 * @hide
7768 */
7769 public static final String WIFI_VERBOSE_LOGGING_ENABLED =
7770 "wifi_verbose_logging_enabled";
7771
7772 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007773 * The maximum number of times we will retry a connection to an access
7774 * point for which we have failed in acquiring an IP address from DHCP.
7775 * A value of N means that we will make N+1 connection attempts in all.
7776 */
7777 public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count";
7778
7779 /**
7780 * Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile
7781 * data connectivity to be established after a disconnect from Wi-Fi.
7782 */
7783 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
7784 "wifi_mobile_data_transition_wakelock_timeout_ms";
7785
7786 /**
Zoltan Szatmary-Ban4045d242015-05-27 12:42:39 +01007787 * This setting controls whether WiFi configurations created by a Device Owner app
7788 * should be locked down (that is, be editable or removable only by the Device Owner App,
7789 * not even by Settings app).
7790 * This setting takes integer values. Non-zero values mean DO created configurations
7791 * are locked down. Value of zero means they are not. Default value in the absence of
7792 * actual value to this setting is 0.
7793 */
7794 public static final String WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN =
7795 "wifi_device_owner_configs_lockdown";
7796
7797 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007798 * The operational wifi frequency band
7799 * Set to one of {@link WifiManager#WIFI_FREQUENCY_BAND_AUTO},
7800 * {@link WifiManager#WIFI_FREQUENCY_BAND_5GHZ} or
7801 * {@link WifiManager#WIFI_FREQUENCY_BAND_2GHZ}
7802 *
7803 * @hide
7804 */
7805 public static final String WIFI_FREQUENCY_BAND = "wifi_frequency_band";
7806
7807 /**
7808 * The Wi-Fi peer-to-peer device name
7809 * @hide
7810 */
7811 public static final String WIFI_P2P_DEVICE_NAME = "wifi_p2p_device_name";
7812
7813 /**
Robert Greenwaltc12783a2013-05-16 12:48:20 -07007814 * The min time between wifi disable and wifi enable
7815 * @hide
7816 */
7817 public static final String WIFI_REENABLE_DELAY_MS = "wifi_reenable_delay";
7818
7819 /**
Jeff Davidsona20ca67d2014-12-16 11:48:54 -08007820 * Timeout for ephemeral networks when all known BSSIDs go out of range. We will disconnect
7821 * from an ephemeral network if there is no BSSID for that network with a non-null score that
7822 * has been seen in this time period.
7823 *
7824 * If this is less than or equal to zero, we use a more conservative behavior and only check
7825 * for a non-null score from the currently connected or target BSSID.
7826 * @hide
7827 */
7828 public static final String WIFI_EPHEMERAL_OUT_OF_RANGE_TIMEOUT_MS =
7829 "wifi_ephemeral_out_of_range_timeout_ms";
7830
7831 /**
Christopher Tatec868b642012-09-12 17:41:04 -07007832 * The number of milliseconds to delay when checking for data stalls during
7833 * non-aggressive detection. (screen is turned off.)
7834 * @hide
7835 */
7836 public static final String DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS =
7837 "data_stall_alarm_non_aggressive_delay_in_ms";
7838
7839 /**
7840 * The number of milliseconds to delay when checking for data stalls during
7841 * aggressive detection. (screen on or suspected data stall)
7842 * @hide
7843 */
7844 public static final String DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS =
7845 "data_stall_alarm_aggressive_delay_in_ms";
7846
7847 /**
Wink Savillece1e3792013-09-03 16:41:44 -07007848 * The number of milliseconds to allow the provisioning apn to remain active
7849 * @hide
7850 */
7851 public static final String PROVISIONING_APN_ALARM_DELAY_IN_MS =
7852 "provisioning_apn_alarm_delay_in_ms";
7853
7854 /**
Christopher Tatec868b642012-09-12 17:41:04 -07007855 * The interval in milliseconds at which to check gprs registration
7856 * after the first registration mismatch of gprs and voice service,
7857 * to detect possible data network registration problems.
7858 *
7859 * @hide
7860 */
7861 public static final String GPRS_REGISTER_CHECK_PERIOD_MS =
7862 "gprs_register_check_period_ms";
7863
7864 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007865 * Nonzero causes Log.wtf() to crash.
7866 * @hide
7867 */
7868 public static final String WTF_IS_FATAL = "wtf_is_fatal";
7869
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07007870 /**
7871 * Ringer mode. This is used internally, changing this value will not
7872 * change the ringer mode. See AudioManager.
7873 */
7874 public static final String MODE_RINGER = "mode_ringer";
Christopher Tate06efb532012-08-24 15:29:27 -07007875
Jeff Brownd4935962012-09-25 13:27:20 -07007876 /**
7877 * Overlay display devices setting.
7878 * The associated value is a specially formatted string that describes the
7879 * size and density of simulated secondary display devices.
7880 * <p>
7881 * Format: {width}x{height}/{dpi};...
7882 * </p><p>
7883 * Example:
7884 * <ul>
7885 * <li><code>1280x720/213</code>: make one overlay that is 1280x720 at 213dpi.</li>
7886 * <li><code>1920x1080/320;1280x720/213</code>: make two overlays, the first
7887 * at 1080p and the second at 720p.</li>
7888 * <li>If the value is empty, then no overlay display devices are created.</li>
7889 * </ul></p>
7890 *
7891 * @hide
7892 */
7893 public static final String OVERLAY_DISPLAY_DEVICES = "overlay_display_devices";
Christopher Tate06efb532012-08-24 15:29:27 -07007894
Jeff Sharkey625239a2012-09-26 22:03:49 -07007895 /**
7896 * Threshold values for the duration and level of a discharge cycle,
7897 * under which we log discharge cycle info.
7898 *
7899 * @hide
7900 */
7901 public static final String
7902 BATTERY_DISCHARGE_DURATION_THRESHOLD = "battery_discharge_duration_threshold";
7903
7904 /** @hide */
7905 public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold";
7906
7907 /**
7908 * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR
7909 * intents on application crashes and ANRs. If this is disabled, the
7910 * crash/ANR dialog will never display the "Report" button.
7911 * <p>
7912 * Type: int (0 = disallow, 1 = allow)
7913 *
7914 * @hide
7915 */
7916 public static final String SEND_ACTION_APP_ERROR = "send_action_app_error";
7917
7918 /**
7919 * Maximum age of entries kept by {@link DropBoxManager}.
7920 *
7921 * @hide
7922 */
7923 public static final String DROPBOX_AGE_SECONDS = "dropbox_age_seconds";
7924
7925 /**
7926 * Maximum number of entry files which {@link DropBoxManager} will keep
7927 * around.
7928 *
7929 * @hide
7930 */
7931 public static final String DROPBOX_MAX_FILES = "dropbox_max_files";
7932
7933 /**
7934 * Maximum amount of disk space used by {@link DropBoxManager} no matter
7935 * what.
7936 *
7937 * @hide
7938 */
7939 public static final String DROPBOX_QUOTA_KB = "dropbox_quota_kb";
7940
7941 /**
7942 * Percent of free disk (excluding reserve) which {@link DropBoxManager}
7943 * will use.
7944 *
7945 * @hide
7946 */
7947 public static final String DROPBOX_QUOTA_PERCENT = "dropbox_quota_percent";
7948
7949 /**
7950 * Percent of total disk which {@link DropBoxManager} will never dip
7951 * into.
7952 *
7953 * @hide
7954 */
7955 public static final String DROPBOX_RESERVE_PERCENT = "dropbox_reserve_percent";
7956
7957 /**
7958 * Prefix for per-tag dropbox disable/enable settings.
7959 *
7960 * @hide
7961 */
7962 public static final String DROPBOX_TAG_PREFIX = "dropbox:";
7963
7964 /**
7965 * Lines of logcat to include with system crash/ANR/etc. reports, as a
7966 * prefix of the dropbox tag of the report type. For example,
7967 * "logcat_for_system_server_anr" controls the lines of logcat captured
7968 * with system server ANR reports. 0 to disable.
7969 *
7970 * @hide
7971 */
7972 public static final String ERROR_LOGCAT_PREFIX = "logcat_for_";
7973
7974 /**
7975 * The interval in minutes after which the amount of free storage left
7976 * on the device is logged to the event log
7977 *
7978 * @hide
7979 */
7980 public static final String SYS_FREE_STORAGE_LOG_INTERVAL = "sys_free_storage_log_interval";
7981
7982 /**
7983 * Threshold for the amount of change in disk free space required to
7984 * report the amount of free space. Used to prevent spamming the logs
7985 * when the disk free space isn't changing frequently.
7986 *
7987 * @hide
7988 */
7989 public static final String
7990 DISK_FREE_CHANGE_REPORTING_THRESHOLD = "disk_free_change_reporting_threshold";
7991
7992 /**
7993 * Minimum percentage of free storage on the device that is used to
7994 * determine if the device is running low on storage. The default is 10.
7995 * <p>
7996 * Say this value is set to 10, the device is considered running low on
7997 * storage if 90% or more of the device storage is filled up.
7998 *
7999 * @hide
8000 */
8001 public static final String
8002 SYS_STORAGE_THRESHOLD_PERCENTAGE = "sys_storage_threshold_percentage";
8003
8004 /**
8005 * Maximum byte size of the low storage threshold. This is to ensure
8006 * that {@link #SYS_STORAGE_THRESHOLD_PERCENTAGE} does not result in an
8007 * overly large threshold for large storage devices. Currently this must
8008 * be less than 2GB. This default is 500MB.
8009 *
8010 * @hide
8011 */
8012 public static final String
8013 SYS_STORAGE_THRESHOLD_MAX_BYTES = "sys_storage_threshold_max_bytes";
8014
8015 /**
8016 * Minimum bytes of free storage on the device before the data partition
8017 * is considered full. By default, 1 MB is reserved to avoid system-wide
8018 * SQLite disk full exceptions.
8019 *
8020 * @hide
8021 */
8022 public static final String
8023 SYS_STORAGE_FULL_THRESHOLD_BYTES = "sys_storage_full_threshold_bytes";
8024
8025 /**
8026 * The maximum reconnect delay for short network outages or when the
8027 * network is suspended due to phone use.
8028 *
8029 * @hide
8030 */
8031 public static final String
8032 SYNC_MAX_RETRY_DELAY_IN_SECONDS = "sync_max_retry_delay_in_seconds";
8033
8034 /**
8035 * The number of milliseconds to delay before sending out
Erik Kline8f29dcf2014-12-08 16:25:20 +09008036 * {@link ConnectivityManager#CONNECTIVITY_ACTION} broadcasts. Ignored.
Jeff Sharkey625239a2012-09-26 22:03:49 -07008037 *
8038 * @hide
8039 */
8040 public static final String CONNECTIVITY_CHANGE_DELAY = "connectivity_change_delay";
8041
Vinit Deshapnde1f12cb52013-08-21 13:09:01 -07008042
8043 /**
8044 * Network sampling interval, in seconds. We'll generate link information
8045 * about bytes/packets sent and error rates based on data sampled in this interval
8046 *
8047 * @hide
8048 */
8049
8050 public static final String CONNECTIVITY_SAMPLING_INTERVAL_IN_SECONDS =
8051 "connectivity_sampling_interval_in_seconds";
8052
Jeff Sharkey625239a2012-09-26 22:03:49 -07008053 /**
Jason Monk602b2322013-07-03 17:04:33 -04008054 * The series of successively longer delays used in retrying to download PAC file.
8055 * Last delay is used between successful PAC downloads.
8056 *
8057 * @hide
8058 */
8059 public static final String PAC_CHANGE_DELAY = "pac_change_delay";
8060
8061 /**
Calvin On4bc78eb2016-10-11 15:10:46 -07008062 * Don't attempt to detect captive portals.
Jeff Sharkey625239a2012-09-26 22:03:49 -07008063 *
8064 * @hide
8065 */
Calvin On4bc78eb2016-10-11 15:10:46 -07008066 public static final int CAPTIVE_PORTAL_MODE_IGNORE = 0;
8067
8068 /**
8069 * When detecting a captive portal, display a notification that
8070 * prompts the user to sign in.
8071 *
8072 * @hide
8073 */
8074 public static final int CAPTIVE_PORTAL_MODE_PROMPT = 1;
8075
8076 /**
8077 * When detecting a captive portal, immediately disconnect from the
8078 * network and do not reconnect to that network in the future.
8079 *
8080 * @hide
8081 */
8082 public static final int CAPTIVE_PORTAL_MODE_AVOID = 2;
8083
8084 /**
8085 * What to do when connecting a network that presents a captive portal.
8086 * Must be one of the CAPTIVE_PORTAL_MODE_* constants above.
8087 *
8088 * The default for this setting is CAPTIVE_PORTAL_MODE_PROMPT.
8089 * @hide
8090 */
8091 public static final String CAPTIVE_PORTAL_MODE = "captive_portal_mode";
8092
8093 /**
8094 * Setting to turn off captive portal detection. Feature is enabled by
8095 * default and the setting needs to be set to 0 to disable it.
8096 *
8097 * @deprecated use CAPTIVE_PORTAL_MODE_IGNORE to disable captive portal detection
8098 * @hide
8099 */
8100 @Deprecated
Jeff Sharkey625239a2012-09-26 22:03:49 -07008101 public static final String
8102 CAPTIVE_PORTAL_DETECTION_ENABLED = "captive_portal_detection_enabled";
8103
8104 /**
8105 * The server used for captive portal detection upon a new conection. A
8106 * 204 response code from the server is used for validation.
Hugo Benichi92eb22fd2016-09-27 13:01:41 +09008107 * TODO: remove this deprecated symbol.
Jeff Sharkey625239a2012-09-26 22:03:49 -07008108 *
8109 * @hide
8110 */
8111 public static final String CAPTIVE_PORTAL_SERVER = "captive_portal_server";
8112
8113 /**
Hugo Benichi92eb22fd2016-09-27 13:01:41 +09008114 * The URL used for HTTPS captive portal detection upon a new connection.
8115 * A 204 response code from the server is used for validation.
8116 *
8117 * @hide
8118 */
8119 public static final String CAPTIVE_PORTAL_HTTPS_URL = "captive_portal_https_url";
8120
8121 /**
8122 * The URL used for HTTP captive portal detection upon a new connection.
8123 * A 204 response code from the server is used for validation.
8124 *
8125 * @hide
8126 */
8127 public static final String CAPTIVE_PORTAL_HTTP_URL = "captive_portal_http_url";
8128
8129 /**
8130 * The URL used for fallback HTTP captive portal detection when previous HTTP
8131 * and HTTPS captive portal detection attemps did not return a conclusive answer.
8132 *
8133 * @hide
8134 */
8135 public static final String CAPTIVE_PORTAL_FALLBACK_URL = "captive_portal_fallback_url";
8136
8137 /**
Lorenzo Colittic5be12e2016-04-19 21:57:31 +09008138 * Whether to use HTTPS for network validation. This is enabled by default and the setting
8139 * needs to be set to 0 to disable it. This setting is a misnomer because captive portals
8140 * don't actually use HTTPS, but it's consistent with the other settings.
8141 *
8142 * @hide
8143 */
8144 public static final String CAPTIVE_PORTAL_USE_HTTPS = "captive_portal_use_https";
8145
8146 /**
Hugo Benichi92eb22fd2016-09-27 13:01:41 +09008147 * Which User-Agent string to use in the header of the captive portal detection probes.
8148 * The User-Agent field is unset when this setting has no value (HttpUrlConnection default).
8149 *
8150 * @hide
8151 */
8152 public static final String CAPTIVE_PORTAL_USER_AGENT = "captive_portal_user_agent";
8153
8154 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07008155 * Whether network service discovery is enabled.
8156 *
8157 * @hide
8158 */
8159 public static final String NSD_ON = "nsd_on";
8160
8161 /**
8162 * Let user pick default install location.
8163 *
8164 * @hide
8165 */
8166 public static final String SET_INSTALL_LOCATION = "set_install_location";
8167
8168 /**
8169 * Default install location value.
8170 * 0 = auto, let system decide
8171 * 1 = internal
8172 * 2 = sdcard
8173 * @hide
8174 */
8175 public static final String DEFAULT_INSTALL_LOCATION = "default_install_location";
8176
8177 /**
8178 * ms during which to consume extra events related to Inet connection
8179 * condition after a transtion to fully-connected
8180 *
8181 * @hide
8182 */
8183 public static final String
8184 INET_CONDITION_DEBOUNCE_UP_DELAY = "inet_condition_debounce_up_delay";
8185
8186 /**
8187 * ms during which to consume extra events related to Inet connection
8188 * condtion after a transtion to partly-connected
8189 *
8190 * @hide
8191 */
8192 public static final String
8193 INET_CONDITION_DEBOUNCE_DOWN_DELAY = "inet_condition_debounce_down_delay";
8194
8195 /** {@hide} */
8196 public static final String
8197 READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT = "read_external_storage_enforced_default";
8198
8199 /**
8200 * Host name and port for global http proxy. Uses ':' seperator for
8201 * between host and port.
8202 */
8203 public static final String HTTP_PROXY = "http_proxy";
8204
8205 /**
8206 * Host name for global http proxy. Set via ConnectivityManager.
8207 *
8208 * @hide
8209 */
8210 public static final String GLOBAL_HTTP_PROXY_HOST = "global_http_proxy_host";
8211
8212 /**
8213 * Integer host port for global http proxy. Set via ConnectivityManager.
8214 *
8215 * @hide
8216 */
8217 public static final String GLOBAL_HTTP_PROXY_PORT = "global_http_proxy_port";
8218
8219 /**
8220 * Exclusion list for global proxy. This string contains a list of
8221 * comma-separated domains where the global proxy does not apply.
8222 * Domains should be listed in a comma- separated list. Example of
8223 * acceptable formats: ".domain1.com,my.domain2.com" Use
8224 * ConnectivityManager to set/get.
8225 *
8226 * @hide
8227 */
8228 public static final String
8229 GLOBAL_HTTP_PROXY_EXCLUSION_LIST = "global_http_proxy_exclusion_list";
8230
8231 /**
Jason Monk602b2322013-07-03 17:04:33 -04008232 * The location PAC File for the proxy.
8233 * @hide
8234 */
8235 public static final String
8236 GLOBAL_HTTP_PROXY_PAC = "global_proxy_pac_url";
8237
8238 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07008239 * Enables the UI setting to allow the user to specify the global HTTP
8240 * proxy and associated exclusion list.
8241 *
8242 * @hide
8243 */
8244 public static final String SET_GLOBAL_HTTP_PROXY = "set_global_http_proxy";
8245
8246 /**
8247 * Setting for default DNS in case nobody suggests one
8248 *
8249 * @hide
8250 */
8251 public static final String DEFAULT_DNS_SERVER = "default_dns_server";
8252
Jeff Sharkey0ac10282012-10-01 12:50:22 -07008253 /** {@hide} */
8254 public static final String
8255 BLUETOOTH_HEADSET_PRIORITY_PREFIX = "bluetooth_headset_priority_";
8256 /** {@hide} */
8257 public static final String
8258 BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX = "bluetooth_a2dp_sink_priority_";
8259 /** {@hide} */
8260 public static final String
Sanket Agarwal1bec6a52015-10-21 18:23:27 -07008261 BLUETOOTH_A2DP_SRC_PRIORITY_PREFIX = "bluetooth_a2dp_src_priority_";
8262 /** {@hide} */
8263 public static final String
Jeff Sharkey0ac10282012-10-01 12:50:22 -07008264 BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX = "bluetooth_input_device_priority_";
Kim Schulz0d376052013-08-22 11:18:02 +02008265 /** {@hide} */
8266 public static final String
8267 BLUETOOTH_MAP_PRIORITY_PREFIX = "bluetooth_map_priority_";
Casper Bonde2a5f6082015-03-19 10:36:45 +01008268 /** {@hide} */
8269 public static final String
Joseph Pirozzo631768d2016-09-01 14:19:28 -07008270 BLUETOOTH_MAP_CLIENT_PRIORITY_PREFIX = "bluetooth_map_client_priority_";
8271 /** {@hide} */
8272 public static final String
Joseph Pirozzo563c7002016-03-21 15:49:48 -07008273 BLUETOOTH_PBAP_CLIENT_PRIORITY_PREFIX = "bluetooth_pbap_client_priority_";
8274 /** {@hide} */
8275 public static final String
Casper Bonde2a5f6082015-03-19 10:36:45 +01008276 BLUETOOTH_SAP_PRIORITY_PREFIX = "bluetooth_sap_priority_";
Sanket Agarwal773297a2016-08-04 16:16:20 -07008277 /** {@hide} */
8278 public static final String
8279 BLUETOOTH_PAN_PRIORITY_PREFIX = "bluetooth_pan_priority_";
Jeff Sharkey0ac10282012-10-01 12:50:22 -07008280
8281 /**
Adam Lesinski31c05d12015-06-09 17:34:04 -07008282 * Device Idle (Doze) specific settings.
8283 * This is encoded as a key=value list, separated by commas. Ex:
8284 *
Henrik Baardeac10ab2016-04-19 07:50:24 +02008285 * "inactive_to=60000,sensing_to=400000"
Adam Lesinski31c05d12015-06-09 17:34:04 -07008286 *
8287 * The following keys are supported:
8288 *
8289 * <pre>
8290 * inactive_to (long)
8291 * sensing_to (long)
8292 * motion_inactive_to (long)
8293 * idle_after_inactive_to (long)
8294 * idle_pending_to (long)
8295 * max_idle_pending_to (long)
8296 * idle_pending_factor (float)
8297 * idle_to (long)
8298 * max_idle_to (long)
8299 * idle_factor (float)
8300 * min_time_to_alarm (long)
8301 * max_temp_app_whitelist_duration (long)
Felipe Lemea1b79bf2016-05-24 13:06:54 -07008302 * notification_whitelist_duration (long)
Adam Lesinski31c05d12015-06-09 17:34:04 -07008303 * </pre>
8304 *
8305 * <p>
8306 * Type: string
8307 * @hide
8308 * @see com.android.server.DeviceIdleController.Constants
8309 */
8310 public static final String DEVICE_IDLE_CONSTANTS = "device_idle_constants";
8311
8312 /**
Joe LaPennaf33b5bf2016-03-23 15:19:47 -07008313 * Device Idle (Doze) specific settings for watches. See {@code #DEVICE_IDLE_CONSTANTS}
8314 *
8315 * <p>
8316 * Type: string
8317 * @hide
8318 * @see com.android.server.DeviceIdleController.Constants
8319 */
8320 public static final String DEVICE_IDLE_CONSTANTS_WATCH = "device_idle_constants_watch";
8321
8322 /**
Adam Lesinskia6232df2015-06-11 18:16:41 -07008323 * App standby (app idle) specific settings.
8324 * This is encoded as a key=value list, separated by commas. Ex:
8325 *
8326 * "idle_duration=5000,parole_interval=4500"
8327 *
8328 * The following keys are supported:
8329 *
8330 * <pre>
Adam Lesinskif0ef3c12016-01-13 12:26:07 -08008331 * idle_duration2 (long)
Adam Lesinskia6232df2015-06-11 18:16:41 -07008332 * wallclock_threshold (long)
8333 * parole_interval (long)
8334 * parole_duration (long)
Adam Lesinskif0ef3c12016-01-13 12:26:07 -08008335 *
8336 * idle_duration (long) // This is deprecated and used to circumvent b/26355386.
Adam Lesinskia6232df2015-06-11 18:16:41 -07008337 * </pre>
8338 *
8339 * <p>
8340 * Type: string
8341 * @hide
8342 * @see com.android.server.usage.UsageStatsService.SettingsObserver
8343 */
8344 public static final String APP_IDLE_CONSTANTS = "app_idle_constants";
8345
8346 /**
Dianne Hackborna750a632015-06-16 17:18:23 -07008347 * Alarm manager specific settings.
8348 * This is encoded as a key=value list, separated by commas. Ex:
8349 *
8350 * "min_futurity=5000,allow_while_idle_short_time=4500"
8351 *
8352 * The following keys are supported:
8353 *
8354 * <pre>
8355 * min_futurity (long)
8356 * min_interval (long)
8357 * allow_while_idle_short_time (long)
8358 * allow_while_idle_long_time (long)
8359 * allow_while_idle_whitelist_duration (long)
8360 * </pre>
8361 *
8362 * <p>
8363 * Type: string
8364 * @hide
8365 * @see com.android.server.AlarmManagerService.Constants
8366 */
8367 public static final String ALARM_MANAGER_CONSTANTS = "alarm_manager_constants";
8368
8369 /**
Dianne Hackborne9a988c2016-05-27 17:59:40 -07008370 * Job scheduler specific settings.
8371 * This is encoded as a key=value list, separated by commas. Ex:
8372 *
8373 * "min_ready_jobs_count=2,moderate_use_factor=.5"
8374 *
8375 * The following keys are supported:
8376 *
8377 * <pre>
8378 * min_idle_count (int)
8379 * min_charging_count (int)
8380 * min_connectivity_count (int)
8381 * min_content_count (int)
8382 * min_ready_jobs_count (int)
8383 * heavy_use_factor (float)
8384 * moderate_use_factor (float)
8385 * fg_job_count (int)
8386 * bg_normal_job_count (int)
8387 * bg_moderate_job_count (int)
8388 * bg_low_job_count (int)
8389 * bg_critical_job_count (int)
8390 * </pre>
8391 *
8392 * <p>
8393 * Type: string
8394 * @hide
8395 * @see com.android.server.job.JobSchedulerService.Constants
8396 */
8397 public static final String JOB_SCHEDULER_CONSTANTS = "job_scheduler_constants";
8398
8399 /**
Makoto Onuki4362a662016-03-08 18:59:09 -08008400 * ShortcutManager specific settings.
8401 * This is encoded as a key=value list, separated by commas. Ex:
8402 *
Makoto Onukib6d35232016-04-04 15:57:17 -07008403 * "reset_interval_sec=86400,max_updates_per_interval=1"
Makoto Onuki4362a662016-03-08 18:59:09 -08008404 *
8405 * The following keys are supported:
8406 *
8407 * <pre>
8408 * reset_interval_sec (long)
Makoto Onukib6d35232016-04-04 15:57:17 -07008409 * max_updates_per_interval (int)
Makoto Onuki4362a662016-03-08 18:59:09 -08008410 * max_icon_dimension_dp (int, DP)
8411 * max_icon_dimension_dp_lowram (int, DP)
8412 * max_shortcuts (int)
8413 * icon_quality (int, 0-100)
8414 * icon_format (String)
8415 * </pre>
8416 *
8417 * <p>
8418 * Type: string
8419 * @hide
8420 * @see com.android.server.pm.ShortcutService.ConfigConstants
8421 */
8422 public static final String SHORTCUT_MANAGER_CONSTANTS = "shortcut_manager_constants";
8423
8424 /**
Jeff Sharkey0ac10282012-10-01 12:50:22 -07008425 * Get the key that retrieves a bluetooth headset's priority.
8426 * @hide
8427 */
8428 public static final String getBluetoothHeadsetPriorityKey(String address) {
Elliott Hughescb64d432013-08-02 10:00:44 -07008429 return BLUETOOTH_HEADSET_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
Jeff Sharkey0ac10282012-10-01 12:50:22 -07008430 }
8431
8432 /**
8433 * Get the key that retrieves a bluetooth a2dp sink's priority.
8434 * @hide
8435 */
8436 public static final String getBluetoothA2dpSinkPriorityKey(String address) {
Elliott Hughescb64d432013-08-02 10:00:44 -07008437 return BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
Jeff Sharkey0ac10282012-10-01 12:50:22 -07008438 }
8439
8440 /**
Sanket Agarwal1bec6a52015-10-21 18:23:27 -07008441 * Get the key that retrieves a bluetooth a2dp src's priority.
8442 * @hide
8443 */
8444 public static final String getBluetoothA2dpSrcPriorityKey(String address) {
8445 return BLUETOOTH_A2DP_SRC_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
8446 }
8447
8448 /**
Jeff Sharkey0ac10282012-10-01 12:50:22 -07008449 * Get the key that retrieves a bluetooth Input Device's priority.
8450 * @hide
8451 */
8452 public static final String getBluetoothInputDevicePriorityKey(String address) {
Elliott Hughescb64d432013-08-02 10:00:44 -07008453 return BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
Jeff Sharkey0ac10282012-10-01 12:50:22 -07008454 }
8455
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07008456 /**
Sanket Agarwal773297a2016-08-04 16:16:20 -07008457 * Get the key that retrieves a bluetooth pan client priority.
8458 * @hide
8459 */
8460 public static final String getBluetoothPanPriorityKey(String address) {
8461 return BLUETOOTH_PAN_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
8462 }
8463
8464 /**
Kim Schulz0d376052013-08-22 11:18:02 +02008465 * Get the key that retrieves a bluetooth map priority.
8466 * @hide
8467 */
8468 public static final String getBluetoothMapPriorityKey(String address) {
8469 return BLUETOOTH_MAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
8470 }
Casper Bonde2a5f6082015-03-19 10:36:45 +01008471
8472 /**
Joseph Pirozzo631768d2016-09-01 14:19:28 -07008473 * Get the key that retrieves a bluetooth map client priority.
8474 * @hide
8475 */
8476 public static final String getBluetoothMapClientPriorityKey(String address) {
8477 return BLUETOOTH_MAP_CLIENT_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
8478 }
8479
8480 /**
Joseph Pirozzo563c7002016-03-21 15:49:48 -07008481 * Get the key that retrieves a bluetooth pbap client priority.
8482 * @hide
8483 */
8484 public static final String getBluetoothPbapClientPriorityKey(String address) {
8485 return BLUETOOTH_PBAP_CLIENT_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
8486 }
8487
8488 /**
Joseph Pirozzo631768d2016-09-01 14:19:28 -07008489 * Get the key that retrieves a bluetooth sap priority.
Casper Bonde2a5f6082015-03-19 10:36:45 +01008490 * @hide
8491 */
8492 public static final String getBluetoothSapPriorityKey(String address) {
8493 return BLUETOOTH_SAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
8494 }
8495
Kim Schulz0d376052013-08-22 11:18:02 +02008496 /**
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07008497 * Scaling factor for normal window animations. Setting to 0 will
8498 * disable window animations.
8499 */
8500 public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale";
8501
8502 /**
8503 * Scaling factor for activity transition animations. Setting to 0 will
8504 * disable window animations.
8505 */
8506 public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale";
8507
8508 /**
8509 * Scaling factor for Animator-based animations. This affects both the
8510 * start delay and duration of all such animations. Setting to 0 will
8511 * cause animations to end immediately. The default value is 1.
8512 */
8513 public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale";
8514
8515 /**
8516 * Scaling factor for normal window animations. Setting to 0 will
8517 * disable window animations.
8518 *
8519 * @hide
8520 */
8521 public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations";
8522
8523 /**
8524 * If 0, the compatibility mode is off for all applications.
8525 * If 1, older applications run under compatibility mode.
8526 * TODO: remove this settings before code freeze (bug/1907571)
8527 * @hide
8528 */
8529 public static final String COMPATIBILITY_MODE = "compatibility_mode";
8530
8531 /**
8532 * CDMA only settings
8533 * Emergency Tone 0 = Off
8534 * 1 = Alert
8535 * 2 = Vibrate
8536 * @hide
8537 */
8538 public static final String EMERGENCY_TONE = "emergency_tone";
8539
8540 /**
8541 * CDMA only settings
8542 * Whether the auto retry is enabled. The value is
8543 * boolean (1 or 0).
8544 * @hide
8545 */
8546 public static final String CALL_AUTO_RETRY = "call_auto_retry";
8547
8548 /**
Selim Cinek705442f2016-09-13 16:02:33 -07008549 * A setting that can be read whether the emergency affordance is currently needed.
8550 * The value is a boolean (1 or 0).
8551 * @hide
8552 */
8553 public static final String EMERGENCY_AFFORDANCE_NEEDED = "emergency_affordance_needed";
8554
8555 /**
Sungmin Choie099ab12014-06-09 14:45:51 +09008556 * See RIL_PreferredNetworkType in ril.h
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07008557 * @hide
8558 */
8559 public static final String PREFERRED_NETWORK_MODE =
8560 "preferred_network_mode";
8561
8562 /**
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07008563 * Name of an application package to be debugged.
8564 */
8565 public static final String DEBUG_APP = "debug_app";
8566
8567 /**
8568 * If 1, when launching DEBUG_APP it will wait for the debugger before
8569 * starting user code. If 0, it will run normally.
8570 */
8571 public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger";
8572
8573 /**
8574 * Control whether the process CPU usage meter should be shown.
Nick Kralevichfc4a5c22016-10-11 09:01:38 -07008575 *
8576 * @deprecated This functionality is no longer available as of
8577 * {@link android.os.Build.VERSION_CODES#N_MR1}.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07008578 */
Nick Kralevichfc4a5c22016-10-11 09:01:38 -07008579 @Deprecated
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07008580 public static final String SHOW_PROCESSES = "show_processes";
8581
8582 /**
Ruchi Kandoi62b8a492014-04-17 18:01:40 -07008583 * If 1 low power mode is enabled.
8584 * @hide
8585 */
8586 public static final String LOW_POWER_MODE = "low_power";
8587
John Spurlockf8f524c2014-06-10 14:47:29 -04008588 /**
8589 * Battery level [1-99] at which low power mode automatically turns on.
Dianne Hackborn14272302014-06-10 23:13:02 -07008590 * If 0, it will not automatically turn on.
John Spurlockf8f524c2014-06-10 14:47:29 -04008591 * @hide
8592 */
8593 public static final String LOW_POWER_MODE_TRIGGER_LEVEL = "low_power_trigger_level";
8594
Ruchi Kandoi62b8a492014-04-17 18:01:40 -07008595 /**
Dianne Hackbornb2117d12016-02-16 18:26:35 -08008596 * If not 0, the activity manager will aggressively finish activities and
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07008597 * processes as soon as they are no longer needed. If 0, the normal
8598 * extended lifetime is used.
8599 */
Dianne Hackborn89ad4562014-08-24 16:45:38 -07008600 public static final String ALWAYS_FINISH_ACTIVITIES = "always_finish_activities";
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07008601
Christopher Tate66488d62012-10-02 11:58:01 -07008602 /**
Dianne Hackbornb2117d12016-02-16 18:26:35 -08008603 * @hide
8604 * If not 0, the activity manager will implement a looser version of background
8605 * check that is more compatible with existing apps.
8606 */
8607 public static final String LENIENT_BACKGROUND_CHECK = "lenient_background_check";
8608
8609 /**
Eric Laurent7ee1e4f2012-10-26 18:11:21 -07008610 * Use Dock audio output for media:
8611 * 0 = disabled
8612 * 1 = enabled
8613 * @hide
8614 */
8615 public static final String DOCK_AUDIO_MEDIA_ENABLED = "dock_audio_media_enabled";
8616
8617 /**
Phil Burkdeaa8d92016-02-23 17:12:04 -08008618 * The surround sound formats AC3, DTS or IEC61937 are
8619 * available for use if they are detected.
8620 * This is the default mode.
8621 *
8622 * Note that AUTO is equivalent to ALWAYS for Android TVs and other
8623 * devices that have an S/PDIF output. This is because S/PDIF
8624 * is unidirectional and the TV cannot know if a decoder is
8625 * connected. So it assumes they are always available.
8626 * @hide
8627 */
8628 public static final int ENCODED_SURROUND_OUTPUT_AUTO = 0;
8629
8630 /**
8631 * AC3, DTS or IEC61937 are NEVER available, even if they
8632 * are detected by the hardware. Those formats will not be
8633 * reported.
8634 *
8635 * An example use case would be an AVR reports that it is capable of
8636 * surround sound decoding but is broken. If NEVER is chosen
8637 * then apps must use PCM output instead of encoded output.
8638 * @hide
8639 */
8640 public static final int ENCODED_SURROUND_OUTPUT_NEVER = 1;
8641
8642 /**
8643 * AC3, DTS or IEC61937 are ALWAYS available, even if they
8644 * are not detected by the hardware. Those formats will be
8645 * reported as part of the HDMI output capability. Applications
8646 * are then free to use either PCM or encoded output.
8647 *
8648 * An example use case would be a when TV was connected over
8649 * TOS-link to an AVR. But the TV could not see it because TOS-link
8650 * is unidirectional.
8651 * @hide
8652 */
8653 public static final int ENCODED_SURROUND_OUTPUT_ALWAYS = 2;
8654
8655 /**
8656 * Set to ENCODED_SURROUND_OUTPUT_AUTO,
8657 * ENCODED_SURROUND_OUTPUT_NEVER or
8658 * ENCODED_SURROUND_OUTPUT_ALWAYS
8659 * @hide
8660 */
8661 public static final String ENCODED_SURROUND_OUTPUT = "encoded_surround_output";
8662
8663 /**
Eric Laurent05274f32012-11-29 12:48:18 -08008664 * Persisted safe headphone volume management state by AudioService
8665 * @hide
8666 */
8667 public static final String AUDIO_SAFE_VOLUME_STATE = "audio_safe_volume_state";
8668
8669 /**
Geremy Condraa0735112013-03-26 21:49:26 -07008670 * URL for tzinfo (time zone) updates
8671 * @hide
8672 */
8673 public static final String TZINFO_UPDATE_CONTENT_URL = "tzinfo_content_url";
8674
8675 /**
8676 * URL for tzinfo (time zone) update metadata
8677 * @hide
8678 */
8679 public static final String TZINFO_UPDATE_METADATA_URL = "tzinfo_metadata_url";
8680
8681 /**
8682 * URL for selinux (mandatory access control) updates
8683 * @hide
8684 */
8685 public static final String SELINUX_UPDATE_CONTENT_URL = "selinux_content_url";
8686
8687 /**
8688 * URL for selinux (mandatory access control) update metadata
8689 * @hide
8690 */
8691 public static final String SELINUX_UPDATE_METADATA_URL = "selinux_metadata_url";
8692
8693 /**
8694 * URL for sms short code updates
8695 * @hide
8696 */
8697 public static final String SMS_SHORT_CODES_UPDATE_CONTENT_URL =
8698 "sms_short_codes_content_url";
8699
8700 /**
8701 * URL for sms short code update metadata
8702 * @hide
8703 */
8704 public static final String SMS_SHORT_CODES_UPDATE_METADATA_URL =
8705 "sms_short_codes_metadata_url";
8706
8707 /**
Amit Mahajan9069fab2015-05-01 11:05:47 -07008708 * URL for apn_db updates
8709 * @hide
8710 */
8711 public static final String APN_DB_UPDATE_CONTENT_URL = "apn_db_content_url";
8712
8713 /**
8714 * URL for apn_db update metadata
8715 * @hide
8716 */
8717 public static final String APN_DB_UPDATE_METADATA_URL = "apn_db_metadata_url";
8718
8719 /**
Geremy Condraa0735112013-03-26 21:49:26 -07008720 * URL for cert pinlist updates
8721 * @hide
8722 */
8723 public static final String CERT_PIN_UPDATE_CONTENT_URL = "cert_pin_content_url";
8724
8725 /**
8726 * URL for cert pinlist updates
8727 * @hide
8728 */
8729 public static final String CERT_PIN_UPDATE_METADATA_URL = "cert_pin_metadata_url";
8730
Geremy Condra757ee522013-03-29 16:39:45 -07008731 /**
Ben Gruver633dc9b2013-04-04 12:05:49 -07008732 * URL for intent firewall updates
8733 * @hide
8734 */
8735 public static final String INTENT_FIREWALL_UPDATE_CONTENT_URL =
8736 "intent_firewall_content_url";
8737
8738 /**
8739 * URL for intent firewall update metadata
8740 * @hide
8741 */
8742 public static final String INTENT_FIREWALL_UPDATE_METADATA_URL =
8743 "intent_firewall_metadata_url";
8744
8745 /**
Geremy Condra4e7f7e82013-03-26 21:09:01 -07008746 * SELinux enforcement status. If 0, permissive; if 1, enforcing.
8747 * @hide
8748 */
8749 public static final String SELINUX_STATUS = "selinux_status";
8750
Geremy Condraa0735112013-03-26 21:49:26 -07008751 /**
Amith Yamasanid8415f42013-08-07 20:15:10 -07008752 * Developer setting to force RTL layout.
8753 * @hide
8754 */
8755 public static final String DEVELOPMENT_FORCE_RTL = "debug.force_rtl";
8756
8757 /**
Daniel Sandlerdea64622013-09-23 16:05:57 -04008758 * Milliseconds after screen-off after which low battery sounds will be silenced.
8759 *
8760 * If zero, battery sounds will always play.
8761 * Defaults to @integer/def_low_battery_sound_timeout in SettingsProvider.
8762 *
8763 * @hide
8764 */
8765 public static final String LOW_BATTERY_SOUND_TIMEOUT = "low_battery_sound_timeout";
8766
8767 /**
Evan Charltoncc7b0432014-01-14 14:47:11 -08008768 * Milliseconds to wait before bouncing Wi-Fi after settings is restored. Note that after
Dianne Hackborna3fb40d2014-08-12 15:06:50 -07008769 * the caller is done with this, they should call {@link ContentResolver#delete} to
Evan Charltoncc7b0432014-01-14 14:47:11 -08008770 * clean up any value that they may have written.
8771 *
8772 * @hide
8773 */
8774 public static final String WIFI_BOUNCE_DELAY_OVERRIDE_MS = "wifi_bounce_delay_override_ms";
8775
John Spurlockc6d1c602014-01-17 15:22:06 -05008776 /**
8777 * Defines global runtime overrides to window policy.
8778 *
Jorim Jaggib10e33f2015-02-04 21:57:40 +01008779 * See {@link com.android.server.policy.PolicyControl} for value format.
John Spurlockc6d1c602014-01-17 15:22:06 -05008780 *
8781 * @hide
8782 */
8783 public static final String POLICY_CONTROL = "policy_control";
Evan Charltoncc7b0432014-01-14 14:47:11 -08008784
8785 /**
John Spurlockae641c92014-06-30 18:11:40 -04008786 * Defines global zen mode. ZEN_MODE_OFF, ZEN_MODE_IMPORTANT_INTERRUPTIONS,
8787 * or ZEN_MODE_NO_INTERRUPTIONS.
John Spurlocke677d712014-02-13 12:52:19 -05008788 *
8789 * @hide
8790 */
8791 public static final String ZEN_MODE = "zen_mode";
8792
8793 /** @hide */ public static final int ZEN_MODE_OFF = 0;
John Spurlockae641c92014-06-30 18:11:40 -04008794 /** @hide */ public static final int ZEN_MODE_IMPORTANT_INTERRUPTIONS = 1;
8795 /** @hide */ public static final int ZEN_MODE_NO_INTERRUPTIONS = 2;
John Spurlock4f1163c2015-04-02 17:41:21 -04008796 /** @hide */ public static final int ZEN_MODE_ALARMS = 3;
John Spurlocke677d712014-02-13 12:52:19 -05008797
8798 /** @hide */ public static String zenModeToString(int mode) {
John Spurlockae641c92014-06-30 18:11:40 -04008799 if (mode == ZEN_MODE_IMPORTANT_INTERRUPTIONS) return "ZEN_MODE_IMPORTANT_INTERRUPTIONS";
John Spurlock4f1163c2015-04-02 17:41:21 -04008800 if (mode == ZEN_MODE_ALARMS) return "ZEN_MODE_ALARMS";
John Spurlockae641c92014-06-30 18:11:40 -04008801 if (mode == ZEN_MODE_NO_INTERRUPTIONS) return "ZEN_MODE_NO_INTERRUPTIONS";
8802 return "ZEN_MODE_OFF";
John Spurlocke677d712014-02-13 12:52:19 -05008803 }
8804
John Spurlockb2278d62015-04-07 12:47:12 -04008805 /** @hide */ public static boolean isValidZenMode(int value) {
8806 switch (value) {
8807 case Global.ZEN_MODE_OFF:
8808 case Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS:
8809 case Global.ZEN_MODE_ALARMS:
8810 case Global.ZEN_MODE_NO_INTERRUPTIONS:
8811 return true;
8812 default:
8813 return false;
8814 }
8815 }
8816
John Spurlocke677d712014-02-13 12:52:19 -05008817 /**
Julia Reynolds9b11fdb2015-07-31 09:49:55 -04008818 * Value of the ringer before entering zen mode.
8819 *
8820 * @hide
8821 */
8822 public static final String ZEN_MODE_RINGER_LEVEL = "zen_mode_ringer_level";
8823
8824 /**
John Spurlock056c5192014-04-20 21:52:01 -04008825 * Opaque value, changes when persisted zen mode configuration changes.
8826 *
8827 * @hide
8828 */
8829 public static final String ZEN_MODE_CONFIG_ETAG = "zen_mode_config_etag";
8830
8831 /**
Chris Wren7bd241232014-02-28 16:25:05 -05008832 * Defines global heads up toggle. One of HEADS_UP_OFF, HEADS_UP_ON.
8833 *
8834 * @hide
8835 */
Chris Wren10d82df2014-03-01 10:34:51 -05008836 public static final String HEADS_UP_NOTIFICATIONS_ENABLED =
8837 "heads_up_notifications_enabled";
Chris Wren7bd241232014-02-28 16:25:05 -05008838
8839 /** @hide */ public static final int HEADS_UP_OFF = 0;
8840 /** @hide */ public static final int HEADS_UP_ON = 1;
8841
8842 /**
Jerome Poichet147b4d72014-05-12 18:13:27 -07008843 * The name of the device
Jerome Poichet147b4d72014-05-12 18:13:27 -07008844 */
8845 public static final String DEVICE_NAME = "device_name";
8846
8847 /**
Jeff Davidson56f9f732014-08-14 16:47:23 -07008848 * Whether the NetworkScoringService has been first initialized.
8849 * <p>
8850 * Type: int (0 for false, 1 for true)
8851 * @hide
8852 */
8853 public static final String NETWORK_SCORING_PROVISIONED = "network_scoring_provisioned";
8854
8855 /**
Jim Miller6848dc82014-10-13 18:51:53 -07008856 * Whether the user wants to be prompted for password to decrypt the device on boot.
8857 * This only matters if the storage is encrypted.
8858 * <p>
8859 * Type: int (0 for false, 1 for true)
8860 * @hide
8861 */
8862 public static final String REQUIRE_PASSWORD_TO_DECRYPT = "require_password_to_decrypt";
8863
8864 /**
Etan Cohen93bbf272015-05-04 18:01:47 -07008865 * Whether the Volte is enabled
Libin.Tang@motorola.com0499bb52014-10-10 14:55:57 -05008866 * <p>
8867 * Type: int (0 for false, 1 for true)
8868 * @hide
8869 */
Etan Cohene41a9cf2014-10-22 10:50:46 -07008870 public static final String ENHANCED_4G_MODE_ENABLED = "volte_vt_enabled";
Libin.Tang@motorola.com0499bb52014-10-10 14:55:57 -05008871
8872 /**
Etan Cohen93bbf272015-05-04 18:01:47 -07008873 * Whether VT (Video Telephony over IMS) is enabled
8874 * <p>
8875 * Type: int (0 for false, 1 for true)
8876 *
8877 * @hide
8878 */
8879 public static final String VT_IMS_ENABLED = "vt_ims_enabled";
8880
8881 /**
Etan Cohen9c8f21b2014-12-23 15:02:19 -08008882 * Whether WFC is enabled
8883 * <p>
8884 * Type: int (0 for false, 1 for true)
8885 *
8886 * @hide
8887 */
8888 public static final String WFC_IMS_ENABLED = "wfc_ims_enabled";
8889
8890 /**
Meng Wang2c25e4a2016-09-19 14:18:05 -07008891 * WFC mode on home/non-roaming network.
Etan Cohen9c8f21b2014-12-23 15:02:19 -08008892 * <p>
8893 * Type: int - 2=Wi-Fi preferred, 1=Cellular preferred, 0=Wi-Fi only
8894 *
8895 * @hide
8896 */
8897 public static final String WFC_IMS_MODE = "wfc_ims_mode";
8898
8899 /**
Meng Wang2c25e4a2016-09-19 14:18:05 -07008900 * WFC mode on roaming network.
8901 * <p>
8902 * Type: int - see {@link WFC_IMS_MODE} for values
8903 *
8904 * @hide
8905 */
8906 public static final String WFC_IMS_ROAMING_MODE = "wfc_ims_roaming_mode";
8907
8908 /**
Etan Cohen9c8f21b2014-12-23 15:02:19 -08008909 * Whether WFC roaming is enabled
8910 * <p>
8911 * Type: int (0 for false, 1 for true)
8912 *
8913 * @hide
8914 */
8915 public static final String WFC_IMS_ROAMING_ENABLED = "wfc_ims_roaming_enabled";
8916
8917 /**
Amit Mahajan4fea0922014-11-18 12:56:28 -08008918 * Whether user can enable/disable LTE as a preferred network. A carrier might control
8919 * this via gservices, OMA-DM, carrier app, etc.
8920 * <p>
8921 * Type: int (0 for false, 1 for true)
8922 * @hide
8923 */
8924 public static final String LTE_SERVICE_FORCED = "lte_service_forced";
8925
8926 /**
Svet Ganov2acf0632015-11-24 19:10:59 -08008927 * Ephemeral app cookie max size in bytes.
8928 * <p>
8929 * Type: int
8930 * @hide
8931 */
8932 public static final String EPHEMERAL_COOKIE_MAX_SIZE_BYTES =
8933 "ephemeral_cookie_max_size_bytes";
8934
8935 /**
Todd Kennedyd15bb752016-09-13 16:38:31 -07008936 * Toggle to enable/disable the entire ephemeral feature. By default, ephemeral is
8937 * enabled. Set to zero to disable.
8938 * <p>
8939 * Type: int (0 for false, 1 for true)
8940 *
8941 * @hide
8942 */
8943 public static final String ENABLE_EPHEMERAL_FEATURE = "enable_ephemeral_feature";
8944
8945 /**
Todd Kennedya97045b2016-06-10 16:42:00 -07008946 * A mask applied to the ephemeral hash to generate the hash prefix.
8947 * <p>
8948 * Type: int
8949 *
8950 * @hide
8951 */
8952 public static final String EPHEMERAL_HASH_PREFIX_MASK = "ephemeral_hash_prefix_mask";
8953
8954 /**
8955 * Number of hash prefixes to send during ephemeral resolution.
8956 * <p>
8957 * Type: int
8958 *
8959 * @hide
8960 */
8961 public static final String EPHEMERAL_HASH_PREFIX_COUNT = "ephemeral_hash_prefix_count";
8962
8963 /**
Svet Ganov2acf0632015-11-24 19:10:59 -08008964 * The duration for caching uninstalled ephemeral apps.
8965 * <p>
8966 * Type: long
8967 * @hide
8968 */
8969 public static final String UNINSTALLED_EPHEMERAL_APP_CACHE_DURATION_MILLIS =
8970 "uninstalled_ephemeral_app_cache_duration_millis";
8971
8972 /**
Fyodor Kupolov07140f72016-02-17 10:46:11 -08008973 * Allows switching users when system user is locked.
8974 * <p>
8975 * Type: int
8976 * @hide
8977 */
8978 public static final String ALLOW_USER_SWITCHING_WHEN_SYSTEM_USER_LOCKED =
8979 "allow_user_switching_when_system_user_locked";
8980
8981 /**
Daichi Hirono82ab9802016-03-02 13:23:29 +09008982 * Boot count since the device starts running APK level 24.
8983 * <p>
8984 * Type: int
8985 */
8986 public static final String BOOT_COUNT = "boot_count";
8987
8988 /**
Lenka Trochtova6474f0e2016-03-24 16:43:10 +01008989 * Whether the safe boot is disallowed.
8990 *
8991 * <p>This setting should have the identical value as the corresponding user restriction.
8992 * The purpose of the setting is to make the restriction available in early boot stages
8993 * before the user restrictions are loaded.
8994 * @hide
8995 */
8996 public static final String SAFE_BOOT_DISALLOWED = "safe_boot_disallowed";
8997
8998 /**
Amith Yamasanieb437d42016-04-29 09:31:25 -07008999 * Whether this device is currently in retail demo mode. If true, device
9000 * usage is severely limited.
9001 * <p>
9002 * Type: int (0 for false, 1 for true)
9003 * @hide
9004 */
9005 public static final String DEVICE_DEMO_MODE = "device_demo_mode";
9006
9007 /**
Suprabh Shukladbbc7af2016-07-06 16:32:56 -07009008 * Retail mode specific settings. This is encoded as a key=value list, separated by commas.
9009 * Ex: "user_inactivity_timeout_ms=30000,warning_dialog_timeout_ms=10000". The following
9010 * keys are supported:
9011 *
9012 * <pre>
9013 * user_inactivity_timeout_ms (long)
9014 * warning_dialog_timeout_ms (long)
9015 * </pre>
9016 * <p>
9017 * Type: string
9018 *
9019 * @hide
9020 */
9021 public static final String RETAIL_DEMO_MODE_CONSTANTS = "retail_demo_mode_constants";
9022
9023 /**
Svetoslav Ganov264c7a92016-08-24 17:31:14 -07009024 * The reason for the settings database being downgraded. This is only for
9025 * troubleshooting purposes and its value should not be interpreted in any way.
9026 *
9027 * Type: string
9028 *
9029 * @hide
9030 */
9031 public static final String DATABASE_DOWNGRADE_REASON = "database_downgrade_reason";
9032
9033 /**
Christopher Tate66488d62012-10-02 11:58:01 -07009034 * Settings to backup. This is here so that it's in the same place as the settings
9035 * keys and easy to update.
9036 *
9037 * These keys may be mentioned in the SETTINGS_TO_BACKUP arrays in System
9038 * and Secure as well. This is because those tables drive both backup and
9039 * restore, and restore needs to properly whitelist keys that used to live
9040 * in those namespaces. The keys will only actually be backed up / restored
9041 * if they are also mentioned in this table (Global.SETTINGS_TO_BACKUP).
9042 *
9043 * NOTE: Settings are backed up and restored in the order they appear
9044 * in this array. If you have one setting depending on another,
9045 * make sure that they are ordered appropriately.
9046 *
9047 * @hide
9048 */
9049 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate58f41ec2013-01-11 15:40:36 -08009050 BUGREPORT_IN_POWER_MENU,
Christopher Tate66488d62012-10-02 11:58:01 -07009051 STAY_ON_WHILE_PLUGGED_IN,
Christopher Tate66488d62012-10-02 11:58:01 -07009052 AUTO_TIME,
9053 AUTO_TIME_ZONE,
9054 POWER_SOUNDS_ENABLED,
9055 DOCK_SOUNDS_ENABLED,
Ritesh Reddyf8f12132015-11-20 16:43:28 +00009056 CHARGING_SOUNDS_ENABLED,
Christopher Tate66488d62012-10-02 11:58:01 -07009057 USB_MASS_STORAGE_ENABLED,
9058 ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED,
9059 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
9060 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY,
Christopher Tate16eb7cd2012-10-09 15:26:30 -07009061 WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED,
Christopher Tate66488d62012-10-02 11:58:01 -07009062 WIFI_NUM_OPEN_NETWORKS_KEPT,
9063 EMERGENCY_TONE,
9064 CALL_AUTO_RETRY,
Amith Yamasani94005242014-10-31 11:35:13 -07009065 DOCK_AUDIO_MEDIA_ENABLED,
Phil Burkdeaa8d92016-02-23 17:12:04 -08009066 ENCODED_SURROUND_OUTPUT,
Amith Yamasani94005242014-10-31 11:35:13 -07009067 LOW_POWER_MODE_TRIGGER_LEVEL
Christopher Tate66488d62012-10-02 11:58:01 -07009068 };
9069
Christopher Tate06efb532012-08-24 15:29:27 -07009070 // Populated lazily, guarded by class object:
Dianne Hackborn139748f2012-09-24 11:36:57 -07009071 private static NameValueCache sNameValueCache = new NameValueCache(
Dianne Hackborn139748f2012-09-24 11:36:57 -07009072 CONTENT_URI,
9073 CALL_METHOD_GET_GLOBAL,
9074 CALL_METHOD_PUT_GLOBAL);
Christopher Tate06efb532012-08-24 15:29:27 -07009075
Christopher Tateaa036a22014-05-19 16:33:27 -07009076 // Certain settings have been moved from global to the per-user secure namespace
9077 private static final HashSet<String> MOVED_TO_SECURE;
9078 static {
9079 MOVED_TO_SECURE = new HashSet<String>(1);
9080 MOVED_TO_SECURE.add(Settings.Global.INSTALL_NON_MARKET_APPS);
9081 }
9082
Svetoslav683914b2015-01-15 14:22:26 -08009083 /** @hide */
9084 public static void getMovedToSecureSettings(Set<String> outKeySet) {
9085 outKeySet.addAll(MOVED_TO_SECURE);
9086 }
9087
Christopher Tate06efb532012-08-24 15:29:27 -07009088 /**
9089 * Look up a name in the database.
9090 * @param resolver to access the database with
9091 * @param name to look up in the table
9092 * @return the corresponding value, or null if not present
9093 */
Dianne Hackborn139748f2012-09-24 11:36:57 -07009094 public static String getString(ContentResolver resolver, String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07009095 return getStringForUser(resolver, name, UserHandle.myUserId());
9096 }
9097
9098 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -07009099 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -07009100 int userHandle) {
Christopher Tateaa036a22014-05-19 16:33:27 -07009101 if (MOVED_TO_SECURE.contains(name)) {
9102 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
9103 + " to android.provider.Settings.Secure, returning read-only value.");
9104 return Secure.getStringForUser(resolver, name, userHandle);
9105 }
Christopher Tate06efb532012-08-24 15:29:27 -07009106 return sNameValueCache.getStringForUser(resolver, name, userHandle);
9107 }
9108
9109 /**
9110 * Store a name/value pair into the database.
9111 * @param resolver to access the database with
9112 * @param name to store
9113 * @param value to associate with the name
9114 * @return true if the value was set, false on database errors
9115 */
9116 public static boolean putString(ContentResolver resolver,
9117 String name, String value) {
9118 return putStringForUser(resolver, name, value, UserHandle.myUserId());
9119 }
9120
9121 /** @hide */
9122 public static boolean putStringForUser(ContentResolver resolver,
9123 String name, String value, int userHandle) {
Christopher Tate06efb532012-08-24 15:29:27 -07009124 if (LOCAL_LOGV) {
9125 Log.v(TAG, "Global.putString(name=" + name + ", value=" + value
9126 + " for " + userHandle);
9127 }
Christopher Tateaa036a22014-05-19 16:33:27 -07009128 // Global and Secure have the same access policy so we can forward writes
9129 if (MOVED_TO_SECURE.contains(name)) {
9130 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
9131 + " to android.provider.Settings.Secure, value is unchanged.");
9132 return Secure.putStringForUser(resolver, name, value, userHandle);
9133 }
Christopher Tate06efb532012-08-24 15:29:27 -07009134 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
9135 }
9136
9137 /**
9138 * Construct the content URI for a particular name/value pair,
9139 * useful for monitoring changes with a ContentObserver.
9140 * @param name to look up in the table
9141 * @return the corresponding content URI, or null if not present
9142 */
9143 public static Uri getUriFor(String name) {
9144 return getUriFor(CONTENT_URI, name);
9145 }
9146
9147 /**
9148 * Convenience function for retrieving a single secure settings value
9149 * as an integer. Note that internally setting values are always
9150 * stored as strings; this function converts the string to an integer
9151 * for you. The default value will be returned if the setting is
9152 * not defined or not an integer.
9153 *
9154 * @param cr The ContentResolver to access.
9155 * @param name The name of the setting to retrieve.
9156 * @param def Value to return if the setting is not defined.
9157 *
9158 * @return The setting's current value, or 'def' if it is not defined
9159 * or not a valid integer.
9160 */
9161 public static int getInt(ContentResolver cr, String name, int def) {
9162 String v = getString(cr, name);
9163 try {
9164 return v != null ? Integer.parseInt(v) : def;
9165 } catch (NumberFormatException e) {
9166 return def;
9167 }
9168 }
9169
9170 /**
9171 * Convenience function for retrieving a single secure settings value
9172 * as an integer. Note that internally setting values are always
9173 * stored as strings; this function converts the string to an integer
9174 * for you.
9175 * <p>
9176 * This version does not take a default value. If the setting has not
9177 * been set, or the string value is not a number,
9178 * it throws {@link SettingNotFoundException}.
9179 *
9180 * @param cr The ContentResolver to access.
9181 * @param name The name of the setting to retrieve.
9182 *
9183 * @throws SettingNotFoundException Thrown if a setting by the given
9184 * name can't be found or the setting value is not an integer.
9185 *
9186 * @return The setting's current value.
9187 */
9188 public static int getInt(ContentResolver cr, String name)
9189 throws SettingNotFoundException {
9190 String v = getString(cr, name);
9191 try {
9192 return Integer.parseInt(v);
9193 } catch (NumberFormatException e) {
9194 throw new SettingNotFoundException(name);
9195 }
9196 }
9197
9198 /**
9199 * Convenience function for updating a single settings value as an
9200 * integer. This will either create a new entry in the table if the
9201 * given name does not exist, or modify the value of the existing row
9202 * with that name. Note that internally setting values are always
9203 * stored as strings, so this function converts the given value to a
9204 * string before storing it.
9205 *
9206 * @param cr The ContentResolver to access.
9207 * @param name The name of the setting to modify.
9208 * @param value The new value for the setting.
9209 * @return true if the value was set, false on database errors
9210 */
9211 public static boolean putInt(ContentResolver cr, String name, int value) {
9212 return putString(cr, name, Integer.toString(value));
9213 }
9214
9215 /**
9216 * Convenience function for retrieving a single secure settings value
9217 * as a {@code long}. Note that internally setting values are always
9218 * stored as strings; this function converts the string to a {@code long}
9219 * for you. The default value will be returned if the setting is
9220 * not defined or not a {@code long}.
9221 *
9222 * @param cr The ContentResolver to access.
9223 * @param name The name of the setting to retrieve.
9224 * @param def Value to return if the setting is not defined.
9225 *
9226 * @return The setting's current value, or 'def' if it is not defined
9227 * or not a valid {@code long}.
9228 */
9229 public static long getLong(ContentResolver cr, String name, long def) {
9230 String valString = getString(cr, name);
9231 long value;
9232 try {
9233 value = valString != null ? Long.parseLong(valString) : def;
9234 } catch (NumberFormatException e) {
9235 value = def;
9236 }
9237 return value;
9238 }
9239
9240 /**
9241 * Convenience function for retrieving a single secure settings value
9242 * as a {@code long}. Note that internally setting values are always
9243 * stored as strings; this function converts the string to a {@code long}
9244 * for you.
9245 * <p>
9246 * This version does not take a default value. If the setting has not
9247 * been set, or the string value is not a number,
9248 * it throws {@link SettingNotFoundException}.
9249 *
9250 * @param cr The ContentResolver to access.
9251 * @param name The name of the setting to retrieve.
9252 *
9253 * @return The setting's current value.
9254 * @throws SettingNotFoundException Thrown if a setting by the given
9255 * name can't be found or the setting value is not an integer.
9256 */
9257 public static long getLong(ContentResolver cr, String name)
9258 throws SettingNotFoundException {
9259 String valString = getString(cr, name);
9260 try {
9261 return Long.parseLong(valString);
9262 } catch (NumberFormatException e) {
9263 throw new SettingNotFoundException(name);
9264 }
9265 }
9266
9267 /**
9268 * Convenience function for updating a secure settings value as a long
9269 * integer. This will either create a new entry in the table if the
9270 * given name does not exist, or modify the value of the existing row
9271 * with that name. Note that internally setting values are always
9272 * stored as strings, so this function converts the given value to a
9273 * string before storing it.
9274 *
9275 * @param cr The ContentResolver to access.
9276 * @param name The name of the setting to modify.
9277 * @param value The new value for the setting.
9278 * @return true if the value was set, false on database errors
9279 */
9280 public static boolean putLong(ContentResolver cr, String name, long value) {
9281 return putString(cr, name, Long.toString(value));
9282 }
9283
9284 /**
9285 * Convenience function for retrieving a single secure settings value
9286 * as a floating point number. Note that internally setting values are
9287 * always stored as strings; this function converts the string to an
9288 * float for you. The default value will be returned if the setting
9289 * is not defined or not a valid float.
9290 *
9291 * @param cr The ContentResolver to access.
9292 * @param name The name of the setting to retrieve.
9293 * @param def Value to return if the setting is not defined.
9294 *
9295 * @return The setting's current value, or 'def' if it is not defined
9296 * or not a valid float.
9297 */
9298 public static float getFloat(ContentResolver cr, String name, float def) {
9299 String v = getString(cr, name);
9300 try {
9301 return v != null ? Float.parseFloat(v) : def;
9302 } catch (NumberFormatException e) {
9303 return def;
9304 }
9305 }
9306
9307 /**
9308 * Convenience function for retrieving a single secure settings value
9309 * as a float. Note that internally setting values are always
9310 * stored as strings; this function converts the string to a float
9311 * for you.
9312 * <p>
9313 * This version does not take a default value. If the setting has not
9314 * been set, or the string value is not a number,
9315 * it throws {@link SettingNotFoundException}.
9316 *
9317 * @param cr The ContentResolver to access.
9318 * @param name The name of the setting to retrieve.
9319 *
9320 * @throws SettingNotFoundException Thrown if a setting by the given
9321 * name can't be found or the setting value is not a float.
9322 *
9323 * @return The setting's current value.
9324 */
9325 public static float getFloat(ContentResolver cr, String name)
9326 throws SettingNotFoundException {
9327 String v = getString(cr, name);
9328 if (v == null) {
9329 throw new SettingNotFoundException(name);
9330 }
9331 try {
9332 return Float.parseFloat(v);
9333 } catch (NumberFormatException e) {
9334 throw new SettingNotFoundException(name);
9335 }
9336 }
9337
9338 /**
9339 * Convenience function for updating a single settings value as a
9340 * floating point number. This will either create a new entry in the
9341 * table if the given name does not exist, or modify the value of the
9342 * existing row with that name. Note that internally setting values
9343 * are always stored as strings, so this function converts the given
9344 * value to a string before storing it.
9345 *
9346 * @param cr The ContentResolver to access.
9347 * @param name The name of the setting to modify.
9348 * @param value The new value for the setting.
9349 * @return true if the value was set, false on database errors
9350 */
9351 public static boolean putFloat(ContentResolver cr, String name, float value) {
9352 return putString(cr, name, Float.toString(value));
9353 }
Wink Savillefb40dd42014-06-12 17:02:31 -07009354
9355
9356 /**
9357 * Subscription to be used for voice call on a multi sim device. The supported values
9358 * are 0 = SUB1, 1 = SUB2 and etc.
9359 * @hide
9360 */
9361 public static final String MULTI_SIM_VOICE_CALL_SUBSCRIPTION = "multi_sim_voice_call";
9362
9363 /**
9364 * Used to provide option to user to select subscription during dial.
9365 * The supported values are 0 = disable or 1 = enable prompt.
9366 * @hide
9367 */
9368 public static final String MULTI_SIM_VOICE_PROMPT = "multi_sim_voice_prompt";
9369
9370 /**
9371 * Subscription to be used for data call on a multi sim device. The supported values
9372 * are 0 = SUB1, 1 = SUB2 and etc.
9373 * @hide
9374 */
9375 public static final String MULTI_SIM_DATA_CALL_SUBSCRIPTION = "multi_sim_data_call";
9376
9377 /**
9378 * Subscription to be used for SMS on a multi sim device. The supported values
9379 * are 0 = SUB1, 1 = SUB2 and etc.
9380 * @hide
9381 */
9382 public static final String MULTI_SIM_SMS_SUBSCRIPTION = "multi_sim_sms";
9383
9384 /**
9385 * Used to provide option to user to select subscription during send SMS.
9386 * The value 1 - enable, 0 - disable
9387 * @hide
9388 */
9389 public static final String MULTI_SIM_SMS_PROMPT = "multi_sim_sms_prompt";
9390
9391
9392
9393 /** User preferred subscriptions setting.
9394 * This holds the details of the user selected subscription from the card and
9395 * the activation status. Each settings string have the coma separated values
9396 * iccId,appType,appId,activationStatus,3gppIndex,3gpp2Index
9397 * @hide
9398 */
9399 public static final String[] MULTI_SIM_USER_PREFERRED_SUBS = {"user_preferred_sub1",
9400 "user_preferred_sub2","user_preferred_sub3"};
Zheng Fub218ff42015-04-13 16:31:16 -07009401
9402 /**
9403 * Whether to enable new contacts aggregator or not.
9404 * The value 1 - enable, 0 - disable
9405 * @hide
9406 */
9407 public static final String NEW_CONTACT_AGGREGATOR = "new_contact_aggregator";
Zheng Fu31ce78c2015-04-15 16:57:53 -07009408
9409 /**
9410 * Whether to enable contacts metadata syncing or not
9411 * The value 1 - enable, 0 - disable
Tingting Wange0cbda42016-05-10 15:39:37 -07009412 *
9413 * @removed
Zheng Fu31ce78c2015-04-15 16:57:53 -07009414 */
Tingting Wange0cbda42016-05-10 15:39:37 -07009415 @Deprecated
Zheng Fu31ce78c2015-04-15 16:57:53 -07009416 public static final String CONTACT_METADATA_SYNC = "contact_metadata_sync";
Wei Liua1817702015-08-11 21:21:12 -07009417
9418 /**
Tingting Wange0cbda42016-05-10 15:39:37 -07009419 * Whether to enable contacts metadata syncing or not
9420 * The value 1 - enable, 0 - disable
9421 */
9422 public static final String CONTACT_METADATA_SYNC_ENABLED = "contact_metadata_sync_enabled";
9423
9424 /**
Wei Liua1817702015-08-11 21:21:12 -07009425 * Whether to enable cellular on boot.
9426 * The value 1 - enable, 0 - disable
9427 * @hide
9428 */
9429 public static final String ENABLE_CELLULAR_ON_BOOT = "enable_cellular_on_boot";
Steven Ngdc20ba62016-04-26 18:19:04 +01009430
9431 /**
Chris Wren763a9bb2016-05-31 17:14:12 -04009432 * The maximum allowed notification enqueue rate in Hertz.
9433 *
9434 * Should be a float, and includes both posts and updates.
9435 * @hide
9436 */
9437 public static final String MAX_NOTIFICATION_ENQUEUE_RATE = "max_notification_enqueue_rate";
Doris Ling628cea42016-06-09 10:35:02 -07009438
9439 /**
Chris Manton95a6c892016-03-15 13:26:11 -07009440 * Whether cell is enabled/disabled
9441 * @hide
9442 */
9443 public static final String CELL_ON = "cell_on";
Christopher Tate06efb532012-08-24 15:29:27 -07009444 }
9445
9446 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08009447 * User-defined bookmarks and shortcuts. The target of each bookmark is an
9448 * Intent URL, allowing it to be either a web page or a particular
9449 * application activity.
9450 *
9451 * @hide
9452 */
9453 public static final class Bookmarks implements BaseColumns
9454 {
9455 private static final String TAG = "Bookmarks";
9456
9457 /**
9458 * The content:// style URL for this table
9459 */
9460 public static final Uri CONTENT_URI =
9461 Uri.parse("content://" + AUTHORITY + "/bookmarks");
9462
9463 /**
9464 * The row ID.
9465 * <p>Type: INTEGER</p>
9466 */
9467 public static final String ID = "_id";
9468
9469 /**
9470 * Descriptive name of the bookmark that can be displayed to the user.
9471 * If this is empty, the title should be resolved at display time (use
9472 * {@link #getTitle(Context, Cursor)} any time you want to display the
9473 * title of a bookmark.)
9474 * <P>
9475 * Type: TEXT
9476 * </P>
9477 */
9478 public static final String TITLE = "title";
9479
9480 /**
9481 * Arbitrary string (displayed to the user) that allows bookmarks to be
9482 * organized into categories. There are some special names for
9483 * standard folders, which all start with '@'. The label displayed for
9484 * the folder changes with the locale (via {@link #getLabelForFolder}) but
9485 * the folder name does not change so you can consistently query for
9486 * the folder regardless of the current locale.
9487 *
9488 * <P>Type: TEXT</P>
9489 *
9490 */
9491 public static final String FOLDER = "folder";
9492
9493 /**
9494 * The Intent URL of the bookmark, describing what it points to. This
9495 * value is given to {@link android.content.Intent#getIntent} to create
9496 * an Intent that can be launched.
9497 * <P>Type: TEXT</P>
9498 */
9499 public static final String INTENT = "intent";
9500
9501 /**
9502 * Optional shortcut character associated with this bookmark.
9503 * <P>Type: INTEGER</P>
9504 */
9505 public static final String SHORTCUT = "shortcut";
9506
9507 /**
9508 * The order in which the bookmark should be displayed
9509 * <P>Type: INTEGER</P>
9510 */
9511 public static final String ORDERING = "ordering";
9512
9513 private static final String[] sIntentProjection = { INTENT };
9514 private static final String[] sShortcutProjection = { ID, SHORTCUT };
9515 private static final String sShortcutSelection = SHORTCUT + "=?";
9516
9517 /**
9518 * Convenience function to retrieve the bookmarked Intent for a
9519 * particular shortcut key.
9520 *
9521 * @param cr The ContentResolver to query.
9522 * @param shortcut The shortcut key.
9523 *
9524 * @return Intent The bookmarked URL, or null if there is no bookmark
9525 * matching the given shortcut.
9526 */
9527 public static Intent getIntentForShortcut(ContentResolver cr, char shortcut)
9528 {
9529 Intent intent = null;
9530
9531 Cursor c = cr.query(CONTENT_URI,
9532 sIntentProjection, sShortcutSelection,
9533 new String[] { String.valueOf((int) shortcut) }, ORDERING);
9534 // Keep trying until we find a valid shortcut
9535 try {
9536 while (intent == null && c.moveToNext()) {
9537 try {
9538 String intentURI = c.getString(c.getColumnIndexOrThrow(INTENT));
Christian Mehlmauera34d2c92010-05-25 19:04:20 +02009539 intent = Intent.parseUri(intentURI, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08009540 } catch (java.net.URISyntaxException e) {
9541 // The stored URL is bad... ignore it.
9542 } catch (IllegalArgumentException e) {
9543 // Column not found
Dianne Hackborna33e3f72009-09-29 17:28:24 -07009544 Log.w(TAG, "Intent column not found", e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08009545 }
9546 }
9547 } finally {
9548 if (c != null) c.close();
9549 }
9550
9551 return intent;
9552 }
9553
9554 /**
9555 * Add a new bookmark to the system.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07009556 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08009557 * @param cr The ContentResolver to query.
9558 * @param intent The desired target of the bookmark.
9559 * @param title Bookmark title that is shown to the user; null if none
9560 * or it should be resolved to the intent's title.
9561 * @param folder Folder in which to place the bookmark; null if none.
9562 * @param shortcut Shortcut that will invoke the bookmark; 0 if none. If
9563 * this is non-zero and there is an existing bookmark entry
9564 * with this same shortcut, then that existing shortcut is
9565 * cleared (the bookmark is not removed).
9566 * @return The unique content URL for the new bookmark entry.
9567 */
9568 public static Uri add(ContentResolver cr,
9569 Intent intent,
9570 String title,
9571 String folder,
9572 char shortcut,
9573 int ordering)
9574 {
9575 // If a shortcut is supplied, and it is already defined for
9576 // another bookmark, then remove the old definition.
9577 if (shortcut != 0) {
Jeff Hamilton7cd51ef2010-05-12 17:30:27 -05009578 cr.delete(CONTENT_URI, sShortcutSelection,
9579 new String[] { String.valueOf((int) shortcut) });
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08009580 }
9581
9582 ContentValues values = new ContentValues();
9583 if (title != null) values.put(TITLE, title);
9584 if (folder != null) values.put(FOLDER, folder);
Jean-Baptiste Queru3b9f0a32010-06-21 13:46:59 -07009585 values.put(INTENT, intent.toUri(0));
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08009586 if (shortcut != 0) values.put(SHORTCUT, (int) shortcut);
9587 values.put(ORDERING, ordering);
9588 return cr.insert(CONTENT_URI, values);
9589 }
9590
9591 /**
9592 * Return the folder name as it should be displayed to the user. This
9593 * takes care of localizing special folders.
9594 *
9595 * @param r Resources object for current locale; only need access to
9596 * system resources.
9597 * @param folder The value found in the {@link #FOLDER} column.
9598 *
9599 * @return CharSequence The label for this folder that should be shown
9600 * to the user.
9601 */
9602 public static CharSequence getLabelForFolder(Resources r, String folder) {
9603 return folder;
9604 }
9605
9606 /**
9607 * Return the title as it should be displayed to the user. This takes
9608 * care of localizing bookmarks that point to activities.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07009609 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08009610 * @param context A context.
9611 * @param cursor A cursor pointing to the row whose title should be
9612 * returned. The cursor must contain at least the {@link #TITLE}
9613 * and {@link #INTENT} columns.
9614 * @return A title that is localized and can be displayed to the user,
9615 * or the empty string if one could not be found.
9616 */
9617 public static CharSequence getTitle(Context context, Cursor cursor) {
9618 int titleColumn = cursor.getColumnIndex(TITLE);
9619 int intentColumn = cursor.getColumnIndex(INTENT);
9620 if (titleColumn == -1 || intentColumn == -1) {
9621 throw new IllegalArgumentException(
9622 "The cursor must contain the TITLE and INTENT columns.");
9623 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07009624
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08009625 String title = cursor.getString(titleColumn);
9626 if (!TextUtils.isEmpty(title)) {
9627 return title;
9628 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07009629
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08009630 String intentUri = cursor.getString(intentColumn);
9631 if (TextUtils.isEmpty(intentUri)) {
9632 return "";
9633 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07009634
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08009635 Intent intent;
9636 try {
Christian Mehlmauera34d2c92010-05-25 19:04:20 +02009637 intent = Intent.parseUri(intentUri, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08009638 } catch (URISyntaxException e) {
9639 return "";
9640 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07009641
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08009642 PackageManager packageManager = context.getPackageManager();
9643 ResolveInfo info = packageManager.resolveActivity(intent, 0);
9644 return info != null ? info.loadLabel(packageManager) : "";
9645 }
9646 }
9647
9648 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08009649 * Returns the device ID that we should use when connecting to the mobile gtalk server.
9650 * This is a string like "android-0x1242", where the hex string is the Android ID obtained
9651 * from the GoogleLoginService.
9652 *
9653 * @param androidId The Android ID for this device.
9654 * @return The device ID that should be used when connecting to the mobile gtalk server.
9655 * @hide
9656 */
9657 public static String getGTalkDeviceId(long androidId) {
9658 return "android-" + Long.toHexString(androidId);
9659 }
Billy Lau6ad2d662015-07-18 00:26:58 +01009660
Billy Laua7238a32015-08-01 12:45:02 +01009661 private static final String[] PM_WRITE_SETTINGS = {
9662 android.Manifest.permission.WRITE_SETTINGS
9663 };
9664 private static final String[] PM_CHANGE_NETWORK_STATE = {
9665 android.Manifest.permission.CHANGE_NETWORK_STATE,
9666 android.Manifest.permission.WRITE_SETTINGS
9667 };
9668 private static final String[] PM_SYSTEM_ALERT_WINDOW = {
9669 android.Manifest.permission.SYSTEM_ALERT_WINDOW
9670 };
9671
Billy Lau6ad2d662015-07-18 00:26:58 +01009672 /**
9673 * Performs a strict and comprehensive check of whether a calling package is allowed to
9674 * write/modify system settings, as the condition differs for pre-M, M+, and
9675 * privileged/preinstalled apps. If the provided uid does not match the
9676 * callingPackage, a negative result will be returned.
9677 * @hide
9678 */
9679 public static boolean isCallingPackageAllowedToWriteSettings(Context context, int uid,
9680 String callingPackage, boolean throwException) {
9681 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
9682 callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS,
Billy Laua7238a32015-08-01 12:45:02 +01009683 PM_WRITE_SETTINGS, false);
Billy Lau6ad2d662015-07-18 00:26:58 +01009684 }
9685
9686 /**
9687 * Performs a strict and comprehensive check of whether a calling package is allowed to
9688 * write/modify system settings, as the condition differs for pre-M, M+, and
9689 * privileged/preinstalled apps. If the provided uid does not match the
Billy Laua7238a32015-08-01 12:45:02 +01009690 * callingPackage, a negative result will be returned. The caller is expected to have
Lorenzo Colittid5427052015-10-15 16:29:00 +09009691 * the WRITE_SETTINGS permission declared.
Billy Lau6ad2d662015-07-18 00:26:58 +01009692 *
9693 * Note: if the check is successful, the operation of this app will be updated to the
9694 * current time.
9695 * @hide
9696 */
9697 public static boolean checkAndNoteWriteSettingsOperation(Context context, int uid,
9698 String callingPackage, boolean throwException) {
9699 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
9700 callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS,
Billy Laua7238a32015-08-01 12:45:02 +01009701 PM_WRITE_SETTINGS, true);
9702 }
9703
9704 /**
9705 * Performs a strict and comprehensive check of whether a calling package is allowed to
9706 * change the state of network, as the condition differs for pre-M, M+, and
Lorenzo Colittid5427052015-10-15 16:29:00 +09009707 * privileged/preinstalled apps. The caller is expected to have either the
9708 * CHANGE_NETWORK_STATE or the WRITE_SETTINGS permission declared. Either of these
9709 * permissions allow changing network state; WRITE_SETTINGS is a runtime permission and
9710 * can be revoked, but (except in M, excluding M MRs), CHANGE_NETWORK_STATE is a normal
9711 * permission and cannot be revoked. See http://b/23597341
Billy Laua7238a32015-08-01 12:45:02 +01009712 *
Lorenzo Colittid5427052015-10-15 16:29:00 +09009713 * Note: if the check succeeds because the application holds WRITE_SETTINGS, the operation
9714 * of this app will be updated to the current time.
Billy Laua7238a32015-08-01 12:45:02 +01009715 * @hide
9716 */
9717 public static boolean checkAndNoteChangeNetworkStateOperation(Context context, int uid,
9718 String callingPackage, boolean throwException) {
Lorenzo Colittid5427052015-10-15 16:29:00 +09009719 if (context.checkCallingOrSelfPermission(android.Manifest.permission.CHANGE_NETWORK_STATE)
9720 == PackageManager.PERMISSION_GRANTED) {
9721 return true;
9722 }
Billy Laua7238a32015-08-01 12:45:02 +01009723 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
9724 callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS,
9725 PM_CHANGE_NETWORK_STATE, true);
Billy Lau6ad2d662015-07-18 00:26:58 +01009726 }
9727
9728 /**
9729 * Performs a strict and comprehensive check of whether a calling package is allowed to
9730 * draw on top of other apps, as the conditions differs for pre-M, M+, and
9731 * privileged/preinstalled apps. If the provided uid does not match the callingPackage,
9732 * a negative result will be returned.
9733 * @hide
9734 */
9735 public static boolean isCallingPackageAllowedToDrawOverlays(Context context, int uid,
9736 String callingPackage, boolean throwException) {
9737 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
9738 callingPackage, throwException, AppOpsManager.OP_SYSTEM_ALERT_WINDOW,
Billy Laua7238a32015-08-01 12:45:02 +01009739 PM_SYSTEM_ALERT_WINDOW, false);
Billy Lau6ad2d662015-07-18 00:26:58 +01009740 }
9741
9742 /**
9743 * Performs a strict and comprehensive check of whether a calling package is allowed to
9744 * draw on top of other apps, as the conditions differs for pre-M, M+, and
9745 * privileged/preinstalled apps. If the provided uid does not match the callingPackage,
9746 * a negative result will be returned.
9747 *
9748 * Note: if the check is successful, the operation of this app will be updated to the
9749 * current time.
9750 * @hide
9751 */
9752 public static boolean checkAndNoteDrawOverlaysOperation(Context context, int uid, String
9753 callingPackage, boolean throwException) {
9754 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
9755 callingPackage, throwException, AppOpsManager.OP_SYSTEM_ALERT_WINDOW,
Billy Laua7238a32015-08-01 12:45:02 +01009756 PM_SYSTEM_ALERT_WINDOW, true);
Billy Lau6ad2d662015-07-18 00:26:58 +01009757 }
9758
9759 /**
9760 * Helper method to perform a general and comprehensive check of whether an operation that is
9761 * protected by appops can be performed by a caller or not. e.g. OP_SYSTEM_ALERT_WINDOW and
9762 * OP_WRITE_SETTINGS
9763 * @hide
9764 */
9765 public static boolean isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context context,
Billy Laua7238a32015-08-01 12:45:02 +01009766 int uid, String callingPackage, boolean throwException, int appOpsOpCode, String[]
9767 permissions, boolean makeNote) {
Billy Lau6ad2d662015-07-18 00:26:58 +01009768 if (callingPackage == null) {
9769 return false;
9770 }
9771
9772 AppOpsManager appOpsMgr = (AppOpsManager)context.getSystemService(Context.APP_OPS_SERVICE);
9773 int mode = AppOpsManager.MODE_DEFAULT;
9774 if (makeNote) {
9775 mode = appOpsMgr.noteOpNoThrow(appOpsOpCode, uid, callingPackage);
9776 } else {
9777 mode = appOpsMgr.checkOpNoThrow(appOpsOpCode, uid, callingPackage);
9778 }
9779
9780 switch (mode) {
9781 case AppOpsManager.MODE_ALLOWED:
9782 return true;
Billy Laua7238a32015-08-01 12:45:02 +01009783
Billy Lau6ad2d662015-07-18 00:26:58 +01009784 case AppOpsManager.MODE_DEFAULT:
9785 // this is the default operating mode after an app's installation
Billy Laua7238a32015-08-01 12:45:02 +01009786 // In this case we will check all associated static permission to see
9787 // if it is granted during install time.
9788 for (String permission : permissions) {
9789 if (context.checkCallingOrSelfPermission(permission) == PackageManager
9790 .PERMISSION_GRANTED) {
9791 // if either of the permissions are granted, we will allow it
9792 return true;
9793 }
Billy Lau6ad2d662015-07-18 00:26:58 +01009794 }
Billy Laua7238a32015-08-01 12:45:02 +01009795
Billy Lau6ad2d662015-07-18 00:26:58 +01009796 default:
9797 // this is for all other cases trickled down here...
9798 if (!throwException) {
9799 return false;
9800 }
9801 }
Billy Laua7238a32015-08-01 12:45:02 +01009802
9803 // prepare string to throw SecurityException
9804 StringBuilder exceptionMessage = new StringBuilder();
9805 exceptionMessage.append(callingPackage);
9806 exceptionMessage.append(" was not granted ");
9807 if (permissions.length > 1) {
9808 exceptionMessage.append(" either of these permissions: ");
9809 } else {
9810 exceptionMessage.append(" this permission: ");
9811 }
9812 for (int i = 0; i < permissions.length; i++) {
9813 exceptionMessage.append(permissions[i]);
9814 exceptionMessage.append((i == permissions.length - 1) ? "." : ", ");
9815 }
9816
9817 throw new SecurityException(exceptionMessage.toString());
Billy Lau6ad2d662015-07-18 00:26:58 +01009818 }
9819
9820 /**
9821 * Retrieves a correponding package name for a given uid. It will query all
9822 * packages that are associated with the given uid, but it will return only
9823 * the zeroth result.
9824 * Note: If package could not be found, a null is returned.
9825 * @hide
9826 */
9827 public static String getPackageNameForUid(Context context, int uid) {
9828 String[] packages = context.getPackageManager().getPackagesForUid(uid);
9829 if (packages == null) {
9830 return null;
9831 }
9832 return packages[0];
9833 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08009834}