blob: 0ff4adc25ab78ccfa4e323e44f0e4e0a54f89af7 [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 =
Joachim Sauer21646082017-06-01 11:17:58 +01003487 new DiscreteValueValidator(new String[] {"12", "24", null});
Svetoslav683914b2015-01-15 14:22:26 -08003488
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);
Christopher Tate06efb532012-08-24 15:29:27 -07004569 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DATA_SERVICE_URL);
4570 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_REDIR_HOST);
4571 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_TARGET_URL);
4572 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_APN);
4573 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_REQUIRED);
4574 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_SUPPORTED);
Christopher Tate06efb532012-08-24 15:29:27 -07004575 MOVED_TO_GLOBAL.add(Settings.Global.USB_MASS_STORAGE_ENABLED);
4576 MOVED_TO_GLOBAL.add(Settings.Global.USE_GOOGLE_MAIL);
Robert Greenwalt3ea0c992013-10-03 21:13:49 +00004577 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_COUNTRY_CODE);
Christopher Tate06efb532012-08-24 15:29:27 -07004578 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FRAMEWORK_SCAN_INTERVAL_MS);
4579 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FREQUENCY_BAND);
4580 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_IDLE_MS);
4581 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MAX_DHCP_RETRY_COUNT);
4582 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS);
4583 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
4584 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
4585 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NUM_OPEN_NETWORKS_KEPT);
4586 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ON);
4587 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_P2P_DEVICE_NAME);
4588 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SAVED_STATE);
4589 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUPPLICANT_SCAN_INTERVAL_MS);
4590 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUSPEND_OPTIMIZATIONS_ENABLED);
Nathan Harold29589fc2016-03-30 21:53:48 -07004591 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_VERBOSE_LOGGING_ENABLED);
vandwalle7c3606c2014-03-31 19:12:07 -07004592 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ENHANCED_AUTO_JOIN);
4593 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORK_SHOW_RSSI);
Christopher Tate06efb532012-08-24 15:29:27 -07004594 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_ON);
4595 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED);
Christopher Tate06efb532012-08-24 15:29:27 -07004596 MOVED_TO_GLOBAL.add(Settings.Global.WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON);
Christopher Tatec868b642012-09-12 17:41:04 -07004597 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_ENABLE);
4598 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_TIMEOUT);
4599 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_DEFAULT_RESPONSE);
4600 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS);
4601 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS);
4602 MOVED_TO_GLOBAL.add(Settings.Global.GPRS_REGISTER_CHECK_PERIOD_MS);
Christopher Tate06efb532012-08-24 15:29:27 -07004603 MOVED_TO_GLOBAL.add(Settings.Global.WTF_IS_FATAL);
Jeff Sharkey625239a2012-09-26 22:03:49 -07004604 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_DURATION_THRESHOLD);
4605 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_THRESHOLD);
4606 MOVED_TO_GLOBAL.add(Settings.Global.SEND_ACTION_APP_ERROR);
4607 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_AGE_SECONDS);
4608 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_MAX_FILES);
4609 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_KB);
4610 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_PERCENT);
4611 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_RESERVE_PERCENT);
4612 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_TAG_PREFIX);
4613 MOVED_TO_GLOBAL.add(Settings.Global.ERROR_LOGCAT_PREFIX);
4614 MOVED_TO_GLOBAL.add(Settings.Global.SYS_FREE_STORAGE_LOG_INTERVAL);
4615 MOVED_TO_GLOBAL.add(Settings.Global.DISK_FREE_CHANGE_REPORTING_THRESHOLD);
4616 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_PERCENTAGE);
4617 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_MAX_BYTES);
4618 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_FULL_THRESHOLD_BYTES);
4619 MOVED_TO_GLOBAL.add(Settings.Global.SYNC_MAX_RETRY_DELAY_IN_SECONDS);
4620 MOVED_TO_GLOBAL.add(Settings.Global.CONNECTIVITY_CHANGE_DELAY);
4621 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED);
4622 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_SERVER);
4623 MOVED_TO_GLOBAL.add(Settings.Global.NSD_ON);
4624 MOVED_TO_GLOBAL.add(Settings.Global.SET_INSTALL_LOCATION);
4625 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_INSTALL_LOCATION);
4626 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_UP_DELAY);
4627 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_DOWN_DELAY);
4628 MOVED_TO_GLOBAL.add(Settings.Global.READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT);
4629 MOVED_TO_GLOBAL.add(Settings.Global.HTTP_PROXY);
4630 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_HOST);
4631 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_PORT);
4632 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST);
4633 MOVED_TO_GLOBAL.add(Settings.Global.SET_GLOBAL_HTTP_PROXY);
4634 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_DNS_SERVER);
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07004635 MOVED_TO_GLOBAL.add(Settings.Global.PREFERRED_NETWORK_MODE);
Hui Shu22671772014-10-01 21:41:07 +00004636 MOVED_TO_GLOBAL.add(Settings.Global.WEBVIEW_DATA_REDUCTION_PROXY_KEY);
Christopher Tate06efb532012-08-24 15:29:27 -07004637 }
4638
Christopher Tate66488d62012-10-02 11:58:01 -07004639 /** @hide */
Svetoslav683914b2015-01-15 14:22:26 -08004640 public static void getMovedToGlobalSettings(Set<String> outKeySet) {
Christopher Tate66488d62012-10-02 11:58:01 -07004641 outKeySet.addAll(MOVED_TO_GLOBAL);
4642 }
4643
Sudheer Shankaaa3c30d2017-05-23 15:19:10 -07004644 /** @hide */
4645 public static void clearProviderForTest() {
4646 sProviderHolder.clearProviderForTest();
4647 sNameValueCache.clearGenerationTrackerForTest();
4648 }
4649
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004650 /**
4651 * Look up a name in the database.
4652 * @param resolver to access the database with
4653 * @param name to look up in the table
4654 * @return the corresponding value, or null if not present
4655 */
Dianne Hackborn139748f2012-09-24 11:36:57 -07004656 public static String getString(ContentResolver resolver, String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07004657 return getStringForUser(resolver, name, UserHandle.myUserId());
4658 }
4659
4660 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -07004661 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -07004662 int userHandle) {
4663 if (MOVED_TO_GLOBAL.contains(name)) {
4664 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
4665 + " to android.provider.Settings.Global.");
4666 return Global.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004667 }
Amith Yamasani52c489c2012-03-28 11:42:42 -07004668
Dianne Hackborn139748f2012-09-24 11:36:57 -07004669 if (MOVED_TO_LOCK_SETTINGS.contains(name)) {
4670 synchronized (Secure.class) {
4671 if (sLockSettings == null) {
4672 sLockSettings = ILockSettings.Stub.asInterface(
4673 (IBinder) ServiceManager.getService("lock_settings"));
4674 sIsSystemProcess = Process.myUid() == Process.SYSTEM_UID;
4675 }
4676 }
4677 if (sLockSettings != null && !sIsSystemProcess) {
Adrian Roos7811d9f2015-07-27 15:10:13 -07004678 // No context; use the ActivityThread's context as an approximation for
4679 // determining the target API level.
4680 Application application = ActivityThread.currentApplication();
4681
4682 boolean isPreMnc = application != null
4683 && application.getApplicationInfo() != null
4684 && application.getApplicationInfo().targetSdkVersion
4685 <= VERSION_CODES.LOLLIPOP_MR1;
4686 if (isPreMnc) {
4687 try {
4688 return sLockSettings.getString(name, "0", userHandle);
4689 } catch (RemoteException re) {
4690 // Fall through
4691 }
4692 } else {
4693 throw new SecurityException("Settings.Secure." + name
4694 + " is deprecated and no longer accessible."
4695 + " See API documentation for potential replacements.");
Dianne Hackborn139748f2012-09-24 11:36:57 -07004696 }
Amith Yamasani52c489c2012-03-28 11:42:42 -07004697 }
4698 }
4699
Christopher Tate06efb532012-08-24 15:29:27 -07004700 return sNameValueCache.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004701 }
4702
4703 /**
4704 * Store a name/value pair into the database.
4705 * @param resolver to access the database with
4706 * @param name to store
4707 * @param value to associate with the name
4708 * @return true if the value was set, false on database errors
4709 */
Christopher Tate06efb532012-08-24 15:29:27 -07004710 public static boolean putString(ContentResolver resolver, String name, String value) {
4711 return putStringForUser(resolver, name, value, UserHandle.myUserId());
4712 }
4713
4714 /** @hide */
4715 public static boolean putStringForUser(ContentResolver resolver, String name, String value,
4716 int userHandle) {
Svetoslav Ganove080da92016-12-21 17:10:35 -08004717 return putStringForUser(resolver, name, value, null, false, userHandle);
4718 }
4719
4720 /** @hide */
4721 public static boolean putStringForUser(@NonNull ContentResolver resolver,
4722 @NonNull String name, @Nullable String value, @Nullable String tag,
4723 boolean makeDefault, @UserIdInt int userHandle) {
Julia Reynolds82735bc2014-09-04 16:43:30 -04004724 if (LOCATION_MODE.equals(name)) {
Tom O'Neill87c7fad2016-08-04 08:16:12 -07004725 // Map LOCATION_MODE to underlying location provider storage API
Julia Reynolds82735bc2014-09-04 16:43:30 -04004726 return setLocationModeForUser(resolver, Integer.parseInt(value), userHandle);
4727 }
Christopher Tate06efb532012-08-24 15:29:27 -07004728 if (MOVED_TO_GLOBAL.contains(name)) {
Robin Lee7af9a742017-02-20 14:47:30 +00004729 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
Christopher Tate06efb532012-08-24 15:29:27 -07004730 + " to android.provider.Settings.Global");
Svetoslav Ganove080da92016-12-21 17:10:35 -08004731 return Global.putStringForUser(resolver, name, value,
4732 tag, makeDefault, userHandle);
Christopher Tate06efb532012-08-24 15:29:27 -07004733 }
Svetoslav Ganove080da92016-12-21 17:10:35 -08004734 return sNameValueCache.putStringForUser(resolver, name, value, tag,
4735 makeDefault, userHandle);
4736 }
4737
4738 /**
4739 * Store a name/value pair into the database.
4740 * <p>
4741 * The method takes an optional tag to associate with the setting
4742 * which can be used to clear only settings made by your package and
4743 * associated with this tag by passing the tag to {@link
4744 * #resetToDefaults(ContentResolver, String)}. Anyone can override
4745 * the current tag. Also if another package changes the setting
4746 * then the tag will be set to the one specified in the set call
4747 * which can be null. Also any of the settings setters that do not
4748 * take a tag as an argument effectively clears the tag.
4749 * </p><p>
4750 * For example, if you set settings A and B with tags T1 and T2 and
4751 * another app changes setting A (potentially to the same value), it
4752 * can assign to it a tag T3 (note that now the package that changed
4753 * the setting is not yours). Now if you reset your changes for T1 and
4754 * T2 only setting B will be reset and A not (as it was changed by
4755 * another package) but since A did not change you are in the desired
4756 * initial state. Now if the other app changes the value of A (assuming
4757 * you registered an observer in the beginning) you would detect that
4758 * the setting was changed by another app and handle this appropriately
4759 * (ignore, set back to some value, etc).
4760 * </p><p>
4761 * Also the method takes an argument whether to make the value the
4762 * default for this setting. If the system already specified a default
4763 * value, then the one passed in here will <strong>not</strong>
4764 * be set as the default.
4765 * </p>
4766 *
4767 * @param resolver to access the database with.
4768 * @param name to store.
4769 * @param value to associate with the name.
4770 * @param tag to associate with the setting.
4771 * @param makeDefault whether to make the value the default one.
4772 * @return true if the value was set, false on database errors.
4773 *
4774 * @see #resetToDefaults(ContentResolver, String)
4775 *
4776 * @hide
4777 */
4778 @SystemApi
4779 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
4780 public static boolean putString(@NonNull ContentResolver resolver,
4781 @NonNull String name, @Nullable String value, @Nullable String tag,
4782 boolean makeDefault) {
4783 return putStringForUser(resolver, name, value, tag, makeDefault,
4784 UserHandle.myUserId());
4785 }
4786
4787 /**
4788 * Reset the settings to their defaults. This would reset <strong>only</strong>
4789 * settings set by the caller's package. Think of it of a way to undo your own
4790 * changes to the global settings. Passing in the optional tag will reset only
4791 * settings changed by your package and associated with this tag.
4792 *
4793 * @param resolver Handle to the content resolver.
4794 * @param tag Optional tag which should be associated with the settings to reset.
4795 *
4796 * @see #putString(ContentResolver, String, String, String, boolean)
4797 *
4798 * @hide
4799 */
4800 @SystemApi
4801 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
4802 public static void resetToDefaults(@NonNull ContentResolver resolver,
4803 @Nullable String tag) {
4804 resetToDefaultsAsUser(resolver, tag, RESET_MODE_PACKAGE_DEFAULTS,
4805 UserHandle.myUserId());
4806 }
4807
4808 /**
4809 *
4810 * Reset the settings to their defaults for a given user with a specific mode. The
4811 * optional tag argument is valid only for {@link #RESET_MODE_PACKAGE_DEFAULTS}
4812 * allowing resetting the settings made by a package and associated with the tag.
4813 *
4814 * @param resolver Handle to the content resolver.
4815 * @param tag Optional tag which should be associated with the settings to reset.
4816 * @param mode The reset mode.
4817 * @param userHandle The user for which to reset to defaults.
4818 *
4819 * @see #RESET_MODE_PACKAGE_DEFAULTS
4820 * @see #RESET_MODE_UNTRUSTED_DEFAULTS
4821 * @see #RESET_MODE_UNTRUSTED_CHANGES
4822 * @see #RESET_MODE_TRUSTED_DEFAULTS
4823 *
4824 * @hide
4825 */
4826 public static void resetToDefaultsAsUser(@NonNull ContentResolver resolver,
4827 @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle) {
4828 try {
4829 Bundle arg = new Bundle();
4830 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
4831 if (tag != null) {
4832 arg.putString(CALL_METHOD_TAG_KEY, tag);
4833 }
4834 arg.putInt(CALL_METHOD_RESET_MODE_KEY, mode);
4835 IContentProvider cp = sProviderHolder.getProvider(resolver);
4836 cp.call(resolver.getPackageName(), CALL_METHOD_RESET_SECURE, null, arg);
4837 } catch (RemoteException e) {
4838 Log.w(TAG, "Can't reset do defaults for " + CONTENT_URI, e);
4839 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004840 }
4841
4842 /**
4843 * Construct the content URI for a particular name/value pair,
4844 * useful for monitoring changes with a ContentObserver.
4845 * @param name to look up in the table
4846 * @return the corresponding content URI, or null if not present
4847 */
4848 public static Uri getUriFor(String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07004849 if (MOVED_TO_GLOBAL.contains(name)) {
4850 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
4851 + " to android.provider.Settings.Global, returning global URI.");
4852 return Global.getUriFor(Global.CONTENT_URI, name);
4853 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004854 return getUriFor(CONTENT_URI, name);
4855 }
4856
4857 /**
4858 * Convenience function for retrieving a single secure settings value
4859 * as an integer. Note that internally setting values are always
4860 * stored as strings; this function converts the string to an integer
4861 * for you. The default value will be returned if the setting is
4862 * not defined or not an integer.
4863 *
4864 * @param cr The ContentResolver to access.
4865 * @param name The name of the setting to retrieve.
4866 * @param def Value to return if the setting is not defined.
4867 *
4868 * @return The setting's current value, or 'def' if it is not defined
4869 * or not a valid integer.
4870 */
4871 public static int getInt(ContentResolver cr, String name, int def) {
Christopher Tate06efb532012-08-24 15:29:27 -07004872 return getIntForUser(cr, name, def, UserHandle.myUserId());
4873 }
4874
4875 /** @hide */
4876 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
Tom O'Neill7f6f4572013-08-27 10:53:15 -07004877 if (LOCATION_MODE.equals(name)) {
Tom O'Neill87c7fad2016-08-04 08:16:12 -07004878 // Map from to underlying location provider storage API to location mode
Tom O'Neill7f6f4572013-08-27 10:53:15 -07004879 return getLocationModeForUser(cr, userHandle);
4880 }
Christopher Tate06efb532012-08-24 15:29:27 -07004881 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004882 try {
4883 return v != null ? Integer.parseInt(v) : def;
4884 } catch (NumberFormatException e) {
4885 return def;
4886 }
4887 }
4888
4889 /**
4890 * Convenience function for retrieving a single secure settings value
4891 * as an integer. Note that internally setting values are always
4892 * stored as strings; this function converts the string to an integer
4893 * for you.
4894 * <p>
4895 * This version does not take a default value. If the setting has not
4896 * been set, or the string value is not a number,
4897 * it throws {@link SettingNotFoundException}.
4898 *
4899 * @param cr The ContentResolver to access.
4900 * @param name The name of the setting to retrieve.
4901 *
4902 * @throws SettingNotFoundException Thrown if a setting by the given
4903 * name can't be found or the setting value is not an integer.
4904 *
4905 * @return The setting's current value.
4906 */
4907 public static int getInt(ContentResolver cr, String name)
4908 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07004909 return getIntForUser(cr, name, UserHandle.myUserId());
4910 }
4911
4912 /** @hide */
4913 public static int getIntForUser(ContentResolver cr, String name, int userHandle)
4914 throws SettingNotFoundException {
Tom O'Neill7f6f4572013-08-27 10:53:15 -07004915 if (LOCATION_MODE.equals(name)) {
Tom O'Neill87c7fad2016-08-04 08:16:12 -07004916 // Map from to underlying location provider storage API to location mode
Tom O'Neill7f6f4572013-08-27 10:53:15 -07004917 return getLocationModeForUser(cr, userHandle);
4918 }
Christopher Tate06efb532012-08-24 15:29:27 -07004919 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004920 try {
4921 return Integer.parseInt(v);
4922 } catch (NumberFormatException e) {
4923 throw new SettingNotFoundException(name);
4924 }
4925 }
4926
4927 /**
4928 * Convenience function for updating a single settings value as an
4929 * integer. This will either create a new entry in the table if the
4930 * given name does not exist, or modify the value of the existing row
4931 * with that name. Note that internally setting values are always
4932 * stored as strings, so this function converts the given value to a
4933 * string before storing it.
4934 *
4935 * @param cr The ContentResolver to access.
4936 * @param name The name of the setting to modify.
4937 * @param value The new value for the setting.
4938 * @return true if the value was set, false on database errors
4939 */
4940 public static boolean putInt(ContentResolver cr, String name, int value) {
Christopher Tate06efb532012-08-24 15:29:27 -07004941 return putIntForUser(cr, name, value, UserHandle.myUserId());
4942 }
4943
4944 /** @hide */
4945 public static boolean putIntForUser(ContentResolver cr, String name, int value,
4946 int userHandle) {
4947 return putStringForUser(cr, name, Integer.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004948 }
4949
4950 /**
4951 * Convenience function for retrieving a single secure settings value
4952 * as a {@code long}. Note that internally setting values are always
4953 * stored as strings; this function converts the string to a {@code long}
4954 * for you. The default value will be returned if the setting is
4955 * not defined or not a {@code long}.
4956 *
4957 * @param cr The ContentResolver to access.
4958 * @param name The name of the setting to retrieve.
4959 * @param def Value to return if the setting is not defined.
4960 *
4961 * @return The setting's current value, or 'def' if it is not defined
4962 * or not a valid {@code long}.
4963 */
4964 public static long getLong(ContentResolver cr, String name, long def) {
Christopher Tate06efb532012-08-24 15:29:27 -07004965 return getLongForUser(cr, name, def, UserHandle.myUserId());
4966 }
4967
4968 /** @hide */
4969 public static long getLongForUser(ContentResolver cr, String name, long def,
4970 int userHandle) {
4971 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004972 long value;
4973 try {
4974 value = valString != null ? Long.parseLong(valString) : def;
4975 } catch (NumberFormatException e) {
4976 value = def;
4977 }
4978 return value;
4979 }
4980
4981 /**
4982 * Convenience function for retrieving a single secure settings value
4983 * as a {@code long}. Note that internally setting values are always
4984 * stored as strings; this function converts the string to a {@code long}
4985 * for you.
4986 * <p>
4987 * This version does not take a default value. If the setting has not
4988 * been set, or the string value is not a number,
4989 * it throws {@link SettingNotFoundException}.
4990 *
4991 * @param cr The ContentResolver to access.
4992 * @param name The name of the setting to retrieve.
4993 *
4994 * @return The setting's current value.
4995 * @throws SettingNotFoundException Thrown if a setting by the given
4996 * name can't be found or the setting value is not an integer.
4997 */
4998 public static long getLong(ContentResolver cr, String name)
4999 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07005000 return getLongForUser(cr, name, UserHandle.myUserId());
5001 }
5002
5003 /** @hide */
5004 public static long getLongForUser(ContentResolver cr, String name, int userHandle)
5005 throws SettingNotFoundException {
5006 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005007 try {
5008 return Long.parseLong(valString);
5009 } catch (NumberFormatException e) {
5010 throw new SettingNotFoundException(name);
5011 }
5012 }
5013
5014 /**
5015 * Convenience function for updating a secure settings value as a long
5016 * integer. This will either create a new entry in the table if the
5017 * given name does not exist, or modify the value of the existing row
5018 * with that name. Note that internally setting values are always
5019 * stored as strings, so this function converts the given value to a
5020 * string before storing it.
5021 *
5022 * @param cr The ContentResolver to access.
5023 * @param name The name of the setting to modify.
5024 * @param value The new value for the setting.
5025 * @return true if the value was set, false on database errors
5026 */
5027 public static boolean putLong(ContentResolver cr, String name, long value) {
Christopher Tate06efb532012-08-24 15:29:27 -07005028 return putLongForUser(cr, name, value, UserHandle.myUserId());
5029 }
5030
5031 /** @hide */
5032 public static boolean putLongForUser(ContentResolver cr, String name, long value,
5033 int userHandle) {
5034 return putStringForUser(cr, name, Long.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005035 }
5036
5037 /**
5038 * Convenience function for retrieving a single secure settings value
5039 * as a floating point number. Note that internally setting values are
5040 * always stored as strings; this function converts the string to an
5041 * float for you. The default value will be returned if the setting
5042 * is not defined or not a valid float.
5043 *
5044 * @param cr The ContentResolver to access.
5045 * @param name The name of the setting to retrieve.
5046 * @param def Value to return if the setting is not defined.
5047 *
5048 * @return The setting's current value, or 'def' if it is not defined
5049 * or not a valid float.
5050 */
5051 public static float getFloat(ContentResolver cr, String name, float def) {
Christopher Tate06efb532012-08-24 15:29:27 -07005052 return getFloatForUser(cr, name, def, UserHandle.myUserId());
5053 }
5054
5055 /** @hide */
5056 public static float getFloatForUser(ContentResolver cr, String name, float def,
5057 int userHandle) {
5058 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005059 try {
5060 return v != null ? Float.parseFloat(v) : def;
5061 } catch (NumberFormatException e) {
5062 return def;
5063 }
5064 }
5065
5066 /**
5067 * Convenience function for retrieving a single secure settings value
5068 * as a float. Note that internally setting values are always
5069 * stored as strings; this function converts the string to a float
5070 * for you.
5071 * <p>
5072 * This version does not take a default value. If the setting has not
5073 * been set, or the string value is not a number,
5074 * it throws {@link SettingNotFoundException}.
5075 *
5076 * @param cr The ContentResolver to access.
5077 * @param name The name of the setting to retrieve.
5078 *
5079 * @throws SettingNotFoundException Thrown if a setting by the given
5080 * name can't be found or the setting value is not a float.
5081 *
5082 * @return The setting's current value.
5083 */
5084 public static float getFloat(ContentResolver cr, String name)
5085 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07005086 return getFloatForUser(cr, name, UserHandle.myUserId());
5087 }
5088
5089 /** @hide */
5090 public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
5091 throws SettingNotFoundException {
5092 String v = getStringForUser(cr, name, userHandle);
Brian Muramatsue1d46982010-12-06 17:34:20 -08005093 if (v == null) {
5094 throw new SettingNotFoundException(name);
5095 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005096 try {
5097 return Float.parseFloat(v);
5098 } catch (NumberFormatException e) {
5099 throw new SettingNotFoundException(name);
5100 }
5101 }
5102
5103 /**
5104 * Convenience function for updating a single settings value as a
5105 * floating point number. This will either create a new entry in the
5106 * table if the given name does not exist, or modify the value of the
5107 * existing row with that name. Note that internally setting values
5108 * are always stored as strings, so this function converts the given
5109 * value to a string before storing it.
5110 *
5111 * @param cr The ContentResolver to access.
5112 * @param name The name of the setting to modify.
5113 * @param value The new value for the setting.
5114 * @return true if the value was set, false on database errors
5115 */
5116 public static boolean putFloat(ContentResolver cr, String name, float value) {
Christopher Tate06efb532012-08-24 15:29:27 -07005117 return putFloatForUser(cr, name, value, UserHandle.myUserId());
5118 }
5119
5120 /** @hide */
5121 public static boolean putFloatForUser(ContentResolver cr, String name, float value,
5122 int userHandle) {
5123 return putStringForUser(cr, name, Float.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005124 }
5125
5126 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005127 * @deprecated Use {@link android.provider.Settings.Global#DEVELOPMENT_SETTINGS_ENABLED}
5128 * instead
Dianne Hackborn895f99e2012-02-02 11:49:12 -08005129 */
Christopher Tate06efb532012-08-24 15:29:27 -07005130 @Deprecated
5131 public static final String DEVELOPMENT_SETTINGS_ENABLED =
5132 Global.DEVELOPMENT_SETTINGS_ENABLED;
Dianne Hackborn895f99e2012-02-02 11:49:12 -08005133
5134 /**
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07005135 * When the user has enable the option to have a "bug report" command
5136 * in the power menu.
Christopher Tate58f41ec2013-01-11 15:40:36 -08005137 * @deprecated Use {@link android.provider.Settings.Global#BUGREPORT_IN_POWER_MENU} instead
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07005138 * @hide
5139 */
Christopher Tate58f41ec2013-01-11 15:40:36 -08005140 @Deprecated
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07005141 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
5142
5143 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005144 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005145 */
Christopher Tate06efb532012-08-24 15:29:27 -07005146 @Deprecated
5147 public static final String ADB_ENABLED = Global.ADB_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005148
5149 /**
5150 * Setting to allow mock locations and location provider status to be injected into the
5151 * LocationManager service for testing purposes during application development. These
5152 * locations and status values override actual location and status information generated
5153 * by network, gps, or other location providers.
Svet Ganovf7e9cf42015-05-13 10:40:31 -07005154 *
5155 * @deprecated This settings is not used anymore.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005156 */
Svet Ganovf7e9cf42015-05-13 10:40:31 -07005157 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005158 public static final String ALLOW_MOCK_LOCATION = "mock_location";
5159
5160 /**
Doug Zongkerd8893db2010-01-26 12:29:44 -08005161 * A 64-bit number (as a hex string) that is randomly
Scott Main44895332013-11-12 09:23:13 -08005162 * generated when the user first sets up the device and should remain
5163 * constant for the lifetime of the user's device. The value may
5164 * change if a factory reset is performed on the device.
5165 * <p class="note"><strong>Note:</strong> When a device has <a
5166 * href="{@docRoot}about/versions/android-4.2.html#MultipleUsers">multiple users</a>
5167 * (available on certain devices running Android 4.2 or higher), each user appears as a
5168 * completely separate device, so the {@code ANDROID_ID} value is unique to each
5169 * user.</p>
Chad Brubaker0d277a72017-04-12 16:56:53 -07005170 *
5171 * <p class="note"><strong>Note:</strong> If the caller is an Instant App the id is scoped
5172 * to the Instant App, it is generated when the Instant App is first installed and reset if
5173 * the user clears the Instant App.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005174 */
5175 public static final String ANDROID_ID = "android_id";
5176
5177 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005178 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005179 */
Christopher Tate06efb532012-08-24 15:29:27 -07005180 @Deprecated
5181 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005182
5183 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005184 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005185 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07005186 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07005187 public static final String DATA_ROAMING = Global.DATA_ROAMING;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005188
5189 /**
5190 * Setting to record the input method used by default, holding the ID
5191 * of the desired method.
5192 */
5193 public static final String DEFAULT_INPUT_METHOD = "default_input_method";
5194
5195 /**
satokab751aa2010-09-14 19:17:36 +09005196 * Setting to record the input method subtype used by default, holding the ID
5197 * of the desired method.
5198 */
5199 public static final String SELECTED_INPUT_METHOD_SUBTYPE =
5200 "selected_input_method_subtype";
5201
5202 /**
satok723a27e2010-11-11 14:58:11 +09005203 * Setting to record the history of input method subtype, holding the pair of ID of IME
5204 * and its last used subtype.
5205 * @hide
5206 */
5207 public static final String INPUT_METHODS_SUBTYPE_HISTORY =
5208 "input_methods_subtype_history";
5209
5210 /**
satok5c58dfc2010-12-14 21:54:47 +09005211 * Setting to record the visibility of input method selector
5212 */
5213 public static final String INPUT_METHOD_SELECTOR_VISIBILITY =
5214 "input_method_selector_visibility";
5215
5216 /**
Dianne Hackborn91097de2014-04-04 18:02:06 -07005217 * The currently selected voice interaction service flattened ComponentName.
5218 * @hide
5219 */
Jeff Sharkeya73b8fd2016-01-06 17:02:08 -07005220 @TestApi
Dianne Hackborn91097de2014-04-04 18:02:06 -07005221 public static final String VOICE_INTERACTION_SERVICE = "voice_interaction_service";
5222
5223 /**
Felipe Leme640f30a2017-03-06 15:44:06 -08005224 * The currently selected autofill service flattened ComponentName.
Felipe Leme5381aa42016-10-13 09:02:32 -07005225 * @hide
5226 */
5227 @TestApi
Felipe Leme640f30a2017-03-06 15:44:06 -08005228 public static final String AUTOFILL_SERVICE = "autofill_service";
Felipe Leme5381aa42016-10-13 09:02:32 -07005229
5230 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005231 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005232 */
Christopher Tate06efb532012-08-24 15:29:27 -07005233 @Deprecated
5234 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005235
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005236 /**
Russell Brennerde6ae442012-09-26 20:53:10 -07005237 * Whether the current user has been set up via setup wizard (0 = false, 1 = true)
5238 * @hide
5239 */
Felipe Leme99230122017-06-12 14:33:02 -07005240 @TestApi
Russell Brennerde6ae442012-09-26 20:53:10 -07005241 public static final String USER_SETUP_COMPLETE = "user_setup_complete";
5242
5243 /**
Sujith Ramakrishnan314df162017-06-16 18:03:18 -07005244 * Whether the current user has been set up via setup wizard (0 = false, 1 = true)
5245 * This value differs from USER_SETUP_COMPLETE in that it can be reset back to 0
5246 * in case SetupWizard has been re-enabled on TV devices.
5247 *
5248 * @hide
5249 */
5250 public static final String TV_USER_SETUP_COMPLETE = "tv_user_setup_complete";
5251
5252 /**
Ido Ofird193c672016-03-01 13:27:54 -08005253 * Prefix for category name that marks whether a suggested action from that category was
5254 * completed.
5255 * @hide
5256 */
5257 public static final String COMPLETED_CATEGORY_PREFIX = "suggested.completed_category.";
5258
5259 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005260 * List of input methods that are currently enabled. This is a string
5261 * containing the IDs of all enabled input methods, each ID separated
5262 * by ':'.
5263 */
5264 public static final String ENABLED_INPUT_METHODS = "enabled_input_methods";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005265
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005266 /**
Amith Yamasanie861ec12010-03-24 21:39:27 -07005267 * List of system input methods that are currently disabled. This is a string
5268 * containing the IDs of all disabled input methods, each ID separated
5269 * by ':'.
5270 * @hide
5271 */
5272 public static final String DISABLED_SYSTEM_INPUT_METHODS = "disabled_system_input_methods";
5273
5274 /**
Michael Wright7b5a96b2014-08-09 19:28:42 -07005275 * Whether to show the IME when a hard keyboard is connected. This is a boolean that
5276 * determines if the IME should be shown when a hard keyboard is attached.
5277 * @hide
5278 */
5279 public static final String SHOW_IME_WITH_HARD_KEYBOARD = "show_ime_with_hard_keyboard";
5280
5281 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07005282 * Host name and port for global http proxy. Uses ':' seperator for
5283 * between host and port.
5284 *
5285 * @deprecated Use {@link Global#HTTP_PROXY}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005286 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07005287 @Deprecated
5288 public static final String HTTP_PROXY = Global.HTTP_PROXY;
Robert Greenwalte90aa5e2010-09-01 11:34:05 -07005289
5290 /**
Robin Lee244ce8e2016-01-05 18:03:46 +00005291 * Package designated as always-on VPN provider.
5292 *
5293 * @hide
5294 */
5295 public static final String ALWAYS_ON_VPN_APP = "always_on_vpn_app";
5296
5297 /**
Robin Lee17e61832016-05-09 13:46:28 +01005298 * Whether to block networking outside of VPN connections while always-on is set.
5299 * @see #ALWAYS_ON_VPN_APP
5300 *
5301 * @hide
5302 */
5303 public static final String ALWAYS_ON_VPN_LOCKDOWN = "always_on_vpn_lockdown";
5304
5305 /**
Christopher Tateaa036a22014-05-19 16:33:27 -07005306 * Whether applications can be installed for this user via the system's
5307 * {@link Intent#ACTION_INSTALL_PACKAGE} mechanism.
5308 *
5309 * <p>1 = permit app installation via the system package installer intent
5310 * <p>0 = do not allow use of the package installer
Suprabh Shuklaaef25132017-01-23 18:09:03 -08005311 * @deprecated Starting from {@link android.os.Build.VERSION_CODES#O}, apps should use
5312 * {@link PackageManager#canRequestPackageInstalls()}
5313 * @see PackageManager#canRequestPackageInstalls()
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005314 */
Christopher Tateaa036a22014-05-19 16:33:27 -07005315 public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005316
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005317 /**
Suprabh Shukla0b1356f2017-02-21 14:33:50 -08005318 * A flag to tell {@link com.android.server.devicepolicy.DevicePolicyManagerService} that
5319 * the default for {@link #INSTALL_NON_MARKET_APPS} is reversed for this user on OTA. So it
5320 * can set the restriction {@link android.os.UserManager#DISALLOW_INSTALL_UNKNOWN_SOURCES}
5321 * on behalf of the profile owner if needed to make the change transparent for profile
5322 * owners.
5323 *
5324 * @hide
5325 */
5326 public static final String UNKNOWN_SOURCES_DEFAULT_REVERSED =
5327 "unknown_sources_default_reversed";
5328
5329 /**
Tom O'Neill923c0dc2014-03-03 11:07:55 -08005330 * Comma-separated list of location providers that activities may access. Do not rely on
5331 * this value being present in settings.db or on ContentObserver notifications on the
5332 * corresponding Uri.
Tom O'Neilla324ac72013-08-26 14:40:23 -07005333 *
Tom O'Neill923c0dc2014-03-03 11:07:55 -08005334 * @deprecated use {@link #LOCATION_MODE} and
5335 * {@link LocationManager#MODE_CHANGED_ACTION} (or
5336 * {@link LocationManager#PROVIDERS_CHANGED_ACTION})
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005337 */
Tom O'Neilla324ac72013-08-26 14:40:23 -07005338 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005339 public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005340
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005341 /**
Tom O'Neill7f6f4572013-08-27 10:53:15 -07005342 * The degree of location access enabled by the user.
Tom O'Neill923c0dc2014-03-03 11:07:55 -08005343 * <p>
Tom O'Neill7f6f4572013-08-27 10:53:15 -07005344 * When used with {@link #putInt(ContentResolver, String, int)}, must be one of {@link
5345 * #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY}, {@link
5346 * #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}. When used with {@link
5347 * #getInt(ContentResolver, String)}, the caller must gracefully handle additional location
5348 * modes that might be added in the future.
Tom O'Neill923c0dc2014-03-03 11:07:55 -08005349 * <p>
5350 * Note: do not rely on this value being present in settings.db or on ContentObserver
5351 * notifications for the corresponding Uri. Use {@link LocationManager#MODE_CHANGED_ACTION}
5352 * to receive changes in this value.
Tom O'Neilla324ac72013-08-26 14:40:23 -07005353 */
5354 public static final String LOCATION_MODE = "location_mode";
Lifu Tangd1fa1d62015-11-25 21:42:44 -08005355 /**
5356 * Stores the previous location mode when {@link #LOCATION_MODE} is set to
5357 * {@link #LOCATION_MODE_OFF}
5358 * @hide
5359 */
5360 public static final String LOCATION_PREVIOUS_MODE = "location_previous_mode";
Tom O'Neilla324ac72013-08-26 14:40:23 -07005361
5362 /**
Lifu Tangd1fa1d62015-11-25 21:42:44 -08005363 * Sets all location providers to the previous states before location was turned off.
5364 * @hide
5365 */
5366 public static final int LOCATION_MODE_PREVIOUS = -1;
5367 /**
Tom O'Neill7f6f4572013-08-27 10:53:15 -07005368 * Location access disabled.
Tom O'Neill1f48b782013-08-19 18:14:56 -07005369 */
5370 public static final int LOCATION_MODE_OFF = 0;
5371 /**
5372 * Network Location Provider disabled, but GPS and other sensors enabled.
5373 */
5374 public static final int LOCATION_MODE_SENSORS_ONLY = 1;
5375 /**
Tom O'Neilld5759432013-09-11 11:03:03 -07005376 * Reduced power usage, such as limiting the number of GPS updates per hour. Requests
5377 * with {@link android.location.Criteria#POWER_HIGH} may be downgraded to
5378 * {@link android.location.Criteria#POWER_MEDIUM}.
Tom O'Neill1f48b782013-08-19 18:14:56 -07005379 */
5380 public static final int LOCATION_MODE_BATTERY_SAVING = 2;
5381 /**
5382 * Best-effort location computation allowed.
5383 */
5384 public static final int LOCATION_MODE_HIGH_ACCURACY = 3;
5385
5386 /**
Danielle Millett925a7d82012-03-19 18:02:20 -04005387 * A flag containing settings used for biometric weak
5388 * @hide
5389 */
Adrian Roos230635e2015-01-07 20:50:29 +01005390 @Deprecated
Danielle Millett925a7d82012-03-19 18:02:20 -04005391 public static final String LOCK_BIOMETRIC_WEAK_FLAGS =
5392 "lock_biometric_weak_flags";
5393
5394 /**
Jason Monk94cfd9d2014-10-31 13:18:21 -04005395 * Whether lock-to-app will lock the keyguard when exiting.
5396 * @hide
5397 */
5398 public static final String LOCK_TO_APP_EXIT_LOCKED = "lock_to_app_exit_locked";
5399
5400 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08005401 * Whether autolock is enabled (0 = false, 1 = true)
Adrian Roos9dd16eb2015-01-08 16:20:49 +01005402 *
5403 * @deprecated Use {@link android.app.KeyguardManager} to determine the state and security
Adrian Roos7811d9f2015-07-27 15:10:13 -07005404 * level of the keyguard. Accessing this setting from an app that is targeting
Deepanshu Guptae836a222015-07-31 12:11:07 -07005405 * {@link VERSION_CODES#M} or later throws a {@code SecurityException}.
Amith Yamasani156c4352010-03-05 17:10:03 -08005406 */
Adrian Roos9dd16eb2015-01-08 16:20:49 +01005407 @Deprecated
Amith Yamasani156c4352010-03-05 17:10:03 -08005408 public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock";
5409
5410 /**
5411 * Whether lock pattern is visible as user enters (0 = false, 1 = true)
Adrian Roos7811d9f2015-07-27 15:10:13 -07005412 *
5413 * @deprecated Accessing this setting from an app that is targeting
Deepanshu Guptae836a222015-07-31 12:11:07 -07005414 * {@link VERSION_CODES#M} or later throws a {@code SecurityException}.
Amith Yamasani156c4352010-03-05 17:10:03 -08005415 */
Adrian Roos7811d9f2015-07-27 15:10:13 -07005416 @Deprecated
Amith Yamasani156c4352010-03-05 17:10:03 -08005417 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
5418
5419 /**
Jeff Sharkey5ed9d682012-10-10 14:28:27 -07005420 * Whether lock pattern will vibrate as user enters (0 = false, 1 =
5421 * true)
5422 *
5423 * @deprecated Starting in {@link VERSION_CODES#JELLY_BEAN_MR1} the
5424 * lockscreen uses
5425 * {@link Settings.System#HAPTIC_FEEDBACK_ENABLED}.
Adrian Roos7811d9f2015-07-27 15:10:13 -07005426 * Accessing this setting from an app that is targeting
Deepanshu Guptae836a222015-07-31 12:11:07 -07005427 * {@link VERSION_CODES#M} or later throws a {@code SecurityException}.
Amith Yamasani156c4352010-03-05 17:10:03 -08005428 */
Jeff Sharkey5ed9d682012-10-10 14:28:27 -07005429 @Deprecated
5430 public static final String
5431 LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = "lock_pattern_tactile_feedback_enabled";
Amith Yamasani156c4352010-03-05 17:10:03 -08005432
5433 /**
Jim Millerbc4603b2010-08-30 21:21:34 -07005434 * This preference allows the device to be locked given time after screen goes off,
5435 * subject to current DeviceAdmin policy limits.
5436 * @hide
5437 */
5438 public static final String LOCK_SCREEN_LOCK_AFTER_TIMEOUT = "lock_screen_lock_after_timeout";
5439
5440
5441 /**
John Spurlock5f050e52012-10-27 10:44:19 -04005442 * This preference contains the string that shows for owner info on LockScreen.
Jim Miller253a5ef2010-10-13 20:57:29 -07005443 * @hide
Jim Miller187ec582013-04-15 18:27:54 -07005444 * @deprecated
Jim Miller253a5ef2010-10-13 20:57:29 -07005445 */
Aurimas Liutikas514c5ef2016-05-24 15:22:55 -07005446 @Deprecated
Jim Miller253a5ef2010-10-13 20:57:29 -07005447 public static final String LOCK_SCREEN_OWNER_INFO = "lock_screen_owner_info";
5448
5449 /**
John Spurlock5f050e52012-10-27 10:44:19 -04005450 * Ids of the user-selected appwidgets on the lockscreen (comma-delimited).
Jim Millerf229e4d2012-09-12 20:32:50 -07005451 * @hide
5452 */
Adrian Roos230635e2015-01-07 20:50:29 +01005453 @Deprecated
Michael Jurkaaa2859a2012-10-24 12:46:49 -07005454 public static final String LOCK_SCREEN_APPWIDGET_IDS =
5455 "lock_screen_appwidget_ids";
Jim Millerf229e4d2012-09-12 20:32:50 -07005456
5457 /**
Jim Miller51117262012-11-04 17:58:09 -08005458 * Id of the appwidget shown on the lock screen when appwidgets are disabled.
5459 * @hide
5460 */
Adrian Roos230635e2015-01-07 20:50:29 +01005461 @Deprecated
Jim Miller51117262012-11-04 17:58:09 -08005462 public static final String LOCK_SCREEN_FALLBACK_APPWIDGET_ID =
5463 "lock_screen_fallback_appwidget_id";
5464
5465 /**
John Spurlock5f050e52012-10-27 10:44:19 -04005466 * Index of the lockscreen appwidget to restore, -1 if none.
5467 * @hide
5468 */
Adrian Roos230635e2015-01-07 20:50:29 +01005469 @Deprecated
John Spurlock5f050e52012-10-27 10:44:19 -04005470 public static final String LOCK_SCREEN_STICKY_APPWIDGET =
5471 "lock_screen_sticky_appwidget";
5472
5473 /**
5474 * This preference enables showing the owner info on LockScreen.
Jim Miller253a5ef2010-10-13 20:57:29 -07005475 * @hide
Jim Miller187ec582013-04-15 18:27:54 -07005476 * @deprecated
Jim Miller253a5ef2010-10-13 20:57:29 -07005477 */
Aurimas Liutikas514c5ef2016-05-24 15:22:55 -07005478 @Deprecated
Jim Miller253a5ef2010-10-13 20:57:29 -07005479 public static final String LOCK_SCREEN_OWNER_INFO_ENABLED =
5480 "lock_screen_owner_info_enabled";
5481
5482 /**
Dan Sandler5d7c3cc2014-02-18 17:35:15 -05005483 * When set by a user, allows notifications to be shown atop a securely locked screen
5484 * in their full "private" form (same as when the device is unlocked).
Dan Sandlerfd16d562014-02-13 18:43:31 -08005485 * @hide
5486 */
5487 public static final String LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS =
5488 "lock_screen_allow_private_notifications";
5489
5490 /**
Adrian Roos3aec6382016-02-05 14:19:01 -08005491 * When set by a user, allows notification remote input atop a securely locked screen
5492 * without having to unlock
5493 * @hide
5494 */
5495 public static final String LOCK_SCREEN_ALLOW_REMOTE_INPUT =
5496 "lock_screen_allow_remote_input";
5497
5498 /**
Chris Wrencd8f4f72014-08-27 18:48:13 -04005499 * Set by the system to track if the user needs to see the call to action for
5500 * the lockscreen notification policy.
5501 * @hide
5502 */
5503 public static final String SHOW_NOTE_ABOUT_NOTIFICATION_HIDING =
5504 "show_note_about_notification_hiding";
5505
5506 /**
Adrian Roos3870d452014-09-05 18:22:28 +02005507 * Set to 1 by the system after trust agents have been initialized.
5508 * @hide
5509 */
5510 public static final String TRUST_AGENTS_INITIALIZED =
5511 "trust_agents_initialized";
5512
5513 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005514 * The Logging ID (a unique 64-bit value) as a hex string.
5515 * Used as a pseudonymous identifier for logging.
5516 * @deprecated This identifier is poorly initialized and has
5517 * many collisions. It should not be used.
5518 */
5519 @Deprecated
5520 public static final String LOGGING_ID = "logging_id";
5521
5522 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005523 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005524 */
Christopher Tate06efb532012-08-24 15:29:27 -07005525 @Deprecated
5526 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005527
5528 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08005529 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005530 */
5531 public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005532
5533 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08005534 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005535 */
5536 public static final String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005537
5538 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08005539 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005540 */
5541 public static final String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005542
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005543 /**
5544 * Settings classname to launch when Settings is clicked from All
5545 * Applications. Needed because of user testing between the old
5546 * and new Settings apps.
5547 */
5548 // TODO: 881807
5549 public static final String SETTINGS_CLASSNAME = "settings_classname";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005550
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005551 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005552 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005553 */
Christopher Tate06efb532012-08-24 15:29:27 -07005554 @Deprecated
5555 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005556
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005557 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005558 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005559 */
Christopher Tate06efb532012-08-24 15:29:27 -07005560 @Deprecated
5561 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005562
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005563 /**
svetoslavganov75986cf2009-05-14 22:28:01 -07005564 * If accessibility is enabled.
5565 */
5566 public static final String ACCESSIBILITY_ENABLED = "accessibility_enabled";
5567
5568 /**
Phil Weaverce687c52017-03-15 08:51:52 -07005569 * Setting specifying if the accessibility shortcut is enabled.
5570 * @hide
5571 */
5572 public static final String ACCESSIBILITY_SHORTCUT_ENABLED =
5573 "accessibility_shortcut_enabled";
5574
5575 /**
5576 * Setting specifying if the accessibility shortcut is enabled.
5577 * @hide
5578 */
5579 public static final String ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN =
5580 "accessibility_shortcut_on_lock_screen";
5581
5582 /**
Phil Weaver106fe732016-11-22 18:18:39 -08005583 * Setting specifying if the accessibility shortcut dialog has been shown to this user.
5584 * @hide
5585 */
5586 public static final String ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN =
5587 "accessibility_shortcut_dialog_shown";
5588
5589 /**
Phil Weaverce687c52017-03-15 08:51:52 -07005590 * Setting specifying the accessibility service to be toggled via the accessibility
Phil Weaver106fe732016-11-22 18:18:39 -08005591 * shortcut. Must be its flattened {@link ComponentName}.
5592 * @hide
5593 */
5594 public static final String ACCESSIBILITY_SHORTCUT_TARGET_SERVICE =
5595 "accessibility_shortcut_target_service";
5596
5597 /**
Casey Burkhardt5e8b9802017-03-24 10:07:20 -07005598 * Setting specifying the accessibility service or feature to be toggled via the
5599 * accessibility button in the navigation bar. This is either a flattened
5600 * {@link ComponentName} or the class name of a system class implementing a supported
5601 * accessibility feature.
5602 * @hide
5603 */
5604 public static final String ACCESSIBILITY_BUTTON_TARGET_COMPONENT =
5605 "accessibility_button_target_component";
5606
5607 /**
Svetoslav Ganov00aabf72011-07-21 11:35:03 -07005608 * If touch exploration is enabled.
Svetoslav Ganov35bfede2011-07-14 17:57:06 -07005609 */
Svetoslav Ganov00aabf72011-07-21 11:35:03 -07005610 public static final String TOUCH_EXPLORATION_ENABLED = "touch_exploration_enabled";
Svetoslav Ganov35bfede2011-07-14 17:57:06 -07005611
5612 /**
svetoslavganov75986cf2009-05-14 22:28:01 -07005613 * List of the enabled accessibility providers.
5614 */
5615 public static final String ENABLED_ACCESSIBILITY_SERVICES =
5616 "enabled_accessibility_services";
5617
5618 /**
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07005619 * List of the accessibility services to which the user has granted
Svetoslav Ganov9a4c5cd2012-05-30 14:06:32 -07005620 * permission to put the device into touch exploration mode.
5621 *
5622 * @hide
5623 */
5624 public static final String TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES =
5625 "touch_exploration_granted_accessibility_services";
5626
5627 /**
Svetoslav Ganov55f937a2011-12-05 11:42:07 -08005628 * Whether to speak passwords while in accessibility mode.
Phil Weaver385912e2017-02-10 10:06:56 -08005629 *
5630 * @deprecated The speaking of passwords is controlled by individual accessibility services.
5631 * Apps should ignore this setting and provide complete information to accessibility
5632 * at all times, which was the behavior when this value was {@code true}.
Svetoslav Ganov55f937a2011-12-05 11:42:07 -08005633 */
Phil Weaver385912e2017-02-10 10:06:56 -08005634 @Deprecated
Svetoslav Ganov55f937a2011-12-05 11:42:07 -08005635 public static final String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password";
5636
5637 /**
Chris Craikcce47eb2014-07-16 15:12:15 -07005638 * Whether to draw text with high contrast while in accessibility mode.
5639 *
5640 * @hide
5641 */
5642 public static final String ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED =
5643 "high_text_contrast_enabled";
5644
5645 /**
Casey Burkhardt74922c62017-02-13 12:43:16 -08005646 * Setting that specifies whether the display magnification is enabled via a system-wide
5647 * triple tap gesture. Display magnifications allows the user to zoom in the display content
5648 * and is targeted to low vision users. The current magnification scale is controlled by
5649 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}.
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07005650 *
5651 * @hide
5652 */
5653 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED =
5654 "accessibility_display_magnification_enabled";
5655
5656 /**
Casey Burkhardt74922c62017-02-13 12:43:16 -08005657 * Setting that specifies whether the display magnification is enabled via a shortcut
5658 * affordance within the system's navigation area. Display magnifications allows the user to
5659 * zoom in the display content and is targeted to low vision users. The current
5660 * magnification scale is controlled by {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}.
5661 *
5662 * @hide
5663 */
5664 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED =
5665 "accessibility_display_magnification_navbar_enabled";
5666
5667 /**
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07005668 * Setting that specifies what the display magnification scale is.
5669 * Display magnifications allows the user to zoom in the display
5670 * content and is targeted to low vision users. Whether a display
5671 * magnification is performed is controlled by
Casey Burkhardt74922c62017-02-13 12:43:16 -08005672 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED} and
5673 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED}
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07005674 *
5675 * @hide
5676 */
5677 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE =
5678 "accessibility_display_magnification_scale";
5679
5680 /**
Phil Weaver89e3ffc2016-09-19 13:51:10 -07005681 * Unused mangnification setting
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07005682 *
5683 * @hide
Phil Weaver89e3ffc2016-09-19 13:51:10 -07005684 * @deprecated
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07005685 */
Steve McKayea93fe72016-12-02 11:35:35 -08005686 @Deprecated
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07005687 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE =
5688 "accessibility_display_magnification_auto_update";
5689
5690 /**
Anna Galusza9b278112016-01-04 11:37:37 -08005691 * Setting that specifies what mode the soft keyboard is in (default or hidden). Can be
5692 * modified from an AccessibilityService using the SoftKeyboardController.
5693 *
5694 * @hide
5695 */
5696 public static final String ACCESSIBILITY_SOFT_KEYBOARD_MODE =
5697 "accessibility_soft_keyboard_mode";
5698
5699 /**
5700 * Default soft keyboard behavior.
5701 *
5702 * @hide
5703 */
5704 public static final int SHOW_MODE_AUTO = 0;
5705
5706 /**
5707 * Soft keyboard is never shown.
5708 *
5709 * @hide
5710 */
5711 public static final int SHOW_MODE_HIDDEN = 1;
5712
5713 /**
Alan Viveretteef793802013-07-23 14:15:28 -07005714 * Setting that specifies whether timed text (captions) should be
5715 * displayed in video content. Text display properties are controlled by
5716 * the following settings:
5717 * <ul>
5718 * <li>{@link #ACCESSIBILITY_CAPTIONING_LOCALE}
5719 * <li>{@link #ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR}
5720 * <li>{@link #ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR}
5721 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_COLOR}
5722 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_TYPE}
5723 * <li>{@link #ACCESSIBILITY_CAPTIONING_TYPEFACE}
Alan Viverette69ce69b2013-08-29 12:23:48 -07005724 * <li>{@link #ACCESSIBILITY_CAPTIONING_FONT_SCALE}
Alan Viveretteef793802013-07-23 14:15:28 -07005725 * </ul>
5726 *
5727 * @hide
5728 */
5729 public static final String ACCESSIBILITY_CAPTIONING_ENABLED =
5730 "accessibility_captioning_enabled";
5731
5732 /**
5733 * Setting that specifies the language for captions as a locale string,
5734 * e.g. en_US.
5735 *
5736 * @see java.util.Locale#toString
5737 * @hide
5738 */
5739 public static final String ACCESSIBILITY_CAPTIONING_LOCALE =
5740 "accessibility_captioning_locale";
5741
5742 /**
Alan Viverette43a1e3d2013-08-02 16:45:03 -07005743 * Integer property that specifies the preset style for captions, one
5744 * of:
5745 * <ul>
Alan Viverette69ce69b2013-08-29 12:23:48 -07005746 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESET_CUSTOM}
5747 * <li>a valid index of {@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESETS}
Alan Viverette43a1e3d2013-08-02 16:45:03 -07005748 * </ul>
5749 *
5750 * @see java.util.Locale#toString
5751 * @hide
5752 */
5753 public static final String ACCESSIBILITY_CAPTIONING_PRESET =
5754 "accessibility_captioning_preset";
5755
5756 /**
Alan Viveretteef793802013-07-23 14:15:28 -07005757 * Integer property that specifes the background color for captions as a
5758 * packed 32-bit color.
5759 *
5760 * @see android.graphics.Color#argb
5761 * @hide
5762 */
5763 public static final String ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR =
5764 "accessibility_captioning_background_color";
5765
5766 /**
5767 * Integer property that specifes the foreground color for captions as a
5768 * packed 32-bit color.
5769 *
5770 * @see android.graphics.Color#argb
5771 * @hide
5772 */
5773 public static final String ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR =
5774 "accessibility_captioning_foreground_color";
5775
5776 /**
5777 * Integer property that specifes the edge type for captions, one of:
5778 * <ul>
Alan Viverette69ce69b2013-08-29 12:23:48 -07005779 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_NONE}
5780 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_OUTLINE}
5781 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_DROP_SHADOW}
Alan Viveretteef793802013-07-23 14:15:28 -07005782 * </ul>
5783 *
5784 * @see #ACCESSIBILITY_CAPTIONING_EDGE_COLOR
5785 * @hide
5786 */
5787 public static final String ACCESSIBILITY_CAPTIONING_EDGE_TYPE =
5788 "accessibility_captioning_edge_type";
5789
5790 /**
5791 * Integer property that specifes the edge color for captions as a
5792 * packed 32-bit color.
5793 *
5794 * @see #ACCESSIBILITY_CAPTIONING_EDGE_TYPE
5795 * @see android.graphics.Color#argb
5796 * @hide
5797 */
5798 public static final String ACCESSIBILITY_CAPTIONING_EDGE_COLOR =
5799 "accessibility_captioning_edge_color";
5800
5801 /**
Alan Viverette55d70622013-12-11 15:22:14 -08005802 * Integer property that specifes the window color for captions as a
5803 * packed 32-bit color.
5804 *
5805 * @see android.graphics.Color#argb
5806 * @hide
5807 */
5808 public static final String ACCESSIBILITY_CAPTIONING_WINDOW_COLOR =
5809 "accessibility_captioning_window_color";
5810
5811 /**
Alan Viveretteef793802013-07-23 14:15:28 -07005812 * String property that specifies the typeface for captions, one of:
5813 * <ul>
5814 * <li>DEFAULT
5815 * <li>MONOSPACE
5816 * <li>SANS_SERIF
5817 * <li>SERIF
5818 * </ul>
5819 *
5820 * @see android.graphics.Typeface
5821 * @hide
5822 */
5823 public static final String ACCESSIBILITY_CAPTIONING_TYPEFACE =
5824 "accessibility_captioning_typeface";
5825
5826 /**
Alan Viverette69ce69b2013-08-29 12:23:48 -07005827 * Floating point property that specifies font scaling for captions.
Alan Viveretteef793802013-07-23 14:15:28 -07005828 *
5829 * @hide
5830 */
Alan Viverette69ce69b2013-08-29 12:23:48 -07005831 public static final String ACCESSIBILITY_CAPTIONING_FONT_SCALE =
5832 "accessibility_captioning_font_scale";
Alan Viveretteef793802013-07-23 14:15:28 -07005833
5834 /**
Alan Viverette410d4e32013-09-30 15:37:38 -07005835 * Setting that specifies whether display color inversion is enabled.
Alan Viverette410d4e32013-09-30 15:37:38 -07005836 */
5837 public static final String ACCESSIBILITY_DISPLAY_INVERSION_ENABLED =
5838 "accessibility_display_inversion_enabled";
5839
5840 /**
Alan Viverette410d4e32013-09-30 15:37:38 -07005841 * Setting that specifies whether display color space adjustment is
5842 * enabled.
5843 *
5844 * @hide
5845 */
5846 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED =
5847 "accessibility_display_daltonizer_enabled";
5848
5849 /**
5850 * Integer property that specifies the type of color space adjustment to
5851 * perform. Valid values are defined in AccessibilityManager.
5852 *
5853 * @hide
5854 */
5855 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER =
5856 "accessibility_display_daltonizer";
5857
5858 /**
Toni Barzic386f8342015-09-09 12:30:41 -07005859 * Setting that specifies whether automatic click when the mouse pointer stops moving is
5860 * enabled.
5861 *
5862 * @hide
5863 */
5864 public static final String ACCESSIBILITY_AUTOCLICK_ENABLED =
5865 "accessibility_autoclick_enabled";
5866
5867 /**
5868 * Integer setting specifying amount of time in ms the mouse pointer has to stay still
5869 * before performing click when {@link #ACCESSIBILITY_AUTOCLICK_ENABLED} is set.
5870 *
5871 * @see #ACCESSIBILITY_AUTOCLICK_ENABLED
5872 * @hide
5873 */
5874 public static final String ACCESSIBILITY_AUTOCLICK_DELAY =
5875 "accessibility_autoclick_delay";
5876
5877 /**
Jun Mukai19a56012015-11-24 11:25:52 -08005878 * Whether or not larger size icons are used for the pointer of mouse/trackpad for
5879 * accessibility.
5880 * (0 = false, 1 = true)
5881 * @hide
5882 */
5883 public static final String ACCESSIBILITY_LARGE_POINTER_ICON =
5884 "accessibility_large_pointer_icon";
5885
5886 /**
Toni Barzic386f8342015-09-09 12:30:41 -07005887 * The timeout for considering a press to be a long press in milliseconds.
Svetoslav Ganov54d068e2011-03-02 12:58:40 -08005888 * @hide
5889 */
5890 public static final String LONG_PRESS_TIMEOUT = "long_press_timeout";
5891
5892 /**
Anthony Hugh96e9cc52016-07-12 15:17:24 -07005893 * The duration in milliseconds between the first tap's up event and the second tap's
5894 * down event for an interaction to be considered part of the same multi-press.
5895 * @hide
5896 */
5897 public static final String MULTI_PRESS_TIMEOUT = "multi_press_timeout";
5898
5899 /**
Svetoslav Ganov6bd20bc2013-09-02 15:24:45 -07005900 * List of the enabled print services.
Philip P. Moltmann8141bdf2015-12-21 17:03:05 -08005901 *
5902 * N and beyond uses {@link #DISABLED_PRINT_SERVICES}. But this might be used in an upgrade
5903 * from pre-N.
5904 *
Svetoslav Ganov4b9a4d12013-06-11 15:20:06 -07005905 * @hide
5906 */
5907 public static final String ENABLED_PRINT_SERVICES =
5908 "enabled_print_services";
5909
5910 /**
Philip P. Moltmann8141bdf2015-12-21 17:03:05 -08005911 * List of the disabled print services.
5912 *
Svetoslav Ganov6bd20bc2013-09-02 15:24:45 -07005913 * @hide
5914 */
Svetoslav Ganov2dcedc122017-06-07 18:50:02 -07005915 @TestApi
Philip P. Moltmann8141bdf2015-12-21 17:03:05 -08005916 public static final String DISABLED_PRINT_SERVICES =
5917 "disabled_print_services";
Svetoslav Ganov6bd20bc2013-09-02 15:24:45 -07005918
5919 /**
Alan Viverette5e8d8372016-02-03 15:38:59 -05005920 * The saved value for WindowManagerService.setForcedDisplayDensity()
5921 * formatted as a single integer representing DPI. If unset, then use
5922 * the real display density.
5923 *
5924 * @hide
5925 */
5926 public static final String DISPLAY_DENSITY_FORCED = "display_density_forced";
5927
5928 /**
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07005929 * Setting to always use the default text-to-speech settings regardless
5930 * of the application settings.
5931 * 1 = override application settings,
5932 * 0 = use application settings (if specified).
Narayan Kamath6d632962011-08-24 11:51:37 +01005933 *
5934 * @deprecated The value of this setting is no longer respected by
5935 * the framework text to speech APIs as of the Ice Cream Sandwich release.
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07005936 */
Narayan Kamath6d632962011-08-24 11:51:37 +01005937 @Deprecated
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07005938 public static final String TTS_USE_DEFAULTS = "tts_use_defaults";
5939
5940 /**
5941 * Default text-to-speech engine speech rate. 100 = 1x
5942 */
5943 public static final String TTS_DEFAULT_RATE = "tts_default_rate";
5944
5945 /**
5946 * Default text-to-speech engine pitch. 100 = 1x
5947 */
5948 public static final String TTS_DEFAULT_PITCH = "tts_default_pitch";
5949
5950 /**
5951 * Default text-to-speech engine.
5952 */
5953 public static final String TTS_DEFAULT_SYNTH = "tts_default_synth";
5954
5955 /**
Jean-Michel Trivif4782672009-06-09 16:22:48 -07005956 * Default text-to-speech language.
Narayan Kamath6d632962011-08-24 11:51:37 +01005957 *
5958 * @deprecated this setting is no longer in use, as of the Ice Cream
5959 * Sandwich release. Apps should never need to read this setting directly,
5960 * instead can query the TextToSpeech framework classes for the default
5961 * locale. {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivif4782672009-06-09 16:22:48 -07005962 */
Narayan Kamath6d632962011-08-24 11:51:37 +01005963 @Deprecated
Jean-Michel Trivif4782672009-06-09 16:22:48 -07005964 public static final String TTS_DEFAULT_LANG = "tts_default_lang";
5965
5966 /**
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07005967 * Default text-to-speech country.
Narayan Kamath6d632962011-08-24 11:51:37 +01005968 *
5969 * @deprecated this setting is no longer in use, as of the Ice Cream
5970 * Sandwich release. Apps should never need to read this setting directly,
5971 * instead can query the TextToSpeech framework classes for the default
5972 * locale. {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07005973 */
Narayan Kamath6d632962011-08-24 11:51:37 +01005974 @Deprecated
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07005975 public static final String TTS_DEFAULT_COUNTRY = "tts_default_country";
5976
5977 /**
5978 * Default text-to-speech locale variant.
Narayan Kamath6d632962011-08-24 11:51:37 +01005979 *
5980 * @deprecated this setting is no longer in use, as of the Ice Cream
5981 * Sandwich release. Apps should never need to read this setting directly,
5982 * instead can query the TextToSpeech framework classes for the
5983 * locale that is in use {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07005984 */
Narayan Kamath6d632962011-08-24 11:51:37 +01005985 @Deprecated
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07005986 public static final String TTS_DEFAULT_VARIANT = "tts_default_variant";
5987
5988 /**
Narayan Kamathe5b8c4d2011-08-22 15:37:47 +01005989 * Stores the default tts locales on a per engine basis. Stored as
5990 * a comma seperated list of values, each value being of the form
5991 * {@code engine_name:locale} for example,
Narayan Kamath6d632962011-08-24 11:51:37 +01005992 * {@code com.foo.ttsengine:eng-USA,com.bar.ttsengine:esp-ESP}. This
5993 * supersedes {@link #TTS_DEFAULT_LANG}, {@link #TTS_DEFAULT_COUNTRY} and
5994 * {@link #TTS_DEFAULT_VARIANT}. Apps should never need to read this
5995 * setting directly, and can query the TextToSpeech framework classes
5996 * for the locale that is in use.
Narayan Kamathe5b8c4d2011-08-22 15:37:47 +01005997 *
5998 * @hide
5999 */
6000 public static final String TTS_DEFAULT_LOCALE = "tts_default_locale";
6001
6002 /**
Charles Chenceffa152010-03-16 21:18:10 -07006003 * Space delimited list of plugin packages that are enabled.
6004 */
6005 public static final String TTS_ENABLED_PLUGINS = "tts_enabled_plugins";
6006
6007 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07006008 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON}
6009 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006010 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07006011 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006012 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
Christopher Tate6f5a9a92012-09-14 17:24:28 -07006013 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006014
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006015 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07006016 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY}
6017 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006018 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07006019 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006020 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
Christopher Tate6f5a9a92012-09-14 17:24:28 -07006021 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006022
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006023 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07006024 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
6025 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006026 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07006027 @Deprecated
6028 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT =
6029 Global.WIFI_NUM_OPEN_NETWORKS_KEPT;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006030
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006031 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07006032 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON}
6033 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006034 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07006035 @Deprecated
6036 public static final String WIFI_ON = Global.WIFI_ON;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006037
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006038 /**
6039 * The acceptable packet loss percentage (range 0 - 100) before trying
6040 * another AP on the same network.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006041 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006042 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07006043 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006044 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
6045 "wifi_watchdog_acceptable_packet_loss_percentage";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006046
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006047 /**
6048 * The number of access points required for a network in order for the
6049 * watchdog to monitor it.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006050 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006051 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07006052 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006053 public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006054
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006055 /**
6056 * The delay between background checks.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006057 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006058 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07006059 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006060 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
6061 "wifi_watchdog_background_check_delay_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006062
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006063 /**
6064 * Whether the Wi-Fi watchdog is enabled for background checking even
6065 * after it thinks the user has connected to a good access point.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006066 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006067 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07006068 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006069 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
6070 "wifi_watchdog_background_check_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006071
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006072 /**
6073 * The timeout for a background ping
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006074 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006075 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07006076 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006077 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
6078 "wifi_watchdog_background_check_timeout_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006079
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006080 /**
6081 * The number of initial pings to perform that *may* be ignored if they
6082 * fail. Again, if these fail, they will *not* be used in packet loss
6083 * calculation. For example, one network always seemed to time out for
6084 * the first couple pings, so this is set to 3 by default.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006085 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006086 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07006087 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006088 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
6089 "wifi_watchdog_initial_ignored_ping_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006090
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006091 /**
6092 * The maximum number of access points (per network) to attempt to test.
6093 * If this number is reached, the watchdog will no longer monitor the
6094 * initial connection state for the network. This is a safeguard for
6095 * networks containing multiple APs whose DNS does not respond to pings.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006096 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006097 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07006098 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006099 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = "wifi_watchdog_max_ap_checks";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006100
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006101 /**
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07006102 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006103 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07006104 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006105 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
6106
6107 /**
6108 * A comma-separated list of SSIDs for which the Wi-Fi watchdog should be enabled.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006109 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006110 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07006111 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006112 public static final String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list";
6113
6114 /**
6115 * The number of pings to test if an access point is a good connection.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006116 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006117 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07006118 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006119 public static final String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006120
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006121 /**
6122 * The delay between pings.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006123 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006124 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07006125 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006126 public static final String WIFI_WATCHDOG_PING_DELAY_MS = "wifi_watchdog_ping_delay_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006127
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006128 /**
6129 * The timeout per ping.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006130 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006131 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07006132 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006133 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006134
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006135 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006136 * @deprecated Use
6137 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006138 */
Christopher Tate06efb532012-08-24 15:29:27 -07006139 @Deprecated
6140 public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006141
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006142 /**
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006143 * @deprecated Use
6144 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006145 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07006146 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006147 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006148 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006149
6150 /**
Jeremy Joslin79294842014-12-03 17:15:28 -08006151 * The number of milliseconds to hold on to a PendingIntent based request. This delay gives
6152 * the receivers of the PendingIntent an opportunity to make a new network request before
6153 * the Network satisfying the request is potentially removed.
6154 *
6155 * @hide
6156 */
6157 public static final String CONNECTIVITY_RELEASE_PENDING_INTENT_DELAY_MS =
6158 "connectivity_release_pending_intent_delay_ms";
6159
6160 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07006161 * Whether background data usage is allowed.
6162 *
6163 * @deprecated As of {@link VERSION_CODES#ICE_CREAM_SANDWICH},
6164 * availability of background data depends on several
6165 * combined factors. When background data is unavailable,
6166 * {@link ConnectivityManager#getActiveNetworkInfo()} will
6167 * now appear disconnected.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006168 */
Jeff Sharkey3a844fc2011-08-16 14:37:57 -07006169 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006170 public static final String BACKGROUND_DATA = "background_data";
Wink Saville04e71b32009-04-02 11:00:54 -07006171
6172 /**
Bjorn Bringert98bfa392010-03-24 10:59:48 +00006173 * Origins for which browsers should allow geolocation by default.
6174 * The value is a space-separated list of origins.
6175 */
6176 public static final String ALLOWED_GEOLOCATION_ORIGINS
6177 = "allowed_geolocation_origins";
6178
6179 /**
Wink Savillee9b06d72009-05-18 21:47:50 -07006180 * The preferred TTY mode 0 = TTy Off, CDMA default
6181 * 1 = TTY Full
6182 * 2 = TTY HCO
6183 * 3 = TTY VCO
6184 * @hide
6185 */
6186 public static final String PREFERRED_TTY_MODE =
6187 "preferred_tty_mode";
6188
Wink Saville04e71b32009-04-02 11:00:54 -07006189 /**
Wink Saville04e71b32009-04-02 11:00:54 -07006190 * Whether the enhanced voice privacy mode is enabled.
6191 * 0 = normal voice privacy
6192 * 1 = enhanced voice privacy
6193 * @hide
6194 */
6195 public static final String ENHANCED_VOICE_PRIVACY_ENABLED = "enhanced_voice_privacy_enabled";
6196
6197 /**
6198 * Whether the TTY mode mode is enabled.
6199 * 0 = disabled
6200 * 1 = enabled
6201 * @hide
6202 */
6203 public static final String TTY_MODE_ENABLED = "tty_mode_enabled";
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07006204
6205 /**
Christopher Tate8031a3d2009-07-06 16:36:05 -07006206 * Controls whether settings backup is enabled.
Dianne Hackborncf098292009-07-01 19:55:20 -07006207 * Type: int ( 0 = disabled, 1 = enabled )
6208 * @hide
6209 */
6210 public static final String BACKUP_ENABLED = "backup_enabled";
6211
6212 /**
Christopher Tatecce9da52010-02-03 15:11:15 -08006213 * Controls whether application data is automatically restored from backup
6214 * at install time.
6215 * Type: int ( 0 = disabled, 1 = enabled )
6216 * @hide
6217 */
6218 public static final String BACKUP_AUTO_RESTORE = "backup_auto_restore";
6219
6220 /**
Christopher Tate8031a3d2009-07-06 16:36:05 -07006221 * Indicates whether settings backup has been fully provisioned.
6222 * Type: int ( 0 = unprovisioned, 1 = fully provisioned )
6223 * @hide
6224 */
6225 public static final String BACKUP_PROVISIONED = "backup_provisioned";
6226
6227 /**
Dianne Hackborncf098292009-07-01 19:55:20 -07006228 * Component of the transport to use for backup/restore.
6229 * @hide
6230 */
6231 public static final String BACKUP_TRANSPORT = "backup_transport";
Sanjay Jeyakumar21bf2412009-07-09 13:31:48 -07006232
Dianne Hackbornd7cd29d2009-07-01 11:22:45 -07006233 /**
6234 * Version for which the setup wizard was last shown. Bumped for
6235 * each release when there is new setup information to show.
6236 * @hide
6237 */
6238 public static final String LAST_SETUP_SHOWN = "last_setup_shown";
Dianne Hackborncf098292009-07-01 19:55:20 -07006239
6240 /**
Doug Zongker43866e02010-01-07 12:09:54 -08006241 * The interval in milliseconds after which Wi-Fi is considered idle.
6242 * When idle, it is possible for the device to be switched from Wi-Fi to
6243 * the mobile data network.
6244 * @hide
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006245 * @deprecated Use {@link android.provider.Settings.Global#WIFI_IDLE_MS}
6246 * instead.
Doug Zongker43866e02010-01-07 12:09:54 -08006247 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07006248 @Deprecated
6249 public static final String WIFI_IDLE_MS = Global.WIFI_IDLE_MS;
Doug Zongker43866e02010-01-07 12:09:54 -08006250
6251 /**
Narayan Kamathee69ff42011-06-28 12:07:18 +01006252 * The global search provider chosen by the user (if multiple global
6253 * search providers are installed). This will be the provider returned
6254 * by {@link SearchManager#getGlobalSearchActivity()} if it's still
6255 * installed. This setting is stored as a flattened component name as
6256 * per {@link ComponentName#flattenToString()}.
6257 *
6258 * @hide
6259 */
6260 public static final String SEARCH_GLOBAL_SEARCH_ACTIVITY =
6261 "search_global_search_activity";
6262
6263 /**
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08006264 * The number of promoted sources in GlobalSearch.
6265 * @hide
6266 */
6267 public static final String SEARCH_NUM_PROMOTED_SOURCES = "search_num_promoted_sources";
6268 /**
6269 * The maximum number of suggestions returned by GlobalSearch.
6270 * @hide
6271 */
6272 public static final String SEARCH_MAX_RESULTS_TO_DISPLAY = "search_max_results_to_display";
6273 /**
6274 * The number of suggestions GlobalSearch will ask each non-web search source for.
6275 * @hide
6276 */
6277 public static final String SEARCH_MAX_RESULTS_PER_SOURCE = "search_max_results_per_source";
6278 /**
6279 * The number of suggestions the GlobalSearch will ask the web search source for.
6280 * @hide
6281 */
6282 public static final String SEARCH_WEB_RESULTS_OVERRIDE_LIMIT =
6283 "search_web_results_override_limit";
6284 /**
6285 * The number of milliseconds that GlobalSearch will wait for suggestions from
6286 * promoted sources before continuing with all other sources.
6287 * @hide
6288 */
6289 public static final String SEARCH_PROMOTED_SOURCE_DEADLINE_MILLIS =
6290 "search_promoted_source_deadline_millis";
6291 /**
6292 * The number of milliseconds before GlobalSearch aborts search suggesiton queries.
6293 * @hide
6294 */
6295 public static final String SEARCH_SOURCE_TIMEOUT_MILLIS = "search_source_timeout_millis";
6296 /**
6297 * The maximum number of milliseconds that GlobalSearch shows the previous results
6298 * after receiving a new query.
6299 * @hide
6300 */
6301 public static final String SEARCH_PREFILL_MILLIS = "search_prefill_millis";
6302 /**
6303 * The maximum age of log data used for shortcuts in GlobalSearch.
6304 * @hide
6305 */
6306 public static final String SEARCH_MAX_STAT_AGE_MILLIS = "search_max_stat_age_millis";
6307 /**
6308 * The maximum age of log data used for source ranking in GlobalSearch.
6309 * @hide
6310 */
6311 public static final String SEARCH_MAX_SOURCE_EVENT_AGE_MILLIS =
6312 "search_max_source_event_age_millis";
6313 /**
6314 * The minimum number of impressions needed to rank a source in GlobalSearch.
6315 * @hide
6316 */
6317 public static final String SEARCH_MIN_IMPRESSIONS_FOR_SOURCE_RANKING =
6318 "search_min_impressions_for_source_ranking";
6319 /**
6320 * The minimum number of clicks needed to rank a source in GlobalSearch.
6321 * @hide
6322 */
6323 public static final String SEARCH_MIN_CLICKS_FOR_SOURCE_RANKING =
6324 "search_min_clicks_for_source_ranking";
6325 /**
6326 * The maximum number of shortcuts shown by GlobalSearch.
6327 * @hide
6328 */
6329 public static final String SEARCH_MAX_SHORTCUTS_RETURNED = "search_max_shortcuts_returned";
6330 /**
6331 * The size of the core thread pool for suggestion queries in GlobalSearch.
6332 * @hide
6333 */
6334 public static final String SEARCH_QUERY_THREAD_CORE_POOL_SIZE =
6335 "search_query_thread_core_pool_size";
6336 /**
6337 * The maximum size of the thread pool for suggestion queries in GlobalSearch.
6338 * @hide
6339 */
6340 public static final String SEARCH_QUERY_THREAD_MAX_POOL_SIZE =
6341 "search_query_thread_max_pool_size";
6342 /**
6343 * The size of the core thread pool for shortcut refreshing in GlobalSearch.
6344 * @hide
6345 */
6346 public static final String SEARCH_SHORTCUT_REFRESH_CORE_POOL_SIZE =
6347 "search_shortcut_refresh_core_pool_size";
6348 /**
6349 * The maximum size of the thread pool for shortcut refreshing in GlobalSearch.
6350 * @hide
6351 */
6352 public static final String SEARCH_SHORTCUT_REFRESH_MAX_POOL_SIZE =
6353 "search_shortcut_refresh_max_pool_size";
6354 /**
6355 * The maximun time that excess threads in the GlobalSeach thread pools will
6356 * wait before terminating.
6357 * @hide
6358 */
6359 public static final String SEARCH_THREAD_KEEPALIVE_SECONDS =
6360 "search_thread_keepalive_seconds";
6361 /**
6362 * The maximum number of concurrent suggestion queries to each source.
6363 * @hide
6364 */
6365 public static final String SEARCH_PER_SOURCE_CONCURRENT_QUERY_LIMIT =
6366 "search_per_source_concurrent_query_limit";
6367
San Mehat87734d32010-01-08 12:53:06 -08006368 /**
Sudheer Shanka2250d562016-11-07 15:41:02 -08006369 * Whether or not alert sounds are played on StorageManagerService events.
6370 * (0 = false, 1 = true)
San Mehat87734d32010-01-08 12:53:06 -08006371 * @hide
6372 */
6373 public static final String MOUNT_PLAY_NOTIFICATION_SND = "mount_play_not_snd";
6374
6375 /**
6376 * Whether or not UMS auto-starts on UMS host detection. (0 = false, 1 = true)
6377 * @hide
6378 */
6379 public static final String MOUNT_UMS_AUTOSTART = "mount_ums_autostart";
6380
6381 /**
6382 * Whether or not a notification is displayed on UMS host detection. (0 = false, 1 = true)
6383 * @hide
6384 */
6385 public static final String MOUNT_UMS_PROMPT = "mount_ums_prompt";
6386
6387 /**
6388 * Whether or not a notification is displayed while UMS is enabled. (0 = false, 1 = true)
6389 * @hide
6390 */
6391 public static final String MOUNT_UMS_NOTIFY_ENABLED = "mount_ums_notify_enabled";
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08006392
Dan Egnor42471dd2010-01-07 17:25:22 -08006393 /**
6394 * If nonzero, ANRs in invisible background processes bring up a dialog.
6395 * Otherwise, the process will be silently killed.
Adrian Roos6a7e0892016-08-23 14:26:39 +02006396 *
6397 * Also prevents ANRs and crash dialogs from being suppressed.
Dan Egnor42471dd2010-01-07 17:25:22 -08006398 * @hide
6399 */
6400 public static final String ANR_SHOW_BACKGROUND = "anr_show_background";
Erikeebc8e22010-02-18 13:27:19 -08006401
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08006402 /**
6403 * The {@link ComponentName} string of the service to be used as the voice recognition
6404 * service.
Erikeebc8e22010-02-18 13:27:19 -08006405 *
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08006406 * @hide
6407 */
6408 public static final String VOICE_RECOGNITION_SERVICE = "voice_recognition_service";
Dan Egnor42471dd2010-01-07 17:25:22 -08006409
William Luh623a4282013-06-24 12:14:18 -07006410 /**
6411 * Stores whether an user has consented to have apps verified through PAM.
6412 * The value is boolean (1 or 0).
6413 *
6414 * @hide
6415 */
6416 public static final String PACKAGE_VERIFIER_USER_CONSENT =
6417 "package_verifier_user_consent";
satok988323c2011-06-22 16:38:13 +09006418
6419 /**
satokada8c4e2011-08-23 14:56:56 +09006420 * The {@link ComponentName} string of the selected spell checker service which is
6421 * one of the services managed by the text service manager.
6422 *
6423 * @hide
6424 */
6425 public static final String SELECTED_SPELL_CHECKER = "selected_spell_checker";
6426
6427 /**
6428 * The {@link ComponentName} string of the selected subtype of the selected spell checker
satok988323c2011-06-22 16:38:13 +09006429 * service which is one of the services managed by the text service manager.
6430 *
6431 * @hide
6432 */
satokada8c4e2011-08-23 14:56:56 +09006433 public static final String SELECTED_SPELL_CHECKER_SUBTYPE =
6434 "selected_spell_checker_subtype";
satok988323c2011-06-22 16:38:13 +09006435
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08006436 /**
satoka33c4fc2011-08-25 16:50:11 +09006437 * The {@link ComponentName} string whether spell checker is enabled or not.
6438 *
6439 * @hide
6440 */
6441 public static final String SPELL_CHECKER_ENABLED = "spell_checker_enabled";
6442
6443 /**
David Brown458e8062010-03-08 21:52:11 -08006444 * What happens when the user presses the Power button while in-call
6445 * and the screen is on.<br/>
6446 * <b>Values:</b><br/>
6447 * 1 - The Power button turns off the screen and locks the device. (Default behavior)<br/>
6448 * 2 - The Power button hangs up the current call.<br/>
6449 *
6450 * @hide
6451 */
6452 public static final String INCALL_POWER_BUTTON_BEHAVIOR = "incall_power_button_behavior";
6453
6454 /**
6455 * INCALL_POWER_BUTTON_BEHAVIOR value for "turn off screen".
6456 * @hide
6457 */
6458 public static final int INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF = 0x1;
6459
6460 /**
6461 * INCALL_POWER_BUTTON_BEHAVIOR value for "hang up".
6462 * @hide
6463 */
6464 public static final int INCALL_POWER_BUTTON_BEHAVIOR_HANGUP = 0x2;
6465
6466 /**
6467 * INCALL_POWER_BUTTON_BEHAVIOR default value.
6468 * @hide
6469 */
6470 public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT =
6471 INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF;
6472
6473 /**
Bryce Leedb776ce2016-09-03 15:02:00 -07006474 * What happens when the user presses the Back button while in-call
6475 * and the screen is on.<br/>
6476 * <b>Values:</b><br/>
6477 * 0 - The Back buttons does nothing different.<br/>
6478 * 1 - The Back button hangs up the current call.<br/>
6479 *
6480 * @hide
6481 */
6482 public static final String INCALL_BACK_BUTTON_BEHAVIOR = "incall_back_button_behavior";
6483
6484 /**
6485 * INCALL_BACK_BUTTON_BEHAVIOR value for no action.
6486 * @hide
6487 */
6488 public static final int INCALL_BACK_BUTTON_BEHAVIOR_NONE = 0x0;
6489
6490 /**
6491 * INCALL_BACK_BUTTON_BEHAVIOR value for "hang up".
6492 * @hide
6493 */
6494 public static final int INCALL_BACK_BUTTON_BEHAVIOR_HANGUP = 0x1;
6495
6496 /**
6497 * INCALL_POWER_BUTTON_BEHAVIOR default value.
6498 * @hide
6499 */
6500 public static final int INCALL_BACK_BUTTON_BEHAVIOR_DEFAULT =
6501 INCALL_BACK_BUTTON_BEHAVIOR_NONE;
6502
6503 /**
Jeff Browna20dda42014-05-27 20:57:24 -07006504 * Whether the device should wake when the wake gesture sensor detects motion.
6505 * @hide
6506 */
6507 public static final String WAKE_GESTURE_ENABLED = "wake_gesture_enabled";
6508
6509 /**
John Spurlocka4215ce2014-08-04 14:50:38 -04006510 * Whether the device should doze if configured.
6511 * @hide
6512 */
6513 public static final String DOZE_ENABLED = "doze_enabled";
6514
6515 /**
Adrian Roosebea7a72016-10-26 12:51:26 -07006516 * Whether doze should be always on.
6517 * @hide
6518 */
6519 public static final String DOZE_ALWAYS_ON = "doze_always_on";
6520
6521 /**
Doris Ling6403b402016-09-09 14:29:19 -07006522 * Whether the device should pulse on pick up gesture.
6523 * @hide
6524 */
6525 public static final String DOZE_PULSE_ON_PICK_UP = "doze_pulse_on_pick_up";
6526
6527 /**
Adrian Roosd0963a02017-05-15 14:33:37 -07006528 * Whether the device should pulse on long press gesture.
6529 * @hide
6530 */
6531 public static final String DOZE_PULSE_ON_LONG_PRESS = "doze_pulse_on_long_press";
6532
6533 /**
Doris Ling6403b402016-09-09 14:29:19 -07006534 * Whether the device should pulse on double tap gesture.
6535 * @hide
6536 */
6537 public static final String DOZE_PULSE_ON_DOUBLE_TAP = "doze_pulse_on_double_tap";
6538
6539 /**
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07006540 * The current night mode that has been selected by the user. Owned
6541 * and controlled by UiModeManagerService. Constants are as per
6542 * UiModeManager.
6543 * @hide
6544 */
6545 public static final String UI_NIGHT_MODE = "ui_night_mode";
Suchi Amalapurapu40e47252010-04-07 16:15:50 -07006546
6547 /**
John Spurlock1a868b72012-08-22 09:56:51 -04006548 * Whether screensavers are enabled.
Daniel Sandler0601eb72011-04-13 01:01:32 -04006549 * @hide
6550 */
Daniel Sandler2d545362011-11-17 10:38:37 -08006551 public static final String SCREENSAVER_ENABLED = "screensaver_enabled";
Daniel Sandler0601eb72011-04-13 01:01:32 -04006552
6553 /**
John Spurlock1a868b72012-08-22 09:56:51 -04006554 * The user's chosen screensaver components.
Daniel Sandler2d545362011-11-17 10:38:37 -08006555 *
John Spurlock1a868b72012-08-22 09:56:51 -04006556 * These will be launched by the PhoneWindowManager after a timeout when not on
Daniel Sandler2d545362011-11-17 10:38:37 -08006557 * battery, or upon dock insertion (if SCREENSAVER_ACTIVATE_ON_DOCK is set to 1).
Daniel Sandler0601eb72011-04-13 01:01:32 -04006558 * @hide
6559 */
John Spurlock1a868b72012-08-22 09:56:51 -04006560 public static final String SCREENSAVER_COMPONENTS = "screensaver_components";
Daniel Sandler2d545362011-11-17 10:38:37 -08006561
6562 /**
John Spurlock1a868b72012-08-22 09:56:51 -04006563 * If screensavers are enabled, whether the screensaver should be automatically launched
6564 * when the device is inserted into a (desk) dock.
Daniel Sandler2d545362011-11-17 10:38:37 -08006565 * @hide
6566 */
6567 public static final String SCREENSAVER_ACTIVATE_ON_DOCK = "screensaver_activate_on_dock";
Daniel Sandler0601eb72011-04-13 01:01:32 -04006568
John Spurlock1a868b72012-08-22 09:56:51 -04006569 /**
6570 * If screensavers are enabled, whether the screensaver should be automatically launched
6571 * when the screen times out when not on battery.
6572 * @hide
6573 */
6574 public static final String SCREENSAVER_ACTIVATE_ON_SLEEP = "screensaver_activate_on_sleep";
6575
6576 /**
6577 * If screensavers are enabled, the default screensaver component.
6578 * @hide
6579 */
6580 public static final String SCREENSAVER_DEFAULT_COMPONENT = "screensaver_default_component";
6581
Daniel Sandler0601eb72011-04-13 01:01:32 -04006582 /**
Martijn Coenena7397882013-07-30 20:07:47 -07006583 * The default NFC payment component
6584 * @hide
6585 */
6586 public static final String NFC_PAYMENT_DEFAULT_COMPONENT = "nfc_payment_default_component";
6587
6588 /**
Martijn Coenen2f6f3a012014-04-25 17:00:21 -07006589 * Whether NFC payment is handled by the foreground application or a default.
6590 * @hide
6591 */
6592 public static final String NFC_PAYMENT_FOREGROUND = "nfc_payment_foreground";
6593
6594 /**
David Braunf5d83192013-09-16 13:43:51 -07006595 * Specifies the package name currently configured to be the primary sms application
6596 * @hide
6597 */
6598 public static final String SMS_DEFAULT_APPLICATION = "sms_default_application";
6599
6600 /**
Yorke Lee014de022015-04-21 17:15:47 -07006601 * Specifies the package name currently configured to be the default dialer application
6602 * @hide
6603 */
6604 public static final String DIALER_DEFAULT_APPLICATION = "dialer_default_application";
6605
6606 /**
Adrian Roos943eb862015-03-26 12:31:16 -07006607 * Specifies the package name currently configured to be the emergency assistance application
6608 *
6609 * @see android.telephony.TelephonyManager#ACTION_EMERGENCY_ASSISTANCE
6610 *
6611 * @hide
6612 */
6613 public static final String EMERGENCY_ASSISTANCE_APPLICATION = "emergency_assistance_application";
6614
6615 /**
Jorim Jaggi9d910832015-05-18 17:35:26 -07006616 * Specifies whether the current app context on scren (assist data) will be sent to the
6617 * assist application (active voice interaction service).
6618 *
6619 * @hide
6620 */
6621 public static final String ASSIST_STRUCTURE_ENABLED = "assist_structure_enabled";
6622
6623 /**
Jorim Jaggia133f0b2015-06-26 16:40:00 -07006624 * Specifies whether a screenshot of the screen contents will be sent to the assist
6625 * application (active voice interaction service).
6626 *
6627 * @hide
6628 */
6629 public static final String ASSIST_SCREENSHOT_ENABLED = "assist_screenshot_enabled";
6630
6631 /**
Adrian Roos2335bd62016-08-11 15:42:40 -07006632 * Specifies whether the screen will show an animation if screen contents are sent to the
6633 * assist application (active voice interaction service).
6634 *
6635 * Note that the disclosure will be forced for third-party assistants or if the device
6636 * does not support disabling it.
6637 *
6638 * @hide
6639 */
6640 public static final String ASSIST_DISCLOSURE_ENABLED = "assist_disclosure_enabled";
6641
6642 /**
Julia Reynoldsb852e562017-06-06 16:14:18 -04006643 * Read only list of the service components that the current user has explicitly allowed to
Julia Reynolds77b2cc92016-11-08 14:41:09 -05006644 * see and assist with all of the user's notifications.
6645 *
Julia Reynoldsb852e562017-06-06 16:14:18 -04006646 * @deprecated Use
6647 * {@link NotificationManager#isNotificationListenerAccessGranted(ComponentName)}.
Julia Reynolds77b2cc92016-11-08 14:41:09 -05006648 * @hide
6649 */
Julia Reynoldsb852e562017-06-06 16:14:18 -04006650 @Deprecated
Julia Reynolds77b2cc92016-11-08 14:41:09 -05006651 public static final String ENABLED_NOTIFICATION_ASSISTANT =
6652 "enabled_notification_assistant";
6653
6654 /**
Julia Reynoldsb852e562017-06-06 16:14:18 -04006655 * Read only list of the service components that the current user has explicitly allowed to
Chris Wren8326a8a2014-10-22 14:13:32 -04006656 * see all of the user's notifications, separated by ':'.
Daniel Sandler4b749ef2013-03-18 21:53:04 -04006657 *
6658 * @hide
Julia Reynoldsb852e562017-06-06 16:14:18 -04006659 * @deprecated Use
6660 * {@link NotificationManager#isNotificationAssistantAccessGranted(ComponentName)}.
Daniel Sandler4b749ef2013-03-18 21:53:04 -04006661 */
Julia Reynoldsb852e562017-06-06 16:14:18 -04006662 @Deprecated
Daniel Sandler4b749ef2013-03-18 21:53:04 -04006663 public static final String ENABLED_NOTIFICATION_LISTENERS = "enabled_notification_listeners";
6664
John Spurlock7340fc82014-04-24 18:50:12 -04006665 /**
Julia Reynoldsb852e562017-06-06 16:14:18 -04006666 * Read only list of the packages that the current user has explicitly allowed to
6667 * manage do not disturb, separated by ':'.
Julia Reynolds0aa7d612016-04-25 14:57:33 -04006668 *
Julia Reynoldsb852e562017-06-06 16:14:18 -04006669 * @deprecated Use {@link NotificationManager#isNotificationPolicyAccessGranted()}.
Julia Reynolds0aa7d612016-04-25 14:57:33 -04006670 * @hide
John Spurlock7c74f782015-06-04 13:01:42 -04006671 */
Julia Reynoldsb852e562017-06-06 16:14:18 -04006672 @Deprecated
Julia Reynolds0aa7d612016-04-25 14:57:33 -04006673 @TestApi
John Spurlock7c74f782015-06-04 13:01:42 -04006674 public static final String ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES =
6675 "enabled_notification_policy_access_packages";
6676
Andre Lagoea35e072016-08-04 13:41:13 +01006677 /**
6678 * Defines whether managed profile ringtones should be synced from it's parent profile
6679 * <p>
6680 * 0 = ringtones are not synced
6681 * 1 = ringtones are synced from the profile's parent (default)
6682 * <p>
6683 * This value is only used for managed profiles.
6684 * @hide
6685 */
Robin Leec74d85f2017-03-16 17:19:42 +00006686 @TestApi
6687 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
Andre Lagoea35e072016-08-04 13:41:13 +01006688 public static final String SYNC_PARENT_SOUNDS = "sync_parent_sounds";
6689
John Spurlockcdb57ae2015-02-11 19:04:11 -05006690 /** @hide */
John Spurlockf1a36642013-10-12 17:50:42 -04006691 public static final String IMMERSIVE_MODE_CONFIRMATIONS = "immersive_mode_confirmations";
John Spurlockd67ec252013-09-05 11:31:54 -04006692
Yorke Lee647f8f32013-05-07 10:49:44 -07006693 /**
Svetoslavf43e8512013-09-30 17:33:05 -07006694 * This is the query URI for finding a print service to install.
6695 *
6696 * @hide
6697 */
6698 public static final String PRINT_SERVICE_SEARCH_URI = "print_service_search_uri";
6699
6700 /**
6701 * This is the query URI for finding a NFC payment service to install.
6702 *
6703 * @hide
6704 */
6705 public static final String PAYMENT_SERVICE_SEARCH_URI = "payment_service_search_uri";
6706
6707 /**
Philip P. Moltmanna30d6e02017-04-27 15:40:02 -07006708 * This is the query URI for finding a auto fill service to install.
6709 *
6710 * @hide
6711 */
6712 public static final String AUTOFILL_SERVICE_SEARCH_URI = "autofill_service_search_uri";
6713
6714 /**
Amith Yamasani1e9c2182014-06-11 17:25:51 -07006715 * If enabled, apps should try to skip any introductory hints on first launch. This might
Amith Yamasani0c416392014-06-13 15:54:39 -07006716 * apply to users that are already familiar with the environment or temporary users.
Amith Yamasani1e9c2182014-06-11 17:25:51 -07006717 * <p>
6718 * Type : int (0 to show hints, 1 to skip showing hints)
Amith Yamasani1e9c2182014-06-11 17:25:51 -07006719 */
6720 public static final String SKIP_FIRST_USE_HINTS = "skip_first_use_hints";
6721
6722 /**
John Spurlockaa5ee4d2014-07-25 13:05:12 -04006723 * Persisted playback time after a user confirmation of an unsafe volume level.
6724 *
6725 * @hide
6726 */
6727 public static final String UNSAFE_VOLUME_MUSIC_ACTIVE_MS = "unsafe_volume_music_active_ms";
6728
6729 /**
Dan Sandler52e5701e2014-07-22 23:14:54 -04006730 * This preference enables notification display on the lockscreen.
6731 * @hide
6732 */
6733 public static final String LOCK_SCREEN_SHOW_NOTIFICATIONS =
6734 "lock_screen_show_notifications";
6735
6736 /**
Winson Chung28217a42017-02-15 13:46:52 -08006737 * This preference stores the last stack active task time for each user, which affects what
6738 * tasks will be visible in Overview.
6739 * @hide
6740 */
6741 public static final String OVERVIEW_LAST_STACK_ACTIVE_TIME =
6742 "overview_last_stack_active_time";
6743
6744 /**
Dongwon Kang4d933a02014-08-07 22:51:47 -07006745 * List of TV inputs that are currently hidden. This is a string
Jaewan Kimf0e530e2014-08-22 00:43:31 +09006746 * containing the IDs of all hidden TV inputs. Each ID is encoded by
6747 * {@link android.net.Uri#encode(String)} and separated by ':'.
Dongwon Kang4d933a02014-08-07 22:51:47 -07006748 * @hide
6749 */
6750 public static final String TV_INPUT_HIDDEN_INPUTS = "tv_input_hidden_inputs";
6751
6752 /**
6753 * List of custom TV input labels. This is a string containing <TV input id, custom name>
Jaewan Kimf0e530e2014-08-22 00:43:31 +09006754 * pairs. TV input id and custom name are encoded by {@link android.net.Uri#encode(String)}
6755 * and separated by ','. Each pair is separated by ':'.
Dongwon Kang4d933a02014-08-07 22:51:47 -07006756 * @hide
6757 */
6758 public static final String TV_INPUT_CUSTOM_LABELS = "tv_input_custom_labels";
6759
6760 /**
Glenn Kasten34cc4db2014-08-13 10:56:38 -07006761 * Whether automatic routing of system audio to USB audio peripheral is disabled.
6762 * The value is boolean (1 or 0), where 1 means automatic routing is disabled,
6763 * and 0 means automatic routing is enabled.
6764 *
6765 * @hide
6766 */
6767 public static final String USB_AUDIO_AUTOMATIC_ROUTING_DISABLED =
6768 "usb_audio_automatic_routing_disabled";
6769
6770 /**
Jeff Brown05af6ad2014-09-30 20:54:30 -07006771 * The timeout in milliseconds before the device fully goes to sleep after
6772 * a period of inactivity. This value sets an upper bound on how long the device
6773 * will stay awake or dreaming without user activity. It should generally
Dianne Hackbornad6a99b2014-11-18 10:11:10 -08006774 * be longer than {@link Settings.System#SCREEN_OFF_TIMEOUT} as otherwise the device
Jeff Brown05af6ad2014-09-30 20:54:30 -07006775 * will sleep before it ever has a chance to dream.
6776 * <p>
6777 * Use -1 to disable this timeout.
6778 * </p>
6779 *
6780 * @hide
6781 */
6782 public static final String SLEEP_TIMEOUT = "sleep_timeout";
6783
6784 /**
Jason Monk27bbb2d2015-03-31 16:46:39 -04006785 * Controls whether double tap to wake is enabled.
6786 * @hide
6787 */
6788 public static final String DOUBLE_TAP_TO_WAKE = "double_tap_to_wake";
6789
6790 /**
Xiyuan Xiae6de8b92015-06-06 22:18:05 -07006791 * The current assistant component. It could be a voice interaction service,
6792 * or an activity that handles ACTION_ASSIST, or empty which means using the default
6793 * handling.
6794 *
6795 * @hide
6796 */
6797 public static final String ASSISTANT = "assistant";
6798
6799 /**
Jason Monk5a5e7d62015-08-04 11:20:25 -04006800 * Whether the camera launch gesture should be disabled.
6801 *
6802 * @hide
6803 */
6804 public static final String CAMERA_GESTURE_DISABLED = "camera_gesture_disabled";
6805
6806 /**
Adrian Roos5941c982015-09-03 15:59:49 -07006807 * Whether the camera launch gesture to double tap the power button when the screen is off
6808 * should be disabled.
6809 *
6810 * @hide
6811 */
6812 public static final String CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED =
6813 "camera_double_tap_power_gesture_disabled";
6814
6815 /**
Doris Linga60d31d2016-07-06 13:39:05 -07006816 * Whether the camera double twist gesture to flip between front and back mode should be
6817 * enabled.
6818 *
6819 * @hide
6820 */
6821 public static final String CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED =
6822 "camera_double_twist_to_flip_enabled";
6823
6824 /**
Daniel Sheng45e0d342017-04-17 17:27:22 -07006825 * Whether or not the smart camera lift trigger that launches the camera when the user moves
6826 * the phone into a position for taking photos should be enabled.
6827 *
6828 * @hide
6829 */
6830 public static final String CAMERA_LIFT_TRIGGER_ENABLED = "camera_lift_trigger_enabled";
6831
6832 /**
Daniel Sheng834e5722017-05-30 09:28:52 -07006833 * The default enable state of the camera lift trigger.
6834 *
6835 * @hide
6836 */
6837 public static final int CAMERA_LIFT_TRIGGER_ENABLED_DEFAULT = 1;
6838
6839 /**
Philip Quinnc4cc3082017-02-13 20:18:16 -08006840 * Whether the assist gesture should be enabled.
6841 *
6842 * @hide
6843 */
6844 public static final String ASSIST_GESTURE_ENABLED = "assist_gesture_enabled";
6845
6846 /**
Philip Quinn80274ca2017-03-03 10:38:38 -08006847 * Sensitivity control for the assist gesture.
6848 *
6849 * @hide
6850 */
6851 public static final String ASSIST_GESTURE_SENSITIVITY = "assist_gesture_sensitivity";
6852
6853 /**
Kevin Chyn80939372017-06-09 15:40:18 -07006854 * Whether the assist gesture should silence alerts.
6855 *
6856 * @hide
6857 */
6858 public static final String ASSIST_GESTURE_SILENCE_ALERTS_ENABLED =
6859 "assist_gesture_silence_alerts_enabled";
6860
6861 /**
6862 * Whether the assist gesture should wake the phone.
6863 *
6864 * @hide
6865 */
6866 public static final String ASSIST_GESTURE_WAKE_ENABLED =
6867 "assist_gesture_wake_enabled";
6868
6869 /**
Kevin Chyncfd641e2017-06-05 11:28:09 -07006870 * Whether Assist Gesture Deferred Setup has been completed
6871 *
6872 * @hide
6873 */
6874 public static final String ASSIST_GESTURE_SETUP_COMPLETE = "assist_gesture_setup_complete";
6875
6876 /**
Justin Klaassen911e8892016-06-21 18:24:24 -07006877 * Control whether Night display is currently activated.
6878 * @hide
6879 */
6880 public static final String NIGHT_DISPLAY_ACTIVATED = "night_display_activated";
6881
6882 /**
6883 * Control whether Night display will automatically activate/deactivate.
6884 * @hide
6885 */
6886 public static final String NIGHT_DISPLAY_AUTO_MODE = "night_display_auto_mode";
6887
6888 /**
Christine Franks6418d0b2017-02-13 09:48:00 -08006889 * Control the color temperature of Night Display, represented in Kelvin.
6890 * @hide
6891 */
6892 public static final String NIGHT_DISPLAY_COLOR_TEMPERATURE =
6893 "night_display_color_temperature";
6894
6895 /**
Justin Klaassen911e8892016-06-21 18:24:24 -07006896 * Custom time when Night display is scheduled to activate.
6897 * Represented as milliseconds from midnight (e.g. 79200000 == 10pm).
6898 * @hide
6899 */
Christine Frankse5bb03e2017-02-10 17:36:10 -08006900 public static final String NIGHT_DISPLAY_CUSTOM_START_TIME =
6901 "night_display_custom_start_time";
Justin Klaassen911e8892016-06-21 18:24:24 -07006902
6903 /**
6904 * Custom time when Night display is scheduled to deactivate.
6905 * Represented as milliseconds from midnight (e.g. 21600000 == 6am).
6906 * @hide
6907 */
6908 public static final String NIGHT_DISPLAY_CUSTOM_END_TIME = "night_display_custom_end_time";
Jason Monk5dbd4aa2016-02-07 13:13:39 -05006909
6910 /**
Christine Frankse5bb03e2017-02-10 17:36:10 -08006911 * Time in milliseconds (since epoch) when Night display was last activated. Use to decide
6912 * whether to apply the current activated state after a reboot or user change.
6913 * @hide
6914 */
6915 public static final String NIGHT_DISPLAY_LAST_ACTIVATED_TIME =
6916 "night_display_last_activated_time";
6917
6918 /**
Ruben Brunke24b9a62016-02-16 21:38:24 -08006919 * Names of the service components that the current user has explicitly allowed to
6920 * be a VR mode listener, separated by ':'.
6921 *
6922 * @hide
6923 */
6924 public static final String ENABLED_VR_LISTENERS = "enabled_vr_listeners";
6925
6926 /**
Ruben Brunk49506e02016-04-18 18:10:47 -07006927 * Behavior of the display while in VR mode.
6928 *
6929 * One of {@link #VR_DISPLAY_MODE_LOW_PERSISTENCE} or {@link #VR_DISPLAY_MODE_OFF}.
6930 *
6931 * @hide
6932 */
6933 public static final String VR_DISPLAY_MODE = "vr_display_mode";
6934
6935 /**
6936 * Lower the display persistence while the system is in VR mode.
6937 *
6938 * @see PackageManager#FEATURE_VR_MODE_HIGH_PERFORMANCE
6939 *
6940 * @hide.
6941 */
6942 public static final int VR_DISPLAY_MODE_LOW_PERSISTENCE = 0;
6943
6944 /**
6945 * Do not alter the display persistence while the system is in VR mode.
6946 *
6947 * @see PackageManager#FEATURE_VR_MODE_HIGH_PERFORMANCE
6948 *
6949 * @hide.
6950 */
6951 public static final int VR_DISPLAY_MODE_OFF = 1;
6952
6953 /**
Jeff Davidson24b9d962016-07-21 12:35:10 -07006954 * Whether CarrierAppUtils#disableCarrierAppsUntilPrivileged has been executed at least
6955 * once.
6956 *
6957 * <p>This is used to ensure that we only take one pass which will disable apps that are not
6958 * privileged (if any). From then on, we only want to enable apps (when a matching SIM is
6959 * inserted), to avoid disabling an app that the user might actively be using.
6960 *
6961 * <p>Will be set to 1 once executed.
6962 *
6963 * @hide
6964 */
6965 public static final String CARRIER_APPS_HANDLED = "carrier_apps_handled";
6966
6967 /**
Tony Makc820cc52016-05-03 18:58:28 +01006968 * Whether parent user can access remote contact in managed profile.
6969 *
6970 * @hide
6971 */
6972 public static final String MANAGED_PROFILE_CONTACT_REMOTE_SEARCH =
6973 "managed_profile_contact_remote_search";
6974
6975 /**
Daniel Nishi395d3872016-05-23 13:25:21 -07006976 * Whether or not the automatic storage manager is enabled and should run on the device.
6977 *
6978 * @hide
6979 */
6980 public static final String AUTOMATIC_STORAGE_MANAGER_ENABLED =
6981 "automatic_storage_manager_enabled";
6982
6983 /**
Daniel Nishic535be12016-06-10 13:51:36 -07006984 * How many days of information for the automatic storage manager to retain on the device.
6985 *
6986 * @hide
6987 */
6988 public static final String AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN =
6989 "automatic_storage_manager_days_to_retain";
6990
6991 /**
6992 * Default number of days of information for the automatic storage manager to retain.
6993 *
6994 * @hide
6995 */
6996 public static final int AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN_DEFAULT = 90;
6997
6998 /**
Daniel Nishif678cc92016-06-24 15:49:25 -07006999 * How many bytes the automatic storage manager has cleared out.
7000 *
7001 * @hide
7002 */
7003 public static final String AUTOMATIC_STORAGE_MANAGER_BYTES_CLEARED =
7004 "automatic_storage_manager_bytes_cleared";
7005
7006
7007 /**
7008 * Last run time for the automatic storage manager.
7009 *
7010 * @hide
7011 */
7012 public static final String AUTOMATIC_STORAGE_MANAGER_LAST_RUN =
7013 "automatic_storage_manager_last_run";
7014
Jorge Gil6825a772016-06-30 11:07:18 -07007015 /**
Daniel Nishida7332c2017-06-12 10:17:33 -07007016 * If the automatic storage manager has been disabled by policy. Note that this doesn't
7017 * mean that the automatic storage manager is prevented from being re-enabled -- this only
7018 * means that it was turned off by policy at least once.
7019 *
7020 * @hide
7021 */
7022 public static final String AUTOMATIC_STORAGE_MANAGER_TURNED_OFF_BY_POLICY =
7023 "automatic_storage_manager_turned_off_by_policy";
7024
7025 /**
Doris Linga60d31d2016-07-06 13:39:05 -07007026 * Whether SystemUI navigation keys is enabled.
7027 * @hide
7028 */
7029 public static final String SYSTEM_NAVIGATION_KEYS_ENABLED =
7030 "system_navigation_keys_enabled";
7031
Allison Babickf0bc8662016-07-11 15:39:16 -07007032 /**
Jason Monkbaade752016-08-25 15:57:14 -04007033 * Holds comma separated list of ordering of QS tiles.
7034 * @hide
7035 */
7036 public static final String QS_TILES = "sysui_qs_tiles";
7037
7038 /**
Fyodor Kupolov539d36f2016-07-27 17:45:12 -07007039 * Whether preloaded APKs have been installed for the user.
7040 * @hide
7041 */
7042 public static final String DEMO_USER_SETUP_COMPLETE
7043 = "demo_user_setup_complete";
7044
7045 /**
Todd Kennedyefc1c4d2016-07-21 07:44:33 -07007046 * Specifies whether the web action API is enabled.
7047 *
7048 * @hide
7049 */
Jesse Evansfc1bfc42017-04-07 16:11:26 -07007050 @SystemApi
7051 public static final String INSTANT_APPS_ENABLED = "instant_apps_enabled";
Todd Kennedyefc1c4d2016-07-21 07:44:33 -07007052
7053 /**
Greg Plesur35144042016-10-10 16:23:49 -04007054 * Has this pairable device been paired or upgraded from a previously paired system.
7055 * @hide
7056 */
7057 public static final String DEVICE_PAIRED = "device_paired";
7058
7059 /**
Shahriyar Amini9343f572017-01-12 12:03:24 -08007060 * Integer state indicating whether package verifier is enabled.
7061 * TODO(b/34259924): Remove this setting.
7062 *
7063 * @hide
7064 */
7065 public static final String PACKAGE_VERIFIER_STATE = "package_verifier_state";
7066
7067 /**
Jack Yu39028572017-02-23 09:49:25 -08007068 * Specifies additional package name for broadcasting the CMAS messages.
7069 * @hide
7070 */
7071 public static final String CMAS_ADDITIONAL_BROADCAST_PKG = "cmas_additional_broadcast_pkg";
7072
7073 /**
Chris Wren89aa2262017-05-05 18:05:56 -04007074 * Whether the launcher should show any notification badges.
7075 * The value is boolean (1 or 0).
7076 * @hide
7077 */
7078 public static final String NOTIFICATION_BADGING = "notification_badging";
7079
7080 /**
Jason Monkcb5296a2017-06-30 10:28:18 -04007081 * Comma separated list of QS tiles that have been auto-added already.
7082 * @hide
7083 */
7084 public static final String QS_AUTO_ADDED_TILES = "qs_auto_tiles";
7085
7086 /**
Svetoslav Ganova571a582011-09-20 18:32:20 -07007087 * This are the settings to be backed up.
7088 *
7089 * NOTE: Settings are backed up and restored in the order they appear
7090 * in this array. If you have one setting depending on another,
7091 * make sure that they are ordered appropriately.
7092 *
-b master501eec92009-07-06 13:53:11 -07007093 * @hide
7094 */
7095 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate58f41ec2013-01-11 15:40:36 -08007096 BUGREPORT_IN_POWER_MENU, // moved to global
Amith Yamasani8823c0a82009-07-07 14:30:17 -07007097 ALLOW_MOCK_LOCATION,
-b master501eec92009-07-06 13:53:11 -07007098 PARENTAL_CONTROL_ENABLED,
7099 PARENTAL_CONTROL_REDIRECT_URL,
Christopher Tate66488d62012-10-02 11:58:01 -07007100 USB_MASS_STORAGE_ENABLED, // moved to global
Anna Galuszafa7786c2015-12-22 10:53:44 -08007101 ACCESSIBILITY_DISPLAY_INVERSION_ENABLED,
7102 ACCESSIBILITY_DISPLAY_DALTONIZER,
Anna Galuszafa7786c2015-12-22 10:53:44 -08007103 ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED,
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07007104 ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED,
Casey Burkhardt74922c62017-02-13 12:43:16 -08007105 ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED,
Svetoslav Ganovd8561a22017-04-25 15:26:03 -07007106 AUTOFILL_SERVICE,
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07007107 ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE,
-b master501eec92009-07-06 13:53:11 -07007108 ENABLED_ACCESSIBILITY_SERVICES,
Ruben Brunke24b9a62016-02-16 21:38:24 -08007109 ENABLED_VR_LISTENERS,
Christopher Tate7b9a28c2015-03-18 13:06:16 -07007110 ENABLED_INPUT_METHODS,
Svetoslav Ganov9a4c5cd2012-05-30 14:06:32 -07007111 TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES,
Svetoslav Ganova28a16d2011-07-28 11:24:21 -07007112 TOUCH_EXPLORATION_ENABLED,
Svetoslav Ganova571a582011-09-20 18:32:20 -07007113 ACCESSIBILITY_ENABLED,
Phil Weaver106fe732016-11-22 18:18:39 -08007114 ACCESSIBILITY_SHORTCUT_TARGET_SERVICE,
Casey Burkhardt5e8b9802017-03-24 10:07:20 -07007115 ACCESSIBILITY_BUTTON_TARGET_COMPONENT,
Phil Weaver106fe732016-11-22 18:18:39 -08007116 ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN,
Phil Weaverce687c52017-03-15 08:51:52 -07007117 ACCESSIBILITY_SHORTCUT_ENABLED,
7118 ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN,
Svetoslav Ganov55f937a2011-12-05 11:42:07 -08007119 ACCESSIBILITY_SPEAK_PASSWORD,
Chris Craikcce47eb2014-07-16 15:12:15 -07007120 ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED,
Anna Galuszafa7786c2015-12-22 10:53:44 -08007121 ACCESSIBILITY_CAPTIONING_PRESET,
Alan Viveretteef793802013-07-23 14:15:28 -07007122 ACCESSIBILITY_CAPTIONING_ENABLED,
7123 ACCESSIBILITY_CAPTIONING_LOCALE,
7124 ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR,
7125 ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR,
7126 ACCESSIBILITY_CAPTIONING_EDGE_TYPE,
7127 ACCESSIBILITY_CAPTIONING_EDGE_COLOR,
7128 ACCESSIBILITY_CAPTIONING_TYPEFACE,
Alan Viverette69ce69b2013-08-29 12:23:48 -07007129 ACCESSIBILITY_CAPTIONING_FONT_SCALE,
Anna Galuszafa7786c2015-12-22 10:53:44 -08007130 ACCESSIBILITY_CAPTIONING_WINDOW_COLOR,
-b master501eec92009-07-06 13:53:11 -07007131 TTS_USE_DEFAULTS,
7132 TTS_DEFAULT_RATE,
7133 TTS_DEFAULT_PITCH,
7134 TTS_DEFAULT_SYNTH,
7135 TTS_DEFAULT_LANG,
7136 TTS_DEFAULT_COUNTRY,
Charles Chenceffa152010-03-16 21:18:10 -07007137 TTS_ENABLED_PLUGINS,
Narayan Kamath6d632962011-08-24 11:51:37 +01007138 TTS_DEFAULT_LOCALE,
Anna Galuszafa7786c2015-12-22 10:53:44 -08007139 SHOW_IME_WITH_HARD_KEYBOARD,
Christopher Tate66488d62012-10-02 11:58:01 -07007140 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, // moved to global
7141 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, // moved to global
7142 WIFI_NUM_OPEN_NETWORKS_KEPT, // moved to global
Christopher Tate06cbadd2015-03-16 18:29:42 -07007143 SELECTED_SPELL_CHECKER,
7144 SELECTED_SPELL_CHECKER_SUBTYPE,
7145 SPELL_CHECKER_ENABLED,
San Mehat87734d32010-01-08 12:53:06 -08007146 MOUNT_PLAY_NOTIFICATION_SND,
7147 MOUNT_UMS_AUTOSTART,
7148 MOUNT_UMS_PROMPT,
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07007149 MOUNT_UMS_NOTIFY_ENABLED,
Jason Monk27bbb2d2015-03-31 16:46:39 -04007150 SLEEP_TIMEOUT,
7151 DOUBLE_TAP_TO_WAKE,
Anna Galuszafa7786c2015-12-22 10:53:44 -08007152 WAKE_GESTURE_ENABLED,
7153 LONG_PRESS_TIMEOUT,
Jason Monk5a5e7d62015-08-04 11:20:25 -04007154 CAMERA_GESTURE_DISABLED,
Toni Barzic386f8342015-09-09 12:30:41 -07007155 ACCESSIBILITY_AUTOCLICK_ENABLED,
Anna Galuszafa7786c2015-12-22 10:53:44 -08007156 ACCESSIBILITY_AUTOCLICK_DELAY,
7157 ACCESSIBILITY_LARGE_POINTER_ICON,
7158 PREFERRED_TTY_MODE,
7159 ENHANCED_VOICE_PRIVACY_ENABLED,
7160 TTY_MODE_ENABLED,
Mike Tsaofc47ba72016-07-15 09:54:07 -07007161 INCALL_POWER_BUTTON_BEHAVIOR,
7162 NIGHT_DISPLAY_CUSTOM_START_TIME,
7163 NIGHT_DISPLAY_CUSTOM_END_TIME,
Christine Franks6418d0b2017-02-13 09:48:00 -08007164 NIGHT_DISPLAY_COLOR_TEMPERATURE,
Mike Tsaofc47ba72016-07-15 09:54:07 -07007165 NIGHT_DISPLAY_AUTO_MODE,
Doris Ling5fafa3c2016-08-26 15:00:49 -07007166 SYNC_PARENT_SOUNDS,
Doris Ling8a332732016-08-24 15:05:43 -07007167 CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED,
7168 CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED,
Jason Monkbaade752016-08-25 15:57:14 -04007169 SYSTEM_NAVIGATION_KEYS_ENABLED,
7170 QS_TILES,
Doris Ling6403b402016-09-09 14:29:19 -07007171 DOZE_ENABLED,
7172 DOZE_PULSE_ON_PICK_UP,
Ruchi Kandoi104e0b42016-12-29 13:31:43 -08007173 DOZE_PULSE_ON_DOUBLE_TAP,
Daniel Nishieb70ad42017-01-27 10:51:35 -08007174 NFC_PAYMENT_DEFAULT_COMPONENT,
Philip Quinnc4cc3082017-02-13 20:18:16 -08007175 AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN,
Santos Cordon5bce4942017-02-27 11:50:18 -08007176 ASSIST_GESTURE_ENABLED,
Philip Quinn80274ca2017-03-03 10:38:38 -08007177 ASSIST_GESTURE_SENSITIVITY,
Kevin Chyn80939372017-06-09 15:40:18 -07007178 ASSIST_GESTURE_SETUP_COMPLETE,
7179 ASSIST_GESTURE_SILENCE_ALERTS_ENABLED,
7180 ASSIST_GESTURE_WAKE_ENABLED,
Chris Wren89aa2262017-05-05 18:05:56 -04007181 VR_DISPLAY_MODE,
Jason Monkcb5296a2017-06-30 10:28:18 -04007182 NOTIFICATION_BADGING,
7183 QS_AUTO_ADDED_TILES,
Jason Monkdf31eff2017-07-10 11:14:19 -04007184 SCREENSAVER_ENABLED,
7185 SCREENSAVER_COMPONENTS,
7186 SCREENSAVER_ACTIVATE_ON_DOCK,
7187 SCREENSAVER_ACTIVATE_ON_SLEEP,
-b master501eec92009-07-06 13:53:11 -07007188 };
7189
Christopher Tate1d0fca32017-06-06 13:30:00 -07007190 /** @hide */
7191 public static final String[] LEGACY_RESTORE_SETTINGS = {
Julia Reynoldsb852e562017-06-06 16:14:18 -04007192 ENABLED_NOTIFICATION_LISTENERS,
7193 ENABLED_NOTIFICATION_ASSISTANT,
7194 ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES
Christopher Tate1d0fca32017-06-06 13:30:00 -07007195 };
7196
-b master501eec92009-07-06 13:53:11 -07007197 /**
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07007198 * These entries are considered common between the personal and the managed profile,
7199 * since the managed profile doesn't get to change them.
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07007200 */
Svetoslav683914b2015-01-15 14:22:26 -08007201 private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>();
Amith Yamasanib0ff3222015-03-04 09:56:14 -08007202
Svetoslav683914b2015-01-15 14:22:26 -08007203 static {
7204 CLONE_TO_MANAGED_PROFILE.add(ACCESSIBILITY_ENABLED);
7205 CLONE_TO_MANAGED_PROFILE.add(ALLOW_MOCK_LOCATION);
7206 CLONE_TO_MANAGED_PROFILE.add(ALLOWED_GEOLOCATION_ORIGINS);
Felipe Lemeaa008962017-04-18 14:54:33 -07007207 CLONE_TO_MANAGED_PROFILE.add(AUTOFILL_SERVICE);
Svetoslav683914b2015-01-15 14:22:26 -08007208 CLONE_TO_MANAGED_PROFILE.add(DEFAULT_INPUT_METHOD);
7209 CLONE_TO_MANAGED_PROFILE.add(ENABLED_ACCESSIBILITY_SERVICES);
7210 CLONE_TO_MANAGED_PROFILE.add(ENABLED_INPUT_METHODS);
7211 CLONE_TO_MANAGED_PROFILE.add(LOCATION_MODE);
Lifu Tangd1fa1d62015-11-25 21:42:44 -08007212 CLONE_TO_MANAGED_PROFILE.add(LOCATION_PREVIOUS_MODE);
Svetoslav683914b2015-01-15 14:22:26 -08007213 CLONE_TO_MANAGED_PROFILE.add(LOCATION_PROVIDERS_ALLOWED);
Svetoslav683914b2015-01-15 14:22:26 -08007214 CLONE_TO_MANAGED_PROFILE.add(SELECTED_INPUT_METHOD_SUBTYPE);
Svetoslav683914b2015-01-15 14:22:26 -08007215 }
7216
7217 /** @hide */
7218 public static void getCloneToManagedProfileSettings(Set<String> outKeySet) {
7219 outKeySet.addAll(CLONE_TO_MANAGED_PROFILE);
7220 }
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07007221
7222 /**
Todd Kennedybe0b8892017-02-15 14:13:52 -08007223 * Secure settings which can be accessed by instant apps.
Chad Brubaker97bccee2017-01-05 15:51:41 -08007224 * @hide
7225 */
Todd Kennedybe0b8892017-02-15 14:13:52 -08007226 public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>();
Chad Brubaker97bccee2017-01-05 15:51:41 -08007227 static {
Todd Kennedybe0b8892017-02-15 14:13:52 -08007228 INSTANT_APP_SETTINGS.add(ENABLED_ACCESSIBILITY_SERVICES);
7229 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_SPEAK_PASSWORD);
7230 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_INVERSION_ENABLED);
Chad Brubaker9408d512017-03-28 16:11:38 -07007231 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_ENABLED);
7232 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_PRESET);
7233 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_EDGE_TYPE);
7234 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_EDGE_COLOR);
7235 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_LOCALE);
7236 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR);
7237 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR);
7238 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_TYPEFACE);
7239 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_FONT_SCALE);
Chad Brubakerd9285b52017-04-27 15:28:57 -07007240 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_WINDOW_COLOR);
7241 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED);
7242 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_DALTONIZER);
7243 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_AUTOCLICK_DELAY);
7244 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_AUTOCLICK_ENABLED);
7245 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_LARGE_POINTER_ICON);
Chad Brubaker97bccee2017-01-05 15:51:41 -08007246
Todd Kennedybe0b8892017-02-15 14:13:52 -08007247 INSTANT_APP_SETTINGS.add(DEFAULT_INPUT_METHOD);
7248 INSTANT_APP_SETTINGS.add(ENABLED_INPUT_METHODS);
Chad Brubaker1bed9372017-03-20 10:52:52 -07007249
7250 INSTANT_APP_SETTINGS.add(ANDROID_ID);
Chad Brubaker8d7b36f2017-04-06 22:57:18 -07007251
7252 INSTANT_APP_SETTINGS.add(PACKAGE_VERIFIER_USER_CONSENT);
Chad Brubaker562afaf2017-04-10 13:32:37 -07007253 INSTANT_APP_SETTINGS.add(ALLOW_MOCK_LOCATION);
Chad Brubaker97bccee2017-01-05 15:51:41 -08007254 }
7255
7256 /**
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07007257 * Helper method for determining if a location provider is enabled.
Tom O'Neilld5759432013-09-11 11:03:03 -07007258 *
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07007259 * @param cr the content resolver to use
7260 * @param provider the location provider to query
7261 * @return true if the provider is enabled
Tom O'Neilld5759432013-09-11 11:03:03 -07007262 *
7263 * @deprecated use {@link #LOCATION_MODE} or
7264 * {@link LocationManager#isProviderEnabled(String)}
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07007265 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07007266 @Deprecated
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07007267 public static final boolean isLocationProviderEnabled(ContentResolver cr, String provider) {
Victoria Leaseb711d572012-10-02 13:14:11 -07007268 return isLocationProviderEnabledForUser(cr, provider, UserHandle.myUserId());
7269 }
7270
7271 /**
7272 * Helper method for determining if a location provider is enabled.
7273 * @param cr the content resolver to use
7274 * @param provider the location provider to query
7275 * @param userId the userId to query
7276 * @return true if the provider is enabled
Tom O'Neilld5759432013-09-11 11:03:03 -07007277 * @deprecated use {@link #LOCATION_MODE} or
7278 * {@link LocationManager#isProviderEnabled(String)}
Victoria Leaseb711d572012-10-02 13:14:11 -07007279 * @hide
7280 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07007281 @Deprecated
Victoria Leaseb711d572012-10-02 13:14:11 -07007282 public static final boolean isLocationProviderEnabledForUser(ContentResolver cr, String provider, int userId) {
7283 String allowedProviders = Settings.Secure.getStringForUser(cr,
7284 LOCATION_PROVIDERS_ALLOWED, userId);
Brad Fitzpatrick11fe1812010-09-10 16:07:52 -07007285 return TextUtils.delimitedStringContains(allowedProviders, ',', provider);
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07007286 }
7287
7288 /**
7289 * Thread-safe method for enabling or disabling a single location provider.
7290 * @param cr the content resolver to use
7291 * @param provider the location provider to enable or disable
7292 * @param enabled true if the provider should be enabled
Tom O'Neilla324ac72013-08-26 14:40:23 -07007293 * @deprecated use {@link #putInt(ContentResolver, String, int)} and {@link #LOCATION_MODE}
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07007294 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07007295 @Deprecated
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07007296 public static final void setLocationProviderEnabled(ContentResolver cr,
7297 String provider, boolean enabled) {
Victoria Leaseb711d572012-10-02 13:14:11 -07007298 setLocationProviderEnabledForUser(cr, provider, enabled, UserHandle.myUserId());
7299 }
7300
7301 /**
7302 * Thread-safe method for enabling or disabling a single location provider.
Tom O'Neilla324ac72013-08-26 14:40:23 -07007303 *
Victoria Leaseb711d572012-10-02 13:14:11 -07007304 * @param cr the content resolver to use
7305 * @param provider the location provider to enable or disable
7306 * @param enabled true if the provider should be enabled
7307 * @param userId the userId for which to enable/disable providers
Tom O'Neilla324ac72013-08-26 14:40:23 -07007308 * @return true if the value was set, false on database errors
7309 * @deprecated use {@link #putIntForUser(ContentResolver, String, int, int)} and
7310 * {@link #LOCATION_MODE}
Victoria Leaseb711d572012-10-02 13:14:11 -07007311 * @hide
7312 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07007313 @Deprecated
Tom O'Neilla324ac72013-08-26 14:40:23 -07007314 public static final boolean setLocationProviderEnabledForUser(ContentResolver cr,
Victoria Leaseb711d572012-10-02 13:14:11 -07007315 String provider, boolean enabled, int userId) {
David Christie3f7b6522013-08-06 19:19:08 -07007316 synchronized (mLocationSettingsLock) {
7317 // to ensure thread safety, we write the provider name with a '+' or '-'
7318 // and let the SettingsProvider handle it rather than reading and modifying
7319 // the list of enabled providers.
7320 if (enabled) {
7321 provider = "+" + provider;
7322 } else {
7323 provider = "-" + provider;
7324 }
Tom O'Neilla324ac72013-08-26 14:40:23 -07007325 return putStringForUser(cr, Settings.Secure.LOCATION_PROVIDERS_ALLOWED, provider,
David Christie3f7b6522013-08-06 19:19:08 -07007326 userId);
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07007327 }
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07007328 }
Tom O'Neill1f48b782013-08-19 18:14:56 -07007329
7330 /**
Lifu Tangd1fa1d62015-11-25 21:42:44 -08007331 * Saves the current location mode into {@link #LOCATION_PREVIOUS_MODE}.
7332 */
7333 private static final boolean saveLocationModeForUser(ContentResolver cr, int userId) {
7334 final int mode = getLocationModeForUser(cr, userId);
7335 return putIntForUser(cr, Settings.Secure.LOCATION_PREVIOUS_MODE, mode, userId);
7336 }
7337
7338 /**
7339 * Restores the current location mode from {@link #LOCATION_PREVIOUS_MODE}.
7340 */
7341 private static final boolean restoreLocationModeForUser(ContentResolver cr, int userId) {
7342 int mode = getIntForUser(cr, Settings.Secure.LOCATION_PREVIOUS_MODE,
7343 LOCATION_MODE_HIGH_ACCURACY, userId);
7344 // Make sure that the previous mode is never "off". Otherwise the user won't be able to
7345 // turn on location any longer.
7346 if (mode == LOCATION_MODE_OFF) {
7347 mode = LOCATION_MODE_HIGH_ACCURACY;
7348 }
7349 return setLocationModeForUser(cr, mode, userId);
7350 }
7351
7352 /**
Tom O'Neill1f48b782013-08-19 18:14:56 -07007353 * Thread-safe method for setting the location mode to one of
7354 * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY},
7355 * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}.
Tom O'Neill87c7fad2016-08-04 08:16:12 -07007356 * Necessary because the mode is a composite of the underlying location provider
7357 * settings.
Tom O'Neill1f48b782013-08-19 18:14:56 -07007358 *
Tom O'Neill1f48b782013-08-19 18:14:56 -07007359 * @param cr the content resolver to use
7360 * @param mode such as {@link #LOCATION_MODE_HIGH_ACCURACY}
7361 * @param userId the userId for which to change mode
Tom O'Neilla324ac72013-08-26 14:40:23 -07007362 * @return true if the value was set, false on database errors
Tom O'Neill1f48b782013-08-19 18:14:56 -07007363 *
7364 * @throws IllegalArgumentException if mode is not one of the supported values
7365 */
Tom O'Neill7f6f4572013-08-27 10:53:15 -07007366 private static final boolean setLocationModeForUser(ContentResolver cr, int mode,
7367 int userId) {
Tom O'Neill1f48b782013-08-19 18:14:56 -07007368 synchronized (mLocationSettingsLock) {
7369 boolean gps = false;
7370 boolean network = false;
7371 switch (mode) {
Lifu Tangd1fa1d62015-11-25 21:42:44 -08007372 case LOCATION_MODE_PREVIOUS:
7373 // Retrieve the actual mode and set to that mode.
7374 return restoreLocationModeForUser(cr, userId);
Tom O'Neill1f48b782013-08-19 18:14:56 -07007375 case LOCATION_MODE_OFF:
Lifu Tangd1fa1d62015-11-25 21:42:44 -08007376 saveLocationModeForUser(cr, userId);
Tom O'Neill1f48b782013-08-19 18:14:56 -07007377 break;
7378 case LOCATION_MODE_SENSORS_ONLY:
7379 gps = true;
7380 break;
7381 case LOCATION_MODE_BATTERY_SAVING:
7382 network = true;
7383 break;
7384 case LOCATION_MODE_HIGH_ACCURACY:
7385 gps = true;
7386 network = true;
7387 break;
7388 default:
7389 throw new IllegalArgumentException("Invalid location mode: " + mode);
7390 }
Tom O'Neill7731a992014-10-09 11:30:49 -07007391 // Note it's important that we set the NLP mode first. The Google implementation
7392 // of NLP clears its NLP consent setting any time it receives a
7393 // LocationManager.PROVIDERS_CHANGED_ACTION broadcast and NLP is disabled. Also,
7394 // it shows an NLP consent dialog any time it receives the broadcast, NLP is
7395 // enabled, and the NLP consent is not set. If 1) we were to enable GPS first,
7396 // 2) a setup wizard has its own NLP consent UI that sets the NLP consent setting,
7397 // and 3) the receiver happened to complete before we enabled NLP, then the Google
7398 // NLP would detect the attempt to enable NLP and show a redundant NLP consent
7399 // dialog. Then the people who wrote the setup wizard would be sad.
Tom O'Neilla324ac72013-08-26 14:40:23 -07007400 boolean nlpSuccess = Settings.Secure.setLocationProviderEnabledForUser(
Tom O'Neill1f48b782013-08-19 18:14:56 -07007401 cr, LocationManager.NETWORK_PROVIDER, network, userId);
Tom O'Neill7731a992014-10-09 11:30:49 -07007402 boolean gpsSuccess = Settings.Secure.setLocationProviderEnabledForUser(
7403 cr, LocationManager.GPS_PROVIDER, gps, userId);
Tom O'Neilla324ac72013-08-26 14:40:23 -07007404 return gpsSuccess && nlpSuccess;
Tom O'Neill1f48b782013-08-19 18:14:56 -07007405 }
7406 }
7407
7408 /**
Tom O'Neill1f48b782013-08-19 18:14:56 -07007409 * Thread-safe method for reading the location mode, returns one of
7410 * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY},
Tom O'Neill87c7fad2016-08-04 08:16:12 -07007411 * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}. Necessary
7412 * because the mode is a composite of the underlying location provider settings.
Tom O'Neill1f48b782013-08-19 18:14:56 -07007413 *
7414 * @param cr the content resolver to use
7415 * @param userId the userId for which to read the mode
7416 * @return the location mode
7417 */
Tom O'Neill7f6f4572013-08-27 10:53:15 -07007418 private static final int getLocationModeForUser(ContentResolver cr, int userId) {
Tom O'Neill1f48b782013-08-19 18:14:56 -07007419 synchronized (mLocationSettingsLock) {
7420 boolean gpsEnabled = Settings.Secure.isLocationProviderEnabledForUser(
7421 cr, LocationManager.GPS_PROVIDER, userId);
7422 boolean networkEnabled = Settings.Secure.isLocationProviderEnabledForUser(
7423 cr, LocationManager.NETWORK_PROVIDER, userId);
7424 if (gpsEnabled && networkEnabled) {
7425 return LOCATION_MODE_HIGH_ACCURACY;
7426 } else if (gpsEnabled) {
7427 return LOCATION_MODE_SENSORS_ONLY;
7428 } else if (networkEnabled) {
7429 return LOCATION_MODE_BATTERY_SAVING;
7430 } else {
7431 return LOCATION_MODE_OFF;
7432 }
7433 }
7434 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007435 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07007436
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007437 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007438 * Global system settings, containing preferences that always apply identically
7439 * to all defined users. Applications can read these but are not allowed to write;
7440 * like the "Secure" settings, these are for preferences that the user must
7441 * explicitly modify through the system UI or specialized APIs for those values.
7442 */
7443 public static final class Global extends NameValueTable {
Christopher Tate06efb532012-08-24 15:29:27 -07007444 /**
7445 * The content:// style URL for global secure settings items. Not public.
7446 */
7447 public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/global");
7448
7449 /**
Amith Yamasani23a0f052014-07-25 12:26:53 -07007450 * Whether users are allowed to add more users or guest from lockscreen.
7451 * <p>
7452 * Type: int
7453 * @hide
7454 */
7455 public static final String ADD_USERS_WHEN_LOCKED = "add_users_when_locked";
7456
7457 /**
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07007458 * Setting whether the global gesture for enabling accessibility is enabled.
7459 * If this gesture is enabled the user will be able to perfrom it to enable
7460 * the accessibility state without visiting the settings app.
Phil Weaver106fe732016-11-22 18:18:39 -08007461 *
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07007462 * @hide
Phil Weaver106fe732016-11-22 18:18:39 -08007463 * No longer used. Should be removed once all dependencies have been updated.
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07007464 */
7465 public static final String ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED =
7466 "enable_accessibility_global_gesture_enabled";
7467
7468 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007469 * Whether Airplane Mode is on.
7470 */
7471 public static final String AIRPLANE_MODE_ON = "airplane_mode_on";
7472
7473 /**
Bryce Lee584a4452014-10-21 15:55:55 -07007474 * Whether Theater Mode is on.
7475 * {@hide}
7476 */
Bryce Leecdfebd62015-02-02 08:19:11 -08007477 @SystemApi
Bryce Lee584a4452014-10-21 15:55:55 -07007478 public static final String THEATER_MODE_ON = "theater_mode_on";
7479
7480 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007481 * Constant for use in AIRPLANE_MODE_RADIOS to specify Bluetooth radio.
7482 */
7483 public static final String RADIO_BLUETOOTH = "bluetooth";
7484
7485 /**
7486 * Constant for use in AIRPLANE_MODE_RADIOS to specify Wi-Fi radio.
7487 */
7488 public static final String RADIO_WIFI = "wifi";
7489
7490 /**
7491 * {@hide}
7492 */
7493 public static final String RADIO_WIMAX = "wimax";
7494 /**
7495 * Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio.
7496 */
7497 public static final String RADIO_CELL = "cell";
7498
7499 /**
7500 * Constant for use in AIRPLANE_MODE_RADIOS to specify NFC radio.
7501 */
7502 public static final String RADIO_NFC = "nfc";
7503
7504 /**
7505 * A comma separated list of radios that need to be disabled when airplane mode
7506 * is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are
7507 * included in the comma separated list.
7508 */
7509 public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios";
7510
7511 /**
7512 * A comma separated list of radios that should to be disabled when airplane mode
7513 * is on, but can be manually reenabled by the user. For example, if RADIO_WIFI is
7514 * added to both AIRPLANE_MODE_RADIOS and AIRPLANE_MODE_TOGGLEABLE_RADIOS, then Wifi
7515 * will be turned off when entering airplane mode, but the user will be able to reenable
7516 * Wifi in the Settings app.
7517 *
7518 * {@hide}
7519 */
7520 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios";
7521
7522 /**
Bryce Leeec85f342015-12-16 13:32:28 -08007523 * A Long representing a bitmap of profiles that should be disabled when bluetooth starts.
7524 * See {@link android.bluetooth.BluetoothProfile}.
7525 * {@hide}
7526 */
7527 public static final String BLUETOOTH_DISABLED_PROFILES = "bluetooth_disabled_profiles";
7528
7529 /**
Andre Eisenbach82a94d92016-01-14 14:20:34 -08007530 * A semi-colon separated list of Bluetooth interoperability workarounds.
7531 * Each entry is a partial Bluetooth device address string and an integer representing
7532 * the feature to be disabled, separated by a comma. The integer must correspond
7533 * to a interoperability feature as defined in "interop.h" in /system/bt.
7534 * <p>
7535 * Example: <br/>
7536 * "00:11:22,0;01:02:03:04,2"
7537 * @hide
7538 */
7539 public static final String BLUETOOTH_INTEROPERABILITY_LIST = "bluetooth_interoperability_list";
7540
7541 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007542 * The policy for deciding when Wi-Fi should go to sleep (which will in
7543 * turn switch to using the mobile data as an Internet connection).
7544 * <p>
7545 * Set to one of {@link #WIFI_SLEEP_POLICY_DEFAULT},
7546 * {@link #WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED}, or
7547 * {@link #WIFI_SLEEP_POLICY_NEVER}.
7548 */
7549 public static final String WIFI_SLEEP_POLICY = "wifi_sleep_policy";
7550
7551 /**
7552 * Value for {@link #WIFI_SLEEP_POLICY} to use the default Wi-Fi sleep
7553 * policy, which is to sleep shortly after the turning off
7554 * according to the {@link #STAY_ON_WHILE_PLUGGED_IN} setting.
7555 */
7556 public static final int WIFI_SLEEP_POLICY_DEFAULT = 0;
7557
7558 /**
7559 * Value for {@link #WIFI_SLEEP_POLICY} to use the default policy when
7560 * the device is on battery, and never go to sleep when the device is
7561 * plugged in.
7562 */
7563 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1;
7564
7565 /**
7566 * Value for {@link #WIFI_SLEEP_POLICY} to never go to sleep.
7567 */
7568 public static final int WIFI_SLEEP_POLICY_NEVER = 2;
7569
7570 /**
7571 * Value to specify if the user prefers the date, time and time zone
7572 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
7573 */
7574 public static final String AUTO_TIME = "auto_time";
7575
7576 /**
7577 * Value to specify if the user prefers the time zone
7578 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
7579 */
7580 public static final String AUTO_TIME_ZONE = "auto_time_zone";
7581
7582 /**
7583 * URI for the car dock "in" event sound.
7584 * @hide
7585 */
7586 public static final String CAR_DOCK_SOUND = "car_dock_sound";
7587
7588 /**
7589 * URI for the car dock "out" event sound.
7590 * @hide
7591 */
7592 public static final String CAR_UNDOCK_SOUND = "car_undock_sound";
7593
7594 /**
7595 * URI for the desk dock "in" event sound.
7596 * @hide
7597 */
7598 public static final String DESK_DOCK_SOUND = "desk_dock_sound";
7599
7600 /**
7601 * URI for the desk dock "out" event sound.
7602 * @hide
7603 */
7604 public static final String DESK_UNDOCK_SOUND = "desk_undock_sound";
7605
7606 /**
7607 * Whether to play a sound for dock events.
7608 * @hide
7609 */
7610 public static final String DOCK_SOUNDS_ENABLED = "dock_sounds_enabled";
7611
7612 /**
Vinod Krishnancf11cea2016-10-20 22:57:02 -07007613 * Whether to play a sound for dock events, only when an accessibility service is on.
7614 * @hide
7615 */
7616 public static final String DOCK_SOUNDS_ENABLED_WHEN_ACCESSIBILITY = "dock_sounds_enabled_when_accessbility";
7617
7618 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007619 * URI for the "device locked" (keyguard shown) sound.
7620 * @hide
7621 */
7622 public static final String LOCK_SOUND = "lock_sound";
7623
7624 /**
7625 * URI for the "device unlocked" sound.
7626 * @hide
7627 */
7628 public static final String UNLOCK_SOUND = "unlock_sound";
7629
7630 /**
Adrian Roos49e057d2014-08-13 17:14:51 +02007631 * URI for the "device is trusted" sound, which is played when the device enters the trusted
7632 * state without unlocking.
7633 * @hide
7634 */
7635 public static final String TRUSTED_SOUND = "trusted_sound";
7636
7637 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007638 * URI for the low battery sound file.
7639 * @hide
7640 */
7641 public static final String LOW_BATTERY_SOUND = "low_battery_sound";
7642
7643 /**
7644 * Whether to play a sound for low-battery alerts.
7645 * @hide
7646 */
7647 public static final String POWER_SOUNDS_ENABLED = "power_sounds_enabled";
7648
7649 /**
Jeff Brown84e27562012-12-07 13:56:34 -08007650 * URI for the "wireless charging started" sound.
7651 * @hide
7652 */
7653 public static final String WIRELESS_CHARGING_STARTED_SOUND =
7654 "wireless_charging_started_sound";
7655
7656 /**
John Spurlock51a871d2015-05-06 17:41:30 -04007657 * Whether to play a sound for charging events.
7658 * @hide
7659 */
7660 public static final String CHARGING_SOUNDS_ENABLED = "charging_sounds_enabled";
7661
7662 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007663 * Whether we keep the device on while the device is plugged in.
7664 * Supported values are:
7665 * <ul>
7666 * <li>{@code 0} to never stay on while plugged in</li>
7667 * <li>{@link BatteryManager#BATTERY_PLUGGED_AC} to stay on for AC charger</li>
7668 * <li>{@link BatteryManager#BATTERY_PLUGGED_USB} to stay on for USB charger</li>
7669 * <li>{@link BatteryManager#BATTERY_PLUGGED_WIRELESS} to stay on for wireless charger</li>
7670 * </ul>
7671 * These values can be OR-ed together.
7672 */
7673 public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in";
7674
7675 /**
Christopher Tate58f41ec2013-01-11 15:40:36 -08007676 * When the user has enable the option to have a "bug report" command
7677 * in the power menu.
7678 * @hide
7679 */
7680 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
7681
7682 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007683 * Whether ADB is enabled.
7684 */
7685 public static final String ADB_ENABLED = "adb_enabled";
7686
7687 /**
Jon Miranda836c0a82014-08-11 12:32:26 -07007688 * Whether Views are allowed to save their attribute data.
7689 * @hide
7690 */
7691 public static final String DEBUG_VIEW_ATTRIBUTES = "debug_view_attributes";
7692
7693 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007694 * Whether assisted GPS should be enabled or not.
7695 * @hide
7696 */
7697 public static final String ASSISTED_GPS_ENABLED = "assisted_gps_enabled";
7698
7699 /**
7700 * Whether bluetooth is enabled/disabled
7701 * 0=disabled. 1=enabled.
7702 */
7703 public static final String BLUETOOTH_ON = "bluetooth_on";
7704
7705 /**
7706 * CDMA Cell Broadcast SMS
7707 * 0 = CDMA Cell Broadcast SMS disabled
7708 * 1 = CDMA Cell Broadcast SMS enabled
7709 * @hide
7710 */
7711 public static final String CDMA_CELL_BROADCAST_SMS =
7712 "cdma_cell_broadcast_sms";
7713
7714 /**
7715 * The CDMA roaming mode 0 = Home Networks, CDMA default
7716 * 1 = Roaming on Affiliated networks
7717 * 2 = Roaming on any networks
7718 * @hide
7719 */
7720 public static final String CDMA_ROAMING_MODE = "roaming_settings";
7721
7722 /**
7723 * The CDMA subscription mode 0 = RUIM/SIM (default)
7724 * 1 = NV
7725 * @hide
7726 */
7727 public static final String CDMA_SUBSCRIPTION_MODE = "subscription_mode";
7728
Narayan Kamath94bcdbc2017-07-17 15:32:53 +01007729 /**
7730 * The default value for whether background data is enabled or not.
7731 *
7732 * Used by {@code NetworkPolicyManagerService}.
7733 *
7734 * @hide
7735 */
7736 public static final String DEFAULT_RESTRICT_BACKGROUND_DATA =
7737 "default_restrict_background_data";
7738
Christopher Tate06efb532012-08-24 15:29:27 -07007739 /** Inactivity timeout to track mobile data activity.
7740 *
7741 * If set to a positive integer, it indicates the inactivity timeout value in seconds to
7742 * infer the data activity of mobile network. After a period of no activity on mobile
7743 * networks with length specified by the timeout, an {@code ACTION_DATA_ACTIVITY_CHANGE}
7744 * intent is fired to indicate a transition of network status from "active" to "idle". Any
7745 * subsequent activity on mobile networks triggers the firing of {@code
7746 * ACTION_DATA_ACTIVITY_CHANGE} intent indicating transition from "idle" to "active".
7747 *
7748 * Network activity refers to transmitting or receiving data on the network interfaces.
7749 *
7750 * Tracking is disabled if set to zero or negative value.
7751 *
7752 * @hide
7753 */
7754 public static final String DATA_ACTIVITY_TIMEOUT_MOBILE = "data_activity_timeout_mobile";
7755
7756 /** Timeout to tracking Wifi data activity. Same as {@code DATA_ACTIVITY_TIMEOUT_MOBILE}
7757 * but for Wifi network.
7758 * @hide
7759 */
7760 public static final String DATA_ACTIVITY_TIMEOUT_WIFI = "data_activity_timeout_wifi";
7761
7762 /**
7763 * Whether or not data roaming is enabled. (0 = false, 1 = true)
7764 */
7765 public static final String DATA_ROAMING = "data_roaming";
7766
7767 /**
Wink Saville75c1e692013-03-20 17:06:50 -07007768 * The value passed to a Mobile DataConnection via bringUp which defines the
7769 * number of retries to preform when setting up the initial connection. The default
7770 * value defined in DataConnectionTrackerBase#DEFAULT_MDC_INITIAL_RETRY is currently 1.
7771 * @hide
7772 */
7773 public static final String MDC_INITIAL_MAX_RETRY = "mdc_initial_max_retry";
7774
7775 /**
Todd Kennedyf39ca8f2015-08-07 14:15:07 -07007776 * Whether any package can be on external storage. When this is true, any
7777 * package, regardless of manifest values, is a candidate for installing
7778 * or moving onto external storage. (0 = false, 1 = true)
7779 * @hide
7780 */
7781 public static final String FORCE_ALLOW_ON_EXTERNAL = "force_allow_on_external";
7782
Jorim Jaggi8ccdf3a2015-10-22 12:50:31 +02007783 /**
Jeff Davidson91c3d072017-04-12 12:17:11 -07007784 * The default SM-DP+ configured for this device.
7785 *
7786 * <p>An SM-DP+ is used by an LPA (see {@link android.service.euicc.EuiccService}) to
7787 * download profiles. If this value is set, the LPA will query this server for any profiles
7788 * available to this device. If any are available, they may be downloaded during device
7789 * provisioning or in settings without needing the user to enter an activation code.
7790 *
7791 * @see android.service.euicc.EuiccService
7792 * @hide
7793 *
7794 * TODO(b/35851809): Make this a SystemApi.
7795 */
7796 public static final String DEFAULT_SM_DP_PLUS = "default_sm_dp_plus";
7797
7798 /**
Jeff Davidsondff39332017-05-19 17:07:48 -07007799 * Whether any profile has ever been downloaded onto a eUICC on the device.
7800 *
7801 * <p>Used to hide eUICC UI from users who have never made use of it and would only be
7802 * confused by seeing references to it in settings.
7803 * (0 = false, 1 = true)
7804 * @hide
7805 */
7806 public static final String EUICC_PROVISIONED = "euicc_provisioned";
7807
7808 /**
Jorim Jaggi8ccdf3a2015-10-22 12:50:31 +02007809 * Whether any activity can be resized. When this is true, any
7810 * activity, regardless of manifest values, can be resized for multi-window.
7811 * (0 = false, 1 = true)
7812 * @hide
7813 */
7814 public static final String DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES
7815 = "force_resizable_activities";
7816
Jorim Jaggi6f2efd32015-12-23 12:04:39 +01007817 /**
7818 * Whether to enable experimental freeform support for windows.
7819 * @hide
7820 */
7821 public static final String DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT
7822 = "enable_freeform_support";
7823
Todd Kennedyf39ca8f2015-08-07 14:15:07 -07007824 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007825 * Whether user has enabled development settings.
7826 */
7827 public static final String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled";
7828
7829 /**
Amith Yamasanicb15d662015-11-10 11:11:15 -08007830 * Whether the device has been provisioned (0 = false, 1 = true).
7831 * <p>On a multiuser device with a separate system user, the screen may be locked
7832 * as soon as this is set to true and further activities cannot be launched on the
7833 * system user unless they are marked to show over keyguard.
Christopher Tate06efb532012-08-24 15:29:27 -07007834 */
7835 public static final String DEVICE_PROVISIONED = "device_provisioned";
7836
7837 /**
Robert Greenwaltbeb482c2016-03-28 15:40:56 -07007838 * Whether mobile data should be allowed while the device is being provisioned.
7839 * This allows the provisioning process to turn off mobile data before the user
7840 * has an opportunity to set things up, preventing other processes from burning
7841 * precious bytes before wifi is setup.
7842 * (0 = false, 1 = true)
7843 * @hide
7844 */
7845 public static final String DEVICE_PROVISIONING_MOBILE_DATA_ENABLED =
7846 "device_provisioning_mobile_data";
7847
7848 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007849 * The saved value for WindowManagerService.setForcedDisplaySize().
7850 * Two integers separated by a comma. If unset, then use the real display size.
7851 * @hide
7852 */
7853 public static final String DISPLAY_SIZE_FORCED = "display_size_forced";
7854
7855 /**
Jeff Brownd46747a2015-04-15 19:02:36 -07007856 * The saved value for WindowManagerService.setForcedDisplayScalingMode().
7857 * 0 or unset if scaling is automatic, 1 if scaling is disabled.
7858 * @hide
7859 */
7860 public static final String DISPLAY_SCALING_FORCE = "display_scaling_force";
7861
7862 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007863 * The maximum size, in bytes, of a download that the download manager will transfer over
7864 * a non-wifi connection.
7865 * @hide
7866 */
7867 public static final String DOWNLOAD_MAX_BYTES_OVER_MOBILE =
7868 "download_manager_max_bytes_over_mobile";
7869
7870 /**
7871 * The recommended maximum size, in bytes, of a download that the download manager should
7872 * transfer over a non-wifi connection. Over this size, the use will be warned, but will
7873 * have the option to start the download over the mobile connection anyway.
7874 * @hide
7875 */
7876 public static final String DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE =
7877 "download_manager_recommended_max_bytes_over_mobile";
7878
7879 /**
Christopher Tateaa036a22014-05-19 16:33:27 -07007880 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
Christopher Tate06efb532012-08-24 15:29:27 -07007881 */
Christopher Tateaa036a22014-05-19 16:33:27 -07007882 @Deprecated
7883 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
Christopher Tate06efb532012-08-24 15:29:27 -07007884
7885 /**
Jinsuk Kimb3d91772014-07-10 12:48:54 +09007886 * Whether HDMI control shall be enabled. If disabled, no CEC/MHL command will be
7887 * sent or processed. (0 = false, 1 = true)
7888 * @hide
7889 */
7890 public static final String HDMI_CONTROL_ENABLED = "hdmi_control_enabled";
7891
7892 /**
Donghyun Choc1fa9af2016-12-27 18:31:09 +09007893 * Whether HDMI System Audio Control feature is enabled. If enabled, TV will try to turn on
7894 * system audio mode if there's a connected CEC-enabled AV Receiver. Then audio stream will
7895 * be played on AVR instead of TV spaeker. If disabled, the system audio mode will never be
7896 * activated.
Jinsuk Kimb3d91772014-07-10 12:48:54 +09007897 * @hide
7898 */
Donghyun Choc1fa9af2016-12-27 18:31:09 +09007899 public static final String HDMI_SYSTEM_AUDIO_CONTROL_ENABLED =
7900 "hdmi_system_audio_control_enabled";
Jinsuk Kimb3d91772014-07-10 12:48:54 +09007901
7902 /**
Jinsuk Kimb3d91772014-07-10 12:48:54 +09007903 * Whether TV will automatically turn on upon reception of the CEC command
7904 * &lt;Text View On&gt; or &lt;Image View On&gt;. (0 = false, 1 = true)
7905 * @hide
7906 */
7907 public static final String HDMI_CONTROL_AUTO_WAKEUP_ENABLED =
7908 "hdmi_control_auto_wakeup_enabled";
7909
7910 /**
7911 * Whether TV will also turn off other CEC devices when it goes to standby mode.
7912 * (0 = false, 1 = true)
7913 * @hide
7914 */
7915 public static final String HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED =
7916 "hdmi_control_auto_device_off_enabled";
7917
7918 /**
Soonil Nagarkar7decfb62017-01-18 12:18:49 -08007919 * The interval in milliseconds at which location requests will be throttled when they are
7920 * coming from the background.
7921 * @hide
7922 */
7923 public static final String LOCATION_BACKGROUND_THROTTLE_INTERVAL_MS =
7924 "location_background_throttle_interval_ms";
7925
Soonil Nagarkar2f1f7e82017-01-24 12:52:10 -08007926 /**
Lifu Tangc94ef4d2017-03-23 23:48:00 -07007927 * Most frequent location update interval in milliseconds that proximity alert is allowed
7928 * to request.
7929 * @hide
7930 */
7931 public static final String LOCATION_BACKGROUND_THROTTLE_PROXIMITY_ALERT_INTERVAL_MS =
7932 "location_background_throttle_proximity_alert_interval_ms";
7933
7934 /**
Soonil Nagarkar2f1f7e82017-01-24 12:52:10 -08007935 * Packages that are whitelisted for background throttling (throttling will not be applied).
7936 * @hide
7937 */
7938 public static final String LOCATION_BACKGROUND_THROTTLE_PACKAGE_WHITELIST =
7939 "location_background_throttle_package_whitelist";
7940
Wei Wangcdbffa92017-04-17 19:49:29 -07007941 /**
7942 * The interval in milliseconds at which wifi scan requests will be throttled when they are
7943 * coming from the background.
7944 * @hide
7945 */
7946 public static final String WIFI_SCAN_BACKGROUND_THROTTLE_INTERVAL_MS =
7947 "wifi_scan_background_throttle_interval_ms";
7948
7949 /**
7950 * Packages that are whitelisted to be exempt for wifi background throttling.
7951 * @hide
7952 */
7953 public static final String WIFI_SCAN_BACKGROUND_THROTTLE_PACKAGE_WHITELIST =
7954 "wifi_scan_background_throttle_package_whitelist";
7955
7956 /**
Jinsuk Kimb3d91772014-07-10 12:48:54 +09007957 * Whether TV will switch to MHL port when a mobile device is plugged in.
7958 * (0 = false, 1 = true)
7959 * @hide
7960 */
7961 public static final String MHL_INPUT_SWITCHING_ENABLED = "mhl_input_switching_enabled";
7962
7963 /**
7964 * Whether TV will charge the mobile device connected at MHL port. (0 = false, 1 = true)
7965 * @hide
7966 */
7967 public static final String MHL_POWER_CHARGE_ENABLED = "mhl_power_charge_enabled";
7968
7969 /**
Christopher Tate06efb532012-08-24 15:29:27 -07007970 * Whether mobile data connections are allowed by the user. See
7971 * ConnectivityManager for more info.
7972 * @hide
7973 */
7974 public static final String MOBILE_DATA = "mobile_data";
7975
Erik Klineda4bfa82015-04-30 12:58:40 +09007976 /**
7977 * Whether the mobile data connection should remain active even when higher
7978 * priority networks like WiFi are active, to help make network switching faster.
7979 *
7980 * See ConnectivityService for more info.
7981 *
7982 * (0 = disabled, 1 = enabled)
7983 * @hide
7984 */
7985 public static final String MOBILE_DATA_ALWAYS_ON = "mobile_data_always_on";
7986
Hugo Benichi05686db2016-10-19 11:17:28 +09007987 /**
7988 * Size of the event buffer for IP connectivity metrics.
7989 * @hide
7990 */
7991 public static final String CONNECTIVITY_METRICS_BUFFER_SIZE =
7992 "connectivity_metrics_buffer_size";
7993
Christopher Tate06efb532012-08-24 15:29:27 -07007994 /** {@hide} */
7995 public static final String NETSTATS_ENABLED = "netstats_enabled";
7996 /** {@hide} */
7997 public static final String NETSTATS_POLL_INTERVAL = "netstats_poll_interval";
7998 /** {@hide} */
7999 public static final String NETSTATS_TIME_CACHE_MAX_AGE = "netstats_time_cache_max_age";
8000 /** {@hide} */
8001 public static final String NETSTATS_GLOBAL_ALERT_BYTES = "netstats_global_alert_bytes";
8002 /** {@hide} */
8003 public static final String NETSTATS_SAMPLE_ENABLED = "netstats_sample_enabled";
Christopher Tate06efb532012-08-24 15:29:27 -07008004
8005 /** {@hide} */
8006 public static final String NETSTATS_DEV_BUCKET_DURATION = "netstats_dev_bucket_duration";
8007 /** {@hide} */
8008 public static final String NETSTATS_DEV_PERSIST_BYTES = "netstats_dev_persist_bytes";
8009 /** {@hide} */
8010 public static final String NETSTATS_DEV_ROTATE_AGE = "netstats_dev_rotate_age";
8011 /** {@hide} */
8012 public static final String NETSTATS_DEV_DELETE_AGE = "netstats_dev_delete_age";
8013
8014 /** {@hide} */
8015 public static final String NETSTATS_UID_BUCKET_DURATION = "netstats_uid_bucket_duration";
8016 /** {@hide} */
8017 public static final String NETSTATS_UID_PERSIST_BYTES = "netstats_uid_persist_bytes";
8018 /** {@hide} */
8019 public static final String NETSTATS_UID_ROTATE_AGE = "netstats_uid_rotate_age";
8020 /** {@hide} */
8021 public static final String NETSTATS_UID_DELETE_AGE = "netstats_uid_delete_age";
8022
8023 /** {@hide} */
8024 public static final String NETSTATS_UID_TAG_BUCKET_DURATION = "netstats_uid_tag_bucket_duration";
8025 /** {@hide} */
8026 public static final String NETSTATS_UID_TAG_PERSIST_BYTES = "netstats_uid_tag_persist_bytes";
8027 /** {@hide} */
8028 public static final String NETSTATS_UID_TAG_ROTATE_AGE = "netstats_uid_tag_rotate_age";
8029 /** {@hide} */
8030 public static final String NETSTATS_UID_TAG_DELETE_AGE = "netstats_uid_tag_delete_age";
8031
8032 /**
8033 * User preference for which network(s) should be used. Only the
8034 * connectivity service should touch this.
8035 */
8036 public static final String NETWORK_PREFERENCE = "network_preference";
8037
8038 /**
Jeff Davidsondd6fd1e2014-04-14 15:14:30 -07008039 * Which package name to use for network scoring. If null, or if the package is not a valid
8040 * scorer app, external network scores will neither be requested nor accepted.
8041 * @hide
8042 */
8043 public static final String NETWORK_SCORER_APP = "network_scorer_app";
8044
8045 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008046 * If the NITZ_UPDATE_DIFF time is exceeded then an automatic adjustment
8047 * to SystemClock will be allowed even if NITZ_UPDATE_SPACING has not been
8048 * exceeded.
8049 * @hide
8050 */
8051 public static final String NITZ_UPDATE_DIFF = "nitz_update_diff";
8052
8053 /**
8054 * The length of time in milli-seconds that automatic small adjustments to
8055 * SystemClock are ignored if NITZ_UPDATE_DIFF is not exceeded.
8056 * @hide
8057 */
8058 public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing";
8059
8060 /** Preferred NTP server. {@hide} */
8061 public static final String NTP_SERVER = "ntp_server";
8062 /** Timeout in milliseconds to wait for NTP server. {@hide} */
8063 public static final String NTP_TIMEOUT = "ntp_timeout";
8064
Jeff Sharkeye8a4b662015-06-27 15:43:45 -07008065 /** {@hide} */
8066 public static final String STORAGE_BENCHMARK_INTERVAL = "storage_benchmark_interval";
8067
Christopher Tate06efb532012-08-24 15:29:27 -07008068 /**
Pierre Imai8e48e672016-04-21 13:30:43 +09008069 * Sample validity in seconds to configure for the system DNS resolver.
8070 * {@hide}
8071 */
8072 public static final String DNS_RESOLVER_SAMPLE_VALIDITY_SECONDS =
8073 "dns_resolver_sample_validity_seconds";
8074
8075 /**
8076 * Success threshold in percent for use with the system DNS resolver.
8077 * {@hide}
8078 */
8079 public static final String DNS_RESOLVER_SUCCESS_THRESHOLD_PERCENT =
8080 "dns_resolver_success_threshold_percent";
8081
8082 /**
8083 * Minimum number of samples needed for statistics to be considered meaningful in the
8084 * system DNS resolver.
8085 * {@hide}
8086 */
8087 public static final String DNS_RESOLVER_MIN_SAMPLES = "dns_resolver_min_samples";
8088
8089 /**
8090 * Maximum number taken into account for statistics purposes in the system DNS resolver.
8091 * {@hide}
8092 */
8093 public static final String DNS_RESOLVER_MAX_SAMPLES = "dns_resolver_max_samples";
8094
8095 /**
Tao Baofdf7c5d2016-02-15 20:59:15 -08008096 * Whether to disable the automatic scheduling of system updates.
8097 * 1 = system updates won't be automatically scheduled (will always
8098 * present notification instead).
8099 * 0 = system updates will be automatically scheduled. (default)
8100 * @hide
8101 */
8102 @SystemApi
8103 public static final String OTA_DISABLE_AUTOMATIC_UPDATE = "ota_disable_automatic_update";
8104
8105 /**
rich cannings4d8fc792012-09-07 14:43:43 -07008106 * Whether the package manager should send package verification broadcasts for verifiers to
8107 * review apps prior to installation.
8108 * 1 = request apps to be verified prior to installation, if a verifier exists.
8109 * 0 = do not verify apps before installation
rich cannings4e5753f2012-09-19 16:03:56 -07008110 * @hide
rich cannings4d8fc792012-09-07 14:43:43 -07008111 */
8112 public static final String PACKAGE_VERIFIER_ENABLE = "package_verifier_enable";
8113
8114 /** Timeout for package verification.
rich cannings4e5753f2012-09-19 16:03:56 -07008115 * @hide */
rich cannings4d8fc792012-09-07 14:43:43 -07008116 public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout";
8117
8118 /** Default response code for package verification.
rich cannings4e5753f2012-09-19 16:03:56 -07008119 * @hide */
rich cannings4d8fc792012-09-07 14:43:43 -07008120 public static final String PACKAGE_VERIFIER_DEFAULT_RESPONSE = "verifier_default_response";
8121
rich cannings4e5753f2012-09-19 16:03:56 -07008122 /**
8123 * Show package verification setting in the Settings app.
rich canningse6686b32012-09-16 14:02:20 -07008124 * 1 = show (default)
8125 * 0 = hide
rich cannings4e5753f2012-09-19 16:03:56 -07008126 * @hide
rich canningse6686b32012-09-16 14:02:20 -07008127 */
8128 public static final String PACKAGE_VERIFIER_SETTING_VISIBLE = "verifier_setting_visible";
8129
rich cannings4d8fc792012-09-07 14:43:43 -07008130 /**
Fabrice Di Meglio1c1b4712014-11-19 17:12:32 -08008131 * Run package verification on apps installed through ADB/ADT/USB
rich cannings4e5753f2012-09-19 16:03:56 -07008132 * 1 = perform package verification on ADB installs (default)
8133 * 0 = bypass package verification on ADB installs
8134 * @hide
8135 */
8136 public static final String PACKAGE_VERIFIER_INCLUDE_ADB = "verifier_verify_adb_installs";
8137
8138 /**
Christopher Tate7265abe2014-11-21 13:54:45 -08008139 * Time since last fstrim (milliseconds) after which we force one to happen
8140 * during device startup. If unset, the default is 3 days.
8141 * @hide
8142 */
8143 public static final String FSTRIM_MANDATORY_INTERVAL = "fstrim_mandatory_interval";
8144
8145 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008146 * The interval in milliseconds at which to check packet counts on the
8147 * mobile data interface when screen is on, to detect possible data
8148 * connection problems.
8149 * @hide
8150 */
8151 public static final String PDP_WATCHDOG_POLL_INTERVAL_MS =
8152 "pdp_watchdog_poll_interval_ms";
8153
8154 /**
8155 * The interval in milliseconds at which to check packet counts on the
8156 * mobile data interface when screen is off, to detect possible data
8157 * connection problems.
8158 * @hide
8159 */
8160 public static final String PDP_WATCHDOG_LONG_POLL_INTERVAL_MS =
8161 "pdp_watchdog_long_poll_interval_ms";
8162
8163 /**
8164 * The interval in milliseconds at which to check packet counts on the
8165 * mobile data interface after {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT}
8166 * outgoing packets has been reached without incoming packets.
8167 * @hide
8168 */
8169 public static final String PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS =
8170 "pdp_watchdog_error_poll_interval_ms";
8171
8172 /**
8173 * The number of outgoing packets sent without seeing an incoming packet
8174 * that triggers a countdown (of {@link #PDP_WATCHDOG_ERROR_POLL_COUNT}
8175 * device is logged to the event log
8176 * @hide
8177 */
8178 public static final String PDP_WATCHDOG_TRIGGER_PACKET_COUNT =
8179 "pdp_watchdog_trigger_packet_count";
8180
8181 /**
8182 * The number of polls to perform (at {@link #PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS})
8183 * after hitting {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} before
8184 * attempting data connection recovery.
8185 * @hide
8186 */
8187 public static final String PDP_WATCHDOG_ERROR_POLL_COUNT =
8188 "pdp_watchdog_error_poll_count";
8189
8190 /**
8191 * The number of failed PDP reset attempts before moving to something more
8192 * drastic: re-registering to the network.
8193 * @hide
8194 */
8195 public static final String PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT =
8196 "pdp_watchdog_max_pdp_reset_fail_count";
8197
8198 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008199 * URL to open browser on to allow user to manage a prepay account
8200 * @hide
8201 */
8202 public static final String SETUP_PREPAID_DATA_SERVICE_URL =
8203 "setup_prepaid_data_service_url";
8204
8205 /**
8206 * URL to attempt a GET on to see if this is a prepay device
8207 * @hide
8208 */
8209 public static final String SETUP_PREPAID_DETECTION_TARGET_URL =
8210 "setup_prepaid_detection_target_url";
8211
8212 /**
8213 * Host to check for a redirect to after an attempt to GET
8214 * SETUP_PREPAID_DETECTION_TARGET_URL. (If we redirected there,
8215 * this is a prepaid device with zero balance.)
8216 * @hide
8217 */
8218 public static final String SETUP_PREPAID_DETECTION_REDIR_HOST =
8219 "setup_prepaid_detection_redir_host";
8220
8221 /**
Jake Hamby76a61422012-09-06 17:40:21 -07008222 * The interval in milliseconds at which to check the number of SMS sent out without asking
8223 * for use permit, to limit the un-authorized SMS usage.
8224 *
8225 * @hide
8226 */
8227 public static final String SMS_OUTGOING_CHECK_INTERVAL_MS =
8228 "sms_outgoing_check_interval_ms";
8229
8230 /**
8231 * The number of outgoing SMS sent without asking for user permit (of {@link
8232 * #SMS_OUTGOING_CHECK_INTERVAL_MS}
8233 *
8234 * @hide
8235 */
8236 public static final String SMS_OUTGOING_CHECK_MAX_COUNT =
8237 "sms_outgoing_check_max_count";
8238
8239 /**
8240 * Used to disable SMS short code confirmation - defaults to true.
Robert Greenwalt026efcc2012-09-24 10:03:21 -07008241 * True indcates we will do the check, etc. Set to false to disable.
Jake Hamby76a61422012-09-06 17:40:21 -07008242 * @see com.android.internal.telephony.SmsUsageMonitor
8243 * @hide
8244 */
8245 public static final String SMS_SHORT_CODE_CONFIRMATION = "sms_short_code_confirmation";
8246
Robert Greenwalt026efcc2012-09-24 10:03:21 -07008247 /**
8248 * Used to select which country we use to determine premium sms codes.
8249 * One of com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_SIM,
8250 * com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_NETWORK,
8251 * or com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_BOTH.
8252 * @hide
8253 */
8254 public static final String SMS_SHORT_CODE_RULE = "sms_short_code_rule";
8255
Jake Hamby76a61422012-09-06 17:40:21 -07008256 /**
JP Abgrall32d1ac4d2014-02-21 12:05:20 -08008257 * Used to select TCP's default initial receiver window size in segments - defaults to a build config value
8258 * @hide
8259 */
8260 public static final String TCP_DEFAULT_INIT_RWND = "tcp_default_init_rwnd";
8261
8262 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008263 * Used to disable Tethering on a device - defaults to true
8264 * @hide
8265 */
8266 public static final String TETHER_SUPPORTED = "tether_supported";
8267
8268 /**
8269 * Used to require DUN APN on the device or not - defaults to a build config value
8270 * which defaults to false
8271 * @hide
8272 */
8273 public static final String TETHER_DUN_REQUIRED = "tether_dun_required";
8274
8275 /**
8276 * Used to hold a gservices-provisioned apn value for DUN. If set, or the
8277 * corresponding build config values are set it will override the APN DB
8278 * values.
8279 * Consists of a comma seperated list of strings:
8280 * "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type"
8281 * note that empty fields can be ommitted: "name,apn,,,,,,,,,310,260,,DUN"
8282 * @hide
8283 */
8284 public static final String TETHER_DUN_APN = "tether_dun_apn";
8285
Erik Kline92c4db02017-05-31 10:21:32 +09008286 /**
8287 * Used to disable trying to talk to any available tethering offload HAL.
8288 *
8289 * Integer values are interpreted as boolean, and the absence of an explicit setting
8290 * is interpreted as |false|.
8291 * @hide
8292 */
8293 public static final String TETHER_OFFLOAD_DISABLED = "tether_offload_disabled";
8294
Christopher Tate06efb532012-08-24 15:29:27 -07008295 /**
Junda Liu0c35fbc2016-01-19 23:20:15 -08008296 * List of carrier apps which are whitelisted to prompt the user for install when
8297 * a sim card with matching uicc carrier privilege rules is inserted.
8298 *
8299 * The value is "package1;package2;..."
8300 * @hide
8301 */
8302 public static final String CARRIER_APP_WHITELIST = "carrier_app_whitelist";
8303
8304 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008305 * USB Mass Storage Enabled
8306 */
8307 public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled";
8308
8309 /**
8310 * If this setting is set (to anything), then all references
8311 * to Gmail on the device must change to Google Mail.
8312 */
8313 public static final String USE_GOOGLE_MAIL = "use_google_mail";
8314
Hui Shu22671772014-10-01 21:41:07 +00008315 /**
8316 * Webview Data reduction proxy key.
8317 * @hide
8318 */
8319 public static final String WEBVIEW_DATA_REDUCTION_PROXY_KEY =
8320 "webview_data_reduction_proxy_key";
8321
Lorenzo Colitti84e6f1232016-08-29 14:03:11 +09008322 /**
8323 * Whether or not the WebView fallback mechanism should be enabled.
8324 * 0=disabled, 1=enabled.
8325 * @hide
8326 */
8327 public static final String WEBVIEW_FALLBACK_LOGIC_ENABLED =
8328 "webview_fallback_logic_enabled";
Gustav Senntonc83e3fa2016-02-18 12:19:13 +00008329
Lorenzo Colitti84e6f1232016-08-29 14:03:11 +09008330 /**
8331 * Name of the package used as WebView provider (if unset the provider is instead determined
8332 * by the system).
8333 * @hide
8334 */
8335 public static final String WEBVIEW_PROVIDER = "webview_provider";
Gustav Sennton14c033c2016-02-11 12:51:27 +00008336
Lorenzo Colitti84e6f1232016-08-29 14:03:11 +09008337 /**
8338 * Developer setting to enable WebView multiprocess rendering.
8339 * @hide
8340 */
8341 @SystemApi
8342 public static final String WEBVIEW_MULTIPROCESS = "webview_multiprocess";
8343
8344 /**
8345 * The maximum number of notifications shown in 24 hours when switching networks.
8346 * @hide
8347 */
8348 public static final String NETWORK_SWITCH_NOTIFICATION_DAILY_LIMIT =
8349 "network_switch_notification_daily_limit";
8350
8351 /**
8352 * The minimum time in milliseconds between notifications when switching networks.
8353 * @hide
8354 */
8355 public static final String NETWORK_SWITCH_NOTIFICATION_RATE_LIMIT_MILLIS =
8356 "network_switch_notification_rate_limit_millis";
Tobias Sargeantda857102016-02-11 14:52:28 +00008357
Christopher Tate06efb532012-08-24 15:29:27 -07008358 /**
Hugo Benichic8e9e122016-09-14 23:23:08 +00008359 * Whether to automatically switch away from wifi networks that lose Internet access.
Lorenzo Colitti165c51c2016-09-19 01:00:19 +09008360 * Only meaningful if config_networkAvoidBadWifi is set to 0, otherwise the system always
8361 * avoids such networks. Valid values are:
8362 *
8363 * 0: Don't avoid bad wifi, don't prompt the user. Get stuck on bad wifi like it's 2013.
8364 * null: Ask the user whether to switch away from bad wifi.
8365 * 1: Avoid bad wifi.
8366 *
Hugo Benichic8e9e122016-09-14 23:23:08 +00008367 * @hide
8368 */
8369 public static final String NETWORK_AVOID_BAD_WIFI = "network_avoid_bad_wifi";
8370
8371 /**
Lorenzo Colitti2de49252017-01-24 18:08:41 +09008372 * User setting for ConnectivityManager.getMeteredMultipathPreference(). This value may be
8373 * overridden by the system based on device or application state. If null, the value
8374 * specified by config_networkMeteredMultipathPreference is used.
8375 *
8376 * @hide
8377 */
8378 public static final String NETWORK_METERED_MULTIPATH_PREFERENCE =
8379 "network_metered_multipath_preference";
8380
8381 /**
William Meecd62f3a2017-01-24 18:01:38 -08008382 * The thresholds of the wifi throughput badging (SD, HD etc.) as a comma-delimited list of
8383 * colon-delimited key-value pairs. The key is the badging enum value defined in
8384 * android.net.ScoredNetwork and the value is the minimum sustained network throughput in
8385 * kbps required for the badge. For example: "10:3000,20:5000,30:25000"
8386 *
8387 * @hide
8388 */
8389 @SystemApi
8390 public static final String WIFI_BADGING_THRESHOLDS = "wifi_badging_thresholds";
8391
8392 /**
Jeff Brown89d55462012-09-19 11:33:42 -07008393 * Whether Wifi display is enabled/disabled
8394 * 0=disabled. 1=enabled.
8395 * @hide
8396 */
8397 public static final String WIFI_DISPLAY_ON = "wifi_display_on";
8398
8399 /**
Chong Zhang1f3ecaa2013-05-03 15:55:36 -07008400 * Whether Wifi display certification mode is enabled/disabled
8401 * 0=disabled. 1=enabled.
8402 * @hide
8403 */
8404 public static final String WIFI_DISPLAY_CERTIFICATION_ON =
8405 "wifi_display_certification_on";
8406
8407 /**
Chong Zhange38af812013-08-29 17:25:17 -07008408 * WPS Configuration method used by Wifi display, this setting only
8409 * takes effect when WIFI_DISPLAY_CERTIFICATION_ON is 1 (enabled).
8410 *
8411 * Possible values are:
8412 *
8413 * WpsInfo.INVALID: use default WPS method chosen by framework
8414 * WpsInfo.PBC : use Push button
8415 * WpsInfo.KEYPAD : use Keypad
8416 * WpsInfo.DISPLAY: use Display
8417 * @hide
8418 */
8419 public static final String WIFI_DISPLAY_WPS_CONFIG =
8420 "wifi_display_wps_config";
8421
8422 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008423 * Whether to notify the user of open networks.
8424 * <p>
8425 * If not connected and the scan results have an open network, we will
8426 * put this notification up. If we attempt to connect to a network or
8427 * the open network(s) disappear, we remove the notification. When we
8428 * show the notification, we will not show it again for
8429 * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time.
Amin Shaikh3087e322017-03-24 17:34:24 -07008430 *
8431 * @deprecated This feature is no longer controlled by this setting in
8432 * {@link android.os.Build.VERSION_CODES#O}.
Christopher Tate06efb532012-08-24 15:29:27 -07008433 */
Amin Shaikh3087e322017-03-24 17:34:24 -07008434 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07008435 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
8436 "wifi_networks_available_notification_on";
Amin Shaikh3087e322017-03-24 17:34:24 -07008437
Christopher Tate06efb532012-08-24 15:29:27 -07008438 /**
8439 * {@hide}
8440 */
8441 public static final String WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON =
8442 "wimax_networks_available_notification_on";
8443
8444 /**
8445 * Delay (in seconds) before repeating the Wi-Fi networks available notification.
8446 * Connecting to a network will reset the timer.
8447 */
8448 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
8449 "wifi_networks_available_repeat_delay";
8450
8451 /**
Robert Greenwalt3ea0c992013-10-03 21:13:49 +00008452 * 802.11 country code in ISO 3166 format
8453 * @hide
8454 */
8455 public static final String WIFI_COUNTRY_CODE = "wifi_country_code";
8456
8457 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008458 * The interval in milliseconds to issue wake up scans when wifi needs
8459 * to connect. This is necessary to connect to an access point when
8460 * device is on the move and the screen is off.
8461 * @hide
8462 */
8463 public static final String WIFI_FRAMEWORK_SCAN_INTERVAL_MS =
8464 "wifi_framework_scan_interval_ms";
8465
8466 /**
8467 * The interval in milliseconds after which Wi-Fi is considered idle.
8468 * When idle, it is possible for the device to be switched from Wi-Fi to
8469 * the mobile data network.
8470 * @hide
8471 */
8472 public static final String WIFI_IDLE_MS = "wifi_idle_ms";
8473
8474 /**
8475 * When the number of open networks exceeds this number, the
8476 * least-recently-used excess networks will be removed.
8477 */
8478 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept";
8479
8480 /**
8481 * Whether the Wi-Fi should be on. Only the Wi-Fi service should touch this.
8482 */
8483 public static final String WIFI_ON = "wifi_on";
8484
8485 /**
Irfan Sheriff11aefad2013-03-06 07:57:41 -08008486 * Setting to allow scans to be enabled even wifi is turned off for connectivity.
8487 * @hide
8488 */
8489 public static final String WIFI_SCAN_ALWAYS_AVAILABLE =
8490 "wifi_scan_always_enabled";
8491
Stephen Chen8ca96c12016-11-16 15:46:51 -08008492 /**
8493 * Value to specify if Wi-Fi Wakeup feature is enabled.
Stephen Chenf1b75642016-12-06 16:08:52 -08008494 *
8495 * Type: int (0 for false, 1 for true)
Stephen Chen8ca96c12016-11-16 15:46:51 -08008496 * @hide
8497 */
8498 @SystemApi
8499 public static final String WIFI_WAKEUP_ENABLED = "wifi_wakeup_enabled";
8500
Stephen Chen6a0c8792016-11-16 15:46:51 -08008501 /**
Jeremy Joslin45caa252017-05-04 11:22:46 -07008502 * Value to specify if Wi-Fi Wakeup is available.
8503 *
8504 * Wi-Fi Wakeup will only operate if it's available
8505 * and {@link #WIFI_WAKEUP_ENABLED} is true.
8506 *
8507 * Type: int (0 for false, 1 for true)
8508 * @hide
8509 */
8510 public static final String WIFI_WAKEUP_AVAILABLE = "wifi_wakeup_available";
8511
8512 /**
Sundeep Ghumane869d832017-01-25 16:23:43 -08008513 * Value to specify whether network quality scores and badging should be shown in the UI.
8514 *
8515 * Type: int (0 for false, 1 for true)
8516 * @hide
8517 */
8518 public static final String NETWORK_SCORING_UI_ENABLED = "network_scoring_ui_enabled";
8519
8520 /**
Stephen Chen6a0c8792016-11-16 15:46:51 -08008521 * Value to specify if network recommendations from
8522 * {@link com.android.server.NetworkScoreService} are enabled.
Stephen Chenf1b75642016-12-06 16:08:52 -08008523 *
Jeremy Joslin9925c6a2017-03-06 10:39:35 -08008524 * Type: int
8525 * Valid values:
8526 * -1 = Forced off
8527 * 0 = Disabled
8528 * 1 = Enabled
8529 *
8530 * Most readers of this setting should simply check if value == 1 to determined the
8531 * enabled state.
Stephen Chen6a0c8792016-11-16 15:46:51 -08008532 * @hide
8533 */
Stephen Chen6a0c8792016-11-16 15:46:51 -08008534 public static final String NETWORK_RECOMMENDATIONS_ENABLED =
8535 "network_recommendations_enabled";
8536
Jeremy Joslincb594f32017-01-03 17:31:23 -08008537 /**
Jeremy Joslinc9eb3c42017-02-08 10:45:30 -08008538 * Which package name to use for network recommendations. If null, network recommendations
8539 * will neither be requested nor accepted.
8540 *
8541 * Use {@link NetworkScoreManager#getActiveScorerPackage()} to read this value and
8542 * {@link NetworkScoreManager#setActiveScorer(String)} to write it.
8543 *
8544 * Type: string - package name
8545 * @hide
8546 */
8547 public static final String NETWORK_RECOMMENDATIONS_PACKAGE =
8548 "network_recommendations_package";
8549
8550 /**
Amin Shaikhbc9a8e62017-02-02 15:39:12 -08008551 * The package name of the application that connect and secures high quality open wifi
8552 * networks automatically.
8553 *
8554 * Type: string package name or null if the feature is either not provided or disabled.
8555 * @hide
8556 */
8557 public static final String USE_OPEN_WIFI_PACKAGE = "use_open_wifi_package";
8558
8559 /**
Jeremy Joslincb594f32017-01-03 17:31:23 -08008560 * The number of milliseconds the {@link com.android.server.NetworkScoreService}
8561 * will give a recommendation request to complete before returning a default response.
8562 *
8563 * Type: long
8564 * @hide
Jeremy Joslinb1a01392017-04-14 13:35:48 -07008565 * @deprecated to be removed
Jeremy Joslincb594f32017-01-03 17:31:23 -08008566 */
8567 public static final String NETWORK_RECOMMENDATION_REQUEST_TIMEOUT_MS =
8568 "network_recommendation_request_timeout_ms";
8569
Amin Shaikhd3c81932017-02-06 16:22:42 -08008570 /**
8571 * The expiration time in milliseconds for the {@link android.net.WifiKey} request cache in
8572 * {@link com.android.server.wifi.RecommendedNetworkEvaluator}.
8573 *
8574 * Type: long
8575 * @hide
8576 */
8577 public static final String RECOMMENDED_NETWORK_EVALUATOR_CACHE_EXPIRY_MS =
8578 "recommended_network_evaluator_cache_expiry_ms";
8579
Irfan Sheriff11aefad2013-03-06 07:57:41 -08008580 /**
Wei Wangd91f1932015-03-19 15:09:56 -07008581 * Settings to allow BLE scans to be enabled even when Bluetooth is turned off for
8582 * connectivity.
8583 * @hide
8584 */
8585 public static final String BLE_SCAN_ALWAYS_AVAILABLE =
8586 "ble_scan_always_enabled";
8587
8588 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008589 * Used to save the Wifi_ON state prior to tethering.
8590 * This state will be checked to restore Wifi after
8591 * the user turns off tethering.
8592 *
8593 * @hide
8594 */
8595 public static final String WIFI_SAVED_STATE = "wifi_saved_state";
8596
8597 /**
8598 * The interval in milliseconds to scan as used by the wifi supplicant
8599 * @hide
8600 */
8601 public static final String WIFI_SUPPLICANT_SCAN_INTERVAL_MS =
8602 "wifi_supplicant_scan_interval_ms";
8603
vandwalle7c3606c2014-03-31 19:12:07 -07008604 /**
8605 * whether frameworks handles wifi auto-join
8606 * @hide
8607 */
8608 public static final String WIFI_ENHANCED_AUTO_JOIN =
8609 "wifi_enhanced_auto_join";
8610
8611 /**
8612 * whether settings show RSSI
8613 * @hide
8614 */
8615 public static final String WIFI_NETWORK_SHOW_RSSI =
8616 "wifi_network_show_rssi";
8617
8618 /**
Irfan Sheriff3809f502012-09-17 16:04:57 -07008619 * The interval in milliseconds to scan at supplicant when p2p is connected
8620 * @hide
8621 */
8622 public static final String WIFI_SCAN_INTERVAL_WHEN_P2P_CONNECTED_MS =
8623 "wifi_scan_interval_p2p_connected_ms";
8624
8625 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008626 * Whether the Wi-Fi watchdog is enabled.
8627 */
8628 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
8629
8630 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008631 * Setting to turn off poor network avoidance on Wi-Fi. Feature is enabled by default and
8632 * the setting needs to be set to 0 to disable it.
8633 * @hide
8634 */
8635 public static final String WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED =
8636 "wifi_watchdog_poor_network_test_enabled";
8637
8638 /**
8639 * Setting to turn on suspend optimizations at screen off on Wi-Fi. Enabled by default and
8640 * needs to be set to 0 to disable it.
8641 * @hide
8642 */
8643 public static final String WIFI_SUSPEND_OPTIMIZATIONS_ENABLED =
8644 "wifi_suspend_optimizations_enabled";
8645
8646 /**
Nathan Harold29589fc2016-03-30 21:53:48 -07008647 * Setting to enable verbose logging in Wi-Fi; disabled by default, and setting to 1
8648 * will enable it. In the future, additional values may be supported.
8649 * @hide
8650 */
8651 public static final String WIFI_VERBOSE_LOGGING_ENABLED =
8652 "wifi_verbose_logging_enabled";
8653
8654 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008655 * The maximum number of times we will retry a connection to an access
8656 * point for which we have failed in acquiring an IP address from DHCP.
8657 * A value of N means that we will make N+1 connection attempts in all.
8658 */
8659 public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count";
8660
8661 /**
8662 * Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile
8663 * data connectivity to be established after a disconnect from Wi-Fi.
8664 */
8665 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
8666 "wifi_mobile_data_transition_wakelock_timeout_ms";
8667
8668 /**
Zoltan Szatmary-Ban4045d242015-05-27 12:42:39 +01008669 * This setting controls whether WiFi configurations created by a Device Owner app
8670 * should be locked down (that is, be editable or removable only by the Device Owner App,
8671 * not even by Settings app).
8672 * This setting takes integer values. Non-zero values mean DO created configurations
8673 * are locked down. Value of zero means they are not. Default value in the absence of
8674 * actual value to this setting is 0.
8675 */
8676 public static final String WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN =
8677 "wifi_device_owner_configs_lockdown";
8678
8679 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008680 * The operational wifi frequency band
8681 * Set to one of {@link WifiManager#WIFI_FREQUENCY_BAND_AUTO},
8682 * {@link WifiManager#WIFI_FREQUENCY_BAND_5GHZ} or
8683 * {@link WifiManager#WIFI_FREQUENCY_BAND_2GHZ}
8684 *
8685 * @hide
8686 */
8687 public static final String WIFI_FREQUENCY_BAND = "wifi_frequency_band";
8688
8689 /**
8690 * The Wi-Fi peer-to-peer device name
8691 * @hide
8692 */
8693 public static final String WIFI_P2P_DEVICE_NAME = "wifi_p2p_device_name";
8694
8695 /**
Robert Greenwaltc12783a2013-05-16 12:48:20 -07008696 * The min time between wifi disable and wifi enable
8697 * @hide
8698 */
8699 public static final String WIFI_REENABLE_DELAY_MS = "wifi_reenable_delay";
8700
8701 /**
Jeff Davidsona20ca67d2014-12-16 11:48:54 -08008702 * Timeout for ephemeral networks when all known BSSIDs go out of range. We will disconnect
8703 * from an ephemeral network if there is no BSSID for that network with a non-null score that
8704 * has been seen in this time period.
8705 *
8706 * If this is less than or equal to zero, we use a more conservative behavior and only check
8707 * for a non-null score from the currently connected or target BSSID.
8708 * @hide
8709 */
8710 public static final String WIFI_EPHEMERAL_OUT_OF_RANGE_TIMEOUT_MS =
8711 "wifi_ephemeral_out_of_range_timeout_ms";
8712
8713 /**
Christopher Tatec868b642012-09-12 17:41:04 -07008714 * The number of milliseconds to delay when checking for data stalls during
8715 * non-aggressive detection. (screen is turned off.)
8716 * @hide
8717 */
8718 public static final String DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS =
8719 "data_stall_alarm_non_aggressive_delay_in_ms";
8720
8721 /**
8722 * The number of milliseconds to delay when checking for data stalls during
8723 * aggressive detection. (screen on or suspected data stall)
8724 * @hide
8725 */
8726 public static final String DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS =
8727 "data_stall_alarm_aggressive_delay_in_ms";
8728
8729 /**
Wink Savillece1e3792013-09-03 16:41:44 -07008730 * The number of milliseconds to allow the provisioning apn to remain active
8731 * @hide
8732 */
8733 public static final String PROVISIONING_APN_ALARM_DELAY_IN_MS =
8734 "provisioning_apn_alarm_delay_in_ms";
8735
8736 /**
Christopher Tatec868b642012-09-12 17:41:04 -07008737 * The interval in milliseconds at which to check gprs registration
8738 * after the first registration mismatch of gprs and voice service,
8739 * to detect possible data network registration problems.
8740 *
8741 * @hide
8742 */
8743 public static final String GPRS_REGISTER_CHECK_PERIOD_MS =
8744 "gprs_register_check_period_ms";
8745
8746 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008747 * Nonzero causes Log.wtf() to crash.
8748 * @hide
8749 */
8750 public static final String WTF_IS_FATAL = "wtf_is_fatal";
8751
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07008752 /**
8753 * Ringer mode. This is used internally, changing this value will not
8754 * change the ringer mode. See AudioManager.
8755 */
8756 public static final String MODE_RINGER = "mode_ringer";
Christopher Tate06efb532012-08-24 15:29:27 -07008757
Jeff Brownd4935962012-09-25 13:27:20 -07008758 /**
8759 * Overlay display devices setting.
8760 * The associated value is a specially formatted string that describes the
8761 * size and density of simulated secondary display devices.
8762 * <p>
8763 * Format: {width}x{height}/{dpi};...
8764 * </p><p>
8765 * Example:
8766 * <ul>
8767 * <li><code>1280x720/213</code>: make one overlay that is 1280x720 at 213dpi.</li>
8768 * <li><code>1920x1080/320;1280x720/213</code>: make two overlays, the first
8769 * at 1080p and the second at 720p.</li>
8770 * <li>If the value is empty, then no overlay display devices are created.</li>
8771 * </ul></p>
8772 *
8773 * @hide
8774 */
8775 public static final String OVERLAY_DISPLAY_DEVICES = "overlay_display_devices";
Christopher Tate06efb532012-08-24 15:29:27 -07008776
Jeff Sharkey625239a2012-09-26 22:03:49 -07008777 /**
8778 * Threshold values for the duration and level of a discharge cycle,
8779 * under which we log discharge cycle info.
8780 *
8781 * @hide
8782 */
8783 public static final String
8784 BATTERY_DISCHARGE_DURATION_THRESHOLD = "battery_discharge_duration_threshold";
8785
8786 /** @hide */
8787 public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold";
8788
8789 /**
8790 * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR
8791 * intents on application crashes and ANRs. If this is disabled, the
8792 * crash/ANR dialog will never display the "Report" button.
8793 * <p>
8794 * Type: int (0 = disallow, 1 = allow)
8795 *
8796 * @hide
8797 */
8798 public static final String SEND_ACTION_APP_ERROR = "send_action_app_error";
8799
8800 /**
8801 * Maximum age of entries kept by {@link DropBoxManager}.
8802 *
8803 * @hide
8804 */
8805 public static final String DROPBOX_AGE_SECONDS = "dropbox_age_seconds";
8806
8807 /**
8808 * Maximum number of entry files which {@link DropBoxManager} will keep
8809 * around.
8810 *
8811 * @hide
8812 */
8813 public static final String DROPBOX_MAX_FILES = "dropbox_max_files";
8814
8815 /**
8816 * Maximum amount of disk space used by {@link DropBoxManager} no matter
8817 * what.
8818 *
8819 * @hide
8820 */
8821 public static final String DROPBOX_QUOTA_KB = "dropbox_quota_kb";
8822
8823 /**
8824 * Percent of free disk (excluding reserve) which {@link DropBoxManager}
8825 * will use.
8826 *
8827 * @hide
8828 */
8829 public static final String DROPBOX_QUOTA_PERCENT = "dropbox_quota_percent";
8830
8831 /**
8832 * Percent of total disk which {@link DropBoxManager} will never dip
8833 * into.
8834 *
8835 * @hide
8836 */
8837 public static final String DROPBOX_RESERVE_PERCENT = "dropbox_reserve_percent";
8838
8839 /**
8840 * Prefix for per-tag dropbox disable/enable settings.
8841 *
8842 * @hide
8843 */
8844 public static final String DROPBOX_TAG_PREFIX = "dropbox:";
8845
8846 /**
8847 * Lines of logcat to include with system crash/ANR/etc. reports, as a
8848 * prefix of the dropbox tag of the report type. For example,
8849 * "logcat_for_system_server_anr" controls the lines of logcat captured
8850 * with system server ANR reports. 0 to disable.
8851 *
8852 * @hide
8853 */
8854 public static final String ERROR_LOGCAT_PREFIX = "logcat_for_";
8855
8856 /**
8857 * The interval in minutes after which the amount of free storage left
8858 * on the device is logged to the event log
8859 *
8860 * @hide
8861 */
8862 public static final String SYS_FREE_STORAGE_LOG_INTERVAL = "sys_free_storage_log_interval";
8863
8864 /**
8865 * Threshold for the amount of change in disk free space required to
8866 * report the amount of free space. Used to prevent spamming the logs
8867 * when the disk free space isn't changing frequently.
8868 *
8869 * @hide
8870 */
8871 public static final String
8872 DISK_FREE_CHANGE_REPORTING_THRESHOLD = "disk_free_change_reporting_threshold";
8873
8874 /**
8875 * Minimum percentage of free storage on the device that is used to
8876 * determine if the device is running low on storage. The default is 10.
8877 * <p>
8878 * Say this value is set to 10, the device is considered running low on
8879 * storage if 90% or more of the device storage is filled up.
8880 *
8881 * @hide
8882 */
8883 public static final String
8884 SYS_STORAGE_THRESHOLD_PERCENTAGE = "sys_storage_threshold_percentage";
8885
8886 /**
8887 * Maximum byte size of the low storage threshold. This is to ensure
8888 * that {@link #SYS_STORAGE_THRESHOLD_PERCENTAGE} does not result in an
8889 * overly large threshold for large storage devices. Currently this must
8890 * be less than 2GB. This default is 500MB.
8891 *
8892 * @hide
8893 */
8894 public static final String
8895 SYS_STORAGE_THRESHOLD_MAX_BYTES = "sys_storage_threshold_max_bytes";
8896
8897 /**
8898 * Minimum bytes of free storage on the device before the data partition
8899 * is considered full. By default, 1 MB is reserved to avoid system-wide
8900 * SQLite disk full exceptions.
8901 *
8902 * @hide
8903 */
8904 public static final String
8905 SYS_STORAGE_FULL_THRESHOLD_BYTES = "sys_storage_full_threshold_bytes";
8906
8907 /**
Jeff Sharkeyd5d5e922017-02-21 10:51:23 -07008908 * Minimum percentage of storage on the device that is reserved for
8909 * cached data.
8910 *
8911 * @hide
8912 */
8913 public static final String
8914 SYS_STORAGE_CACHE_PERCENTAGE = "sys_storage_cache_percentage";
8915
8916 /**
8917 * Maximum bytes of storage on the device that is reserved for cached
8918 * data.
8919 *
8920 * @hide
8921 */
8922 public static final String
8923 SYS_STORAGE_CACHE_MAX_BYTES = "sys_storage_cache_max_bytes";
8924
8925 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07008926 * The maximum reconnect delay for short network outages or when the
8927 * network is suspended due to phone use.
8928 *
8929 * @hide
8930 */
8931 public static final String
8932 SYNC_MAX_RETRY_DELAY_IN_SECONDS = "sync_max_retry_delay_in_seconds";
8933
8934 /**
8935 * The number of milliseconds to delay before sending out
Erik Kline8f29dcf2014-12-08 16:25:20 +09008936 * {@link ConnectivityManager#CONNECTIVITY_ACTION} broadcasts. Ignored.
Jeff Sharkey625239a2012-09-26 22:03:49 -07008937 *
8938 * @hide
8939 */
8940 public static final String CONNECTIVITY_CHANGE_DELAY = "connectivity_change_delay";
8941
Vinit Deshapnde1f12cb52013-08-21 13:09:01 -07008942
8943 /**
8944 * Network sampling interval, in seconds. We'll generate link information
8945 * about bytes/packets sent and error rates based on data sampled in this interval
8946 *
8947 * @hide
8948 */
8949
8950 public static final String CONNECTIVITY_SAMPLING_INTERVAL_IN_SECONDS =
8951 "connectivity_sampling_interval_in_seconds";
8952
Jeff Sharkey625239a2012-09-26 22:03:49 -07008953 /**
Jason Monk602b2322013-07-03 17:04:33 -04008954 * The series of successively longer delays used in retrying to download PAC file.
8955 * Last delay is used between successful PAC downloads.
8956 *
8957 * @hide
8958 */
8959 public static final String PAC_CHANGE_DELAY = "pac_change_delay";
8960
8961 /**
Calvin Onbe96da12016-10-11 15:10:46 -07008962 * Don't attempt to detect captive portals.
Jeff Sharkey625239a2012-09-26 22:03:49 -07008963 *
8964 * @hide
8965 */
Calvin Onbe96da12016-10-11 15:10:46 -07008966 public static final int CAPTIVE_PORTAL_MODE_IGNORE = 0;
8967
8968 /**
8969 * When detecting a captive portal, display a notification that
8970 * prompts the user to sign in.
8971 *
8972 * @hide
8973 */
8974 public static final int CAPTIVE_PORTAL_MODE_PROMPT = 1;
8975
8976 /**
8977 * When detecting a captive portal, immediately disconnect from the
8978 * network and do not reconnect to that network in the future.
8979 *
8980 * @hide
8981 */
8982 public static final int CAPTIVE_PORTAL_MODE_AVOID = 2;
8983
8984 /**
8985 * What to do when connecting a network that presents a captive portal.
8986 * Must be one of the CAPTIVE_PORTAL_MODE_* constants above.
8987 *
8988 * The default for this setting is CAPTIVE_PORTAL_MODE_PROMPT.
8989 * @hide
8990 */
8991 public static final String CAPTIVE_PORTAL_MODE = "captive_portal_mode";
8992
8993 /**
8994 * Setting to turn off captive portal detection. Feature is enabled by
8995 * default and the setting needs to be set to 0 to disable it.
8996 *
8997 * @deprecated use CAPTIVE_PORTAL_MODE_IGNORE to disable captive portal detection
8998 * @hide
8999 */
9000 @Deprecated
Jeff Sharkey625239a2012-09-26 22:03:49 -07009001 public static final String
9002 CAPTIVE_PORTAL_DETECTION_ENABLED = "captive_portal_detection_enabled";
9003
9004 /**
9005 * The server used for captive portal detection upon a new conection. A
9006 * 204 response code from the server is used for validation.
Hugo Benichi92eb22fd2016-09-27 13:01:41 +09009007 * TODO: remove this deprecated symbol.
Jeff Sharkey625239a2012-09-26 22:03:49 -07009008 *
9009 * @hide
9010 */
9011 public static final String CAPTIVE_PORTAL_SERVER = "captive_portal_server";
9012
9013 /**
Hugo Benichi92eb22fd2016-09-27 13:01:41 +09009014 * The URL used for HTTPS captive portal detection upon a new connection.
9015 * A 204 response code from the server is used for validation.
9016 *
9017 * @hide
9018 */
9019 public static final String CAPTIVE_PORTAL_HTTPS_URL = "captive_portal_https_url";
9020
9021 /**
9022 * The URL used for HTTP captive portal detection upon a new connection.
9023 * A 204 response code from the server is used for validation.
9024 *
9025 * @hide
9026 */
9027 public static final String CAPTIVE_PORTAL_HTTP_URL = "captive_portal_http_url";
9028
9029 /**
9030 * The URL used for fallback HTTP captive portal detection when previous HTTP
9031 * and HTTPS captive portal detection attemps did not return a conclusive answer.
9032 *
9033 * @hide
9034 */
9035 public static final String CAPTIVE_PORTAL_FALLBACK_URL = "captive_portal_fallback_url";
9036
9037 /**
Hugo Benichieef918a2017-04-10 17:43:08 +09009038 * A comma separated list of URLs used for captive portal detection in addition to the
9039 * fallback HTTP url associated with the CAPTIVE_PORTAL_FALLBACK_URL settings.
9040 *
9041 * @hide
9042 */
9043 public static final String CAPTIVE_PORTAL_OTHER_FALLBACK_URLS =
9044 "captive_portal_other_fallback_urls";
9045
9046 /**
Lorenzo Colittic5be12e2016-04-19 21:57:31 +09009047 * Whether to use HTTPS for network validation. This is enabled by default and the setting
9048 * needs to be set to 0 to disable it. This setting is a misnomer because captive portals
9049 * don't actually use HTTPS, but it's consistent with the other settings.
9050 *
9051 * @hide
9052 */
9053 public static final String CAPTIVE_PORTAL_USE_HTTPS = "captive_portal_use_https";
9054
9055 /**
Hugo Benichi92eb22fd2016-09-27 13:01:41 +09009056 * Which User-Agent string to use in the header of the captive portal detection probes.
9057 * The User-Agent field is unset when this setting has no value (HttpUrlConnection default).
9058 *
9059 * @hide
9060 */
9061 public static final String CAPTIVE_PORTAL_USER_AGENT = "captive_portal_user_agent";
9062
9063 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07009064 * Whether network service discovery is enabled.
9065 *
9066 * @hide
9067 */
9068 public static final String NSD_ON = "nsd_on";
9069
9070 /**
9071 * Let user pick default install location.
9072 *
9073 * @hide
9074 */
9075 public static final String SET_INSTALL_LOCATION = "set_install_location";
9076
9077 /**
9078 * Default install location value.
9079 * 0 = auto, let system decide
9080 * 1 = internal
9081 * 2 = sdcard
9082 * @hide
9083 */
9084 public static final String DEFAULT_INSTALL_LOCATION = "default_install_location";
9085
9086 /**
9087 * ms during which to consume extra events related to Inet connection
9088 * condition after a transtion to fully-connected
9089 *
9090 * @hide
9091 */
9092 public static final String
9093 INET_CONDITION_DEBOUNCE_UP_DELAY = "inet_condition_debounce_up_delay";
9094
9095 /**
9096 * ms during which to consume extra events related to Inet connection
9097 * condtion after a transtion to partly-connected
9098 *
9099 * @hide
9100 */
9101 public static final String
9102 INET_CONDITION_DEBOUNCE_DOWN_DELAY = "inet_condition_debounce_down_delay";
9103
9104 /** {@hide} */
9105 public static final String
9106 READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT = "read_external_storage_enforced_default";
9107
9108 /**
9109 * Host name and port for global http proxy. Uses ':' seperator for
9110 * between host and port.
9111 */
9112 public static final String HTTP_PROXY = "http_proxy";
9113
9114 /**
9115 * Host name for global http proxy. Set via ConnectivityManager.
9116 *
9117 * @hide
9118 */
9119 public static final String GLOBAL_HTTP_PROXY_HOST = "global_http_proxy_host";
9120
9121 /**
9122 * Integer host port for global http proxy. Set via ConnectivityManager.
9123 *
9124 * @hide
9125 */
9126 public static final String GLOBAL_HTTP_PROXY_PORT = "global_http_proxy_port";
9127
9128 /**
9129 * Exclusion list for global proxy. This string contains a list of
9130 * comma-separated domains where the global proxy does not apply.
9131 * Domains should be listed in a comma- separated list. Example of
9132 * acceptable formats: ".domain1.com,my.domain2.com" Use
9133 * ConnectivityManager to set/get.
9134 *
9135 * @hide
9136 */
9137 public static final String
9138 GLOBAL_HTTP_PROXY_EXCLUSION_LIST = "global_http_proxy_exclusion_list";
9139
9140 /**
Jason Monk602b2322013-07-03 17:04:33 -04009141 * The location PAC File for the proxy.
9142 * @hide
9143 */
9144 public static final String
9145 GLOBAL_HTTP_PROXY_PAC = "global_proxy_pac_url";
9146
9147 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07009148 * Enables the UI setting to allow the user to specify the global HTTP
9149 * proxy and associated exclusion list.
9150 *
9151 * @hide
9152 */
9153 public static final String SET_GLOBAL_HTTP_PROXY = "set_global_http_proxy";
9154
9155 /**
9156 * Setting for default DNS in case nobody suggests one
9157 *
9158 * @hide
9159 */
9160 public static final String DEFAULT_DNS_SERVER = "default_dns_server";
9161
Jeff Sharkey0ac10282012-10-01 12:50:22 -07009162 /** {@hide} */
9163 public static final String
9164 BLUETOOTH_HEADSET_PRIORITY_PREFIX = "bluetooth_headset_priority_";
9165 /** {@hide} */
9166 public static final String
9167 BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX = "bluetooth_a2dp_sink_priority_";
9168 /** {@hide} */
9169 public static final String
Sanket Agarwal1bec6a52015-10-21 18:23:27 -07009170 BLUETOOTH_A2DP_SRC_PRIORITY_PREFIX = "bluetooth_a2dp_src_priority_";
9171 /** {@hide} */
Antony Sargentf5772c62017-04-26 16:37:53 -07009172 public static final String BLUETOOTH_A2DP_SUPPORTS_OPTIONAL_CODECS_PREFIX =
9173 "bluetooth_a2dp_supports_optional_codecs_";
9174 /** {@hide} */
9175 public static final String BLUETOOTH_A2DP_OPTIONAL_CODECS_ENABLED_PREFIX =
9176 "bluetooth_a2dp_optional_codecs_enabled_";
9177 /** {@hide} */
Sanket Agarwal1bec6a52015-10-21 18:23:27 -07009178 public static final String
Jeff Sharkey0ac10282012-10-01 12:50:22 -07009179 BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX = "bluetooth_input_device_priority_";
Kim Schulz0d376052013-08-22 11:18:02 +02009180 /** {@hide} */
9181 public static final String
9182 BLUETOOTH_MAP_PRIORITY_PREFIX = "bluetooth_map_priority_";
Casper Bonde2a5f6082015-03-19 10:36:45 +01009183 /** {@hide} */
9184 public static final String
Joseph Pirozzo631768d2016-09-01 14:19:28 -07009185 BLUETOOTH_MAP_CLIENT_PRIORITY_PREFIX = "bluetooth_map_client_priority_";
9186 /** {@hide} */
9187 public static final String
Joseph Pirozzo563c7002016-03-21 15:49:48 -07009188 BLUETOOTH_PBAP_CLIENT_PRIORITY_PREFIX = "bluetooth_pbap_client_priority_";
9189 /** {@hide} */
9190 public static final String
Casper Bonde2a5f6082015-03-19 10:36:45 +01009191 BLUETOOTH_SAP_PRIORITY_PREFIX = "bluetooth_sap_priority_";
Sanket Agarwal773297a2016-08-04 16:16:20 -07009192 /** {@hide} */
9193 public static final String
9194 BLUETOOTH_PAN_PRIORITY_PREFIX = "bluetooth_pan_priority_";
Jeff Sharkey0ac10282012-10-01 12:50:22 -07009195
9196 /**
Dianne Hackborn0ef403e2017-01-24 18:22:15 -08009197 * Activity manager specific settings.
9198 * This is encoded as a key=value list, separated by commas. Ex:
9199 *
Dianne Hackborn83b40f62017-04-26 13:59:47 -07009200 * "gc_timeout=5000,max_cached_processes=24"
Dianne Hackborn0ef403e2017-01-24 18:22:15 -08009201 *
9202 * The following keys are supported:
9203 *
9204 * <pre>
Dianne Hackborn0ef403e2017-01-24 18:22:15 -08009205 * max_cached_processes (int)
Dianne Hackborn83b40f62017-04-26 13:59:47 -07009206 * background_settle_time (long)
Dianne Hackborncb015632017-06-14 17:30:15 -07009207 * fgservice_min_shown_time (long)
9208 * fgservice_min_report_time (long)
9209 * fgservice_screen_on_before_time (long)
9210 * fgservice_screen_on_after_time (long)
Dianne Hackborn83b40f62017-04-26 13:59:47 -07009211 * content_provider_retain_time (long)
9212 * gc_timeout (long)
9213 * gc_min_interval (long)
9214 * full_pss_min_interval (long)
9215 * full_pss_lowered_interval (long)
Dianne Hackbornffca58b2017-05-24 16:15:45 -07009216 * power_check_interval (long)
9217 * power_check_max_cpu_1 (int)
9218 * power_check_max_cpu_2 (int)
9219 * power_check_max_cpu_3 (int)
9220 * power_check_max_cpu_4 (int)
Dianne Hackborn83b40f62017-04-26 13:59:47 -07009221 * service_usage_interaction_time (long)
9222 * usage_stats_interaction_interval (long)
9223 * service_restart_duration (long)
9224 * service_reset_run_duration (long)
9225 * service_restart_duration_factor (int)
9226 * service_min_restart_time_between (long)
9227 * service_max_inactivity (long)
9228 * service_bg_start_timeout (long)
Dianne Hackborn0ef403e2017-01-24 18:22:15 -08009229 * </pre>
9230 *
9231 * <p>
9232 * Type: string
9233 * @hide
9234 * @see com.android.server.am.ActivityManagerConstants
9235 */
9236 public static final String ACTIVITY_MANAGER_CONSTANTS = "activity_manager_constants";
9237
9238 /**
Adam Lesinski31c05d12015-06-09 17:34:04 -07009239 * Device Idle (Doze) specific settings.
9240 * This is encoded as a key=value list, separated by commas. Ex:
9241 *
Henrik Baardeac10ab2016-04-19 07:50:24 +02009242 * "inactive_to=60000,sensing_to=400000"
Adam Lesinski31c05d12015-06-09 17:34:04 -07009243 *
9244 * The following keys are supported:
9245 *
9246 * <pre>
9247 * inactive_to (long)
9248 * sensing_to (long)
9249 * motion_inactive_to (long)
9250 * idle_after_inactive_to (long)
9251 * idle_pending_to (long)
9252 * max_idle_pending_to (long)
9253 * idle_pending_factor (float)
9254 * idle_to (long)
9255 * max_idle_to (long)
9256 * idle_factor (float)
9257 * min_time_to_alarm (long)
9258 * max_temp_app_whitelist_duration (long)
Felipe Lemea1b79bf2016-05-24 13:06:54 -07009259 * notification_whitelist_duration (long)
Adam Lesinski31c05d12015-06-09 17:34:04 -07009260 * </pre>
9261 *
9262 * <p>
9263 * Type: string
9264 * @hide
9265 * @see com.android.server.DeviceIdleController.Constants
9266 */
9267 public static final String DEVICE_IDLE_CONSTANTS = "device_idle_constants";
9268
9269 /**
Joe LaPennaf33b5bf2016-03-23 15:19:47 -07009270 * Device Idle (Doze) specific settings for watches. See {@code #DEVICE_IDLE_CONSTANTS}
9271 *
9272 * <p>
9273 * Type: string
9274 * @hide
9275 * @see com.android.server.DeviceIdleController.Constants
9276 */
9277 public static final String DEVICE_IDLE_CONSTANTS_WATCH = "device_idle_constants_watch";
9278
9279 /**
jackqdyulei455e90a2017-02-09 15:29:16 -08009280 * Battery Saver specific settings
9281 * This is encoded as a key=value list, separated by commas. Ex:
9282 *
9283 * "vibration_disabled=true,adjust_brightness_factor=0.5"
9284 *
9285 * The following keys are supported:
9286 *
9287 * <pre>
9288 * vibration_disabled (boolean)
9289 * animation_disabled (boolean)
9290 * soundtrigger_disabled (boolean)
9291 * fullbackup_deferred (boolean)
9292 * keyvaluebackup_deferred (boolean)
9293 * firewall_disabled (boolean)
9294 * gps_mode (int)
9295 * adjust_brightness_disabled (boolean)
9296 * adjust_brightness_factor (float)
9297 * </pre>
9298 * @hide
9299 * @see com.android.server.power.BatterySaverPolicy
9300 */
9301 public static final String BATTERY_SAVER_CONSTANTS = "battery_saver_constants";
9302
9303 /**
jackqdyulei7a5e06f2017-05-12 16:00:53 -07009304 * Battery anomaly detection specific settings
9305 * This is encoded as a key=value list, separated by commas. Ex:
9306 *
9307 * "anomaly_detection_enabled=true,wakelock_threshold=2000"
9308 *
9309 * The following keys are supported:
9310 *
9311 * <pre>
9312 * anomaly_detection_enabled (boolean)
9313 * wakelock_enabled (boolean)
9314 * wakelock_threshold (long)
9315 * </pre>
9316 * @hide
9317 */
9318 public static final String ANOMALY_DETECTION_CONSTANTS = "anomaly_detection_constants";
9319
9320 /**
Adam Lesinskia6232df2015-06-11 18:16:41 -07009321 * App standby (app idle) specific settings.
9322 * This is encoded as a key=value list, separated by commas. Ex:
9323 *
9324 * "idle_duration=5000,parole_interval=4500"
9325 *
9326 * The following keys are supported:
9327 *
9328 * <pre>
Adam Lesinskif0ef3c12016-01-13 12:26:07 -08009329 * idle_duration2 (long)
Adam Lesinskia6232df2015-06-11 18:16:41 -07009330 * wallclock_threshold (long)
9331 * parole_interval (long)
9332 * parole_duration (long)
Adam Lesinskif0ef3c12016-01-13 12:26:07 -08009333 *
9334 * idle_duration (long) // This is deprecated and used to circumvent b/26355386.
Adam Lesinskia6232df2015-06-11 18:16:41 -07009335 * </pre>
9336 *
9337 * <p>
9338 * Type: string
9339 * @hide
9340 * @see com.android.server.usage.UsageStatsService.SettingsObserver
9341 */
9342 public static final String APP_IDLE_CONSTANTS = "app_idle_constants";
9343
9344 /**
Dianne Hackborn0ef403e2017-01-24 18:22:15 -08009345 * Power manager specific settings.
9346 * This is encoded as a key=value list, separated by commas. Ex:
9347 *
9348 * "no_cached_wake_locks=1"
9349 *
9350 * The following keys are supported:
9351 *
9352 * <pre>
9353 * no_cached_wake_locks (boolean)
9354 * </pre>
9355 *
9356 * <p>
9357 * Type: string
9358 * @hide
9359 * @see com.android.server.power.PowerManagerConstants
9360 */
9361 public static final String POWER_MANAGER_CONSTANTS = "power_manager_constants";
9362
9363 /**
Dianne Hackborna750a632015-06-16 17:18:23 -07009364 * Alarm manager specific settings.
9365 * This is encoded as a key=value list, separated by commas. Ex:
9366 *
9367 * "min_futurity=5000,allow_while_idle_short_time=4500"
9368 *
9369 * The following keys are supported:
9370 *
9371 * <pre>
9372 * min_futurity (long)
9373 * min_interval (long)
9374 * allow_while_idle_short_time (long)
9375 * allow_while_idle_long_time (long)
9376 * allow_while_idle_whitelist_duration (long)
9377 * </pre>
9378 *
9379 * <p>
9380 * Type: string
9381 * @hide
9382 * @see com.android.server.AlarmManagerService.Constants
9383 */
9384 public static final String ALARM_MANAGER_CONSTANTS = "alarm_manager_constants";
9385
9386 /**
Dianne Hackborne9a988c2016-05-27 17:59:40 -07009387 * Job scheduler specific settings.
9388 * This is encoded as a key=value list, separated by commas. Ex:
9389 *
9390 * "min_ready_jobs_count=2,moderate_use_factor=.5"
9391 *
9392 * The following keys are supported:
9393 *
9394 * <pre>
9395 * min_idle_count (int)
9396 * min_charging_count (int)
9397 * min_connectivity_count (int)
9398 * min_content_count (int)
9399 * min_ready_jobs_count (int)
9400 * heavy_use_factor (float)
9401 * moderate_use_factor (float)
9402 * fg_job_count (int)
9403 * bg_normal_job_count (int)
9404 * bg_moderate_job_count (int)
9405 * bg_low_job_count (int)
9406 * bg_critical_job_count (int)
9407 * </pre>
9408 *
9409 * <p>
9410 * Type: string
9411 * @hide
9412 * @see com.android.server.job.JobSchedulerService.Constants
9413 */
9414 public static final String JOB_SCHEDULER_CONSTANTS = "job_scheduler_constants";
9415
9416 /**
Makoto Onuki4362a662016-03-08 18:59:09 -08009417 * ShortcutManager specific settings.
9418 * This is encoded as a key=value list, separated by commas. Ex:
9419 *
Makoto Onukib6d35232016-04-04 15:57:17 -07009420 * "reset_interval_sec=86400,max_updates_per_interval=1"
Makoto Onuki4362a662016-03-08 18:59:09 -08009421 *
9422 * The following keys are supported:
9423 *
9424 * <pre>
9425 * reset_interval_sec (long)
Makoto Onukib6d35232016-04-04 15:57:17 -07009426 * max_updates_per_interval (int)
Makoto Onuki4362a662016-03-08 18:59:09 -08009427 * max_icon_dimension_dp (int, DP)
9428 * max_icon_dimension_dp_lowram (int, DP)
9429 * max_shortcuts (int)
9430 * icon_quality (int, 0-100)
9431 * icon_format (String)
9432 * </pre>
9433 *
9434 * <p>
9435 * Type: string
9436 * @hide
9437 * @see com.android.server.pm.ShortcutService.ConfigConstants
9438 */
9439 public static final String SHORTCUT_MANAGER_CONSTANTS = "shortcut_manager_constants";
9440
9441 /**
Makoto Onuki09c529a2017-05-01 10:05:28 -07009442 * DevicePolicyManager specific settings.
9443 * This is encoded as a key=value list, separated by commas. Ex:
9444 *
9445 * <pre>
9446 * das_died_service_reconnect_backoff_sec (long)
9447 * das_died_service_reconnect_backoff_increase (float)
9448 * das_died_service_reconnect_max_backoff_sec (long)
9449 * </pre>
9450 *
9451 * <p>
9452 * Type: string
9453 * @hide
9454 * see also com.android.server.devicepolicy.DevicePolicyConstants
9455 */
9456 public static final String DEVICE_POLICY_CONSTANTS = "device_policy_constants";
9457
9458 /**
Jeff Sharkey0ac10282012-10-01 12:50:22 -07009459 * Get the key that retrieves a bluetooth headset's priority.
9460 * @hide
9461 */
9462 public static final String getBluetoothHeadsetPriorityKey(String address) {
Elliott Hughescb64d432013-08-02 10:00:44 -07009463 return BLUETOOTH_HEADSET_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
Jeff Sharkey0ac10282012-10-01 12:50:22 -07009464 }
9465
9466 /**
9467 * Get the key that retrieves a bluetooth a2dp sink's priority.
9468 * @hide
9469 */
9470 public static final String getBluetoothA2dpSinkPriorityKey(String address) {
Elliott Hughescb64d432013-08-02 10:00:44 -07009471 return BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
Jeff Sharkey0ac10282012-10-01 12:50:22 -07009472 }
9473
9474 /**
Sanket Agarwal1bec6a52015-10-21 18:23:27 -07009475 * Get the key that retrieves a bluetooth a2dp src's priority.
9476 * @hide
9477 */
9478 public static final String getBluetoothA2dpSrcPriorityKey(String address) {
9479 return BLUETOOTH_A2DP_SRC_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
9480 }
9481
9482 /**
Antony Sargentf5772c62017-04-26 16:37:53 -07009483 * Get the key that retrieves a bluetooth a2dp device's ability to support optional codecs.
9484 * @hide
9485 */
9486 public static final String getBluetoothA2dpSupportsOptionalCodecsKey(String address) {
9487 return BLUETOOTH_A2DP_SUPPORTS_OPTIONAL_CODECS_PREFIX +
9488 address.toUpperCase(Locale.ROOT);
9489 }
9490
9491 /**
9492 * Get the key that retrieves whether a bluetooth a2dp device should have optional codecs
9493 * enabled.
9494 * @hide
9495 */
9496 public static final String getBluetoothA2dpOptionalCodecsEnabledKey(String address) {
9497 return BLUETOOTH_A2DP_OPTIONAL_CODECS_ENABLED_PREFIX +
9498 address.toUpperCase(Locale.ROOT);
9499 }
9500
9501 /**
Jeff Sharkey0ac10282012-10-01 12:50:22 -07009502 * Get the key that retrieves a bluetooth Input Device's priority.
9503 * @hide
9504 */
9505 public static final String getBluetoothInputDevicePriorityKey(String address) {
Elliott Hughescb64d432013-08-02 10:00:44 -07009506 return BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
Jeff Sharkey0ac10282012-10-01 12:50:22 -07009507 }
9508
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07009509 /**
Sanket Agarwal773297a2016-08-04 16:16:20 -07009510 * Get the key that retrieves a bluetooth pan client priority.
9511 * @hide
9512 */
9513 public static final String getBluetoothPanPriorityKey(String address) {
9514 return BLUETOOTH_PAN_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
9515 }
9516
9517 /**
Kim Schulz0d376052013-08-22 11:18:02 +02009518 * Get the key that retrieves a bluetooth map priority.
9519 * @hide
9520 */
9521 public static final String getBluetoothMapPriorityKey(String address) {
9522 return BLUETOOTH_MAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
9523 }
Casper Bonde2a5f6082015-03-19 10:36:45 +01009524
9525 /**
Joseph Pirozzo631768d2016-09-01 14:19:28 -07009526 * Get the key that retrieves a bluetooth map client priority.
9527 * @hide
9528 */
9529 public static final String getBluetoothMapClientPriorityKey(String address) {
9530 return BLUETOOTH_MAP_CLIENT_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
9531 }
9532
9533 /**
Joseph Pirozzo563c7002016-03-21 15:49:48 -07009534 * Get the key that retrieves a bluetooth pbap client priority.
9535 * @hide
9536 */
9537 public static final String getBluetoothPbapClientPriorityKey(String address) {
9538 return BLUETOOTH_PBAP_CLIENT_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
9539 }
9540
9541 /**
Joseph Pirozzo631768d2016-09-01 14:19:28 -07009542 * Get the key that retrieves a bluetooth sap priority.
Casper Bonde2a5f6082015-03-19 10:36:45 +01009543 * @hide
9544 */
9545 public static final String getBluetoothSapPriorityKey(String address) {
9546 return BLUETOOTH_SAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
9547 }
9548
Kim Schulz0d376052013-08-22 11:18:02 +02009549 /**
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07009550 * Scaling factor for normal window animations. Setting to 0 will
9551 * disable window animations.
9552 */
9553 public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale";
9554
9555 /**
9556 * Scaling factor for activity transition animations. Setting to 0 will
9557 * disable window animations.
9558 */
9559 public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale";
9560
9561 /**
9562 * Scaling factor for Animator-based animations. This affects both the
9563 * start delay and duration of all such animations. Setting to 0 will
9564 * cause animations to end immediately. The default value is 1.
9565 */
9566 public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale";
9567
9568 /**
9569 * Scaling factor for normal window animations. Setting to 0 will
9570 * disable window animations.
9571 *
9572 * @hide
9573 */
9574 public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations";
9575
9576 /**
9577 * If 0, the compatibility mode is off for all applications.
9578 * If 1, older applications run under compatibility mode.
9579 * TODO: remove this settings before code freeze (bug/1907571)
9580 * @hide
9581 */
9582 public static final String COMPATIBILITY_MODE = "compatibility_mode";
9583
9584 /**
9585 * CDMA only settings
9586 * Emergency Tone 0 = Off
9587 * 1 = Alert
9588 * 2 = Vibrate
9589 * @hide
9590 */
9591 public static final String EMERGENCY_TONE = "emergency_tone";
9592
9593 /**
9594 * CDMA only settings
9595 * Whether the auto retry is enabled. The value is
9596 * boolean (1 or 0).
9597 * @hide
9598 */
9599 public static final String CALL_AUTO_RETRY = "call_auto_retry";
9600
9601 /**
Selim Cinek705442f2016-09-13 16:02:33 -07009602 * A setting that can be read whether the emergency affordance is currently needed.
9603 * The value is a boolean (1 or 0).
9604 * @hide
9605 */
9606 public static final String EMERGENCY_AFFORDANCE_NEEDED = "emergency_affordance_needed";
9607
9608 /**
Sungmin Choie099ab12014-06-09 14:45:51 +09009609 * See RIL_PreferredNetworkType in ril.h
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07009610 * @hide
9611 */
9612 public static final String PREFERRED_NETWORK_MODE =
9613 "preferred_network_mode";
9614
9615 /**
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07009616 * Name of an application package to be debugged.
9617 */
9618 public static final String DEBUG_APP = "debug_app";
9619
9620 /**
9621 * If 1, when launching DEBUG_APP it will wait for the debugger before
9622 * starting user code. If 0, it will run normally.
9623 */
9624 public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger";
9625
9626 /**
9627 * Control whether the process CPU usage meter should be shown.
Nick Kralevichfc4a5c22016-10-11 09:01:38 -07009628 *
9629 * @deprecated This functionality is no longer available as of
9630 * {@link android.os.Build.VERSION_CODES#N_MR1}.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07009631 */
Nick Kralevichfc4a5c22016-10-11 09:01:38 -07009632 @Deprecated
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07009633 public static final String SHOW_PROCESSES = "show_processes";
9634
9635 /**
Ruchi Kandoi62b8a492014-04-17 18:01:40 -07009636 * If 1 low power mode is enabled.
9637 * @hide
9638 */
9639 public static final String LOW_POWER_MODE = "low_power";
9640
John Spurlockf8f524c2014-06-10 14:47:29 -04009641 /**
9642 * Battery level [1-99] at which low power mode automatically turns on.
Dianne Hackborn14272302014-06-10 23:13:02 -07009643 * If 0, it will not automatically turn on.
John Spurlockf8f524c2014-06-10 14:47:29 -04009644 * @hide
9645 */
9646 public static final String LOW_POWER_MODE_TRIGGER_LEVEL = "low_power_trigger_level";
9647
Ruchi Kandoi62b8a492014-04-17 18:01:40 -07009648 /**
Dianne Hackbornb2117d12016-02-16 18:26:35 -08009649 * If not 0, the activity manager will aggressively finish activities and
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07009650 * processes as soon as they are no longer needed. If 0, the normal
9651 * extended lifetime is used.
9652 */
Dianne Hackborn89ad4562014-08-24 16:45:38 -07009653 public static final String ALWAYS_FINISH_ACTIVITIES = "always_finish_activities";
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07009654
Christopher Tate66488d62012-10-02 11:58:01 -07009655 /**
Eric Laurent7ee1e4f2012-10-26 18:11:21 -07009656 * Use Dock audio output for media:
9657 * 0 = disabled
9658 * 1 = enabled
9659 * @hide
9660 */
9661 public static final String DOCK_AUDIO_MEDIA_ENABLED = "dock_audio_media_enabled";
9662
9663 /**
Phil Burkdeaa8d92016-02-23 17:12:04 -08009664 * The surround sound formats AC3, DTS or IEC61937 are
9665 * available for use if they are detected.
9666 * This is the default mode.
9667 *
9668 * Note that AUTO is equivalent to ALWAYS for Android TVs and other
9669 * devices that have an S/PDIF output. This is because S/PDIF
9670 * is unidirectional and the TV cannot know if a decoder is
9671 * connected. So it assumes they are always available.
9672 * @hide
9673 */
9674 public static final int ENCODED_SURROUND_OUTPUT_AUTO = 0;
9675
9676 /**
9677 * AC3, DTS or IEC61937 are NEVER available, even if they
9678 * are detected by the hardware. Those formats will not be
9679 * reported.
9680 *
9681 * An example use case would be an AVR reports that it is capable of
9682 * surround sound decoding but is broken. If NEVER is chosen
9683 * then apps must use PCM output instead of encoded output.
9684 * @hide
9685 */
9686 public static final int ENCODED_SURROUND_OUTPUT_NEVER = 1;
9687
9688 /**
9689 * AC3, DTS or IEC61937 are ALWAYS available, even if they
9690 * are not detected by the hardware. Those formats will be
9691 * reported as part of the HDMI output capability. Applications
9692 * are then free to use either PCM or encoded output.
9693 *
9694 * An example use case would be a when TV was connected over
9695 * TOS-link to an AVR. But the TV could not see it because TOS-link
9696 * is unidirectional.
9697 * @hide
9698 */
9699 public static final int ENCODED_SURROUND_OUTPUT_ALWAYS = 2;
9700
9701 /**
9702 * Set to ENCODED_SURROUND_OUTPUT_AUTO,
9703 * ENCODED_SURROUND_OUTPUT_NEVER or
9704 * ENCODED_SURROUND_OUTPUT_ALWAYS
9705 * @hide
9706 */
9707 public static final String ENCODED_SURROUND_OUTPUT = "encoded_surround_output";
9708
9709 /**
Eric Laurent05274f32012-11-29 12:48:18 -08009710 * Persisted safe headphone volume management state by AudioService
9711 * @hide
9712 */
9713 public static final String AUDIO_SAFE_VOLUME_STATE = "audio_safe_volume_state";
9714
9715 /**
Geremy Condraa0735112013-03-26 21:49:26 -07009716 * URL for tzinfo (time zone) updates
9717 * @hide
9718 */
9719 public static final String TZINFO_UPDATE_CONTENT_URL = "tzinfo_content_url";
9720
9721 /**
9722 * URL for tzinfo (time zone) update metadata
9723 * @hide
9724 */
9725 public static final String TZINFO_UPDATE_METADATA_URL = "tzinfo_metadata_url";
9726
9727 /**
9728 * URL for selinux (mandatory access control) updates
9729 * @hide
9730 */
9731 public static final String SELINUX_UPDATE_CONTENT_URL = "selinux_content_url";
9732
9733 /**
9734 * URL for selinux (mandatory access control) update metadata
9735 * @hide
9736 */
9737 public static final String SELINUX_UPDATE_METADATA_URL = "selinux_metadata_url";
9738
9739 /**
9740 * URL for sms short code updates
9741 * @hide
9742 */
9743 public static final String SMS_SHORT_CODES_UPDATE_CONTENT_URL =
9744 "sms_short_codes_content_url";
9745
9746 /**
9747 * URL for sms short code update metadata
9748 * @hide
9749 */
9750 public static final String SMS_SHORT_CODES_UPDATE_METADATA_URL =
9751 "sms_short_codes_metadata_url";
9752
9753 /**
Amit Mahajan9069fab2015-05-01 11:05:47 -07009754 * URL for apn_db updates
9755 * @hide
9756 */
9757 public static final String APN_DB_UPDATE_CONTENT_URL = "apn_db_content_url";
9758
9759 /**
9760 * URL for apn_db update metadata
9761 * @hide
9762 */
9763 public static final String APN_DB_UPDATE_METADATA_URL = "apn_db_metadata_url";
9764
9765 /**
Geremy Condraa0735112013-03-26 21:49:26 -07009766 * URL for cert pinlist updates
9767 * @hide
9768 */
9769 public static final String CERT_PIN_UPDATE_CONTENT_URL = "cert_pin_content_url";
9770
9771 /**
9772 * URL for cert pinlist updates
9773 * @hide
9774 */
9775 public static final String CERT_PIN_UPDATE_METADATA_URL = "cert_pin_metadata_url";
9776
Geremy Condra757ee522013-03-29 16:39:45 -07009777 /**
Ben Gruver633dc9b2013-04-04 12:05:49 -07009778 * URL for intent firewall updates
9779 * @hide
9780 */
9781 public static final String INTENT_FIREWALL_UPDATE_CONTENT_URL =
9782 "intent_firewall_content_url";
9783
9784 /**
9785 * URL for intent firewall update metadata
9786 * @hide
9787 */
9788 public static final String INTENT_FIREWALL_UPDATE_METADATA_URL =
9789 "intent_firewall_metadata_url";
9790
9791 /**
Abodunrinwa Toki51c42032017-04-02 19:16:01 +01009792 * URL for lang id model updates
9793 * @hide
9794 */
9795 public static final String LANG_ID_UPDATE_CONTENT_URL = "lang_id_content_url";
9796
9797 /**
9798 * URL for lang id model update metadata
9799 * @hide
9800 */
9801 public static final String LANG_ID_UPDATE_METADATA_URL = "lang_id_metadata_url";
9802
9803 /**
Abodunrinwa Tokibb957d12017-04-12 14:40:46 +01009804 * URL for smart selection model updates
9805 * @hide
9806 */
9807 public static final String SMART_SELECTION_UPDATE_CONTENT_URL =
9808 "smart_selection_content_url";
9809
9810 /**
9811 * URL for smart selection model update metadata
9812 * @hide
9813 */
9814 public static final String SMART_SELECTION_UPDATE_METADATA_URL =
9815 "smart_selection_metadata_url";
9816
9817 /**
Geremy Condra4e7f7e82013-03-26 21:09:01 -07009818 * SELinux enforcement status. If 0, permissive; if 1, enforcing.
9819 * @hide
9820 */
9821 public static final String SELINUX_STATUS = "selinux_status";
9822
Geremy Condraa0735112013-03-26 21:49:26 -07009823 /**
Amith Yamasanid8415f42013-08-07 20:15:10 -07009824 * Developer setting to force RTL layout.
9825 * @hide
9826 */
9827 public static final String DEVELOPMENT_FORCE_RTL = "debug.force_rtl";
9828
9829 /**
Daniel Sandlerdea64622013-09-23 16:05:57 -04009830 * Milliseconds after screen-off after which low battery sounds will be silenced.
9831 *
9832 * If zero, battery sounds will always play.
9833 * Defaults to @integer/def_low_battery_sound_timeout in SettingsProvider.
9834 *
9835 * @hide
9836 */
9837 public static final String LOW_BATTERY_SOUND_TIMEOUT = "low_battery_sound_timeout";
9838
9839 /**
Evan Charltoncc7b0432014-01-14 14:47:11 -08009840 * Milliseconds to wait before bouncing Wi-Fi after settings is restored. Note that after
Dianne Hackborna3fb40d2014-08-12 15:06:50 -07009841 * the caller is done with this, they should call {@link ContentResolver#delete} to
Evan Charltoncc7b0432014-01-14 14:47:11 -08009842 * clean up any value that they may have written.
9843 *
9844 * @hide
9845 */
9846 public static final String WIFI_BOUNCE_DELAY_OVERRIDE_MS = "wifi_bounce_delay_override_ms";
9847
John Spurlockc6d1c602014-01-17 15:22:06 -05009848 /**
9849 * Defines global runtime overrides to window policy.
9850 *
Jorim Jaggib10e33f2015-02-04 21:57:40 +01009851 * See {@link com.android.server.policy.PolicyControl} for value format.
John Spurlockc6d1c602014-01-17 15:22:06 -05009852 *
9853 * @hide
9854 */
9855 public static final String POLICY_CONTROL = "policy_control";
Evan Charltoncc7b0432014-01-14 14:47:11 -08009856
9857 /**
John Spurlockae641c92014-06-30 18:11:40 -04009858 * Defines global zen mode. ZEN_MODE_OFF, ZEN_MODE_IMPORTANT_INTERRUPTIONS,
9859 * or ZEN_MODE_NO_INTERRUPTIONS.
John Spurlocke677d712014-02-13 12:52:19 -05009860 *
9861 * @hide
9862 */
9863 public static final String ZEN_MODE = "zen_mode";
9864
9865 /** @hide */ public static final int ZEN_MODE_OFF = 0;
John Spurlockae641c92014-06-30 18:11:40 -04009866 /** @hide */ public static final int ZEN_MODE_IMPORTANT_INTERRUPTIONS = 1;
9867 /** @hide */ public static final int ZEN_MODE_NO_INTERRUPTIONS = 2;
John Spurlock4f1163c2015-04-02 17:41:21 -04009868 /** @hide */ public static final int ZEN_MODE_ALARMS = 3;
John Spurlocke677d712014-02-13 12:52:19 -05009869
9870 /** @hide */ public static String zenModeToString(int mode) {
John Spurlockae641c92014-06-30 18:11:40 -04009871 if (mode == ZEN_MODE_IMPORTANT_INTERRUPTIONS) return "ZEN_MODE_IMPORTANT_INTERRUPTIONS";
John Spurlock4f1163c2015-04-02 17:41:21 -04009872 if (mode == ZEN_MODE_ALARMS) return "ZEN_MODE_ALARMS";
John Spurlockae641c92014-06-30 18:11:40 -04009873 if (mode == ZEN_MODE_NO_INTERRUPTIONS) return "ZEN_MODE_NO_INTERRUPTIONS";
9874 return "ZEN_MODE_OFF";
John Spurlocke677d712014-02-13 12:52:19 -05009875 }
9876
John Spurlockb2278d62015-04-07 12:47:12 -04009877 /** @hide */ public static boolean isValidZenMode(int value) {
9878 switch (value) {
9879 case Global.ZEN_MODE_OFF:
9880 case Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS:
9881 case Global.ZEN_MODE_ALARMS:
9882 case Global.ZEN_MODE_NO_INTERRUPTIONS:
9883 return true;
9884 default:
9885 return false;
9886 }
9887 }
9888
John Spurlocke677d712014-02-13 12:52:19 -05009889 /**
Julia Reynolds9b11fdb2015-07-31 09:49:55 -04009890 * Value of the ringer before entering zen mode.
9891 *
9892 * @hide
9893 */
9894 public static final String ZEN_MODE_RINGER_LEVEL = "zen_mode_ringer_level";
9895
9896 /**
John Spurlock056c5192014-04-20 21:52:01 -04009897 * Opaque value, changes when persisted zen mode configuration changes.
9898 *
9899 * @hide
9900 */
9901 public static final String ZEN_MODE_CONFIG_ETAG = "zen_mode_config_etag";
9902
9903 /**
Chris Wren7bd241232014-02-28 16:25:05 -05009904 * Defines global heads up toggle. One of HEADS_UP_OFF, HEADS_UP_ON.
9905 *
9906 * @hide
9907 */
Chris Wren10d82df2014-03-01 10:34:51 -05009908 public static final String HEADS_UP_NOTIFICATIONS_ENABLED =
9909 "heads_up_notifications_enabled";
Chris Wren7bd241232014-02-28 16:25:05 -05009910
9911 /** @hide */ public static final int HEADS_UP_OFF = 0;
9912 /** @hide */ public static final int HEADS_UP_ON = 1;
9913
9914 /**
Jerome Poichet147b4d72014-05-12 18:13:27 -07009915 * The name of the device
Jerome Poichet147b4d72014-05-12 18:13:27 -07009916 */
9917 public static final String DEVICE_NAME = "device_name";
9918
9919 /**
Jeff Davidson56f9f732014-08-14 16:47:23 -07009920 * Whether the NetworkScoringService has been first initialized.
9921 * <p>
9922 * Type: int (0 for false, 1 for true)
9923 * @hide
9924 */
9925 public static final String NETWORK_SCORING_PROVISIONED = "network_scoring_provisioned";
9926
9927 /**
Jim Miller6848dc82014-10-13 18:51:53 -07009928 * Whether the user wants to be prompted for password to decrypt the device on boot.
9929 * This only matters if the storage is encrypted.
9930 * <p>
9931 * Type: int (0 for false, 1 for true)
9932 * @hide
9933 */
9934 public static final String REQUIRE_PASSWORD_TO_DECRYPT = "require_password_to_decrypt";
9935
9936 /**
Etan Cohen93bbf272015-05-04 18:01:47 -07009937 * Whether the Volte is enabled
Libin.Tang@motorola.com0499bb52014-10-10 14:55:57 -05009938 * <p>
9939 * Type: int (0 for false, 1 for true)
9940 * @hide
9941 */
Etan Cohene41a9cf2014-10-22 10:50:46 -07009942 public static final String ENHANCED_4G_MODE_ENABLED = "volte_vt_enabled";
Libin.Tang@motorola.com0499bb52014-10-10 14:55:57 -05009943
9944 /**
Etan Cohen93bbf272015-05-04 18:01:47 -07009945 * Whether VT (Video Telephony over IMS) is enabled
9946 * <p>
9947 * Type: int (0 for false, 1 for true)
9948 *
9949 * @hide
9950 */
9951 public static final String VT_IMS_ENABLED = "vt_ims_enabled";
9952
9953 /**
Etan Cohen9c8f21b2014-12-23 15:02:19 -08009954 * Whether WFC is enabled
9955 * <p>
9956 * Type: int (0 for false, 1 for true)
9957 *
9958 * @hide
9959 */
9960 public static final String WFC_IMS_ENABLED = "wfc_ims_enabled";
9961
9962 /**
Meng Wang2c25e4a2016-09-19 14:18:05 -07009963 * WFC mode on home/non-roaming network.
Etan Cohen9c8f21b2014-12-23 15:02:19 -08009964 * <p>
9965 * Type: int - 2=Wi-Fi preferred, 1=Cellular preferred, 0=Wi-Fi only
9966 *
9967 * @hide
9968 */
9969 public static final String WFC_IMS_MODE = "wfc_ims_mode";
9970
9971 /**
Meng Wang2c25e4a2016-09-19 14:18:05 -07009972 * WFC mode on roaming network.
9973 * <p>
Dianne Hackborn0ef403e2017-01-24 18:22:15 -08009974 * Type: int - see {@link #WFC_IMS_MODE} for values
Meng Wang2c25e4a2016-09-19 14:18:05 -07009975 *
9976 * @hide
9977 */
9978 public static final String WFC_IMS_ROAMING_MODE = "wfc_ims_roaming_mode";
9979
9980 /**
Etan Cohen9c8f21b2014-12-23 15:02:19 -08009981 * Whether WFC roaming is enabled
9982 * <p>
9983 * Type: int (0 for false, 1 for true)
9984 *
9985 * @hide
9986 */
9987 public static final String WFC_IMS_ROAMING_ENABLED = "wfc_ims_roaming_enabled";
9988
9989 /**
Amit Mahajan4fea0922014-11-18 12:56:28 -08009990 * Whether user can enable/disable LTE as a preferred network. A carrier might control
9991 * this via gservices, OMA-DM, carrier app, etc.
9992 * <p>
9993 * Type: int (0 for false, 1 for true)
9994 * @hide
9995 */
9996 public static final String LTE_SERVICE_FORCED = "lte_service_forced";
9997
9998 /**
Svet Ganov2acf0632015-11-24 19:10:59 -08009999 * Ephemeral app cookie max size in bytes.
10000 * <p>
10001 * Type: int
10002 * @hide
10003 */
10004 public static final String EPHEMERAL_COOKIE_MAX_SIZE_BYTES =
10005 "ephemeral_cookie_max_size_bytes";
10006
10007 /**
Todd Kennedyd15bb752016-09-13 16:38:31 -070010008 * Toggle to enable/disable the entire ephemeral feature. By default, ephemeral is
10009 * enabled. Set to zero to disable.
10010 * <p>
10011 * Type: int (0 for false, 1 for true)
10012 *
10013 * @hide
10014 */
10015 public static final String ENABLE_EPHEMERAL_FEATURE = "enable_ephemeral_feature";
10016
10017 /**
Todd Kennedy133c5da2017-06-15 09:44:34 -070010018 * Toggle to enable/disable dexopt for instant applications. The default is for dexopt
10019 * to be disabled.
10020 * <p>
10021 * Type: int (0 to disable, 1 to enable)
10022 *
10023 * @hide
10024 */
10025 public static final String INSTANT_APP_DEXOPT_ENABLED = "instant_app_dexopt_enabled";
10026
10027 /**
Svet Ganovf36d53c2017-05-24 00:27:21 -070010028 * The min period for caching installed instant apps in milliseconds.
Svet Ganov2acf0632015-11-24 19:10:59 -080010029 * <p>
10030 * Type: long
10031 * @hide
10032 */
Svet Ganovf36d53c2017-05-24 00:27:21 -070010033 public static final String INSTALLED_INSTANT_APP_MIN_CACHE_PERIOD =
10034 "installed_instant_app_min_cache_period";
10035
10036 /**
10037 * The max period for caching installed instant apps in milliseconds.
10038 * <p>
10039 * Type: long
10040 * @hide
10041 */
10042 public static final String INSTALLED_INSTANT_APP_MAX_CACHE_PERIOD =
10043 "installed_instant_app_max_cache_period";
10044
10045 /**
10046 * The min period for caching uninstalled instant apps in milliseconds.
10047 * <p>
10048 * Type: long
10049 * @hide
10050 */
10051 public static final String UNINSTALLED_INSTANT_APP_MIN_CACHE_PERIOD =
10052 "uninstalled_instant_app_min_cache_period";
10053
10054 /**
10055 * The max period for caching uninstalled instant apps in milliseconds.
10056 * <p>
10057 * Type: long
10058 * @hide
10059 */
10060 public static final String UNINSTALLED_INSTANT_APP_MAX_CACHE_PERIOD =
10061 "uninstalled_instant_app_max_cache_period";
10062
10063 /**
10064 * The min period for caching unused static shared libs in milliseconds.
10065 * <p>
10066 * Type: long
10067 * @hide
10068 */
10069 public static final String UNUSED_STATIC_SHARED_LIB_MIN_CACHE_PERIOD =
10070 "unused_static_shared_lib_min_cache_period";
Svet Ganov2acf0632015-11-24 19:10:59 -080010071
10072 /**
Fyodor Kupolov07140f72016-02-17 10:46:11 -080010073 * Allows switching users when system user is locked.
10074 * <p>
10075 * Type: int
10076 * @hide
10077 */
10078 public static final String ALLOW_USER_SWITCHING_WHEN_SYSTEM_USER_LOCKED =
10079 "allow_user_switching_when_system_user_locked";
10080
10081 /**
Daichi Hirono82ab9802016-03-02 13:23:29 +090010082 * Boot count since the device starts running APK level 24.
10083 * <p>
10084 * Type: int
10085 */
10086 public static final String BOOT_COUNT = "boot_count";
10087
10088 /**
Lenka Trochtova6474f0e2016-03-24 16:43:10 +010010089 * Whether the safe boot is disallowed.
10090 *
10091 * <p>This setting should have the identical value as the corresponding user restriction.
10092 * The purpose of the setting is to make the restriction available in early boot stages
10093 * before the user restrictions are loaded.
10094 * @hide
10095 */
10096 public static final String SAFE_BOOT_DISALLOWED = "safe_boot_disallowed";
10097
10098 /**
Amith Yamasanieb437d42016-04-29 09:31:25 -070010099 * Whether this device is currently in retail demo mode. If true, device
10100 * usage is severely limited.
10101 * <p>
10102 * Type: int (0 for false, 1 for true)
10103 * @hide
10104 */
10105 public static final String DEVICE_DEMO_MODE = "device_demo_mode";
10106
10107 /**
Sudheer Shanka5918c672017-03-21 19:31:37 -070010108 * Indicates the maximum time that an app is blocked for the network rules to get updated.
10109 *
10110 * Type: long
10111 *
10112 * @hide
10113 */
10114 public static final String NETWORK_ACCESS_TIMEOUT_MS = "network_access_timeout_ms";
10115
10116 /**
Svetoslav Ganov264c7a92016-08-24 17:31:14 -070010117 * The reason for the settings database being downgraded. This is only for
10118 * troubleshooting purposes and its value should not be interpreted in any way.
10119 *
10120 * Type: string
10121 *
10122 * @hide
10123 */
10124 public static final String DATABASE_DOWNGRADE_REASON = "database_downgrade_reason";
10125
10126 /**
Amith Yamasani39452022017-03-21 15:23:47 -070010127 * The build id of when the settings database was first created (or re-created due it
10128 * being missing).
10129 *
10130 * Type: string
10131 *
10132 * @hide
10133 */
10134 public static final String DATABASE_CREATION_BUILDID = "database_creation_buildid";
10135
10136 /**
Suprabh Shukla502fd882016-09-30 15:06:00 -070010137 * Flag to toggle journal mode WAL on or off for the contacts database. WAL is enabled by
10138 * default. Set to 0 to disable.
10139 *
10140 * @hide
10141 */
10142 public static final String CONTACTS_DATABASE_WAL_ENABLED = "contacts_database_wal_enabled";
10143
10144 /**
songchenxi825f69a2017-01-19 14:18:41 -080010145 * Flag to enable the link to location permissions in location setting. Set to 0 to disable.
10146 *
10147 * @hide
10148 */
10149 public static final String LOCATION_SETTINGS_LINK_TO_PERMISSIONS_ENABLED =
10150 "location_settings_link_to_permissions_enabled";
10151
10152 /**
Artem Iglikov50219182017-04-05 15:27:54 +010010153 * Flag to enable use of RefactoredBackupManagerService.
10154 *
10155 * @hide
10156 */
10157 public static final String BACKUP_REFACTORED_SERVICE_DISABLED =
10158 "backup_refactored_service_disabled";
10159
10160 /**
qingxi0ca328f2017-05-19 15:20:03 -070010161 * Flag to set the waiting time for euicc factory reset inside System > Settings
10162 * Type: long
10163 *
10164 * @hide
10165 */
qingxi2f231512017-06-23 15:32:53 -070010166 public static final String EUICC_FACTORY_RESET_TIMEOUT_MILLIS =
10167 "euicc_factory_reset_timeout_millis";
qingxi0ca328f2017-05-19 15:20:03 -070010168
10169 /**
Christopher Tate66488d62012-10-02 11:58:01 -070010170 * Settings to backup. This is here so that it's in the same place as the settings
10171 * keys and easy to update.
10172 *
10173 * These keys may be mentioned in the SETTINGS_TO_BACKUP arrays in System
10174 * and Secure as well. This is because those tables drive both backup and
10175 * restore, and restore needs to properly whitelist keys that used to live
10176 * in those namespaces. The keys will only actually be backed up / restored
10177 * if they are also mentioned in this table (Global.SETTINGS_TO_BACKUP).
10178 *
10179 * NOTE: Settings are backed up and restored in the order they appear
10180 * in this array. If you have one setting depending on another,
10181 * make sure that they are ordered appropriately.
10182 *
10183 * @hide
10184 */
10185 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate58f41ec2013-01-11 15:40:36 -080010186 BUGREPORT_IN_POWER_MENU,
Christopher Tate66488d62012-10-02 11:58:01 -070010187 STAY_ON_WHILE_PLUGGED_IN,
Christopher Tate66488d62012-10-02 11:58:01 -070010188 AUTO_TIME,
10189 AUTO_TIME_ZONE,
10190 POWER_SOUNDS_ENABLED,
10191 DOCK_SOUNDS_ENABLED,
Ritesh Reddyf8f12132015-11-20 16:43:28 +000010192 CHARGING_SOUNDS_ENABLED,
Christopher Tate66488d62012-10-02 11:58:01 -070010193 USB_MASS_STORAGE_ENABLED,
Stephen Chen42f5f292017-01-20 11:24:08 -080010194 NETWORK_RECOMMENDATIONS_ENABLED,
Stephen Chen42f5f292017-01-20 11:24:08 -080010195 WIFI_WAKEUP_ENABLED,
Christopher Tate66488d62012-10-02 11:58:01 -070010196 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
Amin Shaikhbc9a8e62017-02-02 15:39:12 -080010197 USE_OPEN_WIFI_PACKAGE,
Christopher Tate16eb7cd2012-10-09 15:26:30 -070010198 WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED,
Christopher Tate66488d62012-10-02 11:58:01 -070010199 EMERGENCY_TONE,
10200 CALL_AUTO_RETRY,
Amith Yamasani94005242014-10-31 11:35:13 -070010201 DOCK_AUDIO_MEDIA_ENABLED,
Phil Burkdeaa8d92016-02-23 17:12:04 -080010202 ENCODED_SURROUND_OUTPUT,
Stanley Tng767f05f2017-05-01 21:27:31 -070010203 LOW_POWER_MODE_TRIGGER_LEVEL,
10204 BLUETOOTH_ON
Christopher Tate66488d62012-10-02 11:58:01 -070010205 };
10206
Christopher Tate1d0fca32017-06-06 13:30:00 -070010207 /** @hide */
10208 public static final String[] LEGACY_RESTORE_SETTINGS = {
10209 };
10210
Svetoslav Ganove080da92016-12-21 17:10:35 -080010211 private static final ContentProviderHolder sProviderHolder =
10212 new ContentProviderHolder(CONTENT_URI);
10213
Christopher Tate06efb532012-08-24 15:29:27 -070010214 // Populated lazily, guarded by class object:
Svetoslav Ganove080da92016-12-21 17:10:35 -080010215 private static final NameValueCache sNameValueCache = new NameValueCache(
Dianne Hackborn139748f2012-09-24 11:36:57 -070010216 CONTENT_URI,
10217 CALL_METHOD_GET_GLOBAL,
Svetoslav Ganove080da92016-12-21 17:10:35 -080010218 CALL_METHOD_PUT_GLOBAL,
10219 sProviderHolder);
Christopher Tate06efb532012-08-24 15:29:27 -070010220
Christopher Tateaa036a22014-05-19 16:33:27 -070010221 // Certain settings have been moved from global to the per-user secure namespace
10222 private static final HashSet<String> MOVED_TO_SECURE;
10223 static {
Steve McKayea93fe72016-12-02 11:35:35 -080010224 MOVED_TO_SECURE = new HashSet<>(1);
Christopher Tateaa036a22014-05-19 16:33:27 -070010225 MOVED_TO_SECURE.add(Settings.Global.INSTALL_NON_MARKET_APPS);
10226 }
10227
Svetoslav683914b2015-01-15 14:22:26 -080010228 /** @hide */
10229 public static void getMovedToSecureSettings(Set<String> outKeySet) {
10230 outKeySet.addAll(MOVED_TO_SECURE);
10231 }
10232
Sudheer Shankaaa3c30d2017-05-23 15:19:10 -070010233 /** @hide */
10234 public static void clearProviderForTest() {
10235 sProviderHolder.clearProviderForTest();
10236 sNameValueCache.clearGenerationTrackerForTest();
10237 }
10238
Christopher Tate06efb532012-08-24 15:29:27 -070010239 /**
10240 * Look up a name in the database.
10241 * @param resolver to access the database with
10242 * @param name to look up in the table
10243 * @return the corresponding value, or null if not present
10244 */
Dianne Hackborn139748f2012-09-24 11:36:57 -070010245 public static String getString(ContentResolver resolver, String name) {
Christopher Tate06efb532012-08-24 15:29:27 -070010246 return getStringForUser(resolver, name, UserHandle.myUserId());
10247 }
10248
10249 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -070010250 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -070010251 int userHandle) {
Christopher Tateaa036a22014-05-19 16:33:27 -070010252 if (MOVED_TO_SECURE.contains(name)) {
10253 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
10254 + " to android.provider.Settings.Secure, returning read-only value.");
10255 return Secure.getStringForUser(resolver, name, userHandle);
10256 }
Christopher Tate06efb532012-08-24 15:29:27 -070010257 return sNameValueCache.getStringForUser(resolver, name, userHandle);
10258 }
10259
10260 /**
10261 * Store a name/value pair into the database.
10262 * @param resolver to access the database with
10263 * @param name to store
10264 * @param value to associate with the name
10265 * @return true if the value was set, false on database errors
10266 */
10267 public static boolean putString(ContentResolver resolver,
10268 String name, String value) {
Svetoslav Ganove080da92016-12-21 17:10:35 -080010269 return putStringForUser(resolver, name, value, null, false, UserHandle.myUserId());
10270 }
10271
10272 /**
10273 * Store a name/value pair into the database.
10274 * <p>
10275 * The method takes an optional tag to associate with the setting
10276 * which can be used to clear only settings made by your package and
10277 * associated with this tag by passing the tag to {@link
10278 * #resetToDefaults(ContentResolver, String)}. Anyone can override
10279 * the current tag. Also if another package changes the setting
10280 * then the tag will be set to the one specified in the set call
10281 * which can be null. Also any of the settings setters that do not
10282 * take a tag as an argument effectively clears the tag.
10283 * </p><p>
10284 * For example, if you set settings A and B with tags T1 and T2 and
10285 * another app changes setting A (potentially to the same value), it
10286 * can assign to it a tag T3 (note that now the package that changed
10287 * the setting is not yours). Now if you reset your changes for T1 and
10288 * T2 only setting B will be reset and A not (as it was changed by
10289 * another package) but since A did not change you are in the desired
10290 * initial state. Now if the other app changes the value of A (assuming
10291 * you registered an observer in the beginning) you would detect that
10292 * the setting was changed by another app and handle this appropriately
10293 * (ignore, set back to some value, etc).
10294 * </p><p>
10295 * Also the method takes an argument whether to make the value the
10296 * default for this setting. If the system already specified a default
10297 * value, then the one passed in here will <strong>not</strong>
10298 * be set as the default.
10299 * </p>
10300 *
10301 * @param resolver to access the database with.
10302 * @param name to store.
10303 * @param value to associate with the name.
10304 * @param tag to associated with the setting.
10305 * @param makeDefault whether to make the value the default one.
10306 * @return true if the value was set, false on database errors.
10307 *
10308 * @see #resetToDefaults(ContentResolver, String)
10309 *
10310 * @hide
10311 */
10312 @SystemApi
10313 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
10314 public static boolean putString(@NonNull ContentResolver resolver,
10315 @NonNull String name, @Nullable String value, @Nullable String tag,
10316 boolean makeDefault) {
10317 return putStringForUser(resolver, name, value, tag, makeDefault,
10318 UserHandle.myUserId());
10319 }
10320
10321 /**
10322 * Reset the settings to their defaults. This would reset <strong>only</strong>
10323 * settings set by the caller's package. Think of it of a way to undo your own
10324 * changes to the secure settings. Passing in the optional tag will reset only
10325 * settings changed by your package and associated with this tag.
10326 *
10327 * @param resolver Handle to the content resolver.
10328 * @param tag Optional tag which should be associated with the settings to reset.
10329 *
10330 * @see #putString(ContentResolver, String, String, String, boolean)
10331 *
10332 * @hide
10333 */
10334 @SystemApi
10335 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
10336 public static void resetToDefaults(@NonNull ContentResolver resolver,
10337 @Nullable String tag) {
10338 resetToDefaultsAsUser(resolver, tag, RESET_MODE_PACKAGE_DEFAULTS,
10339 UserHandle.myUserId());
10340 }
10341
10342 /**
10343 * Reset the settings to their defaults for a given user with a specific mode. The
10344 * optional tag argument is valid only for {@link #RESET_MODE_PACKAGE_DEFAULTS}
10345 * allowing resetting the settings made by a package and associated with the tag.
10346 *
10347 * @param resolver Handle to the content resolver.
10348 * @param tag Optional tag which should be associated with the settings to reset.
10349 * @param mode The reset mode.
10350 * @param userHandle The user for which to reset to defaults.
10351 *
10352 * @see #RESET_MODE_PACKAGE_DEFAULTS
10353 * @see #RESET_MODE_UNTRUSTED_DEFAULTS
10354 * @see #RESET_MODE_UNTRUSTED_CHANGES
10355 * @see #RESET_MODE_TRUSTED_DEFAULTS
10356 *
10357 * @hide
10358 */
10359 public static void resetToDefaultsAsUser(@NonNull ContentResolver resolver,
10360 @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle) {
10361 try {
10362 Bundle arg = new Bundle();
10363 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
10364 if (tag != null) {
10365 arg.putString(CALL_METHOD_TAG_KEY, tag);
10366 }
10367 arg.putInt(CALL_METHOD_RESET_MODE_KEY, mode);
10368 IContentProvider cp = sProviderHolder.getProvider(resolver);
10369 cp.call(resolver.getPackageName(), CALL_METHOD_RESET_GLOBAL, null, arg);
10370 } catch (RemoteException e) {
10371 Log.w(TAG, "Can't reset do defaults for " + CONTENT_URI, e);
10372 }
Christopher Tate06efb532012-08-24 15:29:27 -070010373 }
10374
10375 /** @hide */
10376 public static boolean putStringForUser(ContentResolver resolver,
10377 String name, String value, int userHandle) {
Svetoslav Ganove080da92016-12-21 17:10:35 -080010378 return putStringForUser(resolver, name, value, null, false, userHandle);
10379 }
10380
10381 /** @hide */
10382 public static boolean putStringForUser(@NonNull ContentResolver resolver,
10383 @NonNull String name, @Nullable String value, @Nullable String tag,
10384 boolean makeDefault, @UserIdInt int userHandle) {
Christopher Tate06efb532012-08-24 15:29:27 -070010385 if (LOCAL_LOGV) {
10386 Log.v(TAG, "Global.putString(name=" + name + ", value=" + value
10387 + " for " + userHandle);
10388 }
Christopher Tateaa036a22014-05-19 16:33:27 -070010389 // Global and Secure have the same access policy so we can forward writes
10390 if (MOVED_TO_SECURE.contains(name)) {
10391 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
10392 + " to android.provider.Settings.Secure, value is unchanged.");
Svetoslav Ganove080da92016-12-21 17:10:35 -080010393 return Secure.putStringForUser(resolver, name, value, tag,
10394 makeDefault, userHandle);
Christopher Tateaa036a22014-05-19 16:33:27 -070010395 }
Svetoslav Ganove080da92016-12-21 17:10:35 -080010396 return sNameValueCache.putStringForUser(resolver, name, value, tag,
10397 makeDefault, userHandle);
Christopher Tate06efb532012-08-24 15:29:27 -070010398 }
10399
10400 /**
10401 * Construct the content URI for a particular name/value pair,
10402 * useful for monitoring changes with a ContentObserver.
10403 * @param name to look up in the table
10404 * @return the corresponding content URI, or null if not present
10405 */
10406 public static Uri getUriFor(String name) {
10407 return getUriFor(CONTENT_URI, name);
10408 }
10409
10410 /**
10411 * Convenience function for retrieving a single secure settings value
10412 * as an integer. Note that internally setting values are always
10413 * stored as strings; this function converts the string to an integer
10414 * for you. The default value will be returned if the setting is
10415 * not defined or not an integer.
10416 *
10417 * @param cr The ContentResolver to access.
10418 * @param name The name of the setting to retrieve.
10419 * @param def Value to return if the setting is not defined.
10420 *
10421 * @return The setting's current value, or 'def' if it is not defined
10422 * or not a valid integer.
10423 */
10424 public static int getInt(ContentResolver cr, String name, int def) {
10425 String v = getString(cr, name);
10426 try {
10427 return v != null ? Integer.parseInt(v) : def;
10428 } catch (NumberFormatException e) {
10429 return def;
10430 }
10431 }
10432
10433 /**
10434 * Convenience function for retrieving a single secure settings value
10435 * as an integer. Note that internally setting values are always
10436 * stored as strings; this function converts the string to an integer
10437 * for you.
10438 * <p>
10439 * This version does not take a default value. If the setting has not
10440 * been set, or the string value is not a number,
10441 * it throws {@link SettingNotFoundException}.
10442 *
10443 * @param cr The ContentResolver to access.
10444 * @param name The name of the setting to retrieve.
10445 *
10446 * @throws SettingNotFoundException Thrown if a setting by the given
10447 * name can't be found or the setting value is not an integer.
10448 *
10449 * @return The setting's current value.
10450 */
10451 public static int getInt(ContentResolver cr, String name)
10452 throws SettingNotFoundException {
10453 String v = getString(cr, name);
10454 try {
10455 return Integer.parseInt(v);
10456 } catch (NumberFormatException e) {
10457 throw new SettingNotFoundException(name);
10458 }
10459 }
10460
10461 /**
10462 * Convenience function for updating a single settings value as an
10463 * integer. This will either create a new entry in the table if the
10464 * given name does not exist, or modify the value of the existing row
10465 * with that name. Note that internally setting values are always
10466 * stored as strings, so this function converts the given value to a
10467 * string before storing it.
10468 *
10469 * @param cr The ContentResolver to access.
10470 * @param name The name of the setting to modify.
10471 * @param value The new value for the setting.
10472 * @return true if the value was set, false on database errors
10473 */
10474 public static boolean putInt(ContentResolver cr, String name, int value) {
10475 return putString(cr, name, Integer.toString(value));
10476 }
10477
10478 /**
10479 * Convenience function for retrieving a single secure settings value
10480 * as a {@code long}. Note that internally setting values are always
10481 * stored as strings; this function converts the string to a {@code long}
10482 * for you. The default value will be returned if the setting is
10483 * not defined or not a {@code long}.
10484 *
10485 * @param cr The ContentResolver to access.
10486 * @param name The name of the setting to retrieve.
10487 * @param def Value to return if the setting is not defined.
10488 *
10489 * @return The setting's current value, or 'def' if it is not defined
10490 * or not a valid {@code long}.
10491 */
10492 public static long getLong(ContentResolver cr, String name, long def) {
10493 String valString = getString(cr, name);
10494 long value;
10495 try {
10496 value = valString != null ? Long.parseLong(valString) : def;
10497 } catch (NumberFormatException e) {
10498 value = def;
10499 }
10500 return value;
10501 }
10502
10503 /**
10504 * Convenience function for retrieving a single secure settings value
10505 * as a {@code long}. Note that internally setting values are always
10506 * stored as strings; this function converts the string to a {@code long}
10507 * for you.
10508 * <p>
10509 * This version does not take a default value. If the setting has not
10510 * been set, or the string value is not a number,
10511 * it throws {@link SettingNotFoundException}.
10512 *
10513 * @param cr The ContentResolver to access.
10514 * @param name The name of the setting to retrieve.
10515 *
10516 * @return The setting's current value.
10517 * @throws SettingNotFoundException Thrown if a setting by the given
10518 * name can't be found or the setting value is not an integer.
10519 */
10520 public static long getLong(ContentResolver cr, String name)
10521 throws SettingNotFoundException {
10522 String valString = getString(cr, name);
10523 try {
10524 return Long.parseLong(valString);
10525 } catch (NumberFormatException e) {
10526 throw new SettingNotFoundException(name);
10527 }
10528 }
10529
10530 /**
10531 * Convenience function for updating a secure settings value as a long
10532 * integer. This will either create a new entry in the table if the
10533 * given name does not exist, or modify the value of the existing row
10534 * with that name. Note that internally setting values are always
10535 * stored as strings, so this function converts the given value to a
10536 * string before storing it.
10537 *
10538 * @param cr The ContentResolver to access.
10539 * @param name The name of the setting to modify.
10540 * @param value The new value for the setting.
10541 * @return true if the value was set, false on database errors
10542 */
10543 public static boolean putLong(ContentResolver cr, String name, long value) {
10544 return putString(cr, name, Long.toString(value));
10545 }
10546
10547 /**
10548 * Convenience function for retrieving a single secure settings value
10549 * as a floating point number. Note that internally setting values are
10550 * always stored as strings; this function converts the string to an
10551 * float for you. The default value will be returned if the setting
10552 * is not defined or not a valid float.
10553 *
10554 * @param cr The ContentResolver to access.
10555 * @param name The name of the setting to retrieve.
10556 * @param def Value to return if the setting is not defined.
10557 *
10558 * @return The setting's current value, or 'def' if it is not defined
10559 * or not a valid float.
10560 */
10561 public static float getFloat(ContentResolver cr, String name, float def) {
10562 String v = getString(cr, name);
10563 try {
10564 return v != null ? Float.parseFloat(v) : def;
10565 } catch (NumberFormatException e) {
10566 return def;
10567 }
10568 }
10569
10570 /**
10571 * Convenience function for retrieving a single secure settings value
10572 * as a float. Note that internally setting values are always
10573 * stored as strings; this function converts the string to a float
10574 * for you.
10575 * <p>
10576 * This version does not take a default value. If the setting has not
10577 * been set, or the string value is not a number,
10578 * it throws {@link SettingNotFoundException}.
10579 *
10580 * @param cr The ContentResolver to access.
10581 * @param name The name of the setting to retrieve.
10582 *
10583 * @throws SettingNotFoundException Thrown if a setting by the given
10584 * name can't be found or the setting value is not a float.
10585 *
10586 * @return The setting's current value.
10587 */
10588 public static float getFloat(ContentResolver cr, String name)
10589 throws SettingNotFoundException {
10590 String v = getString(cr, name);
10591 if (v == null) {
10592 throw new SettingNotFoundException(name);
10593 }
10594 try {
10595 return Float.parseFloat(v);
10596 } catch (NumberFormatException e) {
10597 throw new SettingNotFoundException(name);
10598 }
10599 }
10600
10601 /**
10602 * Convenience function for updating a single settings value as a
10603 * floating point number. This will either create a new entry in the
10604 * table if the given name does not exist, or modify the value of the
10605 * existing row with that name. Note that internally setting values
10606 * are always stored as strings, so this function converts the given
10607 * value to a string before storing it.
10608 *
10609 * @param cr The ContentResolver to access.
10610 * @param name The name of the setting to modify.
10611 * @param value The new value for the setting.
10612 * @return true if the value was set, false on database errors
10613 */
10614 public static boolean putFloat(ContentResolver cr, String name, float value) {
10615 return putString(cr, name, Float.toString(value));
10616 }
Wink Savillefb40dd42014-06-12 17:02:31 -070010617
Wink Savillefb40dd42014-06-12 17:02:31 -070010618 /**
10619 * Subscription to be used for voice call on a multi sim device. The supported values
10620 * are 0 = SUB1, 1 = SUB2 and etc.
10621 * @hide
10622 */
10623 public static final String MULTI_SIM_VOICE_CALL_SUBSCRIPTION = "multi_sim_voice_call";
10624
10625 /**
10626 * Used to provide option to user to select subscription during dial.
10627 * The supported values are 0 = disable or 1 = enable prompt.
10628 * @hide
10629 */
10630 public static final String MULTI_SIM_VOICE_PROMPT = "multi_sim_voice_prompt";
10631
10632 /**
10633 * Subscription to be used for data call on a multi sim device. The supported values
10634 * are 0 = SUB1, 1 = SUB2 and etc.
10635 * @hide
10636 */
10637 public static final String MULTI_SIM_DATA_CALL_SUBSCRIPTION = "multi_sim_data_call";
10638
10639 /**
10640 * Subscription to be used for SMS on a multi sim device. The supported values
10641 * are 0 = SUB1, 1 = SUB2 and etc.
10642 * @hide
10643 */
10644 public static final String MULTI_SIM_SMS_SUBSCRIPTION = "multi_sim_sms";
10645
10646 /**
10647 * Used to provide option to user to select subscription during send SMS.
10648 * The value 1 - enable, 0 - disable
10649 * @hide
10650 */
10651 public static final String MULTI_SIM_SMS_PROMPT = "multi_sim_sms_prompt";
10652
10653
10654
10655 /** User preferred subscriptions setting.
10656 * This holds the details of the user selected subscription from the card and
10657 * the activation status. Each settings string have the coma separated values
10658 * iccId,appType,appId,activationStatus,3gppIndex,3gpp2Index
10659 * @hide
10660 */
10661 public static final String[] MULTI_SIM_USER_PREFERRED_SUBS = {"user_preferred_sub1",
10662 "user_preferred_sub2","user_preferred_sub3"};
Zheng Fub218ff42015-04-13 16:31:16 -070010663
10664 /**
10665 * Whether to enable new contacts aggregator or not.
10666 * The value 1 - enable, 0 - disable
10667 * @hide
10668 */
10669 public static final String NEW_CONTACT_AGGREGATOR = "new_contact_aggregator";
Zheng Fu31ce78c2015-04-15 16:57:53 -070010670
10671 /**
10672 * Whether to enable contacts metadata syncing or not
10673 * The value 1 - enable, 0 - disable
Tingting Wange0cbda42016-05-10 15:39:37 -070010674 *
10675 * @removed
Zheng Fu31ce78c2015-04-15 16:57:53 -070010676 */
Tingting Wange0cbda42016-05-10 15:39:37 -070010677 @Deprecated
Zheng Fu31ce78c2015-04-15 16:57:53 -070010678 public static final String CONTACT_METADATA_SYNC = "contact_metadata_sync";
Wei Liua1817702015-08-11 21:21:12 -070010679
10680 /**
Tingting Wange0cbda42016-05-10 15:39:37 -070010681 * Whether to enable contacts metadata syncing or not
10682 * The value 1 - enable, 0 - disable
10683 */
10684 public static final String CONTACT_METADATA_SYNC_ENABLED = "contact_metadata_sync_enabled";
10685
10686 /**
Wei Liua1817702015-08-11 21:21:12 -070010687 * Whether to enable cellular on boot.
10688 * The value 1 - enable, 0 - disable
10689 * @hide
10690 */
10691 public static final String ENABLE_CELLULAR_ON_BOOT = "enable_cellular_on_boot";
Steven Ngdc20ba62016-04-26 18:19:04 +010010692
10693 /**
Chris Wren763a9bb2016-05-31 17:14:12 -040010694 * The maximum allowed notification enqueue rate in Hertz.
10695 *
Julia Reynolds76c096d2017-06-19 08:16:04 -040010696 * Should be a float, and includes updates only.
Chris Wren763a9bb2016-05-31 17:14:12 -040010697 * @hide
10698 */
10699 public static final String MAX_NOTIFICATION_ENQUEUE_RATE = "max_notification_enqueue_rate";
Doris Ling628cea42016-06-09 10:35:02 -070010700
10701 /**
Geoffrey Pitsch4c6eef22017-04-19 10:26:45 -040010702 * Displays toasts when an app posts a notification that does not specify a valid channel.
10703 *
10704 * The value 1 - enable, 0 - disable
10705 * @hide
10706 */
10707 public static final String SHOW_NOTIFICATION_CHANNEL_WARNINGS =
10708 "show_notification_channel_warnings";
10709
10710 /**
Chris Manton95a6c892016-03-15 13:26:11 -070010711 * Whether cell is enabled/disabled
10712 * @hide
10713 */
10714 public static final String CELL_ON = "cell_on";
Chad Brubaker97bccee2017-01-05 15:51:41 -080010715
10716 /**
Todd Kennedybe0b8892017-02-15 14:13:52 -080010717 * Global settings which can be accessed by instant apps.
Chad Brubaker97bccee2017-01-05 15:51:41 -080010718 * @hide
10719 */
Todd Kennedybe0b8892017-02-15 14:13:52 -080010720 public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>();
Chad Brubaker97bccee2017-01-05 15:51:41 -080010721 static {
Todd Kennedybe0b8892017-02-15 14:13:52 -080010722 INSTANT_APP_SETTINGS.add(WAIT_FOR_DEBUGGER);
10723 INSTANT_APP_SETTINGS.add(DEVICE_PROVISIONED);
10724 INSTANT_APP_SETTINGS.add(DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES);
10725 INSTANT_APP_SETTINGS.add(DEVELOPMENT_FORCE_RTL);
10726 INSTANT_APP_SETTINGS.add(EPHEMERAL_COOKIE_MAX_SIZE_BYTES);
Chad Brubaker1f6a2662017-03-20 11:11:30 -070010727 INSTANT_APP_SETTINGS.add(AIRPLANE_MODE_ON);
Chad Brubaker91d2e282017-04-03 14:34:50 -070010728 INSTANT_APP_SETTINGS.add(WINDOW_ANIMATION_SCALE);
10729 INSTANT_APP_SETTINGS.add(TRANSITION_ANIMATION_SCALE);
10730 INSTANT_APP_SETTINGS.add(ANIMATOR_DURATION_SCALE);
10731 INSTANT_APP_SETTINGS.add(DEBUG_VIEW_ATTRIBUTES);
Chad Brubaker562afaf2017-04-10 13:32:37 -070010732 INSTANT_APP_SETTINGS.add(WTF_IS_FATAL);
Chad Brubaker97bccee2017-01-05 15:51:41 -080010733 }
10734
Andrew Sappersteine3352562017-01-20 15:41:03 -080010735 /**
10736 * Whether to show the high temperature warning notification.
10737 * @hide
10738 */
10739 public static final String SHOW_TEMPERATURE_WARNING = "show_temperature_warning";
10740
10741 /**
10742 * Temperature at which the high temperature warning notification should be shown.
10743 * @hide
10744 */
10745 public static final String WARNING_TEMPERATURE = "warning_temperature";
Daniel Nishi88e45dc2017-01-25 11:43:55 -080010746
10747 /**
10748 * Whether the diskstats logging task is enabled/disabled.
10749 * @hide
10750 */
10751 public static final String ENABLE_DISKSTATS_LOGGING = "enable_diskstats_logging";
Daniel Nishi0f703e62017-02-21 15:19:27 -080010752
10753 /**
10754 * Whether the cache quota calculation task is enabled/disabled.
10755 * @hide
10756 */
10757 public static final String ENABLE_CACHE_QUOTA_CALCULATION =
10758 "enable_cache_quota_calculation";
Daniel Nishi4f5320e2017-06-13 17:51:21 -070010759
10760 /**
10761 * Whether the Deletion Helper no threshold toggle is available.
10762 * @hide
10763 */
10764 public static final String ENABLE_DELETION_HELPER_NO_THRESHOLD_TOGGLE =
10765 "enable_deletion_helper_no_threshold_toggle";
Christopher Tate06efb532012-08-24 15:29:27 -070010766 }
10767
10768 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080010769 * User-defined bookmarks and shortcuts. The target of each bookmark is an
10770 * Intent URL, allowing it to be either a web page or a particular
10771 * application activity.
10772 *
10773 * @hide
10774 */
10775 public static final class Bookmarks implements BaseColumns
10776 {
10777 private static final String TAG = "Bookmarks";
10778
10779 /**
10780 * The content:// style URL for this table
10781 */
10782 public static final Uri CONTENT_URI =
10783 Uri.parse("content://" + AUTHORITY + "/bookmarks");
10784
10785 /**
10786 * The row ID.
10787 * <p>Type: INTEGER</p>
10788 */
10789 public static final String ID = "_id";
10790
10791 /**
10792 * Descriptive name of the bookmark that can be displayed to the user.
10793 * If this is empty, the title should be resolved at display time (use
10794 * {@link #getTitle(Context, Cursor)} any time you want to display the
10795 * title of a bookmark.)
10796 * <P>
10797 * Type: TEXT
10798 * </P>
10799 */
10800 public static final String TITLE = "title";
10801
10802 /**
10803 * Arbitrary string (displayed to the user) that allows bookmarks to be
10804 * organized into categories. There are some special names for
10805 * standard folders, which all start with '@'. The label displayed for
10806 * the folder changes with the locale (via {@link #getLabelForFolder}) but
10807 * the folder name does not change so you can consistently query for
10808 * the folder regardless of the current locale.
10809 *
10810 * <P>Type: TEXT</P>
10811 *
10812 */
10813 public static final String FOLDER = "folder";
10814
10815 /**
10816 * The Intent URL of the bookmark, describing what it points to. This
10817 * value is given to {@link android.content.Intent#getIntent} to create
10818 * an Intent that can be launched.
10819 * <P>Type: TEXT</P>
10820 */
10821 public static final String INTENT = "intent";
10822
10823 /**
10824 * Optional shortcut character associated with this bookmark.
10825 * <P>Type: INTEGER</P>
10826 */
10827 public static final String SHORTCUT = "shortcut";
10828
10829 /**
10830 * The order in which the bookmark should be displayed
10831 * <P>Type: INTEGER</P>
10832 */
10833 public static final String ORDERING = "ordering";
10834
10835 private static final String[] sIntentProjection = { INTENT };
10836 private static final String[] sShortcutProjection = { ID, SHORTCUT };
10837 private static final String sShortcutSelection = SHORTCUT + "=?";
10838
10839 /**
10840 * Convenience function to retrieve the bookmarked Intent for a
10841 * particular shortcut key.
10842 *
10843 * @param cr The ContentResolver to query.
10844 * @param shortcut The shortcut key.
10845 *
10846 * @return Intent The bookmarked URL, or null if there is no bookmark
10847 * matching the given shortcut.
10848 */
10849 public static Intent getIntentForShortcut(ContentResolver cr, char shortcut)
10850 {
10851 Intent intent = null;
10852
10853 Cursor c = cr.query(CONTENT_URI,
10854 sIntentProjection, sShortcutSelection,
10855 new String[] { String.valueOf((int) shortcut) }, ORDERING);
10856 // Keep trying until we find a valid shortcut
10857 try {
10858 while (intent == null && c.moveToNext()) {
10859 try {
10860 String intentURI = c.getString(c.getColumnIndexOrThrow(INTENT));
Christian Mehlmauera34d2c92010-05-25 19:04:20 +020010861 intent = Intent.parseUri(intentURI, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080010862 } catch (java.net.URISyntaxException e) {
10863 // The stored URL is bad... ignore it.
10864 } catch (IllegalArgumentException e) {
10865 // Column not found
Dianne Hackborna33e3f72009-09-29 17:28:24 -070010866 Log.w(TAG, "Intent column not found", e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080010867 }
10868 }
10869 } finally {
10870 if (c != null) c.close();
10871 }
10872
10873 return intent;
10874 }
10875
10876 /**
10877 * Add a new bookmark to the system.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -070010878 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080010879 * @param cr The ContentResolver to query.
10880 * @param intent The desired target of the bookmark.
10881 * @param title Bookmark title that is shown to the user; null if none
10882 * or it should be resolved to the intent's title.
10883 * @param folder Folder in which to place the bookmark; null if none.
10884 * @param shortcut Shortcut that will invoke the bookmark; 0 if none. If
10885 * this is non-zero and there is an existing bookmark entry
10886 * with this same shortcut, then that existing shortcut is
10887 * cleared (the bookmark is not removed).
10888 * @return The unique content URL for the new bookmark entry.
10889 */
10890 public static Uri add(ContentResolver cr,
10891 Intent intent,
10892 String title,
10893 String folder,
10894 char shortcut,
10895 int ordering)
10896 {
10897 // If a shortcut is supplied, and it is already defined for
10898 // another bookmark, then remove the old definition.
10899 if (shortcut != 0) {
Jeff Hamilton7cd51ef2010-05-12 17:30:27 -050010900 cr.delete(CONTENT_URI, sShortcutSelection,
10901 new String[] { String.valueOf((int) shortcut) });
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080010902 }
10903
10904 ContentValues values = new ContentValues();
10905 if (title != null) values.put(TITLE, title);
10906 if (folder != null) values.put(FOLDER, folder);
Jean-Baptiste Queru3b9f0a32010-06-21 13:46:59 -070010907 values.put(INTENT, intent.toUri(0));
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080010908 if (shortcut != 0) values.put(SHORTCUT, (int) shortcut);
10909 values.put(ORDERING, ordering);
10910 return cr.insert(CONTENT_URI, values);
10911 }
10912
10913 /**
10914 * Return the folder name as it should be displayed to the user. This
10915 * takes care of localizing special folders.
10916 *
10917 * @param r Resources object for current locale; only need access to
10918 * system resources.
10919 * @param folder The value found in the {@link #FOLDER} column.
10920 *
10921 * @return CharSequence The label for this folder that should be shown
10922 * to the user.
10923 */
10924 public static CharSequence getLabelForFolder(Resources r, String folder) {
10925 return folder;
10926 }
10927
10928 /**
10929 * Return the title as it should be displayed to the user. This takes
10930 * care of localizing bookmarks that point to activities.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -070010931 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080010932 * @param context A context.
10933 * @param cursor A cursor pointing to the row whose title should be
10934 * returned. The cursor must contain at least the {@link #TITLE}
10935 * and {@link #INTENT} columns.
10936 * @return A title that is localized and can be displayed to the user,
10937 * or the empty string if one could not be found.
10938 */
10939 public static CharSequence getTitle(Context context, Cursor cursor) {
10940 int titleColumn = cursor.getColumnIndex(TITLE);
10941 int intentColumn = cursor.getColumnIndex(INTENT);
10942 if (titleColumn == -1 || intentColumn == -1) {
10943 throw new IllegalArgumentException(
10944 "The cursor must contain the TITLE and INTENT columns.");
10945 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -070010946
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080010947 String title = cursor.getString(titleColumn);
10948 if (!TextUtils.isEmpty(title)) {
10949 return title;
10950 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -070010951
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080010952 String intentUri = cursor.getString(intentColumn);
10953 if (TextUtils.isEmpty(intentUri)) {
10954 return "";
10955 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -070010956
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080010957 Intent intent;
10958 try {
Christian Mehlmauera34d2c92010-05-25 19:04:20 +020010959 intent = Intent.parseUri(intentUri, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080010960 } catch (URISyntaxException e) {
10961 return "";
10962 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -070010963
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080010964 PackageManager packageManager = context.getPackageManager();
10965 ResolveInfo info = packageManager.resolveActivity(intent, 0);
10966 return info != null ? info.loadLabel(packageManager) : "";
10967 }
10968 }
10969
10970 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080010971 * Returns the device ID that we should use when connecting to the mobile gtalk server.
10972 * This is a string like "android-0x1242", where the hex string is the Android ID obtained
10973 * from the GoogleLoginService.
10974 *
10975 * @param androidId The Android ID for this device.
10976 * @return The device ID that should be used when connecting to the mobile gtalk server.
10977 * @hide
10978 */
10979 public static String getGTalkDeviceId(long androidId) {
10980 return "android-" + Long.toHexString(androidId);
10981 }
Billy Lau6ad2d662015-07-18 00:26:58 +010010982
Billy Laua7238a32015-08-01 12:45:02 +010010983 private static final String[] PM_WRITE_SETTINGS = {
10984 android.Manifest.permission.WRITE_SETTINGS
10985 };
10986 private static final String[] PM_CHANGE_NETWORK_STATE = {
10987 android.Manifest.permission.CHANGE_NETWORK_STATE,
10988 android.Manifest.permission.WRITE_SETTINGS
10989 };
10990 private static final String[] PM_SYSTEM_ALERT_WINDOW = {
10991 android.Manifest.permission.SYSTEM_ALERT_WINDOW
10992 };
10993
Billy Lau6ad2d662015-07-18 00:26:58 +010010994 /**
10995 * Performs a strict and comprehensive check of whether a calling package is allowed to
10996 * write/modify system settings, as the condition differs for pre-M, M+, and
10997 * privileged/preinstalled apps. If the provided uid does not match the
10998 * callingPackage, a negative result will be returned.
10999 * @hide
11000 */
11001 public static boolean isCallingPackageAllowedToWriteSettings(Context context, int uid,
11002 String callingPackage, boolean throwException) {
11003 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
11004 callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS,
Billy Laua7238a32015-08-01 12:45:02 +010011005 PM_WRITE_SETTINGS, false);
Billy Lau6ad2d662015-07-18 00:26:58 +010011006 }
11007
11008 /**
11009 * Performs a strict and comprehensive check of whether a calling package is allowed to
11010 * write/modify system settings, as the condition differs for pre-M, M+, and
11011 * privileged/preinstalled apps. If the provided uid does not match the
Billy Laua7238a32015-08-01 12:45:02 +010011012 * callingPackage, a negative result will be returned. The caller is expected to have
Lorenzo Colittid5427052015-10-15 16:29:00 +090011013 * the WRITE_SETTINGS permission declared.
Billy Lau6ad2d662015-07-18 00:26:58 +010011014 *
11015 * Note: if the check is successful, the operation of this app will be updated to the
11016 * current time.
11017 * @hide
11018 */
11019 public static boolean checkAndNoteWriteSettingsOperation(Context context, int uid,
11020 String callingPackage, boolean throwException) {
11021 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
11022 callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS,
Billy Laua7238a32015-08-01 12:45:02 +010011023 PM_WRITE_SETTINGS, true);
11024 }
11025
11026 /**
11027 * Performs a strict and comprehensive check of whether a calling package is allowed to
11028 * change the state of network, as the condition differs for pre-M, M+, and
Lorenzo Colittid5427052015-10-15 16:29:00 +090011029 * privileged/preinstalled apps. The caller is expected to have either the
11030 * CHANGE_NETWORK_STATE or the WRITE_SETTINGS permission declared. Either of these
11031 * permissions allow changing network state; WRITE_SETTINGS is a runtime permission and
11032 * can be revoked, but (except in M, excluding M MRs), CHANGE_NETWORK_STATE is a normal
11033 * permission and cannot be revoked. See http://b/23597341
Billy Laua7238a32015-08-01 12:45:02 +010011034 *
Lorenzo Colittid5427052015-10-15 16:29:00 +090011035 * Note: if the check succeeds because the application holds WRITE_SETTINGS, the operation
11036 * of this app will be updated to the current time.
Billy Laua7238a32015-08-01 12:45:02 +010011037 * @hide
11038 */
11039 public static boolean checkAndNoteChangeNetworkStateOperation(Context context, int uid,
11040 String callingPackage, boolean throwException) {
Lorenzo Colittid5427052015-10-15 16:29:00 +090011041 if (context.checkCallingOrSelfPermission(android.Manifest.permission.CHANGE_NETWORK_STATE)
11042 == PackageManager.PERMISSION_GRANTED) {
11043 return true;
11044 }
Billy Laua7238a32015-08-01 12:45:02 +010011045 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
11046 callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS,
11047 PM_CHANGE_NETWORK_STATE, true);
Billy Lau6ad2d662015-07-18 00:26:58 +010011048 }
11049
11050 /**
11051 * Performs a strict and comprehensive check of whether a calling package is allowed to
11052 * draw on top of other apps, as the conditions differs for pre-M, M+, and
11053 * privileged/preinstalled apps. If the provided uid does not match the callingPackage,
11054 * a negative result will be returned.
11055 * @hide
11056 */
11057 public static boolean isCallingPackageAllowedToDrawOverlays(Context context, int uid,
11058 String callingPackage, boolean throwException) {
11059 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
11060 callingPackage, throwException, AppOpsManager.OP_SYSTEM_ALERT_WINDOW,
Billy Laua7238a32015-08-01 12:45:02 +010011061 PM_SYSTEM_ALERT_WINDOW, false);
Billy Lau6ad2d662015-07-18 00:26:58 +010011062 }
11063
11064 /**
11065 * Performs a strict and comprehensive check of whether a calling package is allowed to
11066 * draw on top of other apps, as the conditions differs for pre-M, M+, and
11067 * privileged/preinstalled apps. If the provided uid does not match the callingPackage,
11068 * a negative result will be returned.
11069 *
11070 * Note: if the check is successful, the operation of this app will be updated to the
11071 * current time.
11072 * @hide
11073 */
11074 public static boolean checkAndNoteDrawOverlaysOperation(Context context, int uid, String
11075 callingPackage, boolean throwException) {
11076 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
11077 callingPackage, throwException, AppOpsManager.OP_SYSTEM_ALERT_WINDOW,
Billy Laua7238a32015-08-01 12:45:02 +010011078 PM_SYSTEM_ALERT_WINDOW, true);
Billy Lau6ad2d662015-07-18 00:26:58 +010011079 }
11080
11081 /**
11082 * Helper method to perform a general and comprehensive check of whether an operation that is
11083 * protected by appops can be performed by a caller or not. e.g. OP_SYSTEM_ALERT_WINDOW and
11084 * OP_WRITE_SETTINGS
11085 * @hide
11086 */
11087 public static boolean isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context context,
Billy Laua7238a32015-08-01 12:45:02 +010011088 int uid, String callingPackage, boolean throwException, int appOpsOpCode, String[]
11089 permissions, boolean makeNote) {
Billy Lau6ad2d662015-07-18 00:26:58 +010011090 if (callingPackage == null) {
11091 return false;
11092 }
11093
11094 AppOpsManager appOpsMgr = (AppOpsManager)context.getSystemService(Context.APP_OPS_SERVICE);
11095 int mode = AppOpsManager.MODE_DEFAULT;
11096 if (makeNote) {
11097 mode = appOpsMgr.noteOpNoThrow(appOpsOpCode, uid, callingPackage);
11098 } else {
11099 mode = appOpsMgr.checkOpNoThrow(appOpsOpCode, uid, callingPackage);
11100 }
11101
11102 switch (mode) {
11103 case AppOpsManager.MODE_ALLOWED:
11104 return true;
Billy Laua7238a32015-08-01 12:45:02 +010011105
Billy Lau6ad2d662015-07-18 00:26:58 +010011106 case AppOpsManager.MODE_DEFAULT:
11107 // this is the default operating mode after an app's installation
Billy Laua7238a32015-08-01 12:45:02 +010011108 // In this case we will check all associated static permission to see
11109 // if it is granted during install time.
11110 for (String permission : permissions) {
11111 if (context.checkCallingOrSelfPermission(permission) == PackageManager
11112 .PERMISSION_GRANTED) {
11113 // if either of the permissions are granted, we will allow it
11114 return true;
11115 }
Billy Lau6ad2d662015-07-18 00:26:58 +010011116 }
Billy Laua7238a32015-08-01 12:45:02 +010011117
Billy Lau6ad2d662015-07-18 00:26:58 +010011118 default:
11119 // this is for all other cases trickled down here...
11120 if (!throwException) {
11121 return false;
11122 }
11123 }
Billy Laua7238a32015-08-01 12:45:02 +010011124
11125 // prepare string to throw SecurityException
11126 StringBuilder exceptionMessage = new StringBuilder();
11127 exceptionMessage.append(callingPackage);
11128 exceptionMessage.append(" was not granted ");
11129 if (permissions.length > 1) {
11130 exceptionMessage.append(" either of these permissions: ");
11131 } else {
11132 exceptionMessage.append(" this permission: ");
11133 }
11134 for (int i = 0; i < permissions.length; i++) {
11135 exceptionMessage.append(permissions[i]);
11136 exceptionMessage.append((i == permissions.length - 1) ? "." : ", ");
11137 }
11138
11139 throw new SecurityException(exceptionMessage.toString());
Billy Lau6ad2d662015-07-18 00:26:58 +010011140 }
11141
11142 /**
11143 * Retrieves a correponding package name for a given uid. It will query all
11144 * packages that are associated with the given uid, but it will return only
11145 * the zeroth result.
11146 * Note: If package could not be found, a null is returned.
11147 * @hide
11148 */
11149 public static String getPackageNameForUid(Context context, int uid) {
11150 String[] packages = context.getPackageManager().getPackagesForUid(uid);
11151 if (packages == null) {
11152 return null;
11153 }
11154 return packages[0];
11155 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080011156}