blob: dc9a26e431b893f31e0d5feeb595a4a81271140f [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
Svetoslav Ganove080da92016-12-21 17:10:35 -080019import android.Manifest;
20import android.annotation.IntDef;
21import android.annotation.IntRange;
Svet Ganov53a441c2016-04-19 19:38:00 -070022import android.annotation.NonNull;
Svetoslav Ganove080da92016-12-21 17:10:35 -080023import android.annotation.Nullable;
24import android.annotation.RequiresPermission;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080025import android.annotation.SdkConstant;
26import android.annotation.SdkConstant.SdkConstantType;
Bryce Leecdfebd62015-02-02 08:19:11 -080027import android.annotation.SystemApi;
Jeff Sharkeya73b8fd2016-01-06 17:02:08 -070028import android.annotation.TestApi;
Svetoslav Ganove080da92016-12-21 17:10:35 -080029import android.annotation.UserIdInt;
Adrian Roos7811d9f2015-07-27 15:10:13 -070030import android.app.ActivityThread;
Billy Lau6ad2d662015-07-18 00:26:58 +010031import android.app.AppOpsManager;
Adrian Roos7811d9f2015-07-27 15:10:13 -070032import android.app.Application;
Julia Reynolds9ba0c612017-01-25 10:31:34 -050033import android.app.NotificationChannel;
Julia Reynoldsb852e562017-06-06 16:14:18 -040034import android.app.NotificationManager;
Narayan Kamathee69ff42011-06-28 12:07:18 +010035import android.app.SearchManager;
Jeff Sharkey6e2bee72012-10-01 13:39:08 -070036import android.app.WallpaperManager;
Mike LeBeau5d34e9b2010-02-10 19:34:56 -080037import android.content.ComponentName;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080038import android.content.ContentResolver;
39import android.content.ContentValues;
40import android.content.Context;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -080041import android.content.IContentProvider;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080042import android.content.Intent;
Dianne Hackbornb8b11a02010-03-10 15:53:11 -080043import android.content.pm.ActivityInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080044import android.content.pm.PackageManager;
45import android.content.pm.ResolveInfo;
46import android.content.res.Configuration;
47import android.content.res.Resources;
48import android.database.Cursor;
49import android.database.SQLException;
David Christie3f7b6522013-08-06 19:19:08 -070050import android.location.LocationManager;
Jeff Sharkey625239a2012-09-26 22:03:49 -070051import android.net.ConnectivityManager;
Jeremy Joslinc9eb3c42017-02-08 10:45:30 -080052import android.net.NetworkScoreManager;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080053import android.net.Uri;
Irfan Sheriff36f74132010-11-04 16:57:37 -070054import android.net.wifi.WifiManager;
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -070055import android.os.BatteryManager;
Chad Brubaker97bccee2017-01-05 15:51:41 -080056import android.os.Binder;
Steve McKayea93fe72016-12-02 11:35:35 -080057import android.os.Build.VERSION_CODES;
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -070058import android.os.Bundle;
Jeff Sharkey625239a2012-09-26 22:03:49 -070059import android.os.DropBoxManager;
Amith Yamasani52c489c2012-03-28 11:42:42 -070060import android.os.IBinder;
Yohei Yukawa23cbe852016-05-17 16:42:58 -070061import android.os.LocaleList;
Amith Yamasani7ab8c4a2012-04-06 09:27:12 -070062import android.os.Process;
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -070063import android.os.RemoteException;
Dianne Hackborn0ef403e2017-01-24 18:22:15 -080064import android.os.ResultReceiver;
Amith Yamasani52c489c2012-03-28 11:42:42 -070065import android.os.ServiceManager;
Dianne Hackbornf02b60a2012-08-16 10:48:27 -070066import android.os.UserHandle;
Narayan Kamath6d632962011-08-24 11:51:37 +010067import android.speech.tts.TextToSpeech;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080068import android.text.TextUtils;
69import android.util.AndroidException;
Svetoslav683914b2015-01-15 14:22:26 -080070import android.util.ArrayMap;
71import android.util.ArraySet;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080072import android.util.Log;
Svet Ganov53a441c2016-04-19 19:38:00 -070073import android.util.MemoryIntArray;
Felipe Lemea1b79bf2016-05-24 13:06:54 -070074
Svet Ganov53a441c2016-04-19 19:38:00 -070075import com.android.internal.annotations.GuardedBy;
Svetoslav683914b2015-01-15 14:22:26 -080076import com.android.internal.util.ArrayUtils;
Amith Yamasani52c489c2012-03-28 11:42:42 -070077import com.android.internal.widget.ILockSettings;
78
Svet Ganov53a441c2016-04-19 19:38:00 -070079import java.io.IOException;
Svetoslav Ganove080da92016-12-21 17:10:35 -080080import java.lang.annotation.Retention;
81import java.lang.annotation.RetentionPolicy;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080082import java.net.URISyntaxException;
Svetoslav683914b2015-01-15 14:22:26 -080083import java.text.SimpleDateFormat;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080084import java.util.HashMap;
85import java.util.HashSet;
Elliott Hughescb64d432013-08-02 10:00:44 -070086import java.util.Locale;
Svetoslav683914b2015-01-15 14:22:26 -080087import java.util.Map;
88import java.util.Set;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080089
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080090/**
91 * The Settings provider contains global system-level device preferences.
92 */
93public final class Settings {
94
95 // Intent actions for Settings
96
97 /**
98 * Activity Action: Show system settings.
99 * <p>
100 * Input: Nothing.
101 * <p>
Gilles Debunnee90bed12011-08-30 14:28:27 -0700102 * Output: Nothing.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800103 */
104 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
105 public static final String ACTION_SETTINGS = "android.settings.SETTINGS";
106
107 /**
108 * Activity Action: Show settings to allow configuration of APNs.
109 * <p>
110 * Input: Nothing.
111 * <p>
Gilles Debunnee90bed12011-08-30 14:28:27 -0700112 * Output: Nothing.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800113 */
114 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
115 public static final String ACTION_APN_SETTINGS = "android.settings.APN_SETTINGS";
116
117 /**
118 * Activity Action: Show settings to allow configuration of current location
119 * sources.
120 * <p>
121 * In some cases, a matching Activity may not exist, so ensure you
122 * safeguard against this.
123 * <p>
124 * Input: Nothing.
125 * <p>
126 * Output: Nothing.
127 */
128 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
129 public static final String ACTION_LOCATION_SOURCE_SETTINGS =
130 "android.settings.LOCATION_SOURCE_SETTINGS";
131
132 /**
Jason Monk76c67aa2016-02-19 14:49:42 -0500133 * Activity Action: Show settings to allow configuration of users.
134 * <p>
135 * In some cases, a matching Activity may not exist, so ensure you
136 * safeguard against this.
137 * <p>
138 * Input: Nothing.
139 * <p>
140 * Output: Nothing.
141 * @hide
142 */
143 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
144 public static final String ACTION_USER_SETTINGS =
145 "android.settings.USER_SETTINGS";
146
147 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800148 * Activity Action: Show settings to allow configuration of wireless controls
149 * such as Wi-Fi, Bluetooth and Mobile networks.
150 * <p>
151 * In some cases, a matching Activity may not exist, so ensure you
152 * safeguard against this.
153 * <p>
154 * Input: Nothing.
155 * <p>
156 * Output: Nothing.
157 */
158 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
159 public static final String ACTION_WIRELESS_SETTINGS =
160 "android.settings.WIRELESS_SETTINGS";
161
162 /**
Jeremy Klein15f3d212016-01-24 17:01:09 -0800163 * Activity Action: Show tether provisioning activity.
164 *
165 * <p>
166 * In some cases, a matching Activity may not exist, so ensure you
167 * safeguard against this.
168 * <p>
Dianne Hackborn0ef403e2017-01-24 18:22:15 -0800169 * Input: {@link ConnectivityManager#EXTRA_TETHER_TYPE} should be included to specify which type
170 * of tethering should be checked. {@link ConnectivityManager#EXTRA_PROVISION_CALLBACK} should
Jeremy Klein15f3d212016-01-24 17:01:09 -0800171 * contain a {@link ResultReceiver} which will be called back with a tether result code.
172 * <p>
173 * Output: The result of the provisioning check.
Dianne Hackborn0ef403e2017-01-24 18:22:15 -0800174 * {@link ConnectivityManager#TETHER_ERROR_NO_ERROR} if successful,
175 * {@link ConnectivityManager#TETHER_ERROR_PROVISION_FAILED} for failure.
Jeremy Klein15f3d212016-01-24 17:01:09 -0800176 *
177 * @hide
178 */
179 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
180 public static final String ACTION_TETHER_PROVISIONING =
181 "android.settings.TETHER_PROVISIONING_UI";
182
183 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800184 * Activity Action: Show settings to allow entering/exiting airplane mode.
185 * <p>
186 * In some cases, a matching Activity may not exist, so ensure you
187 * safeguard against this.
188 * <p>
189 * Input: Nothing.
190 * <p>
191 * Output: Nothing.
192 */
193 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
194 public static final String ACTION_AIRPLANE_MODE_SETTINGS =
195 "android.settings.AIRPLANE_MODE_SETTINGS";
196
197 /**
Malcolm Chen21062542017-06-20 11:36:01 -0700198 * Activity Action: Show mobile data usage list.
199 * <p>
200 * Input: {@link EXTRA_NETWORK_TEMPLATE} and {@link EXTRA_SUB_ID} should be included to specify
201 * how and what mobile data statistics should be collected.
202 * <p>
203 * Output: Nothing
204 * @hide
205 */
206 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
207 public static final String ACTION_MOBILE_DATA_USAGE =
208 "android.settings.MOBILE_DATA_USAGE";
209
210 /** @hide */
211 public static final String EXTRA_NETWORK_TEMPLATE = "network_template";
212 /** @hide */
213 public static final String EXTRA_SUB_ID = "sub_id";
214
215 /**
Barnaby Jamesb3006d32015-04-02 17:49:54 -0700216 * Activity Action: Modify Airplane mode settings using a voice command.
Barnaby James48f35522014-07-16 14:27:39 -0700217 * <p>
218 * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
219 * <p>
220 * This intent MUST be started using
221 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
222 * startVoiceActivity}.
223 * <p>
Barnaby Jamesb3006d32015-04-02 17:49:54 -0700224 * Note: The activity implementing this intent MUST verify that
Barnaby James48f35522014-07-16 14:27:39 -0700225 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before
226 * modifying the setting.
227 * <p>
Barnaby Jamesb3006d32015-04-02 17:49:54 -0700228 * Input: To tell which state airplane mode should be set to, add the
229 * {@link #EXTRA_AIRPLANE_MODE_ENABLED} extra to this Intent with the state specified.
230 * If the extra is not included, no changes will be made.
Barnaby James48f35522014-07-16 14:27:39 -0700231 * <p>
232 * Output: Nothing.
233 */
234 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
235 public static final String ACTION_VOICE_CONTROL_AIRPLANE_MODE =
236 "android.settings.VOICE_CONTROL_AIRPLANE_MODE";
237
238 /**
Dianne Hackborndd9b82c2009-09-03 00:18:47 -0700239 * Activity Action: Show settings for accessibility modules.
240 * <p>
241 * In some cases, a matching Activity may not exist, so ensure you
242 * safeguard against this.
243 * <p>
244 * Input: Nothing.
245 * <p>
246 * Output: Nothing.
247 */
248 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
249 public static final String ACTION_ACCESSIBILITY_SETTINGS =
250 "android.settings.ACCESSIBILITY_SETTINGS";
251
252 /**
Dianne Hackborna3fb40d2014-08-12 15:06:50 -0700253 * Activity Action: Show settings to control access to usage information.
254 * <p>
255 * In some cases, a matching Activity may not exist, so ensure you
256 * safeguard against this.
257 * <p>
258 * Input: Nothing.
259 * <p>
260 * Output: Nothing.
261 */
262 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
263 public static final String ACTION_USAGE_ACCESS_SETTINGS =
264 "android.settings.USAGE_ACCESS_SETTINGS";
265
266 /**
Jason Monk6f909782015-04-17 14:30:25 -0400267 * Activity Category: Show application settings related to usage access.
268 * <p>
269 * An activity that provides a user interface for adjusting usage access related
270 * preferences for its containing application. Optional but recommended for apps that
271 * use {@link android.Manifest.permission#PACKAGE_USAGE_STATS}.
272 * <p>
273 * The activity may define meta-data to describe what usage access is
274 * used for within their app with {@link #METADATA_USAGE_ACCESS_REASON}, which
275 * will be displayed in Settings.
276 * <p>
277 * Input: Nothing.
278 * <p>
279 * Output: Nothing.
280 */
281 @SdkConstant(SdkConstantType.INTENT_CATEGORY)
282 public static final String INTENT_CATEGORY_USAGE_ACCESS_CONFIG =
283 "android.intent.category.USAGE_ACCESS_CONFIG";
284
285 /**
286 * Metadata key: Reason for needing usage access.
287 * <p>
288 * A key for metadata attached to an activity that receives action
289 * {@link #INTENT_CATEGORY_USAGE_ACCESS_CONFIG}, shown to the
290 * user as description of how the app uses usage access.
291 * <p>
292 */
293 public static final String METADATA_USAGE_ACCESS_REASON =
294 "android.settings.metadata.USAGE_ACCESS_REASON";
295
296 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800297 * Activity Action: Show settings to allow configuration of security and
298 * location privacy.
299 * <p>
300 * In some cases, a matching Activity may not exist, so ensure you
301 * safeguard against this.
302 * <p>
303 * Input: Nothing.
304 * <p>
305 * Output: Nothing.
306 */
307 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
308 public static final String ACTION_SECURITY_SETTINGS =
309 "android.settings.SECURITY_SETTINGS";
310
311 /**
Suprabh Shukla2f34b1a2016-12-16 14:47:25 -0800312 * Activity Action: Show settings to allow configuration of trusted external sources
Suprabh Shukla905df002017-05-25 14:21:59 -0700313 *
Suprabh Shukla84d11b42017-03-07 23:40:25 -0800314 * Input: Optionally, the Intent's data URI can specify the application package name to
315 * directly invoke the management GUI specific to the package name. For example
316 * "package:com.my.app".
Suprabh Shukla2f34b1a2016-12-16 14:47:25 -0800317 * <p>
318 * Output: Nothing.
Suprabh Shukla2f34b1a2016-12-16 14:47:25 -0800319 */
320 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
Suprabh Shuklaa1300c82017-04-06 17:52:32 -0700321 public static final String ACTION_MANAGE_UNKNOWN_APP_SOURCES =
Suprabh Shukla89aae442017-04-20 16:04:26 -0700322 "android.settings.MANAGE_UNKNOWN_APP_SOURCES";
Suprabh Shukla2f34b1a2016-12-16 14:47:25 -0800323
324 /**
Maggie Benthall0469f412013-09-05 15:30:26 -0400325 * Activity Action: Show trusted credentials settings, opening to the user tab,
326 * to allow management of installed credentials.
327 * <p>
328 * In some cases, a matching Activity may not exist, so ensure you
329 * safeguard against this.
330 * <p>
331 * Input: Nothing.
332 * <p>
333 * Output: Nothing.
334 * @hide
335 */
336 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
337 public static final String ACTION_TRUSTED_CREDENTIALS_USER =
338 "com.android.settings.TRUSTED_CREDENTIALS_USER";
339
340 /**
341 * Activity Action: Show dialog explaining that an installed CA cert may enable
342 * monitoring of encrypted network traffic.
343 * <p>
344 * In some cases, a matching Activity may not exist, so ensure you
Victor Chang355d4762016-04-07 21:23:15 +0100345 * safeguard against this. Add {@link #EXTRA_NUMBER_OF_CERTIFICATES} extra to indicate the
346 * number of certificates.
Maggie Benthall0469f412013-09-05 15:30:26 -0400347 * <p>
348 * Input: Nothing.
349 * <p>
350 * Output: Nothing.
351 * @hide
352 */
353 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
354 public static final String ACTION_MONITORING_CERT_INFO =
355 "com.android.settings.MONITORING_CERT_INFO";
356
357 /**
Amith Yamasanic15255a2009-09-23 15:33:19 -0700358 * Activity Action: Show settings to allow configuration of privacy options.
359 * <p>
360 * In some cases, a matching Activity may not exist, so ensure you
361 * safeguard 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_PRIVACY_SETTINGS =
369 "android.settings.PRIVACY_SETTINGS";
370
371 /**
Robin Leea249aee2016-02-03 13:42:56 +0000372 * Activity Action: Show settings to allow configuration of VPN.
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 */
381 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
382 public static final String ACTION_VPN_SETTINGS =
383 "android.settings.VPN_SETTINGS";
384
385 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800386 * Activity Action: Show settings to allow configuration of Wi-Fi.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800387 * <p>
388 * In some cases, a matching Activity may not exist, so ensure you
389 * safeguard against this.
390 * <p>
391 * Input: Nothing.
392 * <p>
393 * Output: Nothing.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800394 */
395 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
396 public static final String ACTION_WIFI_SETTINGS =
397 "android.settings.WIFI_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700398
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800399 /**
400 * Activity Action: Show settings to allow configuration of a static IP
401 * address for Wi-Fi.
402 * <p>
403 * In some cases, a matching Activity may not exist, so ensure you safeguard
404 * against this.
405 * <p>
406 * Input: Nothing.
407 * <p>
408 * Output: Nothing.
409 */
410 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
411 public static final String ACTION_WIFI_IP_SETTINGS =
412 "android.settings.WIFI_IP_SETTINGS";
413
414 /**
415 * Activity Action: Show settings to allow configuration of Bluetooth.
416 * <p>
417 * In some cases, a matching Activity may not exist, so ensure you
418 * safeguard against this.
419 * <p>
420 * Input: Nothing.
421 * <p>
422 * Output: Nothing.
423 */
424 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
425 public static final String ACTION_BLUETOOTH_SETTINGS =
426 "android.settings.BLUETOOTH_SETTINGS";
427
428 /**
Kevin Chyn268a96c2017-06-17 17:32:49 -0700429 * Activity Action: Show settings to allow configuration of Assist Gesture.
430 * <p>
431 * In some cases, a matching Activity may not exist, so ensure you
432 * safeguard against this.
433 * <p>
434 * Input: Nothing.
435 * <p>
436 * Output: Nothing.
437 * @hide
438 */
439 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
440 public static final String ACTION_ASSIST_GESTURE_SETTINGS =
441 "android.settings.ASSIST_GESTURE_SETTINGS";
442
443 /**
Jeff Brownc05c1ae2015-05-05 13:46:30 -0700444 * Activity Action: Show settings to allow configuration of cast endpoints.
Jeff Brown1a937b02014-07-01 22:13:04 -0700445 * <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_CAST_SETTINGS =
455 "android.settings.CAST_SETTINGS";
456
457 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800458 * Activity Action: Show settings to allow configuration of date and time.
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 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
468 public static final String ACTION_DATE_SETTINGS =
469 "android.settings.DATE_SETTINGS";
470
471 /**
472 * Activity Action: Show settings to allow configuration of sound and volume.
473 * <p>
474 * In some cases, a matching Activity may not exist, so ensure you
475 * safeguard against this.
476 * <p>
477 * Input: Nothing.
478 * <p>
479 * Output: Nothing.
480 */
481 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
482 public static final String ACTION_SOUND_SETTINGS =
483 "android.settings.SOUND_SETTINGS";
484
485 /**
486 * Activity Action: Show settings to allow configuration of display.
487 * <p>
488 * In some cases, a matching Activity may not exist, so ensure you
489 * safeguard against this.
490 * <p>
491 * Input: Nothing.
492 * <p>
493 * Output: Nothing.
494 */
495 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
496 public static final String ACTION_DISPLAY_SETTINGS =
497 "android.settings.DISPLAY_SETTINGS";
498
499 /**
Justin Klaassen06c0cb72016-07-21 19:22:09 -0700500 * Activity Action: Show settings to allow configuration of Night display.
501 * <p>
502 * In some cases, a matching Activity may not exist, so ensure you
503 * safeguard against this.
504 * <p>
505 * Input: Nothing.
506 * <p>
507 * Output: Nothing.
Justin Klaassen06c0cb72016-07-21 19:22:09 -0700508 */
509 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
510 public static final String ACTION_NIGHT_DISPLAY_SETTINGS =
511 "android.settings.NIGHT_DISPLAY_SETTINGS";
512
513 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800514 * Activity Action: Show settings to allow configuration of locale.
515 * <p>
516 * In some cases, a matching Activity may not exist, so ensure you
517 * safeguard against this.
518 * <p>
519 * Input: Nothing.
520 * <p>
521 * Output: Nothing.
522 */
523 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
524 public static final String ACTION_LOCALE_SETTINGS =
525 "android.settings.LOCALE_SETTINGS";
526
527 /**
528 * Activity Action: Show settings to configure input methods, in particular
529 * allowing the user to enable input methods.
530 * <p>
531 * In some cases, a matching Activity may not exist, so ensure you
532 * safeguard against this.
533 * <p>
534 * Input: Nothing.
535 * <p>
536 * Output: Nothing.
537 */
538 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
Dianne Hackborna3fb40d2014-08-12 15:06:50 -0700539 public static final String ACTION_VOICE_INPUT_SETTINGS =
540 "android.settings.VOICE_INPUT_SETTINGS";
541
542 /**
543 * Activity Action: Show settings to configure input methods, in particular
544 * allowing the user to enable input methods.
545 * <p>
546 * In some cases, a matching Activity may not exist, so ensure you
547 * safeguard against this.
548 * <p>
549 * Input: Nothing.
550 * <p>
551 * Output: Nothing.
552 */
553 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800554 public static final String ACTION_INPUT_METHOD_SETTINGS =
555 "android.settings.INPUT_METHOD_SETTINGS";
556
557 /**
Tadashi G. Takaokaf49688f2011-01-20 17:56:13 +0900558 * Activity Action: Show settings to enable/disable input method subtypes.
satok86417ea2010-10-27 14:11:03 +0900559 * <p>
560 * In some cases, a matching Activity may not exist, so ensure you
561 * safeguard against this.
562 * <p>
Tadashi G. Takaoka25480202011-01-20 23:13:02 +0900563 * To tell which input method's subtypes are displayed in the settings, add
564 * {@link #EXTRA_INPUT_METHOD_ID} extra to this Intent with the input method id.
565 * If there is no extra in this Intent, subtypes from all installed input methods
566 * will be displayed in the settings.
567 *
568 * @see android.view.inputmethod.InputMethodInfo#getId
569 * <p>
satok86417ea2010-10-27 14:11:03 +0900570 * Input: Nothing.
571 * <p>
572 * Output: Nothing.
573 */
574 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
Tadashi G. Takaokaf49688f2011-01-20 17:56:13 +0900575 public static final String ACTION_INPUT_METHOD_SUBTYPE_SETTINGS =
576 "android.settings.INPUT_METHOD_SUBTYPE_SETTINGS";
satok86417ea2010-10-27 14:11:03 +0900577
578 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800579 * Activity Action: Show settings to manage the user input dictionary.
580 * <p>
Chet Haasee8222dd2013-09-05 07:44:18 -0700581 * Starting with {@link android.os.Build.VERSION_CODES#KITKAT},
Satoshi Kataoka2aa2bc52013-07-30 14:25:11 +0900582 * it is guaranteed there will always be an appropriate implementation for this Intent action.
583 * 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 -0800584 * <p>
585 * Input: Nothing.
586 * <p>
587 * Output: Nothing.
588 */
589 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
590 public static final String ACTION_USER_DICTIONARY_SETTINGS =
591 "android.settings.USER_DICTIONARY_SETTINGS";
592
593 /**
Abodunrinwa Toki07177142016-03-22 16:25:48 +0000594 * Activity Action: Show settings to configure the hardware keyboard.
Yohei Yukawad8701bf2016-01-27 16:15:01 -0800595 * <p>
596 * In some cases, a matching Activity may not exist, so ensure you
597 * safeguard against this.
598 * <p>
Yohei Yukawad8701bf2016-01-27 16:15:01 -0800599 * Input: Nothing.
600 * <p>
601 * Output: Nothing.
602 */
603 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
Abodunrinwa Toki07177142016-03-22 16:25:48 +0000604 public static final String ACTION_HARD_KEYBOARD_SETTINGS =
605 "android.settings.HARD_KEYBOARD_SETTINGS";
Yohei Yukawad8701bf2016-01-27 16:15:01 -0800606
607 /**
Gilles Debunnee90bed12011-08-30 14:28:27 -0700608 * Activity Action: Adds a word to the user dictionary.
609 * <p>
610 * In some cases, a matching Activity may not exist, so ensure you
611 * safeguard against this.
612 * <p>
613 * Input: An extra with key <code>word</code> that contains the word
614 * that should be added to the dictionary.
615 * <p>
616 * Output: Nothing.
617 *
618 * @hide
619 */
620 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
621 public static final String ACTION_USER_DICTIONARY_INSERT =
622 "com.android.settings.USER_DICTIONARY_INSERT";
623
624 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800625 * Activity Action: Show settings to allow configuration of application-related settings.
626 * <p>
627 * In some cases, a matching Activity may not exist, so ensure you
628 * safeguard against this.
629 * <p>
630 * Input: Nothing.
631 * <p>
632 * Output: Nothing.
633 */
634 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
635 public static final String ACTION_APPLICATION_SETTINGS =
636 "android.settings.APPLICATION_SETTINGS";
637
638 /**
639 * Activity Action: Show settings to allow configuration of application
Dianne Hackborn8d866e52012-10-10 18:39:45 -0700640 * development-related settings. As of
641 * {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1} this action is
642 * a required part of the platform.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800643 * <p>
644 * Input: Nothing.
645 * <p>
646 * Output: Nothing.
647 */
648 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
649 public static final String ACTION_APPLICATION_DEVELOPMENT_SETTINGS =
650 "android.settings.APPLICATION_DEVELOPMENT_SETTINGS";
651
652 /**
653 * Activity Action: Show settings to allow configuration of quick launch shortcuts.
654 * <p>
655 * In some cases, a matching Activity may not exist, so ensure you
656 * safeguard against this.
657 * <p>
658 * Input: Nothing.
659 * <p>
660 * Output: Nothing.
661 */
662 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
663 public static final String ACTION_QUICK_LAUNCH_SETTINGS =
664 "android.settings.QUICK_LAUNCH_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700665
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800666 /**
667 * Activity Action: Show settings to manage installed applications.
668 * <p>
669 * In some cases, a matching Activity may not exist, so ensure you
670 * safeguard against this.
671 * <p>
672 * Input: Nothing.
673 * <p>
674 * Output: Nothing.
675 */
676 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
677 public static final String ACTION_MANAGE_APPLICATIONS_SETTINGS =
678 "android.settings.MANAGE_APPLICATIONS_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700679
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800680 /**
Winson Chung44e8ff92010-09-27 14:36:52 -0700681 * Activity Action: Show settings to manage all applications.
682 * <p>
683 * In some cases, a matching Activity may not exist, so ensure you
684 * safeguard against this.
685 * <p>
686 * Input: Nothing.
687 * <p>
688 * Output: Nothing.
689 */
690 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
691 public static final String ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS =
692 "android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS";
693
694 /**
Billy Lau6ad2d662015-07-18 00:26:58 +0100695 * Activity Action: Show screen for controlling which apps can draw on top of other apps.
Billy Laucbe540f2015-06-25 01:51:44 +0100696 * <p>
697 * In some cases, a matching Activity may not exist, so ensure you
698 * safeguard against this.
699 * <p>
Billy Lau6ad2d662015-07-18 00:26:58 +0100700 * Input: Optionally, the Intent's data URI can specify the application package name to
701 * directly invoke the management GUI specific to the package name. For example
702 * "package:com.my.app".
Billy Laucbe540f2015-06-25 01:51:44 +0100703 * <p>
704 * Output: Nothing.
705 */
706 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
707 public static final String ACTION_MANAGE_OVERLAY_PERMISSION =
Billy Lau22b3f4c2015-07-08 00:31:01 +0100708 "android.settings.action.MANAGE_OVERLAY_PERMISSION";
709
710 /**
Billy Lau6ad2d662015-07-18 00:26:58 +0100711 * Activity Action: Show screen for controlling which apps are allowed to write/modify
712 * system settings.
Billy Lau22b3f4c2015-07-08 00:31:01 +0100713 * <p>
714 * In some cases, a matching Activity may not exist, so ensure you
715 * safeguard against this.
716 * <p>
Billy Lau6ad2d662015-07-18 00:26:58 +0100717 * Input: Optionally, the Intent's data URI can specify the application package name to
718 * directly invoke the management GUI specific to the package name. For example
719 * "package:com.my.app".
Billy Lau22b3f4c2015-07-08 00:31:01 +0100720 * <p>
721 * Output: Nothing.
722 */
723 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
724 public static final String ACTION_MANAGE_WRITE_SETTINGS =
725 "android.settings.action.MANAGE_WRITE_SETTINGS";
Billy Laucbe540f2015-06-25 01:51:44 +0100726
727 /**
Dianne Hackbornb7bb3b32010-06-06 22:47:50 -0700728 * Activity Action: Show screen of details about a particular application.
729 * <p>
730 * In some cases, a matching Activity may not exist, so ensure you
731 * safeguard against this.
732 * <p>
733 * Input: The Intent's data URI specifies the application package name
734 * to be shown, with the "package" scheme. That is "package:com.my.app".
735 * <p>
736 * Output: Nothing.
737 */
738 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
739 public static final String ACTION_APPLICATION_DETAILS_SETTINGS =
740 "android.settings.APPLICATION_DETAILS_SETTINGS";
741
742 /**
Dianne Hackborn83b40f62017-04-26 13:59:47 -0700743 * Activity Action: Show list of applications that have been running
744 * foreground services (to the user "running in the background").
745 * <p>
746 * Input: Extras "packages" is a string array of package names.
747 * <p>
748 * Output: Nothing.
749 * @hide
750 */
751 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
752 public static final String ACTION_FOREGROUND_SERVICES_SETTINGS =
753 "android.settings.FOREGROUND_SERVICES_SETTINGS";
754
755 /**
Jason Monk287b8892015-06-10 10:39:23 -0400756 * Activity Action: Show screen for controlling which apps can ignore battery optimizations.
757 * <p>
Dianne Hackbornc7b57b12015-08-10 14:52:52 -0700758 * Input: Nothing.
759 * <p>
760 * Output: Nothing.
761 * <p>
762 * You can use {@link android.os.PowerManager#isIgnoringBatteryOptimizations
763 * PowerManager.isIgnoringBatteryOptimizations()} to determine if an application is
764 * already ignoring optimizations. You can use
765 * {@link #ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS} to ask the user to put you
766 * on this list.
767 */
768 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
769 public static final String ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS =
770 "android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS";
771
772 /**
Felipe Leme5f5d7072016-01-27 10:41:22 -0800773 * Activity Action: Ask the user to allow an app to ignore battery optimizations (that is,
Dianne Hackbornc7b57b12015-08-10 14:52:52 -0700774 * put them on the whitelist of apps shown by
775 * {@link #ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS}). For an app to use this, it also
776 * must hold the {@link android.Manifest.permission#REQUEST_IGNORE_BATTERY_OPTIMIZATIONS}
777 * permission.
778 * <p><b>Note:</b> most applications should <em>not</em> use this; there are many facilities
779 * provided by the platform for applications to operate correctly in the various power
Felipe Leme5f5d7072016-01-27 10:41:22 -0800780 * saving modes. This is only for unusual applications that need to deeply control their own
Dianne Hackbornc7b57b12015-08-10 14:52:52 -0700781 * execution, at the potential expense of the user's battery life. Note that these applications
Kweku Adamseb80f7c2016-01-12 11:46:52 -0800782 * greatly run the risk of showing to the user as high power consumers on their device.</p>
Dianne Hackbornc7b57b12015-08-10 14:52:52 -0700783 * <p>
784 * Input: The Intent's data URI must specify the application package name
Jason Monk287b8892015-06-10 10:39:23 -0400785 * to be shown, with the "package" scheme. That is "package:com.my.app".
786 * <p>
787 * Output: Nothing.
Dianne Hackborn1958e5e2015-06-12 18:11:41 -0700788 * <p>
789 * You can use {@link android.os.PowerManager#isIgnoringBatteryOptimizations
790 * PowerManager.isIgnoringBatteryOptimizations()} to determine if an application is
791 * already ignoring optimizations.
Jason Monk287b8892015-06-10 10:39:23 -0400792 */
793 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
Dianne Hackbornc7b57b12015-08-10 14:52:52 -0700794 public static final String ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS =
795 "android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS";
Jason Monk287b8892015-06-10 10:39:23 -0400796
797 /**
Felipe Leme2850b562016-04-21 17:58:47 -0700798 * Activity Action: Show screen for controlling background data
799 * restrictions for a particular application.
Felipe Leme5f5d7072016-01-27 10:41:22 -0800800 * <p>
Felipe Leme2850b562016-04-21 17:58:47 -0700801 * Input: Intent's data URI set with an application name, using the
802 * "package" schema (like "package:com.my.app").
803 *
Felipe Leme5f5d7072016-01-27 10:41:22 -0800804 * <p>
805 * Output: Nothing.
806 * <p>
807 * Applications can also use {@link android.net.ConnectivityManager#getRestrictBackgroundStatus
Felipe Leme2850b562016-04-21 17:58:47 -0700808 * ConnectivityManager#getRestrictBackgroundStatus()} to determine the
809 * status of the background data restrictions for them.
Felipe Leme5f5d7072016-01-27 10:41:22 -0800810 */
811 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
812 public static final String ACTION_IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS =
813 "android.settings.IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS";
814
815 /**
Dianne Hackborn35654b62013-01-14 17:38:02 -0800816 * @hide
817 * Activity Action: Show the "app ops" settings screen.
818 * <p>
819 * Input: Nothing.
820 * <p>
821 * Output: Nothing.
822 */
823 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
824 public static final String ACTION_APP_OPS_SETTINGS =
825 "android.settings.APP_OPS_SETTINGS";
826
827 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800828 * Activity Action: Show settings for system update functionality.
829 * <p>
830 * In some cases, a matching Activity may not exist, so ensure you
831 * safeguard against this.
832 * <p>
833 * Input: Nothing.
834 * <p>
835 * Output: Nothing.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700836 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800837 * @hide
838 */
839 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
840 public static final String ACTION_SYSTEM_UPDATE_SETTINGS =
841 "android.settings.SYSTEM_UPDATE_SETTINGS";
842
843 /**
Ricky Wai38bb8322017-02-01 15:23:50 +0000844 * Activity Action: Show settings for managed profile settings.
845 * <p>
846 * In some cases, a matching Activity may not exist, so ensure you
847 * safeguard against this.
848 * <p>
849 * Input: Nothing.
850 * <p>
851 * Output: Nothing.
852 *
853 * @hide
854 */
855 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
856 public static final String ACTION_MANAGED_PROFILE_SETTINGS =
857 "android.settings.MANAGED_PROFILE_SETTINGS";
858
859 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800860 * Activity Action: Show settings to allow configuration of sync settings.
861 * <p>
862 * In some cases, a matching Activity may not exist, so ensure you
863 * safeguard against this.
864 * <p>
Erikeebc8e22010-02-18 13:27:19 -0800865 * The account types available to add via the add account button may be restricted by adding an
866 * {@link #EXTRA_AUTHORITIES} extra to this Intent with one or more syncable content provider's
867 * authorities. Only account types which can sync with that content provider will be offered to
868 * the user.
869 * <p>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800870 * Input: Nothing.
871 * <p>
872 * Output: Nothing.
873 */
874 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
875 public static final String ACTION_SYNC_SETTINGS =
876 "android.settings.SYNC_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700877
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800878 /**
Erikeebc8e22010-02-18 13:27:19 -0800879 * Activity Action: Show add account screen for creating a new account.
880 * <p>
881 * In some cases, a matching Activity may not exist, so ensure you
882 * safeguard against this.
883 * <p>
884 * The account types available to add may be restricted by adding an {@link #EXTRA_AUTHORITIES}
885 * extra to the Intent with one or more syncable content provider's authorities. Only account
886 * types which can sync with that content provider will be offered to the user.
887 * <p>
Alon Albert50359c22013-02-26 14:47:48 -0800888 * Account types can also be filtered by adding an {@link #EXTRA_ACCOUNT_TYPES} extra to the
889 * Intent with one or more account types.
890 * <p>
Erikeebc8e22010-02-18 13:27:19 -0800891 * Input: Nothing.
892 * <p>
893 * Output: Nothing.
894 */
895 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
896 public static final String ACTION_ADD_ACCOUNT =
897 "android.settings.ADD_ACCOUNT_SETTINGS";
898
899 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800900 * Activity Action: Show settings for selecting the network operator.
901 * <p>
902 * In some cases, a matching Activity may not exist, so ensure you
903 * safeguard against this.
904 * <p>
905 * Input: Nothing.
906 * <p>
907 * Output: Nothing.
908 */
909 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
910 public static final String ACTION_NETWORK_OPERATOR_SETTINGS =
911 "android.settings.NETWORK_OPERATOR_SETTINGS";
912
913 /**
914 * Activity Action: Show settings for selection of 2G/3G.
915 * <p>
916 * In some cases, a matching Activity may not exist, so ensure you
917 * safeguard against this.
918 * <p>
919 * Input: Nothing.
920 * <p>
921 * Output: Nothing.
922 */
923 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
924 public static final String ACTION_DATA_ROAMING_SETTINGS =
925 "android.settings.DATA_ROAMING_SETTINGS";
926
927 /**
928 * Activity Action: Show settings for internal storage.
929 * <p>
930 * In some cases, a matching Activity may not exist, so ensure you
931 * safeguard against this.
932 * <p>
933 * Input: Nothing.
934 * <p>
935 * Output: Nothing.
936 */
937 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
938 public static final String ACTION_INTERNAL_STORAGE_SETTINGS =
939 "android.settings.INTERNAL_STORAGE_SETTINGS";
940 /**
941 * Activity Action: Show settings for memory card storage.
942 * <p>
943 * In some cases, a matching Activity may not exist, so ensure you
944 * safeguard against this.
945 * <p>
946 * Input: Nothing.
947 * <p>
948 * Output: Nothing.
949 */
950 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
951 public static final String ACTION_MEMORY_CARD_SETTINGS =
952 "android.settings.MEMORY_CARD_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700953
Justin Mattsonef340352010-01-13 21:05:46 -0800954 /**
955 * Activity Action: Show settings for global search.
956 * <p>
957 * In some cases, a matching Activity may not exist, so ensure you
958 * safeguard against this.
959 * <p>
960 * Input: Nothing.
961 * <p>
962 * Output: Nothing
963 */
964 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
965 public static final String ACTION_SEARCH_SETTINGS =
966 "android.search.action.SEARCH_SETTINGS";
967
Daniel Sandler9d8b8762010-01-22 20:50:15 -0500968 /**
969 * Activity Action: Show general device information settings (serial
970 * number, software version, phone number, etc.).
971 * <p>
972 * In some cases, a matching Activity may not exist, so ensure you
973 * safeguard against this.
974 * <p>
975 * Input: Nothing.
976 * <p>
977 * Output: Nothing
978 */
979 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
980 public static final String ACTION_DEVICE_INFO_SETTINGS =
981 "android.settings.DEVICE_INFO_SETTINGS";
982
Martijn Coenen9b3c83f2011-07-28 11:21:39 -0500983 /**
Nick Pellycccf01d2011-10-31 14:49:40 -0700984 * Activity Action: Show NFC settings.
985 * <p>
986 * This shows UI that allows NFC to be turned on or off.
Martijn Coenen9b3c83f2011-07-28 11:21:39 -0500987 * <p>
988 * In some cases, a matching Activity may not exist, so ensure you
989 * safeguard against this.
990 * <p>
991 * Input: Nothing.
992 * <p>
993 * Output: Nothing
Nick Pellycccf01d2011-10-31 14:49:40 -0700994 * @see android.nfc.NfcAdapter#isEnabled()
995 */
996 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
997 public static final String ACTION_NFC_SETTINGS = "android.settings.NFC_SETTINGS";
998
999 /**
1000 * Activity Action: Show NFC Sharing settings.
1001 * <p>
1002 * This shows UI that allows NDEF Push (Android Beam) to be turned on or
1003 * off.
1004 * <p>
1005 * In some cases, a matching Activity may not exist, so ensure you
1006 * safeguard against this.
1007 * <p>
1008 * Input: Nothing.
1009 * <p>
1010 * Output: Nothing
1011 * @see android.nfc.NfcAdapter#isNdefPushEnabled()
Martijn Coenen9b3c83f2011-07-28 11:21:39 -05001012 */
1013 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1014 public static final String ACTION_NFCSHARING_SETTINGS =
1015 "android.settings.NFCSHARING_SETTINGS";
1016
Daniel Sandlerc08cd022012-11-27 22:47:37 -05001017 /**
Martijn Coenen62c196a2013-08-09 13:43:34 -07001018 * Activity Action: Show NFC Tap & Pay settings
1019 * <p>
1020 * This shows UI that allows the user to configure Tap&Pay
1021 * settings.
1022 * <p>
1023 * In some cases, a matching Activity may not exist, so ensure you
1024 * safeguard against this.
1025 * <p>
1026 * Input: Nothing.
1027 * <p>
1028 * Output: Nothing
1029 */
1030 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1031 public static final String ACTION_NFC_PAYMENT_SETTINGS =
1032 "android.settings.NFC_PAYMENT_SETTINGS";
1033
1034 /**
Daniel Sandlerc08cd022012-11-27 22:47:37 -05001035 * Activity Action: Show Daydream settings.
1036 * <p>
1037 * In some cases, a matching Activity may not exist, so ensure you
1038 * safeguard against this.
1039 * <p>
1040 * Input: Nothing.
1041 * <p>
1042 * Output: Nothing.
1043 * @see android.service.dreams.DreamService
Daniel Sandlerc08cd022012-11-27 22:47:37 -05001044 */
1045 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1046 public static final String ACTION_DREAM_SETTINGS = "android.settings.DREAM_SETTINGS";
1047
Daniel Sandler5feceeb2013-03-22 18:29:23 -07001048 /**
1049 * Activity Action: Show Notification listener settings.
1050 * <p>
1051 * In some cases, a matching Activity may not exist, so ensure you
1052 * safeguard against this.
1053 * <p>
1054 * Input: Nothing.
1055 * <p>
1056 * Output: Nothing.
1057 * @see android.service.notification.NotificationListenerService
Daniel Sandler5feceeb2013-03-22 18:29:23 -07001058 */
1059 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1060 public static final String ACTION_NOTIFICATION_LISTENER_SETTINGS
Chris Wren8326a8a2014-10-22 14:13:32 -04001061 = "android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS";
Daniel Sandler5feceeb2013-03-22 18:29:23 -07001062
Alan Viverette69ce69b2013-08-29 12:23:48 -07001063 /**
John Spurlock80774932015-05-07 17:38:50 -04001064 * Activity Action: Show Do Not Disturb access settings.
1065 * <p>
John Spurlock7c74f782015-06-04 13:01:42 -04001066 * Users can grant and deny access to Do Not Disturb configuration from here.
1067 * See {@link android.app.NotificationManager#isNotificationPolicyAccessGranted()} for more
1068 * details.
John Spurlock80774932015-05-07 17:38:50 -04001069 * <p>
1070 * Input: Nothing.
1071 * <p>
1072 * Output: Nothing.
1073 */
1074 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
John Spurlock7c74f782015-06-04 13:01:42 -04001075 public static final String ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS
1076 = "android.settings.NOTIFICATION_POLICY_ACCESS_SETTINGS";
John Spurlock80774932015-05-07 17:38:50 -04001077
1078 /**
John Spurlock7340fc82014-04-24 18:50:12 -04001079 * @hide
1080 */
1081 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1082 public static final String ACTION_CONDITION_PROVIDER_SETTINGS
1083 = "android.settings.ACTION_CONDITION_PROVIDER_SETTINGS";
1084
1085 /**
Alan Viverette69ce69b2013-08-29 12:23:48 -07001086 * Activity Action: Show settings for video captioning.
1087 * <p>
1088 * In some cases, a matching Activity may not exist, so ensure you safeguard
1089 * against this.
1090 * <p>
1091 * Input: Nothing.
1092 * <p>
1093 * Output: Nothing.
1094 */
1095 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1096 public static final String ACTION_CAPTIONING_SETTINGS = "android.settings.CAPTIONING_SETTINGS";
1097
Svetoslav773f54d2013-09-03 14:01:43 -07001098 /**
1099 * Activity Action: Show the top level print settings.
1100 * <p>
1101 * In some cases, a matching Activity may not exist, so ensure you
1102 * safeguard against this.
1103 * <p>
1104 * Input: Nothing.
1105 * <p>
1106 * Output: Nothing.
1107 */
1108 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1109 public static final String ACTION_PRINT_SETTINGS =
1110 "android.settings.ACTION_PRINT_SETTINGS";
1111
John Spurlockde547002014-02-28 17:50:39 -05001112 /**
1113 * Activity Action: Show Zen Mode configuration settings.
1114 *
1115 * @hide
1116 */
1117 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1118 public static final String ACTION_ZEN_MODE_SETTINGS = "android.settings.ZEN_MODE_SETTINGS";
1119
Santos Cordona4c75242014-07-09 12:07:51 -07001120 /**
Julia Reynoldsa11d0b12017-02-16 15:01:36 -05001121 * Activity Action: Show Zen Mode (aka Do Not Disturb) priority configuration settings.
John Spurlockfc746f82015-04-03 13:47:14 -04001122 */
1123 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1124 public static final String ACTION_ZEN_MODE_PRIORITY_SETTINGS
1125 = "android.settings.ZEN_MODE_PRIORITY_SETTINGS";
1126
1127 /**
John Spurlock7af10182015-04-03 15:10:31 -04001128 * Activity Action: Show Zen Mode automation configuration settings.
1129 *
1130 * @hide
1131 */
1132 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1133 public static final String ACTION_ZEN_MODE_AUTOMATION_SETTINGS
1134 = "android.settings.ZEN_MODE_AUTOMATION_SETTINGS";
1135
1136 /**
Barnaby Jamesb3006d32015-04-02 17:49:54 -07001137 * Activity Action: Modify do not disturb mode settings.
1138 * <p>
1139 * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
1140 * <p>
1141 * This intent MUST be started using
1142 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
1143 * startVoiceActivity}.
1144 * <p>
1145 * Note: The Activity implementing this intent MUST verify that
1146 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction}.
1147 * returns true before modifying the setting.
1148 * <p>
1149 * Input: The optional {@link #EXTRA_DO_NOT_DISTURB_MODE_MINUTES} extra can be used to indicate
1150 * how long the user wishes to avoid interruptions for. The optional
1151 * {@link #EXTRA_DO_NOT_DISTURB_MODE_ENABLED} extra can be to indicate if the user is
1152 * enabling or disabling do not disturb mode. If either extra is not included, the
1153 * user maybe asked to provide the value.
1154 * <p>
1155 * Output: Nothing.
1156 */
1157 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1158 public static final String ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE =
1159 "android.settings.VOICE_CONTROL_DO_NOT_DISTURB_MODE";
1160
1161 /**
John Spurlockb2278d62015-04-07 12:47:12 -04001162 * Activity Action: Show Zen Mode schedule rule configuration settings.
1163 *
1164 * @hide
1165 */
1166 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1167 public static final String ACTION_ZEN_MODE_SCHEDULE_RULE_SETTINGS
1168 = "android.settings.ZEN_MODE_SCHEDULE_RULE_SETTINGS";
1169
1170 /**
John Spurlockd60258f2015-04-30 09:30:52 -04001171 * Activity Action: Show Zen Mode event rule configuration settings.
1172 *
1173 * @hide
1174 */
1175 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1176 public static final String ACTION_ZEN_MODE_EVENT_RULE_SETTINGS
1177 = "android.settings.ZEN_MODE_EVENT_RULE_SETTINGS";
1178
1179 /**
John Spurlock39581cc2015-04-10 11:59:01 -04001180 * Activity Action: Show Zen Mode external rule configuration settings.
1181 *
1182 * @hide
1183 */
1184 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1185 public static final String ACTION_ZEN_MODE_EXTERNAL_RULE_SETTINGS
1186 = "android.settings.ZEN_MODE_EXTERNAL_RULE_SETTINGS";
1187
1188 /**
Santos Cordona4c75242014-07-09 12:07:51 -07001189 * Activity Action: Show the regulatory information screen for the device.
1190 * <p>
1191 * In some cases, a matching Activity may not exist, so ensure you safeguard
1192 * against this.
1193 * <p>
1194 * Input: Nothing.
1195 * <p>
1196 * Output: Nothing.
1197 */
Jeff Sharkeydd77fda2014-04-16 17:23:08 -07001198 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1199 public static final String
1200 ACTION_SHOW_REGULATORY_INFO = "android.settings.SHOW_REGULATORY_INFO";
1201
Jerome Poichet7974cb32014-05-14 12:04:43 -07001202 /**
1203 * Activity Action: Show Device Name Settings.
1204 * <p>
1205 * In some cases, a matching Activity may not exist, so ensure you safeguard
Tim Kilbourn87cd0dc2014-04-14 15:37:51 -07001206 * against this.
Jerome Poichet7974cb32014-05-14 12:04:43 -07001207 *
1208 * @hide
1209 */
1210 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1211 public static final String DEVICE_NAME_SETTINGS = "android.settings.DEVICE_NAME";
1212
Tim Kilbourn87cd0dc2014-04-14 15:37:51 -07001213 /**
1214 * Activity Action: Show pairing settings.
1215 * <p>
1216 * In some cases, a matching Activity may not exist, so ensure you safeguard
1217 * against this.
1218 *
1219 * @hide
1220 */
1221 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1222 public static final String ACTION_PAIRING_SETTINGS = "android.settings.PAIRING_SETTINGS";
1223
John Spurlockf8f524c2014-06-10 14:47:29 -04001224 /**
1225 * Activity Action: Show battery saver settings.
John Spurlock73466662014-10-30 13:42:05 -04001226 * <p>
1227 * In some cases, a matching Activity may not exist, so ensure you safeguard
1228 * against this.
John Spurlockf8f524c2014-06-10 14:47:29 -04001229 */
1230 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1231 public static final String ACTION_BATTERY_SAVER_SETTINGS
1232 = "android.settings.BATTERY_SAVER_SETTINGS";
1233
Amith Yamasanieb7b94a2014-07-14 18:02:08 -07001234 /**
Barnaby Jamesb3006d32015-04-02 17:49:54 -07001235 * Activity Action: Modify Battery Saver mode setting using a voice command.
1236 * <p>
1237 * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
1238 * <p>
1239 * This intent MUST be started using
1240 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
1241 * startVoiceActivity}.
1242 * <p>
1243 * Note: The activity implementing this intent MUST verify that
1244 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before
1245 * modifying the setting.
1246 * <p>
1247 * Input: To tell which state batter saver mode should be set to, add the
1248 * {@link #EXTRA_BATTERY_SAVER_MODE_ENABLED} extra to this Intent with the state specified.
1249 * If the extra is not included, no changes will be made.
1250 * <p>
1251 * Output: Nothing.
1252 */
1253 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1254 public static final String ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE =
1255 "android.settings.VOICE_CONTROL_BATTERY_SAVER_MODE";
1256
1257 /**
Amith Yamasanieb7b94a2014-07-14 18:02:08 -07001258 * Activity Action: Show Home selection settings. If there are multiple activities
1259 * that can satisfy the {@link Intent#CATEGORY_HOME} intent, this screen allows you
1260 * to pick your preferred activity.
1261 */
1262 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1263 public static final String ACTION_HOME_SETTINGS
1264 = "android.settings.HOME_SETTINGS";
1265
Julia Reynolds7eba5932015-12-11 16:40:39 -05001266 /**
1267 * Activity Action: Show Default apps settings.
1268 * <p>
1269 * In some cases, a matching Activity may not exist, so ensure you
1270 * safeguard against this.
1271 * <p>
1272 * Input: Nothing.
1273 * <p>
1274 * Output: Nothing.
1275 */
1276 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1277 public static final String ACTION_MANAGE_DEFAULT_APPS_SETTINGS
1278 = "android.settings.MANAGE_DEFAULT_APPS_SETTINGS";
1279
John Spurlock2b0e09c2014-07-27 13:27:47 -04001280 /**
1281 * Activity Action: Show notification settings.
1282 *
1283 * @hide
1284 */
1285 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1286 public static final String ACTION_NOTIFICATION_SETTINGS
1287 = "android.settings.NOTIFICATION_SETTINGS";
1288
1289 /**
1290 * Activity Action: Show notification settings for a single app.
Jeff Schumacherdc530092017-01-25 18:51:22 -08001291 * <p>
1292 * Input: {@link #EXTRA_APP_PACKAGE}, the package containing the channel to display.
1293 * Input: Optionally, {@link #EXTRA_CHANNEL_ID}, to highlight that channel.
1294 * <p>
1295 * Output: Nothing.
John Spurlock2b0e09c2014-07-27 13:27:47 -04001296 */
1297 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1298 public static final String ACTION_APP_NOTIFICATION_SETTINGS
1299 = "android.settings.APP_NOTIFICATION_SETTINGS";
1300
Chris Wrencd8f4f72014-08-27 18:48:13 -04001301 /**
Julia Reynolds9ba0c612017-01-25 10:31:34 -05001302 * Activity Action: Show notification settings for a single {@link NotificationChannel}.
1303 * <p>
Julia Reynolds9ba0c612017-01-25 10:31:34 -05001304 * Input: {@link #EXTRA_APP_PACKAGE}, the package containing the channel to display.
1305 * Input: {@link #EXTRA_CHANNEL_ID}, the id of the channel to display.
1306 * <p>
1307 * Output: Nothing.
1308 */
1309 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1310 public static final String ACTION_CHANNEL_NOTIFICATION_SETTINGS
1311 = "android.settings.CHANNEL_NOTIFICATION_SETTINGS";
1312
1313 /**
1314 * Activity Extra: The package owner of the notification channel settings to display.
1315 * <p>
1316 * This must be passed as an extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}.
1317 */
1318 public static final String EXTRA_APP_PACKAGE = "android.provider.extra.APP_PACKAGE";
1319
1320 /**
1321 * Activity Extra: The {@link NotificationChannel#getId()} of the notification channel settings
1322 * to display.
1323 * <p>
1324 * This must be passed as an extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}.
1325 */
1326 public static final String EXTRA_CHANNEL_ID = "android.provider.extra.CHANNEL_ID";
1327
1328 /**
Chris Wrencd8f4f72014-08-27 18:48:13 -04001329 * Activity Action: Show notification redaction settings.
1330 *
1331 * @hide
1332 */
1333 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1334 public static final String ACTION_APP_NOTIFICATION_REDACTION
1335 = "android.settings.ACTION_APP_NOTIFICATION_REDACTION";
1336
John Spurlock2b0e09c2014-07-27 13:27:47 -04001337 /** @hide */ public static final String EXTRA_APP_UID = "app_uid";
John Spurlock2b0e09c2014-07-27 13:27:47 -04001338
Sudheer Shanka410e6bd2015-12-31 15:29:50 +00001339 /**
1340 * Activity Action: Show a dialog with disabled by policy message.
1341 * <p> If an user action is disabled by policy, this dialog can be triggered to let
1342 * the user know about this.
1343 * <p>
1344 * Input: Nothing.
1345 * <p>
1346 * Output: Nothing.
Sudheer Shankaaebd5dd2016-02-18 12:37:14 +00001347 *
1348 * @hide
Sudheer Shanka410e6bd2015-12-31 15:29:50 +00001349 */
1350 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1351 public static final String ACTION_SHOW_ADMIN_SUPPORT_DETAILS
1352 = "android.settings.SHOW_ADMIN_SUPPORT_DETAILS";
1353
Michal Karpinskiba244092016-02-25 17:28:24 +00001354 /**
1355 * Activity Action: Show a dialog for remote bugreport flow.
1356 * <p>
1357 * Input: Nothing.
1358 * <p>
1359 * Output: Nothing.
1360 *
1361 * @hide
1362 */
1363 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1364 public static final String ACTION_SHOW_REMOTE_BUGREPORT_DIALOG
1365 = "android.settings.SHOW_REMOTE_BUGREPORT_DIALOG";
1366
Ruben Brunke24b9a62016-02-16 21:38:24 -08001367 /**
1368 * Activity Action: Show VR listener settings.
1369 * <p>
1370 * Input: Nothing.
1371 * <p>
1372 * Output: Nothing.
1373 *
1374 * @see android.service.vr.VrListenerService
1375 */
1376 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1377 public static final String ACTION_VR_LISTENER_SETTINGS
1378 = "android.settings.VR_LISTENER_SETTINGS";
1379
Jason Monk42d01212016-05-03 14:16:56 -04001380 /**
Winson Chung59fda9e2017-01-20 16:14:51 -08001381 * Activity Action: Show Picture-in-picture settings.
1382 * <p>
1383 * Input: Nothing.
1384 * <p>
1385 * Output: Nothing.
1386 *
1387 * @hide
1388 */
1389 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1390 public static final String ACTION_PICTURE_IN_PICTURE_SETTINGS
1391 = "android.settings.PICTURE_IN_PICTURE_SETTINGS";
1392
1393 /**
Daniel Nishie58d2a72016-09-20 16:42:19 -07001394 * Activity Action: Show Storage Manager settings.
1395 * <p>
1396 * Input: Nothing.
1397 * <p>
1398 * Output: Nothing.
1399 *
1400 * @hide
1401 */
1402 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1403 public static final String ACTION_STORAGE_MANAGER_SETTINGS
1404 = "android.settings.STORAGE_MANAGER_SETTINGS";
1405
1406 /**
Jason Monk42d01212016-05-03 14:16:56 -04001407 * Activity Action: Allows user to select current webview implementation.
1408 * <p>
1409 * Input: Nothing.
1410 * <p>
1411 * Output: Nothing.
1412 */
1413 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1414 public static final String ACTION_WEBVIEW_SETTINGS = "android.settings.WEBVIEW_SETTINGS";
1415
Bartosz Fabianowski46bea2e2016-12-06 01:20:29 +01001416 /**
1417 * Activity Action: Show enterprise privacy section.
1418 * <p>
1419 * Input: Nothing.
1420 * <p>
1421 * Output: Nothing.
1422 * @hide
1423 */
1424 @SystemApi
1425 @TestApi
1426 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1427 public static final String ACTION_ENTERPRISE_PRIVACY_SETTINGS
1428 = "android.settings.ENTERPRISE_PRIVACY_SETTINGS";
1429
Felipe Lemedb041182017-04-21 17:33:38 -07001430 /**
1431 * Activity Action: Show screen that let user select its Autofill Service.
1432 * <p>
1433 * Input: Intent's data URI set with an application name, using the
1434 * "package" schema (like "package:com.my.app").
1435 *
1436 * <p>
1437 * Output: {@link android.app.Activity#RESULT_OK} if user selected an Autofill Service belonging
1438 * to the caller package.
1439 *
1440 * <p>
Ricardo Looaec98da2017-07-01 11:19:03 -07001441 * <b>NOTE: </b> Applications should call
Felipe Lemedb041182017-04-21 17:33:38 -07001442 * {@link android.view.autofill.AutofillManager#hasEnabledAutofillServices()} and
Ricardo Looaec98da2017-07-01 11:19:03 -07001443 * {@link android.view.autofill.AutofillManager#isAutofillSupported()}, and only use this action
1444 * to start an activity if they return {@code false} and {@code true} respectively.
Felipe Lemedb041182017-04-21 17:33:38 -07001445 */
1446 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1447 public static final String ACTION_REQUEST_SET_AUTOFILL_SERVICE =
1448 "android.settings.REQUEST_SET_AUTOFILL_SERVICE";
1449
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001450 // End of Intent actions for Settings
1451
Erikeebc8e22010-02-18 13:27:19 -08001452 /**
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001453 * @hide - Private call() method on SettingsProvider to read from 'system' table.
1454 */
1455 public static final String CALL_METHOD_GET_SYSTEM = "GET_system";
1456
1457 /**
1458 * @hide - Private call() method on SettingsProvider to read from 'secure' table.
1459 */
1460 public static final String CALL_METHOD_GET_SECURE = "GET_secure";
1461
1462 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001463 * @hide - Private call() method on SettingsProvider to read from 'global' table.
1464 */
1465 public static final String CALL_METHOD_GET_GLOBAL = "GET_global";
1466
1467 /**
Svet Ganov53a441c2016-04-19 19:38:00 -07001468 * @hide - Specifies that the caller of the fast-path call()-based flow tracks
1469 * the settings generation in order to cache values locally. If this key is
1470 * mapped to a <code>null</code> string extra in the request bundle, the response
1471 * bundle will contain the same key mapped to a parcelable extra which would be
1472 * an {@link android.util.MemoryIntArray}. The response will also contain an
1473 * integer mapped to the {@link #CALL_METHOD_GENERATION_INDEX_KEY} which is the
1474 * index in the array clients should use to lookup the generation. For efficiency
1475 * the caller should request the generation tracking memory array only if it
1476 * doesn't already have it.
1477 *
1478 * @see #CALL_METHOD_GENERATION_INDEX_KEY
1479 */
1480 public static final String CALL_METHOD_TRACK_GENERATION_KEY = "_track_generation";
1481
1482 /**
1483 * @hide Key with the location in the {@link android.util.MemoryIntArray} where
Svetoslav Ganov8c35dcc2016-06-17 15:27:43 -07001484 * to look up the generation id of the backing table. The value is an integer.
Svet Ganov53a441c2016-04-19 19:38:00 -07001485 *
1486 * @see #CALL_METHOD_TRACK_GENERATION_KEY
1487 */
1488 public static final String CALL_METHOD_GENERATION_INDEX_KEY = "_generation_index";
1489
1490 /**
Svetoslav Ganov8c35dcc2016-06-17 15:27:43 -07001491 * @hide Key with the settings table generation. The value is an integer.
1492 *
1493 * @see #CALL_METHOD_TRACK_GENERATION_KEY
1494 */
1495 public static final String CALL_METHOD_GENERATION_KEY = "_generation";
1496
1497 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001498 * @hide - User handle argument extra to the fast-path call()-based requests
1499 */
1500 public static final String CALL_METHOD_USER_KEY = "_user";
1501
Svetoslav Ganove080da92016-12-21 17:10:35 -08001502 /**
1503 * @hide - Boolean argument extra to the fast-path call()-based requests
1504 */
1505 public static final String CALL_METHOD_MAKE_DEFAULT_KEY = "_make_default";
1506
1507 /**
1508 * @hide - User handle argument extra to the fast-path call()-based requests
1509 */
1510 public static final String CALL_METHOD_RESET_MODE_KEY = "_reset_mode";
1511
1512 /**
1513 * @hide - String argument extra to the fast-path call()-based requests
1514 */
1515 public static final String CALL_METHOD_TAG_KEY = "_tag";
1516
Christopher Tate06efb532012-08-24 15:29:27 -07001517 /** @hide - Private call() method to write to 'system' table */
1518 public static final String CALL_METHOD_PUT_SYSTEM = "PUT_system";
1519
1520 /** @hide - Private call() method to write to 'secure' table */
1521 public static final String CALL_METHOD_PUT_SECURE = "PUT_secure";
1522
1523 /** @hide - Private call() method to write to 'global' table */
1524 public static final String CALL_METHOD_PUT_GLOBAL= "PUT_global";
1525
Svetoslav Ganove080da92016-12-21 17:10:35 -08001526 /** @hide - Private call() method to reset to defaults the 'global' table */
1527 public static final String CALL_METHOD_RESET_GLOBAL = "RESET_global";
1528
1529 /** @hide - Private call() method to reset to defaults the 'secure' table */
1530 public static final String CALL_METHOD_RESET_SECURE = "RESET_secure";
1531
Christopher Tate06efb532012-08-24 15:29:27 -07001532 /**
Erikeebc8e22010-02-18 13:27:19 -08001533 * Activity Extra: Limit available options in launched activity based on the given authority.
1534 * <p>
1535 * This can be passed as an extra field in an Activity Intent with one or more syncable content
1536 * provider's authorities as a String[]. This field is used by some intents to alter the
1537 * behavior of the called activity.
1538 * <p>
1539 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types available based
1540 * on the authority given.
1541 */
Alon Albert50359c22013-02-26 14:47:48 -08001542 public static final String EXTRA_AUTHORITIES = "authorities";
1543
Alon Albertd35bf1f2013-04-18 14:26:51 -07001544 /**
1545 * Activity Extra: Limit available options in launched activity based on the given account
1546 * types.
1547 * <p>
1548 * This can be passed as an extra field in an Activity Intent with one or more account types
1549 * as a String[]. This field is used by some intents to alter the behavior of the called
1550 * activity.
1551 * <p>
1552 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types to the specified
1553 * list.
1554 */
Alon Albert50359c22013-02-26 14:47:48 -08001555 public static final String EXTRA_ACCOUNT_TYPES = "account_types";
Erikeebc8e22010-02-18 13:27:19 -08001556
Tadashi G. Takaoka25480202011-01-20 23:13:02 +09001557 public static final String EXTRA_INPUT_METHOD_ID = "input_method_id";
1558
Barnaby James48f35522014-07-16 14:27:39 -07001559 /**
Michael Wrightc93fbd12014-09-22 20:07:59 -07001560 * Activity Extra: The device identifier to act upon.
1561 * <p>
1562 * This can be passed as an extra field in an Activity Intent with a single
1563 * InputDeviceIdentifier. This field is used by some activities to jump straight into the
1564 * settings for the given device.
1565 * <p>
Dianne Hackbornad6a99b2014-11-18 10:11:10 -08001566 * Example: The {@link #ACTION_INPUT_METHOD_SETTINGS} intent opens the keyboard layout
1567 * dialog for the given device.
Michael Wrightc93fbd12014-09-22 20:07:59 -07001568 * @hide
1569 */
1570 public static final String EXTRA_INPUT_DEVICE_IDENTIFIER = "input_device_identifier";
1571
1572 /**
Barnaby James48f35522014-07-16 14:27:39 -07001573 * Activity Extra: Enable or disable Airplane Mode.
1574 * <p>
1575 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_AIRPLANE_MODE}
Barnaby Jamesb3006d32015-04-02 17:49:54 -07001576 * intent as a boolean to indicate if it should be enabled.
Barnaby James48f35522014-07-16 14:27:39 -07001577 */
1578 public static final String EXTRA_AIRPLANE_MODE_ENABLED = "airplane_mode_enabled";
1579
Barnaby Jamesb3006d32015-04-02 17:49:54 -07001580 /**
1581 * Activity Extra: Enable or disable Battery saver mode.
1582 * <p>
1583 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE}
1584 * intent as a boolean to indicate if it should be enabled.
1585 */
1586 public static final String EXTRA_BATTERY_SAVER_MODE_ENABLED =
1587 "android.settings.extra.battery_saver_mode_enabled";
1588
1589 /**
1590 * Activity Extra: Enable or disable Do Not Disturb mode.
1591 * <p>
1592 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE}
1593 * intent as a boolean to indicate if it should be enabled.
1594 */
1595 public static final String EXTRA_DO_NOT_DISTURB_MODE_ENABLED =
1596 "android.settings.extra.do_not_disturb_mode_enabled";
1597
1598 /**
1599 * Activity Extra: How many minutes to enable do not disturb mode for.
1600 * <p>
1601 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE}
1602 * intent to indicate how long do not disturb mode should be enabled for.
1603 */
1604 public static final String EXTRA_DO_NOT_DISTURB_MODE_MINUTES =
1605 "android.settings.extra.do_not_disturb_mode_minutes";
1606
Victor Chang355d4762016-04-07 21:23:15 +01001607 /**
Svetoslav Ganove080da92016-12-21 17:10:35 -08001608 * Reset mode: reset to defaults only settings changed by the
1609 * calling package. If there is a default set the setting
1610 * will be set to it, otherwise the setting will be deleted.
1611 * This is the only type of reset available to non-system clients.
1612 * @hide
1613 */
1614 public static final int RESET_MODE_PACKAGE_DEFAULTS = 1;
1615
1616 /**
1617 * Reset mode: reset all settings set by untrusted packages, which is
1618 * packages that aren't a part of the system, to the current defaults.
1619 * If there is a default set the setting will be set to it, otherwise
1620 * the setting will be deleted. This mode is only available to the system.
1621 * @hide
1622 */
1623 public static final int RESET_MODE_UNTRUSTED_DEFAULTS = 2;
1624
1625 /**
1626 * Reset mode: delete all settings set by untrusted packages, which is
1627 * packages that aren't a part of the system. If a setting is set by an
1628 * untrusted package it will be deleted if its default is not provided
1629 * by the system, otherwise the setting will be set to its default.
1630 * This mode is only available to the system.
1631 * @hide
1632 */
1633 public static final int RESET_MODE_UNTRUSTED_CHANGES = 3;
1634
1635 /**
1636 * Reset mode: reset all settings to defaults specified by trusted
1637 * packages, which is packages that are a part of the system, and
1638 * delete all settings set by untrusted packages. If a setting has
1639 * a default set by a system package it will be set to the default,
1640 * otherwise the setting will be deleted. This mode is only available
1641 * to the system.
1642 * @hide
1643 */
1644 public static final int RESET_MODE_TRUSTED_DEFAULTS = 4;
1645
1646 /** @hide */
1647 @Retention(RetentionPolicy.SOURCE)
1648 @IntDef({
1649 RESET_MODE_PACKAGE_DEFAULTS,
1650 RESET_MODE_UNTRUSTED_DEFAULTS,
1651 RESET_MODE_UNTRUSTED_CHANGES,
1652 RESET_MODE_TRUSTED_DEFAULTS
1653 })
1654 public @interface ResetMode{}
1655
1656 /**
Victor Chang355d4762016-04-07 21:23:15 +01001657 * Activity Extra: Number of certificates
1658 * <p>
1659 * This can be passed as an extra field to the {@link #ACTION_MONITORING_CERT_INFO}
1660 * intent to indicate the number of certificates
1661 * @hide
1662 */
1663 public static final String EXTRA_NUMBER_OF_CERTIFICATES =
1664 "android.settings.extra.number_of_certificates";
1665
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001666 private static final String JID_RESOURCE_PREFIX = "android";
1667
1668 public static final String AUTHORITY = "settings";
1669
1670 private static final String TAG = "Settings";
Christopher Tate06efb532012-08-24 15:29:27 -07001671 private static final boolean LOCAL_LOGV = false;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001672
David Christie3f7b6522013-08-06 19:19:08 -07001673 // Lock ensures that when enabling/disabling the master location switch, we don't end up
1674 // with a partial enable/disable state in multi-threaded situations.
1675 private static final Object mLocationSettingsLock = new Object();
1676
Chad Brubaker97bccee2017-01-05 15:51:41 -08001677 // Used in system server calling uid workaround in call()
1678 private static boolean sInSystemServer = false;
1679 private static final Object sInSystemServerLock = new Object();
1680
1681 /** @hide */
1682 public static void setInSystemServer() {
1683 synchronized (sInSystemServerLock) {
1684 sInSystemServer = true;
1685 }
1686 }
1687
1688 /** @hide */
1689 public static boolean isInSystemServer() {
1690 synchronized (sInSystemServerLock) {
1691 return sInSystemServer;
1692 }
1693 }
1694
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001695 public static class SettingNotFoundException extends AndroidException {
1696 public SettingNotFoundException(String msg) {
1697 super(msg);
1698 }
1699 }
1700
1701 /**
1702 * Common base for tables of name/value settings.
1703 */
1704 public static class NameValueTable implements BaseColumns {
1705 public static final String NAME = "name";
1706 public static final String VALUE = "value";
1707
1708 protected static boolean putString(ContentResolver resolver, Uri uri,
1709 String name, String value) {
1710 // The database will take care of replacing duplicates.
1711 try {
1712 ContentValues values = new ContentValues();
1713 values.put(NAME, name);
1714 values.put(VALUE, value);
1715 resolver.insert(uri, values);
1716 return true;
1717 } catch (SQLException e) {
Dianne Hackborna33e3f72009-09-29 17:28:24 -07001718 Log.w(TAG, "Can't set key " + name + " in " + uri, e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001719 return false;
1720 }
1721 }
1722
1723 public static Uri getUriFor(Uri uri, String name) {
1724 return Uri.withAppendedPath(uri, name);
1725 }
1726 }
1727
Svet Ganov53a441c2016-04-19 19:38:00 -07001728 private static final class GenerationTracker {
1729 private final MemoryIntArray mArray;
Svetoslav Ganov04df7382016-05-10 18:55:47 -07001730 private final Runnable mErrorHandler;
Svet Ganov53a441c2016-04-19 19:38:00 -07001731 private final int mIndex;
1732 private int mCurrentGeneration;
1733
Svetoslav Ganov04df7382016-05-10 18:55:47 -07001734 public GenerationTracker(@NonNull MemoryIntArray array, int index,
Svetoslav Ganov8c35dcc2016-06-17 15:27:43 -07001735 int generation, Runnable errorHandler) {
Svet Ganov53a441c2016-04-19 19:38:00 -07001736 mArray = array;
1737 mIndex = index;
Svetoslav Ganov04df7382016-05-10 18:55:47 -07001738 mErrorHandler = errorHandler;
Svetoslav Ganov8c35dcc2016-06-17 15:27:43 -07001739 mCurrentGeneration = generation;
Svet Ganov53a441c2016-04-19 19:38:00 -07001740 }
1741
1742 public boolean isGenerationChanged() {
1743 final int currentGeneration = readCurrentGeneration();
1744 if (currentGeneration >= 0) {
1745 if (currentGeneration == mCurrentGeneration) {
1746 return false;
1747 }
1748 mCurrentGeneration = currentGeneration;
1749 }
1750 return true;
1751 }
1752
1753 private int readCurrentGeneration() {
1754 try {
1755 return mArray.get(mIndex);
1756 } catch (IOException e) {
1757 Log.e(TAG, "Error getting current generation", e);
Svetoslav Ganov04df7382016-05-10 18:55:47 -07001758 if (mErrorHandler != null) {
1759 mErrorHandler.run();
1760 }
Svet Ganov53a441c2016-04-19 19:38:00 -07001761 }
1762 return -1;
1763 }
Svetoslav Ganov04df7382016-05-10 18:55:47 -07001764
1765 public void destroy() {
1766 try {
1767 mArray.close();
1768 } catch (IOException e) {
1769 Log.e(TAG, "Error closing backing array", e);
1770 if (mErrorHandler != null) {
1771 mErrorHandler.run();
1772 }
1773 }
1774 }
Svet Ganov53a441c2016-04-19 19:38:00 -07001775 }
1776
Svetoslav Ganove080da92016-12-21 17:10:35 -08001777 private static final class ContentProviderHolder {
1778 private final Object mLock = new Object();
1779
1780 @GuardedBy("mLock")
1781 private final Uri mUri;
1782 @GuardedBy("mLock")
1783 private IContentProvider mContentProvider;
1784
1785 public ContentProviderHolder(Uri uri) {
1786 mUri = uri;
1787 }
1788
1789 public IContentProvider getProvider(ContentResolver contentResolver) {
1790 synchronized (mLock) {
1791 if (mContentProvider == null) {
1792 mContentProvider = contentResolver
1793 .acquireProvider(mUri.getAuthority());
1794 }
1795 return mContentProvider;
1796 }
1797 }
Sudheer Shankaaa3c30d2017-05-23 15:19:10 -07001798
1799 public void clearProviderForTest() {
1800 synchronized (mLock) {
1801 mContentProvider = null;
1802 }
1803 }
Svetoslav Ganove080da92016-12-21 17:10:35 -08001804 }
1805
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001806 // Thread-safe.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001807 private static class NameValueCache {
Svet Ganov53a441c2016-04-19 19:38:00 -07001808 private static final boolean DEBUG = false;
1809
Steve McKayea93fe72016-12-02 11:35:35 -08001810 private static final String[] SELECT_VALUE_PROJECTION = new String[] {
1811 Settings.NameValueTable.VALUE
1812 };
Svetoslav Ganove080da92016-12-21 17:10:35 -08001813
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001814 private static final String NAME_EQ_PLACEHOLDER = "name=?";
1815
1816 // Must synchronize on 'this' to access mValues and mValuesVersion.
Steve McKayea93fe72016-12-02 11:35:35 -08001817 private final HashMap<String, String> mValues = new HashMap<>();
Dan Egnor799f7212009-11-24 16:24:44 -08001818
Svetoslav Ganove080da92016-12-21 17:10:35 -08001819 private final Uri mUri;
1820 private final ContentProviderHolder mProviderHolder;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001821
1822 // The method we'll call (or null, to not use) on the provider
1823 // for the fast path of retrieving settings.
Christopher Tate06efb532012-08-24 15:29:27 -07001824 private final String mCallGetCommand;
1825 private final String mCallSetCommand;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001826
Svet Ganov53a441c2016-04-19 19:38:00 -07001827 @GuardedBy("this")
1828 private GenerationTracker mGenerationTracker;
1829
Svetoslav Ganove080da92016-12-21 17:10:35 -08001830 public NameValueCache(Uri uri, String getCommand, String setCommand,
1831 ContentProviderHolder providerHolder) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001832 mUri = uri;
Christopher Tate06efb532012-08-24 15:29:27 -07001833 mCallGetCommand = getCommand;
1834 mCallSetCommand = setCommand;
Svetoslav Ganove080da92016-12-21 17:10:35 -08001835 mProviderHolder = providerHolder;
Christopher Tate06efb532012-08-24 15:29:27 -07001836 }
1837
1838 public boolean putStringForUser(ContentResolver cr, String name, String value,
Svetoslav Ganove080da92016-12-21 17:10:35 -08001839 String tag, boolean makeDefault, final int userHandle) {
Christopher Tate06efb532012-08-24 15:29:27 -07001840 try {
1841 Bundle arg = new Bundle();
1842 arg.putString(Settings.NameValueTable.VALUE, value);
Christopher Tated5fe1472012-09-10 15:48:38 -07001843 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
Svetoslav Ganove080da92016-12-21 17:10:35 -08001844 if (tag != null) {
1845 arg.putString(CALL_METHOD_TAG_KEY, tag);
1846 }
1847 if (makeDefault) {
1848 arg.putBoolean(CALL_METHOD_MAKE_DEFAULT_KEY, true);
1849 }
1850 IContentProvider cp = mProviderHolder.getProvider(cr);
Dianne Hackborn35654b62013-01-14 17:38:02 -08001851 cp.call(cr.getPackageName(), mCallSetCommand, name, arg);
Christopher Tate06efb532012-08-24 15:29:27 -07001852 } catch (RemoteException e) {
1853 Log.w(TAG, "Can't set key " + name + " in " + mUri, e);
1854 return false;
1855 }
1856 return true;
1857 }
1858
Christopher Tate06efb532012-08-24 15:29:27 -07001859 public String getStringForUser(ContentResolver cr, String name, final int userHandle) {
Christopher Tate78d2a662012-09-13 16:19:44 -07001860 final boolean isSelf = (userHandle == UserHandle.myUserId());
1861 if (isSelf) {
Svet Ganov51b83952016-07-06 12:16:53 -07001862 synchronized (NameValueCache.this) {
Svet Ganov53a441c2016-04-19 19:38:00 -07001863 if (mGenerationTracker != null) {
1864 if (mGenerationTracker.isGenerationChanged()) {
1865 if (DEBUG) {
1866 Log.i(TAG, "Generation changed for type:"
1867 + mUri.getPath() + " in package:"
1868 + cr.getPackageName() +" and user:" + userHandle);
1869 }
1870 mValues.clear();
1871 } else if (mValues.containsKey(name)) {
1872 return mValues.get(name);
Christopher Tate78d2a662012-09-13 16:19:44 -07001873 }
Christopher Tate78d2a662012-09-13 16:19:44 -07001874 }
Dan Egnor799f7212009-11-24 16:24:44 -08001875 }
Christopher Tate78d2a662012-09-13 16:19:44 -07001876 } else {
1877 if (LOCAL_LOGV) Log.v(TAG, "get setting for user " + userHandle
1878 + " by user " + UserHandle.myUserId() + " so skipping cache");
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001879 }
Dan Egnor799f7212009-11-24 16:24:44 -08001880
Svetoslav Ganove080da92016-12-21 17:10:35 -08001881 IContentProvider cp = mProviderHolder.getProvider(cr);
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001882
1883 // Try the fast path first, not using query(). If this
1884 // fails (alternate Settings provider that doesn't support
1885 // this interface?) then we fall back to the query/table
1886 // interface.
Christopher Tate06efb532012-08-24 15:29:27 -07001887 if (mCallGetCommand != null) {
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001888 try {
Christopher Tate06efb532012-08-24 15:29:27 -07001889 Bundle args = null;
Christopher Tate5e08af02012-09-21 17:17:22 -07001890 if (!isSelf) {
Christopher Tate06efb532012-08-24 15:29:27 -07001891 args = new Bundle();
1892 args.putInt(CALL_METHOD_USER_KEY, userHandle);
1893 }
Svet Ganov53a441c2016-04-19 19:38:00 -07001894 boolean needsGenerationTracker = false;
Svet Ganov51b83952016-07-06 12:16:53 -07001895 synchronized (NameValueCache.this) {
Svet Ganov53a441c2016-04-19 19:38:00 -07001896 if (isSelf && mGenerationTracker == null) {
1897 needsGenerationTracker = true;
1898 if (args == null) {
1899 args = new Bundle();
1900 }
1901 args.putString(CALL_METHOD_TRACK_GENERATION_KEY, null);
1902 if (DEBUG) {
1903 Log.i(TAG, "Requested generation tracker for type: "+ mUri.getPath()
1904 + " in package:" + cr.getPackageName() +" and user:"
1905 + userHandle);
1906 }
1907 }
1908 }
Chad Brubaker97bccee2017-01-05 15:51:41 -08001909 Bundle b;
1910 // If we're in system server and in a binder transaction we need to clear the
1911 // calling uid. This works around code in system server that did not call
1912 // clearCallingIdentity, previously this wasn't needed because reading settings
1913 // did not do permission checking but thats no longer the case.
1914 // Long term this should be removed and callers should properly call
1915 // clearCallingIdentity or use a ContentResolver from the caller as needed.
1916 if (Settings.isInSystemServer() && Binder.getCallingUid() != Process.myUid()) {
1917 final long token = Binder.clearCallingIdentity();
1918 try {
1919 b = cp.call(cr.getPackageName(), mCallGetCommand, name, args);
1920 } finally {
1921 Binder.restoreCallingIdentity(token);
1922 }
1923 } else {
1924 b = cp.call(cr.getPackageName(), mCallGetCommand, name, args);
1925 }
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001926 if (b != null) {
Svet Ganov53a441c2016-04-19 19:38:00 -07001927 String value = b.getString(Settings.NameValueTable.VALUE);
Christopher Tate78d2a662012-09-13 16:19:44 -07001928 // Don't update our cache for reads of other users' data
1929 if (isSelf) {
Svet Ganov51b83952016-07-06 12:16:53 -07001930 synchronized (NameValueCache.this) {
Svet Ganov53a441c2016-04-19 19:38:00 -07001931 if (needsGenerationTracker) {
1932 MemoryIntArray array = b.getParcelable(
1933 CALL_METHOD_TRACK_GENERATION_KEY);
1934 final int index = b.getInt(
1935 CALL_METHOD_GENERATION_INDEX_KEY, -1);
1936 if (array != null && index >= 0) {
Svetoslav Ganov8c35dcc2016-06-17 15:27:43 -07001937 final int generation = b.getInt(
1938 CALL_METHOD_GENERATION_KEY, 0);
Svet Ganov53a441c2016-04-19 19:38:00 -07001939 if (DEBUG) {
1940 Log.i(TAG, "Received generation tracker for type:"
1941 + mUri.getPath() + " in package:"
1942 + cr.getPackageName() + " and user:"
1943 + userHandle + " with index:" + index);
1944 }
Svet Ganov9d723d32016-08-27 11:05:56 -07001945 if (mGenerationTracker != null) {
1946 mGenerationTracker.destroy();
1947 }
Svetoslav Ganov04df7382016-05-10 18:55:47 -07001948 mGenerationTracker = new GenerationTracker(array, index,
Svetoslav Ganov8c35dcc2016-06-17 15:27:43 -07001949 generation, () -> {
Svet Ganov51b83952016-07-06 12:16:53 -07001950 synchronized (NameValueCache.this) {
Svetoslav Ganov04df7382016-05-10 18:55:47 -07001951 Log.e(TAG, "Error accessing generation"
1952 + " tracker - removing");
1953 if (mGenerationTracker != null) {
1954 GenerationTracker generationTracker =
1955 mGenerationTracker;
1956 mGenerationTracker = null;
1957 generationTracker.destroy();
1958 mValues.clear();
1959 }
1960 }
1961 });
Svet Ganov53a441c2016-04-19 19:38:00 -07001962 }
1963 }
Christopher Tate78d2a662012-09-13 16:19:44 -07001964 mValues.put(name, value);
1965 }
1966 } else {
1967 if (LOCAL_LOGV) Log.i(TAG, "call-query of user " + userHandle
1968 + " by " + UserHandle.myUserId()
1969 + " so not updating cache");
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001970 }
1971 return value;
1972 }
1973 // If the response Bundle is null, we fall through
1974 // to the query interface below.
1975 } catch (RemoteException e) {
1976 // Not supported by the remote side? Fall through
1977 // to query().
1978 }
1979 }
1980
Dan Egnor799f7212009-11-24 16:24:44 -08001981 Cursor c = null;
1982 try {
Steve McKayea93fe72016-12-02 11:35:35 -08001983 Bundle queryArgs = ContentResolver.createSqlQueryBundle(
1984 NAME_EQ_PLACEHOLDER, new String[]{name}, null);
Chad Brubaker97bccee2017-01-05 15:51:41 -08001985 // Same workaround as above.
1986 if (Settings.isInSystemServer() && Binder.getCallingUid() != Process.myUid()) {
1987 final long token = Binder.clearCallingIdentity();
1988 try {
1989 c = cp.query(cr.getPackageName(), mUri, SELECT_VALUE_PROJECTION, queryArgs,
1990 null);
1991 } finally {
1992 Binder.restoreCallingIdentity(token);
1993 }
1994 } else {
1995 c = cp.query(cr.getPackageName(), mUri, SELECT_VALUE_PROJECTION, queryArgs,
1996 null);
1997 }
Dan Egnor799f7212009-11-24 16:24:44 -08001998 if (c == null) {
1999 Log.w(TAG, "Can't get key " + name + " from " + mUri);
2000 return null;
2001 }
2002
2003 String value = c.moveToNext() ? c.getString(0) : null;
Svet Ganov51b83952016-07-06 12:16:53 -07002004 synchronized (NameValueCache.this) {
Dan Egnor799f7212009-11-24 16:24:44 -08002005 mValues.put(name, value);
2006 }
2007 if (LOCAL_LOGV) {
2008 Log.v(TAG, "cache miss [" + mUri.getLastPathSegment() + "]: " +
2009 name + " = " + (value == null ? "(null)" : value));
2010 }
2011 return value;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08002012 } catch (RemoteException e) {
Dan Egnor799f7212009-11-24 16:24:44 -08002013 Log.w(TAG, "Can't get key " + name + " from " + mUri, e);
2014 return null; // Return null, but don't cache it.
2015 } finally {
2016 if (c != null) c.close();
2017 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002018 }
Sudheer Shankaaa3c30d2017-05-23 15:19:10 -07002019
2020 public void clearGenerationTrackerForTest() {
2021 synchronized (NameValueCache.this) {
2022 if (mGenerationTracker != null) {
2023 mGenerationTracker.destroy();
2024 }
2025 mValues.clear();
2026 mGenerationTracker = null;
2027 }
2028 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002029 }
2030
2031 /**
Trevor Johns682c24e2016-04-12 10:13:47 -07002032 * Checks if the specified context can draw on top of other apps. As of API
2033 * level 23, an app cannot draw on top of other apps unless it declares the
2034 * {@link android.Manifest.permission#SYSTEM_ALERT_WINDOW} permission in its
2035 * manifest, <em>and</em> the user specifically grants the app this
2036 * capability. To prompt the user to grant this approval, the app must send an
2037 * intent with the action
2038 * {@link android.provider.Settings#ACTION_MANAGE_OVERLAY_PERMISSION}, which
2039 * causes the system to display a permission management screen.
Billy Lau6ad2d662015-07-18 00:26:58 +01002040 *
Trevor Johns682c24e2016-04-12 10:13:47 -07002041 * @param context App context.
2042 * @return true if the specified context can draw on top of other apps, false otherwise
Billy Lau6ad2d662015-07-18 00:26:58 +01002043 */
2044 public static boolean canDrawOverlays(Context context) {
Svet Ganov94ba40172016-04-03 22:04:22 -07002045 return Settings.isCallingPackageAllowedToDrawOverlays(context, Process.myUid(),
2046 context.getOpPackageName(), false);
Billy Lau6ad2d662015-07-18 00:26:58 +01002047 }
2048
2049 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002050 * System settings, containing miscellaneous system preferences. This
2051 * table holds simple name/value pairs. There are convenience
2052 * functions for accessing individual settings entries.
2053 */
2054 public static final class System extends NameValueTable {
Alan Viverette04fd67c2016-04-12 10:54:04 -04002055 private static final float DEFAULT_FONT_SCALE = 1.0f;
2056
Svetoslav683914b2015-01-15 14:22:26 -08002057 /** @hide */
2058 public static interface Validator {
2059 public boolean validate(String value);
2060 }
2061
Dianne Hackborn139748f2012-09-24 11:36:57 -07002062 /**
2063 * The content:// style URL for this table
2064 */
2065 public static final Uri CONTENT_URI =
2066 Uri.parse("content://" + AUTHORITY + "/system");
2067
Svetoslav Ganove080da92016-12-21 17:10:35 -08002068 private static final ContentProviderHolder sProviderHolder =
2069 new ContentProviderHolder(CONTENT_URI);
2070
Dianne Hackborn139748f2012-09-24 11:36:57 -07002071 private static final NameValueCache sNameValueCache = new NameValueCache(
Dianne Hackborn139748f2012-09-24 11:36:57 -07002072 CONTENT_URI,
2073 CALL_METHOD_GET_SYSTEM,
Svetoslav Ganove080da92016-12-21 17:10:35 -08002074 CALL_METHOD_PUT_SYSTEM,
2075 sProviderHolder);
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002076
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002077 private static final HashSet<String> MOVED_TO_SECURE;
2078 static {
Steve McKayea93fe72016-12-02 11:35:35 -08002079 MOVED_TO_SECURE = new HashSet<>(30);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002080 MOVED_TO_SECURE.add(Secure.ANDROID_ID);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002081 MOVED_TO_SECURE.add(Secure.HTTP_PROXY);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002082 MOVED_TO_SECURE.add(Secure.LOCATION_PROVIDERS_ALLOWED);
Danielle Millett925a7d82012-03-19 18:02:20 -04002083 MOVED_TO_SECURE.add(Secure.LOCK_BIOMETRIC_WEAK_FLAGS);
Amith Yamasani156c4352010-03-05 17:10:03 -08002084 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_ENABLED);
2085 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_VISIBLE);
2086 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002087 MOVED_TO_SECURE.add(Secure.LOGGING_ID);
2088 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_ENABLED);
2089 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_LAST_UPDATE);
2090 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_REDIRECT_URL);
2091 MOVED_TO_SECURE.add(Secure.SETTINGS_CLASSNAME);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002092 MOVED_TO_SECURE.add(Secure.USE_GOOGLE_MAIL);
2093 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
2094 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
2095 MOVED_TO_SECURE.add(Secure.WIFI_NUM_OPEN_NETWORKS_KEPT);
2096 MOVED_TO_SECURE.add(Secure.WIFI_ON);
2097 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE);
2098 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_AP_COUNT);
2099 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS);
2100 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED);
2101 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS);
2102 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT);
2103 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_MAX_AP_CHECKS);
2104 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ON);
2105 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_COUNT);
2106 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_DELAY_MS);
2107 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS);
Christopher Tateaa036a22014-05-19 16:33:27 -07002108
2109 // At one time in System, then Global, but now back in Secure
2110 MOVED_TO_SECURE.add(Secure.INSTALL_NON_MARKET_APPS);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002111 }
2112
Christopher Tate06efb532012-08-24 15:29:27 -07002113 private static final HashSet<String> MOVED_TO_GLOBAL;
Christopher Tate66488d62012-10-02 11:58:01 -07002114 private static final HashSet<String> MOVED_TO_SECURE_THEN_GLOBAL;
Christopher Tate06efb532012-08-24 15:29:27 -07002115 static {
Steve McKayea93fe72016-12-02 11:35:35 -08002116 MOVED_TO_GLOBAL = new HashSet<>();
2117 MOVED_TO_SECURE_THEN_GLOBAL = new HashSet<>();
Christopher Tate66488d62012-10-02 11:58:01 -07002118
Christopher Tate92198742012-09-07 12:00:13 -07002119 // these were originally in system but migrated to secure in the past,
2120 // so are duplicated in the Secure.* namespace
Christopher Tate66488d62012-10-02 11:58:01 -07002121 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.ADB_ENABLED);
2122 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.BLUETOOTH_ON);
2123 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DATA_ROAMING);
2124 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DEVICE_PROVISIONED);
Christopher Tate66488d62012-10-02 11:58:01 -07002125 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.USB_MASS_STORAGE_ENABLED);
2126 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.HTTP_PROXY);
Christopher Tate06efb532012-08-24 15:29:27 -07002127
Christopher Tate92198742012-09-07 12:00:13 -07002128 // these are moving directly from system to global
Christopher Tate06efb532012-08-24 15:29:27 -07002129 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_ON);
2130 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_RADIOS);
2131 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS);
2132 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME);
2133 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME_ZONE);
2134 MOVED_TO_GLOBAL.add(Settings.Global.CAR_DOCK_SOUND);
2135 MOVED_TO_GLOBAL.add(Settings.Global.CAR_UNDOCK_SOUND);
2136 MOVED_TO_GLOBAL.add(Settings.Global.DESK_DOCK_SOUND);
2137 MOVED_TO_GLOBAL.add(Settings.Global.DESK_UNDOCK_SOUND);
2138 MOVED_TO_GLOBAL.add(Settings.Global.DOCK_SOUNDS_ENABLED);
2139 MOVED_TO_GLOBAL.add(Settings.Global.LOCK_SOUND);
2140 MOVED_TO_GLOBAL.add(Settings.Global.UNLOCK_SOUND);
2141 MOVED_TO_GLOBAL.add(Settings.Global.LOW_BATTERY_SOUND);
2142 MOVED_TO_GLOBAL.add(Settings.Global.POWER_SOUNDS_ENABLED);
2143 MOVED_TO_GLOBAL.add(Settings.Global.STAY_ON_WHILE_PLUGGED_IN);
2144 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SLEEP_POLICY);
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07002145 MOVED_TO_GLOBAL.add(Settings.Global.MODE_RINGER);
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002146 MOVED_TO_GLOBAL.add(Settings.Global.WINDOW_ANIMATION_SCALE);
2147 MOVED_TO_GLOBAL.add(Settings.Global.TRANSITION_ANIMATION_SCALE);
2148 MOVED_TO_GLOBAL.add(Settings.Global.ANIMATOR_DURATION_SCALE);
2149 MOVED_TO_GLOBAL.add(Settings.Global.FANCY_IME_ANIMATIONS);
2150 MOVED_TO_GLOBAL.add(Settings.Global.COMPATIBILITY_MODE);
2151 MOVED_TO_GLOBAL.add(Settings.Global.EMERGENCY_TONE);
2152 MOVED_TO_GLOBAL.add(Settings.Global.CALL_AUTO_RETRY);
2153 MOVED_TO_GLOBAL.add(Settings.Global.DEBUG_APP);
2154 MOVED_TO_GLOBAL.add(Settings.Global.WAIT_FOR_DEBUGGER);
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002155 MOVED_TO_GLOBAL.add(Settings.Global.ALWAYS_FINISH_ACTIVITIES);
Geremy Condraa0735112013-03-26 21:49:26 -07002156 MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_CONTENT_URL);
2157 MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_METADATA_URL);
2158 MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_CONTENT_URL);
2159 MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_METADATA_URL);
2160 MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_CONTENT_URL);
2161 MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_METADATA_URL);
2162 MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_CONTENT_URL);
2163 MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_METADATA_URL);
Christopher Tate06efb532012-08-24 15:29:27 -07002164 }
2165
Svetoslav683914b2015-01-15 14:22:26 -08002166 private static final Validator sBooleanValidator =
2167 new DiscreteValueValidator(new String[] {"0", "1"});
2168
2169 private static final Validator sNonNegativeIntegerValidator = new Validator() {
2170 @Override
2171 public boolean validate(String value) {
2172 try {
2173 return Integer.parseInt(value) >= 0;
2174 } catch (NumberFormatException e) {
2175 return false;
2176 }
2177 }
2178 };
2179
Svetoslav683914b2015-01-15 14:22:26 -08002180 private static final Validator sUriValidator = new Validator() {
2181 @Override
2182 public boolean validate(String value) {
2183 try {
2184 Uri.decode(value);
2185 return true;
2186 } catch (IllegalArgumentException e) {
2187 return false;
2188 }
2189 }
2190 };
2191
2192 private static final Validator sLenientIpAddressValidator = new Validator() {
2193 private static final int MAX_IPV6_LENGTH = 45;
2194
2195 @Override
2196 public boolean validate(String value) {
2197 return value.length() <= MAX_IPV6_LENGTH;
2198 }
2199 };
2200
Christopher Tate66488d62012-10-02 11:58:01 -07002201 /** @hide */
Svetoslav683914b2015-01-15 14:22:26 -08002202 public static void getMovedToGlobalSettings(Set<String> outKeySet) {
Christopher Tate66488d62012-10-02 11:58:01 -07002203 outKeySet.addAll(MOVED_TO_GLOBAL);
2204 outKeySet.addAll(MOVED_TO_SECURE_THEN_GLOBAL);
2205 }
2206
2207 /** @hide */
Svetoslav683914b2015-01-15 14:22:26 -08002208 public static void getMovedToSecureSettings(Set<String> outKeySet) {
2209 outKeySet.addAll(MOVED_TO_SECURE);
2210 }
2211
2212 /** @hide */
Christopher Tate66488d62012-10-02 11:58:01 -07002213 public static void getNonLegacyMovedKeys(HashSet<String> outKeySet) {
2214 outKeySet.addAll(MOVED_TO_GLOBAL);
2215 }
2216
Sudheer Shankaaa3c30d2017-05-23 15:19:10 -07002217 /** @hide */
2218 public static void clearProviderForTest() {
2219 sProviderHolder.clearProviderForTest();
2220 sNameValueCache.clearGenerationTrackerForTest();
2221 }
2222
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002223 /**
2224 * Look up a name in the database.
2225 * @param resolver to access the database with
2226 * @param name to look up in the table
2227 * @return the corresponding value, or null if not present
2228 */
Dianne Hackborn139748f2012-09-24 11:36:57 -07002229 public static String getString(ContentResolver resolver, String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07002230 return getStringForUser(resolver, name, UserHandle.myUserId());
2231 }
2232
2233 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -07002234 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -07002235 int userHandle) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002236 if (MOVED_TO_SECURE.contains(name)) {
2237 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
2238 + " to android.provider.Settings.Secure, returning read-only value.");
Christopher Tate06efb532012-08-24 15:29:27 -07002239 return Secure.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002240 }
Christopher Tate66488d62012-10-02 11:58:01 -07002241 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07002242 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
2243 + " to android.provider.Settings.Global, returning read-only value.");
2244 return Global.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002245 }
Christopher Tate06efb532012-08-24 15:29:27 -07002246 return sNameValueCache.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002247 }
2248
2249 /**
2250 * Store a name/value pair into the database.
2251 * @param resolver to access the database with
2252 * @param name to store
2253 * @param value to associate with the name
2254 * @return true if the value was set, false on database errors
2255 */
2256 public static boolean putString(ContentResolver resolver, String name, String value) {
Christopher Tate06efb532012-08-24 15:29:27 -07002257 return putStringForUser(resolver, name, value, UserHandle.myUserId());
2258 }
2259
2260 /** @hide */
2261 public static boolean putStringForUser(ContentResolver resolver, String name, String value,
2262 int userHandle) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002263 if (MOVED_TO_SECURE.contains(name)) {
2264 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
2265 + " to android.provider.Settings.Secure, value is unchanged.");
2266 return false;
2267 }
Christopher Tate66488d62012-10-02 11:58:01 -07002268 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07002269 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
2270 + " to android.provider.Settings.Global, value is unchanged.");
2271 return false;
2272 }
Svetoslav Ganove080da92016-12-21 17:10:35 -08002273 return sNameValueCache.putStringForUser(resolver, name, value, null, false, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002274 }
2275
2276 /**
2277 * Construct the content URI for a particular name/value pair,
2278 * useful for monitoring changes with a ContentObserver.
2279 * @param name to look up in the table
2280 * @return the corresponding content URI, or null if not present
2281 */
2282 public static Uri getUriFor(String name) {
2283 if (MOVED_TO_SECURE.contains(name)) {
2284 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
2285 + " to android.provider.Settings.Secure, returning Secure URI.");
2286 return Secure.getUriFor(Secure.CONTENT_URI, name);
2287 }
Christopher Tate66488d62012-10-02 11:58:01 -07002288 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07002289 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
2290 + " to android.provider.Settings.Global, returning read-only global URI.");
2291 return Global.getUriFor(Global.CONTENT_URI, name);
2292 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002293 return getUriFor(CONTENT_URI, name);
2294 }
2295
2296 /**
2297 * Convenience function for retrieving a single system settings value
2298 * as an integer. Note that internally setting values are always
2299 * stored as strings; this function converts the string to an integer
2300 * for you. The default value will be returned if the setting is
2301 * not defined or not an integer.
2302 *
2303 * @param cr The ContentResolver to access.
2304 * @param name The name of the setting to retrieve.
2305 * @param def Value to return if the setting is not defined.
2306 *
2307 * @return The setting's current value, or 'def' if it is not defined
2308 * or not a valid integer.
2309 */
2310 public static int getInt(ContentResolver cr, String name, int def) {
Christopher Tate06efb532012-08-24 15:29:27 -07002311 return getIntForUser(cr, name, def, UserHandle.myUserId());
2312 }
2313
2314 /** @hide */
2315 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
2316 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002317 try {
2318 return v != null ? Integer.parseInt(v) : def;
2319 } catch (NumberFormatException e) {
2320 return def;
2321 }
2322 }
2323
2324 /**
2325 * Convenience function for retrieving a single system settings value
2326 * as an integer. Note that internally setting values are always
2327 * stored as strings; this function converts the string to an integer
2328 * for you.
2329 * <p>
2330 * This version does not take a default value. If the setting has not
2331 * been set, or the string value is not a number,
2332 * it throws {@link SettingNotFoundException}.
2333 *
2334 * @param cr The ContentResolver to access.
2335 * @param name The name of the setting to retrieve.
2336 *
2337 * @throws SettingNotFoundException Thrown if a setting by the given
2338 * name can't be found or the setting value is not an integer.
2339 *
2340 * @return The setting's current value.
2341 */
2342 public static int getInt(ContentResolver cr, String name)
2343 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07002344 return getIntForUser(cr, name, UserHandle.myUserId());
2345 }
2346
2347 /** @hide */
2348 public static int getIntForUser(ContentResolver cr, String name, int userHandle)
2349 throws SettingNotFoundException {
2350 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002351 try {
2352 return Integer.parseInt(v);
2353 } catch (NumberFormatException e) {
2354 throw new SettingNotFoundException(name);
2355 }
2356 }
2357
2358 /**
2359 * Convenience function for updating a single settings value as an
2360 * integer. This will either create a new entry in the table if the
2361 * given name does not exist, or modify the value of the existing row
2362 * with that name. Note that internally setting values are always
2363 * stored as strings, so this function converts the given value to a
2364 * string before storing it.
2365 *
2366 * @param cr The ContentResolver to access.
2367 * @param name The name of the setting to modify.
2368 * @param value The new value for the setting.
2369 * @return true if the value was set, false on database errors
2370 */
2371 public static boolean putInt(ContentResolver cr, String name, int value) {
Christopher Tate06efb532012-08-24 15:29:27 -07002372 return putIntForUser(cr, name, value, UserHandle.myUserId());
2373 }
2374
2375 /** @hide */
2376 public static boolean putIntForUser(ContentResolver cr, String name, int value,
2377 int userHandle) {
2378 return putStringForUser(cr, name, Integer.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002379 }
2380
2381 /**
2382 * Convenience function for retrieving a single system settings value
2383 * as a {@code long}. Note that internally setting values are always
2384 * stored as strings; this function converts the string to a {@code long}
2385 * for you. The default value will be returned if the setting is
2386 * not defined or not a {@code long}.
2387 *
2388 * @param cr The ContentResolver to access.
2389 * @param name The name of the setting to retrieve.
2390 * @param def Value to return if the setting is not defined.
2391 *
2392 * @return The setting's current value, or 'def' if it is not defined
2393 * or not a valid {@code long}.
2394 */
2395 public static long getLong(ContentResolver cr, String name, long def) {
Christopher Tate06efb532012-08-24 15:29:27 -07002396 return getLongForUser(cr, name, def, UserHandle.myUserId());
2397 }
2398
2399 /** @hide */
2400 public static long getLongForUser(ContentResolver cr, String name, long def,
2401 int userHandle) {
2402 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002403 long value;
2404 try {
2405 value = valString != null ? Long.parseLong(valString) : def;
2406 } catch (NumberFormatException e) {
2407 value = def;
2408 }
2409 return value;
2410 }
2411
2412 /**
2413 * Convenience function for retrieving a single system settings value
2414 * as a {@code long}. Note that internally setting values are always
2415 * stored as strings; this function converts the string to a {@code long}
2416 * for you.
2417 * <p>
2418 * This version does not take a default value. If the setting has not
2419 * been set, or the string value is not a number,
2420 * it throws {@link SettingNotFoundException}.
2421 *
2422 * @param cr The ContentResolver to access.
2423 * @param name The name of the setting to retrieve.
2424 *
2425 * @return The setting's current value.
2426 * @throws SettingNotFoundException Thrown if a setting by the given
2427 * name can't be found or the setting value is not an integer.
2428 */
2429 public static long getLong(ContentResolver cr, String name)
2430 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07002431 return getLongForUser(cr, name, UserHandle.myUserId());
2432 }
2433
2434 /** @hide */
2435 public static long getLongForUser(ContentResolver cr, String name, int userHandle)
2436 throws SettingNotFoundException {
2437 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002438 try {
2439 return Long.parseLong(valString);
2440 } catch (NumberFormatException e) {
2441 throw new SettingNotFoundException(name);
2442 }
2443 }
2444
2445 /**
2446 * Convenience function for updating a single settings value as a long
2447 * integer. This will either create a new entry in the table if the
2448 * given name does not exist, or modify the value of the existing row
2449 * with that name. Note that internally setting values are always
2450 * stored as strings, so this function converts the given value to a
2451 * string before storing it.
2452 *
2453 * @param cr The ContentResolver to access.
2454 * @param name The name of the setting to modify.
2455 * @param value The new value for the setting.
2456 * @return true if the value was set, false on database errors
2457 */
2458 public static boolean putLong(ContentResolver cr, String name, long value) {
Christopher Tate06efb532012-08-24 15:29:27 -07002459 return putLongForUser(cr, name, value, UserHandle.myUserId());
2460 }
2461
2462 /** @hide */
2463 public static boolean putLongForUser(ContentResolver cr, String name, long value,
2464 int userHandle) {
2465 return putStringForUser(cr, name, Long.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002466 }
2467
2468 /**
2469 * Convenience function for retrieving a single system settings value
2470 * as a floating point number. Note that internally setting values are
2471 * always stored as strings; this function converts the string to an
2472 * float for you. The default value will be returned if the setting
2473 * is not defined or not a valid float.
2474 *
2475 * @param cr The ContentResolver to access.
2476 * @param name The name of the setting to retrieve.
2477 * @param def Value to return if the setting is not defined.
2478 *
2479 * @return The setting's current value, or 'def' if it is not defined
2480 * or not a valid float.
2481 */
2482 public static float getFloat(ContentResolver cr, String name, float def) {
Christopher Tate06efb532012-08-24 15:29:27 -07002483 return getFloatForUser(cr, name, def, UserHandle.myUserId());
2484 }
2485
2486 /** @hide */
2487 public static float getFloatForUser(ContentResolver cr, String name, float def,
2488 int userHandle) {
2489 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002490 try {
2491 return v != null ? Float.parseFloat(v) : def;
2492 } catch (NumberFormatException e) {
2493 return def;
2494 }
2495 }
2496
2497 /**
2498 * Convenience function for retrieving a single system settings value
2499 * as a float. Note that internally setting values are always
2500 * stored as strings; this function converts the string to a float
2501 * for you.
2502 * <p>
2503 * This version does not take a default value. If the setting has not
2504 * been set, or the string value is not a number,
2505 * it throws {@link SettingNotFoundException}.
2506 *
2507 * @param cr The ContentResolver to access.
2508 * @param name The name of the setting to retrieve.
2509 *
2510 * @throws SettingNotFoundException Thrown if a setting by the given
2511 * name can't be found or the setting value is not a float.
2512 *
2513 * @return The setting's current value.
2514 */
2515 public static float getFloat(ContentResolver cr, String name)
2516 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07002517 return getFloatForUser(cr, name, UserHandle.myUserId());
2518 }
2519
2520 /** @hide */
2521 public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
2522 throws SettingNotFoundException {
2523 String v = getStringForUser(cr, name, userHandle);
Brian Muramatsue1d46982010-12-06 17:34:20 -08002524 if (v == null) {
2525 throw new SettingNotFoundException(name);
2526 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002527 try {
2528 return Float.parseFloat(v);
2529 } catch (NumberFormatException e) {
2530 throw new SettingNotFoundException(name);
2531 }
2532 }
2533
2534 /**
2535 * Convenience function for updating a single settings value as a
2536 * floating point number. This will either create a new entry in the
2537 * table if the given name does not exist, or modify the value of the
2538 * existing row with that name. Note that internally setting values
2539 * are always stored as strings, so this function converts the given
2540 * value to a string before storing it.
2541 *
2542 * @param cr The ContentResolver to access.
2543 * @param name The name of the setting to modify.
2544 * @param value The new value for the setting.
2545 * @return true if the value was set, false on database errors
2546 */
2547 public static boolean putFloat(ContentResolver cr, String name, float value) {
Christopher Tate06efb532012-08-24 15:29:27 -07002548 return putFloatForUser(cr, name, value, UserHandle.myUserId());
2549 }
2550
2551 /** @hide */
2552 public static boolean putFloatForUser(ContentResolver cr, String name, float value,
2553 int userHandle) {
2554 return putStringForUser(cr, name, Float.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002555 }
2556
2557 /**
2558 * Convenience function to read all of the current
2559 * configuration-related settings into a
2560 * {@link Configuration} object.
2561 *
2562 * @param cr The ContentResolver to access.
2563 * @param outConfig Where to place the configuration settings.
2564 */
2565 public static void getConfiguration(ContentResolver cr, Configuration outConfig) {
Seigo Nonakaea906b32016-05-18 17:33:04 +09002566 adjustConfigurationForUser(cr, outConfig, UserHandle.myUserId(),
2567 false /* updateSettingsIfEmpty */);
Christopher Tate06efb532012-08-24 15:29:27 -07002568 }
2569
2570 /** @hide */
Seigo Nonakaea906b32016-05-18 17:33:04 +09002571 public static void adjustConfigurationForUser(ContentResolver cr, Configuration outConfig,
2572 int userHandle, boolean updateSettingsIfEmpty) {
Christopher Tate06efb532012-08-24 15:29:27 -07002573 outConfig.fontScale = Settings.System.getFloatForUser(
Alan Viverette04fd67c2016-04-12 10:54:04 -04002574 cr, FONT_SCALE, DEFAULT_FONT_SCALE, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002575 if (outConfig.fontScale < 0) {
Alan Viverette04fd67c2016-04-12 10:54:04 -04002576 outConfig.fontScale = DEFAULT_FONT_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002577 }
Seigo Nonakaea906b32016-05-18 17:33:04 +09002578
2579 final String localeValue =
2580 Settings.System.getStringForUser(cr, SYSTEM_LOCALES, userHandle);
2581 if (localeValue != null) {
2582 outConfig.setLocales(LocaleList.forLanguageTags(localeValue));
2583 } else {
2584 // Do not update configuration with emtpy settings since we need to take over the
2585 // locale list of previous user if the settings value is empty. This happens when a
2586 // new user is created.
2587
2588 if (updateSettingsIfEmpty) {
2589 // Make current configuration persistent. This is necessary the first time a
2590 // user log in. At the first login, the configuration settings are empty, so we
2591 // need to store the adjusted configuration as the initial settings.
2592 Settings.System.putStringForUser(
2593 cr, SYSTEM_LOCALES, outConfig.getLocales().toLanguageTags(),
2594 userHandle);
2595 }
2596 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002597 }
2598
2599 /**
Dianne Hackborn31ca8542011-07-19 14:58:28 -07002600 * @hide Erase the fields in the Configuration that should be applied
2601 * by the settings.
2602 */
2603 public static void clearConfiguration(Configuration inoutConfig) {
2604 inoutConfig.fontScale = 0;
Seigo Nonakad4031512016-03-17 21:18:53 +09002605 if (!inoutConfig.userSetLocale && !inoutConfig.getLocales().isEmpty()) {
Seigo Nonakabd5cac62016-05-13 15:11:37 +09002606 inoutConfig.clearLocales();
Seigo Nonakabd5cbdd2016-01-25 19:40:28 +09002607 }
Dianne Hackborn31ca8542011-07-19 14:58:28 -07002608 }
Narayan Kamath6d632962011-08-24 11:51:37 +01002609
Dianne Hackborn31ca8542011-07-19 14:58:28 -07002610 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002611 * Convenience function to write a batch of configuration-related
2612 * settings from a {@link Configuration} object.
2613 *
2614 * @param cr The ContentResolver to access.
2615 * @param config The settings to write.
2616 * @return true if the values were set, false on database errors
2617 */
2618 public static boolean putConfiguration(ContentResolver cr, Configuration config) {
Christopher Tate06efb532012-08-24 15:29:27 -07002619 return putConfigurationForUser(cr, config, UserHandle.myUserId());
2620 }
2621
2622 /** @hide */
2623 public static boolean putConfigurationForUser(ContentResolver cr, Configuration config,
2624 int userHandle) {
Seigo Nonakabd5cbdd2016-01-25 19:40:28 +09002625 return Settings.System.putFloatForUser(cr, FONT_SCALE, config.fontScale, userHandle) &&
2626 Settings.System.putStringForUser(
2627 cr, SYSTEM_LOCALES, config.getLocales().toLanguageTags(), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002628 }
2629
Dianne Hackbornb8b11a02010-03-10 15:53:11 -08002630 /** @hide */
2631 public static boolean hasInterestingConfigurationChanges(int changes) {
Seigo Nonakabd5cbdd2016-01-25 19:40:28 +09002632 return (changes & ActivityInfo.CONFIG_FONT_SCALE) != 0 ||
2633 (changes & ActivityInfo.CONFIG_LOCALE) != 0;
Dianne Hackbornb8b11a02010-03-10 15:53:11 -08002634 }
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07002635
Christopher Tate06efb532012-08-24 15:29:27 -07002636 /** @deprecated - Do not use */
2637 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002638 public static boolean getShowGTalkServiceStatus(ContentResolver cr) {
Christopher Tate06efb532012-08-24 15:29:27 -07002639 return getShowGTalkServiceStatusForUser(cr, UserHandle.myUserId());
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002640 }
2641
Christopher Tate06efb532012-08-24 15:29:27 -07002642 /**
2643 * @hide
2644 * @deprecated - Do not use
2645 */
Aurimas Liutikas514c5ef2016-05-24 15:22:55 -07002646 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002647 public static boolean getShowGTalkServiceStatusForUser(ContentResolver cr,
2648 int userHandle) {
2649 return getIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, 0, userHandle) != 0;
2650 }
2651
2652 /** @deprecated - Do not use */
2653 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002654 public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag) {
Christopher Tatec8c08382012-09-19 17:18:18 -07002655 setShowGTalkServiceStatusForUser(cr, flag, UserHandle.myUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07002656 }
2657
2658 /**
2659 * @hide
2660 * @deprecated - Do not use
2661 */
2662 @Deprecated
2663 public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean flag,
2664 int userHandle) {
2665 putIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, flag ? 1 : 0, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002666 }
2667
Svetoslav683914b2015-01-15 14:22:26 -08002668 private static final class DiscreteValueValidator implements Validator {
2669 private final String[] mValues;
2670
2671 public DiscreteValueValidator(String[] values) {
2672 mValues = values;
2673 }
2674
Svetoslav1b71ea92015-02-17 18:20:29 -08002675 @Override
Svetoslav683914b2015-01-15 14:22:26 -08002676 public boolean validate(String value) {
2677 return ArrayUtils.contains(mValues, value);
2678 }
2679 }
2680
2681 private static final class InclusiveIntegerRangeValidator implements Validator {
2682 private final int mMin;
2683 private final int mMax;
2684
2685 public InclusiveIntegerRangeValidator(int min, int max) {
2686 mMin = min;
2687 mMax = max;
2688 }
2689
Svetoslav1b71ea92015-02-17 18:20:29 -08002690 @Override
Svetoslav683914b2015-01-15 14:22:26 -08002691 public boolean validate(String value) {
2692 try {
2693 final int intValue = Integer.parseInt(value);
2694 return intValue >= mMin && intValue <= mMax;
2695 } catch (NumberFormatException e) {
2696 return false;
2697 }
2698 }
2699 }
2700
2701 private static final class InclusiveFloatRangeValidator implements Validator {
2702 private final float mMin;
2703 private final float mMax;
2704
2705 public InclusiveFloatRangeValidator(float min, float max) {
2706 mMin = min;
2707 mMax = max;
2708 }
2709
Svetoslav1b71ea92015-02-17 18:20:29 -08002710 @Override
Svetoslav683914b2015-01-15 14:22:26 -08002711 public boolean validate(String value) {
2712 try {
2713 final float floatValue = Float.parseFloat(value);
2714 return floatValue >= mMin && floatValue <= mMax;
2715 } catch (NumberFormatException e) {
2716 return false;
2717 }
2718 }
2719 }
2720
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002721 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002722 * @deprecated Use {@link android.provider.Settings.Global#STAY_ON_WHILE_PLUGGED_IN} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002723 */
Christopher Tate06efb532012-08-24 15:29:27 -07002724 @Deprecated
2725 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 -08002726
2727 /**
2728 * What happens when the user presses the end call button if they're not
2729 * on a call.<br/>
2730 * <b>Values:</b><br/>
2731 * 0 - The end button does nothing.<br/>
2732 * 1 - The end button goes to the home screen.<br/>
2733 * 2 - The end button puts the device to sleep and locks the keyguard.<br/>
2734 * 3 - The end button goes to the home screen. If the user is already on the
2735 * home screen, it puts the device to sleep.
2736 */
2737 public static final String END_BUTTON_BEHAVIOR = "end_button_behavior";
2738
Svetoslav683914b2015-01-15 14:22:26 -08002739 private static final Validator END_BUTTON_BEHAVIOR_VALIDATOR =
2740 new InclusiveIntegerRangeValidator(0, 3);
2741
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002742 /**
David Brown458e8062010-03-08 21:52:11 -08002743 * END_BUTTON_BEHAVIOR value for "go home".
2744 * @hide
2745 */
2746 public static final int END_BUTTON_BEHAVIOR_HOME = 0x1;
2747
2748 /**
2749 * END_BUTTON_BEHAVIOR value for "go to sleep".
2750 * @hide
2751 */
2752 public static final int END_BUTTON_BEHAVIOR_SLEEP = 0x2;
2753
2754 /**
2755 * END_BUTTON_BEHAVIOR default value.
2756 * @hide
2757 */
2758 public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_SLEEP;
2759
2760 /**
Joe Onorato9cdffa12011-04-06 18:27:27 -07002761 * Is advanced settings mode turned on. 0 == no, 1 == yes
2762 * @hide
2763 */
2764 public static final String ADVANCED_SETTINGS = "advanced_settings";
2765
Svetoslav683914b2015-01-15 14:22:26 -08002766 private static final Validator ADVANCED_SETTINGS_VALIDATOR = sBooleanValidator;
2767
Joe Onorato9cdffa12011-04-06 18:27:27 -07002768 /**
2769 * ADVANCED_SETTINGS default value.
2770 * @hide
2771 */
2772 public static final int ADVANCED_SETTINGS_DEFAULT = 0;
2773
2774 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002775 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002776 */
Christopher Tate06efb532012-08-24 15:29:27 -07002777 @Deprecated
2778 public static final String AIRPLANE_MODE_ON = Global.AIRPLANE_MODE_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002779
2780 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002781 * @deprecated Use {@link android.provider.Settings.Global#RADIO_BLUETOOTH} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002782 */
Christopher Tate06efb532012-08-24 15:29:27 -07002783 @Deprecated
2784 public static final String RADIO_BLUETOOTH = Global.RADIO_BLUETOOTH;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002785
2786 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002787 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIFI} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002788 */
Christopher Tate06efb532012-08-24 15:29:27 -07002789 @Deprecated
2790 public static final String RADIO_WIFI = Global.RADIO_WIFI;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002791
Robert Greenwalt8588e472011-11-08 10:12:25 -08002792 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002793 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIMAX} instead
Robert Greenwalt8588e472011-11-08 10:12:25 -08002794 * {@hide}
2795 */
Christopher Tate06efb532012-08-24 15:29:27 -07002796 @Deprecated
2797 public static final String RADIO_WIMAX = Global.RADIO_WIMAX;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002798
2799 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002800 * @deprecated Use {@link android.provider.Settings.Global#RADIO_CELL} instead
Nick Pelly8d32a012011-08-09 07:03:49 -07002801 */
Christopher Tate06efb532012-08-24 15:29:27 -07002802 @Deprecated
2803 public static final String RADIO_CELL = Global.RADIO_CELL;
Nick Pelly8d32a012011-08-09 07:03:49 -07002804
2805 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002806 * @deprecated Use {@link android.provider.Settings.Global#RADIO_NFC} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002807 */
Christopher Tate06efb532012-08-24 15:29:27 -07002808 @Deprecated
2809 public static final String RADIO_NFC = Global.RADIO_NFC;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002810
2811 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002812 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_RADIOS} instead
2813 */
2814 @Deprecated
2815 public static final String AIRPLANE_MODE_RADIOS = Global.AIRPLANE_MODE_RADIOS;
2816
2817 /**
2818 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_TOGGLEABLE_RADIOS} instead
Mike Lockwoodbd5ddf02009-07-29 21:37:14 -07002819 *
2820 * {@hide}
2821 */
Christopher Tate06efb532012-08-24 15:29:27 -07002822 @Deprecated
2823 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS =
2824 Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS;
Mike Lockwoodbd5ddf02009-07-29 21:37:14 -07002825
2826 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002827 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002828 */
Christopher Tate06efb532012-08-24 15:29:27 -07002829 @Deprecated
2830 public static final String WIFI_SLEEP_POLICY = Global.WIFI_SLEEP_POLICY;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002831
2832 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002833 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_DEFAULT} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002834 */
Christopher Tate06efb532012-08-24 15:29:27 -07002835 @Deprecated
2836 public static final int WIFI_SLEEP_POLICY_DEFAULT = Global.WIFI_SLEEP_POLICY_DEFAULT;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002837
2838 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002839 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002840 */
Christopher Tate06efb532012-08-24 15:29:27 -07002841 @Deprecated
2842 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED =
2843 Global.WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002844
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002845 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002846 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002847 */
Christopher Tate06efb532012-08-24 15:29:27 -07002848 @Deprecated
2849 public static final int WIFI_SLEEP_POLICY_NEVER = Global.WIFI_SLEEP_POLICY_NEVER;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002850
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07002851 /**
2852 * @deprecated Use {@link android.provider.Settings.Global#MODE_RINGER} instead
2853 */
2854 @Deprecated
2855 public static final String MODE_RINGER = Global.MODE_RINGER;
2856
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002857 /**
2858 * Whether to use static IP and other static network attributes.
2859 * <p>
2860 * Set to 1 for true and 0 for false.
Jeff Sharkey625239a2012-09-26 22:03:49 -07002861 *
2862 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002863 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002864 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002865 public static final String WIFI_USE_STATIC_IP = "wifi_use_static_ip";
2866
Svetoslav683914b2015-01-15 14:22:26 -08002867 private static final Validator WIFI_USE_STATIC_IP_VALIDATOR = sBooleanValidator;
2868
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002869 /**
2870 * The static IP address.
2871 * <p>
2872 * Example: "192.168.1.51"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002873 *
2874 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002875 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002876 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002877 public static final String WIFI_STATIC_IP = "wifi_static_ip";
2878
Svetoslav683914b2015-01-15 14:22:26 -08002879 private static final Validator WIFI_STATIC_IP_VALIDATOR = sLenientIpAddressValidator;
2880
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002881 /**
2882 * If using static IP, the gateway's IP address.
2883 * <p>
2884 * Example: "192.168.1.1"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002885 *
2886 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002887 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002888 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002889 public static final String WIFI_STATIC_GATEWAY = "wifi_static_gateway";
2890
Svetoslav683914b2015-01-15 14:22:26 -08002891 private static final Validator WIFI_STATIC_GATEWAY_VALIDATOR = sLenientIpAddressValidator;
2892
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002893 /**
2894 * If using static IP, the net mask.
2895 * <p>
2896 * Example: "255.255.255.0"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002897 *
2898 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002899 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002900 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002901 public static final String WIFI_STATIC_NETMASK = "wifi_static_netmask";
2902
Svetoslav683914b2015-01-15 14:22:26 -08002903 private static final Validator WIFI_STATIC_NETMASK_VALIDATOR = sLenientIpAddressValidator;
2904
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002905 /**
2906 * If using static IP, the primary DNS's IP address.
2907 * <p>
2908 * Example: "192.168.1.1"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002909 *
2910 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002911 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002912 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002913 public static final String WIFI_STATIC_DNS1 = "wifi_static_dns1";
2914
Svetoslav683914b2015-01-15 14:22:26 -08002915 private static final Validator WIFI_STATIC_DNS1_VALIDATOR = sLenientIpAddressValidator;
2916
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002917 /**
2918 * If using static IP, the secondary DNS's IP address.
2919 * <p>
2920 * Example: "192.168.1.2"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002921 *
2922 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002923 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002924 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002925 public static final String WIFI_STATIC_DNS2 = "wifi_static_dns2";
2926
Svetoslav683914b2015-01-15 14:22:26 -08002927 private static final Validator WIFI_STATIC_DNS2_VALIDATOR = sLenientIpAddressValidator;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002928
2929 /**
2930 * Determines whether remote devices may discover and/or connect to
2931 * this device.
2932 * <P>Type: INT</P>
2933 * 2 -- discoverable and connectable
2934 * 1 -- connectable but not discoverable
2935 * 0 -- neither connectable nor discoverable
2936 */
2937 public static final String BLUETOOTH_DISCOVERABILITY =
2938 "bluetooth_discoverability";
2939
Svetoslav683914b2015-01-15 14:22:26 -08002940 private static final Validator BLUETOOTH_DISCOVERABILITY_VALIDATOR =
2941 new InclusiveIntegerRangeValidator(0, 2);
2942
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002943 /**
2944 * Bluetooth discoverability timeout. If this value is nonzero, then
2945 * Bluetooth becomes discoverable for a certain number of seconds,
2946 * after which is becomes simply connectable. The value is in seconds.
2947 */
2948 public static final String BLUETOOTH_DISCOVERABILITY_TIMEOUT =
2949 "bluetooth_discoverability_timeout";
2950
Svetoslav683914b2015-01-15 14:22:26 -08002951 private static final Validator BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR =
2952 sNonNegativeIntegerValidator;
2953
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002954 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08002955 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_ENABLED}
2956 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002957 */
Amith Yamasani156c4352010-03-05 17:10:03 -08002958 @Deprecated
2959 public static final String LOCK_PATTERN_ENABLED = Secure.LOCK_PATTERN_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002960
2961 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08002962 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_VISIBLE}
2963 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002964 */
Amith Yamasani156c4352010-03-05 17:10:03 -08002965 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002966 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
2967
2968 /**
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07002969 * @deprecated Use
Amith Yamasani156c4352010-03-05 17:10:03 -08002970 * {@link android.provider.Settings.Secure#LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED}
2971 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002972 */
Amith Yamasani156c4352010-03-05 17:10:03 -08002973 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002974 public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED =
2975 "lock_pattern_tactile_feedback_enabled";
2976
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002977 /**
2978 * A formatted string of the next alarm that is set, or the empty string
2979 * if there is no alarm set.
Adrian Roosc42a1e12014-07-07 23:35:53 +02002980 *
2981 * @deprecated Use {@link android.app.AlarmManager#getNextAlarmClock()}.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002982 */
Adrian Roosc42a1e12014-07-07 23:35:53 +02002983 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002984 public static final String NEXT_ALARM_FORMATTED = "next_alarm_formatted";
2985
Svetoslav683914b2015-01-15 14:22:26 -08002986 private static final Validator NEXT_ALARM_FORMATTED_VALIDATOR = new Validator() {
2987 private static final int MAX_LENGTH = 1000;
Svetoslav1b71ea92015-02-17 18:20:29 -08002988
Svetoslav683914b2015-01-15 14:22:26 -08002989 @Override
2990 public boolean validate(String value) {
2991 // TODO: No idea what the correct format is.
Svetoslav64d6e9c2015-02-12 11:30:36 -08002992 return value == null || value.length() < MAX_LENGTH;
Svetoslav683914b2015-01-15 14:22:26 -08002993 }
2994 };
2995
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002996 /**
2997 * Scaling factor for fonts, float.
2998 */
2999 public static final String FONT_SCALE = "font_scale";
3000
Svetoslav683914b2015-01-15 14:22:26 -08003001 private static final Validator FONT_SCALE_VALIDATOR = new Validator() {
3002 @Override
3003 public boolean validate(String value) {
3004 try {
3005 return Float.parseFloat(value) >= 0;
3006 } catch (NumberFormatException e) {
3007 return false;
3008 }
3009 }
3010 };
3011
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003012 /**
Seigo Nonakabd5cbdd2016-01-25 19:40:28 +09003013 * The serialized system locale value.
3014 *
3015 * Do not use this value directory.
Yohei Yukawa23cbe852016-05-17 16:42:58 -07003016 * To get system locale, use {@link LocaleList#getDefault} instead.
Seigo Nonakabd5cbdd2016-01-25 19:40:28 +09003017 * To update system locale, use {@link com.android.internal.app.LocalePicker#updateLocales}
3018 * instead.
3019 * @hide
3020 */
3021 public static final String SYSTEM_LOCALES = "system_locales";
3022
3023
3024 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003025 * Name of an application package to be debugged.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003026 *
3027 * @deprecated Use {@link Global#DEBUG_APP} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003028 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003029 @Deprecated
3030 public static final String DEBUG_APP = Global.DEBUG_APP;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003031
3032 /**
3033 * If 1, when launching DEBUG_APP it will wait for the debugger before
3034 * starting user code. If 0, it will run normally.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003035 *
3036 * @deprecated Use {@link Global#WAIT_FOR_DEBUGGER} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003037 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003038 @Deprecated
3039 public static final String WAIT_FOR_DEBUGGER = Global.WAIT_FOR_DEBUGGER;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003040
3041 /**
3042 * Whether or not to dim the screen. 0=no 1=yes
Jeff Brown96307042012-07-27 15:51:34 -07003043 * @deprecated This setting is no longer used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003044 */
Jeff Brown96307042012-07-27 15:51:34 -07003045 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003046 public static final String DIM_SCREEN = "dim_screen";
3047
Svetoslav683914b2015-01-15 14:22:26 -08003048 private static final Validator DIM_SCREEN_VALIDATOR = sBooleanValidator;
3049
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003050 /**
Jeff Brown05af6ad2014-09-30 20:54:30 -07003051 * The amount of time in milliseconds before the device goes to sleep or begins
3052 * to dream after a period of inactivity. This value is also known as the
3053 * user activity timeout period since the screen isn't necessarily turned off
3054 * when it expires.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003055 */
3056 public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout";
3057
Svetoslav683914b2015-01-15 14:22:26 -08003058 private static final Validator SCREEN_OFF_TIMEOUT_VALIDATOR = sNonNegativeIntegerValidator;
3059
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003060 /**
3061 * The screen backlight brightness between 0 and 255.
3062 */
3063 public static final String SCREEN_BRIGHTNESS = "screen_brightness";
3064
Svetoslav683914b2015-01-15 14:22:26 -08003065 private static final Validator SCREEN_BRIGHTNESS_VALIDATOR =
3066 new InclusiveIntegerRangeValidator(0, 255);
3067
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003068 /**
Santos Cordon3107d292016-09-20 15:50:35 -07003069 * The screen backlight brightness between 0 and 255.
3070 * @hide
3071 */
3072 public static final String SCREEN_BRIGHTNESS_FOR_VR = "screen_brightness_for_vr";
3073
3074 private static final Validator SCREEN_BRIGHTNESS_FOR_VR_VALIDATOR =
3075 new InclusiveIntegerRangeValidator(0, 255);
3076
3077 /**
Dan Murphy951764b2009-08-27 14:59:03 -05003078 * Control whether to enable automatic brightness mode.
Dan Murphy951764b2009-08-27 14:59:03 -05003079 */
3080 public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode";
3081
Svetoslav683914b2015-01-15 14:22:26 -08003082 private static final Validator SCREEN_BRIGHTNESS_MODE_VALIDATOR = sBooleanValidator;
3083
Dan Murphy951764b2009-08-27 14:59:03 -05003084 /**
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08003085 * Adjustment to auto-brightness to make it generally more (>0.0 <1.0)
3086 * or less (<0.0 >-1.0) bright.
Dianne Hackborn518a3d82012-05-09 16:30:49 -07003087 * @hide
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08003088 */
3089 public static final String SCREEN_AUTO_BRIGHTNESS_ADJ = "screen_auto_brightness_adj";
3090
Svetoslav683914b2015-01-15 14:22:26 -08003091 private static final Validator SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR =
3092 new InclusiveFloatRangeValidator(-1, 1);
3093
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08003094 /**
Mike Lockwooddc3494e2009-10-14 21:17:09 -07003095 * SCREEN_BRIGHTNESS_MODE value for manual mode.
Mike Lockwooddc3494e2009-10-14 21:17:09 -07003096 */
3097 public static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0;
3098
3099 /**
Scott Main52bfc242012-02-09 10:09:14 -08003100 * SCREEN_BRIGHTNESS_MODE value for automatic mode.
Mike Lockwooddc3494e2009-10-14 21:17:09 -07003101 */
3102 public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1;
3103
3104 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003105 * Control whether the process CPU usage meter should be shown.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003106 *
Nick Kralevichfc4a5c22016-10-11 09:01:38 -07003107 * @deprecated This functionality is no longer available as of
3108 * {@link android.os.Build.VERSION_CODES#N_MR1}.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003109 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003110 @Deprecated
3111 public static final String SHOW_PROCESSES = Global.SHOW_PROCESSES;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003112
3113 /**
3114 * If 1, the activity manager will aggressively finish activities and
3115 * processes as soon as they are no longer needed. If 0, the normal
3116 * extended lifetime is used.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003117 *
3118 * @deprecated Use {@link Global#ALWAYS_FINISH_ACTIVITIES} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003119 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003120 @Deprecated
3121 public static final String ALWAYS_FINISH_ACTIVITIES = Global.ALWAYS_FINISH_ACTIVITIES;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003122
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003123 /**
3124 * Determines which streams are affected by ringer mode changes. The
3125 * stream type's bit should be set to 1 if it should be muted when going
3126 * into an inaudible ringer mode.
3127 */
3128 public static final String MODE_RINGER_STREAMS_AFFECTED = "mode_ringer_streams_affected";
3129
Svetoslav683914b2015-01-15 14:22:26 -08003130 private static final Validator MODE_RINGER_STREAMS_AFFECTED_VALIDATOR =
3131 sNonNegativeIntegerValidator;
3132
3133 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003134 * Determines which streams are affected by mute. The
3135 * stream type's bit should be set to 1 if it should be muted when a mute request
3136 * is received.
3137 */
Svetoslav683914b2015-01-15 14:22:26 -08003138 public static final String MUTE_STREAMS_AFFECTED = "mute_streams_affected";
3139
3140 private static final Validator MUTE_STREAMS_AFFECTED_VALIDATOR =
3141 sNonNegativeIntegerValidator;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003142
3143 /**
3144 * Whether vibrate is on for different events. This is used internally,
3145 * changing this value will not change the vibrate. See AudioManager.
3146 */
3147 public static final String VIBRATE_ON = "vibrate_on";
3148
Svetoslav683914b2015-01-15 14:22:26 -08003149 private static final Validator VIBRATE_ON_VALIDATOR = sBooleanValidator;
3150
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003151 /**
Jeff Brown7f6c2312012-04-13 20:38:38 -07003152 * If 1, redirects the system vibrator to all currently attached input devices
3153 * that support vibration. If there are no such input devices, then the system
3154 * vibrator is used instead.
3155 * If 0, does not register the system vibrator.
3156 *
3157 * This setting is mainly intended to provide a compatibility mechanism for
3158 * applications that only know about the system vibrator and do not use the
3159 * input device vibrator API.
3160 *
3161 * @hide
3162 */
3163 public static final String VIBRATE_INPUT_DEVICES = "vibrate_input_devices";
3164
Svetoslav683914b2015-01-15 14:22:26 -08003165 private static final Validator VIBRATE_INPUT_DEVICES_VALIDATOR = sBooleanValidator;
3166
Jeff Brown7f6c2312012-04-13 20:38:38 -07003167 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003168 * Ringer volume. This is used internally, changing this value will not
3169 * change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08003170 *
3171 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003172 */
3173 public static final String VOLUME_RING = "volume_ring";
3174
3175 /**
3176 * System/notifications volume. This is used internally, changing this
3177 * value will not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08003178 *
3179 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003180 */
3181 public static final String VOLUME_SYSTEM = "volume_system";
3182
3183 /**
3184 * Voice call volume. This is used internally, changing this value will
3185 * not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08003186 *
3187 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003188 */
3189 public static final String VOLUME_VOICE = "volume_voice";
3190
3191 /**
3192 * Music/media/gaming volume. This is used internally, changing this
3193 * value will not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08003194 *
3195 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003196 */
3197 public static final String VOLUME_MUSIC = "volume_music";
3198
3199 /**
3200 * Alarm volume. This is used internally, changing this
3201 * value will not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08003202 *
3203 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003204 */
3205 public static final String VOLUME_ALARM = "volume_alarm";
3206
3207 /**
3208 * Notification volume. This is used internally, changing this
3209 * value will not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08003210 *
3211 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003212 */
3213 public static final String VOLUME_NOTIFICATION = "volume_notification";
3214
3215 /**
Eric Laurent484d2882009-12-08 09:05:45 -08003216 * Bluetooth Headset volume. This is used internally, changing this value will
3217 * not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08003218 *
3219 * @removed Not used by anything since API 2.
Eric Laurent484d2882009-12-08 09:05:45 -08003220 */
3221 public static final String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco";
3222
3223 /**
Jean-Michel Trivia53b7052017-04-12 18:27:01 -07003224 * @hide
3225 * Acessibility volume. This is used internally, changing this
3226 * value will not change the volume.
3227 */
3228 public static final String VOLUME_ACCESSIBILITY = "volume_a11y";
3229
3230 /**
Mike Lockwood8517e462011-10-25 14:47:19 -04003231 * Master volume (float in the range 0.0f to 1.0f).
Svetoslavdbbeeb32015-02-18 19:16:25 -08003232 *
Mike Lockwood8517e462011-10-25 14:47:19 -04003233 * @hide
3234 */
3235 public static final String VOLUME_MASTER = "volume_master";
3236
3237 /**
Andy Hungf04b84d2015-12-18 17:33:27 -08003238 * Master mono (int 1 = mono, 0 = normal).
3239 *
3240 * @hide
3241 */
3242 public static final String MASTER_MONO = "master_mono";
3243
3244 private static final Validator MASTER_MONO_VALIDATOR = sBooleanValidator;
3245
3246 /**
Justin Koh57978ed2012-04-03 17:37:58 -07003247 * Whether the notifications should use the ring volume (value of 1) or
3248 * a separate notification volume (value of 0). In most cases, users
3249 * will have this enabled so the notification and ringer volumes will be
3250 * the same. However, power users can disable this and use the separate
3251 * notification volume control.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003252 * <p>
Justin Koh57978ed2012-04-03 17:37:58 -07003253 * Note: This is a one-off setting that will be removed in the future
3254 * when there is profile support. For this reason, it is kept hidden
3255 * from the public APIs.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003256 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003257 * @hide
Amith Yamasani42722bf2011-07-22 10:34:27 -07003258 * @deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003259 */
Gilles Debunnee90bed12011-08-30 14:28:27 -07003260 @Deprecated
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003261 public static final String NOTIFICATIONS_USE_RING_VOLUME =
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003262 "notifications_use_ring_volume";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003263
Svetoslav683914b2015-01-15 14:22:26 -08003264 private static final Validator NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR = sBooleanValidator;
3265
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003266 /**
Daniel Sandler6329bf72010-02-26 15:17:44 -05003267 * Whether silent mode should allow vibration feedback. This is used
3268 * internally in AudioService and the Sound settings activity to
3269 * coordinate decoupling of vibrate and silent modes. This setting
3270 * will likely be removed in a future release with support for
3271 * audio/vibe feedback profiles.
3272 *
Eric Laurentbffc3d12012-05-07 17:43:49 -07003273 * Not used anymore. On devices with vibrator, the user explicitly selects
3274 * silent or vibrate mode.
3275 * Kept for use by legacy database upgrade code in DatabaseHelper.
Daniel Sandler6329bf72010-02-26 15:17:44 -05003276 * @hide
3277 */
3278 public static final String VIBRATE_IN_SILENT = "vibrate_in_silent";
3279
Svetoslav683914b2015-01-15 14:22:26 -08003280 private static final Validator VIBRATE_IN_SILENT_VALIDATOR = sBooleanValidator;
3281
Daniel Sandler6329bf72010-02-26 15:17:44 -05003282 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003283 * The mapping of stream type (integer) to its setting.
Svetoslavdbbeeb32015-02-18 19:16:25 -08003284 *
3285 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003286 */
3287 public static final String[] VOLUME_SETTINGS = {
3288 VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC,
Eric Laurent484d2882009-12-08 09:05:45 -08003289 VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003290 };
3291
3292 /**
Jean-Michel Trivia53b7052017-04-12 18:27:01 -07003293 * @hide
3294 * The mapping of stream type (integer) to its setting.
3295 * Unlike the VOLUME_SETTINGS array, this one contains as many entries as
3296 * AudioSystem.NUM_STREAM_TYPES, and has empty strings for stream types whose volumes
3297 * are never persisted.
3298 */
3299 public static final String[] VOLUME_SETTINGS_INT = {
3300 VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC,
3301 VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO,
3302 "" /*STREAM_SYSTEM_ENFORCED, no setting for this stream*/,
3303 "" /*STREAM_DTMF, no setting for this stream*/,
3304 "" /*STREAM_TTS, no setting for this stream*/,
3305 VOLUME_ACCESSIBILITY
3306 };
3307
3308 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003309 * Appended to various volume related settings to record the previous
3310 * values before they the settings were affected by a silent/vibrate
3311 * ringer mode change.
Svetoslavdbbeeb32015-02-18 19:16:25 -08003312 *
3313 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003314 */
3315 public static final String APPEND_FOR_LAST_AUDIBLE = "_last_audible";
3316
3317 /**
3318 * Persistent store for the system-wide default ringtone URI.
3319 * <p>
3320 * If you need to play the default ringtone at any given time, it is recommended
3321 * you give {@link #DEFAULT_RINGTONE_URI} to the media player. It will resolve
3322 * to the set default ringtone at the time of playing.
3323 *
3324 * @see #DEFAULT_RINGTONE_URI
3325 */
3326 public static final String RINGTONE = "ringtone";
3327
Svetoslav683914b2015-01-15 14:22:26 -08003328 private static final Validator RINGTONE_VALIDATOR = sUriValidator;
3329
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003330 /**
3331 * A {@link Uri} that will point to the current default ringtone at any
3332 * given time.
3333 * <p>
3334 * If the current default ringtone is in the DRM provider and the caller
3335 * does not have permission, the exception will be a
3336 * FileNotFoundException.
3337 */
3338 public static final Uri DEFAULT_RINGTONE_URI = getUriFor(RINGTONE);
3339
Jeff Sharkey413573a2016-02-22 17:52:45 -07003340 /** {@hide} */
3341 public static final String RINGTONE_CACHE = "ringtone_cache";
3342 /** {@hide} */
3343 public static final Uri RINGTONE_CACHE_URI = getUriFor(RINGTONE_CACHE);
3344
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003345 /**
3346 * Persistent store for the system-wide default notification sound.
3347 *
3348 * @see #RINGTONE
3349 * @see #DEFAULT_NOTIFICATION_URI
3350 */
3351 public static final String NOTIFICATION_SOUND = "notification_sound";
3352
Svetoslav683914b2015-01-15 14:22:26 -08003353 private static final Validator NOTIFICATION_SOUND_VALIDATOR = sUriValidator;
3354
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003355 /**
3356 * A {@link Uri} that will point to the current default notification
3357 * sound at any given time.
3358 *
3359 * @see #DEFAULT_RINGTONE_URI
3360 */
3361 public static final Uri DEFAULT_NOTIFICATION_URI = getUriFor(NOTIFICATION_SOUND);
3362
Jeff Sharkey413573a2016-02-22 17:52:45 -07003363 /** {@hide} */
3364 public static final String NOTIFICATION_SOUND_CACHE = "notification_sound_cache";
3365 /** {@hide} */
3366 public static final Uri NOTIFICATION_SOUND_CACHE_URI = getUriFor(NOTIFICATION_SOUND_CACHE);
3367
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003368 /**
Patrick Scott3156bb002009-04-13 09:57:38 -07003369 * Persistent store for the system-wide default alarm alert.
3370 *
3371 * @see #RINGTONE
3372 * @see #DEFAULT_ALARM_ALERT_URI
3373 */
3374 public static final String ALARM_ALERT = "alarm_alert";
3375
Svetoslav683914b2015-01-15 14:22:26 -08003376 private static final Validator ALARM_ALERT_VALIDATOR = sUriValidator;
3377
Patrick Scott3156bb002009-04-13 09:57:38 -07003378 /**
3379 * A {@link Uri} that will point to the current default alarm alert at
3380 * any given time.
3381 *
3382 * @see #DEFAULT_ALARM_ALERT_URI
3383 */
3384 public static final Uri DEFAULT_ALARM_ALERT_URI = getUriFor(ALARM_ALERT);
3385
Jeff Sharkey413573a2016-02-22 17:52:45 -07003386 /** {@hide} */
3387 public static final String ALARM_ALERT_CACHE = "alarm_alert_cache";
3388 /** {@hide} */
3389 public static final Uri ALARM_ALERT_CACHE_URI = getUriFor(ALARM_ALERT_CACHE);
3390
Patrick Scott3156bb002009-04-13 09:57:38 -07003391 /**
Jean-Michel Trivid589fea2011-04-15 11:28:10 -07003392 * Persistent store for the system default media button event receiver.
3393 *
3394 * @hide
3395 */
3396 public static final String MEDIA_BUTTON_RECEIVER = "media_button_receiver";
3397
Svetoslav683914b2015-01-15 14:22:26 -08003398 private static final Validator MEDIA_BUTTON_RECEIVER_VALIDATOR = new Validator() {
3399 @Override
3400 public boolean validate(String value) {
3401 try {
3402 ComponentName.unflattenFromString(value);
3403 return true;
3404 } catch (NullPointerException e) {
3405 return false;
3406 }
3407 }
3408 };
3409
Jean-Michel Trivid589fea2011-04-15 11:28:10 -07003410 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003411 * Setting to enable Auto Replace (AutoText) in text editors. 1 = On, 0 = Off
3412 */
3413 public static final String TEXT_AUTO_REPLACE = "auto_replace";
3414
Svetoslav683914b2015-01-15 14:22:26 -08003415 private static final Validator TEXT_AUTO_REPLACE_VALIDATOR = sBooleanValidator;
3416
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003417 /**
3418 * Setting to enable Auto Caps in text editors. 1 = On, 0 = Off
3419 */
3420 public static final String TEXT_AUTO_CAPS = "auto_caps";
3421
Svetoslav683914b2015-01-15 14:22:26 -08003422 private static final Validator TEXT_AUTO_CAPS_VALIDATOR = sBooleanValidator;
3423
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003424 /**
3425 * Setting to enable Auto Punctuate in text editors. 1 = On, 0 = Off. This
3426 * feature converts two spaces to a "." and space.
3427 */
3428 public static final String TEXT_AUTO_PUNCTUATE = "auto_punctuate";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003429
Svetoslav683914b2015-01-15 14:22:26 -08003430 private static final Validator TEXT_AUTO_PUNCTUATE_VALIDATOR = sBooleanValidator;
3431
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003432 /**
3433 * Setting to showing password characters in text editors. 1 = On, 0 = Off
3434 */
3435 public static final String TEXT_SHOW_PASSWORD = "show_password";
3436
Svetoslav683914b2015-01-15 14:22:26 -08003437 private static final Validator TEXT_SHOW_PASSWORD_VALIDATOR = sBooleanValidator;
3438
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003439 public static final String SHOW_GTALK_SERVICE_STATUS =
3440 "SHOW_GTALK_SERVICE_STATUS";
3441
Svetoslav683914b2015-01-15 14:22:26 -08003442 private static final Validator SHOW_GTALK_SERVICE_STATUS_VALIDATOR = sBooleanValidator;
3443
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003444 /**
3445 * Name of activity to use for wallpaper on the home screen.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003446 *
3447 * @deprecated Use {@link WallpaperManager} instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003448 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003449 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003450 public static final String WALLPAPER_ACTIVITY = "wallpaper_activity";
3451
Svetoslav683914b2015-01-15 14:22:26 -08003452 private static final Validator WALLPAPER_ACTIVITY_VALIDATOR = new Validator() {
3453 private static final int MAX_LENGTH = 1000;
3454
3455 @Override
3456 public boolean validate(String value) {
3457 if (value != null && value.length() > MAX_LENGTH) {
3458 return false;
3459 }
3460 return ComponentName.unflattenFromString(value) != null;
3461 }
3462 };
3463
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003464 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003465 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME}
3466 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003467 */
Christopher Tate06efb532012-08-24 15:29:27 -07003468 @Deprecated
3469 public static final String AUTO_TIME = Global.AUTO_TIME;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003470
3471 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003472 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME_ZONE}
3473 * instead
Amith Yamasaniad450be2010-09-16 16:47:00 -07003474 */
Christopher Tate06efb532012-08-24 15:29:27 -07003475 @Deprecated
3476 public static final String AUTO_TIME_ZONE = Global.AUTO_TIME_ZONE;
Amith Yamasaniad450be2010-09-16 16:47:00 -07003477
3478 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003479 * Display times as 12 or 24 hours
3480 * 12
3481 * 24
3482 */
3483 public static final String TIME_12_24 = "time_12_24";
3484
Svetoslav683914b2015-01-15 14:22:26 -08003485 /** @hide */
3486 public static final Validator TIME_12_24_VALIDATOR =
3487 new DiscreteValueValidator(new String[] {"12", "24"});
3488
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003489 /**
3490 * Date format string
3491 * mm/dd/yyyy
3492 * dd/mm/yyyy
3493 * yyyy/mm/dd
3494 */
3495 public static final String DATE_FORMAT = "date_format";
3496
Svetoslav683914b2015-01-15 14:22:26 -08003497 /** @hide */
3498 public static final Validator DATE_FORMAT_VALIDATOR = new Validator() {
3499 @Override
3500 public boolean validate(String value) {
3501 try {
3502 new SimpleDateFormat(value);
3503 return true;
3504 } catch (IllegalArgumentException e) {
3505 return false;
3506 }
3507 }
3508 };
3509
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003510 /**
3511 * Whether the setup wizard has been run before (on first boot), or if
3512 * it still needs to be run.
3513 *
3514 * nonzero = it has been run in the past
3515 * 0 = it has not been run in the past
3516 */
3517 public static final String SETUP_WIZARD_HAS_RUN = "setup_wizard_has_run";
3518
Svetoslav683914b2015-01-15 14:22:26 -08003519 /** @hide */
3520 public static final Validator SETUP_WIZARD_HAS_RUN_VALIDATOR = sBooleanValidator;
3521
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003522 /**
3523 * Scaling factor for normal window animations. Setting to 0 will disable window
3524 * animations.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003525 *
3526 * @deprecated Use {@link Global#WINDOW_ANIMATION_SCALE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003527 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003528 @Deprecated
3529 public static final String WINDOW_ANIMATION_SCALE = Global.WINDOW_ANIMATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003530
3531 /**
3532 * Scaling factor for activity transition animations. Setting to 0 will disable window
3533 * animations.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003534 *
3535 * @deprecated Use {@link Global#TRANSITION_ANIMATION_SCALE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003536 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003537 @Deprecated
3538 public static final String TRANSITION_ANIMATION_SCALE = Global.TRANSITION_ANIMATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003539
3540 /**
Chet Haasec38fa1f2012-02-01 16:37:46 -08003541 * Scaling factor for Animator-based animations. This affects both the start delay and
3542 * duration of all such animations. Setting to 0 will cause animations to end immediately.
3543 * The default value is 1.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003544 *
3545 * @deprecated Use {@link Global#ANIMATOR_DURATION_SCALE} instead
Chet Haasec38fa1f2012-02-01 16:37:46 -08003546 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003547 @Deprecated
3548 public static final String ANIMATOR_DURATION_SCALE = Global.ANIMATOR_DURATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003549
3550 /**
3551 * Control whether the accelerometer will be used to change screen
3552 * orientation. If 0, it will not be used unless explicitly requested
3553 * by the application; if 1, it will be used by default unless explicitly
3554 * disabled by the application.
3555 */
3556 public static final String ACCELEROMETER_ROTATION = "accelerometer_rotation";
3557
Svetoslav683914b2015-01-15 14:22:26 -08003558 /** @hide */
3559 public static final Validator ACCELEROMETER_ROTATION_VALIDATOR = sBooleanValidator;
3560
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003561 /**
Daniel Sandlerb73617d2010-08-17 00:41:00 -04003562 * Default screen rotation when no other policy applies.
3563 * When {@link #ACCELEROMETER_ROTATION} is zero and no on-screen Activity expresses a
3564 * preference, this rotation value will be used. Must be one of the
Brian Muramatsue1d46982010-12-06 17:34:20 -08003565 * {@link android.view.Surface#ROTATION_0 Surface rotation constants}.
Daniel Sandlerb73617d2010-08-17 00:41:00 -04003566 *
Dianne Hackborn16ec0802014-08-15 18:32:33 -07003567 * @see android.view.Display#getRotation
Daniel Sandlerb73617d2010-08-17 00:41:00 -04003568 */
3569 public static final String USER_ROTATION = "user_rotation";
3570
Svetoslav683914b2015-01-15 14:22:26 -08003571 /** @hide */
3572 public static final Validator USER_ROTATION_VALIDATOR =
3573 new InclusiveIntegerRangeValidator(0, 3);
3574
Daniel Sandlerb73617d2010-08-17 00:41:00 -04003575 /**
Jeff Brown207673cd2012-06-05 17:47:11 -07003576 * Control whether the rotation lock toggle in the System UI should be hidden.
3577 * Typically this is done for accessibility purposes to make it harder for
3578 * the user to accidentally toggle the rotation lock while the display rotation
3579 * has been locked for accessibility.
3580 *
3581 * If 0, then rotation lock toggle is not hidden for accessibility (although it may be
3582 * unavailable for other reasons). If 1, then the rotation lock toggle is hidden.
3583 *
3584 * @hide
3585 */
3586 public static final String HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY =
3587 "hide_rotation_lock_toggle_for_accessibility";
3588
Svetoslav683914b2015-01-15 14:22:26 -08003589 /** @hide */
3590 public static final Validator HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR =
3591 sBooleanValidator;
3592
Jeff Brown207673cd2012-06-05 17:47:11 -07003593 /**
Daisuke Miyakawa3c60eeb2012-05-08 12:08:25 -07003594 * Whether the phone vibrates when it is ringing due to an incoming call. This will
3595 * be used by Phone and Setting apps; it shouldn't affect other apps.
3596 * The value is boolean (1 or 0).
3597 *
3598 * Note: this is not same as "vibrate on ring", which had been available until ICS.
3599 * It was about AudioManager's setting and thus affected all the applications which
3600 * relied on the setting, while this is purely about the vibration setting for incoming
3601 * calls.
Daisuke Miyakawa3c60eeb2012-05-08 12:08:25 -07003602 */
3603 public static final String VIBRATE_WHEN_RINGING = "vibrate_when_ringing";
3604
Svetoslav683914b2015-01-15 14:22:26 -08003605 /** @hide */
3606 public static final Validator VIBRATE_WHEN_RINGING_VALIDATOR = sBooleanValidator;
3607
Daisuke Miyakawa3c60eeb2012-05-08 12:08:25 -07003608 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003609 * Whether the audible DTMF tones are played by the dialer when dialing. The value is
3610 * boolean (1 or 0).
3611 */
3612 public static final String DTMF_TONE_WHEN_DIALING = "dtmf_tone";
3613
Svetoslav683914b2015-01-15 14:22:26 -08003614 /** @hide */
3615 public static final Validator DTMF_TONE_WHEN_DIALING_VALIDATOR = sBooleanValidator;
3616
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003617 /**
David Kraused0f67152009-06-13 18:01:13 -05003618 * CDMA only settings
3619 * DTMF tone type played by the dialer when dialing.
3620 * 0 = Normal
3621 * 1 = Long
David Kraused0f67152009-06-13 18:01:13 -05003622 */
3623 public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type";
3624
Svetoslav683914b2015-01-15 14:22:26 -08003625 /** @hide */
3626 public static final Validator DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR = sBooleanValidator;
3627
David Kraused0f67152009-06-13 18:01:13 -05003628 /**
David Kraused0f67152009-06-13 18:01:13 -05003629 * Whether the hearing aid is enabled. The value is
3630 * boolean (1 or 0).
3631 * @hide
3632 */
3633 public static final String HEARING_AID = "hearing_aid";
3634
Svetoslav683914b2015-01-15 14:22:26 -08003635 /** @hide */
3636 public static final Validator HEARING_AID_VALIDATOR = sBooleanValidator;
3637
David Kraused0f67152009-06-13 18:01:13 -05003638 /**
3639 * CDMA only settings
3640 * TTY Mode
3641 * 0 = OFF
3642 * 1 = FULL
3643 * 2 = VCO
3644 * 3 = HCO
3645 * @hide
3646 */
3647 public static final String TTY_MODE = "tty_mode";
3648
Svetoslav683914b2015-01-15 14:22:26 -08003649 /** @hide */
3650 public static final Validator TTY_MODE_VALIDATOR = new InclusiveIntegerRangeValidator(0, 3);
3651
David Kraused0f67152009-06-13 18:01:13 -05003652 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003653 * Whether the sounds effects (key clicks, lid open ...) are enabled. The value is
3654 * boolean (1 or 0).
3655 */
3656 public static final String SOUND_EFFECTS_ENABLED = "sound_effects_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003657
Svetoslav683914b2015-01-15 14:22:26 -08003658 /** @hide */
3659 public static final Validator SOUND_EFFECTS_ENABLED_VALIDATOR = sBooleanValidator;
3660
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003661 /**
3662 * Whether the haptic feedback (long presses, ...) are enabled. The value is
3663 * boolean (1 or 0).
3664 */
3665 public static final String HAPTIC_FEEDBACK_ENABLED = "haptic_feedback_enabled";
Sanjay Jeyakumar21bf2412009-07-09 13:31:48 -07003666
Svetoslav683914b2015-01-15 14:22:26 -08003667 /** @hide */
3668 public static final Validator HAPTIC_FEEDBACK_ENABLED_VALIDATOR = sBooleanValidator;
3669
Mike LeBeau48603e72009-06-05 00:27:00 +01003670 /**
Bjorn Bringert24abb662010-09-21 12:21:18 +01003671 * @deprecated Each application that shows web suggestions should have its own
3672 * setting for this.
Mike LeBeau48603e72009-06-05 00:27:00 +01003673 */
Bjorn Bringert24abb662010-09-21 12:21:18 +01003674 @Deprecated
Mike LeBeau48603e72009-06-05 00:27:00 +01003675 public static final String SHOW_WEB_SUGGESTIONS = "show_web_suggestions";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003676
Svetoslav683914b2015-01-15 14:22:26 -08003677 /** @hide */
3678 public static final Validator SHOW_WEB_SUGGESTIONS_VALIDATOR = sBooleanValidator;
3679
-b master501eec92009-07-06 13:53:11 -07003680 /**
Amith Yamasaniae3ed702009-12-01 19:02:05 -08003681 * Whether the notification LED should repeatedly flash when a notification is
3682 * pending. The value is boolean (1 or 0).
3683 * @hide
3684 */
3685 public static final String NOTIFICATION_LIGHT_PULSE = "notification_light_pulse";
3686
Svetoslav683914b2015-01-15 14:22:26 -08003687 /** @hide */
3688 public static final Validator NOTIFICATION_LIGHT_PULSE_VALIDATOR = sBooleanValidator;
3689
Amith Yamasaniae3ed702009-12-01 19:02:05 -08003690 /**
Dianne Hackborn90d2db32010-02-11 22:19:06 -08003691 * Show pointer location on screen?
3692 * 0 = no
3693 * 1 = yes
3694 * @hide
3695 */
3696 public static final String POINTER_LOCATION = "pointer_location";
3697
Svetoslav683914b2015-01-15 14:22:26 -08003698 /** @hide */
3699 public static final Validator POINTER_LOCATION_VALIDATOR = sBooleanValidator;
3700
Dianne Hackborn90d2db32010-02-11 22:19:06 -08003701 /**
Jeff Browndaf4a122011-08-26 17:14:14 -07003702 * Show touch positions on screen?
3703 * 0 = no
3704 * 1 = yes
3705 * @hide
3706 */
3707 public static final String SHOW_TOUCHES = "show_touches";
3708
Svetoslav683914b2015-01-15 14:22:26 -08003709 /** @hide */
3710 public static final Validator SHOW_TOUCHES_VALIDATOR = sBooleanValidator;
3711
Jeff Browndaf4a122011-08-26 17:14:14 -07003712 /**
Dianne Hackborn16ec0802014-08-15 18:32:33 -07003713 * Log raw orientation data from
Jorim Jaggib10e33f2015-02-04 21:57:40 +01003714 * {@link com.android.server.policy.WindowOrientationListener} for use with the
Jeff Brown4519f072011-01-23 13:16:01 -08003715 * orientationplot.py tool.
3716 * 0 = no
3717 * 1 = yes
3718 * @hide
3719 */
3720 public static final String WINDOW_ORIENTATION_LISTENER_LOG =
3721 "window_orientation_listener_log";
3722
Svetoslav683914b2015-01-15 14:22:26 -08003723 /** @hide */
3724 public static final Validator WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR = sBooleanValidator;
3725
Jeff Brown4519f072011-01-23 13:16:01 -08003726 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003727 * @deprecated Use {@link android.provider.Settings.Global#POWER_SOUNDS_ENABLED}
3728 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003729 * @hide
3730 */
Christopher Tate06efb532012-08-24 15:29:27 -07003731 @Deprecated
3732 public static final String POWER_SOUNDS_ENABLED = Global.POWER_SOUNDS_ENABLED;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003733
3734 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003735 * @deprecated Use {@link android.provider.Settings.Global#DOCK_SOUNDS_ENABLED}
3736 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003737 * @hide
3738 */
Christopher Tate06efb532012-08-24 15:29:27 -07003739 @Deprecated
3740 public static final String DOCK_SOUNDS_ENABLED = Global.DOCK_SOUNDS_ENABLED;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003741
3742 /**
3743 * Whether to play sounds when the keyguard is shown and dismissed.
3744 * @hide
3745 */
3746 public static final String LOCKSCREEN_SOUNDS_ENABLED = "lockscreen_sounds_enabled";
3747
Svetoslav683914b2015-01-15 14:22:26 -08003748 /** @hide */
3749 public static final Validator LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR = sBooleanValidator;
3750
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003751 /**
Mike Lockwood7bef7392011-10-20 16:51:53 -04003752 * Whether the lockscreen should be completely disabled.
3753 * @hide
3754 */
3755 public static final String LOCKSCREEN_DISABLED = "lockscreen.disabled";
3756
Svetoslav683914b2015-01-15 14:22:26 -08003757 /** @hide */
3758 public static final Validator LOCKSCREEN_DISABLED_VALIDATOR = sBooleanValidator;
3759
Mike Lockwood7bef7392011-10-20 16:51:53 -04003760 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003761 * @deprecated Use {@link android.provider.Settings.Global#LOW_BATTERY_SOUND}
3762 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003763 * @hide
3764 */
Christopher Tate06efb532012-08-24 15:29:27 -07003765 @Deprecated
3766 public static final String LOW_BATTERY_SOUND = Global.LOW_BATTERY_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003767
3768 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003769 * @deprecated Use {@link android.provider.Settings.Global#DESK_DOCK_SOUND}
3770 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003771 * @hide
3772 */
Christopher Tate06efb532012-08-24 15:29:27 -07003773 @Deprecated
3774 public static final String DESK_DOCK_SOUND = Global.DESK_DOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003775
3776 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003777 * @deprecated Use {@link android.provider.Settings.Global#DESK_UNDOCK_SOUND}
3778 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003779 * @hide
3780 */
Christopher Tate06efb532012-08-24 15:29:27 -07003781 @Deprecated
3782 public static final String DESK_UNDOCK_SOUND = Global.DESK_UNDOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003783
3784 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003785 * @deprecated Use {@link android.provider.Settings.Global#CAR_DOCK_SOUND}
3786 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003787 * @hide
3788 */
Christopher Tate06efb532012-08-24 15:29:27 -07003789 @Deprecated
3790 public static final String CAR_DOCK_SOUND = Global.CAR_DOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003791
3792 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003793 * @deprecated Use {@link android.provider.Settings.Global#CAR_UNDOCK_SOUND}
3794 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003795 * @hide
3796 */
Christopher Tate06efb532012-08-24 15:29:27 -07003797 @Deprecated
3798 public static final String CAR_UNDOCK_SOUND = Global.CAR_UNDOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003799
3800 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003801 * @deprecated Use {@link android.provider.Settings.Global#LOCK_SOUND}
3802 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003803 * @hide
3804 */
Christopher Tate06efb532012-08-24 15:29:27 -07003805 @Deprecated
3806 public static final String LOCK_SOUND = Global.LOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003807
3808 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003809 * @deprecated Use {@link android.provider.Settings.Global#UNLOCK_SOUND}
3810 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003811 * @hide
3812 */
Christopher Tate06efb532012-08-24 15:29:27 -07003813 @Deprecated
3814 public static final String UNLOCK_SOUND = Global.UNLOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003815
3816 /**
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003817 * Receive incoming SIP calls?
3818 * 0 = no
3819 * 1 = yes
3820 * @hide
3821 */
3822 public static final String SIP_RECEIVE_CALLS = "sip_receive_calls";
3823
Svetoslav683914b2015-01-15 14:22:26 -08003824 /** @hide */
3825 public static final Validator SIP_RECEIVE_CALLS_VALIDATOR = sBooleanValidator;
3826
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003827 /**
3828 * Call Preference String.
3829 * "SIP_ALWAYS" : Always use SIP with network access
3830 * "SIP_ADDRESS_ONLY" : Only if destination is a SIP address
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003831 * @hide
3832 */
3833 public static final String SIP_CALL_OPTIONS = "sip_call_options";
3834
Svetoslav683914b2015-01-15 14:22:26 -08003835 /** @hide */
3836 public static final Validator SIP_CALL_OPTIONS_VALIDATOR = new DiscreteValueValidator(
3837 new String[] {"SIP_ALWAYS", "SIP_ADDRESS_ONLY"});
3838
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003839 /**
3840 * One of the sip call options: Always use SIP with network access.
3841 * @hide
3842 */
3843 public static final String SIP_ALWAYS = "SIP_ALWAYS";
3844
Svetoslav683914b2015-01-15 14:22:26 -08003845 /** @hide */
3846 public static final Validator SIP_ALWAYS_VALIDATOR = sBooleanValidator;
3847
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003848 /**
3849 * One of the sip call options: Only if destination is a SIP address.
3850 * @hide
3851 */
3852 public static final String SIP_ADDRESS_ONLY = "SIP_ADDRESS_ONLY";
3853
Svetoslav683914b2015-01-15 14:22:26 -08003854 /** @hide */
3855 public static final Validator SIP_ADDRESS_ONLY_VALIDATOR = sBooleanValidator;
3856
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003857 /**
Tyler Gunn2c830a22014-09-02 08:39:35 -07003858 * @deprecated Use SIP_ALWAYS or SIP_ADDRESS_ONLY instead. Formerly used to indicate that
3859 * the user should be prompted each time a call is made whether it should be placed using
3860 * SIP. The {@link com.android.providers.settings.DatabaseHelper} replaces this with
3861 * SIP_ADDRESS_ONLY.
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003862 * @hide
3863 */
Tyler Gunn2c830a22014-09-02 08:39:35 -07003864 @Deprecated
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003865 public static final String SIP_ASK_ME_EACH_TIME = "SIP_ASK_ME_EACH_TIME";
3866
Svetoslav683914b2015-01-15 14:22:26 -08003867 /** @hide */
3868 public static final Validator SIP_ASK_ME_EACH_TIME_VALIDATOR = sBooleanValidator;
3869
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003870 /**
Jeff Brown1a84fd12011-06-02 01:26:32 -07003871 * Pointer speed setting.
3872 * This is an integer value in a range between -7 and +7, so there are 15 possible values.
3873 * -7 = slowest
3874 * 0 = default speed
3875 * +7 = fastest
3876 * @hide
3877 */
3878 public static final String POINTER_SPEED = "pointer_speed";
3879
Svetoslav683914b2015-01-15 14:22:26 -08003880 /** @hide */
3881 public static final Validator POINTER_SPEED_VALIDATOR =
3882 new InclusiveFloatRangeValidator(-7, 7);
3883
Jeff Brown1a84fd12011-06-02 01:26:32 -07003884 /**
Jason Monk56e09b42014-07-18 10:29:14 -04003885 * Whether lock-to-app will be triggered by long-press on recents.
3886 * @hide
3887 */
3888 public static final String LOCK_TO_APP_ENABLED = "lock_to_app_enabled";
3889
Svetoslav683914b2015-01-15 14:22:26 -08003890 /** @hide */
3891 public static final Validator LOCK_TO_APP_ENABLED_VALIDATOR = sBooleanValidator;
3892
Jason Monk56e09b42014-07-18 10:29:14 -04003893 /**
Daniel Sandler2fdb68b2013-10-03 00:12:11 -04003894 * I am the lolrus.
3895 * <p>
3896 * Nonzero values indicate that the user has a bukkit.
3897 * Backward-compatible with <code>PrefGetPreference(prefAllowEasterEggs)</code>.
3898 * @hide
3899 */
3900 public static final String EGG_MODE = "egg_mode";
3901
Svetoslav683914b2015-01-15 14:22:26 -08003902 /** @hide */
Svet Ganovb1918a02015-05-15 09:32:55 -07003903 public static final Validator EGG_MODE_VALIDATOR = new Validator() {
3904 @Override
3905 public boolean validate(String value) {
3906 try {
3907 return Long.parseLong(value) >= 0;
3908 } catch (NumberFormatException e) {
3909 return false;
3910 }
3911 }
3912 };
Svetoslav683914b2015-01-15 14:22:26 -08003913
3914 /**
Evan Lairdbcf631d2017-03-10 10:56:45 -05003915 * Setting to determine whether or not to show the battery percentage in the status bar.
3916 * 0 - Don't show percentage
3917 * 1 - Show percentage
3918 * @hide
3919 */
3920 public static final String SHOW_BATTERY_PERCENT = "status_bar_show_battery_percent";
3921
3922 /** @hide */
3923 private static final Validator SHOW_BATTERY_PERCENT_VALIDATOR = sBooleanValidator;
3924
3925 /**
Svetoslav683914b2015-01-15 14:22:26 -08003926 * IMPORTANT: If you add a new public settings you also have to add it to
3927 * PUBLIC_SETTINGS below. If the new setting is hidden you have to add
3928 * it to PRIVATE_SETTINGS below. Also add a validator that can validate
3929 * the setting value. See an example above.
3930 */
3931
Daniel Sandler2fdb68b2013-10-03 00:12:11 -04003932 /**
-b master501eec92009-07-06 13:53:11 -07003933 * Settings to backup. This is here so that it's in the same place as the settings
3934 * keys and easy to update.
Svetoslav Ganova571a582011-09-20 18:32:20 -07003935 *
3936 * NOTE: Settings are backed up and restored in the order they appear
3937 * in this array. If you have one setting depending on another,
3938 * make sure that they are ordered appropriately.
3939 *
-b master501eec92009-07-06 13:53:11 -07003940 * @hide
3941 */
3942 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate66488d62012-10-02 11:58:01 -07003943 STAY_ON_WHILE_PLUGGED_IN, // moved to global
-b master501eec92009-07-06 13:53:11 -07003944 WIFI_USE_STATIC_IP,
3945 WIFI_STATIC_IP,
3946 WIFI_STATIC_GATEWAY,
3947 WIFI_STATIC_NETMASK,
3948 WIFI_STATIC_DNS1,
3949 WIFI_STATIC_DNS2,
3950 BLUETOOTH_DISCOVERABILITY,
3951 BLUETOOTH_DISCOVERABILITY_TIMEOUT,
Casey Burkhardt86b867f2015-12-29 18:03:36 -08003952 FONT_SCALE,
-b master501eec92009-07-06 13:53:11 -07003953 DIM_SCREEN,
3954 SCREEN_OFF_TIMEOUT,
3955 SCREEN_BRIGHTNESS,
Christopher Tate362aca62009-09-25 15:58:03 -07003956 SCREEN_BRIGHTNESS_MODE,
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08003957 SCREEN_AUTO_BRIGHTNESS_ADJ,
Santos Cordonbd9dd552017-02-13 13:37:45 -08003958 SCREEN_BRIGHTNESS_FOR_VR,
Jeff Brown7f6c2312012-04-13 20:38:38 -07003959 VIBRATE_INPUT_DEVICES,
Amith Yamasani8823c0a82009-07-07 14:30:17 -07003960 MODE_RINGER_STREAMS_AFFECTED,
-b master501eec92009-07-06 13:53:11 -07003961 TEXT_AUTO_REPLACE,
3962 TEXT_AUTO_CAPS,
3963 TEXT_AUTO_PUNCTUATE,
3964 TEXT_SHOW_PASSWORD,
Christopher Tate66488d62012-10-02 11:58:01 -07003965 AUTO_TIME, // moved to global
3966 AUTO_TIME_ZONE, // moved to global
-b master501eec92009-07-06 13:53:11 -07003967 TIME_12_24,
3968 DATE_FORMAT,
-b master501eec92009-07-06 13:53:11 -07003969 DTMF_TONE_WHEN_DIALING,
3970 DTMF_TONE_TYPE_WHEN_DIALING,
-b master501eec92009-07-06 13:53:11 -07003971 HEARING_AID,
3972 TTY_MODE,
Christopher Tateea2d6e82016-05-19 16:55:49 -07003973 MASTER_MONO,
-b master501eec92009-07-06 13:53:11 -07003974 SOUND_EFFECTS_ENABLED,
3975 HAPTIC_FEEDBACK_ENABLED,
Christopher Tate66488d62012-10-02 11:58:01 -07003976 POWER_SOUNDS_ENABLED, // moved to global
3977 DOCK_SOUNDS_ENABLED, // moved to global
Christopher Tate14c2d792010-02-25 16:49:44 -08003978 LOCKSCREEN_SOUNDS_ENABLED,
Amith Yamasaniae3ed702009-12-01 19:02:05 -08003979 SHOW_WEB_SUGGESTIONS,
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003980 SIP_CALL_OPTIONS,
Nick Pelly038cabe2010-09-23 16:12:11 -07003981 SIP_RECEIVE_CALLS,
Jeff Brown1a84fd12011-06-02 01:26:32 -07003982 POINTER_SPEED,
Amith Yamasani622bf2222013-09-06 13:54:28 -07003983 VIBRATE_WHEN_RINGING,
3984 RINGTONE,
Jason Monk94cfd9d2014-10-31 13:18:21 -04003985 LOCK_TO_APP_ENABLED,
Anna Galuszafa7786c2015-12-22 10:53:44 -08003986 NOTIFICATION_SOUND,
Evan Lairdbcf631d2017-03-10 10:56:45 -05003987 ACCELEROMETER_ROTATION,
3988 SHOW_BATTERY_PERCENT
-b master501eec92009-07-06 13:53:11 -07003989 };
3990
Sailesh Nepal1bd78762014-02-11 22:32:21 -08003991 /**
Christopher Tate1d0fca32017-06-06 13:30:00 -07003992 * Keys we no longer back up under the current schema, but want to continue to
3993 * process when restoring historical backup datasets.
3994 *
3995 * @hide
3996 */
3997 public static final String[] LEGACY_RESTORE_SETTINGS = {
3998 };
3999
4000 /**
Amith Yamasanib0ff3222015-03-04 09:56:14 -08004001 * These are all public system settings
Svetoslav683914b2015-01-15 14:22:26 -08004002 *
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07004003 * @hide
4004 */
Svetoslav683914b2015-01-15 14:22:26 -08004005 public static final Set<String> PUBLIC_SETTINGS = new ArraySet<>();
4006 static {
4007 PUBLIC_SETTINGS.add(END_BUTTON_BEHAVIOR);
4008 PUBLIC_SETTINGS.add(WIFI_USE_STATIC_IP);
4009 PUBLIC_SETTINGS.add(WIFI_STATIC_IP);
4010 PUBLIC_SETTINGS.add(WIFI_STATIC_GATEWAY);
4011 PUBLIC_SETTINGS.add(WIFI_STATIC_NETMASK);
4012 PUBLIC_SETTINGS.add(WIFI_STATIC_DNS1);
4013 PUBLIC_SETTINGS.add(WIFI_STATIC_DNS2);
4014 PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY);
4015 PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY_TIMEOUT);
4016 PUBLIC_SETTINGS.add(NEXT_ALARM_FORMATTED);
4017 PUBLIC_SETTINGS.add(FONT_SCALE);
4018 PUBLIC_SETTINGS.add(DIM_SCREEN);
4019 PUBLIC_SETTINGS.add(SCREEN_OFF_TIMEOUT);
4020 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS);
4021 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_MODE);
4022 PUBLIC_SETTINGS.add(MODE_RINGER_STREAMS_AFFECTED);
4023 PUBLIC_SETTINGS.add(MUTE_STREAMS_AFFECTED);
4024 PUBLIC_SETTINGS.add(VIBRATE_ON);
4025 PUBLIC_SETTINGS.add(VOLUME_RING);
4026 PUBLIC_SETTINGS.add(VOLUME_SYSTEM);
4027 PUBLIC_SETTINGS.add(VOLUME_VOICE);
4028 PUBLIC_SETTINGS.add(VOLUME_MUSIC);
4029 PUBLIC_SETTINGS.add(VOLUME_ALARM);
4030 PUBLIC_SETTINGS.add(VOLUME_NOTIFICATION);
4031 PUBLIC_SETTINGS.add(VOLUME_BLUETOOTH_SCO);
4032 PUBLIC_SETTINGS.add(RINGTONE);
4033 PUBLIC_SETTINGS.add(NOTIFICATION_SOUND);
4034 PUBLIC_SETTINGS.add(ALARM_ALERT);
4035 PUBLIC_SETTINGS.add(TEXT_AUTO_REPLACE);
4036 PUBLIC_SETTINGS.add(TEXT_AUTO_CAPS);
4037 PUBLIC_SETTINGS.add(TEXT_AUTO_PUNCTUATE);
4038 PUBLIC_SETTINGS.add(TEXT_SHOW_PASSWORD);
4039 PUBLIC_SETTINGS.add(SHOW_GTALK_SERVICE_STATUS);
4040 PUBLIC_SETTINGS.add(WALLPAPER_ACTIVITY);
4041 PUBLIC_SETTINGS.add(TIME_12_24);
4042 PUBLIC_SETTINGS.add(DATE_FORMAT);
4043 PUBLIC_SETTINGS.add(SETUP_WIZARD_HAS_RUN);
4044 PUBLIC_SETTINGS.add(ACCELEROMETER_ROTATION);
4045 PUBLIC_SETTINGS.add(USER_ROTATION);
4046 PUBLIC_SETTINGS.add(DTMF_TONE_WHEN_DIALING);
4047 PUBLIC_SETTINGS.add(SOUND_EFFECTS_ENABLED);
4048 PUBLIC_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED);
4049 PUBLIC_SETTINGS.add(SHOW_WEB_SUGGESTIONS);
Svetoslav Ganovd2631632015-12-09 16:29:22 -08004050 PUBLIC_SETTINGS.add(VIBRATE_WHEN_RINGING);
Svetoslav683914b2015-01-15 14:22:26 -08004051 }
4052
4053 /**
4054 * These are all hidden system settings.
4055 *
4056 * @hide
4057 */
4058 public static final Set<String> PRIVATE_SETTINGS = new ArraySet<>();
4059 static {
4060 PRIVATE_SETTINGS.add(WIFI_USE_STATIC_IP);
4061 PRIVATE_SETTINGS.add(END_BUTTON_BEHAVIOR);
4062 PRIVATE_SETTINGS.add(ADVANCED_SETTINGS);
4063 PRIVATE_SETTINGS.add(SCREEN_AUTO_BRIGHTNESS_ADJ);
4064 PRIVATE_SETTINGS.add(VIBRATE_INPUT_DEVICES);
4065 PRIVATE_SETTINGS.add(VOLUME_MASTER);
Andy Hungf04b84d2015-12-18 17:33:27 -08004066 PRIVATE_SETTINGS.add(MASTER_MONO);
Svetoslav683914b2015-01-15 14:22:26 -08004067 PRIVATE_SETTINGS.add(NOTIFICATIONS_USE_RING_VOLUME);
4068 PRIVATE_SETTINGS.add(VIBRATE_IN_SILENT);
4069 PRIVATE_SETTINGS.add(MEDIA_BUTTON_RECEIVER);
4070 PRIVATE_SETTINGS.add(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY);
Svetoslav683914b2015-01-15 14:22:26 -08004071 PRIVATE_SETTINGS.add(DTMF_TONE_TYPE_WHEN_DIALING);
4072 PRIVATE_SETTINGS.add(HEARING_AID);
4073 PRIVATE_SETTINGS.add(TTY_MODE);
4074 PRIVATE_SETTINGS.add(NOTIFICATION_LIGHT_PULSE);
4075 PRIVATE_SETTINGS.add(POINTER_LOCATION);
4076 PRIVATE_SETTINGS.add(SHOW_TOUCHES);
4077 PRIVATE_SETTINGS.add(WINDOW_ORIENTATION_LISTENER_LOG);
4078 PRIVATE_SETTINGS.add(POWER_SOUNDS_ENABLED);
4079 PRIVATE_SETTINGS.add(DOCK_SOUNDS_ENABLED);
4080 PRIVATE_SETTINGS.add(LOCKSCREEN_SOUNDS_ENABLED);
4081 PRIVATE_SETTINGS.add(LOCKSCREEN_DISABLED);
4082 PRIVATE_SETTINGS.add(LOW_BATTERY_SOUND);
4083 PRIVATE_SETTINGS.add(DESK_DOCK_SOUND);
4084 PRIVATE_SETTINGS.add(DESK_UNDOCK_SOUND);
4085 PRIVATE_SETTINGS.add(CAR_DOCK_SOUND);
4086 PRIVATE_SETTINGS.add(CAR_UNDOCK_SOUND);
4087 PRIVATE_SETTINGS.add(LOCK_SOUND);
4088 PRIVATE_SETTINGS.add(UNLOCK_SOUND);
4089 PRIVATE_SETTINGS.add(SIP_RECEIVE_CALLS);
4090 PRIVATE_SETTINGS.add(SIP_CALL_OPTIONS);
4091 PRIVATE_SETTINGS.add(SIP_ALWAYS);
4092 PRIVATE_SETTINGS.add(SIP_ADDRESS_ONLY);
4093 PRIVATE_SETTINGS.add(SIP_ASK_ME_EACH_TIME);
4094 PRIVATE_SETTINGS.add(POINTER_SPEED);
4095 PRIVATE_SETTINGS.add(LOCK_TO_APP_ENABLED);
4096 PRIVATE_SETTINGS.add(EGG_MODE);
Evan Lairdbcf631d2017-03-10 10:56:45 -05004097 PRIVATE_SETTINGS.add(SHOW_BATTERY_PERCENT);
Svetoslav683914b2015-01-15 14:22:26 -08004098 }
4099
4100 /**
Amith Yamasanib0ff3222015-03-04 09:56:14 -08004101 * These are all public system settings
Svetoslav683914b2015-01-15 14:22:26 -08004102 *
4103 * @hide
4104 */
4105 public static final Map<String, Validator> VALIDATORS = new ArrayMap<>();
4106 static {
4107 VALIDATORS.put(END_BUTTON_BEHAVIOR,END_BUTTON_BEHAVIOR_VALIDATOR);
4108 VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR);
4109 VALIDATORS.put(BLUETOOTH_DISCOVERABILITY, BLUETOOTH_DISCOVERABILITY_VALIDATOR);
4110 VALIDATORS.put(BLUETOOTH_DISCOVERABILITY_TIMEOUT,
4111 BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR);
4112 VALIDATORS.put(NEXT_ALARM_FORMATTED, NEXT_ALARM_FORMATTED_VALIDATOR);
4113 VALIDATORS.put(FONT_SCALE, FONT_SCALE_VALIDATOR);
4114 VALIDATORS.put(DIM_SCREEN, DIM_SCREEN_VALIDATOR);
4115 VALIDATORS.put(SCREEN_OFF_TIMEOUT, SCREEN_OFF_TIMEOUT_VALIDATOR);
4116 VALIDATORS.put(SCREEN_BRIGHTNESS, SCREEN_BRIGHTNESS_VALIDATOR);
Santos Cordon3107d292016-09-20 15:50:35 -07004117 VALIDATORS.put(SCREEN_BRIGHTNESS_FOR_VR, SCREEN_BRIGHTNESS_FOR_VR_VALIDATOR);
Svetoslav683914b2015-01-15 14:22:26 -08004118 VALIDATORS.put(SCREEN_BRIGHTNESS_MODE, SCREEN_BRIGHTNESS_MODE_VALIDATOR);
4119 VALIDATORS.put(MODE_RINGER_STREAMS_AFFECTED, MODE_RINGER_STREAMS_AFFECTED_VALIDATOR);
4120 VALIDATORS.put(MUTE_STREAMS_AFFECTED, MUTE_STREAMS_AFFECTED_VALIDATOR);
4121 VALIDATORS.put(VIBRATE_ON, VIBRATE_ON_VALIDATOR);
Svetoslav683914b2015-01-15 14:22:26 -08004122 VALIDATORS.put(RINGTONE, RINGTONE_VALIDATOR);
4123 VALIDATORS.put(NOTIFICATION_SOUND, NOTIFICATION_SOUND_VALIDATOR);
4124 VALIDATORS.put(ALARM_ALERT, ALARM_ALERT_VALIDATOR);
4125 VALIDATORS.put(TEXT_AUTO_REPLACE, TEXT_AUTO_REPLACE_VALIDATOR);
4126 VALIDATORS.put(TEXT_AUTO_CAPS, TEXT_AUTO_CAPS_VALIDATOR);
4127 VALIDATORS.put(TEXT_AUTO_PUNCTUATE, TEXT_AUTO_PUNCTUATE_VALIDATOR);
4128 VALIDATORS.put(TEXT_SHOW_PASSWORD, TEXT_SHOW_PASSWORD_VALIDATOR);
4129 VALIDATORS.put(SHOW_GTALK_SERVICE_STATUS, SHOW_GTALK_SERVICE_STATUS_VALIDATOR);
4130 VALIDATORS.put(WALLPAPER_ACTIVITY, WALLPAPER_ACTIVITY_VALIDATOR);
4131 VALIDATORS.put(TIME_12_24, TIME_12_24_VALIDATOR);
4132 VALIDATORS.put(DATE_FORMAT, DATE_FORMAT_VALIDATOR);
4133 VALIDATORS.put(SETUP_WIZARD_HAS_RUN, SETUP_WIZARD_HAS_RUN_VALIDATOR);
4134 VALIDATORS.put(ACCELEROMETER_ROTATION, ACCELEROMETER_ROTATION_VALIDATOR);
4135 VALIDATORS.put(USER_ROTATION, USER_ROTATION_VALIDATOR);
4136 VALIDATORS.put(DTMF_TONE_WHEN_DIALING, DTMF_TONE_WHEN_DIALING_VALIDATOR);
4137 VALIDATORS.put(SOUND_EFFECTS_ENABLED, SOUND_EFFECTS_ENABLED_VALIDATOR);
4138 VALIDATORS.put(HAPTIC_FEEDBACK_ENABLED, HAPTIC_FEEDBACK_ENABLED_VALIDATOR);
4139 VALIDATORS.put(SHOW_WEB_SUGGESTIONS, SHOW_WEB_SUGGESTIONS_VALIDATOR);
4140 VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR);
4141 VALIDATORS.put(END_BUTTON_BEHAVIOR, END_BUTTON_BEHAVIOR_VALIDATOR);
4142 VALIDATORS.put(ADVANCED_SETTINGS, ADVANCED_SETTINGS_VALIDATOR);
4143 VALIDATORS.put(SCREEN_AUTO_BRIGHTNESS_ADJ, SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR);
4144 VALIDATORS.put(VIBRATE_INPUT_DEVICES, VIBRATE_INPUT_DEVICES_VALIDATOR);
Andy Hungf04b84d2015-12-18 17:33:27 -08004145 VALIDATORS.put(MASTER_MONO, MASTER_MONO_VALIDATOR);
Svetoslav683914b2015-01-15 14:22:26 -08004146 VALIDATORS.put(NOTIFICATIONS_USE_RING_VOLUME, NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR);
4147 VALIDATORS.put(VIBRATE_IN_SILENT, VIBRATE_IN_SILENT_VALIDATOR);
4148 VALIDATORS.put(MEDIA_BUTTON_RECEIVER, MEDIA_BUTTON_RECEIVER_VALIDATOR);
4149 VALIDATORS.put(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY,
4150 HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR);
4151 VALIDATORS.put(VIBRATE_WHEN_RINGING, VIBRATE_WHEN_RINGING_VALIDATOR);
4152 VALIDATORS.put(DTMF_TONE_TYPE_WHEN_DIALING, DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR);
4153 VALIDATORS.put(HEARING_AID, HEARING_AID_VALIDATOR);
4154 VALIDATORS.put(TTY_MODE, TTY_MODE_VALIDATOR);
4155 VALIDATORS.put(NOTIFICATION_LIGHT_PULSE, NOTIFICATION_LIGHT_PULSE_VALIDATOR);
4156 VALIDATORS.put(POINTER_LOCATION, POINTER_LOCATION_VALIDATOR);
4157 VALIDATORS.put(SHOW_TOUCHES, SHOW_TOUCHES_VALIDATOR);
4158 VALIDATORS.put(WINDOW_ORIENTATION_LISTENER_LOG,
4159 WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR);
4160 VALIDATORS.put(LOCKSCREEN_SOUNDS_ENABLED, LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR);
4161 VALIDATORS.put(LOCKSCREEN_DISABLED, LOCKSCREEN_DISABLED_VALIDATOR);
4162 VALIDATORS.put(SIP_RECEIVE_CALLS, SIP_RECEIVE_CALLS_VALIDATOR);
4163 VALIDATORS.put(SIP_CALL_OPTIONS, SIP_CALL_OPTIONS_VALIDATOR);
4164 VALIDATORS.put(SIP_ALWAYS, SIP_ALWAYS_VALIDATOR);
4165 VALIDATORS.put(SIP_ADDRESS_ONLY, SIP_ADDRESS_ONLY_VALIDATOR);
4166 VALIDATORS.put(SIP_ASK_ME_EACH_TIME, SIP_ASK_ME_EACH_TIME_VALIDATOR);
4167 VALIDATORS.put(POINTER_SPEED, POINTER_SPEED_VALIDATOR);
4168 VALIDATORS.put(LOCK_TO_APP_ENABLED, LOCK_TO_APP_ENABLED_VALIDATOR);
4169 VALIDATORS.put(EGG_MODE, EGG_MODE_VALIDATOR);
4170 VALIDATORS.put(WIFI_STATIC_IP, WIFI_STATIC_IP_VALIDATOR);
4171 VALIDATORS.put(WIFI_STATIC_GATEWAY, WIFI_STATIC_GATEWAY_VALIDATOR);
4172 VALIDATORS.put(WIFI_STATIC_NETMASK, WIFI_STATIC_NETMASK_VALIDATOR);
4173 VALIDATORS.put(WIFI_STATIC_DNS1, WIFI_STATIC_DNS1_VALIDATOR);
4174 VALIDATORS.put(WIFI_STATIC_DNS2, WIFI_STATIC_DNS2_VALIDATOR);
Evan Lairdbcf631d2017-03-10 10:56:45 -05004175 VALIDATORS.put(SHOW_BATTERY_PERCENT, SHOW_BATTERY_PERCENT_VALIDATOR);
Svetoslav683914b2015-01-15 14:22:26 -08004176 }
4177
4178 /**
4179 * These entries are considered common between the personal and the managed profile,
4180 * since the managed profile doesn't get to change them.
4181 */
4182 private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>();
4183 static {
4184 CLONE_TO_MANAGED_PROFILE.add(DATE_FORMAT);
4185 CLONE_TO_MANAGED_PROFILE.add(HAPTIC_FEEDBACK_ENABLED);
4186 CLONE_TO_MANAGED_PROFILE.add(SOUND_EFFECTS_ENABLED);
4187 CLONE_TO_MANAGED_PROFILE.add(TEXT_SHOW_PASSWORD);
4188 CLONE_TO_MANAGED_PROFILE.add(TIME_12_24);
4189 }
4190
4191 /** @hide */
4192 public static void getCloneToManagedProfileSettings(Set<String> outKeySet) {
4193 outKeySet.addAll(CLONE_TO_MANAGED_PROFILE);
4194 }
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07004195
4196 /**
Andre Lago3fa139c2016-08-04 13:53:44 +01004197 * These entries should be cloned from this profile's parent only if the dependency's
4198 * value is true ("1")
4199 *
4200 * Note: the dependencies must be Secure settings
4201 *
4202 * @hide
4203 */
4204 public static final Map<String, String> CLONE_FROM_PARENT_ON_VALUE = new ArrayMap<>();
4205 static {
4206 CLONE_FROM_PARENT_ON_VALUE.put(RINGTONE, Secure.SYNC_PARENT_SOUNDS);
4207 CLONE_FROM_PARENT_ON_VALUE.put(NOTIFICATION_SOUND, Secure.SYNC_PARENT_SOUNDS);
4208 CLONE_FROM_PARENT_ON_VALUE.put(ALARM_ALERT, Secure.SYNC_PARENT_SOUNDS);
4209 }
4210
4211 /** @hide */
4212 public static void getCloneFromParentOnValueSettings(Map<String, String> outMap) {
4213 outMap.putAll(CLONE_FROM_PARENT_ON_VALUE);
4214 }
4215
4216 /**
Todd Kennedybe0b8892017-02-15 14:13:52 -08004217 * System settings which can be accessed by instant apps.
Chad Brubaker97bccee2017-01-05 15:51:41 -08004218 * @hide
4219 */
Todd Kennedybe0b8892017-02-15 14:13:52 -08004220 public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>();
Chad Brubaker97bccee2017-01-05 15:51:41 -08004221 static {
Todd Kennedybe0b8892017-02-15 14:13:52 -08004222 INSTANT_APP_SETTINGS.add(TEXT_AUTO_REPLACE);
4223 INSTANT_APP_SETTINGS.add(TEXT_AUTO_CAPS);
4224 INSTANT_APP_SETTINGS.add(TEXT_AUTO_PUNCTUATE);
4225 INSTANT_APP_SETTINGS.add(TEXT_SHOW_PASSWORD);
4226 INSTANT_APP_SETTINGS.add(DATE_FORMAT);
4227 INSTANT_APP_SETTINGS.add(FONT_SCALE);
4228 INSTANT_APP_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED);
4229 INSTANT_APP_SETTINGS.add(TIME_12_24);
4230 INSTANT_APP_SETTINGS.add(SOUND_EFFECTS_ENABLED);
Chad Brubaker562afaf2017-04-10 13:32:37 -07004231 INSTANT_APP_SETTINGS.add(ACCELEROMETER_ROTATION);
Chad Brubaker97bccee2017-01-05 15:51:41 -08004232 }
4233
4234 /**
Sailesh Nepal1bd78762014-02-11 22:32:21 -08004235 * When to use Wi-Fi calling
4236 *
4237 * @see android.telephony.TelephonyManager.WifiCallingChoices
4238 * @hide
4239 */
4240 public static final String WHEN_TO_MAKE_WIFI_CALLS = "when_to_make_wifi_calls";
4241
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004242 // Settings moved to Settings.Secure
4243
4244 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004245 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004246 * instead
4247 */
4248 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07004249 public static final String ADB_ENABLED = Global.ADB_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004250
4251 /**
4252 * @deprecated Use {@link android.provider.Settings.Secure#ANDROID_ID} instead
4253 */
4254 @Deprecated
4255 public static final String ANDROID_ID = Secure.ANDROID_ID;
4256
4257 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004258 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004259 */
4260 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07004261 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004262
4263 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004264 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004265 */
4266 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07004267 public static final String DATA_ROAMING = Global.DATA_ROAMING;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004268
4269 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004270 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004271 */
4272 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07004273 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004274
4275 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07004276 * @deprecated Use {@link android.provider.Settings.Global#HTTP_PROXY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004277 */
4278 @Deprecated
Jeff Sharkey625239a2012-09-26 22:03:49 -07004279 public static final String HTTP_PROXY = Global.HTTP_PROXY;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004280
4281 /**
Christopher Tateaa036a22014-05-19 16:33:27 -07004282 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004283 */
4284 @Deprecated
Christopher Tateaa036a22014-05-19 16:33:27 -07004285 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004286
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004287 /**
4288 * @deprecated Use {@link android.provider.Settings.Secure#LOCATION_PROVIDERS_ALLOWED}
4289 * instead
4290 */
4291 @Deprecated
4292 public static final String LOCATION_PROVIDERS_ALLOWED = Secure.LOCATION_PROVIDERS_ALLOWED;
4293
4294 /**
4295 * @deprecated Use {@link android.provider.Settings.Secure#LOGGING_ID} instead
4296 */
4297 @Deprecated
4298 public static final String LOGGING_ID = Secure.LOGGING_ID;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004299
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004300 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004301 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004302 */
4303 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07004304 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004305
4306 /**
4307 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_ENABLED}
4308 * instead
4309 */
4310 @Deprecated
4311 public static final String PARENTAL_CONTROL_ENABLED = Secure.PARENTAL_CONTROL_ENABLED;
4312
4313 /**
4314 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_LAST_UPDATE}
4315 * instead
4316 */
4317 @Deprecated
4318 public static final String PARENTAL_CONTROL_LAST_UPDATE = Secure.PARENTAL_CONTROL_LAST_UPDATE;
4319
4320 /**
4321 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_REDIRECT_URL}
4322 * instead
4323 */
4324 @Deprecated
4325 public static final String PARENTAL_CONTROL_REDIRECT_URL =
4326 Secure.PARENTAL_CONTROL_REDIRECT_URL;
4327
4328 /**
4329 * @deprecated Use {@link android.provider.Settings.Secure#SETTINGS_CLASSNAME} instead
4330 */
4331 @Deprecated
4332 public static final String SETTINGS_CLASSNAME = Secure.SETTINGS_CLASSNAME;
4333
4334 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004335 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004336 */
4337 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07004338 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004339
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004340 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004341 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004342 */
4343 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07004344 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004345
Dianne Hackborn4a51c202009-08-21 15:14:02 -07004346 /**
4347 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07004348 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
Dianne Hackborn4a51c202009-08-21 15:14:02 -07004349 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004350 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07004351 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 -08004352
Dianne Hackborn4a51c202009-08-21 15:14:02 -07004353 /**
4354 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07004355 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
Dianne Hackborn4a51c202009-08-21 15:14:02 -07004356 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004357 @Deprecated
4358 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
Christopher Tate06efb532012-08-24 15:29:27 -07004359 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004360
4361 /**
4362 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07004363 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004364 */
4365 @Deprecated
4366 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
Christopher Tate06efb532012-08-24 15:29:27 -07004367 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004368
4369 /**
4370 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07004371 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004372 */
4373 @Deprecated
4374 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
Christopher Tate06efb532012-08-24 15:29:27 -07004375 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004376
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004377 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004378 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004379 * instead
4380 */
4381 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07004382 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 -08004383
4384 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004385 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004386 */
4387 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07004388 public static final String WIFI_ON = Global.WIFI_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004389
4390 /**
4391 * @deprecated Use
4392 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE}
4393 * instead
4394 */
4395 @Deprecated
4396 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
4397 Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE;
4398
4399 /**
4400 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_AP_COUNT} instead
4401 */
4402 @Deprecated
4403 public static final String WIFI_WATCHDOG_AP_COUNT = Secure.WIFI_WATCHDOG_AP_COUNT;
4404
4405 /**
4406 * @deprecated Use
4407 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS} instead
4408 */
4409 @Deprecated
4410 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
4411 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004412
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004413 /**
4414 * @deprecated Use
4415 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED} instead
4416 */
4417 @Deprecated
4418 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
4419 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED;
4420
4421 /**
4422 * @deprecated Use
4423 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS}
4424 * instead
4425 */
4426 @Deprecated
4427 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
4428 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS;
4429
4430 /**
4431 * @deprecated Use
4432 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT} instead
4433 */
4434 @Deprecated
4435 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
4436 Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT;
4437
4438 /**
4439 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_MAX_AP_CHECKS}
4440 * instead
4441 */
4442 @Deprecated
4443 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = Secure.WIFI_WATCHDOG_MAX_AP_CHECKS;
4444
4445 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004446 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004447 */
4448 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07004449 public static final String WIFI_WATCHDOG_ON = Global.WIFI_WATCHDOG_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004450
4451 /**
4452 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_COUNT} instead
4453 */
4454 @Deprecated
4455 public static final String WIFI_WATCHDOG_PING_COUNT = Secure.WIFI_WATCHDOG_PING_COUNT;
4456
4457 /**
4458 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_DELAY_MS}
4459 * instead
4460 */
4461 @Deprecated
4462 public static final String WIFI_WATCHDOG_PING_DELAY_MS = Secure.WIFI_WATCHDOG_PING_DELAY_MS;
4463
4464 /**
4465 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_TIMEOUT_MS}
4466 * instead
4467 */
4468 @Deprecated
4469 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS =
4470 Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS;
Billy Lau6ad2d662015-07-18 00:26:58 +01004471
4472 /**
Trevor Johns682c24e2016-04-12 10:13:47 -07004473 * Checks if the specified app can modify system settings. As of API
4474 * level 23, an app cannot modify system settings unless it declares the
4475 * {@link android.Manifest.permission#WRITE_SETTINGS}
4476 * permission in its manifest, <em>and</em> the user specifically grants
4477 * the app this capability. To prompt the user to grant this approval,
4478 * the app must send an intent with the action {@link
4479 * android.provider.Settings#ACTION_MANAGE_WRITE_SETTINGS}, which causes
4480 * the system to display a permission management screen.
Billy Lau6ad2d662015-07-18 00:26:58 +01004481 *
Trevor Johns682c24e2016-04-12 10:13:47 -07004482 * @param context App context.
Billy Lau6ad2d662015-07-18 00:26:58 +01004483 * @return true if the calling app can write to system settings, false otherwise
4484 */
4485 public static boolean canWrite(Context context) {
Svet Ganov94ba40172016-04-03 22:04:22 -07004486 return isCallingPackageAllowedToWriteSettings(context, Process.myUid(),
4487 context.getOpPackageName(), false);
Billy Lau6ad2d662015-07-18 00:26:58 +01004488 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004489 }
4490
4491 /**
4492 * Secure system settings, containing system preferences that applications
4493 * can read but are not allowed to write. These are for preferences that
4494 * the user must explicitly modify through the system UI or specialized
4495 * APIs for those values, not modified directly by applications.
4496 */
4497 public static final class Secure extends NameValueTable {
Dianne Hackborn139748f2012-09-24 11:36:57 -07004498 /**
4499 * The content:// style URL for this table
4500 */
4501 public static final Uri CONTENT_URI =
4502 Uri.parse("content://" + AUTHORITY + "/secure");
4503
Svetoslav Ganove080da92016-12-21 17:10:35 -08004504 private static final ContentProviderHolder sProviderHolder =
4505 new ContentProviderHolder(CONTENT_URI);
4506
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08004507 // Populated lazily, guarded by class object:
Dianne Hackborn139748f2012-09-24 11:36:57 -07004508 private static final NameValueCache sNameValueCache = new NameValueCache(
Dianne Hackborn139748f2012-09-24 11:36:57 -07004509 CONTENT_URI,
4510 CALL_METHOD_GET_SECURE,
Svetoslav Ganove080da92016-12-21 17:10:35 -08004511 CALL_METHOD_PUT_SECURE,
4512 sProviderHolder);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004513
Amith Yamasani52c489c2012-03-28 11:42:42 -07004514 private static ILockSettings sLockSettings = null;
4515
Amith Yamasani7ab8c4a2012-04-06 09:27:12 -07004516 private static boolean sIsSystemProcess;
Amith Yamasani52c489c2012-03-28 11:42:42 -07004517 private static final HashSet<String> MOVED_TO_LOCK_SETTINGS;
Christopher Tate06efb532012-08-24 15:29:27 -07004518 private static final HashSet<String> MOVED_TO_GLOBAL;
Amith Yamasani52c489c2012-03-28 11:42:42 -07004519 static {
Steve McKayea93fe72016-12-02 11:35:35 -08004520 MOVED_TO_LOCK_SETTINGS = new HashSet<>(3);
Amith Yamasani52c489c2012-03-28 11:42:42 -07004521 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_ENABLED);
4522 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_VISIBLE);
4523 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
Christopher Tate06efb532012-08-24 15:29:27 -07004524
Steve McKayea93fe72016-12-02 11:35:35 -08004525 MOVED_TO_GLOBAL = new HashSet<>();
Christopher Tate06efb532012-08-24 15:29:27 -07004526 MOVED_TO_GLOBAL.add(Settings.Global.ADB_ENABLED);
4527 MOVED_TO_GLOBAL.add(Settings.Global.ASSISTED_GPS_ENABLED);
4528 MOVED_TO_GLOBAL.add(Settings.Global.BLUETOOTH_ON);
Christopher Tate58f41ec2013-01-11 15:40:36 -08004529 MOVED_TO_GLOBAL.add(Settings.Global.BUGREPORT_IN_POWER_MENU);
Christopher Tate06efb532012-08-24 15:29:27 -07004530 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_CELL_BROADCAST_SMS);
4531 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_ROAMING_MODE);
4532 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_SUBSCRIPTION_MODE);
4533 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_MOBILE);
4534 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_WIFI);
4535 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ROAMING);
4536 MOVED_TO_GLOBAL.add(Settings.Global.DEVELOPMENT_SETTINGS_ENABLED);
4537 MOVED_TO_GLOBAL.add(Settings.Global.DEVICE_PROVISIONED);
Christopher Tate06efb532012-08-24 15:29:27 -07004538 MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_SIZE_FORCED);
4539 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_MAX_BYTES_OVER_MOBILE);
4540 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE);
Christopher Tate06efb532012-08-24 15:29:27 -07004541 MOVED_TO_GLOBAL.add(Settings.Global.MOBILE_DATA);
4542 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_BUCKET_DURATION);
4543 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_DELETE_AGE);
4544 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_PERSIST_BYTES);
4545 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_ROTATE_AGE);
4546 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_ENABLED);
4547 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_GLOBAL_ALERT_BYTES);
4548 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_POLL_INTERVAL);
Christopher Tate06efb532012-08-24 15:29:27 -07004549 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_SAMPLE_ENABLED);
4550 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_TIME_CACHE_MAX_AGE);
4551 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_BUCKET_DURATION);
4552 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_DELETE_AGE);
4553 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_PERSIST_BYTES);
4554 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_ROTATE_AGE);
4555 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_BUCKET_DURATION);
4556 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_DELETE_AGE);
4557 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_PERSIST_BYTES);
4558 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_ROTATE_AGE);
4559 MOVED_TO_GLOBAL.add(Settings.Global.NETWORK_PREFERENCE);
4560 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_DIFF);
4561 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_SPACING);
4562 MOVED_TO_GLOBAL.add(Settings.Global.NTP_SERVER);
4563 MOVED_TO_GLOBAL.add(Settings.Global.NTP_TIMEOUT);
4564 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_ERROR_POLL_COUNT);
4565 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_LONG_POLL_INTERVAL_MS);
4566 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT);
4567 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_POLL_INTERVAL_MS);
4568 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_TRIGGER_PACKET_COUNT);
4569 MOVED_TO_GLOBAL.add(Settings.Global.SAMPLING_PROFILER_MS);
4570 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DATA_SERVICE_URL);
4571 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_REDIR_HOST);
4572 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_TARGET_URL);
4573 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_APN);
4574 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_REQUIRED);
4575 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_SUPPORTED);
Christopher Tate06efb532012-08-24 15:29:27 -07004576 MOVED_TO_GLOBAL.add(Settings.Global.USB_MASS_STORAGE_ENABLED);
4577 MOVED_TO_GLOBAL.add(Settings.Global.USE_GOOGLE_MAIL);
Robert Greenwalt3ea0c992013-10-03 21:13:49 +00004578 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_COUNTRY_CODE);
Christopher Tate06efb532012-08-24 15:29:27 -07004579 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FRAMEWORK_SCAN_INTERVAL_MS);
4580 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FREQUENCY_BAND);
4581 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_IDLE_MS);
4582 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MAX_DHCP_RETRY_COUNT);
4583 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS);
4584 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
4585 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
4586 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NUM_OPEN_NETWORKS_KEPT);
4587 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ON);
4588 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_P2P_DEVICE_NAME);
4589 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SAVED_STATE);
4590 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUPPLICANT_SCAN_INTERVAL_MS);
4591 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUSPEND_OPTIMIZATIONS_ENABLED);
Nathan Harold29589fc2016-03-30 21:53:48 -07004592 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_VERBOSE_LOGGING_ENABLED);
vandwalle7c3606c2014-03-31 19:12:07 -07004593 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ENHANCED_AUTO_JOIN);
4594 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORK_SHOW_RSSI);
Christopher Tate06efb532012-08-24 15:29:27 -07004595 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_ON);
4596 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED);
Christopher Tate06efb532012-08-24 15:29:27 -07004597 MOVED_TO_GLOBAL.add(Settings.Global.WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON);
Christopher Tatec868b642012-09-12 17:41:04 -07004598 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_ENABLE);
4599 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_TIMEOUT);
4600 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_DEFAULT_RESPONSE);
4601 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS);
4602 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS);
4603 MOVED_TO_GLOBAL.add(Settings.Global.GPRS_REGISTER_CHECK_PERIOD_MS);
Christopher Tate06efb532012-08-24 15:29:27 -07004604 MOVED_TO_GLOBAL.add(Settings.Global.WTF_IS_FATAL);
Jeff Sharkey625239a2012-09-26 22:03:49 -07004605 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_DURATION_THRESHOLD);
4606 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_THRESHOLD);
4607 MOVED_TO_GLOBAL.add(Settings.Global.SEND_ACTION_APP_ERROR);
4608 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_AGE_SECONDS);
4609 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_MAX_FILES);
4610 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_KB);
4611 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_PERCENT);
4612 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_RESERVE_PERCENT);
4613 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_TAG_PREFIX);
4614 MOVED_TO_GLOBAL.add(Settings.Global.ERROR_LOGCAT_PREFIX);
4615 MOVED_TO_GLOBAL.add(Settings.Global.SYS_FREE_STORAGE_LOG_INTERVAL);
4616 MOVED_TO_GLOBAL.add(Settings.Global.DISK_FREE_CHANGE_REPORTING_THRESHOLD);
4617 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_PERCENTAGE);
4618 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_MAX_BYTES);
4619 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_FULL_THRESHOLD_BYTES);
4620 MOVED_TO_GLOBAL.add(Settings.Global.SYNC_MAX_RETRY_DELAY_IN_SECONDS);
4621 MOVED_TO_GLOBAL.add(Settings.Global.CONNECTIVITY_CHANGE_DELAY);
4622 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED);
4623 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_SERVER);
4624 MOVED_TO_GLOBAL.add(Settings.Global.NSD_ON);
4625 MOVED_TO_GLOBAL.add(Settings.Global.SET_INSTALL_LOCATION);
4626 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_INSTALL_LOCATION);
4627 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_UP_DELAY);
4628 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_DOWN_DELAY);
4629 MOVED_TO_GLOBAL.add(Settings.Global.READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT);
4630 MOVED_TO_GLOBAL.add(Settings.Global.HTTP_PROXY);
4631 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_HOST);
4632 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_PORT);
4633 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST);
4634 MOVED_TO_GLOBAL.add(Settings.Global.SET_GLOBAL_HTTP_PROXY);
4635 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_DNS_SERVER);
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07004636 MOVED_TO_GLOBAL.add(Settings.Global.PREFERRED_NETWORK_MODE);
Hui Shu22671772014-10-01 21:41:07 +00004637 MOVED_TO_GLOBAL.add(Settings.Global.WEBVIEW_DATA_REDUCTION_PROXY_KEY);
Christopher Tate06efb532012-08-24 15:29:27 -07004638 }
4639
Christopher Tate66488d62012-10-02 11:58:01 -07004640 /** @hide */
Svetoslav683914b2015-01-15 14:22:26 -08004641 public static void getMovedToGlobalSettings(Set<String> outKeySet) {
Christopher Tate66488d62012-10-02 11:58:01 -07004642 outKeySet.addAll(MOVED_TO_GLOBAL);
4643 }
4644
Sudheer Shankaaa3c30d2017-05-23 15:19:10 -07004645 /** @hide */
4646 public static void clearProviderForTest() {
4647 sProviderHolder.clearProviderForTest();
4648 sNameValueCache.clearGenerationTrackerForTest();
4649 }
4650
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004651 /**
4652 * Look up a name in the database.
4653 * @param resolver to access the database with
4654 * @param name to look up in the table
4655 * @return the corresponding value, or null if not present
4656 */
Dianne Hackborn139748f2012-09-24 11:36:57 -07004657 public static String getString(ContentResolver resolver, String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07004658 return getStringForUser(resolver, name, UserHandle.myUserId());
4659 }
4660
4661 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -07004662 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -07004663 int userHandle) {
4664 if (MOVED_TO_GLOBAL.contains(name)) {
4665 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
4666 + " to android.provider.Settings.Global.");
4667 return Global.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004668 }
Amith Yamasani52c489c2012-03-28 11:42:42 -07004669
Dianne Hackborn139748f2012-09-24 11:36:57 -07004670 if (MOVED_TO_LOCK_SETTINGS.contains(name)) {
4671 synchronized (Secure.class) {
4672 if (sLockSettings == null) {
4673 sLockSettings = ILockSettings.Stub.asInterface(
4674 (IBinder) ServiceManager.getService("lock_settings"));
4675 sIsSystemProcess = Process.myUid() == Process.SYSTEM_UID;
4676 }
4677 }
4678 if (sLockSettings != null && !sIsSystemProcess) {
Adrian Roos7811d9f2015-07-27 15:10:13 -07004679 // No context; use the ActivityThread's context as an approximation for
4680 // determining the target API level.
4681 Application application = ActivityThread.currentApplication();
4682
4683 boolean isPreMnc = application != null
4684 && application.getApplicationInfo() != null
4685 && application.getApplicationInfo().targetSdkVersion
4686 <= VERSION_CODES.LOLLIPOP_MR1;
4687 if (isPreMnc) {
4688 try {
4689 return sLockSettings.getString(name, "0", userHandle);
4690 } catch (RemoteException re) {
4691 // Fall through
4692 }
4693 } else {
4694 throw new SecurityException("Settings.Secure." + name
4695 + " is deprecated and no longer accessible."
4696 + " See API documentation for potential replacements.");
Dianne Hackborn139748f2012-09-24 11:36:57 -07004697 }
Amith Yamasani52c489c2012-03-28 11:42:42 -07004698 }
4699 }
4700
Christopher Tate06efb532012-08-24 15:29:27 -07004701 return sNameValueCache.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004702 }
4703
4704 /**
4705 * Store a name/value pair into the database.
4706 * @param resolver to access the database with
4707 * @param name to store
4708 * @param value to associate with the name
4709 * @return true if the value was set, false on database errors
4710 */
Christopher Tate06efb532012-08-24 15:29:27 -07004711 public static boolean putString(ContentResolver resolver, String name, String value) {
4712 return putStringForUser(resolver, name, value, UserHandle.myUserId());
4713 }
4714
4715 /** @hide */
4716 public static boolean putStringForUser(ContentResolver resolver, String name, String value,
4717 int userHandle) {
Svetoslav Ganove080da92016-12-21 17:10:35 -08004718 return putStringForUser(resolver, name, value, null, false, userHandle);
4719 }
4720
4721 /** @hide */
4722 public static boolean putStringForUser(@NonNull ContentResolver resolver,
4723 @NonNull String name, @Nullable String value, @Nullable String tag,
4724 boolean makeDefault, @UserIdInt int userHandle) {
Julia Reynolds82735bc2014-09-04 16:43:30 -04004725 if (LOCATION_MODE.equals(name)) {
Tom O'Neill87c7fad2016-08-04 08:16:12 -07004726 // Map LOCATION_MODE to underlying location provider storage API
Julia Reynolds82735bc2014-09-04 16:43:30 -04004727 return setLocationModeForUser(resolver, Integer.parseInt(value), userHandle);
4728 }
Christopher Tate06efb532012-08-24 15:29:27 -07004729 if (MOVED_TO_GLOBAL.contains(name)) {
Robin Lee7af9a742017-02-20 14:47:30 +00004730 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
Christopher Tate06efb532012-08-24 15:29:27 -07004731 + " to android.provider.Settings.Global");
Svetoslav Ganove080da92016-12-21 17:10:35 -08004732 return Global.putStringForUser(resolver, name, value,
4733 tag, makeDefault, userHandle);
Christopher Tate06efb532012-08-24 15:29:27 -07004734 }
Svetoslav Ganove080da92016-12-21 17:10:35 -08004735 return sNameValueCache.putStringForUser(resolver, name, value, tag,
4736 makeDefault, userHandle);
4737 }
4738
4739 /**
4740 * Store a name/value pair into the database.
4741 * <p>
4742 * The method takes an optional tag to associate with the setting
4743 * which can be used to clear only settings made by your package and
4744 * associated with this tag by passing the tag to {@link
4745 * #resetToDefaults(ContentResolver, String)}. Anyone can override
4746 * the current tag. Also if another package changes the setting
4747 * then the tag will be set to the one specified in the set call
4748 * which can be null. Also any of the settings setters that do not
4749 * take a tag as an argument effectively clears the tag.
4750 * </p><p>
4751 * For example, if you set settings A and B with tags T1 and T2 and
4752 * another app changes setting A (potentially to the same value), it
4753 * can assign to it a tag T3 (note that now the package that changed
4754 * the setting is not yours). Now if you reset your changes for T1 and
4755 * T2 only setting B will be reset and A not (as it was changed by
4756 * another package) but since A did not change you are in the desired
4757 * initial state. Now if the other app changes the value of A (assuming
4758 * you registered an observer in the beginning) you would detect that
4759 * the setting was changed by another app and handle this appropriately
4760 * (ignore, set back to some value, etc).
4761 * </p><p>
4762 * Also the method takes an argument whether to make the value the
4763 * default for this setting. If the system already specified a default
4764 * value, then the one passed in here will <strong>not</strong>
4765 * be set as the default.
4766 * </p>
4767 *
4768 * @param resolver to access the database with.
4769 * @param name to store.
4770 * @param value to associate with the name.
4771 * @param tag to associate with the setting.
4772 * @param makeDefault whether to make the value the default one.
4773 * @return true if the value was set, false on database errors.
4774 *
4775 * @see #resetToDefaults(ContentResolver, String)
4776 *
4777 * @hide
4778 */
4779 @SystemApi
4780 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
4781 public static boolean putString(@NonNull ContentResolver resolver,
4782 @NonNull String name, @Nullable String value, @Nullable String tag,
4783 boolean makeDefault) {
4784 return putStringForUser(resolver, name, value, tag, makeDefault,
4785 UserHandle.myUserId());
4786 }
4787
4788 /**
4789 * Reset the settings to their defaults. This would reset <strong>only</strong>
4790 * settings set by the caller's package. Think of it of a way to undo your own
4791 * changes to the global settings. Passing in the optional tag will reset only
4792 * settings changed by your package and associated with this tag.
4793 *
4794 * @param resolver Handle to the content resolver.
4795 * @param tag Optional tag which should be associated with the settings to reset.
4796 *
4797 * @see #putString(ContentResolver, String, String, String, boolean)
4798 *
4799 * @hide
4800 */
4801 @SystemApi
4802 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
4803 public static void resetToDefaults(@NonNull ContentResolver resolver,
4804 @Nullable String tag) {
4805 resetToDefaultsAsUser(resolver, tag, RESET_MODE_PACKAGE_DEFAULTS,
4806 UserHandle.myUserId());
4807 }
4808
4809 /**
4810 *
4811 * Reset the settings to their defaults for a given user with a specific mode. The
4812 * optional tag argument is valid only for {@link #RESET_MODE_PACKAGE_DEFAULTS}
4813 * allowing resetting the settings made by a package and associated with the tag.
4814 *
4815 * @param resolver Handle to the content resolver.
4816 * @param tag Optional tag which should be associated with the settings to reset.
4817 * @param mode The reset mode.
4818 * @param userHandle The user for which to reset to defaults.
4819 *
4820 * @see #RESET_MODE_PACKAGE_DEFAULTS
4821 * @see #RESET_MODE_UNTRUSTED_DEFAULTS
4822 * @see #RESET_MODE_UNTRUSTED_CHANGES
4823 * @see #RESET_MODE_TRUSTED_DEFAULTS
4824 *
4825 * @hide
4826 */
4827 public static void resetToDefaultsAsUser(@NonNull ContentResolver resolver,
4828 @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle) {
4829 try {
4830 Bundle arg = new Bundle();
4831 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
4832 if (tag != null) {
4833 arg.putString(CALL_METHOD_TAG_KEY, tag);
4834 }
4835 arg.putInt(CALL_METHOD_RESET_MODE_KEY, mode);
4836 IContentProvider cp = sProviderHolder.getProvider(resolver);
4837 cp.call(resolver.getPackageName(), CALL_METHOD_RESET_SECURE, null, arg);
4838 } catch (RemoteException e) {
4839 Log.w(TAG, "Can't reset do defaults for " + CONTENT_URI, e);
4840 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004841 }
4842
4843 /**
4844 * Construct the content URI for a particular name/value pair,
4845 * useful for monitoring changes with a ContentObserver.
4846 * @param name to look up in the table
4847 * @return the corresponding content URI, or null if not present
4848 */
4849 public static Uri getUriFor(String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07004850 if (MOVED_TO_GLOBAL.contains(name)) {
4851 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
4852 + " to android.provider.Settings.Global, returning global URI.");
4853 return Global.getUriFor(Global.CONTENT_URI, name);
4854 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004855 return getUriFor(CONTENT_URI, name);
4856 }
4857
4858 /**
4859 * Convenience function for retrieving a single secure settings value
4860 * as an integer. Note that internally setting values are always
4861 * stored as strings; this function converts the string to an integer
4862 * for you. The default value will be returned if the setting is
4863 * not defined or not an integer.
4864 *
4865 * @param cr The ContentResolver to access.
4866 * @param name The name of the setting to retrieve.
4867 * @param def Value to return if the setting is not defined.
4868 *
4869 * @return The setting's current value, or 'def' if it is not defined
4870 * or not a valid integer.
4871 */
4872 public static int getInt(ContentResolver cr, String name, int def) {
Christopher Tate06efb532012-08-24 15:29:27 -07004873 return getIntForUser(cr, name, def, UserHandle.myUserId());
4874 }
4875
4876 /** @hide */
4877 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
Tom O'Neill7f6f4572013-08-27 10:53:15 -07004878 if (LOCATION_MODE.equals(name)) {
Tom O'Neill87c7fad2016-08-04 08:16:12 -07004879 // Map from to underlying location provider storage API to location mode
Tom O'Neill7f6f4572013-08-27 10:53:15 -07004880 return getLocationModeForUser(cr, userHandle);
4881 }
Christopher Tate06efb532012-08-24 15:29:27 -07004882 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004883 try {
4884 return v != null ? Integer.parseInt(v) : def;
4885 } catch (NumberFormatException e) {
4886 return def;
4887 }
4888 }
4889
4890 /**
4891 * Convenience function for retrieving a single secure settings value
4892 * as an integer. Note that internally setting values are always
4893 * stored as strings; this function converts the string to an integer
4894 * for you.
4895 * <p>
4896 * This version does not take a default value. If the setting has not
4897 * been set, or the string value is not a number,
4898 * it throws {@link SettingNotFoundException}.
4899 *
4900 * @param cr The ContentResolver to access.
4901 * @param name The name of the setting to retrieve.
4902 *
4903 * @throws SettingNotFoundException Thrown if a setting by the given
4904 * name can't be found or the setting value is not an integer.
4905 *
4906 * @return The setting's current value.
4907 */
4908 public static int getInt(ContentResolver cr, String name)
4909 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07004910 return getIntForUser(cr, name, UserHandle.myUserId());
4911 }
4912
4913 /** @hide */
4914 public static int getIntForUser(ContentResolver cr, String name, int userHandle)
4915 throws SettingNotFoundException {
Tom O'Neill7f6f4572013-08-27 10:53:15 -07004916 if (LOCATION_MODE.equals(name)) {
Tom O'Neill87c7fad2016-08-04 08:16:12 -07004917 // Map from to underlying location provider storage API to location mode
Tom O'Neill7f6f4572013-08-27 10:53:15 -07004918 return getLocationModeForUser(cr, userHandle);
4919 }
Christopher Tate06efb532012-08-24 15:29:27 -07004920 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004921 try {
4922 return Integer.parseInt(v);
4923 } catch (NumberFormatException e) {
4924 throw new SettingNotFoundException(name);
4925 }
4926 }
4927
4928 /**
4929 * Convenience function for updating a single settings value as an
4930 * integer. This will either create a new entry in the table if the
4931 * given name does not exist, or modify the value of the existing row
4932 * with that name. Note that internally setting values are always
4933 * stored as strings, so this function converts the given value to a
4934 * string before storing it.
4935 *
4936 * @param cr The ContentResolver to access.
4937 * @param name The name of the setting to modify.
4938 * @param value The new value for the setting.
4939 * @return true if the value was set, false on database errors
4940 */
4941 public static boolean putInt(ContentResolver cr, String name, int value) {
Christopher Tate06efb532012-08-24 15:29:27 -07004942 return putIntForUser(cr, name, value, UserHandle.myUserId());
4943 }
4944
4945 /** @hide */
4946 public static boolean putIntForUser(ContentResolver cr, String name, int value,
4947 int userHandle) {
4948 return putStringForUser(cr, name, Integer.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004949 }
4950
4951 /**
4952 * Convenience function for retrieving a single secure settings value
4953 * as a {@code long}. Note that internally setting values are always
4954 * stored as strings; this function converts the string to a {@code long}
4955 * for you. The default value will be returned if the setting is
4956 * not defined or not a {@code long}.
4957 *
4958 * @param cr The ContentResolver to access.
4959 * @param name The name of the setting to retrieve.
4960 * @param def Value to return if the setting is not defined.
4961 *
4962 * @return The setting's current value, or 'def' if it is not defined
4963 * or not a valid {@code long}.
4964 */
4965 public static long getLong(ContentResolver cr, String name, long def) {
Christopher Tate06efb532012-08-24 15:29:27 -07004966 return getLongForUser(cr, name, def, UserHandle.myUserId());
4967 }
4968
4969 /** @hide */
4970 public static long getLongForUser(ContentResolver cr, String name, long def,
4971 int userHandle) {
4972 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004973 long value;
4974 try {
4975 value = valString != null ? Long.parseLong(valString) : def;
4976 } catch (NumberFormatException e) {
4977 value = def;
4978 }
4979 return value;
4980 }
4981
4982 /**
4983 * Convenience function for retrieving a single secure settings value
4984 * as a {@code long}. Note that internally setting values are always
4985 * stored as strings; this function converts the string to a {@code long}
4986 * for you.
4987 * <p>
4988 * This version does not take a default value. If the setting has not
4989 * been set, or the string value is not a number,
4990 * it throws {@link SettingNotFoundException}.
4991 *
4992 * @param cr The ContentResolver to access.
4993 * @param name The name of the setting to retrieve.
4994 *
4995 * @return The setting's current value.
4996 * @throws SettingNotFoundException Thrown if a setting by the given
4997 * name can't be found or the setting value is not an integer.
4998 */
4999 public static long getLong(ContentResolver cr, String name)
5000 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07005001 return getLongForUser(cr, name, UserHandle.myUserId());
5002 }
5003
5004 /** @hide */
5005 public static long getLongForUser(ContentResolver cr, String name, int userHandle)
5006 throws SettingNotFoundException {
5007 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005008 try {
5009 return Long.parseLong(valString);
5010 } catch (NumberFormatException e) {
5011 throw new SettingNotFoundException(name);
5012 }
5013 }
5014
5015 /**
5016 * Convenience function for updating a secure settings value as a long
5017 * integer. This will either create a new entry in the table if the
5018 * given name does not exist, or modify the value of the existing row
5019 * with that name. Note that internally setting values are always
5020 * stored as strings, so this function converts the given value to a
5021 * string before storing it.
5022 *
5023 * @param cr The ContentResolver to access.
5024 * @param name The name of the setting to modify.
5025 * @param value The new value for the setting.
5026 * @return true if the value was set, false on database errors
5027 */
5028 public static boolean putLong(ContentResolver cr, String name, long value) {
Christopher Tate06efb532012-08-24 15:29:27 -07005029 return putLongForUser(cr, name, value, UserHandle.myUserId());
5030 }
5031
5032 /** @hide */
5033 public static boolean putLongForUser(ContentResolver cr, String name, long value,
5034 int userHandle) {
5035 return putStringForUser(cr, name, Long.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005036 }
5037
5038 /**
5039 * Convenience function for retrieving a single secure settings value
5040 * as a floating point number. Note that internally setting values are
5041 * always stored as strings; this function converts the string to an
5042 * float for you. The default value will be returned if the setting
5043 * is not defined or not a valid float.
5044 *
5045 * @param cr The ContentResolver to access.
5046 * @param name The name of the setting to retrieve.
5047 * @param def Value to return if the setting is not defined.
5048 *
5049 * @return The setting's current value, or 'def' if it is not defined
5050 * or not a valid float.
5051 */
5052 public static float getFloat(ContentResolver cr, String name, float def) {
Christopher Tate06efb532012-08-24 15:29:27 -07005053 return getFloatForUser(cr, name, def, UserHandle.myUserId());
5054 }
5055
5056 /** @hide */
5057 public static float getFloatForUser(ContentResolver cr, String name, float def,
5058 int userHandle) {
5059 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005060 try {
5061 return v != null ? Float.parseFloat(v) : def;
5062 } catch (NumberFormatException e) {
5063 return def;
5064 }
5065 }
5066
5067 /**
5068 * Convenience function for retrieving a single secure settings value
5069 * as a float. Note that internally setting values are always
5070 * stored as strings; this function converts the string to a float
5071 * for you.
5072 * <p>
5073 * This version does not take a default value. If the setting has not
5074 * been set, or the string value is not a number,
5075 * it throws {@link SettingNotFoundException}.
5076 *
5077 * @param cr The ContentResolver to access.
5078 * @param name The name of the setting to retrieve.
5079 *
5080 * @throws SettingNotFoundException Thrown if a setting by the given
5081 * name can't be found or the setting value is not a float.
5082 *
5083 * @return The setting's current value.
5084 */
5085 public static float getFloat(ContentResolver cr, String name)
5086 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07005087 return getFloatForUser(cr, name, UserHandle.myUserId());
5088 }
5089
5090 /** @hide */
5091 public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
5092 throws SettingNotFoundException {
5093 String v = getStringForUser(cr, name, userHandle);
Brian Muramatsue1d46982010-12-06 17:34:20 -08005094 if (v == null) {
5095 throw new SettingNotFoundException(name);
5096 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005097 try {
5098 return Float.parseFloat(v);
5099 } catch (NumberFormatException e) {
5100 throw new SettingNotFoundException(name);
5101 }
5102 }
5103
5104 /**
5105 * Convenience function for updating a single settings value as a
5106 * floating point number. This will either create a new entry in the
5107 * table if the given name does not exist, or modify the value of the
5108 * existing row with that name. Note that internally setting values
5109 * are always stored as strings, so this function converts the given
5110 * value to a string before storing it.
5111 *
5112 * @param cr The ContentResolver to access.
5113 * @param name The name of the setting to modify.
5114 * @param value The new value for the setting.
5115 * @return true if the value was set, false on database errors
5116 */
5117 public static boolean putFloat(ContentResolver cr, String name, float value) {
Christopher Tate06efb532012-08-24 15:29:27 -07005118 return putFloatForUser(cr, name, value, UserHandle.myUserId());
5119 }
5120
5121 /** @hide */
5122 public static boolean putFloatForUser(ContentResolver cr, String name, float value,
5123 int userHandle) {
5124 return putStringForUser(cr, name, Float.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005125 }
5126
5127 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005128 * @deprecated Use {@link android.provider.Settings.Global#DEVELOPMENT_SETTINGS_ENABLED}
5129 * instead
Dianne Hackborn895f99e2012-02-02 11:49:12 -08005130 */
Christopher Tate06efb532012-08-24 15:29:27 -07005131 @Deprecated
5132 public static final String DEVELOPMENT_SETTINGS_ENABLED =
5133 Global.DEVELOPMENT_SETTINGS_ENABLED;
Dianne Hackborn895f99e2012-02-02 11:49:12 -08005134
5135 /**
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07005136 * When the user has enable the option to have a "bug report" command
5137 * in the power menu.
Christopher Tate58f41ec2013-01-11 15:40:36 -08005138 * @deprecated Use {@link android.provider.Settings.Global#BUGREPORT_IN_POWER_MENU} instead
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07005139 * @hide
5140 */
Christopher Tate58f41ec2013-01-11 15:40:36 -08005141 @Deprecated
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07005142 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
5143
5144 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005145 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005146 */
Christopher Tate06efb532012-08-24 15:29:27 -07005147 @Deprecated
5148 public static final String ADB_ENABLED = Global.ADB_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005149
5150 /**
5151 * Setting to allow mock locations and location provider status to be injected into the
5152 * LocationManager service for testing purposes during application development. These
5153 * locations and status values override actual location and status information generated
5154 * by network, gps, or other location providers.
Svet Ganovf7e9cf42015-05-13 10:40:31 -07005155 *
5156 * @deprecated This settings is not used anymore.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005157 */
Svet Ganovf7e9cf42015-05-13 10:40:31 -07005158 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005159 public static final String ALLOW_MOCK_LOCATION = "mock_location";
5160
5161 /**
Doug Zongkerd8893db2010-01-26 12:29:44 -08005162 * A 64-bit number (as a hex string) that is randomly
Scott Main44895332013-11-12 09:23:13 -08005163 * generated when the user first sets up the device and should remain
5164 * constant for the lifetime of the user's device. The value may
5165 * change if a factory reset is performed on the device.
5166 * <p class="note"><strong>Note:</strong> When a device has <a
5167 * href="{@docRoot}about/versions/android-4.2.html#MultipleUsers">multiple users</a>
5168 * (available on certain devices running Android 4.2 or higher), each user appears as a
5169 * completely separate device, so the {@code ANDROID_ID} value is unique to each
5170 * user.</p>
Chad Brubaker0d277a72017-04-12 16:56:53 -07005171 *
5172 * <p class="note"><strong>Note:</strong> If the caller is an Instant App the id is scoped
5173 * to the Instant App, it is generated when the Instant App is first installed and reset if
5174 * the user clears the Instant App.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005175 */
5176 public static final String ANDROID_ID = "android_id";
5177
5178 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005179 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005180 */
Christopher Tate06efb532012-08-24 15:29:27 -07005181 @Deprecated
5182 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005183
5184 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005185 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005186 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07005187 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07005188 public static final String DATA_ROAMING = Global.DATA_ROAMING;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005189
5190 /**
5191 * Setting to record the input method used by default, holding the ID
5192 * of the desired method.
5193 */
5194 public static final String DEFAULT_INPUT_METHOD = "default_input_method";
5195
5196 /**
satokab751aa2010-09-14 19:17:36 +09005197 * Setting to record the input method subtype used by default, holding the ID
5198 * of the desired method.
5199 */
5200 public static final String SELECTED_INPUT_METHOD_SUBTYPE =
5201 "selected_input_method_subtype";
5202
5203 /**
satok723a27e2010-11-11 14:58:11 +09005204 * Setting to record the history of input method subtype, holding the pair of ID of IME
5205 * and its last used subtype.
5206 * @hide
5207 */
5208 public static final String INPUT_METHODS_SUBTYPE_HISTORY =
5209 "input_methods_subtype_history";
5210
5211 /**
satok5c58dfc2010-12-14 21:54:47 +09005212 * Setting to record the visibility of input method selector
5213 */
5214 public static final String INPUT_METHOD_SELECTOR_VISIBILITY =
5215 "input_method_selector_visibility";
5216
5217 /**
Dianne Hackborn91097de2014-04-04 18:02:06 -07005218 * The currently selected voice interaction service flattened ComponentName.
5219 * @hide
5220 */
Jeff Sharkeya73b8fd2016-01-06 17:02:08 -07005221 @TestApi
Dianne Hackborn91097de2014-04-04 18:02:06 -07005222 public static final String VOICE_INTERACTION_SERVICE = "voice_interaction_service";
5223
5224 /**
Felipe Leme640f30a2017-03-06 15:44:06 -08005225 * The currently selected autofill service flattened ComponentName.
Felipe Leme5381aa42016-10-13 09:02:32 -07005226 * @hide
5227 */
5228 @TestApi
Felipe Leme640f30a2017-03-06 15:44:06 -08005229 public static final String AUTOFILL_SERVICE = "autofill_service";
Felipe Leme5381aa42016-10-13 09:02:32 -07005230
5231 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005232 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005233 */
Christopher Tate06efb532012-08-24 15:29:27 -07005234 @Deprecated
5235 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005236
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005237 /**
Russell Brennerde6ae442012-09-26 20:53:10 -07005238 * Whether the current user has been set up via setup wizard (0 = false, 1 = true)
5239 * @hide
5240 */
Felipe Leme99230122017-06-12 14:33:02 -07005241 @TestApi
Russell Brennerde6ae442012-09-26 20:53:10 -07005242 public static final String USER_SETUP_COMPLETE = "user_setup_complete";
5243
5244 /**
Sujith Ramakrishnan314df162017-06-16 18:03:18 -07005245 * Whether the current user has been set up via setup wizard (0 = false, 1 = true)
5246 * This value differs from USER_SETUP_COMPLETE in that it can be reset back to 0
5247 * in case SetupWizard has been re-enabled on TV devices.
5248 *
5249 * @hide
5250 */
5251 public static final String TV_USER_SETUP_COMPLETE = "tv_user_setup_complete";
5252
5253 /**
Ido Ofird193c672016-03-01 13:27:54 -08005254 * Prefix for category name that marks whether a suggested action from that category was
5255 * completed.
5256 * @hide
5257 */
5258 public static final String COMPLETED_CATEGORY_PREFIX = "suggested.completed_category.";
5259
5260 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005261 * List of input methods that are currently enabled. This is a string
5262 * containing the IDs of all enabled input methods, each ID separated
5263 * by ':'.
5264 */
5265 public static final String ENABLED_INPUT_METHODS = "enabled_input_methods";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005266
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005267 /**
Amith Yamasanie861ec12010-03-24 21:39:27 -07005268 * List of system input methods that are currently disabled. This is a string
5269 * containing the IDs of all disabled input methods, each ID separated
5270 * by ':'.
5271 * @hide
5272 */
5273 public static final String DISABLED_SYSTEM_INPUT_METHODS = "disabled_system_input_methods";
5274
5275 /**
Michael Wright7b5a96b2014-08-09 19:28:42 -07005276 * Whether to show the IME when a hard keyboard is connected. This is a boolean that
5277 * determines if the IME should be shown when a hard keyboard is attached.
5278 * @hide
5279 */
5280 public static final String SHOW_IME_WITH_HARD_KEYBOARD = "show_ime_with_hard_keyboard";
5281
5282 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07005283 * Host name and port for global http proxy. Uses ':' seperator for
5284 * between host and port.
5285 *
5286 * @deprecated Use {@link Global#HTTP_PROXY}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005287 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07005288 @Deprecated
5289 public static final String HTTP_PROXY = Global.HTTP_PROXY;
Robert Greenwalte90aa5e2010-09-01 11:34:05 -07005290
5291 /**
Robin Lee244ce8e2016-01-05 18:03:46 +00005292 * Package designated as always-on VPN provider.
5293 *
5294 * @hide
5295 */
5296 public static final String ALWAYS_ON_VPN_APP = "always_on_vpn_app";
5297
5298 /**
Robin Lee17e61832016-05-09 13:46:28 +01005299 * Whether to block networking outside of VPN connections while always-on is set.
5300 * @see #ALWAYS_ON_VPN_APP
5301 *
5302 * @hide
5303 */
5304 public static final String ALWAYS_ON_VPN_LOCKDOWN = "always_on_vpn_lockdown";
5305
5306 /**
Christopher Tateaa036a22014-05-19 16:33:27 -07005307 * Whether applications can be installed for this user via the system's
5308 * {@link Intent#ACTION_INSTALL_PACKAGE} mechanism.
5309 *
5310 * <p>1 = permit app installation via the system package installer intent
5311 * <p>0 = do not allow use of the package installer
Suprabh Shuklaaef25132017-01-23 18:09:03 -08005312 * @deprecated Starting from {@link android.os.Build.VERSION_CODES#O}, apps should use
5313 * {@link PackageManager#canRequestPackageInstalls()}
5314 * @see PackageManager#canRequestPackageInstalls()
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005315 */
Christopher Tateaa036a22014-05-19 16:33:27 -07005316 public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005317
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005318 /**
Suprabh Shukla0b1356f2017-02-21 14:33:50 -08005319 * A flag to tell {@link com.android.server.devicepolicy.DevicePolicyManagerService} that
5320 * the default for {@link #INSTALL_NON_MARKET_APPS} is reversed for this user on OTA. So it
5321 * can set the restriction {@link android.os.UserManager#DISALLOW_INSTALL_UNKNOWN_SOURCES}
5322 * on behalf of the profile owner if needed to make the change transparent for profile
5323 * owners.
5324 *
5325 * @hide
5326 */
5327 public static final String UNKNOWN_SOURCES_DEFAULT_REVERSED =
5328 "unknown_sources_default_reversed";
5329
5330 /**
Tom O'Neill923c0dc2014-03-03 11:07:55 -08005331 * Comma-separated list of location providers that activities may access. Do not rely on
5332 * this value being present in settings.db or on ContentObserver notifications on the
5333 * corresponding Uri.
Tom O'Neilla324ac72013-08-26 14:40:23 -07005334 *
Tom O'Neill923c0dc2014-03-03 11:07:55 -08005335 * @deprecated use {@link #LOCATION_MODE} and
5336 * {@link LocationManager#MODE_CHANGED_ACTION} (or
5337 * {@link LocationManager#PROVIDERS_CHANGED_ACTION})
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005338 */
Tom O'Neilla324ac72013-08-26 14:40:23 -07005339 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005340 public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005341
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005342 /**
Tom O'Neill7f6f4572013-08-27 10:53:15 -07005343 * The degree of location access enabled by the user.
Tom O'Neill923c0dc2014-03-03 11:07:55 -08005344 * <p>
Tom O'Neill7f6f4572013-08-27 10:53:15 -07005345 * When used with {@link #putInt(ContentResolver, String, int)}, must be one of {@link
5346 * #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY}, {@link
5347 * #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}. When used with {@link
5348 * #getInt(ContentResolver, String)}, the caller must gracefully handle additional location
5349 * modes that might be added in the future.
Tom O'Neill923c0dc2014-03-03 11:07:55 -08005350 * <p>
5351 * Note: do not rely on this value being present in settings.db or on ContentObserver
5352 * notifications for the corresponding Uri. Use {@link LocationManager#MODE_CHANGED_ACTION}
5353 * to receive changes in this value.
Tom O'Neilla324ac72013-08-26 14:40:23 -07005354 */
5355 public static final String LOCATION_MODE = "location_mode";
Lifu Tangd1fa1d62015-11-25 21:42:44 -08005356 /**
5357 * Stores the previous location mode when {@link #LOCATION_MODE} is set to
5358 * {@link #LOCATION_MODE_OFF}
5359 * @hide
5360 */
5361 public static final String LOCATION_PREVIOUS_MODE = "location_previous_mode";
Tom O'Neilla324ac72013-08-26 14:40:23 -07005362
5363 /**
Lifu Tangd1fa1d62015-11-25 21:42:44 -08005364 * Sets all location providers to the previous states before location was turned off.
5365 * @hide
5366 */
5367 public static final int LOCATION_MODE_PREVIOUS = -1;
5368 /**
Tom O'Neill7f6f4572013-08-27 10:53:15 -07005369 * Location access disabled.
Tom O'Neill1f48b782013-08-19 18:14:56 -07005370 */
5371 public static final int LOCATION_MODE_OFF = 0;
5372 /**
5373 * Network Location Provider disabled, but GPS and other sensors enabled.
5374 */
5375 public static final int LOCATION_MODE_SENSORS_ONLY = 1;
5376 /**
Tom O'Neilld5759432013-09-11 11:03:03 -07005377 * Reduced power usage, such as limiting the number of GPS updates per hour. Requests
5378 * with {@link android.location.Criteria#POWER_HIGH} may be downgraded to
5379 * {@link android.location.Criteria#POWER_MEDIUM}.
Tom O'Neill1f48b782013-08-19 18:14:56 -07005380 */
5381 public static final int LOCATION_MODE_BATTERY_SAVING = 2;
5382 /**
5383 * Best-effort location computation allowed.
5384 */
5385 public static final int LOCATION_MODE_HIGH_ACCURACY = 3;
5386
5387 /**
Danielle Millett925a7d82012-03-19 18:02:20 -04005388 * A flag containing settings used for biometric weak
5389 * @hide
5390 */
Adrian Roos230635e2015-01-07 20:50:29 +01005391 @Deprecated
Danielle Millett925a7d82012-03-19 18:02:20 -04005392 public static final String LOCK_BIOMETRIC_WEAK_FLAGS =
5393 "lock_biometric_weak_flags";
5394
5395 /**
Jason Monk94cfd9d2014-10-31 13:18:21 -04005396 * Whether lock-to-app will lock the keyguard when exiting.
5397 * @hide
5398 */
5399 public static final String LOCK_TO_APP_EXIT_LOCKED = "lock_to_app_exit_locked";
5400
5401 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08005402 * Whether autolock is enabled (0 = false, 1 = true)
Adrian Roos9dd16eb2015-01-08 16:20:49 +01005403 *
5404 * @deprecated Use {@link android.app.KeyguardManager} to determine the state and security
Adrian Roos7811d9f2015-07-27 15:10:13 -07005405 * level of the keyguard. Accessing this setting from an app that is targeting
Deepanshu Guptae836a222015-07-31 12:11:07 -07005406 * {@link VERSION_CODES#M} or later throws a {@code SecurityException}.
Amith Yamasani156c4352010-03-05 17:10:03 -08005407 */
Adrian Roos9dd16eb2015-01-08 16:20:49 +01005408 @Deprecated
Amith Yamasani156c4352010-03-05 17:10:03 -08005409 public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock";
5410
5411 /**
5412 * Whether lock pattern is visible as user enters (0 = false, 1 = true)
Adrian Roos7811d9f2015-07-27 15:10:13 -07005413 *
5414 * @deprecated Accessing this setting from an app that is targeting
Deepanshu Guptae836a222015-07-31 12:11:07 -07005415 * {@link VERSION_CODES#M} or later throws a {@code SecurityException}.
Amith Yamasani156c4352010-03-05 17:10:03 -08005416 */
Adrian Roos7811d9f2015-07-27 15:10:13 -07005417 @Deprecated
Amith Yamasani156c4352010-03-05 17:10:03 -08005418 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
5419
5420 /**
Jeff Sharkey5ed9d682012-10-10 14:28:27 -07005421 * Whether lock pattern will vibrate as user enters (0 = false, 1 =
5422 * true)
5423 *
5424 * @deprecated Starting in {@link VERSION_CODES#JELLY_BEAN_MR1} the
5425 * lockscreen uses
5426 * {@link Settings.System#HAPTIC_FEEDBACK_ENABLED}.
Adrian Roos7811d9f2015-07-27 15:10:13 -07005427 * Accessing this setting from an app that is targeting
Deepanshu Guptae836a222015-07-31 12:11:07 -07005428 * {@link VERSION_CODES#M} or later throws a {@code SecurityException}.
Amith Yamasani156c4352010-03-05 17:10:03 -08005429 */
Jeff Sharkey5ed9d682012-10-10 14:28:27 -07005430 @Deprecated
5431 public static final String
5432 LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = "lock_pattern_tactile_feedback_enabled";
Amith Yamasani156c4352010-03-05 17:10:03 -08005433
5434 /**
Jim Millerbc4603b2010-08-30 21:21:34 -07005435 * This preference allows the device to be locked given time after screen goes off,
5436 * subject to current DeviceAdmin policy limits.
5437 * @hide
5438 */
5439 public static final String LOCK_SCREEN_LOCK_AFTER_TIMEOUT = "lock_screen_lock_after_timeout";
5440
5441
5442 /**
John Spurlock5f050e52012-10-27 10:44:19 -04005443 * This preference contains the string that shows for owner info on LockScreen.
Jim Miller253a5ef2010-10-13 20:57:29 -07005444 * @hide
Jim Miller187ec582013-04-15 18:27:54 -07005445 * @deprecated
Jim Miller253a5ef2010-10-13 20:57:29 -07005446 */
Aurimas Liutikas514c5ef2016-05-24 15:22:55 -07005447 @Deprecated
Jim Miller253a5ef2010-10-13 20:57:29 -07005448 public static final String LOCK_SCREEN_OWNER_INFO = "lock_screen_owner_info";
5449
5450 /**
John Spurlock5f050e52012-10-27 10:44:19 -04005451 * Ids of the user-selected appwidgets on the lockscreen (comma-delimited).
Jim Millerf229e4d2012-09-12 20:32:50 -07005452 * @hide
5453 */
Adrian Roos230635e2015-01-07 20:50:29 +01005454 @Deprecated
Michael Jurkaaa2859a2012-10-24 12:46:49 -07005455 public static final String LOCK_SCREEN_APPWIDGET_IDS =
5456 "lock_screen_appwidget_ids";
Jim Millerf229e4d2012-09-12 20:32:50 -07005457
5458 /**
Jim Miller51117262012-11-04 17:58:09 -08005459 * Id of the appwidget shown on the lock screen when appwidgets are disabled.
5460 * @hide
5461 */
Adrian Roos230635e2015-01-07 20:50:29 +01005462 @Deprecated
Jim Miller51117262012-11-04 17:58:09 -08005463 public static final String LOCK_SCREEN_FALLBACK_APPWIDGET_ID =
5464 "lock_screen_fallback_appwidget_id";
5465
5466 /**
John Spurlock5f050e52012-10-27 10:44:19 -04005467 * Index of the lockscreen appwidget to restore, -1 if none.
5468 * @hide
5469 */
Adrian Roos230635e2015-01-07 20:50:29 +01005470 @Deprecated
John Spurlock5f050e52012-10-27 10:44:19 -04005471 public static final String LOCK_SCREEN_STICKY_APPWIDGET =
5472 "lock_screen_sticky_appwidget";
5473
5474 /**
5475 * This preference enables showing the owner info on LockScreen.
Jim Miller253a5ef2010-10-13 20:57:29 -07005476 * @hide
Jim Miller187ec582013-04-15 18:27:54 -07005477 * @deprecated
Jim Miller253a5ef2010-10-13 20:57:29 -07005478 */
Aurimas Liutikas514c5ef2016-05-24 15:22:55 -07005479 @Deprecated
Jim Miller253a5ef2010-10-13 20:57:29 -07005480 public static final String LOCK_SCREEN_OWNER_INFO_ENABLED =
5481 "lock_screen_owner_info_enabled";
5482
5483 /**
Dan Sandler5d7c3cc2014-02-18 17:35:15 -05005484 * When set by a user, allows notifications to be shown atop a securely locked screen
5485 * in their full "private" form (same as when the device is unlocked).
Dan Sandlerfd16d562014-02-13 18:43:31 -08005486 * @hide
5487 */
5488 public static final String LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS =
5489 "lock_screen_allow_private_notifications";
5490
5491 /**
Adrian Roos3aec6382016-02-05 14:19:01 -08005492 * When set by a user, allows notification remote input atop a securely locked screen
5493 * without having to unlock
5494 * @hide
5495 */
5496 public static final String LOCK_SCREEN_ALLOW_REMOTE_INPUT =
5497 "lock_screen_allow_remote_input";
5498
5499 /**
Chris Wrencd8f4f72014-08-27 18:48:13 -04005500 * Set by the system to track if the user needs to see the call to action for
5501 * the lockscreen notification policy.
5502 * @hide
5503 */
5504 public static final String SHOW_NOTE_ABOUT_NOTIFICATION_HIDING =
5505 "show_note_about_notification_hiding";
5506
5507 /**
Adrian Roos3870d452014-09-05 18:22:28 +02005508 * Set to 1 by the system after trust agents have been initialized.
5509 * @hide
5510 */
5511 public static final String TRUST_AGENTS_INITIALIZED =
5512 "trust_agents_initialized";
5513
5514 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005515 * The Logging ID (a unique 64-bit value) as a hex string.
5516 * Used as a pseudonymous identifier for logging.
5517 * @deprecated This identifier is poorly initialized and has
5518 * many collisions. It should not be used.
5519 */
5520 @Deprecated
5521 public static final String LOGGING_ID = "logging_id";
5522
5523 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005524 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005525 */
Christopher Tate06efb532012-08-24 15:29:27 -07005526 @Deprecated
5527 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005528
5529 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08005530 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005531 */
5532 public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005533
5534 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08005535 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005536 */
5537 public static final String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005538
5539 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08005540 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005541 */
5542 public static final String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005543
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005544 /**
5545 * Settings classname to launch when Settings is clicked from All
5546 * Applications. Needed because of user testing between the old
5547 * and new Settings apps.
5548 */
5549 // TODO: 881807
5550 public static final String SETTINGS_CLASSNAME = "settings_classname";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005551
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005552 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005553 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005554 */
Christopher Tate06efb532012-08-24 15:29:27 -07005555 @Deprecated
5556 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005557
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005558 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005559 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005560 */
Christopher Tate06efb532012-08-24 15:29:27 -07005561 @Deprecated
5562 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005563
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005564 /**
svetoslavganov75986cf2009-05-14 22:28:01 -07005565 * If accessibility is enabled.
5566 */
5567 public static final String ACCESSIBILITY_ENABLED = "accessibility_enabled";
5568
5569 /**
Phil Weaverce687c52017-03-15 08:51:52 -07005570 * Setting specifying if the accessibility shortcut is enabled.
5571 * @hide
5572 */
5573 public static final String ACCESSIBILITY_SHORTCUT_ENABLED =
5574 "accessibility_shortcut_enabled";
5575
5576 /**
5577 * Setting specifying if the accessibility shortcut is enabled.
5578 * @hide
5579 */
5580 public static final String ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN =
5581 "accessibility_shortcut_on_lock_screen";
5582
5583 /**
Phil Weaver106fe732016-11-22 18:18:39 -08005584 * Setting specifying if the accessibility shortcut dialog has been shown to this user.
5585 * @hide
5586 */
5587 public static final String ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN =
5588 "accessibility_shortcut_dialog_shown";
5589
5590 /**
Phil Weaverce687c52017-03-15 08:51:52 -07005591 * Setting specifying the accessibility service to be toggled via the accessibility
Phil Weaver106fe732016-11-22 18:18:39 -08005592 * shortcut. Must be its flattened {@link ComponentName}.
5593 * @hide
5594 */
5595 public static final String ACCESSIBILITY_SHORTCUT_TARGET_SERVICE =
5596 "accessibility_shortcut_target_service";
5597
5598 /**
Casey Burkhardt5e8b9802017-03-24 10:07:20 -07005599 * Setting specifying the accessibility service or feature to be toggled via the
5600 * accessibility button in the navigation bar. This is either a flattened
5601 * {@link ComponentName} or the class name of a system class implementing a supported
5602 * accessibility feature.
5603 * @hide
5604 */
5605 public static final String ACCESSIBILITY_BUTTON_TARGET_COMPONENT =
5606 "accessibility_button_target_component";
5607
5608 /**
Svetoslav Ganov00aabf72011-07-21 11:35:03 -07005609 * If touch exploration is enabled.
Svetoslav Ganov35bfede2011-07-14 17:57:06 -07005610 */
Svetoslav Ganov00aabf72011-07-21 11:35:03 -07005611 public static final String TOUCH_EXPLORATION_ENABLED = "touch_exploration_enabled";
Svetoslav Ganov35bfede2011-07-14 17:57:06 -07005612
5613 /**
svetoslavganov75986cf2009-05-14 22:28:01 -07005614 * List of the enabled accessibility providers.
5615 */
5616 public static final String ENABLED_ACCESSIBILITY_SERVICES =
5617 "enabled_accessibility_services";
5618
5619 /**
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07005620 * List of the accessibility services to which the user has granted
Svetoslav Ganov9a4c5cd2012-05-30 14:06:32 -07005621 * permission to put the device into touch exploration mode.
5622 *
5623 * @hide
5624 */
5625 public static final String TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES =
5626 "touch_exploration_granted_accessibility_services";
5627
5628 /**
Svetoslav Ganov55f937a2011-12-05 11:42:07 -08005629 * Whether to speak passwords while in accessibility mode.
Phil Weaver385912e2017-02-10 10:06:56 -08005630 *
5631 * @deprecated The speaking of passwords is controlled by individual accessibility services.
5632 * Apps should ignore this setting and provide complete information to accessibility
5633 * at all times, which was the behavior when this value was {@code true}.
Svetoslav Ganov55f937a2011-12-05 11:42:07 -08005634 */
Phil Weaver385912e2017-02-10 10:06:56 -08005635 @Deprecated
Svetoslav Ganov55f937a2011-12-05 11:42:07 -08005636 public static final String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password";
5637
5638 /**
Chris Craikcce47eb2014-07-16 15:12:15 -07005639 * Whether to draw text with high contrast while in accessibility mode.
5640 *
5641 * @hide
5642 */
5643 public static final String ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED =
5644 "high_text_contrast_enabled";
5645
5646 /**
Casey Burkhardt74922c62017-02-13 12:43:16 -08005647 * Setting that specifies whether the display magnification is enabled via a system-wide
5648 * triple tap gesture. Display magnifications allows the user to zoom in the display content
5649 * and is targeted to low vision users. The current magnification scale is controlled by
5650 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}.
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07005651 *
5652 * @hide
5653 */
5654 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED =
5655 "accessibility_display_magnification_enabled";
5656
5657 /**
Casey Burkhardt74922c62017-02-13 12:43:16 -08005658 * Setting that specifies whether the display magnification is enabled via a shortcut
5659 * affordance within the system's navigation area. Display magnifications allows the user to
5660 * zoom in the display content and is targeted to low vision users. The current
5661 * magnification scale is controlled by {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}.
5662 *
5663 * @hide
5664 */
5665 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED =
5666 "accessibility_display_magnification_navbar_enabled";
5667
5668 /**
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07005669 * Setting that specifies what the display magnification scale is.
5670 * Display magnifications allows the user to zoom in the display
5671 * content and is targeted to low vision users. Whether a display
5672 * magnification is performed is controlled by
Casey Burkhardt74922c62017-02-13 12:43:16 -08005673 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED} and
5674 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED}
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07005675 *
5676 * @hide
5677 */
5678 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE =
5679 "accessibility_display_magnification_scale";
5680
5681 /**
Phil Weaver89e3ffc2016-09-19 13:51:10 -07005682 * Unused mangnification setting
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07005683 *
5684 * @hide
Phil Weaver89e3ffc2016-09-19 13:51:10 -07005685 * @deprecated
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07005686 */
Steve McKayea93fe72016-12-02 11:35:35 -08005687 @Deprecated
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07005688 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE =
5689 "accessibility_display_magnification_auto_update";
5690
5691 /**
Anna Galusza9b278112016-01-04 11:37:37 -08005692 * Setting that specifies what mode the soft keyboard is in (default or hidden). Can be
5693 * modified from an AccessibilityService using the SoftKeyboardController.
5694 *
5695 * @hide
5696 */
5697 public static final String ACCESSIBILITY_SOFT_KEYBOARD_MODE =
5698 "accessibility_soft_keyboard_mode";
5699
5700 /**
5701 * Default soft keyboard behavior.
5702 *
5703 * @hide
5704 */
5705 public static final int SHOW_MODE_AUTO = 0;
5706
5707 /**
5708 * Soft keyboard is never shown.
5709 *
5710 * @hide
5711 */
5712 public static final int SHOW_MODE_HIDDEN = 1;
5713
5714 /**
Alan Viveretteef793802013-07-23 14:15:28 -07005715 * Setting that specifies whether timed text (captions) should be
5716 * displayed in video content. Text display properties are controlled by
5717 * the following settings:
5718 * <ul>
5719 * <li>{@link #ACCESSIBILITY_CAPTIONING_LOCALE}
5720 * <li>{@link #ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR}
5721 * <li>{@link #ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR}
5722 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_COLOR}
5723 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_TYPE}
5724 * <li>{@link #ACCESSIBILITY_CAPTIONING_TYPEFACE}
Alan Viverette69ce69b2013-08-29 12:23:48 -07005725 * <li>{@link #ACCESSIBILITY_CAPTIONING_FONT_SCALE}
Alan Viveretteef793802013-07-23 14:15:28 -07005726 * </ul>
5727 *
5728 * @hide
5729 */
5730 public static final String ACCESSIBILITY_CAPTIONING_ENABLED =
5731 "accessibility_captioning_enabled";
5732
5733 /**
5734 * Setting that specifies the language for captions as a locale string,
5735 * e.g. en_US.
5736 *
5737 * @see java.util.Locale#toString
5738 * @hide
5739 */
5740 public static final String ACCESSIBILITY_CAPTIONING_LOCALE =
5741 "accessibility_captioning_locale";
5742
5743 /**
Alan Viverette43a1e3d2013-08-02 16:45:03 -07005744 * Integer property that specifies the preset style for captions, one
5745 * of:
5746 * <ul>
Alan Viverette69ce69b2013-08-29 12:23:48 -07005747 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESET_CUSTOM}
5748 * <li>a valid index of {@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESETS}
Alan Viverette43a1e3d2013-08-02 16:45:03 -07005749 * </ul>
5750 *
5751 * @see java.util.Locale#toString
5752 * @hide
5753 */
5754 public static final String ACCESSIBILITY_CAPTIONING_PRESET =
5755 "accessibility_captioning_preset";
5756
5757 /**
Alan Viveretteef793802013-07-23 14:15:28 -07005758 * Integer property that specifes the background color for captions as a
5759 * packed 32-bit color.
5760 *
5761 * @see android.graphics.Color#argb
5762 * @hide
5763 */
5764 public static final String ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR =
5765 "accessibility_captioning_background_color";
5766
5767 /**
5768 * Integer property that specifes the foreground color for captions as a
5769 * packed 32-bit color.
5770 *
5771 * @see android.graphics.Color#argb
5772 * @hide
5773 */
5774 public static final String ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR =
5775 "accessibility_captioning_foreground_color";
5776
5777 /**
5778 * Integer property that specifes the edge type for captions, one of:
5779 * <ul>
Alan Viverette69ce69b2013-08-29 12:23:48 -07005780 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_NONE}
5781 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_OUTLINE}
5782 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_DROP_SHADOW}
Alan Viveretteef793802013-07-23 14:15:28 -07005783 * </ul>
5784 *
5785 * @see #ACCESSIBILITY_CAPTIONING_EDGE_COLOR
5786 * @hide
5787 */
5788 public static final String ACCESSIBILITY_CAPTIONING_EDGE_TYPE =
5789 "accessibility_captioning_edge_type";
5790
5791 /**
5792 * Integer property that specifes the edge color for captions as a
5793 * packed 32-bit color.
5794 *
5795 * @see #ACCESSIBILITY_CAPTIONING_EDGE_TYPE
5796 * @see android.graphics.Color#argb
5797 * @hide
5798 */
5799 public static final String ACCESSIBILITY_CAPTIONING_EDGE_COLOR =
5800 "accessibility_captioning_edge_color";
5801
5802 /**
Alan Viverette55d70622013-12-11 15:22:14 -08005803 * Integer property that specifes the window color for captions as a
5804 * packed 32-bit color.
5805 *
5806 * @see android.graphics.Color#argb
5807 * @hide
5808 */
5809 public static final String ACCESSIBILITY_CAPTIONING_WINDOW_COLOR =
5810 "accessibility_captioning_window_color";
5811
5812 /**
Alan Viveretteef793802013-07-23 14:15:28 -07005813 * String property that specifies the typeface for captions, one of:
5814 * <ul>
5815 * <li>DEFAULT
5816 * <li>MONOSPACE
5817 * <li>SANS_SERIF
5818 * <li>SERIF
5819 * </ul>
5820 *
5821 * @see android.graphics.Typeface
5822 * @hide
5823 */
5824 public static final String ACCESSIBILITY_CAPTIONING_TYPEFACE =
5825 "accessibility_captioning_typeface";
5826
5827 /**
Alan Viverette69ce69b2013-08-29 12:23:48 -07005828 * Floating point property that specifies font scaling for captions.
Alan Viveretteef793802013-07-23 14:15:28 -07005829 *
5830 * @hide
5831 */
Alan Viverette69ce69b2013-08-29 12:23:48 -07005832 public static final String ACCESSIBILITY_CAPTIONING_FONT_SCALE =
5833 "accessibility_captioning_font_scale";
Alan Viveretteef793802013-07-23 14:15:28 -07005834
5835 /**
Alan Viverette410d4e32013-09-30 15:37:38 -07005836 * Setting that specifies whether display color inversion is enabled.
Alan Viverette410d4e32013-09-30 15:37:38 -07005837 */
5838 public static final String ACCESSIBILITY_DISPLAY_INVERSION_ENABLED =
5839 "accessibility_display_inversion_enabled";
5840
5841 /**
Alan Viverette410d4e32013-09-30 15:37:38 -07005842 * Setting that specifies whether display color space adjustment is
5843 * enabled.
5844 *
5845 * @hide
5846 */
5847 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED =
5848 "accessibility_display_daltonizer_enabled";
5849
5850 /**
5851 * Integer property that specifies the type of color space adjustment to
5852 * perform. Valid values are defined in AccessibilityManager.
5853 *
5854 * @hide
5855 */
5856 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER =
5857 "accessibility_display_daltonizer";
5858
5859 /**
Toni Barzic386f8342015-09-09 12:30:41 -07005860 * Setting that specifies whether automatic click when the mouse pointer stops moving is
5861 * enabled.
5862 *
5863 * @hide
5864 */
5865 public static final String ACCESSIBILITY_AUTOCLICK_ENABLED =
5866 "accessibility_autoclick_enabled";
5867
5868 /**
5869 * Integer setting specifying amount of time in ms the mouse pointer has to stay still
5870 * before performing click when {@link #ACCESSIBILITY_AUTOCLICK_ENABLED} is set.
5871 *
5872 * @see #ACCESSIBILITY_AUTOCLICK_ENABLED
5873 * @hide
5874 */
5875 public static final String ACCESSIBILITY_AUTOCLICK_DELAY =
5876 "accessibility_autoclick_delay";
5877
5878 /**
Jun Mukai19a56012015-11-24 11:25:52 -08005879 * Whether or not larger size icons are used for the pointer of mouse/trackpad for
5880 * accessibility.
5881 * (0 = false, 1 = true)
5882 * @hide
5883 */
5884 public static final String ACCESSIBILITY_LARGE_POINTER_ICON =
5885 "accessibility_large_pointer_icon";
5886
5887 /**
Toni Barzic386f8342015-09-09 12:30:41 -07005888 * The timeout for considering a press to be a long press in milliseconds.
Svetoslav Ganov54d068e2011-03-02 12:58:40 -08005889 * @hide
5890 */
5891 public static final String LONG_PRESS_TIMEOUT = "long_press_timeout";
5892
5893 /**
Anthony Hugh96e9cc52016-07-12 15:17:24 -07005894 * The duration in milliseconds between the first tap's up event and the second tap's
5895 * down event for an interaction to be considered part of the same multi-press.
5896 * @hide
5897 */
5898 public static final String MULTI_PRESS_TIMEOUT = "multi_press_timeout";
5899
5900 /**
Svetoslav Ganov6bd20bc2013-09-02 15:24:45 -07005901 * List of the enabled print services.
Philip P. Moltmann8141bdf2015-12-21 17:03:05 -08005902 *
5903 * N and beyond uses {@link #DISABLED_PRINT_SERVICES}. But this might be used in an upgrade
5904 * from pre-N.
5905 *
Svetoslav Ganov4b9a4d12013-06-11 15:20:06 -07005906 * @hide
5907 */
5908 public static final String ENABLED_PRINT_SERVICES =
5909 "enabled_print_services";
5910
5911 /**
Philip P. Moltmann8141bdf2015-12-21 17:03:05 -08005912 * List of the disabled print services.
5913 *
Svetoslav Ganov6bd20bc2013-09-02 15:24:45 -07005914 * @hide
5915 */
Svetoslav Ganov2dcedc122017-06-07 18:50:02 -07005916 @TestApi
Philip P. Moltmann8141bdf2015-12-21 17:03:05 -08005917 public static final String DISABLED_PRINT_SERVICES =
5918 "disabled_print_services";
Svetoslav Ganov6bd20bc2013-09-02 15:24:45 -07005919
5920 /**
Alan Viverette5e8d8372016-02-03 15:38:59 -05005921 * The saved value for WindowManagerService.setForcedDisplayDensity()
5922 * formatted as a single integer representing DPI. If unset, then use
5923 * the real display density.
5924 *
5925 * @hide
5926 */
5927 public static final String DISPLAY_DENSITY_FORCED = "display_density_forced";
5928
5929 /**
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07005930 * Setting to always use the default text-to-speech settings regardless
5931 * of the application settings.
5932 * 1 = override application settings,
5933 * 0 = use application settings (if specified).
Narayan Kamath6d632962011-08-24 11:51:37 +01005934 *
5935 * @deprecated The value of this setting is no longer respected by
5936 * the framework text to speech APIs as of the Ice Cream Sandwich release.
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07005937 */
Narayan Kamath6d632962011-08-24 11:51:37 +01005938 @Deprecated
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07005939 public static final String TTS_USE_DEFAULTS = "tts_use_defaults";
5940
5941 /**
5942 * Default text-to-speech engine speech rate. 100 = 1x
5943 */
5944 public static final String TTS_DEFAULT_RATE = "tts_default_rate";
5945
5946 /**
5947 * Default text-to-speech engine pitch. 100 = 1x
5948 */
5949 public static final String TTS_DEFAULT_PITCH = "tts_default_pitch";
5950
5951 /**
5952 * Default text-to-speech engine.
5953 */
5954 public static final String TTS_DEFAULT_SYNTH = "tts_default_synth";
5955
5956 /**
Jean-Michel Trivif4782672009-06-09 16:22:48 -07005957 * Default text-to-speech language.
Narayan Kamath6d632962011-08-24 11:51:37 +01005958 *
5959 * @deprecated this setting is no longer in use, as of the Ice Cream
5960 * Sandwich release. Apps should never need to read this setting directly,
5961 * instead can query the TextToSpeech framework classes for the default
5962 * locale. {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivif4782672009-06-09 16:22:48 -07005963 */
Narayan Kamath6d632962011-08-24 11:51:37 +01005964 @Deprecated
Jean-Michel Trivif4782672009-06-09 16:22:48 -07005965 public static final String TTS_DEFAULT_LANG = "tts_default_lang";
5966
5967 /**
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07005968 * Default text-to-speech country.
Narayan Kamath6d632962011-08-24 11:51:37 +01005969 *
5970 * @deprecated this setting is no longer in use, as of the Ice Cream
5971 * Sandwich release. Apps should never need to read this setting directly,
5972 * instead can query the TextToSpeech framework classes for the default
5973 * locale. {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07005974 */
Narayan Kamath6d632962011-08-24 11:51:37 +01005975 @Deprecated
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07005976 public static final String TTS_DEFAULT_COUNTRY = "tts_default_country";
5977
5978 /**
5979 * Default text-to-speech locale variant.
Narayan Kamath6d632962011-08-24 11:51:37 +01005980 *
5981 * @deprecated this setting is no longer in use, as of the Ice Cream
5982 * Sandwich release. Apps should never need to read this setting directly,
5983 * instead can query the TextToSpeech framework classes for the
5984 * locale that is in use {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07005985 */
Narayan Kamath6d632962011-08-24 11:51:37 +01005986 @Deprecated
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07005987 public static final String TTS_DEFAULT_VARIANT = "tts_default_variant";
5988
5989 /**
Narayan Kamathe5b8c4d2011-08-22 15:37:47 +01005990 * Stores the default tts locales on a per engine basis. Stored as
5991 * a comma seperated list of values, each value being of the form
5992 * {@code engine_name:locale} for example,
Narayan Kamath6d632962011-08-24 11:51:37 +01005993 * {@code com.foo.ttsengine:eng-USA,com.bar.ttsengine:esp-ESP}. This
5994 * supersedes {@link #TTS_DEFAULT_LANG}, {@link #TTS_DEFAULT_COUNTRY} and
5995 * {@link #TTS_DEFAULT_VARIANT}. Apps should never need to read this
5996 * setting directly, and can query the TextToSpeech framework classes
5997 * for the locale that is in use.
Narayan Kamathe5b8c4d2011-08-22 15:37:47 +01005998 *
5999 * @hide
6000 */
6001 public static final String TTS_DEFAULT_LOCALE = "tts_default_locale";
6002
6003 /**
Charles Chenceffa152010-03-16 21:18:10 -07006004 * Space delimited list of plugin packages that are enabled.
6005 */
6006 public static final String TTS_ENABLED_PLUGINS = "tts_enabled_plugins";
6007
6008 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07006009 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON}
6010 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006011 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07006012 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006013 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
Christopher Tate6f5a9a92012-09-14 17:24:28 -07006014 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006015
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006016 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07006017 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY}
6018 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006019 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07006020 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006021 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
Christopher Tate6f5a9a92012-09-14 17:24:28 -07006022 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006023
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006024 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07006025 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
6026 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006027 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07006028 @Deprecated
6029 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT =
6030 Global.WIFI_NUM_OPEN_NETWORKS_KEPT;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006031
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006032 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07006033 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON}
6034 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006035 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07006036 @Deprecated
6037 public static final String WIFI_ON = Global.WIFI_ON;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006038
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006039 /**
6040 * The acceptable packet loss percentage (range 0 - 100) before trying
6041 * another AP on the same network.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006042 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006043 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07006044 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006045 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
6046 "wifi_watchdog_acceptable_packet_loss_percentage";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006047
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006048 /**
6049 * The number of access points required for a network in order for the
6050 * watchdog to monitor it.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006051 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006052 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07006053 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006054 public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006055
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006056 /**
6057 * The delay between background checks.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006058 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006059 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07006060 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006061 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
6062 "wifi_watchdog_background_check_delay_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006063
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006064 /**
6065 * Whether the Wi-Fi watchdog is enabled for background checking even
6066 * after it thinks the user has connected to a good access point.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006067 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006068 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07006069 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006070 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
6071 "wifi_watchdog_background_check_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006072
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006073 /**
6074 * The timeout for a background ping
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006075 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006076 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07006077 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006078 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
6079 "wifi_watchdog_background_check_timeout_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006080
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006081 /**
6082 * The number of initial pings to perform that *may* be ignored if they
6083 * fail. Again, if these fail, they will *not* be used in packet loss
6084 * calculation. For example, one network always seemed to time out for
6085 * the first couple pings, so this is set to 3 by default.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006086 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006087 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07006088 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006089 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
6090 "wifi_watchdog_initial_ignored_ping_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006091
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006092 /**
6093 * The maximum number of access points (per network) to attempt to test.
6094 * If this number is reached, the watchdog will no longer monitor the
6095 * initial connection state for the network. This is a safeguard for
6096 * networks containing multiple APs whose DNS does not respond to pings.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006097 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006098 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07006099 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006100 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = "wifi_watchdog_max_ap_checks";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006101
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006102 /**
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07006103 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006104 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07006105 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006106 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
6107
6108 /**
6109 * A comma-separated list of SSIDs for which the Wi-Fi watchdog should be enabled.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006110 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006111 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07006112 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006113 public static final String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list";
6114
6115 /**
6116 * The number of pings to test if an access point is a good connection.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006117 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006118 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07006119 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006120 public static final String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006121
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006122 /**
6123 * The delay between pings.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006124 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006125 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07006126 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006127 public static final String WIFI_WATCHDOG_PING_DELAY_MS = "wifi_watchdog_ping_delay_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006128
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006129 /**
6130 * The timeout per ping.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006131 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006132 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07006133 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006134 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006135
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006136 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006137 * @deprecated Use
6138 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006139 */
Christopher Tate06efb532012-08-24 15:29:27 -07006140 @Deprecated
6141 public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006142
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006143 /**
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006144 * @deprecated Use
6145 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006146 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07006147 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006148 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006149 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006150
6151 /**
Jeremy Joslin79294842014-12-03 17:15:28 -08006152 * The number of milliseconds to hold on to a PendingIntent based request. This delay gives
6153 * the receivers of the PendingIntent an opportunity to make a new network request before
6154 * the Network satisfying the request is potentially removed.
6155 *
6156 * @hide
6157 */
6158 public static final String CONNECTIVITY_RELEASE_PENDING_INTENT_DELAY_MS =
6159 "connectivity_release_pending_intent_delay_ms";
6160
6161 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07006162 * Whether background data usage is allowed.
6163 *
6164 * @deprecated As of {@link VERSION_CODES#ICE_CREAM_SANDWICH},
6165 * availability of background data depends on several
6166 * combined factors. When background data is unavailable,
6167 * {@link ConnectivityManager#getActiveNetworkInfo()} will
6168 * now appear disconnected.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006169 */
Jeff Sharkey3a844fc2011-08-16 14:37:57 -07006170 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006171 public static final String BACKGROUND_DATA = "background_data";
Wink Saville04e71b32009-04-02 11:00:54 -07006172
6173 /**
Bjorn Bringert98bfa392010-03-24 10:59:48 +00006174 * Origins for which browsers should allow geolocation by default.
6175 * The value is a space-separated list of origins.
6176 */
6177 public static final String ALLOWED_GEOLOCATION_ORIGINS
6178 = "allowed_geolocation_origins";
6179
6180 /**
Wink Savillee9b06d72009-05-18 21:47:50 -07006181 * The preferred TTY mode 0 = TTy Off, CDMA default
6182 * 1 = TTY Full
6183 * 2 = TTY HCO
6184 * 3 = TTY VCO
6185 * @hide
6186 */
6187 public static final String PREFERRED_TTY_MODE =
6188 "preferred_tty_mode";
6189
Wink Saville04e71b32009-04-02 11:00:54 -07006190 /**
Wink Saville04e71b32009-04-02 11:00:54 -07006191 * Whether the enhanced voice privacy mode is enabled.
6192 * 0 = normal voice privacy
6193 * 1 = enhanced voice privacy
6194 * @hide
6195 */
6196 public static final String ENHANCED_VOICE_PRIVACY_ENABLED = "enhanced_voice_privacy_enabled";
6197
6198 /**
6199 * Whether the TTY mode mode is enabled.
6200 * 0 = disabled
6201 * 1 = enabled
6202 * @hide
6203 */
6204 public static final String TTY_MODE_ENABLED = "tty_mode_enabled";
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07006205
6206 /**
Christopher Tate8031a3d2009-07-06 16:36:05 -07006207 * Controls whether settings backup is enabled.
Dianne Hackborncf098292009-07-01 19:55:20 -07006208 * Type: int ( 0 = disabled, 1 = enabled )
6209 * @hide
6210 */
6211 public static final String BACKUP_ENABLED = "backup_enabled";
6212
6213 /**
Christopher Tatecce9da52010-02-03 15:11:15 -08006214 * Controls whether application data is automatically restored from backup
6215 * at install time.
6216 * Type: int ( 0 = disabled, 1 = enabled )
6217 * @hide
6218 */
6219 public static final String BACKUP_AUTO_RESTORE = "backup_auto_restore";
6220
6221 /**
Christopher Tate8031a3d2009-07-06 16:36:05 -07006222 * Indicates whether settings backup has been fully provisioned.
6223 * Type: int ( 0 = unprovisioned, 1 = fully provisioned )
6224 * @hide
6225 */
6226 public static final String BACKUP_PROVISIONED = "backup_provisioned";
6227
6228 /**
Dianne Hackborncf098292009-07-01 19:55:20 -07006229 * Component of the transport to use for backup/restore.
6230 * @hide
6231 */
6232 public static final String BACKUP_TRANSPORT = "backup_transport";
Sanjay Jeyakumar21bf2412009-07-09 13:31:48 -07006233
Dianne Hackbornd7cd29d2009-07-01 11:22:45 -07006234 /**
6235 * Version for which the setup wizard was last shown. Bumped for
6236 * each release when there is new setup information to show.
6237 * @hide
6238 */
6239 public static final String LAST_SETUP_SHOWN = "last_setup_shown";
Dianne Hackborncf098292009-07-01 19:55:20 -07006240
6241 /**
Doug Zongker43866e02010-01-07 12:09:54 -08006242 * The interval in milliseconds after which Wi-Fi is considered idle.
6243 * When idle, it is possible for the device to be switched from Wi-Fi to
6244 * the mobile data network.
6245 * @hide
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006246 * @deprecated Use {@link android.provider.Settings.Global#WIFI_IDLE_MS}
6247 * instead.
Doug Zongker43866e02010-01-07 12:09:54 -08006248 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07006249 @Deprecated
6250 public static final String WIFI_IDLE_MS = Global.WIFI_IDLE_MS;
Doug Zongker43866e02010-01-07 12:09:54 -08006251
6252 /**
Narayan Kamathee69ff42011-06-28 12:07:18 +01006253 * The global search provider chosen by the user (if multiple global
6254 * search providers are installed). This will be the provider returned
6255 * by {@link SearchManager#getGlobalSearchActivity()} if it's still
6256 * installed. This setting is stored as a flattened component name as
6257 * per {@link ComponentName#flattenToString()}.
6258 *
6259 * @hide
6260 */
6261 public static final String SEARCH_GLOBAL_SEARCH_ACTIVITY =
6262 "search_global_search_activity";
6263
6264 /**
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08006265 * The number of promoted sources in GlobalSearch.
6266 * @hide
6267 */
6268 public static final String SEARCH_NUM_PROMOTED_SOURCES = "search_num_promoted_sources";
6269 /**
6270 * The maximum number of suggestions returned by GlobalSearch.
6271 * @hide
6272 */
6273 public static final String SEARCH_MAX_RESULTS_TO_DISPLAY = "search_max_results_to_display";
6274 /**
6275 * The number of suggestions GlobalSearch will ask each non-web search source for.
6276 * @hide
6277 */
6278 public static final String SEARCH_MAX_RESULTS_PER_SOURCE = "search_max_results_per_source";
6279 /**
6280 * The number of suggestions the GlobalSearch will ask the web search source for.
6281 * @hide
6282 */
6283 public static final String SEARCH_WEB_RESULTS_OVERRIDE_LIMIT =
6284 "search_web_results_override_limit";
6285 /**
6286 * The number of milliseconds that GlobalSearch will wait for suggestions from
6287 * promoted sources before continuing with all other sources.
6288 * @hide
6289 */
6290 public static final String SEARCH_PROMOTED_SOURCE_DEADLINE_MILLIS =
6291 "search_promoted_source_deadline_millis";
6292 /**
6293 * The number of milliseconds before GlobalSearch aborts search suggesiton queries.
6294 * @hide
6295 */
6296 public static final String SEARCH_SOURCE_TIMEOUT_MILLIS = "search_source_timeout_millis";
6297 /**
6298 * The maximum number of milliseconds that GlobalSearch shows the previous results
6299 * after receiving a new query.
6300 * @hide
6301 */
6302 public static final String SEARCH_PREFILL_MILLIS = "search_prefill_millis";
6303 /**
6304 * The maximum age of log data used for shortcuts in GlobalSearch.
6305 * @hide
6306 */
6307 public static final String SEARCH_MAX_STAT_AGE_MILLIS = "search_max_stat_age_millis";
6308 /**
6309 * The maximum age of log data used for source ranking in GlobalSearch.
6310 * @hide
6311 */
6312 public static final String SEARCH_MAX_SOURCE_EVENT_AGE_MILLIS =
6313 "search_max_source_event_age_millis";
6314 /**
6315 * The minimum number of impressions needed to rank a source in GlobalSearch.
6316 * @hide
6317 */
6318 public static final String SEARCH_MIN_IMPRESSIONS_FOR_SOURCE_RANKING =
6319 "search_min_impressions_for_source_ranking";
6320 /**
6321 * The minimum number of clicks needed to rank a source in GlobalSearch.
6322 * @hide
6323 */
6324 public static final String SEARCH_MIN_CLICKS_FOR_SOURCE_RANKING =
6325 "search_min_clicks_for_source_ranking";
6326 /**
6327 * The maximum number of shortcuts shown by GlobalSearch.
6328 * @hide
6329 */
6330 public static final String SEARCH_MAX_SHORTCUTS_RETURNED = "search_max_shortcuts_returned";
6331 /**
6332 * The size of the core thread pool for suggestion queries in GlobalSearch.
6333 * @hide
6334 */
6335 public static final String SEARCH_QUERY_THREAD_CORE_POOL_SIZE =
6336 "search_query_thread_core_pool_size";
6337 /**
6338 * The maximum size of the thread pool for suggestion queries in GlobalSearch.
6339 * @hide
6340 */
6341 public static final String SEARCH_QUERY_THREAD_MAX_POOL_SIZE =
6342 "search_query_thread_max_pool_size";
6343 /**
6344 * The size of the core thread pool for shortcut refreshing in GlobalSearch.
6345 * @hide
6346 */
6347 public static final String SEARCH_SHORTCUT_REFRESH_CORE_POOL_SIZE =
6348 "search_shortcut_refresh_core_pool_size";
6349 /**
6350 * The maximum size of the thread pool for shortcut refreshing in GlobalSearch.
6351 * @hide
6352 */
6353 public static final String SEARCH_SHORTCUT_REFRESH_MAX_POOL_SIZE =
6354 "search_shortcut_refresh_max_pool_size";
6355 /**
6356 * The maximun time that excess threads in the GlobalSeach thread pools will
6357 * wait before terminating.
6358 * @hide
6359 */
6360 public static final String SEARCH_THREAD_KEEPALIVE_SECONDS =
6361 "search_thread_keepalive_seconds";
6362 /**
6363 * The maximum number of concurrent suggestion queries to each source.
6364 * @hide
6365 */
6366 public static final String SEARCH_PER_SOURCE_CONCURRENT_QUERY_LIMIT =
6367 "search_per_source_concurrent_query_limit";
6368
San Mehat87734d32010-01-08 12:53:06 -08006369 /**
Sudheer Shanka2250d562016-11-07 15:41:02 -08006370 * Whether or not alert sounds are played on StorageManagerService events.
6371 * (0 = false, 1 = true)
San Mehat87734d32010-01-08 12:53:06 -08006372 * @hide
6373 */
6374 public static final String MOUNT_PLAY_NOTIFICATION_SND = "mount_play_not_snd";
6375
6376 /**
6377 * Whether or not UMS auto-starts on UMS host detection. (0 = false, 1 = true)
6378 * @hide
6379 */
6380 public static final String MOUNT_UMS_AUTOSTART = "mount_ums_autostart";
6381
6382 /**
6383 * Whether or not a notification is displayed on UMS host detection. (0 = false, 1 = true)
6384 * @hide
6385 */
6386 public static final String MOUNT_UMS_PROMPT = "mount_ums_prompt";
6387
6388 /**
6389 * Whether or not a notification is displayed while UMS is enabled. (0 = false, 1 = true)
6390 * @hide
6391 */
6392 public static final String MOUNT_UMS_NOTIFY_ENABLED = "mount_ums_notify_enabled";
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08006393
Dan Egnor42471dd2010-01-07 17:25:22 -08006394 /**
6395 * If nonzero, ANRs in invisible background processes bring up a dialog.
6396 * Otherwise, the process will be silently killed.
Adrian Roos6a7e0892016-08-23 14:26:39 +02006397 *
6398 * Also prevents ANRs and crash dialogs from being suppressed.
Dan Egnor42471dd2010-01-07 17:25:22 -08006399 * @hide
6400 */
6401 public static final String ANR_SHOW_BACKGROUND = "anr_show_background";
Erikeebc8e22010-02-18 13:27:19 -08006402
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08006403 /**
6404 * The {@link ComponentName} string of the service to be used as the voice recognition
6405 * service.
Erikeebc8e22010-02-18 13:27:19 -08006406 *
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08006407 * @hide
6408 */
6409 public static final String VOICE_RECOGNITION_SERVICE = "voice_recognition_service";
Dan Egnor42471dd2010-01-07 17:25:22 -08006410
William Luh623a4282013-06-24 12:14:18 -07006411 /**
6412 * Stores whether an user has consented to have apps verified through PAM.
6413 * The value is boolean (1 or 0).
6414 *
6415 * @hide
6416 */
6417 public static final String PACKAGE_VERIFIER_USER_CONSENT =
6418 "package_verifier_user_consent";
satok988323c2011-06-22 16:38:13 +09006419
6420 /**
satokada8c4e2011-08-23 14:56:56 +09006421 * The {@link ComponentName} string of the selected spell checker service which is
6422 * one of the services managed by the text service manager.
6423 *
6424 * @hide
6425 */
6426 public static final String SELECTED_SPELL_CHECKER = "selected_spell_checker";
6427
6428 /**
6429 * The {@link ComponentName} string of the selected subtype of the selected spell checker
satok988323c2011-06-22 16:38:13 +09006430 * service which is one of the services managed by the text service manager.
6431 *
6432 * @hide
6433 */
satokada8c4e2011-08-23 14:56:56 +09006434 public static final String SELECTED_SPELL_CHECKER_SUBTYPE =
6435 "selected_spell_checker_subtype";
satok988323c2011-06-22 16:38:13 +09006436
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08006437 /**
satoka33c4fc2011-08-25 16:50:11 +09006438 * The {@link ComponentName} string whether spell checker is enabled or not.
6439 *
6440 * @hide
6441 */
6442 public static final String SPELL_CHECKER_ENABLED = "spell_checker_enabled";
6443
6444 /**
David Brown458e8062010-03-08 21:52:11 -08006445 * What happens when the user presses the Power button while in-call
6446 * and the screen is on.<br/>
6447 * <b>Values:</b><br/>
6448 * 1 - The Power button turns off the screen and locks the device. (Default behavior)<br/>
6449 * 2 - The Power button hangs up the current call.<br/>
6450 *
6451 * @hide
6452 */
6453 public static final String INCALL_POWER_BUTTON_BEHAVIOR = "incall_power_button_behavior";
6454
6455 /**
6456 * INCALL_POWER_BUTTON_BEHAVIOR value for "turn off screen".
6457 * @hide
6458 */
6459 public static final int INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF = 0x1;
6460
6461 /**
6462 * INCALL_POWER_BUTTON_BEHAVIOR value for "hang up".
6463 * @hide
6464 */
6465 public static final int INCALL_POWER_BUTTON_BEHAVIOR_HANGUP = 0x2;
6466
6467 /**
6468 * INCALL_POWER_BUTTON_BEHAVIOR default value.
6469 * @hide
6470 */
6471 public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT =
6472 INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF;
6473
6474 /**
Bryce Leedb776ce2016-09-03 15:02:00 -07006475 * What happens when the user presses the Back button while in-call
6476 * and the screen is on.<br/>
6477 * <b>Values:</b><br/>
6478 * 0 - The Back buttons does nothing different.<br/>
6479 * 1 - The Back button hangs up the current call.<br/>
6480 *
6481 * @hide
6482 */
6483 public static final String INCALL_BACK_BUTTON_BEHAVIOR = "incall_back_button_behavior";
6484
6485 /**
6486 * INCALL_BACK_BUTTON_BEHAVIOR value for no action.
6487 * @hide
6488 */
6489 public static final int INCALL_BACK_BUTTON_BEHAVIOR_NONE = 0x0;
6490
6491 /**
6492 * INCALL_BACK_BUTTON_BEHAVIOR value for "hang up".
6493 * @hide
6494 */
6495 public static final int INCALL_BACK_BUTTON_BEHAVIOR_HANGUP = 0x1;
6496
6497 /**
6498 * INCALL_POWER_BUTTON_BEHAVIOR default value.
6499 * @hide
6500 */
6501 public static final int INCALL_BACK_BUTTON_BEHAVIOR_DEFAULT =
6502 INCALL_BACK_BUTTON_BEHAVIOR_NONE;
6503
6504 /**
Jeff Browna20dda42014-05-27 20:57:24 -07006505 * Whether the device should wake when the wake gesture sensor detects motion.
6506 * @hide
6507 */
6508 public static final String WAKE_GESTURE_ENABLED = "wake_gesture_enabled";
6509
6510 /**
John Spurlocka4215ce2014-08-04 14:50:38 -04006511 * Whether the device should doze if configured.
6512 * @hide
6513 */
6514 public static final String DOZE_ENABLED = "doze_enabled";
6515
6516 /**
Adrian Roosebea7a72016-10-26 12:51:26 -07006517 * Whether doze should be always on.
6518 * @hide
6519 */
6520 public static final String DOZE_ALWAYS_ON = "doze_always_on";
6521
6522 /**
Doris Ling6403b402016-09-09 14:29:19 -07006523 * Whether the device should pulse on pick up gesture.
6524 * @hide
6525 */
6526 public static final String DOZE_PULSE_ON_PICK_UP = "doze_pulse_on_pick_up";
6527
6528 /**
Adrian Roosd0963a02017-05-15 14:33:37 -07006529 * Whether the device should pulse on long press gesture.
6530 * @hide
6531 */
6532 public static final String DOZE_PULSE_ON_LONG_PRESS = "doze_pulse_on_long_press";
6533
6534 /**
Doris Ling6403b402016-09-09 14:29:19 -07006535 * Whether the device should pulse on double tap gesture.
6536 * @hide
6537 */
6538 public static final String DOZE_PULSE_ON_DOUBLE_TAP = "doze_pulse_on_double_tap";
6539
6540 /**
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07006541 * The current night mode that has been selected by the user. Owned
6542 * and controlled by UiModeManagerService. Constants are as per
6543 * UiModeManager.
6544 * @hide
6545 */
6546 public static final String UI_NIGHT_MODE = "ui_night_mode";
Suchi Amalapurapu40e47252010-04-07 16:15:50 -07006547
6548 /**
John Spurlock1a868b72012-08-22 09:56:51 -04006549 * Whether screensavers are enabled.
Daniel Sandler0601eb72011-04-13 01:01:32 -04006550 * @hide
6551 */
Daniel Sandler2d545362011-11-17 10:38:37 -08006552 public static final String SCREENSAVER_ENABLED = "screensaver_enabled";
Daniel Sandler0601eb72011-04-13 01:01:32 -04006553
6554 /**
John Spurlock1a868b72012-08-22 09:56:51 -04006555 * The user's chosen screensaver components.
Daniel Sandler2d545362011-11-17 10:38:37 -08006556 *
John Spurlock1a868b72012-08-22 09:56:51 -04006557 * These will be launched by the PhoneWindowManager after a timeout when not on
Daniel Sandler2d545362011-11-17 10:38:37 -08006558 * battery, or upon dock insertion (if SCREENSAVER_ACTIVATE_ON_DOCK is set to 1).
Daniel Sandler0601eb72011-04-13 01:01:32 -04006559 * @hide
6560 */
John Spurlock1a868b72012-08-22 09:56:51 -04006561 public static final String SCREENSAVER_COMPONENTS = "screensaver_components";
Daniel Sandler2d545362011-11-17 10:38:37 -08006562
6563 /**
John Spurlock1a868b72012-08-22 09:56:51 -04006564 * If screensavers are enabled, whether the screensaver should be automatically launched
6565 * when the device is inserted into a (desk) dock.
Daniel Sandler2d545362011-11-17 10:38:37 -08006566 * @hide
6567 */
6568 public static final String SCREENSAVER_ACTIVATE_ON_DOCK = "screensaver_activate_on_dock";
Daniel Sandler0601eb72011-04-13 01:01:32 -04006569
John Spurlock1a868b72012-08-22 09:56:51 -04006570 /**
6571 * If screensavers are enabled, whether the screensaver should be automatically launched
6572 * when the screen times out when not on battery.
6573 * @hide
6574 */
6575 public static final String SCREENSAVER_ACTIVATE_ON_SLEEP = "screensaver_activate_on_sleep";
6576
6577 /**
6578 * If screensavers are enabled, the default screensaver component.
6579 * @hide
6580 */
6581 public static final String SCREENSAVER_DEFAULT_COMPONENT = "screensaver_default_component";
6582
Daniel Sandler0601eb72011-04-13 01:01:32 -04006583 /**
Martijn Coenena7397882013-07-30 20:07:47 -07006584 * The default NFC payment component
6585 * @hide
6586 */
6587 public static final String NFC_PAYMENT_DEFAULT_COMPONENT = "nfc_payment_default_component";
6588
6589 /**
Martijn Coenen2f6f3a012014-04-25 17:00:21 -07006590 * Whether NFC payment is handled by the foreground application or a default.
6591 * @hide
6592 */
6593 public static final String NFC_PAYMENT_FOREGROUND = "nfc_payment_foreground";
6594
6595 /**
David Braunf5d83192013-09-16 13:43:51 -07006596 * Specifies the package name currently configured to be the primary sms application
6597 * @hide
6598 */
6599 public static final String SMS_DEFAULT_APPLICATION = "sms_default_application";
6600
6601 /**
Yorke Lee014de022015-04-21 17:15:47 -07006602 * Specifies the package name currently configured to be the default dialer application
6603 * @hide
6604 */
6605 public static final String DIALER_DEFAULT_APPLICATION = "dialer_default_application";
6606
6607 /**
Adrian Roos943eb862015-03-26 12:31:16 -07006608 * Specifies the package name currently configured to be the emergency assistance application
6609 *
6610 * @see android.telephony.TelephonyManager#ACTION_EMERGENCY_ASSISTANCE
6611 *
6612 * @hide
6613 */
6614 public static final String EMERGENCY_ASSISTANCE_APPLICATION = "emergency_assistance_application";
6615
6616 /**
Jorim Jaggi9d910832015-05-18 17:35:26 -07006617 * Specifies whether the current app context on scren (assist data) will be sent to the
6618 * assist application (active voice interaction service).
6619 *
6620 * @hide
6621 */
6622 public static final String ASSIST_STRUCTURE_ENABLED = "assist_structure_enabled";
6623
6624 /**
Jorim Jaggia133f0b2015-06-26 16:40:00 -07006625 * Specifies whether a screenshot of the screen contents will be sent to the assist
6626 * application (active voice interaction service).
6627 *
6628 * @hide
6629 */
6630 public static final String ASSIST_SCREENSHOT_ENABLED = "assist_screenshot_enabled";
6631
6632 /**
Adrian Roos2335bd62016-08-11 15:42:40 -07006633 * Specifies whether the screen will show an animation if screen contents are sent to the
6634 * assist application (active voice interaction service).
6635 *
6636 * Note that the disclosure will be forced for third-party assistants or if the device
6637 * does not support disabling it.
6638 *
6639 * @hide
6640 */
6641 public static final String ASSIST_DISCLOSURE_ENABLED = "assist_disclosure_enabled";
6642
6643 /**
Julia Reynoldsb852e562017-06-06 16:14:18 -04006644 * Read only list of the service components that the current user has explicitly allowed to
Julia Reynolds77b2cc92016-11-08 14:41:09 -05006645 * see and assist with all of the user's notifications.
6646 *
Julia Reynoldsb852e562017-06-06 16:14:18 -04006647 * @deprecated Use
6648 * {@link NotificationManager#isNotificationListenerAccessGranted(ComponentName)}.
Julia Reynolds77b2cc92016-11-08 14:41:09 -05006649 * @hide
6650 */
Julia Reynoldsb852e562017-06-06 16:14:18 -04006651 @Deprecated
Julia Reynolds77b2cc92016-11-08 14:41:09 -05006652 public static final String ENABLED_NOTIFICATION_ASSISTANT =
6653 "enabled_notification_assistant";
6654
6655 /**
Julia Reynoldsb852e562017-06-06 16:14:18 -04006656 * Read only list of the service components that the current user has explicitly allowed to
Chris Wren8326a8a2014-10-22 14:13:32 -04006657 * see all of the user's notifications, separated by ':'.
Daniel Sandler4b749ef2013-03-18 21:53:04 -04006658 *
6659 * @hide
Julia Reynoldsb852e562017-06-06 16:14:18 -04006660 * @deprecated Use
6661 * {@link NotificationManager#isNotificationAssistantAccessGranted(ComponentName)}.
Daniel Sandler4b749ef2013-03-18 21:53:04 -04006662 */
Julia Reynoldsb852e562017-06-06 16:14:18 -04006663 @Deprecated
Daniel Sandler4b749ef2013-03-18 21:53:04 -04006664 public static final String ENABLED_NOTIFICATION_LISTENERS = "enabled_notification_listeners";
6665
John Spurlock7340fc82014-04-24 18:50:12 -04006666 /**
Julia Reynoldsb852e562017-06-06 16:14:18 -04006667 * Read only list of the packages that the current user has explicitly allowed to
6668 * manage do not disturb, separated by ':'.
Julia Reynolds0aa7d612016-04-25 14:57:33 -04006669 *
Julia Reynoldsb852e562017-06-06 16:14:18 -04006670 * @deprecated Use {@link NotificationManager#isNotificationPolicyAccessGranted()}.
Julia Reynolds0aa7d612016-04-25 14:57:33 -04006671 * @hide
John Spurlock7c74f782015-06-04 13:01:42 -04006672 */
Julia Reynoldsb852e562017-06-06 16:14:18 -04006673 @Deprecated
Julia Reynolds0aa7d612016-04-25 14:57:33 -04006674 @TestApi
John Spurlock7c74f782015-06-04 13:01:42 -04006675 public static final String ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES =
6676 "enabled_notification_policy_access_packages";
6677
Andre Lagoea35e072016-08-04 13:41:13 +01006678 /**
6679 * Defines whether managed profile ringtones should be synced from it's parent profile
6680 * <p>
6681 * 0 = ringtones are not synced
6682 * 1 = ringtones are synced from the profile's parent (default)
6683 * <p>
6684 * This value is only used for managed profiles.
6685 * @hide
6686 */
Robin Leec74d85f2017-03-16 17:19:42 +00006687 @TestApi
6688 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
Andre Lagoea35e072016-08-04 13:41:13 +01006689 public static final String SYNC_PARENT_SOUNDS = "sync_parent_sounds";
6690
John Spurlockcdb57ae2015-02-11 19:04:11 -05006691 /** @hide */
John Spurlockf1a36642013-10-12 17:50:42 -04006692 public static final String IMMERSIVE_MODE_CONFIRMATIONS = "immersive_mode_confirmations";
John Spurlockd67ec252013-09-05 11:31:54 -04006693
Yorke Lee647f8f32013-05-07 10:49:44 -07006694 /**
Svetoslavf43e8512013-09-30 17:33:05 -07006695 * This is the query URI for finding a print service to install.
6696 *
6697 * @hide
6698 */
6699 public static final String PRINT_SERVICE_SEARCH_URI = "print_service_search_uri";
6700
6701 /**
6702 * This is the query URI for finding a NFC payment service to install.
6703 *
6704 * @hide
6705 */
6706 public static final String PAYMENT_SERVICE_SEARCH_URI = "payment_service_search_uri";
6707
6708 /**
Philip P. Moltmanna30d6e02017-04-27 15:40:02 -07006709 * This is the query URI for finding a auto fill service to install.
6710 *
6711 * @hide
6712 */
6713 public static final String AUTOFILL_SERVICE_SEARCH_URI = "autofill_service_search_uri";
6714
6715 /**
Amith Yamasani1e9c2182014-06-11 17:25:51 -07006716 * If enabled, apps should try to skip any introductory hints on first launch. This might
Amith Yamasani0c416392014-06-13 15:54:39 -07006717 * apply to users that are already familiar with the environment or temporary users.
Amith Yamasani1e9c2182014-06-11 17:25:51 -07006718 * <p>
6719 * Type : int (0 to show hints, 1 to skip showing hints)
Amith Yamasani1e9c2182014-06-11 17:25:51 -07006720 */
6721 public static final String SKIP_FIRST_USE_HINTS = "skip_first_use_hints";
6722
6723 /**
John Spurlockaa5ee4d2014-07-25 13:05:12 -04006724 * Persisted playback time after a user confirmation of an unsafe volume level.
6725 *
6726 * @hide
6727 */
6728 public static final String UNSAFE_VOLUME_MUSIC_ACTIVE_MS = "unsafe_volume_music_active_ms";
6729
6730 /**
Dan Sandler52e5701e2014-07-22 23:14:54 -04006731 * This preference enables notification display on the lockscreen.
6732 * @hide
6733 */
6734 public static final String LOCK_SCREEN_SHOW_NOTIFICATIONS =
6735 "lock_screen_show_notifications";
6736
6737 /**
Winson Chung28217a42017-02-15 13:46:52 -08006738 * This preference stores the last stack active task time for each user, which affects what
6739 * tasks will be visible in Overview.
6740 * @hide
6741 */
6742 public static final String OVERVIEW_LAST_STACK_ACTIVE_TIME =
6743 "overview_last_stack_active_time";
6744
6745 /**
Dongwon Kang4d933a02014-08-07 22:51:47 -07006746 * List of TV inputs that are currently hidden. This is a string
Jaewan Kimf0e530e2014-08-22 00:43:31 +09006747 * containing the IDs of all hidden TV inputs. Each ID is encoded by
6748 * {@link android.net.Uri#encode(String)} and separated by ':'.
Dongwon Kang4d933a02014-08-07 22:51:47 -07006749 * @hide
6750 */
6751 public static final String TV_INPUT_HIDDEN_INPUTS = "tv_input_hidden_inputs";
6752
6753 /**
6754 * List of custom TV input labels. This is a string containing <TV input id, custom name>
Jaewan Kimf0e530e2014-08-22 00:43:31 +09006755 * pairs. TV input id and custom name are encoded by {@link android.net.Uri#encode(String)}
6756 * and separated by ','. Each pair is separated by ':'.
Dongwon Kang4d933a02014-08-07 22:51:47 -07006757 * @hide
6758 */
6759 public static final String TV_INPUT_CUSTOM_LABELS = "tv_input_custom_labels";
6760
6761 /**
Glenn Kasten34cc4db2014-08-13 10:56:38 -07006762 * Whether automatic routing of system audio to USB audio peripheral is disabled.
6763 * The value is boolean (1 or 0), where 1 means automatic routing is disabled,
6764 * and 0 means automatic routing is enabled.
6765 *
6766 * @hide
6767 */
6768 public static final String USB_AUDIO_AUTOMATIC_ROUTING_DISABLED =
6769 "usb_audio_automatic_routing_disabled";
6770
6771 /**
Jeff Brown05af6ad2014-09-30 20:54:30 -07006772 * The timeout in milliseconds before the device fully goes to sleep after
6773 * a period of inactivity. This value sets an upper bound on how long the device
6774 * will stay awake or dreaming without user activity. It should generally
Dianne Hackbornad6a99b2014-11-18 10:11:10 -08006775 * be longer than {@link Settings.System#SCREEN_OFF_TIMEOUT} as otherwise the device
Jeff Brown05af6ad2014-09-30 20:54:30 -07006776 * will sleep before it ever has a chance to dream.
6777 * <p>
6778 * Use -1 to disable this timeout.
6779 * </p>
6780 *
6781 * @hide
6782 */
6783 public static final String SLEEP_TIMEOUT = "sleep_timeout";
6784
6785 /**
Jason Monk27bbb2d2015-03-31 16:46:39 -04006786 * Controls whether double tap to wake is enabled.
6787 * @hide
6788 */
6789 public static final String DOUBLE_TAP_TO_WAKE = "double_tap_to_wake";
6790
6791 /**
Xiyuan Xiae6de8b92015-06-06 22:18:05 -07006792 * The current assistant component. It could be a voice interaction service,
6793 * or an activity that handles ACTION_ASSIST, or empty which means using the default
6794 * handling.
6795 *
6796 * @hide
6797 */
6798 public static final String ASSISTANT = "assistant";
6799
6800 /**
Jason Monk5a5e7d62015-08-04 11:20:25 -04006801 * Whether the camera launch gesture should be disabled.
6802 *
6803 * @hide
6804 */
6805 public static final String CAMERA_GESTURE_DISABLED = "camera_gesture_disabled";
6806
6807 /**
Adrian Roos5941c982015-09-03 15:59:49 -07006808 * Whether the camera launch gesture to double tap the power button when the screen is off
6809 * should be disabled.
6810 *
6811 * @hide
6812 */
6813 public static final String CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED =
6814 "camera_double_tap_power_gesture_disabled";
6815
6816 /**
Doris Linga60d31d2016-07-06 13:39:05 -07006817 * Whether the camera double twist gesture to flip between front and back mode should be
6818 * enabled.
6819 *
6820 * @hide
6821 */
6822 public static final String CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED =
6823 "camera_double_twist_to_flip_enabled";
6824
6825 /**
Daniel Sheng45e0d342017-04-17 17:27:22 -07006826 * Whether or not the smart camera lift trigger that launches the camera when the user moves
6827 * the phone into a position for taking photos should be enabled.
6828 *
6829 * @hide
6830 */
6831 public static final String CAMERA_LIFT_TRIGGER_ENABLED = "camera_lift_trigger_enabled";
6832
6833 /**
Daniel Sheng834e5722017-05-30 09:28:52 -07006834 * The default enable state of the camera lift trigger.
6835 *
6836 * @hide
6837 */
6838 public static final int CAMERA_LIFT_TRIGGER_ENABLED_DEFAULT = 1;
6839
6840 /**
Philip Quinnc4cc3082017-02-13 20:18:16 -08006841 * Whether the assist gesture should be enabled.
6842 *
6843 * @hide
6844 */
6845 public static final String ASSIST_GESTURE_ENABLED = "assist_gesture_enabled";
6846
6847 /**
Philip Quinn80274ca2017-03-03 10:38:38 -08006848 * Sensitivity control for the assist gesture.
6849 *
6850 * @hide
6851 */
6852 public static final String ASSIST_GESTURE_SENSITIVITY = "assist_gesture_sensitivity";
6853
6854 /**
Kevin Chyn80939372017-06-09 15:40:18 -07006855 * Whether the assist gesture should silence alerts.
6856 *
6857 * @hide
6858 */
6859 public static final String ASSIST_GESTURE_SILENCE_ALERTS_ENABLED =
6860 "assist_gesture_silence_alerts_enabled";
6861
6862 /**
6863 * Whether the assist gesture should wake the phone.
6864 *
6865 * @hide
6866 */
6867 public static final String ASSIST_GESTURE_WAKE_ENABLED =
6868 "assist_gesture_wake_enabled";
6869
6870 /**
Kevin Chyncfd641e2017-06-05 11:28:09 -07006871 * Whether Assist Gesture Deferred Setup has been completed
6872 *
6873 * @hide
6874 */
6875 public static final String ASSIST_GESTURE_SETUP_COMPLETE = "assist_gesture_setup_complete";
6876
6877 /**
Justin Klaassen911e8892016-06-21 18:24:24 -07006878 * Control whether Night display is currently activated.
6879 * @hide
6880 */
6881 public static final String NIGHT_DISPLAY_ACTIVATED = "night_display_activated";
6882
6883 /**
6884 * Control whether Night display will automatically activate/deactivate.
6885 * @hide
6886 */
6887 public static final String NIGHT_DISPLAY_AUTO_MODE = "night_display_auto_mode";
6888
6889 /**
Christine Franks6418d0b2017-02-13 09:48:00 -08006890 * Control the color temperature of Night Display, represented in Kelvin.
6891 * @hide
6892 */
6893 public static final String NIGHT_DISPLAY_COLOR_TEMPERATURE =
6894 "night_display_color_temperature";
6895
6896 /**
Justin Klaassen911e8892016-06-21 18:24:24 -07006897 * Custom time when Night display is scheduled to activate.
6898 * Represented as milliseconds from midnight (e.g. 79200000 == 10pm).
6899 * @hide
6900 */
Christine Frankse5bb03e2017-02-10 17:36:10 -08006901 public static final String NIGHT_DISPLAY_CUSTOM_START_TIME =
6902 "night_display_custom_start_time";
Justin Klaassen911e8892016-06-21 18:24:24 -07006903
6904 /**
6905 * Custom time when Night display is scheduled to deactivate.
6906 * Represented as milliseconds from midnight (e.g. 21600000 == 6am).
6907 * @hide
6908 */
6909 public static final String NIGHT_DISPLAY_CUSTOM_END_TIME = "night_display_custom_end_time";
Jason Monk5dbd4aa2016-02-07 13:13:39 -05006910
6911 /**
Christine Frankse5bb03e2017-02-10 17:36:10 -08006912 * Time in milliseconds (since epoch) when Night display was last activated. Use to decide
6913 * whether to apply the current activated state after a reboot or user change.
6914 * @hide
6915 */
6916 public static final String NIGHT_DISPLAY_LAST_ACTIVATED_TIME =
6917 "night_display_last_activated_time";
6918
6919 /**
Ruben Brunke24b9a62016-02-16 21:38:24 -08006920 * Names of the service components that the current user has explicitly allowed to
6921 * be a VR mode listener, separated by ':'.
6922 *
6923 * @hide
6924 */
6925 public static final String ENABLED_VR_LISTENERS = "enabled_vr_listeners";
6926
6927 /**
Ruben Brunk49506e02016-04-18 18:10:47 -07006928 * Behavior of the display while in VR mode.
6929 *
6930 * One of {@link #VR_DISPLAY_MODE_LOW_PERSISTENCE} or {@link #VR_DISPLAY_MODE_OFF}.
6931 *
6932 * @hide
6933 */
6934 public static final String VR_DISPLAY_MODE = "vr_display_mode";
6935
6936 /**
6937 * Lower the display persistence while the system is in VR mode.
6938 *
6939 * @see PackageManager#FEATURE_VR_MODE_HIGH_PERFORMANCE
6940 *
6941 * @hide.
6942 */
6943 public static final int VR_DISPLAY_MODE_LOW_PERSISTENCE = 0;
6944
6945 /**
6946 * Do not alter the display persistence while the system is in VR mode.
6947 *
6948 * @see PackageManager#FEATURE_VR_MODE_HIGH_PERFORMANCE
6949 *
6950 * @hide.
6951 */
6952 public static final int VR_DISPLAY_MODE_OFF = 1;
6953
6954 /**
Jeff Davidson24b9d962016-07-21 12:35:10 -07006955 * Whether CarrierAppUtils#disableCarrierAppsUntilPrivileged has been executed at least
6956 * once.
6957 *
6958 * <p>This is used to ensure that we only take one pass which will disable apps that are not
6959 * privileged (if any). From then on, we only want to enable apps (when a matching SIM is
6960 * inserted), to avoid disabling an app that the user might actively be using.
6961 *
6962 * <p>Will be set to 1 once executed.
6963 *
6964 * @hide
6965 */
6966 public static final String CARRIER_APPS_HANDLED = "carrier_apps_handled";
6967
6968 /**
Tony Makc820cc52016-05-03 18:58:28 +01006969 * Whether parent user can access remote contact in managed profile.
6970 *
6971 * @hide
6972 */
6973 public static final String MANAGED_PROFILE_CONTACT_REMOTE_SEARCH =
6974 "managed_profile_contact_remote_search";
6975
6976 /**
Daniel Nishi395d3872016-05-23 13:25:21 -07006977 * Whether or not the automatic storage manager is enabled and should run on the device.
6978 *
6979 * @hide
6980 */
6981 public static final String AUTOMATIC_STORAGE_MANAGER_ENABLED =
6982 "automatic_storage_manager_enabled";
6983
6984 /**
Daniel Nishic535be12016-06-10 13:51:36 -07006985 * How many days of information for the automatic storage manager to retain on the device.
6986 *
6987 * @hide
6988 */
6989 public static final String AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN =
6990 "automatic_storage_manager_days_to_retain";
6991
6992 /**
6993 * Default number of days of information for the automatic storage manager to retain.
6994 *
6995 * @hide
6996 */
6997 public static final int AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN_DEFAULT = 90;
6998
6999 /**
Daniel Nishif678cc92016-06-24 15:49:25 -07007000 * How many bytes the automatic storage manager has cleared out.
7001 *
7002 * @hide
7003 */
7004 public static final String AUTOMATIC_STORAGE_MANAGER_BYTES_CLEARED =
7005 "automatic_storage_manager_bytes_cleared";
7006
7007
7008 /**
7009 * Last run time for the automatic storage manager.
7010 *
7011 * @hide
7012 */
7013 public static final String AUTOMATIC_STORAGE_MANAGER_LAST_RUN =
7014 "automatic_storage_manager_last_run";
7015
Jorge Gil6825a772016-06-30 11:07:18 -07007016 /**
Daniel Nishida7332c2017-06-12 10:17:33 -07007017 * If the automatic storage manager has been disabled by policy. Note that this doesn't
7018 * mean that the automatic storage manager is prevented from being re-enabled -- this only
7019 * means that it was turned off by policy at least once.
7020 *
7021 * @hide
7022 */
7023 public static final String AUTOMATIC_STORAGE_MANAGER_TURNED_OFF_BY_POLICY =
7024 "automatic_storage_manager_turned_off_by_policy";
7025
7026 /**
Doris Linga60d31d2016-07-06 13:39:05 -07007027 * Whether SystemUI navigation keys is enabled.
7028 * @hide
7029 */
7030 public static final String SYSTEM_NAVIGATION_KEYS_ENABLED =
7031 "system_navigation_keys_enabled";
7032
Allison Babickf0bc8662016-07-11 15:39:16 -07007033 /**
Jason Monkbaade752016-08-25 15:57:14 -04007034 * Holds comma separated list of ordering of QS tiles.
7035 * @hide
7036 */
7037 public static final String QS_TILES = "sysui_qs_tiles";
7038
7039 /**
Fyodor Kupolov539d36f2016-07-27 17:45:12 -07007040 * Whether preloaded APKs have been installed for the user.
7041 * @hide
7042 */
7043 public static final String DEMO_USER_SETUP_COMPLETE
7044 = "demo_user_setup_complete";
7045
7046 /**
Todd Kennedyefc1c4d2016-07-21 07:44:33 -07007047 * Specifies whether the web action API is enabled.
7048 *
7049 * @hide
7050 */
Jesse Evansfc1bfc42017-04-07 16:11:26 -07007051 @SystemApi
7052 public static final String INSTANT_APPS_ENABLED = "instant_apps_enabled";
Todd Kennedyefc1c4d2016-07-21 07:44:33 -07007053
7054 /**
Greg Plesur35144042016-10-10 16:23:49 -04007055 * Has this pairable device been paired or upgraded from a previously paired system.
7056 * @hide
7057 */
7058 public static final String DEVICE_PAIRED = "device_paired";
7059
7060 /**
Shahriyar Amini9343f572017-01-12 12:03:24 -08007061 * Integer state indicating whether package verifier is enabled.
7062 * TODO(b/34259924): Remove this setting.
7063 *
7064 * @hide
7065 */
7066 public static final String PACKAGE_VERIFIER_STATE = "package_verifier_state";
7067
7068 /**
Jack Yu39028572017-02-23 09:49:25 -08007069 * Specifies additional package name for broadcasting the CMAS messages.
7070 * @hide
7071 */
7072 public static final String CMAS_ADDITIONAL_BROADCAST_PKG = "cmas_additional_broadcast_pkg";
7073
7074 /**
Chris Wren89aa2262017-05-05 18:05:56 -04007075 * Whether the launcher should show any notification badges.
7076 * The value is boolean (1 or 0).
7077 * @hide
7078 */
7079 public static final String NOTIFICATION_BADGING = "notification_badging";
7080
7081 /**
Jason Monkcb5296a2017-06-30 10:28:18 -04007082 * Comma separated list of QS tiles that have been auto-added already.
7083 * @hide
7084 */
7085 public static final String QS_AUTO_ADDED_TILES = "qs_auto_tiles";
7086
7087 /**
Svetoslav Ganova571a582011-09-20 18:32:20 -07007088 * This are the settings to be backed up.
7089 *
7090 * NOTE: Settings are backed up and restored in the order they appear
7091 * in this array. If you have one setting depending on another,
7092 * make sure that they are ordered appropriately.
7093 *
-b master501eec92009-07-06 13:53:11 -07007094 * @hide
7095 */
7096 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate58f41ec2013-01-11 15:40:36 -08007097 BUGREPORT_IN_POWER_MENU, // moved to global
Amith Yamasani8823c0a82009-07-07 14:30:17 -07007098 ALLOW_MOCK_LOCATION,
-b master501eec92009-07-06 13:53:11 -07007099 PARENTAL_CONTROL_ENABLED,
7100 PARENTAL_CONTROL_REDIRECT_URL,
Christopher Tate66488d62012-10-02 11:58:01 -07007101 USB_MASS_STORAGE_ENABLED, // moved to global
Anna Galuszafa7786c2015-12-22 10:53:44 -08007102 ACCESSIBILITY_DISPLAY_INVERSION_ENABLED,
7103 ACCESSIBILITY_DISPLAY_DALTONIZER,
Anna Galuszafa7786c2015-12-22 10:53:44 -08007104 ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED,
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07007105 ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED,
Casey Burkhardt74922c62017-02-13 12:43:16 -08007106 ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED,
Svetoslav Ganovd8561a22017-04-25 15:26:03 -07007107 AUTOFILL_SERVICE,
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07007108 ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE,
-b master501eec92009-07-06 13:53:11 -07007109 ENABLED_ACCESSIBILITY_SERVICES,
Ruben Brunke24b9a62016-02-16 21:38:24 -08007110 ENABLED_VR_LISTENERS,
Christopher Tate7b9a28c2015-03-18 13:06:16 -07007111 ENABLED_INPUT_METHODS,
Svetoslav Ganov9a4c5cd2012-05-30 14:06:32 -07007112 TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES,
Svetoslav Ganova28a16d2011-07-28 11:24:21 -07007113 TOUCH_EXPLORATION_ENABLED,
Svetoslav Ganova571a582011-09-20 18:32:20 -07007114 ACCESSIBILITY_ENABLED,
Phil Weaver106fe732016-11-22 18:18:39 -08007115 ACCESSIBILITY_SHORTCUT_TARGET_SERVICE,
Casey Burkhardt5e8b9802017-03-24 10:07:20 -07007116 ACCESSIBILITY_BUTTON_TARGET_COMPONENT,
Phil Weaver106fe732016-11-22 18:18:39 -08007117 ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN,
Phil Weaverce687c52017-03-15 08:51:52 -07007118 ACCESSIBILITY_SHORTCUT_ENABLED,
7119 ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN,
Svetoslav Ganov55f937a2011-12-05 11:42:07 -08007120 ACCESSIBILITY_SPEAK_PASSWORD,
Chris Craikcce47eb2014-07-16 15:12:15 -07007121 ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED,
Anna Galuszafa7786c2015-12-22 10:53:44 -08007122 ACCESSIBILITY_CAPTIONING_PRESET,
Alan Viveretteef793802013-07-23 14:15:28 -07007123 ACCESSIBILITY_CAPTIONING_ENABLED,
7124 ACCESSIBILITY_CAPTIONING_LOCALE,
7125 ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR,
7126 ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR,
7127 ACCESSIBILITY_CAPTIONING_EDGE_TYPE,
7128 ACCESSIBILITY_CAPTIONING_EDGE_COLOR,
7129 ACCESSIBILITY_CAPTIONING_TYPEFACE,
Alan Viverette69ce69b2013-08-29 12:23:48 -07007130 ACCESSIBILITY_CAPTIONING_FONT_SCALE,
Anna Galuszafa7786c2015-12-22 10:53:44 -08007131 ACCESSIBILITY_CAPTIONING_WINDOW_COLOR,
-b master501eec92009-07-06 13:53:11 -07007132 TTS_USE_DEFAULTS,
7133 TTS_DEFAULT_RATE,
7134 TTS_DEFAULT_PITCH,
7135 TTS_DEFAULT_SYNTH,
7136 TTS_DEFAULT_LANG,
7137 TTS_DEFAULT_COUNTRY,
Charles Chenceffa152010-03-16 21:18:10 -07007138 TTS_ENABLED_PLUGINS,
Narayan Kamath6d632962011-08-24 11:51:37 +01007139 TTS_DEFAULT_LOCALE,
Anna Galuszafa7786c2015-12-22 10:53:44 -08007140 SHOW_IME_WITH_HARD_KEYBOARD,
Christopher Tate66488d62012-10-02 11:58:01 -07007141 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, // moved to global
7142 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, // moved to global
7143 WIFI_NUM_OPEN_NETWORKS_KEPT, // moved to global
Christopher Tate06cbadd2015-03-16 18:29:42 -07007144 SELECTED_SPELL_CHECKER,
7145 SELECTED_SPELL_CHECKER_SUBTYPE,
7146 SPELL_CHECKER_ENABLED,
San Mehat87734d32010-01-08 12:53:06 -08007147 MOUNT_PLAY_NOTIFICATION_SND,
7148 MOUNT_UMS_AUTOSTART,
7149 MOUNT_UMS_PROMPT,
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07007150 MOUNT_UMS_NOTIFY_ENABLED,
Jason Monk27bbb2d2015-03-31 16:46:39 -04007151 SLEEP_TIMEOUT,
7152 DOUBLE_TAP_TO_WAKE,
Anna Galuszafa7786c2015-12-22 10:53:44 -08007153 WAKE_GESTURE_ENABLED,
7154 LONG_PRESS_TIMEOUT,
Jason Monk5a5e7d62015-08-04 11:20:25 -04007155 CAMERA_GESTURE_DISABLED,
Toni Barzic386f8342015-09-09 12:30:41 -07007156 ACCESSIBILITY_AUTOCLICK_ENABLED,
Anna Galuszafa7786c2015-12-22 10:53:44 -08007157 ACCESSIBILITY_AUTOCLICK_DELAY,
7158 ACCESSIBILITY_LARGE_POINTER_ICON,
7159 PREFERRED_TTY_MODE,
7160 ENHANCED_VOICE_PRIVACY_ENABLED,
7161 TTY_MODE_ENABLED,
Mike Tsaofc47ba72016-07-15 09:54:07 -07007162 INCALL_POWER_BUTTON_BEHAVIOR,
7163 NIGHT_DISPLAY_CUSTOM_START_TIME,
7164 NIGHT_DISPLAY_CUSTOM_END_TIME,
Christine Franks6418d0b2017-02-13 09:48:00 -08007165 NIGHT_DISPLAY_COLOR_TEMPERATURE,
Mike Tsaofc47ba72016-07-15 09:54:07 -07007166 NIGHT_DISPLAY_AUTO_MODE,
Doris Ling5fafa3c2016-08-26 15:00:49 -07007167 SYNC_PARENT_SOUNDS,
Doris Ling8a332732016-08-24 15:05:43 -07007168 CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED,
7169 CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED,
Jason Monkbaade752016-08-25 15:57:14 -04007170 SYSTEM_NAVIGATION_KEYS_ENABLED,
7171 QS_TILES,
Doris Ling6403b402016-09-09 14:29:19 -07007172 DOZE_ENABLED,
7173 DOZE_PULSE_ON_PICK_UP,
Ruchi Kandoi104e0b42016-12-29 13:31:43 -08007174 DOZE_PULSE_ON_DOUBLE_TAP,
Daniel Nishieb70ad42017-01-27 10:51:35 -08007175 NFC_PAYMENT_DEFAULT_COMPONENT,
Philip Quinnc4cc3082017-02-13 20:18:16 -08007176 AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN,
Santos Cordon5bce4942017-02-27 11:50:18 -08007177 ASSIST_GESTURE_ENABLED,
Philip Quinn80274ca2017-03-03 10:38:38 -08007178 ASSIST_GESTURE_SENSITIVITY,
Kevin Chyn80939372017-06-09 15:40:18 -07007179 ASSIST_GESTURE_SETUP_COMPLETE,
7180 ASSIST_GESTURE_SILENCE_ALERTS_ENABLED,
7181 ASSIST_GESTURE_WAKE_ENABLED,
Chris Wren89aa2262017-05-05 18:05:56 -04007182 VR_DISPLAY_MODE,
Jason Monkcb5296a2017-06-30 10:28:18 -04007183 NOTIFICATION_BADGING,
7184 QS_AUTO_ADDED_TILES,
Jason Monkdf31eff2017-07-10 11:14:19 -04007185 SCREENSAVER_ENABLED,
7186 SCREENSAVER_COMPONENTS,
7187 SCREENSAVER_ACTIVATE_ON_DOCK,
7188 SCREENSAVER_ACTIVATE_ON_SLEEP,
-b master501eec92009-07-06 13:53:11 -07007189 };
7190
Christopher Tate1d0fca32017-06-06 13:30:00 -07007191 /** @hide */
7192 public static final String[] LEGACY_RESTORE_SETTINGS = {
Julia Reynoldsb852e562017-06-06 16:14:18 -04007193 ENABLED_NOTIFICATION_LISTENERS,
7194 ENABLED_NOTIFICATION_ASSISTANT,
7195 ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES
Christopher Tate1d0fca32017-06-06 13:30:00 -07007196 };
7197
-b master501eec92009-07-06 13:53:11 -07007198 /**
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07007199 * These entries are considered common between the personal and the managed profile,
7200 * since the managed profile doesn't get to change them.
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07007201 */
Svetoslav683914b2015-01-15 14:22:26 -08007202 private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>();
Amith Yamasanib0ff3222015-03-04 09:56:14 -08007203
Svetoslav683914b2015-01-15 14:22:26 -08007204 static {
7205 CLONE_TO_MANAGED_PROFILE.add(ACCESSIBILITY_ENABLED);
7206 CLONE_TO_MANAGED_PROFILE.add(ALLOW_MOCK_LOCATION);
7207 CLONE_TO_MANAGED_PROFILE.add(ALLOWED_GEOLOCATION_ORIGINS);
Felipe Lemeaa008962017-04-18 14:54:33 -07007208 CLONE_TO_MANAGED_PROFILE.add(AUTOFILL_SERVICE);
Svetoslav683914b2015-01-15 14:22:26 -08007209 CLONE_TO_MANAGED_PROFILE.add(DEFAULT_INPUT_METHOD);
7210 CLONE_TO_MANAGED_PROFILE.add(ENABLED_ACCESSIBILITY_SERVICES);
7211 CLONE_TO_MANAGED_PROFILE.add(ENABLED_INPUT_METHODS);
7212 CLONE_TO_MANAGED_PROFILE.add(LOCATION_MODE);
Lifu Tangd1fa1d62015-11-25 21:42:44 -08007213 CLONE_TO_MANAGED_PROFILE.add(LOCATION_PREVIOUS_MODE);
Svetoslav683914b2015-01-15 14:22:26 -08007214 CLONE_TO_MANAGED_PROFILE.add(LOCATION_PROVIDERS_ALLOWED);
Svetoslav683914b2015-01-15 14:22:26 -08007215 CLONE_TO_MANAGED_PROFILE.add(SELECTED_INPUT_METHOD_SUBTYPE);
7216 CLONE_TO_MANAGED_PROFILE.add(SELECTED_SPELL_CHECKER);
7217 CLONE_TO_MANAGED_PROFILE.add(SELECTED_SPELL_CHECKER_SUBTYPE);
7218 }
7219
7220 /** @hide */
7221 public static void getCloneToManagedProfileSettings(Set<String> outKeySet) {
7222 outKeySet.addAll(CLONE_TO_MANAGED_PROFILE);
7223 }
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07007224
7225 /**
Todd Kennedybe0b8892017-02-15 14:13:52 -08007226 * Secure settings which can be accessed by instant apps.
Chad Brubaker97bccee2017-01-05 15:51:41 -08007227 * @hide
7228 */
Todd Kennedybe0b8892017-02-15 14:13:52 -08007229 public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>();
Chad Brubaker97bccee2017-01-05 15:51:41 -08007230 static {
Todd Kennedybe0b8892017-02-15 14:13:52 -08007231 INSTANT_APP_SETTINGS.add(ENABLED_ACCESSIBILITY_SERVICES);
7232 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_SPEAK_PASSWORD);
7233 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_INVERSION_ENABLED);
Chad Brubaker9408d512017-03-28 16:11:38 -07007234 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_ENABLED);
7235 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_PRESET);
7236 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_EDGE_TYPE);
7237 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_EDGE_COLOR);
7238 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_LOCALE);
7239 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR);
7240 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR);
7241 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_TYPEFACE);
7242 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_FONT_SCALE);
Chad Brubakerd9285b52017-04-27 15:28:57 -07007243 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_WINDOW_COLOR);
7244 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED);
7245 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_DALTONIZER);
7246 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_AUTOCLICK_DELAY);
7247 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_AUTOCLICK_ENABLED);
7248 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_LARGE_POINTER_ICON);
Chad Brubaker97bccee2017-01-05 15:51:41 -08007249
Todd Kennedybe0b8892017-02-15 14:13:52 -08007250 INSTANT_APP_SETTINGS.add(DEFAULT_INPUT_METHOD);
7251 INSTANT_APP_SETTINGS.add(ENABLED_INPUT_METHODS);
Chad Brubaker1bed9372017-03-20 10:52:52 -07007252
7253 INSTANT_APP_SETTINGS.add(ANDROID_ID);
Chad Brubaker8d7b36f2017-04-06 22:57:18 -07007254
7255 INSTANT_APP_SETTINGS.add(PACKAGE_VERIFIER_USER_CONSENT);
Chad Brubaker562afaf2017-04-10 13:32:37 -07007256 INSTANT_APP_SETTINGS.add(ALLOW_MOCK_LOCATION);
Chad Brubaker97bccee2017-01-05 15:51:41 -08007257 }
7258
7259 /**
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07007260 * Helper method for determining if a location provider is enabled.
Tom O'Neilld5759432013-09-11 11:03:03 -07007261 *
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07007262 * @param cr the content resolver to use
7263 * @param provider the location provider to query
7264 * @return true if the provider is enabled
Tom O'Neilld5759432013-09-11 11:03:03 -07007265 *
7266 * @deprecated use {@link #LOCATION_MODE} or
7267 * {@link LocationManager#isProviderEnabled(String)}
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07007268 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07007269 @Deprecated
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07007270 public static final boolean isLocationProviderEnabled(ContentResolver cr, String provider) {
Victoria Leaseb711d572012-10-02 13:14:11 -07007271 return isLocationProviderEnabledForUser(cr, provider, UserHandle.myUserId());
7272 }
7273
7274 /**
7275 * Helper method for determining if a location provider is enabled.
7276 * @param cr the content resolver to use
7277 * @param provider the location provider to query
7278 * @param userId the userId to query
7279 * @return true if the provider is enabled
Tom O'Neilld5759432013-09-11 11:03:03 -07007280 * @deprecated use {@link #LOCATION_MODE} or
7281 * {@link LocationManager#isProviderEnabled(String)}
Victoria Leaseb711d572012-10-02 13:14:11 -07007282 * @hide
7283 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07007284 @Deprecated
Victoria Leaseb711d572012-10-02 13:14:11 -07007285 public static final boolean isLocationProviderEnabledForUser(ContentResolver cr, String provider, int userId) {
7286 String allowedProviders = Settings.Secure.getStringForUser(cr,
7287 LOCATION_PROVIDERS_ALLOWED, userId);
Brad Fitzpatrick11fe1812010-09-10 16:07:52 -07007288 return TextUtils.delimitedStringContains(allowedProviders, ',', provider);
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07007289 }
7290
7291 /**
7292 * Thread-safe method for enabling or disabling a single location provider.
7293 * @param cr the content resolver to use
7294 * @param provider the location provider to enable or disable
7295 * @param enabled true if the provider should be enabled
Tom O'Neilla324ac72013-08-26 14:40:23 -07007296 * @deprecated use {@link #putInt(ContentResolver, String, int)} and {@link #LOCATION_MODE}
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07007297 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07007298 @Deprecated
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07007299 public static final void setLocationProviderEnabled(ContentResolver cr,
7300 String provider, boolean enabled) {
Victoria Leaseb711d572012-10-02 13:14:11 -07007301 setLocationProviderEnabledForUser(cr, provider, enabled, UserHandle.myUserId());
7302 }
7303
7304 /**
7305 * Thread-safe method for enabling or disabling a single location provider.
Tom O'Neilla324ac72013-08-26 14:40:23 -07007306 *
Victoria Leaseb711d572012-10-02 13:14:11 -07007307 * @param cr the content resolver to use
7308 * @param provider the location provider to enable or disable
7309 * @param enabled true if the provider should be enabled
7310 * @param userId the userId for which to enable/disable providers
Tom O'Neilla324ac72013-08-26 14:40:23 -07007311 * @return true if the value was set, false on database errors
7312 * @deprecated use {@link #putIntForUser(ContentResolver, String, int, int)} and
7313 * {@link #LOCATION_MODE}
Victoria Leaseb711d572012-10-02 13:14:11 -07007314 * @hide
7315 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07007316 @Deprecated
Tom O'Neilla324ac72013-08-26 14:40:23 -07007317 public static final boolean setLocationProviderEnabledForUser(ContentResolver cr,
Victoria Leaseb711d572012-10-02 13:14:11 -07007318 String provider, boolean enabled, int userId) {
David Christie3f7b6522013-08-06 19:19:08 -07007319 synchronized (mLocationSettingsLock) {
7320 // to ensure thread safety, we write the provider name with a '+' or '-'
7321 // and let the SettingsProvider handle it rather than reading and modifying
7322 // the list of enabled providers.
7323 if (enabled) {
7324 provider = "+" + provider;
7325 } else {
7326 provider = "-" + provider;
7327 }
Tom O'Neilla324ac72013-08-26 14:40:23 -07007328 return putStringForUser(cr, Settings.Secure.LOCATION_PROVIDERS_ALLOWED, provider,
David Christie3f7b6522013-08-06 19:19:08 -07007329 userId);
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07007330 }
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07007331 }
Tom O'Neill1f48b782013-08-19 18:14:56 -07007332
7333 /**
Lifu Tangd1fa1d62015-11-25 21:42:44 -08007334 * Saves the current location mode into {@link #LOCATION_PREVIOUS_MODE}.
7335 */
7336 private static final boolean saveLocationModeForUser(ContentResolver cr, int userId) {
7337 final int mode = getLocationModeForUser(cr, userId);
7338 return putIntForUser(cr, Settings.Secure.LOCATION_PREVIOUS_MODE, mode, userId);
7339 }
7340
7341 /**
7342 * Restores the current location mode from {@link #LOCATION_PREVIOUS_MODE}.
7343 */
7344 private static final boolean restoreLocationModeForUser(ContentResolver cr, int userId) {
7345 int mode = getIntForUser(cr, Settings.Secure.LOCATION_PREVIOUS_MODE,
7346 LOCATION_MODE_HIGH_ACCURACY, userId);
7347 // Make sure that the previous mode is never "off". Otherwise the user won't be able to
7348 // turn on location any longer.
7349 if (mode == LOCATION_MODE_OFF) {
7350 mode = LOCATION_MODE_HIGH_ACCURACY;
7351 }
7352 return setLocationModeForUser(cr, mode, userId);
7353 }
7354
7355 /**
Tom O'Neill1f48b782013-08-19 18:14:56 -07007356 * Thread-safe method for setting the location mode to one of
7357 * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY},
7358 * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}.
Tom O'Neill87c7fad2016-08-04 08:16:12 -07007359 * Necessary because the mode is a composite of the underlying location provider
7360 * settings.
Tom O'Neill1f48b782013-08-19 18:14:56 -07007361 *
Tom O'Neill1f48b782013-08-19 18:14:56 -07007362 * @param cr the content resolver to use
7363 * @param mode such as {@link #LOCATION_MODE_HIGH_ACCURACY}
7364 * @param userId the userId for which to change mode
Tom O'Neilla324ac72013-08-26 14:40:23 -07007365 * @return true if the value was set, false on database errors
Tom O'Neill1f48b782013-08-19 18:14:56 -07007366 *
7367 * @throws IllegalArgumentException if mode is not one of the supported values
7368 */
Tom O'Neill7f6f4572013-08-27 10:53:15 -07007369 private static final boolean setLocationModeForUser(ContentResolver cr, int mode,
7370 int userId) {
Tom O'Neill1f48b782013-08-19 18:14:56 -07007371 synchronized (mLocationSettingsLock) {
7372 boolean gps = false;
7373 boolean network = false;
7374 switch (mode) {
Lifu Tangd1fa1d62015-11-25 21:42:44 -08007375 case LOCATION_MODE_PREVIOUS:
7376 // Retrieve the actual mode and set to that mode.
7377 return restoreLocationModeForUser(cr, userId);
Tom O'Neill1f48b782013-08-19 18:14:56 -07007378 case LOCATION_MODE_OFF:
Lifu Tangd1fa1d62015-11-25 21:42:44 -08007379 saveLocationModeForUser(cr, userId);
Tom O'Neill1f48b782013-08-19 18:14:56 -07007380 break;
7381 case LOCATION_MODE_SENSORS_ONLY:
7382 gps = true;
7383 break;
7384 case LOCATION_MODE_BATTERY_SAVING:
7385 network = true;
7386 break;
7387 case LOCATION_MODE_HIGH_ACCURACY:
7388 gps = true;
7389 network = true;
7390 break;
7391 default:
7392 throw new IllegalArgumentException("Invalid location mode: " + mode);
7393 }
Tom O'Neill7731a992014-10-09 11:30:49 -07007394 // Note it's important that we set the NLP mode first. The Google implementation
7395 // of NLP clears its NLP consent setting any time it receives a
7396 // LocationManager.PROVIDERS_CHANGED_ACTION broadcast and NLP is disabled. Also,
7397 // it shows an NLP consent dialog any time it receives the broadcast, NLP is
7398 // enabled, and the NLP consent is not set. If 1) we were to enable GPS first,
7399 // 2) a setup wizard has its own NLP consent UI that sets the NLP consent setting,
7400 // and 3) the receiver happened to complete before we enabled NLP, then the Google
7401 // NLP would detect the attempt to enable NLP and show a redundant NLP consent
7402 // dialog. Then the people who wrote the setup wizard would be sad.
Tom O'Neilla324ac72013-08-26 14:40:23 -07007403 boolean nlpSuccess = Settings.Secure.setLocationProviderEnabledForUser(
Tom O'Neill1f48b782013-08-19 18:14:56 -07007404 cr, LocationManager.NETWORK_PROVIDER, network, userId);
Tom O'Neill7731a992014-10-09 11:30:49 -07007405 boolean gpsSuccess = Settings.Secure.setLocationProviderEnabledForUser(
7406 cr, LocationManager.GPS_PROVIDER, gps, userId);
Tom O'Neilla324ac72013-08-26 14:40:23 -07007407 return gpsSuccess && nlpSuccess;
Tom O'Neill1f48b782013-08-19 18:14:56 -07007408 }
7409 }
7410
7411 /**
Tom O'Neill1f48b782013-08-19 18:14:56 -07007412 * Thread-safe method for reading the location mode, returns one of
7413 * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY},
Tom O'Neill87c7fad2016-08-04 08:16:12 -07007414 * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}. Necessary
7415 * because the mode is a composite of the underlying location provider settings.
Tom O'Neill1f48b782013-08-19 18:14:56 -07007416 *
7417 * @param cr the content resolver to use
7418 * @param userId the userId for which to read the mode
7419 * @return the location mode
7420 */
Tom O'Neill7f6f4572013-08-27 10:53:15 -07007421 private static final int getLocationModeForUser(ContentResolver cr, int userId) {
Tom O'Neill1f48b782013-08-19 18:14:56 -07007422 synchronized (mLocationSettingsLock) {
7423 boolean gpsEnabled = Settings.Secure.isLocationProviderEnabledForUser(
7424 cr, LocationManager.GPS_PROVIDER, userId);
7425 boolean networkEnabled = Settings.Secure.isLocationProviderEnabledForUser(
7426 cr, LocationManager.NETWORK_PROVIDER, userId);
7427 if (gpsEnabled && networkEnabled) {
7428 return LOCATION_MODE_HIGH_ACCURACY;
7429 } else if (gpsEnabled) {
7430 return LOCATION_MODE_SENSORS_ONLY;
7431 } else if (networkEnabled) {
7432 return LOCATION_MODE_BATTERY_SAVING;
7433 } else {
7434 return LOCATION_MODE_OFF;
7435 }
7436 }
7437 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007438 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07007439
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007440 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007441 * Global system settings, containing preferences that always apply identically
7442 * to all defined users. Applications can read these but are not allowed to write;
7443 * like the "Secure" settings, these are for preferences that the user must
7444 * explicitly modify through the system UI or specialized APIs for those values.
7445 */
7446 public static final class Global extends NameValueTable {
Christopher Tate06efb532012-08-24 15:29:27 -07007447 /**
7448 * The content:// style URL for global secure settings items. Not public.
7449 */
7450 public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/global");
7451
7452 /**
Amith Yamasani23a0f052014-07-25 12:26:53 -07007453 * Whether users are allowed to add more users or guest from lockscreen.
7454 * <p>
7455 * Type: int
7456 * @hide
7457 */
7458 public static final String ADD_USERS_WHEN_LOCKED = "add_users_when_locked";
7459
7460 /**
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07007461 * Setting whether the global gesture for enabling accessibility is enabled.
7462 * If this gesture is enabled the user will be able to perfrom it to enable
7463 * the accessibility state without visiting the settings app.
Phil Weaver106fe732016-11-22 18:18:39 -08007464 *
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07007465 * @hide
Phil Weaver106fe732016-11-22 18:18:39 -08007466 * No longer used. Should be removed once all dependencies have been updated.
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07007467 */
7468 public static final String ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED =
7469 "enable_accessibility_global_gesture_enabled";
7470
7471 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007472 * Whether Airplane Mode is on.
7473 */
7474 public static final String AIRPLANE_MODE_ON = "airplane_mode_on";
7475
7476 /**
Bryce Lee584a4452014-10-21 15:55:55 -07007477 * Whether Theater Mode is on.
7478 * {@hide}
7479 */
Bryce Leecdfebd62015-02-02 08:19:11 -08007480 @SystemApi
Bryce Lee584a4452014-10-21 15:55:55 -07007481 public static final String THEATER_MODE_ON = "theater_mode_on";
7482
7483 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007484 * Constant for use in AIRPLANE_MODE_RADIOS to specify Bluetooth radio.
7485 */
7486 public static final String RADIO_BLUETOOTH = "bluetooth";
7487
7488 /**
7489 * Constant for use in AIRPLANE_MODE_RADIOS to specify Wi-Fi radio.
7490 */
7491 public static final String RADIO_WIFI = "wifi";
7492
7493 /**
7494 * {@hide}
7495 */
7496 public static final String RADIO_WIMAX = "wimax";
7497 /**
7498 * Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio.
7499 */
7500 public static final String RADIO_CELL = "cell";
7501
7502 /**
7503 * Constant for use in AIRPLANE_MODE_RADIOS to specify NFC radio.
7504 */
7505 public static final String RADIO_NFC = "nfc";
7506
7507 /**
7508 * A comma separated list of radios that need to be disabled when airplane mode
7509 * is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are
7510 * included in the comma separated list.
7511 */
7512 public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios";
7513
7514 /**
7515 * A comma separated list of radios that should to be disabled when airplane mode
7516 * is on, but can be manually reenabled by the user. For example, if RADIO_WIFI is
7517 * added to both AIRPLANE_MODE_RADIOS and AIRPLANE_MODE_TOGGLEABLE_RADIOS, then Wifi
7518 * will be turned off when entering airplane mode, but the user will be able to reenable
7519 * Wifi in the Settings app.
7520 *
7521 * {@hide}
7522 */
7523 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios";
7524
7525 /**
Bryce Leeec85f342015-12-16 13:32:28 -08007526 * A Long representing a bitmap of profiles that should be disabled when bluetooth starts.
7527 * See {@link android.bluetooth.BluetoothProfile}.
7528 * {@hide}
7529 */
7530 public static final String BLUETOOTH_DISABLED_PROFILES = "bluetooth_disabled_profiles";
7531
7532 /**
Andre Eisenbach82a94d92016-01-14 14:20:34 -08007533 * A semi-colon separated list of Bluetooth interoperability workarounds.
7534 * Each entry is a partial Bluetooth device address string and an integer representing
7535 * the feature to be disabled, separated by a comma. The integer must correspond
7536 * to a interoperability feature as defined in "interop.h" in /system/bt.
7537 * <p>
7538 * Example: <br/>
7539 * "00:11:22,0;01:02:03:04,2"
7540 * @hide
7541 */
7542 public static final String BLUETOOTH_INTEROPERABILITY_LIST = "bluetooth_interoperability_list";
7543
7544 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007545 * The policy for deciding when Wi-Fi should go to sleep (which will in
7546 * turn switch to using the mobile data as an Internet connection).
7547 * <p>
7548 * Set to one of {@link #WIFI_SLEEP_POLICY_DEFAULT},
7549 * {@link #WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED}, or
7550 * {@link #WIFI_SLEEP_POLICY_NEVER}.
7551 */
7552 public static final String WIFI_SLEEP_POLICY = "wifi_sleep_policy";
7553
7554 /**
7555 * Value for {@link #WIFI_SLEEP_POLICY} to use the default Wi-Fi sleep
7556 * policy, which is to sleep shortly after the turning off
7557 * according to the {@link #STAY_ON_WHILE_PLUGGED_IN} setting.
7558 */
7559 public static final int WIFI_SLEEP_POLICY_DEFAULT = 0;
7560
7561 /**
7562 * Value for {@link #WIFI_SLEEP_POLICY} to use the default policy when
7563 * the device is on battery, and never go to sleep when the device is
7564 * plugged in.
7565 */
7566 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1;
7567
7568 /**
7569 * Value for {@link #WIFI_SLEEP_POLICY} to never go to sleep.
7570 */
7571 public static final int WIFI_SLEEP_POLICY_NEVER = 2;
7572
7573 /**
7574 * Value to specify if the user prefers the date, time and time zone
7575 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
7576 */
7577 public static final String AUTO_TIME = "auto_time";
7578
7579 /**
7580 * Value to specify if the user prefers the time zone
7581 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
7582 */
7583 public static final String AUTO_TIME_ZONE = "auto_time_zone";
7584
7585 /**
7586 * URI for the car dock "in" event sound.
7587 * @hide
7588 */
7589 public static final String CAR_DOCK_SOUND = "car_dock_sound";
7590
7591 /**
7592 * URI for the car dock "out" event sound.
7593 * @hide
7594 */
7595 public static final String CAR_UNDOCK_SOUND = "car_undock_sound";
7596
7597 /**
7598 * URI for the desk dock "in" event sound.
7599 * @hide
7600 */
7601 public static final String DESK_DOCK_SOUND = "desk_dock_sound";
7602
7603 /**
7604 * URI for the desk dock "out" event sound.
7605 * @hide
7606 */
7607 public static final String DESK_UNDOCK_SOUND = "desk_undock_sound";
7608
7609 /**
7610 * Whether to play a sound for dock events.
7611 * @hide
7612 */
7613 public static final String DOCK_SOUNDS_ENABLED = "dock_sounds_enabled";
7614
7615 /**
Vinod Krishnancf11cea2016-10-20 22:57:02 -07007616 * Whether to play a sound for dock events, only when an accessibility service is on.
7617 * @hide
7618 */
7619 public static final String DOCK_SOUNDS_ENABLED_WHEN_ACCESSIBILITY = "dock_sounds_enabled_when_accessbility";
7620
7621 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007622 * URI for the "device locked" (keyguard shown) sound.
7623 * @hide
7624 */
7625 public static final String LOCK_SOUND = "lock_sound";
7626
7627 /**
7628 * URI for the "device unlocked" sound.
7629 * @hide
7630 */
7631 public static final String UNLOCK_SOUND = "unlock_sound";
7632
7633 /**
Adrian Roos49e057d2014-08-13 17:14:51 +02007634 * URI for the "device is trusted" sound, which is played when the device enters the trusted
7635 * state without unlocking.
7636 * @hide
7637 */
7638 public static final String TRUSTED_SOUND = "trusted_sound";
7639
7640 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007641 * URI for the low battery sound file.
7642 * @hide
7643 */
7644 public static final String LOW_BATTERY_SOUND = "low_battery_sound";
7645
7646 /**
7647 * Whether to play a sound for low-battery alerts.
7648 * @hide
7649 */
7650 public static final String POWER_SOUNDS_ENABLED = "power_sounds_enabled";
7651
7652 /**
Jeff Brown84e27562012-12-07 13:56:34 -08007653 * URI for the "wireless charging started" sound.
7654 * @hide
7655 */
7656 public static final String WIRELESS_CHARGING_STARTED_SOUND =
7657 "wireless_charging_started_sound";
7658
7659 /**
John Spurlock51a871d2015-05-06 17:41:30 -04007660 * Whether to play a sound for charging events.
7661 * @hide
7662 */
7663 public static final String CHARGING_SOUNDS_ENABLED = "charging_sounds_enabled";
7664
7665 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007666 * Whether we keep the device on while the device is plugged in.
7667 * Supported values are:
7668 * <ul>
7669 * <li>{@code 0} to never stay on while plugged in</li>
7670 * <li>{@link BatteryManager#BATTERY_PLUGGED_AC} to stay on for AC charger</li>
7671 * <li>{@link BatteryManager#BATTERY_PLUGGED_USB} to stay on for USB charger</li>
7672 * <li>{@link BatteryManager#BATTERY_PLUGGED_WIRELESS} to stay on for wireless charger</li>
7673 * </ul>
7674 * These values can be OR-ed together.
7675 */
7676 public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in";
7677
7678 /**
Christopher Tate58f41ec2013-01-11 15:40:36 -08007679 * When the user has enable the option to have a "bug report" command
7680 * in the power menu.
7681 * @hide
7682 */
7683 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
7684
7685 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007686 * Whether ADB is enabled.
7687 */
7688 public static final String ADB_ENABLED = "adb_enabled";
7689
7690 /**
Jon Miranda836c0a82014-08-11 12:32:26 -07007691 * Whether Views are allowed to save their attribute data.
7692 * @hide
7693 */
7694 public static final String DEBUG_VIEW_ATTRIBUTES = "debug_view_attributes";
7695
7696 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007697 * Whether assisted GPS should be enabled or not.
7698 * @hide
7699 */
7700 public static final String ASSISTED_GPS_ENABLED = "assisted_gps_enabled";
7701
7702 /**
7703 * Whether bluetooth is enabled/disabled
7704 * 0=disabled. 1=enabled.
7705 */
7706 public static final String BLUETOOTH_ON = "bluetooth_on";
7707
7708 /**
7709 * CDMA Cell Broadcast SMS
7710 * 0 = CDMA Cell Broadcast SMS disabled
7711 * 1 = CDMA Cell Broadcast SMS enabled
7712 * @hide
7713 */
7714 public static final String CDMA_CELL_BROADCAST_SMS =
7715 "cdma_cell_broadcast_sms";
7716
7717 /**
7718 * The CDMA roaming mode 0 = Home Networks, CDMA default
7719 * 1 = Roaming on Affiliated networks
7720 * 2 = Roaming on any networks
7721 * @hide
7722 */
7723 public static final String CDMA_ROAMING_MODE = "roaming_settings";
7724
7725 /**
7726 * The CDMA subscription mode 0 = RUIM/SIM (default)
7727 * 1 = NV
7728 * @hide
7729 */
7730 public static final String CDMA_SUBSCRIPTION_MODE = "subscription_mode";
7731
Narayan Kamath94bcdbc2017-07-17 15:32:53 +01007732 /**
7733 * The default value for whether background data is enabled or not.
7734 *
7735 * Used by {@code NetworkPolicyManagerService}.
7736 *
7737 * @hide
7738 */
7739 public static final String DEFAULT_RESTRICT_BACKGROUND_DATA =
7740 "default_restrict_background_data";
7741
Christopher Tate06efb532012-08-24 15:29:27 -07007742 /** Inactivity timeout to track mobile data activity.
7743 *
7744 * If set to a positive integer, it indicates the inactivity timeout value in seconds to
7745 * infer the data activity of mobile network. After a period of no activity on mobile
7746 * networks with length specified by the timeout, an {@code ACTION_DATA_ACTIVITY_CHANGE}
7747 * intent is fired to indicate a transition of network status from "active" to "idle". Any
7748 * subsequent activity on mobile networks triggers the firing of {@code
7749 * ACTION_DATA_ACTIVITY_CHANGE} intent indicating transition from "idle" to "active".
7750 *
7751 * Network activity refers to transmitting or receiving data on the network interfaces.
7752 *
7753 * Tracking is disabled if set to zero or negative value.
7754 *
7755 * @hide
7756 */
7757 public static final String DATA_ACTIVITY_TIMEOUT_MOBILE = "data_activity_timeout_mobile";
7758
7759 /** Timeout to tracking Wifi data activity. Same as {@code DATA_ACTIVITY_TIMEOUT_MOBILE}
7760 * but for Wifi network.
7761 * @hide
7762 */
7763 public static final String DATA_ACTIVITY_TIMEOUT_WIFI = "data_activity_timeout_wifi";
7764
7765 /**
7766 * Whether or not data roaming is enabled. (0 = false, 1 = true)
7767 */
7768 public static final String DATA_ROAMING = "data_roaming";
7769
7770 /**
Wink Saville75c1e692013-03-20 17:06:50 -07007771 * The value passed to a Mobile DataConnection via bringUp which defines the
7772 * number of retries to preform when setting up the initial connection. The default
7773 * value defined in DataConnectionTrackerBase#DEFAULT_MDC_INITIAL_RETRY is currently 1.
7774 * @hide
7775 */
7776 public static final String MDC_INITIAL_MAX_RETRY = "mdc_initial_max_retry";
7777
7778 /**
Todd Kennedyf39ca8f2015-08-07 14:15:07 -07007779 * Whether any package can be on external storage. When this is true, any
7780 * package, regardless of manifest values, is a candidate for installing
7781 * or moving onto external storage. (0 = false, 1 = true)
7782 * @hide
7783 */
7784 public static final String FORCE_ALLOW_ON_EXTERNAL = "force_allow_on_external";
7785
Jorim Jaggi8ccdf3a2015-10-22 12:50:31 +02007786 /**
Jeff Davidson91c3d072017-04-12 12:17:11 -07007787 * The default SM-DP+ configured for this device.
7788 *
7789 * <p>An SM-DP+ is used by an LPA (see {@link android.service.euicc.EuiccService}) to
7790 * download profiles. If this value is set, the LPA will query this server for any profiles
7791 * available to this device. If any are available, they may be downloaded during device
7792 * provisioning or in settings without needing the user to enter an activation code.
7793 *
7794 * @see android.service.euicc.EuiccService
7795 * @hide
7796 *
7797 * TODO(b/35851809): Make this a SystemApi.
7798 */
7799 public static final String DEFAULT_SM_DP_PLUS = "default_sm_dp_plus";
7800
7801 /**
Jeff Davidsondff39332017-05-19 17:07:48 -07007802 * Whether any profile has ever been downloaded onto a eUICC on the device.
7803 *
7804 * <p>Used to hide eUICC UI from users who have never made use of it and would only be
7805 * confused by seeing references to it in settings.
7806 * (0 = false, 1 = true)
7807 * @hide
7808 */
7809 public static final String EUICC_PROVISIONED = "euicc_provisioned";
7810
7811 /**
Jorim Jaggi8ccdf3a2015-10-22 12:50:31 +02007812 * Whether any activity can be resized. When this is true, any
7813 * activity, regardless of manifest values, can be resized for multi-window.
7814 * (0 = false, 1 = true)
7815 * @hide
7816 */
7817 public static final String DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES
7818 = "force_resizable_activities";
7819
Jorim Jaggi6f2efd32015-12-23 12:04:39 +01007820 /**
7821 * Whether to enable experimental freeform support for windows.
7822 * @hide
7823 */
7824 public static final String DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT
7825 = "enable_freeform_support";
7826
Todd Kennedyf39ca8f2015-08-07 14:15:07 -07007827 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007828 * Whether user has enabled development settings.
7829 */
7830 public static final String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled";
7831
7832 /**
Amith Yamasanicb15d662015-11-10 11:11:15 -08007833 * Whether the device has been provisioned (0 = false, 1 = true).
7834 * <p>On a multiuser device with a separate system user, the screen may be locked
7835 * as soon as this is set to true and further activities cannot be launched on the
7836 * system user unless they are marked to show over keyguard.
Christopher Tate06efb532012-08-24 15:29:27 -07007837 */
7838 public static final String DEVICE_PROVISIONED = "device_provisioned";
7839
7840 /**
Robert Greenwaltbeb482c2016-03-28 15:40:56 -07007841 * Whether mobile data should be allowed while the device is being provisioned.
7842 * This allows the provisioning process to turn off mobile data before the user
7843 * has an opportunity to set things up, preventing other processes from burning
7844 * precious bytes before wifi is setup.
7845 * (0 = false, 1 = true)
7846 * @hide
7847 */
7848 public static final String DEVICE_PROVISIONING_MOBILE_DATA_ENABLED =
7849 "device_provisioning_mobile_data";
7850
7851 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007852 * The saved value for WindowManagerService.setForcedDisplaySize().
7853 * Two integers separated by a comma. If unset, then use the real display size.
7854 * @hide
7855 */
7856 public static final String DISPLAY_SIZE_FORCED = "display_size_forced";
7857
7858 /**
Jeff Brownd46747a2015-04-15 19:02:36 -07007859 * The saved value for WindowManagerService.setForcedDisplayScalingMode().
7860 * 0 or unset if scaling is automatic, 1 if scaling is disabled.
7861 * @hide
7862 */
7863 public static final String DISPLAY_SCALING_FORCE = "display_scaling_force";
7864
7865 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007866 * The maximum size, in bytes, of a download that the download manager will transfer over
7867 * a non-wifi connection.
7868 * @hide
7869 */
7870 public static final String DOWNLOAD_MAX_BYTES_OVER_MOBILE =
7871 "download_manager_max_bytes_over_mobile";
7872
7873 /**
7874 * The recommended maximum size, in bytes, of a download that the download manager should
7875 * transfer over a non-wifi connection. Over this size, the use will be warned, but will
7876 * have the option to start the download over the mobile connection anyway.
7877 * @hide
7878 */
7879 public static final String DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE =
7880 "download_manager_recommended_max_bytes_over_mobile";
7881
7882 /**
Christopher Tateaa036a22014-05-19 16:33:27 -07007883 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
Christopher Tate06efb532012-08-24 15:29:27 -07007884 */
Christopher Tateaa036a22014-05-19 16:33:27 -07007885 @Deprecated
7886 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
Christopher Tate06efb532012-08-24 15:29:27 -07007887
7888 /**
Jinsuk Kimb3d91772014-07-10 12:48:54 +09007889 * Whether HDMI control shall be enabled. If disabled, no CEC/MHL command will be
7890 * sent or processed. (0 = false, 1 = true)
7891 * @hide
7892 */
7893 public static final String HDMI_CONTROL_ENABLED = "hdmi_control_enabled";
7894
7895 /**
Donghyun Choc1fa9af2016-12-27 18:31:09 +09007896 * Whether HDMI System Audio Control feature is enabled. If enabled, TV will try to turn on
7897 * system audio mode if there's a connected CEC-enabled AV Receiver. Then audio stream will
7898 * be played on AVR instead of TV spaeker. If disabled, the system audio mode will never be
7899 * activated.
Jinsuk Kimb3d91772014-07-10 12:48:54 +09007900 * @hide
7901 */
Donghyun Choc1fa9af2016-12-27 18:31:09 +09007902 public static final String HDMI_SYSTEM_AUDIO_CONTROL_ENABLED =
7903 "hdmi_system_audio_control_enabled";
Jinsuk Kimb3d91772014-07-10 12:48:54 +09007904
7905 /**
Jinsuk Kimb3d91772014-07-10 12:48:54 +09007906 * Whether TV will automatically turn on upon reception of the CEC command
7907 * &lt;Text View On&gt; or &lt;Image View On&gt;. (0 = false, 1 = true)
7908 * @hide
7909 */
7910 public static final String HDMI_CONTROL_AUTO_WAKEUP_ENABLED =
7911 "hdmi_control_auto_wakeup_enabled";
7912
7913 /**
7914 * Whether TV will also turn off other CEC devices when it goes to standby mode.
7915 * (0 = false, 1 = true)
7916 * @hide
7917 */
7918 public static final String HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED =
7919 "hdmi_control_auto_device_off_enabled";
7920
7921 /**
Soonil Nagarkar7decfb62017-01-18 12:18:49 -08007922 * The interval in milliseconds at which location requests will be throttled when they are
7923 * coming from the background.
7924 * @hide
7925 */
7926 public static final String LOCATION_BACKGROUND_THROTTLE_INTERVAL_MS =
7927 "location_background_throttle_interval_ms";
7928
Soonil Nagarkar2f1f7e82017-01-24 12:52:10 -08007929 /**
Lifu Tangc94ef4d2017-03-23 23:48:00 -07007930 * Most frequent location update interval in milliseconds that proximity alert is allowed
7931 * to request.
7932 * @hide
7933 */
7934 public static final String LOCATION_BACKGROUND_THROTTLE_PROXIMITY_ALERT_INTERVAL_MS =
7935 "location_background_throttle_proximity_alert_interval_ms";
7936
7937 /**
Soonil Nagarkar2f1f7e82017-01-24 12:52:10 -08007938 * Packages that are whitelisted for background throttling (throttling will not be applied).
7939 * @hide
7940 */
7941 public static final String LOCATION_BACKGROUND_THROTTLE_PACKAGE_WHITELIST =
7942 "location_background_throttle_package_whitelist";
7943
Wei Wangcdbffa92017-04-17 19:49:29 -07007944 /**
7945 * The interval in milliseconds at which wifi scan requests will be throttled when they are
7946 * coming from the background.
7947 * @hide
7948 */
7949 public static final String WIFI_SCAN_BACKGROUND_THROTTLE_INTERVAL_MS =
7950 "wifi_scan_background_throttle_interval_ms";
7951
7952 /**
7953 * Packages that are whitelisted to be exempt for wifi background throttling.
7954 * @hide
7955 */
7956 public static final String WIFI_SCAN_BACKGROUND_THROTTLE_PACKAGE_WHITELIST =
7957 "wifi_scan_background_throttle_package_whitelist";
7958
7959 /**
Jinsuk Kimb3d91772014-07-10 12:48:54 +09007960 * Whether TV will switch to MHL port when a mobile device is plugged in.
7961 * (0 = false, 1 = true)
7962 * @hide
7963 */
7964 public static final String MHL_INPUT_SWITCHING_ENABLED = "mhl_input_switching_enabled";
7965
7966 /**
7967 * Whether TV will charge the mobile device connected at MHL port. (0 = false, 1 = true)
7968 * @hide
7969 */
7970 public static final String MHL_POWER_CHARGE_ENABLED = "mhl_power_charge_enabled";
7971
7972 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007973 * Whether mobile data connections are allowed by the user. See
7974 * ConnectivityManager for more info.
7975 * @hide
7976 */
7977 public static final String MOBILE_DATA = "mobile_data";
7978
Erik Klineda4bfa82015-04-30 12:58:40 +09007979 /**
7980 * Whether the mobile data connection should remain active even when higher
7981 * priority networks like WiFi are active, to help make network switching faster.
7982 *
7983 * See ConnectivityService for more info.
7984 *
7985 * (0 = disabled, 1 = enabled)
7986 * @hide
7987 */
7988 public static final String MOBILE_DATA_ALWAYS_ON = "mobile_data_always_on";
7989
Hugo Benichi05686db2016-10-19 11:17:28 +09007990 /**
7991 * Size of the event buffer for IP connectivity metrics.
7992 * @hide
7993 */
7994 public static final String CONNECTIVITY_METRICS_BUFFER_SIZE =
7995 "connectivity_metrics_buffer_size";
7996
Christopher Tate06efb532012-08-24 15:29:27 -07007997 /** {@hide} */
7998 public static final String NETSTATS_ENABLED = "netstats_enabled";
7999 /** {@hide} */
8000 public static final String NETSTATS_POLL_INTERVAL = "netstats_poll_interval";
8001 /** {@hide} */
8002 public static final String NETSTATS_TIME_CACHE_MAX_AGE = "netstats_time_cache_max_age";
8003 /** {@hide} */
8004 public static final String NETSTATS_GLOBAL_ALERT_BYTES = "netstats_global_alert_bytes";
8005 /** {@hide} */
8006 public static final String NETSTATS_SAMPLE_ENABLED = "netstats_sample_enabled";
Christopher Tate06efb532012-08-24 15:29:27 -07008007
8008 /** {@hide} */
8009 public static final String NETSTATS_DEV_BUCKET_DURATION = "netstats_dev_bucket_duration";
8010 /** {@hide} */
8011 public static final String NETSTATS_DEV_PERSIST_BYTES = "netstats_dev_persist_bytes";
8012 /** {@hide} */
8013 public static final String NETSTATS_DEV_ROTATE_AGE = "netstats_dev_rotate_age";
8014 /** {@hide} */
8015 public static final String NETSTATS_DEV_DELETE_AGE = "netstats_dev_delete_age";
8016
8017 /** {@hide} */
8018 public static final String NETSTATS_UID_BUCKET_DURATION = "netstats_uid_bucket_duration";
8019 /** {@hide} */
8020 public static final String NETSTATS_UID_PERSIST_BYTES = "netstats_uid_persist_bytes";
8021 /** {@hide} */
8022 public static final String NETSTATS_UID_ROTATE_AGE = "netstats_uid_rotate_age";
8023 /** {@hide} */
8024 public static final String NETSTATS_UID_DELETE_AGE = "netstats_uid_delete_age";
8025
8026 /** {@hide} */
8027 public static final String NETSTATS_UID_TAG_BUCKET_DURATION = "netstats_uid_tag_bucket_duration";
8028 /** {@hide} */
8029 public static final String NETSTATS_UID_TAG_PERSIST_BYTES = "netstats_uid_tag_persist_bytes";
8030 /** {@hide} */
8031 public static final String NETSTATS_UID_TAG_ROTATE_AGE = "netstats_uid_tag_rotate_age";
8032 /** {@hide} */
8033 public static final String NETSTATS_UID_TAG_DELETE_AGE = "netstats_uid_tag_delete_age";
8034
8035 /**
8036 * User preference for which network(s) should be used. Only the
8037 * connectivity service should touch this.
8038 */
8039 public static final String NETWORK_PREFERENCE = "network_preference";
8040
8041 /**
Jeff Davidsondd6fd1e2014-04-14 15:14:30 -07008042 * Which package name to use for network scoring. If null, or if the package is not a valid
8043 * scorer app, external network scores will neither be requested nor accepted.
8044 * @hide
8045 */
8046 public static final String NETWORK_SCORER_APP = "network_scorer_app";
8047
8048 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008049 * If the NITZ_UPDATE_DIFF time is exceeded then an automatic adjustment
8050 * to SystemClock will be allowed even if NITZ_UPDATE_SPACING has not been
8051 * exceeded.
8052 * @hide
8053 */
8054 public static final String NITZ_UPDATE_DIFF = "nitz_update_diff";
8055
8056 /**
8057 * The length of time in milli-seconds that automatic small adjustments to
8058 * SystemClock are ignored if NITZ_UPDATE_DIFF is not exceeded.
8059 * @hide
8060 */
8061 public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing";
8062
8063 /** Preferred NTP server. {@hide} */
8064 public static final String NTP_SERVER = "ntp_server";
8065 /** Timeout in milliseconds to wait for NTP server. {@hide} */
8066 public static final String NTP_TIMEOUT = "ntp_timeout";
8067
Jeff Sharkeye8a4b662015-06-27 15:43:45 -07008068 /** {@hide} */
8069 public static final String STORAGE_BENCHMARK_INTERVAL = "storage_benchmark_interval";
8070
Christopher Tate06efb532012-08-24 15:29:27 -07008071 /**
Pierre Imai8e48e672016-04-21 13:30:43 +09008072 * Sample validity in seconds to configure for the system DNS resolver.
8073 * {@hide}
8074 */
8075 public static final String DNS_RESOLVER_SAMPLE_VALIDITY_SECONDS =
8076 "dns_resolver_sample_validity_seconds";
8077
8078 /**
8079 * Success threshold in percent for use with the system DNS resolver.
8080 * {@hide}
8081 */
8082 public static final String DNS_RESOLVER_SUCCESS_THRESHOLD_PERCENT =
8083 "dns_resolver_success_threshold_percent";
8084
8085 /**
8086 * Minimum number of samples needed for statistics to be considered meaningful in the
8087 * system DNS resolver.
8088 * {@hide}
8089 */
8090 public static final String DNS_RESOLVER_MIN_SAMPLES = "dns_resolver_min_samples";
8091
8092 /**
8093 * Maximum number taken into account for statistics purposes in the system DNS resolver.
8094 * {@hide}
8095 */
8096 public static final String DNS_RESOLVER_MAX_SAMPLES = "dns_resolver_max_samples";
8097
8098 /**
Tao Baofdf7c5d2016-02-15 20:59:15 -08008099 * Whether to disable the automatic scheduling of system updates.
8100 * 1 = system updates won't be automatically scheduled (will always
8101 * present notification instead).
8102 * 0 = system updates will be automatically scheduled. (default)
8103 * @hide
8104 */
8105 @SystemApi
8106 public static final String OTA_DISABLE_AUTOMATIC_UPDATE = "ota_disable_automatic_update";
8107
8108 /**
rich cannings4d8fc792012-09-07 14:43:43 -07008109 * Whether the package manager should send package verification broadcasts for verifiers to
8110 * review apps prior to installation.
8111 * 1 = request apps to be verified prior to installation, if a verifier exists.
8112 * 0 = do not verify apps before installation
rich cannings4e5753f2012-09-19 16:03:56 -07008113 * @hide
rich cannings4d8fc792012-09-07 14:43:43 -07008114 */
8115 public static final String PACKAGE_VERIFIER_ENABLE = "package_verifier_enable";
8116
8117 /** Timeout for package verification.
rich cannings4e5753f2012-09-19 16:03:56 -07008118 * @hide */
rich cannings4d8fc792012-09-07 14:43:43 -07008119 public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout";
8120
8121 /** Default response code for package verification.
rich cannings4e5753f2012-09-19 16:03:56 -07008122 * @hide */
rich cannings4d8fc792012-09-07 14:43:43 -07008123 public static final String PACKAGE_VERIFIER_DEFAULT_RESPONSE = "verifier_default_response";
8124
rich cannings4e5753f2012-09-19 16:03:56 -07008125 /**
8126 * Show package verification setting in the Settings app.
rich canningse6686b32012-09-16 14:02:20 -07008127 * 1 = show (default)
8128 * 0 = hide
rich cannings4e5753f2012-09-19 16:03:56 -07008129 * @hide
rich canningse6686b32012-09-16 14:02:20 -07008130 */
8131 public static final String PACKAGE_VERIFIER_SETTING_VISIBLE = "verifier_setting_visible";
8132
rich cannings4d8fc792012-09-07 14:43:43 -07008133 /**
Fabrice Di Meglio1c1b4712014-11-19 17:12:32 -08008134 * Run package verification on apps installed through ADB/ADT/USB
rich cannings4e5753f2012-09-19 16:03:56 -07008135 * 1 = perform package verification on ADB installs (default)
8136 * 0 = bypass package verification on ADB installs
8137 * @hide
8138 */
8139 public static final String PACKAGE_VERIFIER_INCLUDE_ADB = "verifier_verify_adb_installs";
8140
8141 /**
Christopher Tate7265abe2014-11-21 13:54:45 -08008142 * Time since last fstrim (milliseconds) after which we force one to happen
8143 * during device startup. If unset, the default is 3 days.
8144 * @hide
8145 */
8146 public static final String FSTRIM_MANDATORY_INTERVAL = "fstrim_mandatory_interval";
8147
8148 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008149 * The interval in milliseconds at which to check packet counts on the
8150 * mobile data interface when screen is on, to detect possible data
8151 * connection problems.
8152 * @hide
8153 */
8154 public static final String PDP_WATCHDOG_POLL_INTERVAL_MS =
8155 "pdp_watchdog_poll_interval_ms";
8156
8157 /**
8158 * The interval in milliseconds at which to check packet counts on the
8159 * mobile data interface when screen is off, to detect possible data
8160 * connection problems.
8161 * @hide
8162 */
8163 public static final String PDP_WATCHDOG_LONG_POLL_INTERVAL_MS =
8164 "pdp_watchdog_long_poll_interval_ms";
8165
8166 /**
8167 * The interval in milliseconds at which to check packet counts on the
8168 * mobile data interface after {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT}
8169 * outgoing packets has been reached without incoming packets.
8170 * @hide
8171 */
8172 public static final String PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS =
8173 "pdp_watchdog_error_poll_interval_ms";
8174
8175 /**
8176 * The number of outgoing packets sent without seeing an incoming packet
8177 * that triggers a countdown (of {@link #PDP_WATCHDOG_ERROR_POLL_COUNT}
8178 * device is logged to the event log
8179 * @hide
8180 */
8181 public static final String PDP_WATCHDOG_TRIGGER_PACKET_COUNT =
8182 "pdp_watchdog_trigger_packet_count";
8183
8184 /**
8185 * The number of polls to perform (at {@link #PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS})
8186 * after hitting {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} before
8187 * attempting data connection recovery.
8188 * @hide
8189 */
8190 public static final String PDP_WATCHDOG_ERROR_POLL_COUNT =
8191 "pdp_watchdog_error_poll_count";
8192
8193 /**
8194 * The number of failed PDP reset attempts before moving to something more
8195 * drastic: re-registering to the network.
8196 * @hide
8197 */
8198 public static final String PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT =
8199 "pdp_watchdog_max_pdp_reset_fail_count";
8200
8201 /**
8202 * A positive value indicates how often the SamplingProfiler
8203 * should take snapshots. Zero value means SamplingProfiler
8204 * is disabled.
8205 *
8206 * @hide
8207 */
8208 public static final String SAMPLING_PROFILER_MS = "sampling_profiler_ms";
8209
8210 /**
8211 * URL to open browser on to allow user to manage a prepay account
8212 * @hide
8213 */
8214 public static final String SETUP_PREPAID_DATA_SERVICE_URL =
8215 "setup_prepaid_data_service_url";
8216
8217 /**
8218 * URL to attempt a GET on to see if this is a prepay device
8219 * @hide
8220 */
8221 public static final String SETUP_PREPAID_DETECTION_TARGET_URL =
8222 "setup_prepaid_detection_target_url";
8223
8224 /**
8225 * Host to check for a redirect to after an attempt to GET
8226 * SETUP_PREPAID_DETECTION_TARGET_URL. (If we redirected there,
8227 * this is a prepaid device with zero balance.)
8228 * @hide
8229 */
8230 public static final String SETUP_PREPAID_DETECTION_REDIR_HOST =
8231 "setup_prepaid_detection_redir_host";
8232
8233 /**
Jake Hamby76a61422012-09-06 17:40:21 -07008234 * The interval in milliseconds at which to check the number of SMS sent out without asking
8235 * for use permit, to limit the un-authorized SMS usage.
8236 *
8237 * @hide
8238 */
8239 public static final String SMS_OUTGOING_CHECK_INTERVAL_MS =
8240 "sms_outgoing_check_interval_ms";
8241
8242 /**
8243 * The number of outgoing SMS sent without asking for user permit (of {@link
8244 * #SMS_OUTGOING_CHECK_INTERVAL_MS}
8245 *
8246 * @hide
8247 */
8248 public static final String SMS_OUTGOING_CHECK_MAX_COUNT =
8249 "sms_outgoing_check_max_count";
8250
8251 /**
8252 * Used to disable SMS short code confirmation - defaults to true.
Robert Greenwalt026efcc2012-09-24 10:03:21 -07008253 * True indcates we will do the check, etc. Set to false to disable.
Jake Hamby76a61422012-09-06 17:40:21 -07008254 * @see com.android.internal.telephony.SmsUsageMonitor
8255 * @hide
8256 */
8257 public static final String SMS_SHORT_CODE_CONFIRMATION = "sms_short_code_confirmation";
8258
Robert Greenwalt026efcc2012-09-24 10:03:21 -07008259 /**
8260 * Used to select which country we use to determine premium sms codes.
8261 * One of com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_SIM,
8262 * com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_NETWORK,
8263 * or com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_BOTH.
8264 * @hide
8265 */
8266 public static final String SMS_SHORT_CODE_RULE = "sms_short_code_rule";
8267
Jake Hamby76a61422012-09-06 17:40:21 -07008268 /**
JP Abgrall32d1ac4d2014-02-21 12:05:20 -08008269 * Used to select TCP's default initial receiver window size in segments - defaults to a build config value
8270 * @hide
8271 */
8272 public static final String TCP_DEFAULT_INIT_RWND = "tcp_default_init_rwnd";
8273
8274 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008275 * Used to disable Tethering on a device - defaults to true
8276 * @hide
8277 */
8278 public static final String TETHER_SUPPORTED = "tether_supported";
8279
8280 /**
8281 * Used to require DUN APN on the device or not - defaults to a build config value
8282 * which defaults to false
8283 * @hide
8284 */
8285 public static final String TETHER_DUN_REQUIRED = "tether_dun_required";
8286
8287 /**
8288 * Used to hold a gservices-provisioned apn value for DUN. If set, or the
8289 * corresponding build config values are set it will override the APN DB
8290 * values.
8291 * Consists of a comma seperated list of strings:
8292 * "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type"
8293 * note that empty fields can be ommitted: "name,apn,,,,,,,,,310,260,,DUN"
8294 * @hide
8295 */
8296 public static final String TETHER_DUN_APN = "tether_dun_apn";
8297
Erik Kline92c4db02017-05-31 10:21:32 +09008298 /**
8299 * Used to disable trying to talk to any available tethering offload HAL.
8300 *
8301 * Integer values are interpreted as boolean, and the absence of an explicit setting
8302 * is interpreted as |false|.
8303 * @hide
8304 */
8305 public static final String TETHER_OFFLOAD_DISABLED = "tether_offload_disabled";
8306
Christopher Tate06efb532012-08-24 15:29:27 -07008307 /**
Junda Liu0c35fbc2016-01-19 23:20:15 -08008308 * List of carrier apps which are whitelisted to prompt the user for install when
8309 * a sim card with matching uicc carrier privilege rules is inserted.
8310 *
8311 * The value is "package1;package2;..."
8312 * @hide
8313 */
8314 public static final String CARRIER_APP_WHITELIST = "carrier_app_whitelist";
8315
8316 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008317 * USB Mass Storage Enabled
8318 */
8319 public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled";
8320
8321 /**
8322 * If this setting is set (to anything), then all references
8323 * to Gmail on the device must change to Google Mail.
8324 */
8325 public static final String USE_GOOGLE_MAIL = "use_google_mail";
8326
Hui Shu22671772014-10-01 21:41:07 +00008327 /**
8328 * Webview Data reduction proxy key.
8329 * @hide
8330 */
8331 public static final String WEBVIEW_DATA_REDUCTION_PROXY_KEY =
8332 "webview_data_reduction_proxy_key";
8333
Lorenzo Colitti84e6f1232016-08-29 14:03:11 +09008334 /**
8335 * Whether or not the WebView fallback mechanism should be enabled.
8336 * 0=disabled, 1=enabled.
8337 * @hide
8338 */
8339 public static final String WEBVIEW_FALLBACK_LOGIC_ENABLED =
8340 "webview_fallback_logic_enabled";
Gustav Senntonc83e3fa2016-02-18 12:19:13 +00008341
Lorenzo Colitti84e6f1232016-08-29 14:03:11 +09008342 /**
8343 * Name of the package used as WebView provider (if unset the provider is instead determined
8344 * by the system).
8345 * @hide
8346 */
8347 public static final String WEBVIEW_PROVIDER = "webview_provider";
Gustav Sennton14c033c2016-02-11 12:51:27 +00008348
Lorenzo Colitti84e6f1232016-08-29 14:03:11 +09008349 /**
8350 * Developer setting to enable WebView multiprocess rendering.
8351 * @hide
8352 */
8353 @SystemApi
8354 public static final String WEBVIEW_MULTIPROCESS = "webview_multiprocess";
8355
8356 /**
8357 * The maximum number of notifications shown in 24 hours when switching networks.
8358 * @hide
8359 */
8360 public static final String NETWORK_SWITCH_NOTIFICATION_DAILY_LIMIT =
8361 "network_switch_notification_daily_limit";
8362
8363 /**
8364 * The minimum time in milliseconds between notifications when switching networks.
8365 * @hide
8366 */
8367 public static final String NETWORK_SWITCH_NOTIFICATION_RATE_LIMIT_MILLIS =
8368 "network_switch_notification_rate_limit_millis";
Tobias Sargeantda857102016-02-11 14:52:28 +00008369
Christopher Tate06efb532012-08-24 15:29:27 -07008370 /**
Hugo Benichic8e9e122016-09-14 23:23:08 +00008371 * Whether to automatically switch away from wifi networks that lose Internet access.
Lorenzo Colitti165c51c2016-09-19 01:00:19 +09008372 * Only meaningful if config_networkAvoidBadWifi is set to 0, otherwise the system always
8373 * avoids such networks. Valid values are:
8374 *
8375 * 0: Don't avoid bad wifi, don't prompt the user. Get stuck on bad wifi like it's 2013.
8376 * null: Ask the user whether to switch away from bad wifi.
8377 * 1: Avoid bad wifi.
8378 *
Hugo Benichic8e9e122016-09-14 23:23:08 +00008379 * @hide
8380 */
8381 public static final String NETWORK_AVOID_BAD_WIFI = "network_avoid_bad_wifi";
8382
8383 /**
Lorenzo Colitti2de49252017-01-24 18:08:41 +09008384 * User setting for ConnectivityManager.getMeteredMultipathPreference(). This value may be
8385 * overridden by the system based on device or application state. If null, the value
8386 * specified by config_networkMeteredMultipathPreference is used.
8387 *
8388 * @hide
8389 */
8390 public static final String NETWORK_METERED_MULTIPATH_PREFERENCE =
8391 "network_metered_multipath_preference";
8392
8393 /**
William Meecd62f3a2017-01-24 18:01:38 -08008394 * The thresholds of the wifi throughput badging (SD, HD etc.) as a comma-delimited list of
8395 * colon-delimited key-value pairs. The key is the badging enum value defined in
8396 * android.net.ScoredNetwork and the value is the minimum sustained network throughput in
8397 * kbps required for the badge. For example: "10:3000,20:5000,30:25000"
8398 *
8399 * @hide
8400 */
8401 @SystemApi
8402 public static final String WIFI_BADGING_THRESHOLDS = "wifi_badging_thresholds";
8403
8404 /**
Jeff Brown89d55462012-09-19 11:33:42 -07008405 * Whether Wifi display is enabled/disabled
8406 * 0=disabled. 1=enabled.
8407 * @hide
8408 */
8409 public static final String WIFI_DISPLAY_ON = "wifi_display_on";
8410
8411 /**
Chong Zhang1f3ecaa2013-05-03 15:55:36 -07008412 * Whether Wifi display certification mode is enabled/disabled
8413 * 0=disabled. 1=enabled.
8414 * @hide
8415 */
8416 public static final String WIFI_DISPLAY_CERTIFICATION_ON =
8417 "wifi_display_certification_on";
8418
8419 /**
Chong Zhange38af812013-08-29 17:25:17 -07008420 * WPS Configuration method used by Wifi display, this setting only
8421 * takes effect when WIFI_DISPLAY_CERTIFICATION_ON is 1 (enabled).
8422 *
8423 * Possible values are:
8424 *
8425 * WpsInfo.INVALID: use default WPS method chosen by framework
8426 * WpsInfo.PBC : use Push button
8427 * WpsInfo.KEYPAD : use Keypad
8428 * WpsInfo.DISPLAY: use Display
8429 * @hide
8430 */
8431 public static final String WIFI_DISPLAY_WPS_CONFIG =
8432 "wifi_display_wps_config";
8433
8434 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008435 * Whether to notify the user of open networks.
8436 * <p>
8437 * If not connected and the scan results have an open network, we will
8438 * put this notification up. If we attempt to connect to a network or
8439 * the open network(s) disappear, we remove the notification. When we
8440 * show the notification, we will not show it again for
8441 * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time.
Amin Shaikh3087e322017-03-24 17:34:24 -07008442 *
8443 * @deprecated This feature is no longer controlled by this setting in
8444 * {@link android.os.Build.VERSION_CODES#O}.
Christopher Tate06efb532012-08-24 15:29:27 -07008445 */
Amin Shaikh3087e322017-03-24 17:34:24 -07008446 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07008447 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
8448 "wifi_networks_available_notification_on";
Amin Shaikh3087e322017-03-24 17:34:24 -07008449
Christopher Tate06efb532012-08-24 15:29:27 -07008450 /**
8451 * {@hide}
8452 */
8453 public static final String WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON =
8454 "wimax_networks_available_notification_on";
8455
8456 /**
8457 * Delay (in seconds) before repeating the Wi-Fi networks available notification.
8458 * Connecting to a network will reset the timer.
8459 */
8460 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
8461 "wifi_networks_available_repeat_delay";
8462
8463 /**
Robert Greenwalt3ea0c992013-10-03 21:13:49 +00008464 * 802.11 country code in ISO 3166 format
8465 * @hide
8466 */
8467 public static final String WIFI_COUNTRY_CODE = "wifi_country_code";
8468
8469 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008470 * The interval in milliseconds to issue wake up scans when wifi needs
8471 * to connect. This is necessary to connect to an access point when
8472 * device is on the move and the screen is off.
8473 * @hide
8474 */
8475 public static final String WIFI_FRAMEWORK_SCAN_INTERVAL_MS =
8476 "wifi_framework_scan_interval_ms";
8477
8478 /**
8479 * The interval in milliseconds after which Wi-Fi is considered idle.
8480 * When idle, it is possible for the device to be switched from Wi-Fi to
8481 * the mobile data network.
8482 * @hide
8483 */
8484 public static final String WIFI_IDLE_MS = "wifi_idle_ms";
8485
8486 /**
8487 * When the number of open networks exceeds this number, the
8488 * least-recently-used excess networks will be removed.
8489 */
8490 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept";
8491
8492 /**
8493 * Whether the Wi-Fi should be on. Only the Wi-Fi service should touch this.
8494 */
8495 public static final String WIFI_ON = "wifi_on";
8496
8497 /**
Irfan Sheriff11aefad2013-03-06 07:57:41 -08008498 * Setting to allow scans to be enabled even wifi is turned off for connectivity.
8499 * @hide
8500 */
8501 public static final String WIFI_SCAN_ALWAYS_AVAILABLE =
8502 "wifi_scan_always_enabled";
8503
Stephen Chen8ca96c12016-11-16 15:46:51 -08008504 /**
8505 * Value to specify if Wi-Fi Wakeup feature is enabled.
Stephen Chenf1b75642016-12-06 16:08:52 -08008506 *
8507 * Type: int (0 for false, 1 for true)
Stephen Chen8ca96c12016-11-16 15:46:51 -08008508 * @hide
8509 */
8510 @SystemApi
8511 public static final String WIFI_WAKEUP_ENABLED = "wifi_wakeup_enabled";
8512
Stephen Chen6a0c8792016-11-16 15:46:51 -08008513 /**
Jeremy Joslin45caa252017-05-04 11:22:46 -07008514 * Value to specify if Wi-Fi Wakeup is available.
8515 *
8516 * Wi-Fi Wakeup will only operate if it's available
8517 * and {@link #WIFI_WAKEUP_ENABLED} is true.
8518 *
8519 * Type: int (0 for false, 1 for true)
8520 * @hide
8521 */
8522 public static final String WIFI_WAKEUP_AVAILABLE = "wifi_wakeup_available";
8523
8524 /**
Sundeep Ghumane869d832017-01-25 16:23:43 -08008525 * Value to specify whether network quality scores and badging should be shown in the UI.
8526 *
8527 * Type: int (0 for false, 1 for true)
8528 * @hide
8529 */
8530 public static final String NETWORK_SCORING_UI_ENABLED = "network_scoring_ui_enabled";
8531
8532 /**
Stephen Chen6a0c8792016-11-16 15:46:51 -08008533 * Value to specify if network recommendations from
8534 * {@link com.android.server.NetworkScoreService} are enabled.
Stephen Chenf1b75642016-12-06 16:08:52 -08008535 *
Jeremy Joslin9925c6a2017-03-06 10:39:35 -08008536 * Type: int
8537 * Valid values:
8538 * -1 = Forced off
8539 * 0 = Disabled
8540 * 1 = Enabled
8541 *
8542 * Most readers of this setting should simply check if value == 1 to determined the
8543 * enabled state.
Stephen Chen6a0c8792016-11-16 15:46:51 -08008544 * @hide
8545 */
Stephen Chen6a0c8792016-11-16 15:46:51 -08008546 public static final String NETWORK_RECOMMENDATIONS_ENABLED =
8547 "network_recommendations_enabled";
8548
Jeremy Joslincb594f32017-01-03 17:31:23 -08008549 /**
Jeremy Joslinc9eb3c42017-02-08 10:45:30 -08008550 * Which package name to use for network recommendations. If null, network recommendations
8551 * will neither be requested nor accepted.
8552 *
8553 * Use {@link NetworkScoreManager#getActiveScorerPackage()} to read this value and
8554 * {@link NetworkScoreManager#setActiveScorer(String)} to write it.
8555 *
8556 * Type: string - package name
8557 * @hide
8558 */
8559 public static final String NETWORK_RECOMMENDATIONS_PACKAGE =
8560 "network_recommendations_package";
8561
8562 /**
Amin Shaikhbc9a8e62017-02-02 15:39:12 -08008563 * The package name of the application that connect and secures high quality open wifi
8564 * networks automatically.
8565 *
8566 * Type: string package name or null if the feature is either not provided or disabled.
8567 * @hide
8568 */
8569 public static final String USE_OPEN_WIFI_PACKAGE = "use_open_wifi_package";
8570
8571 /**
Jeremy Joslincb594f32017-01-03 17:31:23 -08008572 * The number of milliseconds the {@link com.android.server.NetworkScoreService}
8573 * will give a recommendation request to complete before returning a default response.
8574 *
8575 * Type: long
8576 * @hide
Jeremy Joslinb1a01392017-04-14 13:35:48 -07008577 * @deprecated to be removed
Jeremy Joslincb594f32017-01-03 17:31:23 -08008578 */
8579 public static final String NETWORK_RECOMMENDATION_REQUEST_TIMEOUT_MS =
8580 "network_recommendation_request_timeout_ms";
8581
Amin Shaikhd3c81932017-02-06 16:22:42 -08008582 /**
8583 * The expiration time in milliseconds for the {@link android.net.WifiKey} request cache in
8584 * {@link com.android.server.wifi.RecommendedNetworkEvaluator}.
8585 *
8586 * Type: long
8587 * @hide
8588 */
8589 public static final String RECOMMENDED_NETWORK_EVALUATOR_CACHE_EXPIRY_MS =
8590 "recommended_network_evaluator_cache_expiry_ms";
8591
Irfan Sheriff11aefad2013-03-06 07:57:41 -08008592 /**
Wei Wangd91f1932015-03-19 15:09:56 -07008593 * Settings to allow BLE scans to be enabled even when Bluetooth is turned off for
8594 * connectivity.
8595 * @hide
8596 */
8597 public static final String BLE_SCAN_ALWAYS_AVAILABLE =
8598 "ble_scan_always_enabled";
8599
8600 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008601 * Used to save the Wifi_ON state prior to tethering.
8602 * This state will be checked to restore Wifi after
8603 * the user turns off tethering.
8604 *
8605 * @hide
8606 */
8607 public static final String WIFI_SAVED_STATE = "wifi_saved_state";
8608
8609 /**
8610 * The interval in milliseconds to scan as used by the wifi supplicant
8611 * @hide
8612 */
8613 public static final String WIFI_SUPPLICANT_SCAN_INTERVAL_MS =
8614 "wifi_supplicant_scan_interval_ms";
8615
vandwalle7c3606c2014-03-31 19:12:07 -07008616 /**
8617 * whether frameworks handles wifi auto-join
8618 * @hide
8619 */
8620 public static final String WIFI_ENHANCED_AUTO_JOIN =
8621 "wifi_enhanced_auto_join";
8622
8623 /**
8624 * whether settings show RSSI
8625 * @hide
8626 */
8627 public static final String WIFI_NETWORK_SHOW_RSSI =
8628 "wifi_network_show_rssi";
8629
8630 /**
Irfan Sheriff3809f502012-09-17 16:04:57 -07008631 * The interval in milliseconds to scan at supplicant when p2p is connected
8632 * @hide
8633 */
8634 public static final String WIFI_SCAN_INTERVAL_WHEN_P2P_CONNECTED_MS =
8635 "wifi_scan_interval_p2p_connected_ms";
8636
8637 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008638 * Whether the Wi-Fi watchdog is enabled.
8639 */
8640 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
8641
8642 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008643 * Setting to turn off poor network avoidance on Wi-Fi. Feature is enabled by default and
8644 * the setting needs to be set to 0 to disable it.
8645 * @hide
8646 */
8647 public static final String WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED =
8648 "wifi_watchdog_poor_network_test_enabled";
8649
8650 /**
8651 * Setting to turn on suspend optimizations at screen off on Wi-Fi. Enabled by default and
8652 * needs to be set to 0 to disable it.
8653 * @hide
8654 */
8655 public static final String WIFI_SUSPEND_OPTIMIZATIONS_ENABLED =
8656 "wifi_suspend_optimizations_enabled";
8657
8658 /**
Nathan Harold29589fc2016-03-30 21:53:48 -07008659 * Setting to enable verbose logging in Wi-Fi; disabled by default, and setting to 1
8660 * will enable it. In the future, additional values may be supported.
8661 * @hide
8662 */
8663 public static final String WIFI_VERBOSE_LOGGING_ENABLED =
8664 "wifi_verbose_logging_enabled";
8665
8666 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008667 * The maximum number of times we will retry a connection to an access
8668 * point for which we have failed in acquiring an IP address from DHCP.
8669 * A value of N means that we will make N+1 connection attempts in all.
8670 */
8671 public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count";
8672
8673 /**
8674 * Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile
8675 * data connectivity to be established after a disconnect from Wi-Fi.
8676 */
8677 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
8678 "wifi_mobile_data_transition_wakelock_timeout_ms";
8679
8680 /**
Zoltan Szatmary-Ban4045d242015-05-27 12:42:39 +01008681 * This setting controls whether WiFi configurations created by a Device Owner app
8682 * should be locked down (that is, be editable or removable only by the Device Owner App,
8683 * not even by Settings app).
8684 * This setting takes integer values. Non-zero values mean DO created configurations
8685 * are locked down. Value of zero means they are not. Default value in the absence of
8686 * actual value to this setting is 0.
8687 */
8688 public static final String WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN =
8689 "wifi_device_owner_configs_lockdown";
8690
8691 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008692 * The operational wifi frequency band
8693 * Set to one of {@link WifiManager#WIFI_FREQUENCY_BAND_AUTO},
8694 * {@link WifiManager#WIFI_FREQUENCY_BAND_5GHZ} or
8695 * {@link WifiManager#WIFI_FREQUENCY_BAND_2GHZ}
8696 *
8697 * @hide
8698 */
8699 public static final String WIFI_FREQUENCY_BAND = "wifi_frequency_band";
8700
8701 /**
8702 * The Wi-Fi peer-to-peer device name
8703 * @hide
8704 */
8705 public static final String WIFI_P2P_DEVICE_NAME = "wifi_p2p_device_name";
8706
8707 /**
Robert Greenwaltc12783a2013-05-16 12:48:20 -07008708 * The min time between wifi disable and wifi enable
8709 * @hide
8710 */
8711 public static final String WIFI_REENABLE_DELAY_MS = "wifi_reenable_delay";
8712
8713 /**
Jeff Davidsona20ca67d2014-12-16 11:48:54 -08008714 * Timeout for ephemeral networks when all known BSSIDs go out of range. We will disconnect
8715 * from an ephemeral network if there is no BSSID for that network with a non-null score that
8716 * has been seen in this time period.
8717 *
8718 * If this is less than or equal to zero, we use a more conservative behavior and only check
8719 * for a non-null score from the currently connected or target BSSID.
8720 * @hide
8721 */
8722 public static final String WIFI_EPHEMERAL_OUT_OF_RANGE_TIMEOUT_MS =
8723 "wifi_ephemeral_out_of_range_timeout_ms";
8724
8725 /**
Christopher Tatec868b642012-09-12 17:41:04 -07008726 * The number of milliseconds to delay when checking for data stalls during
8727 * non-aggressive detection. (screen is turned off.)
8728 * @hide
8729 */
8730 public static final String DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS =
8731 "data_stall_alarm_non_aggressive_delay_in_ms";
8732
8733 /**
8734 * The number of milliseconds to delay when checking for data stalls during
8735 * aggressive detection. (screen on or suspected data stall)
8736 * @hide
8737 */
8738 public static final String DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS =
8739 "data_stall_alarm_aggressive_delay_in_ms";
8740
8741 /**
Wink Savillece1e3792013-09-03 16:41:44 -07008742 * The number of milliseconds to allow the provisioning apn to remain active
8743 * @hide
8744 */
8745 public static final String PROVISIONING_APN_ALARM_DELAY_IN_MS =
8746 "provisioning_apn_alarm_delay_in_ms";
8747
8748 /**
Christopher Tatec868b642012-09-12 17:41:04 -07008749 * The interval in milliseconds at which to check gprs registration
8750 * after the first registration mismatch of gprs and voice service,
8751 * to detect possible data network registration problems.
8752 *
8753 * @hide
8754 */
8755 public static final String GPRS_REGISTER_CHECK_PERIOD_MS =
8756 "gprs_register_check_period_ms";
8757
8758 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008759 * Nonzero causes Log.wtf() to crash.
8760 * @hide
8761 */
8762 public static final String WTF_IS_FATAL = "wtf_is_fatal";
8763
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07008764 /**
8765 * Ringer mode. This is used internally, changing this value will not
8766 * change the ringer mode. See AudioManager.
8767 */
8768 public static final String MODE_RINGER = "mode_ringer";
Christopher Tate06efb532012-08-24 15:29:27 -07008769
Jeff Brownd4935962012-09-25 13:27:20 -07008770 /**
8771 * Overlay display devices setting.
8772 * The associated value is a specially formatted string that describes the
8773 * size and density of simulated secondary display devices.
8774 * <p>
8775 * Format: {width}x{height}/{dpi};...
8776 * </p><p>
8777 * Example:
8778 * <ul>
8779 * <li><code>1280x720/213</code>: make one overlay that is 1280x720 at 213dpi.</li>
8780 * <li><code>1920x1080/320;1280x720/213</code>: make two overlays, the first
8781 * at 1080p and the second at 720p.</li>
8782 * <li>If the value is empty, then no overlay display devices are created.</li>
8783 * </ul></p>
8784 *
8785 * @hide
8786 */
8787 public static final String OVERLAY_DISPLAY_DEVICES = "overlay_display_devices";
Christopher Tate06efb532012-08-24 15:29:27 -07008788
Jeff Sharkey625239a2012-09-26 22:03:49 -07008789 /**
8790 * Threshold values for the duration and level of a discharge cycle,
8791 * under which we log discharge cycle info.
8792 *
8793 * @hide
8794 */
8795 public static final String
8796 BATTERY_DISCHARGE_DURATION_THRESHOLD = "battery_discharge_duration_threshold";
8797
8798 /** @hide */
8799 public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold";
8800
8801 /**
8802 * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR
8803 * intents on application crashes and ANRs. If this is disabled, the
8804 * crash/ANR dialog will never display the "Report" button.
8805 * <p>
8806 * Type: int (0 = disallow, 1 = allow)
8807 *
8808 * @hide
8809 */
8810 public static final String SEND_ACTION_APP_ERROR = "send_action_app_error";
8811
8812 /**
8813 * Maximum age of entries kept by {@link DropBoxManager}.
8814 *
8815 * @hide
8816 */
8817 public static final String DROPBOX_AGE_SECONDS = "dropbox_age_seconds";
8818
8819 /**
8820 * Maximum number of entry files which {@link DropBoxManager} will keep
8821 * around.
8822 *
8823 * @hide
8824 */
8825 public static final String DROPBOX_MAX_FILES = "dropbox_max_files";
8826
8827 /**
8828 * Maximum amount of disk space used by {@link DropBoxManager} no matter
8829 * what.
8830 *
8831 * @hide
8832 */
8833 public static final String DROPBOX_QUOTA_KB = "dropbox_quota_kb";
8834
8835 /**
8836 * Percent of free disk (excluding reserve) which {@link DropBoxManager}
8837 * will use.
8838 *
8839 * @hide
8840 */
8841 public static final String DROPBOX_QUOTA_PERCENT = "dropbox_quota_percent";
8842
8843 /**
8844 * Percent of total disk which {@link DropBoxManager} will never dip
8845 * into.
8846 *
8847 * @hide
8848 */
8849 public static final String DROPBOX_RESERVE_PERCENT = "dropbox_reserve_percent";
8850
8851 /**
8852 * Prefix for per-tag dropbox disable/enable settings.
8853 *
8854 * @hide
8855 */
8856 public static final String DROPBOX_TAG_PREFIX = "dropbox:";
8857
8858 /**
8859 * Lines of logcat to include with system crash/ANR/etc. reports, as a
8860 * prefix of the dropbox tag of the report type. For example,
8861 * "logcat_for_system_server_anr" controls the lines of logcat captured
8862 * with system server ANR reports. 0 to disable.
8863 *
8864 * @hide
8865 */
8866 public static final String ERROR_LOGCAT_PREFIX = "logcat_for_";
8867
8868 /**
8869 * The interval in minutes after which the amount of free storage left
8870 * on the device is logged to the event log
8871 *
8872 * @hide
8873 */
8874 public static final String SYS_FREE_STORAGE_LOG_INTERVAL = "sys_free_storage_log_interval";
8875
8876 /**
8877 * Threshold for the amount of change in disk free space required to
8878 * report the amount of free space. Used to prevent spamming the logs
8879 * when the disk free space isn't changing frequently.
8880 *
8881 * @hide
8882 */
8883 public static final String
8884 DISK_FREE_CHANGE_REPORTING_THRESHOLD = "disk_free_change_reporting_threshold";
8885
8886 /**
8887 * Minimum percentage of free storage on the device that is used to
8888 * determine if the device is running low on storage. The default is 10.
8889 * <p>
8890 * Say this value is set to 10, the device is considered running low on
8891 * storage if 90% or more of the device storage is filled up.
8892 *
8893 * @hide
8894 */
8895 public static final String
8896 SYS_STORAGE_THRESHOLD_PERCENTAGE = "sys_storage_threshold_percentage";
8897
8898 /**
8899 * Maximum byte size of the low storage threshold. This is to ensure
8900 * that {@link #SYS_STORAGE_THRESHOLD_PERCENTAGE} does not result in an
8901 * overly large threshold for large storage devices. Currently this must
8902 * be less than 2GB. This default is 500MB.
8903 *
8904 * @hide
8905 */
8906 public static final String
8907 SYS_STORAGE_THRESHOLD_MAX_BYTES = "sys_storage_threshold_max_bytes";
8908
8909 /**
8910 * Minimum bytes of free storage on the device before the data partition
8911 * is considered full. By default, 1 MB is reserved to avoid system-wide
8912 * SQLite disk full exceptions.
8913 *
8914 * @hide
8915 */
8916 public static final String
8917 SYS_STORAGE_FULL_THRESHOLD_BYTES = "sys_storage_full_threshold_bytes";
8918
8919 /**
Jeff Sharkeyd5d5e922017-02-21 10:51:23 -07008920 * Minimum percentage of storage on the device that is reserved for
8921 * cached data.
8922 *
8923 * @hide
8924 */
8925 public static final String
8926 SYS_STORAGE_CACHE_PERCENTAGE = "sys_storage_cache_percentage";
8927
8928 /**
8929 * Maximum bytes of storage on the device that is reserved for cached
8930 * data.
8931 *
8932 * @hide
8933 */
8934 public static final String
8935 SYS_STORAGE_CACHE_MAX_BYTES = "sys_storage_cache_max_bytes";
8936
8937 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07008938 * The maximum reconnect delay for short network outages or when the
8939 * network is suspended due to phone use.
8940 *
8941 * @hide
8942 */
8943 public static final String
8944 SYNC_MAX_RETRY_DELAY_IN_SECONDS = "sync_max_retry_delay_in_seconds";
8945
8946 /**
8947 * The number of milliseconds to delay before sending out
Erik Kline8f29dcf2014-12-08 16:25:20 +09008948 * {@link ConnectivityManager#CONNECTIVITY_ACTION} broadcasts. Ignored.
Jeff Sharkey625239a2012-09-26 22:03:49 -07008949 *
8950 * @hide
8951 */
8952 public static final String CONNECTIVITY_CHANGE_DELAY = "connectivity_change_delay";
8953
Vinit Deshapnde1f12cb52013-08-21 13:09:01 -07008954
8955 /**
8956 * Network sampling interval, in seconds. We'll generate link information
8957 * about bytes/packets sent and error rates based on data sampled in this interval
8958 *
8959 * @hide
8960 */
8961
8962 public static final String CONNECTIVITY_SAMPLING_INTERVAL_IN_SECONDS =
8963 "connectivity_sampling_interval_in_seconds";
8964
Jeff Sharkey625239a2012-09-26 22:03:49 -07008965 /**
Jason Monk602b2322013-07-03 17:04:33 -04008966 * The series of successively longer delays used in retrying to download PAC file.
8967 * Last delay is used between successful PAC downloads.
8968 *
8969 * @hide
8970 */
8971 public static final String PAC_CHANGE_DELAY = "pac_change_delay";
8972
8973 /**
Calvin Onbe96da12016-10-11 15:10:46 -07008974 * Don't attempt to detect captive portals.
Jeff Sharkey625239a2012-09-26 22:03:49 -07008975 *
8976 * @hide
8977 */
Calvin Onbe96da12016-10-11 15:10:46 -07008978 public static final int CAPTIVE_PORTAL_MODE_IGNORE = 0;
8979
8980 /**
8981 * When detecting a captive portal, display a notification that
8982 * prompts the user to sign in.
8983 *
8984 * @hide
8985 */
8986 public static final int CAPTIVE_PORTAL_MODE_PROMPT = 1;
8987
8988 /**
8989 * When detecting a captive portal, immediately disconnect from the
8990 * network and do not reconnect to that network in the future.
8991 *
8992 * @hide
8993 */
8994 public static final int CAPTIVE_PORTAL_MODE_AVOID = 2;
8995
8996 /**
8997 * What to do when connecting a network that presents a captive portal.
8998 * Must be one of the CAPTIVE_PORTAL_MODE_* constants above.
8999 *
9000 * The default for this setting is CAPTIVE_PORTAL_MODE_PROMPT.
9001 * @hide
9002 */
9003 public static final String CAPTIVE_PORTAL_MODE = "captive_portal_mode";
9004
9005 /**
9006 * Setting to turn off captive portal detection. Feature is enabled by
9007 * default and the setting needs to be set to 0 to disable it.
9008 *
9009 * @deprecated use CAPTIVE_PORTAL_MODE_IGNORE to disable captive portal detection
9010 * @hide
9011 */
9012 @Deprecated
Jeff Sharkey625239a2012-09-26 22:03:49 -07009013 public static final String
9014 CAPTIVE_PORTAL_DETECTION_ENABLED = "captive_portal_detection_enabled";
9015
9016 /**
9017 * The server used for captive portal detection upon a new conection. A
9018 * 204 response code from the server is used for validation.
Hugo Benichi92eb22fd2016-09-27 13:01:41 +09009019 * TODO: remove this deprecated symbol.
Jeff Sharkey625239a2012-09-26 22:03:49 -07009020 *
9021 * @hide
9022 */
9023 public static final String CAPTIVE_PORTAL_SERVER = "captive_portal_server";
9024
9025 /**
Hugo Benichi92eb22fd2016-09-27 13:01:41 +09009026 * The URL used for HTTPS captive portal detection upon a new connection.
9027 * A 204 response code from the server is used for validation.
9028 *
9029 * @hide
9030 */
9031 public static final String CAPTIVE_PORTAL_HTTPS_URL = "captive_portal_https_url";
9032
9033 /**
9034 * The URL used for HTTP captive portal detection upon a new connection.
9035 * A 204 response code from the server is used for validation.
9036 *
9037 * @hide
9038 */
9039 public static final String CAPTIVE_PORTAL_HTTP_URL = "captive_portal_http_url";
9040
9041 /**
9042 * The URL used for fallback HTTP captive portal detection when previous HTTP
9043 * and HTTPS captive portal detection attemps did not return a conclusive answer.
9044 *
9045 * @hide
9046 */
9047 public static final String CAPTIVE_PORTAL_FALLBACK_URL = "captive_portal_fallback_url";
9048
9049 /**
Hugo Benichieef918a2017-04-10 17:43:08 +09009050 * A comma separated list of URLs used for captive portal detection in addition to the
9051 * fallback HTTP url associated with the CAPTIVE_PORTAL_FALLBACK_URL settings.
9052 *
9053 * @hide
9054 */
9055 public static final String CAPTIVE_PORTAL_OTHER_FALLBACK_URLS =
9056 "captive_portal_other_fallback_urls";
9057
9058 /**
Lorenzo Colittic5be12e2016-04-19 21:57:31 +09009059 * Whether to use HTTPS for network validation. This is enabled by default and the setting
9060 * needs to be set to 0 to disable it. This setting is a misnomer because captive portals
9061 * don't actually use HTTPS, but it's consistent with the other settings.
9062 *
9063 * @hide
9064 */
9065 public static final String CAPTIVE_PORTAL_USE_HTTPS = "captive_portal_use_https";
9066
9067 /**
Hugo Benichi92eb22fd2016-09-27 13:01:41 +09009068 * Which User-Agent string to use in the header of the captive portal detection probes.
9069 * The User-Agent field is unset when this setting has no value (HttpUrlConnection default).
9070 *
9071 * @hide
9072 */
9073 public static final String CAPTIVE_PORTAL_USER_AGENT = "captive_portal_user_agent";
9074
9075 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07009076 * Whether network service discovery is enabled.
9077 *
9078 * @hide
9079 */
9080 public static final String NSD_ON = "nsd_on";
9081
9082 /**
9083 * Let user pick default install location.
9084 *
9085 * @hide
9086 */
9087 public static final String SET_INSTALL_LOCATION = "set_install_location";
9088
9089 /**
9090 * Default install location value.
9091 * 0 = auto, let system decide
9092 * 1 = internal
9093 * 2 = sdcard
9094 * @hide
9095 */
9096 public static final String DEFAULT_INSTALL_LOCATION = "default_install_location";
9097
9098 /**
9099 * ms during which to consume extra events related to Inet connection
9100 * condition after a transtion to fully-connected
9101 *
9102 * @hide
9103 */
9104 public static final String
9105 INET_CONDITION_DEBOUNCE_UP_DELAY = "inet_condition_debounce_up_delay";
9106
9107 /**
9108 * ms during which to consume extra events related to Inet connection
9109 * condtion after a transtion to partly-connected
9110 *
9111 * @hide
9112 */
9113 public static final String
9114 INET_CONDITION_DEBOUNCE_DOWN_DELAY = "inet_condition_debounce_down_delay";
9115
9116 /** {@hide} */
9117 public static final String
9118 READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT = "read_external_storage_enforced_default";
9119
9120 /**
9121 * Host name and port for global http proxy. Uses ':' seperator for
9122 * between host and port.
9123 */
9124 public static final String HTTP_PROXY = "http_proxy";
9125
9126 /**
9127 * Host name for global http proxy. Set via ConnectivityManager.
9128 *
9129 * @hide
9130 */
9131 public static final String GLOBAL_HTTP_PROXY_HOST = "global_http_proxy_host";
9132
9133 /**
9134 * Integer host port for global http proxy. Set via ConnectivityManager.
9135 *
9136 * @hide
9137 */
9138 public static final String GLOBAL_HTTP_PROXY_PORT = "global_http_proxy_port";
9139
9140 /**
9141 * Exclusion list for global proxy. This string contains a list of
9142 * comma-separated domains where the global proxy does not apply.
9143 * Domains should be listed in a comma- separated list. Example of
9144 * acceptable formats: ".domain1.com,my.domain2.com" Use
9145 * ConnectivityManager to set/get.
9146 *
9147 * @hide
9148 */
9149 public static final String
9150 GLOBAL_HTTP_PROXY_EXCLUSION_LIST = "global_http_proxy_exclusion_list";
9151
9152 /**
Jason Monk602b2322013-07-03 17:04:33 -04009153 * The location PAC File for the proxy.
9154 * @hide
9155 */
9156 public static final String
9157 GLOBAL_HTTP_PROXY_PAC = "global_proxy_pac_url";
9158
9159 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07009160 * Enables the UI setting to allow the user to specify the global HTTP
9161 * proxy and associated exclusion list.
9162 *
9163 * @hide
9164 */
9165 public static final String SET_GLOBAL_HTTP_PROXY = "set_global_http_proxy";
9166
9167 /**
9168 * Setting for default DNS in case nobody suggests one
9169 *
9170 * @hide
9171 */
9172 public static final String DEFAULT_DNS_SERVER = "default_dns_server";
9173
Jeff Sharkey0ac10282012-10-01 12:50:22 -07009174 /** {@hide} */
9175 public static final String
9176 BLUETOOTH_HEADSET_PRIORITY_PREFIX = "bluetooth_headset_priority_";
9177 /** {@hide} */
9178 public static final String
9179 BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX = "bluetooth_a2dp_sink_priority_";
9180 /** {@hide} */
9181 public static final String
Sanket Agarwal1bec6a52015-10-21 18:23:27 -07009182 BLUETOOTH_A2DP_SRC_PRIORITY_PREFIX = "bluetooth_a2dp_src_priority_";
9183 /** {@hide} */
Antony Sargentf5772c62017-04-26 16:37:53 -07009184 public static final String BLUETOOTH_A2DP_SUPPORTS_OPTIONAL_CODECS_PREFIX =
9185 "bluetooth_a2dp_supports_optional_codecs_";
9186 /** {@hide} */
9187 public static final String BLUETOOTH_A2DP_OPTIONAL_CODECS_ENABLED_PREFIX =
9188 "bluetooth_a2dp_optional_codecs_enabled_";
9189 /** {@hide} */
Sanket Agarwal1bec6a52015-10-21 18:23:27 -07009190 public static final String
Jeff Sharkey0ac10282012-10-01 12:50:22 -07009191 BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX = "bluetooth_input_device_priority_";
Kim Schulz0d376052013-08-22 11:18:02 +02009192 /** {@hide} */
9193 public static final String
9194 BLUETOOTH_MAP_PRIORITY_PREFIX = "bluetooth_map_priority_";
Casper Bonde2a5f6082015-03-19 10:36:45 +01009195 /** {@hide} */
9196 public static final String
Joseph Pirozzo631768d2016-09-01 14:19:28 -07009197 BLUETOOTH_MAP_CLIENT_PRIORITY_PREFIX = "bluetooth_map_client_priority_";
9198 /** {@hide} */
9199 public static final String
Joseph Pirozzo563c7002016-03-21 15:49:48 -07009200 BLUETOOTH_PBAP_CLIENT_PRIORITY_PREFIX = "bluetooth_pbap_client_priority_";
9201 /** {@hide} */
9202 public static final String
Casper Bonde2a5f6082015-03-19 10:36:45 +01009203 BLUETOOTH_SAP_PRIORITY_PREFIX = "bluetooth_sap_priority_";
Sanket Agarwal773297a2016-08-04 16:16:20 -07009204 /** {@hide} */
9205 public static final String
9206 BLUETOOTH_PAN_PRIORITY_PREFIX = "bluetooth_pan_priority_";
Jeff Sharkey0ac10282012-10-01 12:50:22 -07009207
9208 /**
Dianne Hackborn0ef403e2017-01-24 18:22:15 -08009209 * Activity manager specific settings.
9210 * This is encoded as a key=value list, separated by commas. Ex:
9211 *
Dianne Hackborn83b40f62017-04-26 13:59:47 -07009212 * "gc_timeout=5000,max_cached_processes=24"
Dianne Hackborn0ef403e2017-01-24 18:22:15 -08009213 *
9214 * The following keys are supported:
9215 *
9216 * <pre>
Dianne Hackborn0ef403e2017-01-24 18:22:15 -08009217 * max_cached_processes (int)
Dianne Hackborn83b40f62017-04-26 13:59:47 -07009218 * background_settle_time (long)
Dianne Hackborncb015632017-06-14 17:30:15 -07009219 * fgservice_min_shown_time (long)
9220 * fgservice_min_report_time (long)
9221 * fgservice_screen_on_before_time (long)
9222 * fgservice_screen_on_after_time (long)
Dianne Hackborn83b40f62017-04-26 13:59:47 -07009223 * content_provider_retain_time (long)
9224 * gc_timeout (long)
9225 * gc_min_interval (long)
9226 * full_pss_min_interval (long)
9227 * full_pss_lowered_interval (long)
Dianne Hackbornffca58b2017-05-24 16:15:45 -07009228 * power_check_interval (long)
9229 * power_check_max_cpu_1 (int)
9230 * power_check_max_cpu_2 (int)
9231 * power_check_max_cpu_3 (int)
9232 * power_check_max_cpu_4 (int)
Dianne Hackborn83b40f62017-04-26 13:59:47 -07009233 * service_usage_interaction_time (long)
9234 * usage_stats_interaction_interval (long)
9235 * service_restart_duration (long)
9236 * service_reset_run_duration (long)
9237 * service_restart_duration_factor (int)
9238 * service_min_restart_time_between (long)
9239 * service_max_inactivity (long)
9240 * service_bg_start_timeout (long)
Dianne Hackborn0ef403e2017-01-24 18:22:15 -08009241 * </pre>
9242 *
9243 * <p>
9244 * Type: string
9245 * @hide
9246 * @see com.android.server.am.ActivityManagerConstants
9247 */
9248 public static final String ACTIVITY_MANAGER_CONSTANTS = "activity_manager_constants";
9249
9250 /**
Adam Lesinski31c05d12015-06-09 17:34:04 -07009251 * Device Idle (Doze) specific settings.
9252 * This is encoded as a key=value list, separated by commas. Ex:
9253 *
Henrik Baardeac10ab2016-04-19 07:50:24 +02009254 * "inactive_to=60000,sensing_to=400000"
Adam Lesinski31c05d12015-06-09 17:34:04 -07009255 *
9256 * The following keys are supported:
9257 *
9258 * <pre>
9259 * inactive_to (long)
9260 * sensing_to (long)
9261 * motion_inactive_to (long)
9262 * idle_after_inactive_to (long)
9263 * idle_pending_to (long)
9264 * max_idle_pending_to (long)
9265 * idle_pending_factor (float)
9266 * idle_to (long)
9267 * max_idle_to (long)
9268 * idle_factor (float)
9269 * min_time_to_alarm (long)
9270 * max_temp_app_whitelist_duration (long)
Felipe Lemea1b79bf2016-05-24 13:06:54 -07009271 * notification_whitelist_duration (long)
Adam Lesinski31c05d12015-06-09 17:34:04 -07009272 * </pre>
9273 *
9274 * <p>
9275 * Type: string
9276 * @hide
9277 * @see com.android.server.DeviceIdleController.Constants
9278 */
9279 public static final String DEVICE_IDLE_CONSTANTS = "device_idle_constants";
9280
9281 /**
Joe LaPennaf33b5bf2016-03-23 15:19:47 -07009282 * Device Idle (Doze) specific settings for watches. See {@code #DEVICE_IDLE_CONSTANTS}
9283 *
9284 * <p>
9285 * Type: string
9286 * @hide
9287 * @see com.android.server.DeviceIdleController.Constants
9288 */
9289 public static final String DEVICE_IDLE_CONSTANTS_WATCH = "device_idle_constants_watch";
9290
9291 /**
jackqdyulei455e90a2017-02-09 15:29:16 -08009292 * Battery Saver specific settings
9293 * This is encoded as a key=value list, separated by commas. Ex:
9294 *
9295 * "vibration_disabled=true,adjust_brightness_factor=0.5"
9296 *
9297 * The following keys are supported:
9298 *
9299 * <pre>
9300 * vibration_disabled (boolean)
9301 * animation_disabled (boolean)
9302 * soundtrigger_disabled (boolean)
9303 * fullbackup_deferred (boolean)
9304 * keyvaluebackup_deferred (boolean)
9305 * firewall_disabled (boolean)
9306 * gps_mode (int)
9307 * adjust_brightness_disabled (boolean)
9308 * adjust_brightness_factor (float)
9309 * </pre>
9310 * @hide
9311 * @see com.android.server.power.BatterySaverPolicy
9312 */
9313 public static final String BATTERY_SAVER_CONSTANTS = "battery_saver_constants";
9314
9315 /**
jackqdyulei7a5e06f2017-05-12 16:00:53 -07009316 * Battery anomaly detection specific settings
9317 * This is encoded as a key=value list, separated by commas. Ex:
9318 *
9319 * "anomaly_detection_enabled=true,wakelock_threshold=2000"
9320 *
9321 * The following keys are supported:
9322 *
9323 * <pre>
9324 * anomaly_detection_enabled (boolean)
9325 * wakelock_enabled (boolean)
9326 * wakelock_threshold (long)
9327 * </pre>
9328 * @hide
9329 */
9330 public static final String ANOMALY_DETECTION_CONSTANTS = "anomaly_detection_constants";
9331
9332 /**
Adam Lesinskia6232df2015-06-11 18:16:41 -07009333 * App standby (app idle) specific settings.
9334 * This is encoded as a key=value list, separated by commas. Ex:
9335 *
9336 * "idle_duration=5000,parole_interval=4500"
9337 *
9338 * The following keys are supported:
9339 *
9340 * <pre>
Adam Lesinskif0ef3c12016-01-13 12:26:07 -08009341 * idle_duration2 (long)
Adam Lesinskia6232df2015-06-11 18:16:41 -07009342 * wallclock_threshold (long)
9343 * parole_interval (long)
9344 * parole_duration (long)
Adam Lesinskif0ef3c12016-01-13 12:26:07 -08009345 *
9346 * idle_duration (long) // This is deprecated and used to circumvent b/26355386.
Adam Lesinskia6232df2015-06-11 18:16:41 -07009347 * </pre>
9348 *
9349 * <p>
9350 * Type: string
9351 * @hide
9352 * @see com.android.server.usage.UsageStatsService.SettingsObserver
9353 */
9354 public static final String APP_IDLE_CONSTANTS = "app_idle_constants";
9355
9356 /**
Dianne Hackborn0ef403e2017-01-24 18:22:15 -08009357 * Power manager specific settings.
9358 * This is encoded as a key=value list, separated by commas. Ex:
9359 *
9360 * "no_cached_wake_locks=1"
9361 *
9362 * The following keys are supported:
9363 *
9364 * <pre>
9365 * no_cached_wake_locks (boolean)
9366 * </pre>
9367 *
9368 * <p>
9369 * Type: string
9370 * @hide
9371 * @see com.android.server.power.PowerManagerConstants
9372 */
9373 public static final String POWER_MANAGER_CONSTANTS = "power_manager_constants";
9374
9375 /**
Dianne Hackborna750a632015-06-16 17:18:23 -07009376 * Alarm manager specific settings.
9377 * This is encoded as a key=value list, separated by commas. Ex:
9378 *
9379 * "min_futurity=5000,allow_while_idle_short_time=4500"
9380 *
9381 * The following keys are supported:
9382 *
9383 * <pre>
9384 * min_futurity (long)
9385 * min_interval (long)
9386 * allow_while_idle_short_time (long)
9387 * allow_while_idle_long_time (long)
9388 * allow_while_idle_whitelist_duration (long)
9389 * </pre>
9390 *
9391 * <p>
9392 * Type: string
9393 * @hide
9394 * @see com.android.server.AlarmManagerService.Constants
9395 */
9396 public static final String ALARM_MANAGER_CONSTANTS = "alarm_manager_constants";
9397
9398 /**
Dianne Hackborne9a988c2016-05-27 17:59:40 -07009399 * Job scheduler specific settings.
9400 * This is encoded as a key=value list, separated by commas. Ex:
9401 *
9402 * "min_ready_jobs_count=2,moderate_use_factor=.5"
9403 *
9404 * The following keys are supported:
9405 *
9406 * <pre>
9407 * min_idle_count (int)
9408 * min_charging_count (int)
9409 * min_connectivity_count (int)
9410 * min_content_count (int)
9411 * min_ready_jobs_count (int)
9412 * heavy_use_factor (float)
9413 * moderate_use_factor (float)
9414 * fg_job_count (int)
9415 * bg_normal_job_count (int)
9416 * bg_moderate_job_count (int)
9417 * bg_low_job_count (int)
9418 * bg_critical_job_count (int)
9419 * </pre>
9420 *
9421 * <p>
9422 * Type: string
9423 * @hide
9424 * @see com.android.server.job.JobSchedulerService.Constants
9425 */
9426 public static final String JOB_SCHEDULER_CONSTANTS = "job_scheduler_constants";
9427
9428 /**
Makoto Onuki4362a662016-03-08 18:59:09 -08009429 * ShortcutManager specific settings.
9430 * This is encoded as a key=value list, separated by commas. Ex:
9431 *
Makoto Onukib6d35232016-04-04 15:57:17 -07009432 * "reset_interval_sec=86400,max_updates_per_interval=1"
Makoto Onuki4362a662016-03-08 18:59:09 -08009433 *
9434 * The following keys are supported:
9435 *
9436 * <pre>
9437 * reset_interval_sec (long)
Makoto Onukib6d35232016-04-04 15:57:17 -07009438 * max_updates_per_interval (int)
Makoto Onuki4362a662016-03-08 18:59:09 -08009439 * max_icon_dimension_dp (int, DP)
9440 * max_icon_dimension_dp_lowram (int, DP)
9441 * max_shortcuts (int)
9442 * icon_quality (int, 0-100)
9443 * icon_format (String)
9444 * </pre>
9445 *
9446 * <p>
9447 * Type: string
9448 * @hide
9449 * @see com.android.server.pm.ShortcutService.ConfigConstants
9450 */
9451 public static final String SHORTCUT_MANAGER_CONSTANTS = "shortcut_manager_constants";
9452
9453 /**
Makoto Onuki09c529a2017-05-01 10:05:28 -07009454 * DevicePolicyManager specific settings.
9455 * This is encoded as a key=value list, separated by commas. Ex:
9456 *
9457 * <pre>
9458 * das_died_service_reconnect_backoff_sec (long)
9459 * das_died_service_reconnect_backoff_increase (float)
9460 * das_died_service_reconnect_max_backoff_sec (long)
9461 * </pre>
9462 *
9463 * <p>
9464 * Type: string
9465 * @hide
9466 * see also com.android.server.devicepolicy.DevicePolicyConstants
9467 */
9468 public static final String DEVICE_POLICY_CONSTANTS = "device_policy_constants";
9469
9470 /**
Jeff Sharkey0ac10282012-10-01 12:50:22 -07009471 * Get the key that retrieves a bluetooth headset's priority.
9472 * @hide
9473 */
9474 public static final String getBluetoothHeadsetPriorityKey(String address) {
Elliott Hughescb64d432013-08-02 10:00:44 -07009475 return BLUETOOTH_HEADSET_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
Jeff Sharkey0ac10282012-10-01 12:50:22 -07009476 }
9477
9478 /**
9479 * Get the key that retrieves a bluetooth a2dp sink's priority.
9480 * @hide
9481 */
9482 public static final String getBluetoothA2dpSinkPriorityKey(String address) {
Elliott Hughescb64d432013-08-02 10:00:44 -07009483 return BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
Jeff Sharkey0ac10282012-10-01 12:50:22 -07009484 }
9485
9486 /**
Sanket Agarwal1bec6a52015-10-21 18:23:27 -07009487 * Get the key that retrieves a bluetooth a2dp src's priority.
9488 * @hide
9489 */
9490 public static final String getBluetoothA2dpSrcPriorityKey(String address) {
9491 return BLUETOOTH_A2DP_SRC_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
9492 }
9493
9494 /**
Antony Sargentf5772c62017-04-26 16:37:53 -07009495 * Get the key that retrieves a bluetooth a2dp device's ability to support optional codecs.
9496 * @hide
9497 */
9498 public static final String getBluetoothA2dpSupportsOptionalCodecsKey(String address) {
9499 return BLUETOOTH_A2DP_SUPPORTS_OPTIONAL_CODECS_PREFIX +
9500 address.toUpperCase(Locale.ROOT);
9501 }
9502
9503 /**
9504 * Get the key that retrieves whether a bluetooth a2dp device should have optional codecs
9505 * enabled.
9506 * @hide
9507 */
9508 public static final String getBluetoothA2dpOptionalCodecsEnabledKey(String address) {
9509 return BLUETOOTH_A2DP_OPTIONAL_CODECS_ENABLED_PREFIX +
9510 address.toUpperCase(Locale.ROOT);
9511 }
9512
9513 /**
Jeff Sharkey0ac10282012-10-01 12:50:22 -07009514 * Get the key that retrieves a bluetooth Input Device's priority.
9515 * @hide
9516 */
9517 public static final String getBluetoothInputDevicePriorityKey(String address) {
Elliott Hughescb64d432013-08-02 10:00:44 -07009518 return BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
Jeff Sharkey0ac10282012-10-01 12:50:22 -07009519 }
9520
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07009521 /**
Sanket Agarwal773297a2016-08-04 16:16:20 -07009522 * Get the key that retrieves a bluetooth pan client priority.
9523 * @hide
9524 */
9525 public static final String getBluetoothPanPriorityKey(String address) {
9526 return BLUETOOTH_PAN_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
9527 }
9528
9529 /**
Kim Schulz0d376052013-08-22 11:18:02 +02009530 * Get the key that retrieves a bluetooth map priority.
9531 * @hide
9532 */
9533 public static final String getBluetoothMapPriorityKey(String address) {
9534 return BLUETOOTH_MAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
9535 }
Casper Bonde2a5f6082015-03-19 10:36:45 +01009536
9537 /**
Joseph Pirozzo631768d2016-09-01 14:19:28 -07009538 * Get the key that retrieves a bluetooth map client priority.
9539 * @hide
9540 */
9541 public static final String getBluetoothMapClientPriorityKey(String address) {
9542 return BLUETOOTH_MAP_CLIENT_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
9543 }
9544
9545 /**
Joseph Pirozzo563c7002016-03-21 15:49:48 -07009546 * Get the key that retrieves a bluetooth pbap client priority.
9547 * @hide
9548 */
9549 public static final String getBluetoothPbapClientPriorityKey(String address) {
9550 return BLUETOOTH_PBAP_CLIENT_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
9551 }
9552
9553 /**
Joseph Pirozzo631768d2016-09-01 14:19:28 -07009554 * Get the key that retrieves a bluetooth sap priority.
Casper Bonde2a5f6082015-03-19 10:36:45 +01009555 * @hide
9556 */
9557 public static final String getBluetoothSapPriorityKey(String address) {
9558 return BLUETOOTH_SAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
9559 }
9560
Kim Schulz0d376052013-08-22 11:18:02 +02009561 /**
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07009562 * Scaling factor for normal window animations. Setting to 0 will
9563 * disable window animations.
9564 */
9565 public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale";
9566
9567 /**
9568 * Scaling factor for activity transition animations. Setting to 0 will
9569 * disable window animations.
9570 */
9571 public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale";
9572
9573 /**
9574 * Scaling factor for Animator-based animations. This affects both the
9575 * start delay and duration of all such animations. Setting to 0 will
9576 * cause animations to end immediately. The default value is 1.
9577 */
9578 public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale";
9579
9580 /**
9581 * Scaling factor for normal window animations. Setting to 0 will
9582 * disable window animations.
9583 *
9584 * @hide
9585 */
9586 public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations";
9587
9588 /**
9589 * If 0, the compatibility mode is off for all applications.
9590 * If 1, older applications run under compatibility mode.
9591 * TODO: remove this settings before code freeze (bug/1907571)
9592 * @hide
9593 */
9594 public static final String COMPATIBILITY_MODE = "compatibility_mode";
9595
9596 /**
9597 * CDMA only settings
9598 * Emergency Tone 0 = Off
9599 * 1 = Alert
9600 * 2 = Vibrate
9601 * @hide
9602 */
9603 public static final String EMERGENCY_TONE = "emergency_tone";
9604
9605 /**
9606 * CDMA only settings
9607 * Whether the auto retry is enabled. The value is
9608 * boolean (1 or 0).
9609 * @hide
9610 */
9611 public static final String CALL_AUTO_RETRY = "call_auto_retry";
9612
9613 /**
Selim Cinek705442f2016-09-13 16:02:33 -07009614 * A setting that can be read whether the emergency affordance is currently needed.
9615 * The value is a boolean (1 or 0).
9616 * @hide
9617 */
9618 public static final String EMERGENCY_AFFORDANCE_NEEDED = "emergency_affordance_needed";
9619
9620 /**
Sungmin Choie099ab12014-06-09 14:45:51 +09009621 * See RIL_PreferredNetworkType in ril.h
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07009622 * @hide
9623 */
9624 public static final String PREFERRED_NETWORK_MODE =
9625 "preferred_network_mode";
9626
9627 /**
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07009628 * Name of an application package to be debugged.
9629 */
9630 public static final String DEBUG_APP = "debug_app";
9631
9632 /**
9633 * If 1, when launching DEBUG_APP it will wait for the debugger before
9634 * starting user code. If 0, it will run normally.
9635 */
9636 public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger";
9637
9638 /**
9639 * Control whether the process CPU usage meter should be shown.
Nick Kralevichfc4a5c22016-10-11 09:01:38 -07009640 *
9641 * @deprecated This functionality is no longer available as of
9642 * {@link android.os.Build.VERSION_CODES#N_MR1}.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07009643 */
Nick Kralevichfc4a5c22016-10-11 09:01:38 -07009644 @Deprecated
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07009645 public static final String SHOW_PROCESSES = "show_processes";
9646
9647 /**
Ruchi Kandoi62b8a492014-04-17 18:01:40 -07009648 * If 1 low power mode is enabled.
9649 * @hide
9650 */
9651 public static final String LOW_POWER_MODE = "low_power";
9652
John Spurlockf8f524c2014-06-10 14:47:29 -04009653 /**
9654 * Battery level [1-99] at which low power mode automatically turns on.
Dianne Hackborn14272302014-06-10 23:13:02 -07009655 * If 0, it will not automatically turn on.
John Spurlockf8f524c2014-06-10 14:47:29 -04009656 * @hide
9657 */
9658 public static final String LOW_POWER_MODE_TRIGGER_LEVEL = "low_power_trigger_level";
9659
Ruchi Kandoi62b8a492014-04-17 18:01:40 -07009660 /**
Dianne Hackbornb2117d12016-02-16 18:26:35 -08009661 * If not 0, the activity manager will aggressively finish activities and
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07009662 * processes as soon as they are no longer needed. If 0, the normal
9663 * extended lifetime is used.
9664 */
Dianne Hackborn89ad4562014-08-24 16:45:38 -07009665 public static final String ALWAYS_FINISH_ACTIVITIES = "always_finish_activities";
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07009666
Christopher Tate66488d62012-10-02 11:58:01 -07009667 /**
Eric Laurent7ee1e4f2012-10-26 18:11:21 -07009668 * Use Dock audio output for media:
9669 * 0 = disabled
9670 * 1 = enabled
9671 * @hide
9672 */
9673 public static final String DOCK_AUDIO_MEDIA_ENABLED = "dock_audio_media_enabled";
9674
9675 /**
Phil Burkdeaa8d92016-02-23 17:12:04 -08009676 * The surround sound formats AC3, DTS or IEC61937 are
9677 * available for use if they are detected.
9678 * This is the default mode.
9679 *
9680 * Note that AUTO is equivalent to ALWAYS for Android TVs and other
9681 * devices that have an S/PDIF output. This is because S/PDIF
9682 * is unidirectional and the TV cannot know if a decoder is
9683 * connected. So it assumes they are always available.
9684 * @hide
9685 */
9686 public static final int ENCODED_SURROUND_OUTPUT_AUTO = 0;
9687
9688 /**
9689 * AC3, DTS or IEC61937 are NEVER available, even if they
9690 * are detected by the hardware. Those formats will not be
9691 * reported.
9692 *
9693 * An example use case would be an AVR reports that it is capable of
9694 * surround sound decoding but is broken. If NEVER is chosen
9695 * then apps must use PCM output instead of encoded output.
9696 * @hide
9697 */
9698 public static final int ENCODED_SURROUND_OUTPUT_NEVER = 1;
9699
9700 /**
9701 * AC3, DTS or IEC61937 are ALWAYS available, even if they
9702 * are not detected by the hardware. Those formats will be
9703 * reported as part of the HDMI output capability. Applications
9704 * are then free to use either PCM or encoded output.
9705 *
9706 * An example use case would be a when TV was connected over
9707 * TOS-link to an AVR. But the TV could not see it because TOS-link
9708 * is unidirectional.
9709 * @hide
9710 */
9711 public static final int ENCODED_SURROUND_OUTPUT_ALWAYS = 2;
9712
9713 /**
9714 * Set to ENCODED_SURROUND_OUTPUT_AUTO,
9715 * ENCODED_SURROUND_OUTPUT_NEVER or
9716 * ENCODED_SURROUND_OUTPUT_ALWAYS
9717 * @hide
9718 */
9719 public static final String ENCODED_SURROUND_OUTPUT = "encoded_surround_output";
9720
9721 /**
Eric Laurent05274f32012-11-29 12:48:18 -08009722 * Persisted safe headphone volume management state by AudioService
9723 * @hide
9724 */
9725 public static final String AUDIO_SAFE_VOLUME_STATE = "audio_safe_volume_state";
9726
9727 /**
Geremy Condraa0735112013-03-26 21:49:26 -07009728 * URL for tzinfo (time zone) updates
9729 * @hide
9730 */
9731 public static final String TZINFO_UPDATE_CONTENT_URL = "tzinfo_content_url";
9732
9733 /**
9734 * URL for tzinfo (time zone) update metadata
9735 * @hide
9736 */
9737 public static final String TZINFO_UPDATE_METADATA_URL = "tzinfo_metadata_url";
9738
9739 /**
9740 * URL for selinux (mandatory access control) updates
9741 * @hide
9742 */
9743 public static final String SELINUX_UPDATE_CONTENT_URL = "selinux_content_url";
9744
9745 /**
9746 * URL for selinux (mandatory access control) update metadata
9747 * @hide
9748 */
9749 public static final String SELINUX_UPDATE_METADATA_URL = "selinux_metadata_url";
9750
9751 /**
9752 * URL for sms short code updates
9753 * @hide
9754 */
9755 public static final String SMS_SHORT_CODES_UPDATE_CONTENT_URL =
9756 "sms_short_codes_content_url";
9757
9758 /**
9759 * URL for sms short code update metadata
9760 * @hide
9761 */
9762 public static final String SMS_SHORT_CODES_UPDATE_METADATA_URL =
9763 "sms_short_codes_metadata_url";
9764
9765 /**
Amit Mahajan9069fab2015-05-01 11:05:47 -07009766 * URL for apn_db updates
9767 * @hide
9768 */
9769 public static final String APN_DB_UPDATE_CONTENT_URL = "apn_db_content_url";
9770
9771 /**
9772 * URL for apn_db update metadata
9773 * @hide
9774 */
9775 public static final String APN_DB_UPDATE_METADATA_URL = "apn_db_metadata_url";
9776
9777 /**
Geremy Condraa0735112013-03-26 21:49:26 -07009778 * URL for cert pinlist updates
9779 * @hide
9780 */
9781 public static final String CERT_PIN_UPDATE_CONTENT_URL = "cert_pin_content_url";
9782
9783 /**
9784 * URL for cert pinlist updates
9785 * @hide
9786 */
9787 public static final String CERT_PIN_UPDATE_METADATA_URL = "cert_pin_metadata_url";
9788
Geremy Condra757ee522013-03-29 16:39:45 -07009789 /**
Ben Gruver633dc9b2013-04-04 12:05:49 -07009790 * URL for intent firewall updates
9791 * @hide
9792 */
9793 public static final String INTENT_FIREWALL_UPDATE_CONTENT_URL =
9794 "intent_firewall_content_url";
9795
9796 /**
9797 * URL for intent firewall update metadata
9798 * @hide
9799 */
9800 public static final String INTENT_FIREWALL_UPDATE_METADATA_URL =
9801 "intent_firewall_metadata_url";
9802
9803 /**
Abodunrinwa Toki51c42032017-04-02 19:16:01 +01009804 * URL for lang id model updates
9805 * @hide
9806 */
9807 public static final String LANG_ID_UPDATE_CONTENT_URL = "lang_id_content_url";
9808
9809 /**
9810 * URL for lang id model update metadata
9811 * @hide
9812 */
9813 public static final String LANG_ID_UPDATE_METADATA_URL = "lang_id_metadata_url";
9814
9815 /**
Abodunrinwa Tokibb957d12017-04-12 14:40:46 +01009816 * URL for smart selection model updates
9817 * @hide
9818 */
9819 public static final String SMART_SELECTION_UPDATE_CONTENT_URL =
9820 "smart_selection_content_url";
9821
9822 /**
9823 * URL for smart selection model update metadata
9824 * @hide
9825 */
9826 public static final String SMART_SELECTION_UPDATE_METADATA_URL =
9827 "smart_selection_metadata_url";
9828
9829 /**
Geremy Condra4e7f7e82013-03-26 21:09:01 -07009830 * SELinux enforcement status. If 0, permissive; if 1, enforcing.
9831 * @hide
9832 */
9833 public static final String SELINUX_STATUS = "selinux_status";
9834
Geremy Condraa0735112013-03-26 21:49:26 -07009835 /**
Amith Yamasanid8415f42013-08-07 20:15:10 -07009836 * Developer setting to force RTL layout.
9837 * @hide
9838 */
9839 public static final String DEVELOPMENT_FORCE_RTL = "debug.force_rtl";
9840
9841 /**
Daniel Sandlerdea64622013-09-23 16:05:57 -04009842 * Milliseconds after screen-off after which low battery sounds will be silenced.
9843 *
9844 * If zero, battery sounds will always play.
9845 * Defaults to @integer/def_low_battery_sound_timeout in SettingsProvider.
9846 *
9847 * @hide
9848 */
9849 public static final String LOW_BATTERY_SOUND_TIMEOUT = "low_battery_sound_timeout";
9850
9851 /**
Evan Charltoncc7b0432014-01-14 14:47:11 -08009852 * Milliseconds to wait before bouncing Wi-Fi after settings is restored. Note that after
Dianne Hackborna3fb40d2014-08-12 15:06:50 -07009853 * the caller is done with this, they should call {@link ContentResolver#delete} to
Evan Charltoncc7b0432014-01-14 14:47:11 -08009854 * clean up any value that they may have written.
9855 *
9856 * @hide
9857 */
9858 public static final String WIFI_BOUNCE_DELAY_OVERRIDE_MS = "wifi_bounce_delay_override_ms";
9859
John Spurlockc6d1c602014-01-17 15:22:06 -05009860 /**
9861 * Defines global runtime overrides to window policy.
9862 *
Jorim Jaggib10e33f2015-02-04 21:57:40 +01009863 * See {@link com.android.server.policy.PolicyControl} for value format.
John Spurlockc6d1c602014-01-17 15:22:06 -05009864 *
9865 * @hide
9866 */
9867 public static final String POLICY_CONTROL = "policy_control";
Evan Charltoncc7b0432014-01-14 14:47:11 -08009868
9869 /**
John Spurlockae641c92014-06-30 18:11:40 -04009870 * Defines global zen mode. ZEN_MODE_OFF, ZEN_MODE_IMPORTANT_INTERRUPTIONS,
9871 * or ZEN_MODE_NO_INTERRUPTIONS.
John Spurlocke677d712014-02-13 12:52:19 -05009872 *
9873 * @hide
9874 */
9875 public static final String ZEN_MODE = "zen_mode";
9876
9877 /** @hide */ public static final int ZEN_MODE_OFF = 0;
John Spurlockae641c92014-06-30 18:11:40 -04009878 /** @hide */ public static final int ZEN_MODE_IMPORTANT_INTERRUPTIONS = 1;
9879 /** @hide */ public static final int ZEN_MODE_NO_INTERRUPTIONS = 2;
John Spurlock4f1163c2015-04-02 17:41:21 -04009880 /** @hide */ public static final int ZEN_MODE_ALARMS = 3;
John Spurlocke677d712014-02-13 12:52:19 -05009881
9882 /** @hide */ public static String zenModeToString(int mode) {
John Spurlockae641c92014-06-30 18:11:40 -04009883 if (mode == ZEN_MODE_IMPORTANT_INTERRUPTIONS) return "ZEN_MODE_IMPORTANT_INTERRUPTIONS";
John Spurlock4f1163c2015-04-02 17:41:21 -04009884 if (mode == ZEN_MODE_ALARMS) return "ZEN_MODE_ALARMS";
John Spurlockae641c92014-06-30 18:11:40 -04009885 if (mode == ZEN_MODE_NO_INTERRUPTIONS) return "ZEN_MODE_NO_INTERRUPTIONS";
9886 return "ZEN_MODE_OFF";
John Spurlocke677d712014-02-13 12:52:19 -05009887 }
9888
John Spurlockb2278d62015-04-07 12:47:12 -04009889 /** @hide */ public static boolean isValidZenMode(int value) {
9890 switch (value) {
9891 case Global.ZEN_MODE_OFF:
9892 case Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS:
9893 case Global.ZEN_MODE_ALARMS:
9894 case Global.ZEN_MODE_NO_INTERRUPTIONS:
9895 return true;
9896 default:
9897 return false;
9898 }
9899 }
9900
John Spurlocke677d712014-02-13 12:52:19 -05009901 /**
Julia Reynolds9b11fdb2015-07-31 09:49:55 -04009902 * Value of the ringer before entering zen mode.
9903 *
9904 * @hide
9905 */
9906 public static final String ZEN_MODE_RINGER_LEVEL = "zen_mode_ringer_level";
9907
9908 /**
John Spurlock056c5192014-04-20 21:52:01 -04009909 * Opaque value, changes when persisted zen mode configuration changes.
9910 *
9911 * @hide
9912 */
9913 public static final String ZEN_MODE_CONFIG_ETAG = "zen_mode_config_etag";
9914
9915 /**
Chris Wren7bd241232014-02-28 16:25:05 -05009916 * Defines global heads up toggle. One of HEADS_UP_OFF, HEADS_UP_ON.
9917 *
9918 * @hide
9919 */
Chris Wren10d82df2014-03-01 10:34:51 -05009920 public static final String HEADS_UP_NOTIFICATIONS_ENABLED =
9921 "heads_up_notifications_enabled";
Chris Wren7bd241232014-02-28 16:25:05 -05009922
9923 /** @hide */ public static final int HEADS_UP_OFF = 0;
9924 /** @hide */ public static final int HEADS_UP_ON = 1;
9925
9926 /**
Jerome Poichet147b4d72014-05-12 18:13:27 -07009927 * The name of the device
Jerome Poichet147b4d72014-05-12 18:13:27 -07009928 */
9929 public static final String DEVICE_NAME = "device_name";
9930
9931 /**
Jeff Davidson56f9f732014-08-14 16:47:23 -07009932 * Whether the NetworkScoringService has been first initialized.
9933 * <p>
9934 * Type: int (0 for false, 1 for true)
9935 * @hide
9936 */
9937 public static final String NETWORK_SCORING_PROVISIONED = "network_scoring_provisioned";
9938
9939 /**
Jim Miller6848dc82014-10-13 18:51:53 -07009940 * Whether the user wants to be prompted for password to decrypt the device on boot.
9941 * This only matters if the storage is encrypted.
9942 * <p>
9943 * Type: int (0 for false, 1 for true)
9944 * @hide
9945 */
9946 public static final String REQUIRE_PASSWORD_TO_DECRYPT = "require_password_to_decrypt";
9947
9948 /**
Etan Cohen93bbf272015-05-04 18:01:47 -07009949 * Whether the Volte is enabled
Libin.Tang@motorola.com0499bb52014-10-10 14:55:57 -05009950 * <p>
9951 * Type: int (0 for false, 1 for true)
9952 * @hide
9953 */
Etan Cohene41a9cf2014-10-22 10:50:46 -07009954 public static final String ENHANCED_4G_MODE_ENABLED = "volte_vt_enabled";
Libin.Tang@motorola.com0499bb52014-10-10 14:55:57 -05009955
9956 /**
Etan Cohen93bbf272015-05-04 18:01:47 -07009957 * Whether VT (Video Telephony over IMS) is enabled
9958 * <p>
9959 * Type: int (0 for false, 1 for true)
9960 *
9961 * @hide
9962 */
9963 public static final String VT_IMS_ENABLED = "vt_ims_enabled";
9964
9965 /**
Etan Cohen9c8f21b2014-12-23 15:02:19 -08009966 * Whether WFC is enabled
9967 * <p>
9968 * Type: int (0 for false, 1 for true)
9969 *
9970 * @hide
9971 */
9972 public static final String WFC_IMS_ENABLED = "wfc_ims_enabled";
9973
9974 /**
Meng Wang2c25e4a2016-09-19 14:18:05 -07009975 * WFC mode on home/non-roaming network.
Etan Cohen9c8f21b2014-12-23 15:02:19 -08009976 * <p>
9977 * Type: int - 2=Wi-Fi preferred, 1=Cellular preferred, 0=Wi-Fi only
9978 *
9979 * @hide
9980 */
9981 public static final String WFC_IMS_MODE = "wfc_ims_mode";
9982
9983 /**
Meng Wang2c25e4a2016-09-19 14:18:05 -07009984 * WFC mode on roaming network.
9985 * <p>
Dianne Hackborn0ef403e2017-01-24 18:22:15 -08009986 * Type: int - see {@link #WFC_IMS_MODE} for values
Meng Wang2c25e4a2016-09-19 14:18:05 -07009987 *
9988 * @hide
9989 */
9990 public static final String WFC_IMS_ROAMING_MODE = "wfc_ims_roaming_mode";
9991
9992 /**
Etan Cohen9c8f21b2014-12-23 15:02:19 -08009993 * Whether WFC roaming is enabled
9994 * <p>
9995 * Type: int (0 for false, 1 for true)
9996 *
9997 * @hide
9998 */
9999 public static final String WFC_IMS_ROAMING_ENABLED = "wfc_ims_roaming_enabled";
10000
10001 /**
Amit Mahajan4fea0922014-11-18 12:56:28 -080010002 * Whether user can enable/disable LTE as a preferred network. A carrier might control
10003 * this via gservices, OMA-DM, carrier app, etc.
10004 * <p>
10005 * Type: int (0 for false, 1 for true)
10006 * @hide
10007 */
10008 public static final String LTE_SERVICE_FORCED = "lte_service_forced";
10009
10010 /**
Svet Ganov2acf0632015-11-24 19:10:59 -080010011 * Ephemeral app cookie max size in bytes.
10012 * <p>
10013 * Type: int
10014 * @hide
10015 */
10016 public static final String EPHEMERAL_COOKIE_MAX_SIZE_BYTES =
10017 "ephemeral_cookie_max_size_bytes";
10018
10019 /**
Todd Kennedyd15bb752016-09-13 16:38:31 -070010020 * Toggle to enable/disable the entire ephemeral feature. By default, ephemeral is
10021 * enabled. Set to zero to disable.
10022 * <p>
10023 * Type: int (0 for false, 1 for true)
10024 *
10025 * @hide
10026 */
10027 public static final String ENABLE_EPHEMERAL_FEATURE = "enable_ephemeral_feature";
10028
10029 /**
Todd Kennedy133c5da2017-06-15 09:44:34 -070010030 * Toggle to enable/disable dexopt for instant applications. The default is for dexopt
10031 * to be disabled.
10032 * <p>
10033 * Type: int (0 to disable, 1 to enable)
10034 *
10035 * @hide
10036 */
10037 public static final String INSTANT_APP_DEXOPT_ENABLED = "instant_app_dexopt_enabled";
10038
10039 /**
Svet Ganovf36d53c2017-05-24 00:27:21 -070010040 * The min period for caching installed instant apps in milliseconds.
Svet Ganov2acf0632015-11-24 19:10:59 -080010041 * <p>
10042 * Type: long
10043 * @hide
10044 */
Svet Ganovf36d53c2017-05-24 00:27:21 -070010045 public static final String INSTALLED_INSTANT_APP_MIN_CACHE_PERIOD =
10046 "installed_instant_app_min_cache_period";
10047
10048 /**
10049 * The max period for caching installed instant apps in milliseconds.
10050 * <p>
10051 * Type: long
10052 * @hide
10053 */
10054 public static final String INSTALLED_INSTANT_APP_MAX_CACHE_PERIOD =
10055 "installed_instant_app_max_cache_period";
10056
10057 /**
10058 * The min period for caching uninstalled instant apps in milliseconds.
10059 * <p>
10060 * Type: long
10061 * @hide
10062 */
10063 public static final String UNINSTALLED_INSTANT_APP_MIN_CACHE_PERIOD =
10064 "uninstalled_instant_app_min_cache_period";
10065
10066 /**
10067 * The max period for caching uninstalled instant apps in milliseconds.
10068 * <p>
10069 * Type: long
10070 * @hide
10071 */
10072 public static final String UNINSTALLED_INSTANT_APP_MAX_CACHE_PERIOD =
10073 "uninstalled_instant_app_max_cache_period";
10074
10075 /**
10076 * The min period for caching unused static shared libs in milliseconds.
10077 * <p>
10078 * Type: long
10079 * @hide
10080 */
10081 public static final String UNUSED_STATIC_SHARED_LIB_MIN_CACHE_PERIOD =
10082 "unused_static_shared_lib_min_cache_period";
Svet Ganov2acf0632015-11-24 19:10:59 -080010083
10084 /**
Fyodor Kupolov07140f72016-02-17 10:46:11 -080010085 * Allows switching users when system user is locked.
10086 * <p>
10087 * Type: int
10088 * @hide
10089 */
10090 public static final String ALLOW_USER_SWITCHING_WHEN_SYSTEM_USER_LOCKED =
10091 "allow_user_switching_when_system_user_locked";
10092
10093 /**
Daichi Hirono82ab9802016-03-02 13:23:29 +090010094 * Boot count since the device starts running APK level 24.
10095 * <p>
10096 * Type: int
10097 */
10098 public static final String BOOT_COUNT = "boot_count";
10099
10100 /**
Lenka Trochtova6474f0e2016-03-24 16:43:10 +010010101 * Whether the safe boot is disallowed.
10102 *
10103 * <p>This setting should have the identical value as the corresponding user restriction.
10104 * The purpose of the setting is to make the restriction available in early boot stages
10105 * before the user restrictions are loaded.
10106 * @hide
10107 */
10108 public static final String SAFE_BOOT_DISALLOWED = "safe_boot_disallowed";
10109
10110 /**
Amith Yamasanieb437d42016-04-29 09:31:25 -070010111 * Whether this device is currently in retail demo mode. If true, device
10112 * usage is severely limited.
10113 * <p>
10114 * Type: int (0 for false, 1 for true)
10115 * @hide
10116 */
10117 public static final String DEVICE_DEMO_MODE = "device_demo_mode";
10118
10119 /**
Sudheer Shanka5918c672017-03-21 19:31:37 -070010120 * Indicates the maximum time that an app is blocked for the network rules to get updated.
10121 *
10122 * Type: long
10123 *
10124 * @hide
10125 */
10126 public static final String NETWORK_ACCESS_TIMEOUT_MS = "network_access_timeout_ms";
10127
10128 /**
Svetoslav Ganov264c7a92016-08-24 17:31:14 -070010129 * The reason for the settings database being downgraded. This is only for
10130 * troubleshooting purposes and its value should not be interpreted in any way.
10131 *
10132 * Type: string
10133 *
10134 * @hide
10135 */
10136 public static final String DATABASE_DOWNGRADE_REASON = "database_downgrade_reason";
10137
10138 /**
Amith Yamasani39452022017-03-21 15:23:47 -070010139 * The build id of when the settings database was first created (or re-created due it
10140 * being missing).
10141 *
10142 * Type: string
10143 *
10144 * @hide
10145 */
10146 public static final String DATABASE_CREATION_BUILDID = "database_creation_buildid";
10147
10148 /**
Suprabh Shukla502fd882016-09-30 15:06:00 -070010149 * Flag to toggle journal mode WAL on or off for the contacts database. WAL is enabled by
10150 * default. Set to 0 to disable.
10151 *
10152 * @hide
10153 */
10154 public static final String CONTACTS_DATABASE_WAL_ENABLED = "contacts_database_wal_enabled";
10155
10156 /**
songchenxi825f69a2017-01-19 14:18:41 -080010157 * Flag to enable the link to location permissions in location setting. Set to 0 to disable.
10158 *
10159 * @hide
10160 */
10161 public static final String LOCATION_SETTINGS_LINK_TO_PERMISSIONS_ENABLED =
10162 "location_settings_link_to_permissions_enabled";
10163
10164 /**
Artem Iglikov50219182017-04-05 15:27:54 +010010165 * Flag to enable use of RefactoredBackupManagerService.
10166 *
10167 * @hide
10168 */
10169 public static final String BACKUP_REFACTORED_SERVICE_DISABLED =
10170 "backup_refactored_service_disabled";
10171
10172 /**
qingxi0ca328f2017-05-19 15:20:03 -070010173 * Flag to set the waiting time for euicc factory reset inside System > Settings
10174 * Type: long
10175 *
10176 * @hide
10177 */
qingxi2f231512017-06-23 15:32:53 -070010178 public static final String EUICC_FACTORY_RESET_TIMEOUT_MILLIS =
10179 "euicc_factory_reset_timeout_millis";
qingxi0ca328f2017-05-19 15:20:03 -070010180
10181 /**
Christopher Tate66488d62012-10-02 11:58:01 -070010182 * Settings to backup. This is here so that it's in the same place as the settings
10183 * keys and easy to update.
10184 *
10185 * These keys may be mentioned in the SETTINGS_TO_BACKUP arrays in System
10186 * and Secure as well. This is because those tables drive both backup and
10187 * restore, and restore needs to properly whitelist keys that used to live
10188 * in those namespaces. The keys will only actually be backed up / restored
10189 * if they are also mentioned in this table (Global.SETTINGS_TO_BACKUP).
10190 *
10191 * NOTE: Settings are backed up and restored in the order they appear
10192 * in this array. If you have one setting depending on another,
10193 * make sure that they are ordered appropriately.
10194 *
10195 * @hide
10196 */
10197 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate58f41ec2013-01-11 15:40:36 -080010198 BUGREPORT_IN_POWER_MENU,
Christopher Tate66488d62012-10-02 11:58:01 -070010199 STAY_ON_WHILE_PLUGGED_IN,
Christopher Tate66488d62012-10-02 11:58:01 -070010200 AUTO_TIME,
10201 AUTO_TIME_ZONE,
10202 POWER_SOUNDS_ENABLED,
10203 DOCK_SOUNDS_ENABLED,
Ritesh Reddyf8f12132015-11-20 16:43:28 +000010204 CHARGING_SOUNDS_ENABLED,
Christopher Tate66488d62012-10-02 11:58:01 -070010205 USB_MASS_STORAGE_ENABLED,
Stephen Chen42f5f292017-01-20 11:24:08 -080010206 NETWORK_RECOMMENDATIONS_ENABLED,
Stephen Chen42f5f292017-01-20 11:24:08 -080010207 WIFI_WAKEUP_ENABLED,
Christopher Tate66488d62012-10-02 11:58:01 -070010208 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
Amin Shaikhbc9a8e62017-02-02 15:39:12 -080010209 USE_OPEN_WIFI_PACKAGE,
Christopher Tate16eb7cd2012-10-09 15:26:30 -070010210 WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED,
Christopher Tate66488d62012-10-02 11:58:01 -070010211 EMERGENCY_TONE,
10212 CALL_AUTO_RETRY,
Amith Yamasani94005242014-10-31 11:35:13 -070010213 DOCK_AUDIO_MEDIA_ENABLED,
Phil Burkdeaa8d92016-02-23 17:12:04 -080010214 ENCODED_SURROUND_OUTPUT,
Stanley Tng767f05f2017-05-01 21:27:31 -070010215 LOW_POWER_MODE_TRIGGER_LEVEL,
10216 BLUETOOTH_ON
Christopher Tate66488d62012-10-02 11:58:01 -070010217 };
10218
Christopher Tate1d0fca32017-06-06 13:30:00 -070010219 /** @hide */
10220 public static final String[] LEGACY_RESTORE_SETTINGS = {
10221 };
10222
Svetoslav Ganove080da92016-12-21 17:10:35 -080010223 private static final ContentProviderHolder sProviderHolder =
10224 new ContentProviderHolder(CONTENT_URI);
10225
Christopher Tate06efb532012-08-24 15:29:27 -070010226 // Populated lazily, guarded by class object:
Svetoslav Ganove080da92016-12-21 17:10:35 -080010227 private static final NameValueCache sNameValueCache = new NameValueCache(
Dianne Hackborn139748f2012-09-24 11:36:57 -070010228 CONTENT_URI,
10229 CALL_METHOD_GET_GLOBAL,
Svetoslav Ganove080da92016-12-21 17:10:35 -080010230 CALL_METHOD_PUT_GLOBAL,
10231 sProviderHolder);
Christopher Tate06efb532012-08-24 15:29:27 -070010232
Christopher Tateaa036a22014-05-19 16:33:27 -070010233 // Certain settings have been moved from global to the per-user secure namespace
10234 private static final HashSet<String> MOVED_TO_SECURE;
10235 static {
Steve McKayea93fe72016-12-02 11:35:35 -080010236 MOVED_TO_SECURE = new HashSet<>(1);
Christopher Tateaa036a22014-05-19 16:33:27 -070010237 MOVED_TO_SECURE.add(Settings.Global.INSTALL_NON_MARKET_APPS);
10238 }
10239
Svetoslav683914b2015-01-15 14:22:26 -080010240 /** @hide */
10241 public static void getMovedToSecureSettings(Set<String> outKeySet) {
10242 outKeySet.addAll(MOVED_TO_SECURE);
10243 }
10244
Sudheer Shankaaa3c30d2017-05-23 15:19:10 -070010245 /** @hide */
10246 public static void clearProviderForTest() {
10247 sProviderHolder.clearProviderForTest();
10248 sNameValueCache.clearGenerationTrackerForTest();
10249 }
10250
Christopher Tate06efb532012-08-24 15:29:27 -070010251 /**
10252 * Look up a name in the database.
10253 * @param resolver to access the database with
10254 * @param name to look up in the table
10255 * @return the corresponding value, or null if not present
10256 */
Dianne Hackborn139748f2012-09-24 11:36:57 -070010257 public static String getString(ContentResolver resolver, String name) {
Christopher Tate06efb532012-08-24 15:29:27 -070010258 return getStringForUser(resolver, name, UserHandle.myUserId());
10259 }
10260
10261 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -070010262 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -070010263 int userHandle) {
Christopher Tateaa036a22014-05-19 16:33:27 -070010264 if (MOVED_TO_SECURE.contains(name)) {
10265 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
10266 + " to android.provider.Settings.Secure, returning read-only value.");
10267 return Secure.getStringForUser(resolver, name, userHandle);
10268 }
Christopher Tate06efb532012-08-24 15:29:27 -070010269 return sNameValueCache.getStringForUser(resolver, name, userHandle);
10270 }
10271
10272 /**
10273 * Store a name/value pair into the database.
10274 * @param resolver to access the database with
10275 * @param name to store
10276 * @param value to associate with the name
10277 * @return true if the value was set, false on database errors
10278 */
10279 public static boolean putString(ContentResolver resolver,
10280 String name, String value) {
Svetoslav Ganove080da92016-12-21 17:10:35 -080010281 return putStringForUser(resolver, name, value, null, false, UserHandle.myUserId());
10282 }
10283
10284 /**
10285 * Store a name/value pair into the database.
10286 * <p>
10287 * The method takes an optional tag to associate with the setting
10288 * which can be used to clear only settings made by your package and
10289 * associated with this tag by passing the tag to {@link
10290 * #resetToDefaults(ContentResolver, String)}. Anyone can override
10291 * the current tag. Also if another package changes the setting
10292 * then the tag will be set to the one specified in the set call
10293 * which can be null. Also any of the settings setters that do not
10294 * take a tag as an argument effectively clears the tag.
10295 * </p><p>
10296 * For example, if you set settings A and B with tags T1 and T2 and
10297 * another app changes setting A (potentially to the same value), it
10298 * can assign to it a tag T3 (note that now the package that changed
10299 * the setting is not yours). Now if you reset your changes for T1 and
10300 * T2 only setting B will be reset and A not (as it was changed by
10301 * another package) but since A did not change you are in the desired
10302 * initial state. Now if the other app changes the value of A (assuming
10303 * you registered an observer in the beginning) you would detect that
10304 * the setting was changed by another app and handle this appropriately
10305 * (ignore, set back to some value, etc).
10306 * </p><p>
10307 * Also the method takes an argument whether to make the value the
10308 * default for this setting. If the system already specified a default
10309 * value, then the one passed in here will <strong>not</strong>
10310 * be set as the default.
10311 * </p>
10312 *
10313 * @param resolver to access the database with.
10314 * @param name to store.
10315 * @param value to associate with the name.
10316 * @param tag to associated with the setting.
10317 * @param makeDefault whether to make the value the default one.
10318 * @return true if the value was set, false on database errors.
10319 *
10320 * @see #resetToDefaults(ContentResolver, String)
10321 *
10322 * @hide
10323 */
10324 @SystemApi
10325 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
10326 public static boolean putString(@NonNull ContentResolver resolver,
10327 @NonNull String name, @Nullable String value, @Nullable String tag,
10328 boolean makeDefault) {
10329 return putStringForUser(resolver, name, value, tag, makeDefault,
10330 UserHandle.myUserId());
10331 }
10332
10333 /**
10334 * Reset the settings to their defaults. This would reset <strong>only</strong>
10335 * settings set by the caller's package. Think of it of a way to undo your own
10336 * changes to the secure settings. Passing in the optional tag will reset only
10337 * settings changed by your package and associated with this tag.
10338 *
10339 * @param resolver Handle to the content resolver.
10340 * @param tag Optional tag which should be associated with the settings to reset.
10341 *
10342 * @see #putString(ContentResolver, String, String, String, boolean)
10343 *
10344 * @hide
10345 */
10346 @SystemApi
10347 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
10348 public static void resetToDefaults(@NonNull ContentResolver resolver,
10349 @Nullable String tag) {
10350 resetToDefaultsAsUser(resolver, tag, RESET_MODE_PACKAGE_DEFAULTS,
10351 UserHandle.myUserId());
10352 }
10353
10354 /**
10355 * Reset the settings to their defaults for a given user with a specific mode. The
10356 * optional tag argument is valid only for {@link #RESET_MODE_PACKAGE_DEFAULTS}
10357 * allowing resetting the settings made by a package and associated with the tag.
10358 *
10359 * @param resolver Handle to the content resolver.
10360 * @param tag Optional tag which should be associated with the settings to reset.
10361 * @param mode The reset mode.
10362 * @param userHandle The user for which to reset to defaults.
10363 *
10364 * @see #RESET_MODE_PACKAGE_DEFAULTS
10365 * @see #RESET_MODE_UNTRUSTED_DEFAULTS
10366 * @see #RESET_MODE_UNTRUSTED_CHANGES
10367 * @see #RESET_MODE_TRUSTED_DEFAULTS
10368 *
10369 * @hide
10370 */
10371 public static void resetToDefaultsAsUser(@NonNull ContentResolver resolver,
10372 @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle) {
10373 try {
10374 Bundle arg = new Bundle();
10375 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
10376 if (tag != null) {
10377 arg.putString(CALL_METHOD_TAG_KEY, tag);
10378 }
10379 arg.putInt(CALL_METHOD_RESET_MODE_KEY, mode);
10380 IContentProvider cp = sProviderHolder.getProvider(resolver);
10381 cp.call(resolver.getPackageName(), CALL_METHOD_RESET_GLOBAL, null, arg);
10382 } catch (RemoteException e) {
10383 Log.w(TAG, "Can't reset do defaults for " + CONTENT_URI, e);
10384 }
Christopher Tate06efb532012-08-24 15:29:27 -070010385 }
10386
10387 /** @hide */
10388 public static boolean putStringForUser(ContentResolver resolver,
10389 String name, String value, int userHandle) {
Svetoslav Ganove080da92016-12-21 17:10:35 -080010390 return putStringForUser(resolver, name, value, null, false, userHandle);
10391 }
10392
10393 /** @hide */
10394 public static boolean putStringForUser(@NonNull ContentResolver resolver,
10395 @NonNull String name, @Nullable String value, @Nullable String tag,
10396 boolean makeDefault, @UserIdInt int userHandle) {
Christopher Tate06efb532012-08-24 15:29:27 -070010397 if (LOCAL_LOGV) {
10398 Log.v(TAG, "Global.putString(name=" + name + ", value=" + value
10399 + " for " + userHandle);
10400 }
Christopher Tateaa036a22014-05-19 16:33:27 -070010401 // Global and Secure have the same access policy so we can forward writes
10402 if (MOVED_TO_SECURE.contains(name)) {
10403 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
10404 + " to android.provider.Settings.Secure, value is unchanged.");
Svetoslav Ganove080da92016-12-21 17:10:35 -080010405 return Secure.putStringForUser(resolver, name, value, tag,
10406 makeDefault, userHandle);
Christopher Tateaa036a22014-05-19 16:33:27 -070010407 }
Svetoslav Ganove080da92016-12-21 17:10:35 -080010408 return sNameValueCache.putStringForUser(resolver, name, value, tag,
10409 makeDefault, userHandle);
Christopher Tate06efb532012-08-24 15:29:27 -070010410 }
10411
10412 /**
10413 * Construct the content URI for a particular name/value pair,
10414 * useful for monitoring changes with a ContentObserver.
10415 * @param name to look up in the table
10416 * @return the corresponding content URI, or null if not present
10417 */
10418 public static Uri getUriFor(String name) {
10419 return getUriFor(CONTENT_URI, name);
10420 }
10421
10422 /**
10423 * Convenience function for retrieving a single secure settings value
10424 * as an integer. Note that internally setting values are always
10425 * stored as strings; this function converts the string to an integer
10426 * for you. The default value will be returned if the setting is
10427 * not defined or not an integer.
10428 *
10429 * @param cr The ContentResolver to access.
10430 * @param name The name of the setting to retrieve.
10431 * @param def Value to return if the setting is not defined.
10432 *
10433 * @return The setting's current value, or 'def' if it is not defined
10434 * or not a valid integer.
10435 */
10436 public static int getInt(ContentResolver cr, String name, int def) {
10437 String v = getString(cr, name);
10438 try {
10439 return v != null ? Integer.parseInt(v) : def;
10440 } catch (NumberFormatException e) {
10441 return def;
10442 }
10443 }
10444
10445 /**
10446 * Convenience function for retrieving a single secure settings value
10447 * as an integer. Note that internally setting values are always
10448 * stored as strings; this function converts the string to an integer
10449 * for you.
10450 * <p>
10451 * This version does not take a default value. If the setting has not
10452 * been set, or the string value is not a number,
10453 * it throws {@link SettingNotFoundException}.
10454 *
10455 * @param cr The ContentResolver to access.
10456 * @param name The name of the setting to retrieve.
10457 *
10458 * @throws SettingNotFoundException Thrown if a setting by the given
10459 * name can't be found or the setting value is not an integer.
10460 *
10461 * @return The setting's current value.
10462 */
10463 public static int getInt(ContentResolver cr, String name)
10464 throws SettingNotFoundException {
10465 String v = getString(cr, name);
10466 try {
10467 return Integer.parseInt(v);
10468 } catch (NumberFormatException e) {
10469 throw new SettingNotFoundException(name);
10470 }
10471 }
10472
10473 /**
10474 * Convenience function for updating a single settings value as an
10475 * integer. This will either create a new entry in the table if the
10476 * given name does not exist, or modify the value of the existing row
10477 * with that name. Note that internally setting values are always
10478 * stored as strings, so this function converts the given value to a
10479 * string before storing it.
10480 *
10481 * @param cr The ContentResolver to access.
10482 * @param name The name of the setting to modify.
10483 * @param value The new value for the setting.
10484 * @return true if the value was set, false on database errors
10485 */
10486 public static boolean putInt(ContentResolver cr, String name, int value) {
10487 return putString(cr, name, Integer.toString(value));
10488 }
10489
10490 /**
10491 * Convenience function for retrieving a single secure settings value
10492 * as a {@code long}. Note that internally setting values are always
10493 * stored as strings; this function converts the string to a {@code long}
10494 * for you. The default value will be returned if the setting is
10495 * not defined or not a {@code long}.
10496 *
10497 * @param cr The ContentResolver to access.
10498 * @param name The name of the setting to retrieve.
10499 * @param def Value to return if the setting is not defined.
10500 *
10501 * @return The setting's current value, or 'def' if it is not defined
10502 * or not a valid {@code long}.
10503 */
10504 public static long getLong(ContentResolver cr, String name, long def) {
10505 String valString = getString(cr, name);
10506 long value;
10507 try {
10508 value = valString != null ? Long.parseLong(valString) : def;
10509 } catch (NumberFormatException e) {
10510 value = def;
10511 }
10512 return value;
10513 }
10514
10515 /**
10516 * Convenience function for retrieving a single secure settings value
10517 * as a {@code long}. Note that internally setting values are always
10518 * stored as strings; this function converts the string to a {@code long}
10519 * for you.
10520 * <p>
10521 * This version does not take a default value. If the setting has not
10522 * been set, or the string value is not a number,
10523 * it throws {@link SettingNotFoundException}.
10524 *
10525 * @param cr The ContentResolver to access.
10526 * @param name The name of the setting to retrieve.
10527 *
10528 * @return The setting's current value.
10529 * @throws SettingNotFoundException Thrown if a setting by the given
10530 * name can't be found or the setting value is not an integer.
10531 */
10532 public static long getLong(ContentResolver cr, String name)
10533 throws SettingNotFoundException {
10534 String valString = getString(cr, name);
10535 try {
10536 return Long.parseLong(valString);
10537 } catch (NumberFormatException e) {
10538 throw new SettingNotFoundException(name);
10539 }
10540 }
10541
10542 /**
10543 * Convenience function for updating a secure settings value as a long
10544 * integer. This will either create a new entry in the table if the
10545 * given name does not exist, or modify the value of the existing row
10546 * with that name. Note that internally setting values are always
10547 * stored as strings, so this function converts the given value to a
10548 * string before storing it.
10549 *
10550 * @param cr The ContentResolver to access.
10551 * @param name The name of the setting to modify.
10552 * @param value The new value for the setting.
10553 * @return true if the value was set, false on database errors
10554 */
10555 public static boolean putLong(ContentResolver cr, String name, long value) {
10556 return putString(cr, name, Long.toString(value));
10557 }
10558
10559 /**
10560 * Convenience function for retrieving a single secure settings value
10561 * as a floating point number. Note that internally setting values are
10562 * always stored as strings; this function converts the string to an
10563 * float for you. The default value will be returned if the setting
10564 * is not defined or not a valid float.
10565 *
10566 * @param cr The ContentResolver to access.
10567 * @param name The name of the setting to retrieve.
10568 * @param def Value to return if the setting is not defined.
10569 *
10570 * @return The setting's current value, or 'def' if it is not defined
10571 * or not a valid float.
10572 */
10573 public static float getFloat(ContentResolver cr, String name, float def) {
10574 String v = getString(cr, name);
10575 try {
10576 return v != null ? Float.parseFloat(v) : def;
10577 } catch (NumberFormatException e) {
10578 return def;
10579 }
10580 }
10581
10582 /**
10583 * Convenience function for retrieving a single secure settings value
10584 * as a float. Note that internally setting values are always
10585 * stored as strings; this function converts the string to a float
10586 * for you.
10587 * <p>
10588 * This version does not take a default value. If the setting has not
10589 * been set, or the string value is not a number,
10590 * it throws {@link SettingNotFoundException}.
10591 *
10592 * @param cr The ContentResolver to access.
10593 * @param name The name of the setting to retrieve.
10594 *
10595 * @throws SettingNotFoundException Thrown if a setting by the given
10596 * name can't be found or the setting value is not a float.
10597 *
10598 * @return The setting's current value.
10599 */
10600 public static float getFloat(ContentResolver cr, String name)
10601 throws SettingNotFoundException {
10602 String v = getString(cr, name);
10603 if (v == null) {
10604 throw new SettingNotFoundException(name);
10605 }
10606 try {
10607 return Float.parseFloat(v);
10608 } catch (NumberFormatException e) {
10609 throw new SettingNotFoundException(name);
10610 }
10611 }
10612
10613 /**
10614 * Convenience function for updating a single settings value as a
10615 * floating point number. This will either create a new entry in the
10616 * table if the given name does not exist, or modify the value of the
10617 * existing row with that name. Note that internally setting values
10618 * are always stored as strings, so this function converts the given
10619 * value to a string before storing it.
10620 *
10621 * @param cr The ContentResolver to access.
10622 * @param name The name of the setting to modify.
10623 * @param value The new value for the setting.
10624 * @return true if the value was set, false on database errors
10625 */
10626 public static boolean putFloat(ContentResolver cr, String name, float value) {
10627 return putString(cr, name, Float.toString(value));
10628 }
Wink Savillefb40dd42014-06-12 17:02:31 -070010629
Wink Savillefb40dd42014-06-12 17:02:31 -070010630 /**
10631 * Subscription to be used for voice call on a multi sim device. The supported values
10632 * are 0 = SUB1, 1 = SUB2 and etc.
10633 * @hide
10634 */
10635 public static final String MULTI_SIM_VOICE_CALL_SUBSCRIPTION = "multi_sim_voice_call";
10636
10637 /**
10638 * Used to provide option to user to select subscription during dial.
10639 * The supported values are 0 = disable or 1 = enable prompt.
10640 * @hide
10641 */
10642 public static final String MULTI_SIM_VOICE_PROMPT = "multi_sim_voice_prompt";
10643
10644 /**
10645 * Subscription to be used for data call on a multi sim device. The supported values
10646 * are 0 = SUB1, 1 = SUB2 and etc.
10647 * @hide
10648 */
10649 public static final String MULTI_SIM_DATA_CALL_SUBSCRIPTION = "multi_sim_data_call";
10650
10651 /**
10652 * Subscription to be used for SMS on a multi sim device. The supported values
10653 * are 0 = SUB1, 1 = SUB2 and etc.
10654 * @hide
10655 */
10656 public static final String MULTI_SIM_SMS_SUBSCRIPTION = "multi_sim_sms";
10657
10658 /**
10659 * Used to provide option to user to select subscription during send SMS.
10660 * The value 1 - enable, 0 - disable
10661 * @hide
10662 */
10663 public static final String MULTI_SIM_SMS_PROMPT = "multi_sim_sms_prompt";
10664
10665
10666
10667 /** User preferred subscriptions setting.
10668 * This holds the details of the user selected subscription from the card and
10669 * the activation status. Each settings string have the coma separated values
10670 * iccId,appType,appId,activationStatus,3gppIndex,3gpp2Index
10671 * @hide
10672 */
10673 public static final String[] MULTI_SIM_USER_PREFERRED_SUBS = {"user_preferred_sub1",
10674 "user_preferred_sub2","user_preferred_sub3"};
Zheng Fub218ff42015-04-13 16:31:16 -070010675
10676 /**
10677 * Whether to enable new contacts aggregator or not.
10678 * The value 1 - enable, 0 - disable
10679 * @hide
10680 */
10681 public static final String NEW_CONTACT_AGGREGATOR = "new_contact_aggregator";
Zheng Fu31ce78c2015-04-15 16:57:53 -070010682
10683 /**
10684 * Whether to enable contacts metadata syncing or not
10685 * The value 1 - enable, 0 - disable
Tingting Wange0cbda42016-05-10 15:39:37 -070010686 *
10687 * @removed
Zheng Fu31ce78c2015-04-15 16:57:53 -070010688 */
Tingting Wange0cbda42016-05-10 15:39:37 -070010689 @Deprecated
Zheng Fu31ce78c2015-04-15 16:57:53 -070010690 public static final String CONTACT_METADATA_SYNC = "contact_metadata_sync";
Wei Liua1817702015-08-11 21:21:12 -070010691
10692 /**
Tingting Wange0cbda42016-05-10 15:39:37 -070010693 * Whether to enable contacts metadata syncing or not
10694 * The value 1 - enable, 0 - disable
10695 */
10696 public static final String CONTACT_METADATA_SYNC_ENABLED = "contact_metadata_sync_enabled";
10697
10698 /**
Wei Liua1817702015-08-11 21:21:12 -070010699 * Whether to enable cellular on boot.
10700 * The value 1 - enable, 0 - disable
10701 * @hide
10702 */
10703 public static final String ENABLE_CELLULAR_ON_BOOT = "enable_cellular_on_boot";
Steven Ngdc20ba62016-04-26 18:19:04 +010010704
10705 /**
Chris Wren763a9bb2016-05-31 17:14:12 -040010706 * The maximum allowed notification enqueue rate in Hertz.
10707 *
Julia Reynolds76c096d2017-06-19 08:16:04 -040010708 * Should be a float, and includes updates only.
Chris Wren763a9bb2016-05-31 17:14:12 -040010709 * @hide
10710 */
10711 public static final String MAX_NOTIFICATION_ENQUEUE_RATE = "max_notification_enqueue_rate";
Doris Ling628cea42016-06-09 10:35:02 -070010712
10713 /**
Geoffrey Pitsch4c6eef22017-04-19 10:26:45 -040010714 * Displays toasts when an app posts a notification that does not specify a valid channel.
10715 *
10716 * The value 1 - enable, 0 - disable
10717 * @hide
10718 */
10719 public static final String SHOW_NOTIFICATION_CHANNEL_WARNINGS =
10720 "show_notification_channel_warnings";
10721
10722 /**
Chris Manton95a6c892016-03-15 13:26:11 -070010723 * Whether cell is enabled/disabled
10724 * @hide
10725 */
10726 public static final String CELL_ON = "cell_on";
Chad Brubaker97bccee2017-01-05 15:51:41 -080010727
10728 /**
Todd Kennedybe0b8892017-02-15 14:13:52 -080010729 * Global settings which can be accessed by instant apps.
Chad Brubaker97bccee2017-01-05 15:51:41 -080010730 * @hide
10731 */
Todd Kennedybe0b8892017-02-15 14:13:52 -080010732 public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>();
Chad Brubaker97bccee2017-01-05 15:51:41 -080010733 static {
Todd Kennedybe0b8892017-02-15 14:13:52 -080010734 INSTANT_APP_SETTINGS.add(WAIT_FOR_DEBUGGER);
10735 INSTANT_APP_SETTINGS.add(DEVICE_PROVISIONED);
10736 INSTANT_APP_SETTINGS.add(DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES);
10737 INSTANT_APP_SETTINGS.add(DEVELOPMENT_FORCE_RTL);
10738 INSTANT_APP_SETTINGS.add(EPHEMERAL_COOKIE_MAX_SIZE_BYTES);
Chad Brubaker1f6a2662017-03-20 11:11:30 -070010739 INSTANT_APP_SETTINGS.add(AIRPLANE_MODE_ON);
Chad Brubaker91d2e282017-04-03 14:34:50 -070010740 INSTANT_APP_SETTINGS.add(WINDOW_ANIMATION_SCALE);
10741 INSTANT_APP_SETTINGS.add(TRANSITION_ANIMATION_SCALE);
10742 INSTANT_APP_SETTINGS.add(ANIMATOR_DURATION_SCALE);
10743 INSTANT_APP_SETTINGS.add(DEBUG_VIEW_ATTRIBUTES);
Chad Brubaker562afaf2017-04-10 13:32:37 -070010744 INSTANT_APP_SETTINGS.add(WTF_IS_FATAL);
Chad Brubaker97bccee2017-01-05 15:51:41 -080010745 }
10746
Andrew Sappersteine3352562017-01-20 15:41:03 -080010747 /**
10748 * Whether to show the high temperature warning notification.
10749 * @hide
10750 */
10751 public static final String SHOW_TEMPERATURE_WARNING = "show_temperature_warning";
10752
10753 /**
10754 * Temperature at which the high temperature warning notification should be shown.
10755 * @hide
10756 */
10757 public static final String WARNING_TEMPERATURE = "warning_temperature";
Daniel Nishi88e45dc2017-01-25 11:43:55 -080010758
10759 /**
10760 * Whether the diskstats logging task is enabled/disabled.
10761 * @hide
10762 */
10763 public static final String ENABLE_DISKSTATS_LOGGING = "enable_diskstats_logging";
Daniel Nishi0f703e62017-02-21 15:19:27 -080010764
10765 /**
10766 * Whether the cache quota calculation task is enabled/disabled.
10767 * @hide
10768 */
10769 public static final String ENABLE_CACHE_QUOTA_CALCULATION =
10770 "enable_cache_quota_calculation";
Daniel Nishi4f5320e2017-06-13 17:51:21 -070010771
10772 /**
10773 * Whether the Deletion Helper no threshold toggle is available.
10774 * @hide
10775 */
10776 public static final String ENABLE_DELETION_HELPER_NO_THRESHOLD_TOGGLE =
10777 "enable_deletion_helper_no_threshold_toggle";
Christopher Tate06efb532012-08-24 15:29:27 -070010778 }
10779
10780 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080010781 * User-defined bookmarks and shortcuts. The target of each bookmark is an
10782 * Intent URL, allowing it to be either a web page or a particular
10783 * application activity.
10784 *
10785 * @hide
10786 */
10787 public static final class Bookmarks implements BaseColumns
10788 {
10789 private static final String TAG = "Bookmarks";
10790
10791 /**
10792 * The content:// style URL for this table
10793 */
10794 public static final Uri CONTENT_URI =
10795 Uri.parse("content://" + AUTHORITY + "/bookmarks");
10796
10797 /**
10798 * The row ID.
10799 * <p>Type: INTEGER</p>
10800 */
10801 public static final String ID = "_id";
10802
10803 /**
10804 * Descriptive name of the bookmark that can be displayed to the user.
10805 * If this is empty, the title should be resolved at display time (use
10806 * {@link #getTitle(Context, Cursor)} any time you want to display the
10807 * title of a bookmark.)
10808 * <P>
10809 * Type: TEXT
10810 * </P>
10811 */
10812 public static final String TITLE = "title";
10813
10814 /**
10815 * Arbitrary string (displayed to the user) that allows bookmarks to be
10816 * organized into categories. There are some special names for
10817 * standard folders, which all start with '@'. The label displayed for
10818 * the folder changes with the locale (via {@link #getLabelForFolder}) but
10819 * the folder name does not change so you can consistently query for
10820 * the folder regardless of the current locale.
10821 *
10822 * <P>Type: TEXT</P>
10823 *
10824 */
10825 public static final String FOLDER = "folder";
10826
10827 /**
10828 * The Intent URL of the bookmark, describing what it points to. This
10829 * value is given to {@link android.content.Intent#getIntent} to create
10830 * an Intent that can be launched.
10831 * <P>Type: TEXT</P>
10832 */
10833 public static final String INTENT = "intent";
10834
10835 /**
10836 * Optional shortcut character associated with this bookmark.
10837 * <P>Type: INTEGER</P>
10838 */
10839 public static final String SHORTCUT = "shortcut";
10840
10841 /**
10842 * The order in which the bookmark should be displayed
10843 * <P>Type: INTEGER</P>
10844 */
10845 public static final String ORDERING = "ordering";
10846
10847 private static final String[] sIntentProjection = { INTENT };
10848 private static final String[] sShortcutProjection = { ID, SHORTCUT };
10849 private static final String sShortcutSelection = SHORTCUT + "=?";
10850
10851 /**
10852 * Convenience function to retrieve the bookmarked Intent for a
10853 * particular shortcut key.
10854 *
10855 * @param cr The ContentResolver to query.
10856 * @param shortcut The shortcut key.
10857 *
10858 * @return Intent The bookmarked URL, or null if there is no bookmark
10859 * matching the given shortcut.
10860 */
10861 public static Intent getIntentForShortcut(ContentResolver cr, char shortcut)
10862 {
10863 Intent intent = null;
10864
10865 Cursor c = cr.query(CONTENT_URI,
10866 sIntentProjection, sShortcutSelection,
10867 new String[] { String.valueOf((int) shortcut) }, ORDERING);
10868 // Keep trying until we find a valid shortcut
10869 try {
10870 while (intent == null && c.moveToNext()) {
10871 try {
10872 String intentURI = c.getString(c.getColumnIndexOrThrow(INTENT));
Christian Mehlmauera34d2c92010-05-25 19:04:20 +020010873 intent = Intent.parseUri(intentURI, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080010874 } catch (java.net.URISyntaxException e) {
10875 // The stored URL is bad... ignore it.
10876 } catch (IllegalArgumentException e) {
10877 // Column not found
Dianne Hackborna33e3f72009-09-29 17:28:24 -070010878 Log.w(TAG, "Intent column not found", e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080010879 }
10880 }
10881 } finally {
10882 if (c != null) c.close();
10883 }
10884
10885 return intent;
10886 }
10887
10888 /**
10889 * Add a new bookmark to the system.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -070010890 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080010891 * @param cr The ContentResolver to query.
10892 * @param intent The desired target of the bookmark.
10893 * @param title Bookmark title that is shown to the user; null if none
10894 * or it should be resolved to the intent's title.
10895 * @param folder Folder in which to place the bookmark; null if none.
10896 * @param shortcut Shortcut that will invoke the bookmark; 0 if none. If
10897 * this is non-zero and there is an existing bookmark entry
10898 * with this same shortcut, then that existing shortcut is
10899 * cleared (the bookmark is not removed).
10900 * @return The unique content URL for the new bookmark entry.
10901 */
10902 public static Uri add(ContentResolver cr,
10903 Intent intent,
10904 String title,
10905 String folder,
10906 char shortcut,
10907 int ordering)
10908 {
10909 // If a shortcut is supplied, and it is already defined for
10910 // another bookmark, then remove the old definition.
10911 if (shortcut != 0) {
Jeff Hamilton7cd51ef2010-05-12 17:30:27 -050010912 cr.delete(CONTENT_URI, sShortcutSelection,
10913 new String[] { String.valueOf((int) shortcut) });
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080010914 }
10915
10916 ContentValues values = new ContentValues();
10917 if (title != null) values.put(TITLE, title);
10918 if (folder != null) values.put(FOLDER, folder);
Jean-Baptiste Queru3b9f0a32010-06-21 13:46:59 -070010919 values.put(INTENT, intent.toUri(0));
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080010920 if (shortcut != 0) values.put(SHORTCUT, (int) shortcut);
10921 values.put(ORDERING, ordering);
10922 return cr.insert(CONTENT_URI, values);
10923 }
10924
10925 /**
10926 * Return the folder name as it should be displayed to the user. This
10927 * takes care of localizing special folders.
10928 *
10929 * @param r Resources object for current locale; only need access to
10930 * system resources.
10931 * @param folder The value found in the {@link #FOLDER} column.
10932 *
10933 * @return CharSequence The label for this folder that should be shown
10934 * to the user.
10935 */
10936 public static CharSequence getLabelForFolder(Resources r, String folder) {
10937 return folder;
10938 }
10939
10940 /**
10941 * Return the title as it should be displayed to the user. This takes
10942 * care of localizing bookmarks that point to activities.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -070010943 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080010944 * @param context A context.
10945 * @param cursor A cursor pointing to the row whose title should be
10946 * returned. The cursor must contain at least the {@link #TITLE}
10947 * and {@link #INTENT} columns.
10948 * @return A title that is localized and can be displayed to the user,
10949 * or the empty string if one could not be found.
10950 */
10951 public static CharSequence getTitle(Context context, Cursor cursor) {
10952 int titleColumn = cursor.getColumnIndex(TITLE);
10953 int intentColumn = cursor.getColumnIndex(INTENT);
10954 if (titleColumn == -1 || intentColumn == -1) {
10955 throw new IllegalArgumentException(
10956 "The cursor must contain the TITLE and INTENT columns.");
10957 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -070010958
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080010959 String title = cursor.getString(titleColumn);
10960 if (!TextUtils.isEmpty(title)) {
10961 return title;
10962 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -070010963
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080010964 String intentUri = cursor.getString(intentColumn);
10965 if (TextUtils.isEmpty(intentUri)) {
10966 return "";
10967 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -070010968
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080010969 Intent intent;
10970 try {
Christian Mehlmauera34d2c92010-05-25 19:04:20 +020010971 intent = Intent.parseUri(intentUri, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080010972 } catch (URISyntaxException e) {
10973 return "";
10974 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -070010975
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080010976 PackageManager packageManager = context.getPackageManager();
10977 ResolveInfo info = packageManager.resolveActivity(intent, 0);
10978 return info != null ? info.loadLabel(packageManager) : "";
10979 }
10980 }
10981
10982 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080010983 * Returns the device ID that we should use when connecting to the mobile gtalk server.
10984 * This is a string like "android-0x1242", where the hex string is the Android ID obtained
10985 * from the GoogleLoginService.
10986 *
10987 * @param androidId The Android ID for this device.
10988 * @return The device ID that should be used when connecting to the mobile gtalk server.
10989 * @hide
10990 */
10991 public static String getGTalkDeviceId(long androidId) {
10992 return "android-" + Long.toHexString(androidId);
10993 }
Billy Lau6ad2d662015-07-18 00:26:58 +010010994
Billy Laua7238a32015-08-01 12:45:02 +010010995 private static final String[] PM_WRITE_SETTINGS = {
10996 android.Manifest.permission.WRITE_SETTINGS
10997 };
10998 private static final String[] PM_CHANGE_NETWORK_STATE = {
10999 android.Manifest.permission.CHANGE_NETWORK_STATE,
11000 android.Manifest.permission.WRITE_SETTINGS
11001 };
11002 private static final String[] PM_SYSTEM_ALERT_WINDOW = {
11003 android.Manifest.permission.SYSTEM_ALERT_WINDOW
11004 };
11005
Billy Lau6ad2d662015-07-18 00:26:58 +010011006 /**
11007 * Performs a strict and comprehensive check of whether a calling package is allowed to
11008 * write/modify system settings, as the condition differs for pre-M, M+, and
11009 * privileged/preinstalled apps. If the provided uid does not match the
11010 * callingPackage, a negative result will be returned.
11011 * @hide
11012 */
11013 public static boolean isCallingPackageAllowedToWriteSettings(Context context, int uid,
11014 String callingPackage, boolean throwException) {
11015 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
11016 callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS,
Billy Laua7238a32015-08-01 12:45:02 +010011017 PM_WRITE_SETTINGS, false);
Billy Lau6ad2d662015-07-18 00:26:58 +010011018 }
11019
11020 /**
11021 * Performs a strict and comprehensive check of whether a calling package is allowed to
11022 * write/modify system settings, as the condition differs for pre-M, M+, and
11023 * privileged/preinstalled apps. If the provided uid does not match the
Billy Laua7238a32015-08-01 12:45:02 +010011024 * callingPackage, a negative result will be returned. The caller is expected to have
Lorenzo Colittid5427052015-10-15 16:29:00 +090011025 * the WRITE_SETTINGS permission declared.
Billy Lau6ad2d662015-07-18 00:26:58 +010011026 *
11027 * Note: if the check is successful, the operation of this app will be updated to the
11028 * current time.
11029 * @hide
11030 */
11031 public static boolean checkAndNoteWriteSettingsOperation(Context context, int uid,
11032 String callingPackage, boolean throwException) {
11033 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
11034 callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS,
Billy Laua7238a32015-08-01 12:45:02 +010011035 PM_WRITE_SETTINGS, true);
11036 }
11037
11038 /**
11039 * Performs a strict and comprehensive check of whether a calling package is allowed to
11040 * change the state of network, as the condition differs for pre-M, M+, and
Lorenzo Colittid5427052015-10-15 16:29:00 +090011041 * privileged/preinstalled apps. The caller is expected to have either the
11042 * CHANGE_NETWORK_STATE or the WRITE_SETTINGS permission declared. Either of these
11043 * permissions allow changing network state; WRITE_SETTINGS is a runtime permission and
11044 * can be revoked, but (except in M, excluding M MRs), CHANGE_NETWORK_STATE is a normal
11045 * permission and cannot be revoked. See http://b/23597341
Billy Laua7238a32015-08-01 12:45:02 +010011046 *
Lorenzo Colittid5427052015-10-15 16:29:00 +090011047 * Note: if the check succeeds because the application holds WRITE_SETTINGS, the operation
11048 * of this app will be updated to the current time.
Billy Laua7238a32015-08-01 12:45:02 +010011049 * @hide
11050 */
11051 public static boolean checkAndNoteChangeNetworkStateOperation(Context context, int uid,
11052 String callingPackage, boolean throwException) {
Lorenzo Colittid5427052015-10-15 16:29:00 +090011053 if (context.checkCallingOrSelfPermission(android.Manifest.permission.CHANGE_NETWORK_STATE)
11054 == PackageManager.PERMISSION_GRANTED) {
11055 return true;
11056 }
Billy Laua7238a32015-08-01 12:45:02 +010011057 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
11058 callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS,
11059 PM_CHANGE_NETWORK_STATE, true);
Billy Lau6ad2d662015-07-18 00:26:58 +010011060 }
11061
11062 /**
11063 * Performs a strict and comprehensive check of whether a calling package is allowed to
11064 * draw on top of other apps, as the conditions differs for pre-M, M+, and
11065 * privileged/preinstalled apps. If the provided uid does not match the callingPackage,
11066 * a negative result will be returned.
11067 * @hide
11068 */
11069 public static boolean isCallingPackageAllowedToDrawOverlays(Context context, int uid,
11070 String callingPackage, boolean throwException) {
11071 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
11072 callingPackage, throwException, AppOpsManager.OP_SYSTEM_ALERT_WINDOW,
Billy Laua7238a32015-08-01 12:45:02 +010011073 PM_SYSTEM_ALERT_WINDOW, false);
Billy Lau6ad2d662015-07-18 00:26:58 +010011074 }
11075
11076 /**
11077 * Performs a strict and comprehensive check of whether a calling package is allowed to
11078 * draw on top of other apps, as the conditions differs for pre-M, M+, and
11079 * privileged/preinstalled apps. If the provided uid does not match the callingPackage,
11080 * a negative result will be returned.
11081 *
11082 * Note: if the check is successful, the operation of this app will be updated to the
11083 * current time.
11084 * @hide
11085 */
11086 public static boolean checkAndNoteDrawOverlaysOperation(Context context, int uid, String
11087 callingPackage, boolean throwException) {
11088 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
11089 callingPackage, throwException, AppOpsManager.OP_SYSTEM_ALERT_WINDOW,
Billy Laua7238a32015-08-01 12:45:02 +010011090 PM_SYSTEM_ALERT_WINDOW, true);
Billy Lau6ad2d662015-07-18 00:26:58 +010011091 }
11092
11093 /**
11094 * Helper method to perform a general and comprehensive check of whether an operation that is
11095 * protected by appops can be performed by a caller or not. e.g. OP_SYSTEM_ALERT_WINDOW and
11096 * OP_WRITE_SETTINGS
11097 * @hide
11098 */
11099 public static boolean isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context context,
Billy Laua7238a32015-08-01 12:45:02 +010011100 int uid, String callingPackage, boolean throwException, int appOpsOpCode, String[]
11101 permissions, boolean makeNote) {
Billy Lau6ad2d662015-07-18 00:26:58 +010011102 if (callingPackage == null) {
11103 return false;
11104 }
11105
11106 AppOpsManager appOpsMgr = (AppOpsManager)context.getSystemService(Context.APP_OPS_SERVICE);
11107 int mode = AppOpsManager.MODE_DEFAULT;
11108 if (makeNote) {
11109 mode = appOpsMgr.noteOpNoThrow(appOpsOpCode, uid, callingPackage);
11110 } else {
11111 mode = appOpsMgr.checkOpNoThrow(appOpsOpCode, uid, callingPackage);
11112 }
11113
11114 switch (mode) {
11115 case AppOpsManager.MODE_ALLOWED:
11116 return true;
Billy Laua7238a32015-08-01 12:45:02 +010011117
Billy Lau6ad2d662015-07-18 00:26:58 +010011118 case AppOpsManager.MODE_DEFAULT:
11119 // this is the default operating mode after an app's installation
Billy Laua7238a32015-08-01 12:45:02 +010011120 // In this case we will check all associated static permission to see
11121 // if it is granted during install time.
11122 for (String permission : permissions) {
11123 if (context.checkCallingOrSelfPermission(permission) == PackageManager
11124 .PERMISSION_GRANTED) {
11125 // if either of the permissions are granted, we will allow it
11126 return true;
11127 }
Billy Lau6ad2d662015-07-18 00:26:58 +010011128 }
Billy Laua7238a32015-08-01 12:45:02 +010011129
Billy Lau6ad2d662015-07-18 00:26:58 +010011130 default:
11131 // this is for all other cases trickled down here...
11132 if (!throwException) {
11133 return false;
11134 }
11135 }
Billy Laua7238a32015-08-01 12:45:02 +010011136
11137 // prepare string to throw SecurityException
11138 StringBuilder exceptionMessage = new StringBuilder();
11139 exceptionMessage.append(callingPackage);
11140 exceptionMessage.append(" was not granted ");
11141 if (permissions.length > 1) {
11142 exceptionMessage.append(" either of these permissions: ");
11143 } else {
11144 exceptionMessage.append(" this permission: ");
11145 }
11146 for (int i = 0; i < permissions.length; i++) {
11147 exceptionMessage.append(permissions[i]);
11148 exceptionMessage.append((i == permissions.length - 1) ? "." : ", ");
11149 }
11150
11151 throw new SecurityException(exceptionMessage.toString());
Billy Lau6ad2d662015-07-18 00:26:58 +010011152 }
11153
11154 /**
11155 * Retrieves a correponding package name for a given uid. It will query all
11156 * packages that are associated with the given uid, but it will return only
11157 * the zeroth result.
11158 * Note: If package could not be found, a null is returned.
11159 * @hide
11160 */
11161 public static String getPackageNameForUid(Context context, int uid) {
11162 String[] packages = context.getPackageManager().getPackagesForUid(uid);
11163 if (packages == null) {
11164 return null;
11165 }
11166 return packages[0];
11167 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080011168}