blob: 9be29967656ff21e7f23f0d4c2f468f07960b02f [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
Michal Karpinski964943a2018-01-19 16:28:26 +000019import static android.provider.SettingsValidators.ANY_INTEGER_VALIDATOR;
Michal Karpinski5db1e432018-01-18 20:10:24 +000020import static android.provider.SettingsValidators.ANY_STRING_VALIDATOR;
Michal Karpinski2c37b082018-01-18 16:14:27 +000021import static android.provider.SettingsValidators.BOOLEAN_VALIDATOR;
22import static android.provider.SettingsValidators.COMPONENT_NAME_VALIDATOR;
23import static android.provider.SettingsValidators.LENIENT_IP_ADDRESS_VALIDATOR;
Michal Karpinski964943a2018-01-19 16:28:26 +000024import static android.provider.SettingsValidators.LOCALE_VALIDATOR;
Michal Karpinski2c37b082018-01-18 16:14:27 +000025import static android.provider.SettingsValidators.NON_NEGATIVE_INTEGER_VALIDATOR;
Annie Meng44511792018-05-17 18:49:24 +010026import static android.provider.SettingsValidators.NULLABLE_COMPONENT_NAME_VALIDATOR;
Michal Karpinski5db1e432018-01-18 20:10:24 +000027import static android.provider.SettingsValidators.PACKAGE_NAME_VALIDATOR;
Michal Karpinski2c37b082018-01-18 16:14:27 +000028import static android.provider.SettingsValidators.URI_VALIDATOR;
29
Svetoslav Ganove080da92016-12-21 17:10:35 -080030import android.Manifest;
31import android.annotation.IntDef;
32import android.annotation.IntRange;
Svet Ganov53a441c2016-04-19 19:38:00 -070033import android.annotation.NonNull;
Svetoslav Ganove080da92016-12-21 17:10:35 -080034import android.annotation.Nullable;
35import android.annotation.RequiresPermission;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080036import android.annotation.SdkConstant;
37import android.annotation.SdkConstant.SdkConstantType;
Bryce Leecdfebd62015-02-02 08:19:11 -080038import android.annotation.SystemApi;
Jeff Sharkeya73b8fd2016-01-06 17:02:08 -070039import android.annotation.TestApi;
Svetoslav Ganove080da92016-12-21 17:10:35 -080040import android.annotation.UserIdInt;
Adrian Roos7811d9f2015-07-27 15:10:13 -070041import android.app.ActivityThread;
Billy Lau6ad2d662015-07-18 00:26:58 +010042import android.app.AppOpsManager;
Adrian Roos7811d9f2015-07-27 15:10:13 -070043import android.app.Application;
Julia Reynolds9ba0c612017-01-25 10:31:34 -050044import android.app.NotificationChannel;
Julia Reynoldsb852e562017-06-06 16:14:18 -040045import android.app.NotificationManager;
Narayan Kamathee69ff42011-06-28 12:07:18 +010046import android.app.SearchManager;
Jeff Sharkey6e2bee72012-10-01 13:39:08 -070047import android.app.WallpaperManager;
Mike LeBeau5d34e9b2010-02-10 19:34:56 -080048import android.content.ComponentName;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080049import android.content.ContentResolver;
50import android.content.ContentValues;
51import android.content.Context;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -080052import android.content.IContentProvider;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080053import android.content.Intent;
Dianne Hackbornb8b11a02010-03-10 15:53:11 -080054import android.content.pm.ActivityInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080055import android.content.pm.PackageManager;
56import android.content.pm.ResolveInfo;
57import android.content.res.Configuration;
58import android.content.res.Resources;
59import android.database.Cursor;
60import android.database.SQLException;
David Christie3f7b6522013-08-06 19:19:08 -070061import android.location.LocationManager;
jiabin39940752018-04-02 18:18:45 -070062import android.media.AudioFormat;
Jeff Sharkey625239a2012-09-26 22:03:49 -070063import android.net.ConnectivityManager;
Jeremy Joslinc9eb3c42017-02-08 10:45:30 -080064import android.net.NetworkScoreManager;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080065import android.net.Uri;
Irfan Sheriff36f74132010-11-04 16:57:37 -070066import android.net.wifi.WifiManager;
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -070067import android.os.BatteryManager;
Chad Brubaker97bccee2017-01-05 15:51:41 -080068import android.os.Binder;
Steve McKayea93fe72016-12-02 11:35:35 -080069import android.os.Build.VERSION_CODES;
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -070070import android.os.Bundle;
Jeff Sharkey625239a2012-09-26 22:03:49 -070071import android.os.DropBoxManager;
Amith Yamasani52c489c2012-03-28 11:42:42 -070072import android.os.IBinder;
Yohei Yukawa23cbe852016-05-17 16:42:58 -070073import android.os.LocaleList;
Amith Yamasani7ab8c4a2012-04-06 09:27:12 -070074import android.os.Process;
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -070075import android.os.RemoteException;
Dianne Hackborn0ef403e2017-01-24 18:22:15 -080076import android.os.ResultReceiver;
Amith Yamasani52c489c2012-03-28 11:42:42 -070077import android.os.ServiceManager;
Dianne Hackbornf02b60a2012-08-16 10:48:27 -070078import android.os.UserHandle;
Michal Karpinski2c37b082018-01-18 16:14:27 +000079import android.provider.SettingsValidators.Validator;
Narayan Kamath6d632962011-08-24 11:51:37 +010080import android.speech.tts.TextToSpeech;
Malcolm Chenc66dee92017-09-26 14:45:40 -070081import android.telephony.SubscriptionManager;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080082import android.text.TextUtils;
83import android.util.AndroidException;
Svetoslav683914b2015-01-15 14:22:26 -080084import android.util.ArrayMap;
85import android.util.ArraySet;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080086import android.util.Log;
Svet Ganov53a441c2016-04-19 19:38:00 -070087import android.util.MemoryIntArray;
Yohei Yukawa3f8c5682018-03-01 13:10:23 -080088import android.view.textservice.TextServicesManager;
Felipe Lemea1b79bf2016-05-24 13:06:54 -070089
Svet Ganov53a441c2016-04-19 19:38:00 -070090import com.android.internal.annotations.GuardedBy;
Chia-I Wu1e0e7172018-03-14 15:45:29 -070091import com.android.internal.app.ColorDisplayController;
Amith Yamasani52c489c2012-03-28 11:42:42 -070092import com.android.internal.widget.ILockSettings;
93
Svet Ganov53a441c2016-04-19 19:38:00 -070094import java.io.IOException;
Svetoslav Ganove080da92016-12-21 17:10:35 -080095import java.lang.annotation.Retention;
96import java.lang.annotation.RetentionPolicy;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080097import java.net.URISyntaxException;
Svetoslav683914b2015-01-15 14:22:26 -080098import java.text.SimpleDateFormat;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080099import java.util.HashMap;
100import java.util.HashSet;
Elliott Hughescb64d432013-08-02 10:00:44 -0700101import java.util.Locale;
Svetoslav683914b2015-01-15 14:22:26 -0800102import java.util.Map;
103import java.util.Set;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800104
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800105/**
106 * The Settings provider contains global system-level device preferences.
107 */
108public final class Settings {
109
110 // Intent actions for Settings
111
112 /**
113 * Activity Action: Show system settings.
114 * <p>
115 * Input: Nothing.
116 * <p>
Gilles Debunnee90bed12011-08-30 14:28:27 -0700117 * Output: Nothing.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800118 */
119 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
120 public static final String ACTION_SETTINGS = "android.settings.SETTINGS";
121
122 /**
123 * Activity Action: Show settings to allow configuration of APNs.
124 * <p>
125 * Input: Nothing.
126 * <p>
Gilles Debunnee90bed12011-08-30 14:28:27 -0700127 * Output: Nothing.
Christopher Tate72da1e62018-05-10 13:09:48 -0700128 *
129 * <p class="note">
130 * In some cases, a matching Activity may not exist, so ensure you
131 * safeguard against this.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800132 */
133 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
134 public static final String ACTION_APN_SETTINGS = "android.settings.APN_SETTINGS";
135
136 /**
137 * Activity Action: Show settings to allow configuration of current location
138 * sources.
139 * <p>
140 * In some cases, a matching Activity may not exist, so ensure you
141 * safeguard against this.
142 * <p>
143 * Input: Nothing.
144 * <p>
145 * Output: Nothing.
146 */
147 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
148 public static final String ACTION_LOCATION_SOURCE_SETTINGS =
149 "android.settings.LOCATION_SOURCE_SETTINGS";
150
151 /**
Lifu Tang58aa11b2018-04-12 10:13:15 -0700152 * Activity Action: Show scanning settings to allow configuration of Wi-Fi
153 * and Bluetooth scanning settings.
154 * <p>
155 * In some cases, a matching Activity may not exist, so ensure you
156 * safeguard against this.
157 * <p>
158 * Input: Nothing.
159 * <p>
160 * Output: Nothing.
161 * @hide
162 */
163 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
164 public static final String ACTION_LOCATION_SCANNING_SETTINGS =
165 "android.settings.LOCATION_SCANNING_SETTINGS";
166
167 /**
Jason Monk76c67aa2016-02-19 14:49:42 -0500168 * Activity Action: Show settings to allow configuration of users.
169 * <p>
170 * In some cases, a matching Activity may not exist, so ensure you
171 * safeguard against this.
172 * <p>
173 * Input: Nothing.
174 * <p>
175 * Output: Nothing.
176 * @hide
177 */
178 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
179 public static final String ACTION_USER_SETTINGS =
180 "android.settings.USER_SETTINGS";
181
182 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800183 * Activity Action: Show settings to allow configuration of wireless controls
184 * such as Wi-Fi, Bluetooth and Mobile networks.
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_WIRELESS_SETTINGS =
195 "android.settings.WIRELESS_SETTINGS";
196
197 /**
Jeremy Klein15f3d212016-01-24 17:01:09 -0800198 * Activity Action: Show tether provisioning activity.
199 *
200 * <p>
201 * In some cases, a matching Activity may not exist, so ensure you
202 * safeguard against this.
203 * <p>
Dianne Hackborn0ef403e2017-01-24 18:22:15 -0800204 * Input: {@link ConnectivityManager#EXTRA_TETHER_TYPE} should be included to specify which type
205 * of tethering should be checked. {@link ConnectivityManager#EXTRA_PROVISION_CALLBACK} should
Jeremy Klein15f3d212016-01-24 17:01:09 -0800206 * contain a {@link ResultReceiver} which will be called back with a tether result code.
207 * <p>
208 * Output: The result of the provisioning check.
Dianne Hackborn0ef403e2017-01-24 18:22:15 -0800209 * {@link ConnectivityManager#TETHER_ERROR_NO_ERROR} if successful,
210 * {@link ConnectivityManager#TETHER_ERROR_PROVISION_FAILED} for failure.
Jeremy Klein15f3d212016-01-24 17:01:09 -0800211 *
212 * @hide
213 */
214 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
215 public static final String ACTION_TETHER_PROVISIONING =
216 "android.settings.TETHER_PROVISIONING_UI";
217
218 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800219 * Activity Action: Show settings to allow entering/exiting airplane mode.
220 * <p>
221 * In some cases, a matching Activity may not exist, so ensure you
222 * safeguard against this.
223 * <p>
224 * Input: Nothing.
225 * <p>
226 * Output: Nothing.
227 */
228 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
229 public static final String ACTION_AIRPLANE_MODE_SETTINGS =
230 "android.settings.AIRPLANE_MODE_SETTINGS";
231
232 /**
Malcolm Chen21062542017-06-20 11:36:01 -0700233 * Activity Action: Show mobile data usage list.
234 * <p>
235 * Input: {@link EXTRA_NETWORK_TEMPLATE} and {@link EXTRA_SUB_ID} should be included to specify
236 * how and what mobile data statistics should be collected.
237 * <p>
238 * Output: Nothing
239 * @hide
240 */
241 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
242 public static final String ACTION_MOBILE_DATA_USAGE =
243 "android.settings.MOBILE_DATA_USAGE";
244
245 /** @hide */
246 public static final String EXTRA_NETWORK_TEMPLATE = "network_template";
Jeff Davidsonf32f7b42017-11-03 15:05:07 -0700247
248 /**
249 * An int extra specifying a subscription ID.
250 *
251 * @see android.telephony.SubscriptionInfo#getSubscriptionId
252 */
253 public static final String EXTRA_SUB_ID = "android.provider.extra.SUB_ID";
Malcolm Chen21062542017-06-20 11:36:01 -0700254
255 /**
Barnaby Jamesb3006d32015-04-02 17:49:54 -0700256 * Activity Action: Modify Airplane mode settings using a voice command.
Barnaby James48f35522014-07-16 14:27:39 -0700257 * <p>
258 * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
259 * <p>
260 * This intent MUST be started using
261 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
262 * startVoiceActivity}.
263 * <p>
Barnaby Jamesb3006d32015-04-02 17:49:54 -0700264 * Note: The activity implementing this intent MUST verify that
Barnaby James48f35522014-07-16 14:27:39 -0700265 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before
266 * modifying the setting.
267 * <p>
Barnaby Jamesb3006d32015-04-02 17:49:54 -0700268 * Input: To tell which state airplane mode should be set to, add the
269 * {@link #EXTRA_AIRPLANE_MODE_ENABLED} extra to this Intent with the state specified.
270 * If the extra is not included, no changes will be made.
Barnaby James48f35522014-07-16 14:27:39 -0700271 * <p>
272 * Output: Nothing.
273 */
274 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
275 public static final String ACTION_VOICE_CONTROL_AIRPLANE_MODE =
276 "android.settings.VOICE_CONTROL_AIRPLANE_MODE";
277
278 /**
Dianne Hackborndd9b82c2009-09-03 00:18:47 -0700279 * Activity Action: Show settings for accessibility modules.
280 * <p>
281 * In some cases, a matching Activity may not exist, so ensure you
282 * safeguard against this.
283 * <p>
284 * Input: Nothing.
285 * <p>
286 * Output: Nothing.
287 */
288 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
289 public static final String ACTION_ACCESSIBILITY_SETTINGS =
290 "android.settings.ACCESSIBILITY_SETTINGS";
291
292 /**
Dianne Hackborna3fb40d2014-08-12 15:06:50 -0700293 * Activity Action: Show settings to control access to usage information.
294 * <p>
295 * In some cases, a matching Activity may not exist, so ensure you
296 * safeguard against this.
297 * <p>
298 * Input: Nothing.
299 * <p>
300 * Output: Nothing.
301 */
302 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
303 public static final String ACTION_USAGE_ACCESS_SETTINGS =
304 "android.settings.USAGE_ACCESS_SETTINGS";
305
306 /**
Jason Monk6f909782015-04-17 14:30:25 -0400307 * Activity Category: Show application settings related to usage access.
308 * <p>
309 * An activity that provides a user interface for adjusting usage access related
310 * preferences for its containing application. Optional but recommended for apps that
311 * use {@link android.Manifest.permission#PACKAGE_USAGE_STATS}.
312 * <p>
313 * The activity may define meta-data to describe what usage access is
314 * used for within their app with {@link #METADATA_USAGE_ACCESS_REASON}, which
315 * will be displayed in Settings.
316 * <p>
317 * Input: Nothing.
318 * <p>
319 * Output: Nothing.
320 */
321 @SdkConstant(SdkConstantType.INTENT_CATEGORY)
322 public static final String INTENT_CATEGORY_USAGE_ACCESS_CONFIG =
323 "android.intent.category.USAGE_ACCESS_CONFIG";
324
325 /**
326 * Metadata key: Reason for needing usage access.
327 * <p>
328 * A key for metadata attached to an activity that receives action
329 * {@link #INTENT_CATEGORY_USAGE_ACCESS_CONFIG}, shown to the
330 * user as description of how the app uses usage access.
331 * <p>
332 */
333 public static final String METADATA_USAGE_ACCESS_REASON =
334 "android.settings.metadata.USAGE_ACCESS_REASON";
335
336 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800337 * Activity Action: Show settings to allow configuration of security and
338 * location privacy.
339 * <p>
340 * In some cases, a matching Activity may not exist, so ensure you
341 * safeguard against this.
342 * <p>
343 * Input: Nothing.
344 * <p>
345 * Output: Nothing.
346 */
347 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
348 public static final String ACTION_SECURITY_SETTINGS =
349 "android.settings.SECURITY_SETTINGS";
350
351 /**
Suprabh Shukla2f34b1a2016-12-16 14:47:25 -0800352 * Activity Action: Show settings to allow configuration of trusted external sources
Suprabh Shukla905df002017-05-25 14:21:59 -0700353 *
Suprabh Shukla84d11b42017-03-07 23:40:25 -0800354 * Input: Optionally, the Intent's data URI can specify the application package name to
355 * directly invoke the management GUI specific to the package name. For example
356 * "package:com.my.app".
Suprabh Shukla2f34b1a2016-12-16 14:47:25 -0800357 * <p>
358 * Output: Nothing.
Suprabh Shukla2f34b1a2016-12-16 14:47:25 -0800359 */
360 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
Suprabh Shuklaa1300c82017-04-06 17:52:32 -0700361 public static final String ACTION_MANAGE_UNKNOWN_APP_SOURCES =
Suprabh Shukla89aae442017-04-20 16:04:26 -0700362 "android.settings.MANAGE_UNKNOWN_APP_SOURCES";
Suprabh Shukla2f34b1a2016-12-16 14:47:25 -0800363
364 /**
Maggie Benthall0469f412013-09-05 15:30:26 -0400365 * Activity Action: Show trusted credentials settings, opening to the user tab,
366 * to allow management of installed credentials.
367 * <p>
368 * In some cases, a matching Activity may not exist, so ensure you
369 * safeguard against this.
370 * <p>
371 * Input: Nothing.
372 * <p>
373 * Output: Nothing.
374 * @hide
375 */
376 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
377 public static final String ACTION_TRUSTED_CREDENTIALS_USER =
378 "com.android.settings.TRUSTED_CREDENTIALS_USER";
379
380 /**
381 * Activity Action: Show dialog explaining that an installed CA cert may enable
382 * monitoring of encrypted network traffic.
383 * <p>
384 * In some cases, a matching Activity may not exist, so ensure you
Victor Chang355d4762016-04-07 21:23:15 +0100385 * safeguard against this. Add {@link #EXTRA_NUMBER_OF_CERTIFICATES} extra to indicate the
386 * number of certificates.
Maggie Benthall0469f412013-09-05 15:30:26 -0400387 * <p>
388 * Input: Nothing.
389 * <p>
390 * Output: Nothing.
391 * @hide
392 */
393 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
394 public static final String ACTION_MONITORING_CERT_INFO =
395 "com.android.settings.MONITORING_CERT_INFO";
396
397 /**
Amith Yamasanic15255a2009-09-23 15:33:19 -0700398 * Activity Action: Show settings to allow configuration of privacy options.
399 * <p>
400 * In some cases, a matching Activity may not exist, so ensure you
401 * safeguard against this.
402 * <p>
403 * Input: Nothing.
404 * <p>
405 * Output: Nothing.
406 */
407 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
408 public static final String ACTION_PRIVACY_SETTINGS =
409 "android.settings.PRIVACY_SETTINGS";
410
411 /**
Robin Leea249aee2016-02-03 13:42:56 +0000412 * Activity Action: Show settings to allow configuration of VPN.
413 * <p>
414 * In some cases, a matching Activity may not exist, so ensure you
415 * safeguard against this.
416 * <p>
417 * Input: Nothing.
418 * <p>
419 * Output: Nothing.
420 */
421 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
422 public static final String ACTION_VPN_SETTINGS =
423 "android.settings.VPN_SETTINGS";
424
425 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800426 * Activity Action: Show settings to allow configuration of Wi-Fi.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800427 * <p>
428 * In some cases, a matching Activity may not exist, so ensure you
429 * safeguard against this.
430 * <p>
431 * Input: Nothing.
432 * <p>
433 * Output: Nothing.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800434 */
435 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
436 public static final String ACTION_WIFI_SETTINGS =
437 "android.settings.WIFI_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700438
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800439 /**
440 * Activity Action: Show settings to allow configuration of a static IP
441 * address for Wi-Fi.
442 * <p>
443 * In some cases, a matching Activity may not exist, so ensure you safeguard
444 * against this.
445 * <p>
446 * Input: Nothing.
447 * <p>
448 * Output: Nothing.
449 */
450 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
451 public static final String ACTION_WIFI_IP_SETTINGS =
452 "android.settings.WIFI_IP_SETTINGS";
453
454 /**
Rohan Shah53f3f152018-02-28 15:13:31 -0800455 * Activity Action: Show settings to allow configuration of data and view data usage.
456 * <p>
457 * In some cases, a matching Activity may not exist, so ensure you
458 * safeguard against this.
459 * <p>
460 * Input: Nothing.
461 * <p>
462 * Output: Nothing.
463 */
464 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
465 public static final String ACTION_DATA_USAGE_SETTINGS =
466 "android.settings.DATA_USAGE_SETTINGS";
467
468 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800469 * Activity Action: Show settings to allow configuration of Bluetooth.
470 * <p>
471 * In some cases, a matching Activity may not exist, so ensure you
472 * safeguard against this.
473 * <p>
474 * Input: Nothing.
475 * <p>
476 * Output: Nothing.
477 */
478 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
479 public static final String ACTION_BLUETOOTH_SETTINGS =
480 "android.settings.BLUETOOTH_SETTINGS";
481
482 /**
Kevin Chyn268a96c2017-06-17 17:32:49 -0700483 * Activity Action: Show settings to allow configuration of Assist Gesture.
484 * <p>
485 * In some cases, a matching Activity may not exist, so ensure you
486 * safeguard against this.
487 * <p>
488 * Input: Nothing.
489 * <p>
490 * Output: Nothing.
491 * @hide
492 */
493 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
494 public static final String ACTION_ASSIST_GESTURE_SETTINGS =
495 "android.settings.ASSIST_GESTURE_SETTINGS";
496
497 /**
Kevin Chyn83ff28c2017-10-13 16:35:17 -0700498 * Activity Action: Show settings to enroll fingerprints, and setup PIN/Pattern/Pass if
499 * necessary.
500 * <p>
501 * Input: Nothing.
502 * <p>
503 * Output: Nothing.
504 */
505 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
506 public static final String ACTION_FINGERPRINT_ENROLL =
507 "android.settings.FINGERPRINT_ENROLL";
508
509 /**
Jeff Brownc05c1ae2015-05-05 13:46:30 -0700510 * Activity Action: Show settings to allow configuration of cast endpoints.
Jeff Brown1a937b02014-07-01 22:13:04 -0700511 * <p>
512 * In some cases, a matching Activity may not exist, so ensure you
513 * safeguard against this.
514 * <p>
515 * Input: Nothing.
516 * <p>
517 * Output: Nothing.
518 */
519 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
520 public static final String ACTION_CAST_SETTINGS =
521 "android.settings.CAST_SETTINGS";
522
523 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800524 * Activity Action: Show settings to allow configuration of date and time.
525 * <p>
526 * In some cases, a matching Activity may not exist, so ensure you
527 * safeguard against this.
528 * <p>
529 * Input: Nothing.
530 * <p>
531 * Output: Nothing.
532 */
533 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
534 public static final String ACTION_DATE_SETTINGS =
535 "android.settings.DATE_SETTINGS";
536
537 /**
538 * Activity Action: Show settings to allow configuration of sound and volume.
539 * <p>
540 * In some cases, a matching Activity may not exist, so ensure you
541 * safeguard against this.
542 * <p>
543 * Input: Nothing.
544 * <p>
545 * Output: Nothing.
546 */
547 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
548 public static final String ACTION_SOUND_SETTINGS =
549 "android.settings.SOUND_SETTINGS";
550
551 /**
552 * Activity Action: Show settings to allow configuration of display.
553 * <p>
554 * In some cases, a matching Activity may not exist, so ensure you
555 * safeguard against this.
556 * <p>
557 * Input: Nothing.
558 * <p>
559 * Output: Nothing.
560 */
561 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
562 public static final String ACTION_DISPLAY_SETTINGS =
563 "android.settings.DISPLAY_SETTINGS";
564
565 /**
Justin Klaassen06c0cb72016-07-21 19:22:09 -0700566 * Activity Action: Show settings to allow configuration of Night display.
567 * <p>
568 * In some cases, a matching Activity may not exist, so ensure you
569 * safeguard against this.
570 * <p>
571 * Input: Nothing.
572 * <p>
573 * Output: Nothing.
Justin Klaassen06c0cb72016-07-21 19:22:09 -0700574 */
575 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
576 public static final String ACTION_NIGHT_DISPLAY_SETTINGS =
577 "android.settings.NIGHT_DISPLAY_SETTINGS";
578
579 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800580 * Activity Action: Show settings to allow configuration of locale.
581 * <p>
582 * In some cases, a matching Activity may not exist, so ensure you
583 * safeguard against this.
584 * <p>
585 * Input: Nothing.
586 * <p>
587 * Output: Nothing.
588 */
589 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
590 public static final String ACTION_LOCALE_SETTINGS =
591 "android.settings.LOCALE_SETTINGS";
592
593 /**
594 * Activity Action: Show settings to configure input methods, in particular
595 * allowing the user to enable input methods.
596 * <p>
597 * In some cases, a matching Activity may not exist, so ensure you
598 * safeguard against this.
599 * <p>
600 * Input: Nothing.
601 * <p>
602 * Output: Nothing.
603 */
604 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
Dianne Hackborna3fb40d2014-08-12 15:06:50 -0700605 public static final String ACTION_VOICE_INPUT_SETTINGS =
606 "android.settings.VOICE_INPUT_SETTINGS";
607
608 /**
609 * Activity Action: Show settings to configure input methods, in particular
610 * allowing the user to enable input methods.
611 * <p>
612 * In some cases, a matching Activity may not exist, so ensure you
613 * safeguard against this.
614 * <p>
615 * Input: Nothing.
616 * <p>
617 * Output: Nothing.
618 */
619 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800620 public static final String ACTION_INPUT_METHOD_SETTINGS =
621 "android.settings.INPUT_METHOD_SETTINGS";
622
623 /**
Tadashi G. Takaokaf49688f2011-01-20 17:56:13 +0900624 * Activity Action: Show settings to enable/disable input method subtypes.
satok86417ea2010-10-27 14:11:03 +0900625 * <p>
626 * In some cases, a matching Activity may not exist, so ensure you
627 * safeguard against this.
628 * <p>
Tadashi G. Takaoka25480202011-01-20 23:13:02 +0900629 * To tell which input method's subtypes are displayed in the settings, add
630 * {@link #EXTRA_INPUT_METHOD_ID} extra to this Intent with the input method id.
631 * If there is no extra in this Intent, subtypes from all installed input methods
632 * will be displayed in the settings.
633 *
634 * @see android.view.inputmethod.InputMethodInfo#getId
635 * <p>
satok86417ea2010-10-27 14:11:03 +0900636 * Input: Nothing.
637 * <p>
638 * Output: Nothing.
639 */
640 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
Tadashi G. Takaokaf49688f2011-01-20 17:56:13 +0900641 public static final String ACTION_INPUT_METHOD_SUBTYPE_SETTINGS =
642 "android.settings.INPUT_METHOD_SUBTYPE_SETTINGS";
satok86417ea2010-10-27 14:11:03 +0900643
644 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800645 * Activity Action: Show settings to manage the user input dictionary.
646 * <p>
Chet Haasee8222dd2013-09-05 07:44:18 -0700647 * Starting with {@link android.os.Build.VERSION_CODES#KITKAT},
Satoshi Kataoka2aa2bc52013-07-30 14:25:11 +0900648 * it is guaranteed there will always be an appropriate implementation for this Intent action.
649 * 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 -0800650 * <p>
651 * Input: Nothing.
652 * <p>
653 * Output: Nothing.
654 */
655 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
656 public static final String ACTION_USER_DICTIONARY_SETTINGS =
657 "android.settings.USER_DICTIONARY_SETTINGS";
658
659 /**
Abodunrinwa Toki07177142016-03-22 16:25:48 +0000660 * Activity Action: Show settings to configure the hardware keyboard.
Yohei Yukawad8701bf2016-01-27 16:15:01 -0800661 * <p>
662 * In some cases, a matching Activity may not exist, so ensure you
663 * safeguard against this.
664 * <p>
Yohei Yukawad8701bf2016-01-27 16:15:01 -0800665 * Input: Nothing.
666 * <p>
667 * Output: Nothing.
668 */
669 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
Abodunrinwa Toki07177142016-03-22 16:25:48 +0000670 public static final String ACTION_HARD_KEYBOARD_SETTINGS =
671 "android.settings.HARD_KEYBOARD_SETTINGS";
Yohei Yukawad8701bf2016-01-27 16:15:01 -0800672
673 /**
Gilles Debunnee90bed12011-08-30 14:28:27 -0700674 * Activity Action: Adds a word to the user dictionary.
675 * <p>
676 * In some cases, a matching Activity may not exist, so ensure you
677 * safeguard against this.
678 * <p>
679 * Input: An extra with key <code>word</code> that contains the word
680 * that should be added to the dictionary.
681 * <p>
682 * Output: Nothing.
683 *
684 * @hide
685 */
686 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
687 public static final String ACTION_USER_DICTIONARY_INSERT =
688 "com.android.settings.USER_DICTIONARY_INSERT";
689
690 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800691 * Activity Action: Show settings to allow configuration of application-related settings.
692 * <p>
693 * In some cases, a matching Activity may not exist, so ensure you
694 * safeguard against this.
695 * <p>
696 * Input: Nothing.
697 * <p>
698 * Output: Nothing.
699 */
700 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
701 public static final String ACTION_APPLICATION_SETTINGS =
702 "android.settings.APPLICATION_SETTINGS";
703
704 /**
705 * Activity Action: Show settings to allow configuration of application
Dianne Hackborn8d866e52012-10-10 18:39:45 -0700706 * development-related settings. As of
707 * {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1} this action is
708 * a required part of the platform.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800709 * <p>
710 * Input: Nothing.
711 * <p>
712 * Output: Nothing.
713 */
714 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
715 public static final String ACTION_APPLICATION_DEVELOPMENT_SETTINGS =
716 "android.settings.APPLICATION_DEVELOPMENT_SETTINGS";
717
718 /**
719 * Activity Action: Show settings to allow configuration of quick launch shortcuts.
720 * <p>
721 * In some cases, a matching Activity may not exist, so ensure you
722 * safeguard against this.
723 * <p>
724 * Input: Nothing.
725 * <p>
726 * Output: Nothing.
727 */
728 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
729 public static final String ACTION_QUICK_LAUNCH_SETTINGS =
730 "android.settings.QUICK_LAUNCH_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700731
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800732 /**
733 * Activity Action: Show settings to manage installed applications.
734 * <p>
735 * In some cases, a matching Activity may not exist, so ensure you
736 * safeguard against this.
737 * <p>
738 * Input: Nothing.
739 * <p>
740 * Output: Nothing.
741 */
742 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
743 public static final String ACTION_MANAGE_APPLICATIONS_SETTINGS =
744 "android.settings.MANAGE_APPLICATIONS_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700745
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800746 /**
Winson Chung44e8ff92010-09-27 14:36:52 -0700747 * Activity Action: Show settings to manage all applications.
748 * <p>
749 * In some cases, a matching Activity may not exist, so ensure you
750 * safeguard against this.
751 * <p>
752 * Input: Nothing.
753 * <p>
754 * Output: Nothing.
755 */
756 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
757 public static final String ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS =
758 "android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS";
759
760 /**
Billy Lau6ad2d662015-07-18 00:26:58 +0100761 * Activity Action: Show screen for controlling which apps can draw on top of other apps.
Billy Laucbe540f2015-06-25 01:51:44 +0100762 * <p>
763 * In some cases, a matching Activity may not exist, so ensure you
764 * safeguard against this.
765 * <p>
Billy Lau6ad2d662015-07-18 00:26:58 +0100766 * Input: Optionally, the Intent's data URI can specify the application package name to
767 * directly invoke the management GUI specific to the package name. For example
768 * "package:com.my.app".
Billy Laucbe540f2015-06-25 01:51:44 +0100769 * <p>
770 * Output: Nothing.
771 */
772 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
773 public static final String ACTION_MANAGE_OVERLAY_PERMISSION =
Billy Lau22b3f4c2015-07-08 00:31:01 +0100774 "android.settings.action.MANAGE_OVERLAY_PERMISSION";
775
776 /**
Billy Lau6ad2d662015-07-18 00:26:58 +0100777 * Activity Action: Show screen for controlling which apps are allowed to write/modify
778 * system settings.
Billy Lau22b3f4c2015-07-08 00:31:01 +0100779 * <p>
780 * In some cases, a matching Activity may not exist, so ensure you
781 * safeguard against this.
782 * <p>
Billy Lau6ad2d662015-07-18 00:26:58 +0100783 * Input: Optionally, the Intent's data URI can specify the application package name to
784 * directly invoke the management GUI specific to the package name. For example
785 * "package:com.my.app".
Billy Lau22b3f4c2015-07-08 00:31:01 +0100786 * <p>
787 * Output: Nothing.
788 */
789 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
790 public static final String ACTION_MANAGE_WRITE_SETTINGS =
791 "android.settings.action.MANAGE_WRITE_SETTINGS";
Billy Laucbe540f2015-06-25 01:51:44 +0100792
793 /**
Dianne Hackbornb7bb3b32010-06-06 22:47:50 -0700794 * Activity Action: Show screen of details about a particular application.
795 * <p>
796 * In some cases, a matching Activity may not exist, so ensure you
797 * safeguard against this.
798 * <p>
799 * Input: The Intent's data URI specifies the application package name
800 * to be shown, with the "package" scheme. That is "package:com.my.app".
801 * <p>
802 * Output: Nothing.
803 */
804 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
805 public static final String ACTION_APPLICATION_DETAILS_SETTINGS =
806 "android.settings.APPLICATION_DETAILS_SETTINGS";
807
808 /**
Ben Lin296f80a2018-02-27 15:23:38 -0800809 * Activity Action: Show the "Open by Default" page in a particular application's details page.
810 * <p>
811 * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
812 * <p>
813 * Input: The Intent's data URI specifies the application package name
814 * to be shown, with the "package" scheme. That is "package:com.my.app".
815 * <p>
816 * Output: Nothing.
817 * @hide
818 */
819 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
820 public static final String ACTION_APPLICATION_DETAILS_SETTINGS_OPEN_BY_DEFAULT_PAGE =
821 "android.settings.APPLICATION_DETAILS_SETTINGS_OPEN_BY_DEFAULT_PAGE";
822
823 /**
Dianne Hackborn83b40f62017-04-26 13:59:47 -0700824 * Activity Action: Show list of applications that have been running
825 * foreground services (to the user "running in the background").
826 * <p>
827 * Input: Extras "packages" is a string array of package names.
828 * <p>
829 * Output: Nothing.
830 * @hide
831 */
832 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
833 public static final String ACTION_FOREGROUND_SERVICES_SETTINGS =
834 "android.settings.FOREGROUND_SERVICES_SETTINGS";
835
836 /**
Jason Monk287b8892015-06-10 10:39:23 -0400837 * Activity Action: Show screen for controlling which apps can ignore battery optimizations.
838 * <p>
Dianne Hackbornc7b57b12015-08-10 14:52:52 -0700839 * Input: Nothing.
840 * <p>
841 * Output: Nothing.
842 * <p>
843 * You can use {@link android.os.PowerManager#isIgnoringBatteryOptimizations
844 * PowerManager.isIgnoringBatteryOptimizations()} to determine if an application is
845 * already ignoring optimizations. You can use
846 * {@link #ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS} to ask the user to put you
847 * on this list.
848 */
849 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
850 public static final String ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS =
851 "android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS";
852
853 /**
Felipe Leme5f5d7072016-01-27 10:41:22 -0800854 * Activity Action: Ask the user to allow an app to ignore battery optimizations (that is,
Dianne Hackbornc7b57b12015-08-10 14:52:52 -0700855 * put them on the whitelist of apps shown by
856 * {@link #ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS}). For an app to use this, it also
857 * must hold the {@link android.Manifest.permission#REQUEST_IGNORE_BATTERY_OPTIMIZATIONS}
858 * permission.
859 * <p><b>Note:</b> most applications should <em>not</em> use this; there are many facilities
860 * provided by the platform for applications to operate correctly in the various power
Felipe Leme5f5d7072016-01-27 10:41:22 -0800861 * saving modes. This is only for unusual applications that need to deeply control their own
Dianne Hackbornc7b57b12015-08-10 14:52:52 -0700862 * execution, at the potential expense of the user's battery life. Note that these applications
Kweku Adamseb80f7c2016-01-12 11:46:52 -0800863 * greatly run the risk of showing to the user as high power consumers on their device.</p>
Dianne Hackbornc7b57b12015-08-10 14:52:52 -0700864 * <p>
865 * Input: The Intent's data URI must specify the application package name
Jason Monk287b8892015-06-10 10:39:23 -0400866 * to be shown, with the "package" scheme. That is "package:com.my.app".
867 * <p>
868 * Output: Nothing.
Dianne Hackborn1958e5e2015-06-12 18:11:41 -0700869 * <p>
870 * You can use {@link android.os.PowerManager#isIgnoringBatteryOptimizations
871 * PowerManager.isIgnoringBatteryOptimizations()} to determine if an application is
872 * already ignoring optimizations.
Jason Monk287b8892015-06-10 10:39:23 -0400873 */
874 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
Dianne Hackbornc7b57b12015-08-10 14:52:52 -0700875 public static final String ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS =
876 "android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS";
Jason Monk287b8892015-06-10 10:39:23 -0400877
878 /**
Felipe Leme2850b562016-04-21 17:58:47 -0700879 * Activity Action: Show screen for controlling background data
880 * restrictions for a particular application.
Felipe Leme5f5d7072016-01-27 10:41:22 -0800881 * <p>
Felipe Leme2850b562016-04-21 17:58:47 -0700882 * Input: Intent's data URI set with an application name, using the
883 * "package" schema (like "package:com.my.app").
884 *
Felipe Leme5f5d7072016-01-27 10:41:22 -0800885 * <p>
886 * Output: Nothing.
887 * <p>
888 * Applications can also use {@link android.net.ConnectivityManager#getRestrictBackgroundStatus
Felipe Leme2850b562016-04-21 17:58:47 -0700889 * ConnectivityManager#getRestrictBackgroundStatus()} to determine the
890 * status of the background data restrictions for them.
Christopher Tate72da1e62018-05-10 13:09:48 -0700891 *
892 * <p class="note">
893 * In some cases, a matching Activity may not exist, so ensure you
894 * safeguard against this.
Felipe Leme5f5d7072016-01-27 10:41:22 -0800895 */
896 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
897 public static final String ACTION_IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS =
898 "android.settings.IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS";
899
900 /**
Dianne Hackborn35654b62013-01-14 17:38:02 -0800901 * @hide
902 * Activity Action: Show the "app ops" settings screen.
903 * <p>
904 * Input: Nothing.
905 * <p>
906 * Output: Nothing.
907 */
908 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
909 public static final String ACTION_APP_OPS_SETTINGS =
910 "android.settings.APP_OPS_SETTINGS";
911
912 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800913 * Activity Action: Show settings for system update functionality.
914 * <p>
915 * In some cases, a matching Activity may not exist, so ensure you
916 * safeguard against this.
917 * <p>
918 * Input: Nothing.
919 * <p>
920 * Output: Nothing.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700921 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800922 * @hide
923 */
924 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
925 public static final String ACTION_SYSTEM_UPDATE_SETTINGS =
926 "android.settings.SYSTEM_UPDATE_SETTINGS";
927
928 /**
Ricky Wai38bb8322017-02-01 15:23:50 +0000929 * Activity Action: Show settings for managed profile settings.
930 * <p>
931 * In some cases, a matching Activity may not exist, so ensure you
932 * safeguard against this.
933 * <p>
934 * Input: Nothing.
935 * <p>
936 * Output: Nothing.
937 *
938 * @hide
939 */
940 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
941 public static final String ACTION_MANAGED_PROFILE_SETTINGS =
942 "android.settings.MANAGED_PROFILE_SETTINGS";
943
944 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800945 * Activity Action: Show settings to allow configuration of sync settings.
946 * <p>
947 * In some cases, a matching Activity may not exist, so ensure you
948 * safeguard against this.
949 * <p>
Erikeebc8e22010-02-18 13:27:19 -0800950 * The account types available to add via the add account button may be restricted by adding an
951 * {@link #EXTRA_AUTHORITIES} extra to this Intent with one or more syncable content provider's
952 * authorities. Only account types which can sync with that content provider will be offered to
953 * the user.
954 * <p>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800955 * Input: Nothing.
956 * <p>
957 * Output: Nothing.
958 */
959 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
960 public static final String ACTION_SYNC_SETTINGS =
961 "android.settings.SYNC_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700962
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800963 /**
Erikeebc8e22010-02-18 13:27:19 -0800964 * Activity Action: Show add account screen for creating a new account.
965 * <p>
966 * In some cases, a matching Activity may not exist, so ensure you
967 * safeguard against this.
968 * <p>
969 * The account types available to add may be restricted by adding an {@link #EXTRA_AUTHORITIES}
970 * extra to the Intent with one or more syncable content provider's authorities. Only account
971 * types which can sync with that content provider will be offered to the user.
972 * <p>
Alon Albert50359c22013-02-26 14:47:48 -0800973 * Account types can also be filtered by adding an {@link #EXTRA_ACCOUNT_TYPES} extra to the
974 * Intent with one or more account types.
975 * <p>
Erikeebc8e22010-02-18 13:27:19 -0800976 * Input: Nothing.
977 * <p>
978 * Output: Nothing.
979 */
980 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
981 public static final String ACTION_ADD_ACCOUNT =
982 "android.settings.ADD_ACCOUNT_SETTINGS";
983
984 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800985 * Activity Action: Show settings for selecting the network operator.
986 * <p>
987 * In some cases, a matching Activity may not exist, so ensure you
988 * safeguard against this.
989 * <p>
Jeff Davidsonf32f7b42017-11-03 15:05:07 -0700990 * The subscription ID of the subscription for which available network operators should be
991 * displayed may be optionally specified with {@link #EXTRA_SUB_ID}.
992 * <p>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800993 * Input: Nothing.
994 * <p>
995 * Output: Nothing.
996 */
997 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
998 public static final String ACTION_NETWORK_OPERATOR_SETTINGS =
999 "android.settings.NETWORK_OPERATOR_SETTINGS";
1000
1001 /**
1002 * Activity Action: Show settings for selection of 2G/3G.
1003 * <p>
1004 * In some cases, a matching Activity may not exist, so ensure you
1005 * safeguard against this.
1006 * <p>
1007 * Input: Nothing.
1008 * <p>
1009 * Output: Nothing.
1010 */
1011 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1012 public static final String ACTION_DATA_ROAMING_SETTINGS =
1013 "android.settings.DATA_ROAMING_SETTINGS";
1014
1015 /**
1016 * Activity Action: Show settings for internal storage.
1017 * <p>
1018 * In some cases, a matching Activity may not exist, so ensure you
1019 * safeguard against this.
1020 * <p>
1021 * Input: Nothing.
1022 * <p>
1023 * Output: Nothing.
1024 */
1025 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1026 public static final String ACTION_INTERNAL_STORAGE_SETTINGS =
1027 "android.settings.INTERNAL_STORAGE_SETTINGS";
1028 /**
1029 * Activity Action: Show settings for memory card storage.
1030 * <p>
1031 * In some cases, a matching Activity may not exist, so ensure you
1032 * safeguard against this.
1033 * <p>
1034 * Input: Nothing.
1035 * <p>
1036 * Output: Nothing.
1037 */
1038 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1039 public static final String ACTION_MEMORY_CARD_SETTINGS =
1040 "android.settings.MEMORY_CARD_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001041
Justin Mattsonef340352010-01-13 21:05:46 -08001042 /**
1043 * Activity Action: Show settings for global search.
1044 * <p>
1045 * In some cases, a matching Activity may not exist, so ensure you
1046 * safeguard against this.
1047 * <p>
1048 * Input: Nothing.
1049 * <p>
1050 * Output: Nothing
1051 */
1052 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1053 public static final String ACTION_SEARCH_SETTINGS =
1054 "android.search.action.SEARCH_SETTINGS";
1055
Daniel Sandler9d8b8762010-01-22 20:50:15 -05001056 /**
1057 * Activity Action: Show general device information settings (serial
1058 * number, software version, phone number, etc.).
1059 * <p>
1060 * In some cases, a matching Activity may not exist, so ensure you
1061 * safeguard against this.
1062 * <p>
1063 * Input: Nothing.
1064 * <p>
1065 * Output: Nothing
1066 */
1067 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1068 public static final String ACTION_DEVICE_INFO_SETTINGS =
1069 "android.settings.DEVICE_INFO_SETTINGS";
1070
Martijn Coenen9b3c83f2011-07-28 11:21:39 -05001071 /**
Nick Pellycccf01d2011-10-31 14:49:40 -07001072 * Activity Action: Show NFC settings.
1073 * <p>
1074 * This shows UI that allows NFC to be turned on or off.
Martijn Coenen9b3c83f2011-07-28 11:21:39 -05001075 * <p>
1076 * In some cases, a matching Activity may not exist, so ensure you
1077 * safeguard against this.
1078 * <p>
1079 * Input: Nothing.
1080 * <p>
1081 * Output: Nothing
Nick Pellycccf01d2011-10-31 14:49:40 -07001082 * @see android.nfc.NfcAdapter#isEnabled()
1083 */
1084 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1085 public static final String ACTION_NFC_SETTINGS = "android.settings.NFC_SETTINGS";
1086
1087 /**
1088 * Activity Action: Show NFC Sharing settings.
1089 * <p>
1090 * This shows UI that allows NDEF Push (Android Beam) to be turned on or
1091 * off.
1092 * <p>
1093 * In some cases, a matching Activity may not exist, so ensure you
1094 * safeguard against this.
1095 * <p>
1096 * Input: Nothing.
1097 * <p>
1098 * Output: Nothing
1099 * @see android.nfc.NfcAdapter#isNdefPushEnabled()
Martijn Coenen9b3c83f2011-07-28 11:21:39 -05001100 */
1101 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1102 public static final String ACTION_NFCSHARING_SETTINGS =
1103 "android.settings.NFCSHARING_SETTINGS";
1104
Daniel Sandlerc08cd022012-11-27 22:47:37 -05001105 /**
Martijn Coenen62c196a2013-08-09 13:43:34 -07001106 * Activity Action: Show NFC Tap & Pay settings
1107 * <p>
1108 * This shows UI that allows the user to configure Tap&Pay
1109 * settings.
1110 * <p>
1111 * In some cases, a matching Activity may not exist, so ensure you
1112 * safeguard against this.
1113 * <p>
1114 * Input: Nothing.
1115 * <p>
1116 * Output: Nothing
1117 */
1118 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1119 public static final String ACTION_NFC_PAYMENT_SETTINGS =
1120 "android.settings.NFC_PAYMENT_SETTINGS";
1121
1122 /**
Daniel Sandlerc08cd022012-11-27 22:47:37 -05001123 * Activity Action: Show Daydream settings.
1124 * <p>
1125 * In some cases, a matching Activity may not exist, so ensure you
1126 * safeguard against this.
1127 * <p>
1128 * Input: Nothing.
1129 * <p>
1130 * Output: Nothing.
1131 * @see android.service.dreams.DreamService
Daniel Sandlerc08cd022012-11-27 22:47:37 -05001132 */
1133 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1134 public static final String ACTION_DREAM_SETTINGS = "android.settings.DREAM_SETTINGS";
1135
Daniel Sandler5feceeb2013-03-22 18:29:23 -07001136 /**
1137 * Activity Action: Show Notification listener settings.
1138 * <p>
1139 * In some cases, a matching Activity may not exist, so ensure you
1140 * safeguard against this.
1141 * <p>
1142 * Input: Nothing.
1143 * <p>
1144 * Output: Nothing.
1145 * @see android.service.notification.NotificationListenerService
Daniel Sandler5feceeb2013-03-22 18:29:23 -07001146 */
1147 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1148 public static final String ACTION_NOTIFICATION_LISTENER_SETTINGS
Chris Wren8326a8a2014-10-22 14:13:32 -04001149 = "android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS";
Daniel Sandler5feceeb2013-03-22 18:29:23 -07001150
Alan Viverette69ce69b2013-08-29 12:23:48 -07001151 /**
John Spurlock80774932015-05-07 17:38:50 -04001152 * Activity Action: Show Do Not Disturb access settings.
1153 * <p>
John Spurlock7c74f782015-06-04 13:01:42 -04001154 * Users can grant and deny access to Do Not Disturb configuration from here.
1155 * See {@link android.app.NotificationManager#isNotificationPolicyAccessGranted()} for more
1156 * details.
John Spurlock80774932015-05-07 17:38:50 -04001157 * <p>
1158 * Input: Nothing.
1159 * <p>
1160 * Output: Nothing.
Christopher Tate72da1e62018-05-10 13:09:48 -07001161 *
1162 * <p class="note">
1163 * In some cases, a matching Activity may not exist, so ensure you
1164 * safeguard against this.
John Spurlock80774932015-05-07 17:38:50 -04001165 */
1166 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
John Spurlock7c74f782015-06-04 13:01:42 -04001167 public static final String ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS
1168 = "android.settings.NOTIFICATION_POLICY_ACCESS_SETTINGS";
John Spurlock80774932015-05-07 17:38:50 -04001169
1170 /**
John Spurlock7340fc82014-04-24 18:50:12 -04001171 * @hide
1172 */
1173 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1174 public static final String ACTION_CONDITION_PROVIDER_SETTINGS
1175 = "android.settings.ACTION_CONDITION_PROVIDER_SETTINGS";
1176
1177 /**
Alan Viverette69ce69b2013-08-29 12:23:48 -07001178 * Activity Action: Show settings for video captioning.
1179 * <p>
1180 * In some cases, a matching Activity may not exist, so ensure you safeguard
1181 * against this.
1182 * <p>
1183 * Input: Nothing.
1184 * <p>
1185 * Output: Nothing.
1186 */
1187 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1188 public static final String ACTION_CAPTIONING_SETTINGS = "android.settings.CAPTIONING_SETTINGS";
1189
Svetoslav773f54d2013-09-03 14:01:43 -07001190 /**
1191 * Activity Action: Show the top level print settings.
1192 * <p>
1193 * In some cases, a matching Activity may not exist, so ensure you
1194 * safeguard against this.
1195 * <p>
1196 * Input: Nothing.
1197 * <p>
1198 * Output: Nothing.
1199 */
1200 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1201 public static final String ACTION_PRINT_SETTINGS =
1202 "android.settings.ACTION_PRINT_SETTINGS";
1203
John Spurlockde547002014-02-28 17:50:39 -05001204 /**
1205 * Activity Action: Show Zen Mode configuration settings.
1206 *
1207 * @hide
1208 */
1209 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1210 public static final String ACTION_ZEN_MODE_SETTINGS = "android.settings.ZEN_MODE_SETTINGS";
1211
Santos Cordona4c75242014-07-09 12:07:51 -07001212 /**
Julia Reynolds9aa1c9e2018-04-09 11:31:15 -04001213 * Activity Action: Show Zen Mode visual effects configuration settings.
1214 *
1215 * @hide
1216 */
1217 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1218 public static final String ZEN_MODE_BLOCKED_EFFECTS_SETTINGS =
1219 "android.settings.ZEN_MODE_BLOCKED_EFFECTS_SETTINGS";
1220
1221 /**
1222 * Activity Action: Show Zen Mode onboarding activity.
1223 *
1224 * @hide
1225 */
1226 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1227 public static final String ZEN_MODE_ONBOARDING = "android.settings.ZEN_MODE_ONBOARDING";
1228
1229 /**
Julia Reynoldsa11d0b12017-02-16 15:01:36 -05001230 * Activity Action: Show Zen Mode (aka Do Not Disturb) priority configuration settings.
John Spurlockfc746f82015-04-03 13:47:14 -04001231 */
1232 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1233 public static final String ACTION_ZEN_MODE_PRIORITY_SETTINGS
1234 = "android.settings.ZEN_MODE_PRIORITY_SETTINGS";
1235
1236 /**
John Spurlock7af10182015-04-03 15:10:31 -04001237 * Activity Action: Show Zen Mode automation configuration settings.
1238 *
1239 * @hide
1240 */
1241 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1242 public static final String ACTION_ZEN_MODE_AUTOMATION_SETTINGS
1243 = "android.settings.ZEN_MODE_AUTOMATION_SETTINGS";
1244
1245 /**
Barnaby Jamesb3006d32015-04-02 17:49:54 -07001246 * Activity Action: Modify do not disturb mode settings.
1247 * <p>
1248 * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
1249 * <p>
1250 * This intent MUST be started using
1251 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
1252 * startVoiceActivity}.
1253 * <p>
1254 * Note: The Activity implementing this intent MUST verify that
1255 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction}.
1256 * returns true before modifying the setting.
1257 * <p>
1258 * Input: The optional {@link #EXTRA_DO_NOT_DISTURB_MODE_MINUTES} extra can be used to indicate
1259 * how long the user wishes to avoid interruptions for. The optional
1260 * {@link #EXTRA_DO_NOT_DISTURB_MODE_ENABLED} extra can be to indicate if the user is
1261 * enabling or disabling do not disturb mode. If either extra is not included, the
1262 * user maybe asked to provide the value.
1263 * <p>
1264 * Output: Nothing.
1265 */
1266 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1267 public static final String ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE =
1268 "android.settings.VOICE_CONTROL_DO_NOT_DISTURB_MODE";
1269
1270 /**
John Spurlockb2278d62015-04-07 12:47:12 -04001271 * Activity Action: Show Zen Mode schedule rule configuration settings.
1272 *
1273 * @hide
1274 */
1275 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1276 public static final String ACTION_ZEN_MODE_SCHEDULE_RULE_SETTINGS
1277 = "android.settings.ZEN_MODE_SCHEDULE_RULE_SETTINGS";
1278
1279 /**
John Spurlockd60258f2015-04-30 09:30:52 -04001280 * Activity Action: Show Zen Mode event rule configuration settings.
1281 *
1282 * @hide
1283 */
1284 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1285 public static final String ACTION_ZEN_MODE_EVENT_RULE_SETTINGS
1286 = "android.settings.ZEN_MODE_EVENT_RULE_SETTINGS";
1287
1288 /**
John Spurlock39581cc2015-04-10 11:59:01 -04001289 * Activity Action: Show Zen Mode external rule configuration settings.
1290 *
1291 * @hide
1292 */
1293 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1294 public static final String ACTION_ZEN_MODE_EXTERNAL_RULE_SETTINGS
1295 = "android.settings.ZEN_MODE_EXTERNAL_RULE_SETTINGS";
1296
1297 /**
Santos Cordona4c75242014-07-09 12:07:51 -07001298 * Activity Action: Show the regulatory information screen for the device.
1299 * <p>
1300 * In some cases, a matching Activity may not exist, so ensure you safeguard
1301 * against this.
1302 * <p>
1303 * Input: Nothing.
1304 * <p>
1305 * Output: Nothing.
1306 */
Jeff Sharkeydd77fda2014-04-16 17:23:08 -07001307 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1308 public static final String
1309 ACTION_SHOW_REGULATORY_INFO = "android.settings.SHOW_REGULATORY_INFO";
1310
Jerome Poichet7974cb32014-05-14 12:04:43 -07001311 /**
1312 * Activity Action: Show Device Name Settings.
1313 * <p>
1314 * In some cases, a matching Activity may not exist, so ensure you safeguard
Tim Kilbourn87cd0dc2014-04-14 15:37:51 -07001315 * against this.
Jerome Poichet7974cb32014-05-14 12:04:43 -07001316 *
1317 * @hide
1318 */
1319 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1320 public static final String DEVICE_NAME_SETTINGS = "android.settings.DEVICE_NAME";
1321
Tim Kilbourn87cd0dc2014-04-14 15:37:51 -07001322 /**
1323 * Activity Action: Show pairing settings.
1324 * <p>
1325 * In some cases, a matching Activity may not exist, so ensure you safeguard
1326 * against this.
1327 *
1328 * @hide
1329 */
1330 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1331 public static final String ACTION_PAIRING_SETTINGS = "android.settings.PAIRING_SETTINGS";
1332
John Spurlockf8f524c2014-06-10 14:47:29 -04001333 /**
1334 * Activity Action: Show battery saver settings.
John Spurlock73466662014-10-30 13:42:05 -04001335 * <p>
1336 * In some cases, a matching Activity may not exist, so ensure you safeguard
1337 * against this.
John Spurlockf8f524c2014-06-10 14:47:29 -04001338 */
1339 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1340 public static final String ACTION_BATTERY_SAVER_SETTINGS
1341 = "android.settings.BATTERY_SAVER_SETTINGS";
1342
Amith Yamasanieb7b94a2014-07-14 18:02:08 -07001343 /**
Barnaby Jamesb3006d32015-04-02 17:49:54 -07001344 * Activity Action: Modify Battery Saver mode setting using a voice command.
1345 * <p>
1346 * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
1347 * <p>
1348 * This intent MUST be started using
1349 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
1350 * startVoiceActivity}.
1351 * <p>
1352 * Note: The activity implementing this intent MUST verify that
1353 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before
1354 * modifying the setting.
1355 * <p>
1356 * Input: To tell which state batter saver mode should be set to, add the
1357 * {@link #EXTRA_BATTERY_SAVER_MODE_ENABLED} extra to this Intent with the state specified.
1358 * If the extra is not included, no changes will be made.
1359 * <p>
1360 * Output: Nothing.
1361 */
1362 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1363 public static final String ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE =
1364 "android.settings.VOICE_CONTROL_BATTERY_SAVER_MODE";
1365
1366 /**
Amith Yamasanieb7b94a2014-07-14 18:02:08 -07001367 * Activity Action: Show Home selection settings. If there are multiple activities
1368 * that can satisfy the {@link Intent#CATEGORY_HOME} intent, this screen allows you
1369 * to pick your preferred activity.
1370 */
1371 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1372 public static final String ACTION_HOME_SETTINGS
1373 = "android.settings.HOME_SETTINGS";
1374
Julia Reynolds7eba5932015-12-11 16:40:39 -05001375 /**
1376 * Activity Action: Show Default apps settings.
1377 * <p>
1378 * In some cases, a matching Activity may not exist, so ensure you
1379 * safeguard against this.
1380 * <p>
1381 * Input: Nothing.
1382 * <p>
1383 * Output: Nothing.
1384 */
1385 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1386 public static final String ACTION_MANAGE_DEFAULT_APPS_SETTINGS
1387 = "android.settings.MANAGE_DEFAULT_APPS_SETTINGS";
1388
John Spurlock2b0e09c2014-07-27 13:27:47 -04001389 /**
1390 * Activity Action: Show notification settings.
1391 *
1392 * @hide
1393 */
1394 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1395 public static final String ACTION_NOTIFICATION_SETTINGS
1396 = "android.settings.NOTIFICATION_SETTINGS";
1397
1398 /**
Julia Reynoldsed1c9af2018-03-21 15:21:09 -04001399 * Activity Action: Show app listing settings, filtered by those that send notifications.
1400 *
1401 * @hide
1402 */
1403 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1404 public static final String ACTION_ALL_APPS_NOTIFICATION_SETTINGS =
1405 "android.settings.ALL_APPS_NOTIFICATION_SETTINGS";
1406
1407 /**
John Spurlock2b0e09c2014-07-27 13:27:47 -04001408 * Activity Action: Show notification settings for a single app.
Jeff Schumacherdc530092017-01-25 18:51:22 -08001409 * <p>
Julia Reynoldsed1c9af2018-03-21 15:21:09 -04001410 * Input: {@link #EXTRA_APP_PACKAGE}, the package to display.
Jeff Schumacherdc530092017-01-25 18:51:22 -08001411 * <p>
1412 * Output: Nothing.
John Spurlock2b0e09c2014-07-27 13:27:47 -04001413 */
1414 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1415 public static final String ACTION_APP_NOTIFICATION_SETTINGS
1416 = "android.settings.APP_NOTIFICATION_SETTINGS";
1417
Chris Wrencd8f4f72014-08-27 18:48:13 -04001418 /**
Julia Reynolds9ba0c612017-01-25 10:31:34 -05001419 * Activity Action: Show notification settings for a single {@link NotificationChannel}.
1420 * <p>
Julia Reynolds9ba0c612017-01-25 10:31:34 -05001421 * Input: {@link #EXTRA_APP_PACKAGE}, the package containing the channel to display.
1422 * Input: {@link #EXTRA_CHANNEL_ID}, the id of the channel to display.
1423 * <p>
1424 * Output: Nothing.
1425 */
1426 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1427 public static final String ACTION_CHANNEL_NOTIFICATION_SETTINGS
1428 = "android.settings.CHANNEL_NOTIFICATION_SETTINGS";
1429
1430 /**
1431 * Activity Extra: The package owner of the notification channel settings to display.
1432 * <p>
1433 * This must be passed as an extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}.
1434 */
1435 public static final String EXTRA_APP_PACKAGE = "android.provider.extra.APP_PACKAGE";
1436
1437 /**
1438 * Activity Extra: The {@link NotificationChannel#getId()} of the notification channel settings
1439 * to display.
1440 * <p>
1441 * This must be passed as an extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}.
1442 */
1443 public static final String EXTRA_CHANNEL_ID = "android.provider.extra.CHANNEL_ID";
1444
1445 /**
Chris Wrencd8f4f72014-08-27 18:48:13 -04001446 * Activity Action: Show notification redaction settings.
1447 *
1448 * @hide
1449 */
1450 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1451 public static final String ACTION_APP_NOTIFICATION_REDACTION
1452 = "android.settings.ACTION_APP_NOTIFICATION_REDACTION";
1453
John Spurlock2b0e09c2014-07-27 13:27:47 -04001454 /** @hide */ public static final String EXTRA_APP_UID = "app_uid";
John Spurlock2b0e09c2014-07-27 13:27:47 -04001455
Sudheer Shanka410e6bd2015-12-31 15:29:50 +00001456 /**
1457 * Activity Action: Show a dialog with disabled by policy message.
1458 * <p> If an user action is disabled by policy, this dialog can be triggered to let
1459 * the user know about this.
1460 * <p>
1461 * Input: Nothing.
1462 * <p>
1463 * Output: Nothing.
Sudheer Shankaaebd5dd2016-02-18 12:37:14 +00001464 *
1465 * @hide
Sudheer Shanka410e6bd2015-12-31 15:29:50 +00001466 */
1467 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1468 public static final String ACTION_SHOW_ADMIN_SUPPORT_DETAILS
1469 = "android.settings.SHOW_ADMIN_SUPPORT_DETAILS";
1470
Michal Karpinskiba244092016-02-25 17:28:24 +00001471 /**
1472 * Activity Action: Show a dialog for remote bugreport flow.
1473 * <p>
1474 * Input: Nothing.
1475 * <p>
1476 * Output: Nothing.
1477 *
1478 * @hide
1479 */
1480 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1481 public static final String ACTION_SHOW_REMOTE_BUGREPORT_DIALOG
1482 = "android.settings.SHOW_REMOTE_BUGREPORT_DIALOG";
1483
Ruben Brunke24b9a62016-02-16 21:38:24 -08001484 /**
1485 * Activity Action: Show VR listener settings.
1486 * <p>
1487 * Input: Nothing.
1488 * <p>
1489 * Output: Nothing.
1490 *
1491 * @see android.service.vr.VrListenerService
1492 */
1493 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1494 public static final String ACTION_VR_LISTENER_SETTINGS
1495 = "android.settings.VR_LISTENER_SETTINGS";
1496
Jason Monk42d01212016-05-03 14:16:56 -04001497 /**
Winson Chung59fda9e2017-01-20 16:14:51 -08001498 * Activity Action: Show Picture-in-picture settings.
1499 * <p>
1500 * Input: Nothing.
1501 * <p>
1502 * Output: Nothing.
1503 *
1504 * @hide
1505 */
1506 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1507 public static final String ACTION_PICTURE_IN_PICTURE_SETTINGS
1508 = "android.settings.PICTURE_IN_PICTURE_SETTINGS";
1509
1510 /**
Daniel Nishie58d2a72016-09-20 16:42:19 -07001511 * Activity Action: Show Storage Manager settings.
1512 * <p>
1513 * Input: Nothing.
1514 * <p>
1515 * Output: Nothing.
1516 *
1517 * @hide
1518 */
1519 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1520 public static final String ACTION_STORAGE_MANAGER_SETTINGS
1521 = "android.settings.STORAGE_MANAGER_SETTINGS";
1522
1523 /**
Jason Monk42d01212016-05-03 14:16:56 -04001524 * Activity Action: Allows user to select current webview implementation.
1525 * <p>
1526 * Input: Nothing.
1527 * <p>
1528 * Output: Nothing.
1529 */
1530 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1531 public static final String ACTION_WEBVIEW_SETTINGS = "android.settings.WEBVIEW_SETTINGS";
1532
Bartosz Fabianowski46bea2e2016-12-06 01:20:29 +01001533 /**
1534 * Activity Action: Show enterprise privacy section.
1535 * <p>
1536 * Input: Nothing.
1537 * <p>
1538 * Output: Nothing.
1539 * @hide
1540 */
1541 @SystemApi
1542 @TestApi
1543 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1544 public static final String ACTION_ENTERPRISE_PRIVACY_SETTINGS
1545 = "android.settings.ENTERPRISE_PRIVACY_SETTINGS";
1546
Felipe Lemedb041182017-04-21 17:33:38 -07001547 /**
1548 * Activity Action: Show screen that let user select its Autofill Service.
1549 * <p>
1550 * Input: Intent's data URI set with an application name, using the
1551 * "package" schema (like "package:com.my.app").
1552 *
1553 * <p>
1554 * Output: {@link android.app.Activity#RESULT_OK} if user selected an Autofill Service belonging
1555 * to the caller package.
1556 *
1557 * <p>
Ricardo Looaec98da2017-07-01 11:19:03 -07001558 * <b>NOTE: </b> Applications should call
Felipe Lemedb041182017-04-21 17:33:38 -07001559 * {@link android.view.autofill.AutofillManager#hasEnabledAutofillServices()} and
Ricardo Looaec98da2017-07-01 11:19:03 -07001560 * {@link android.view.autofill.AutofillManager#isAutofillSupported()}, and only use this action
1561 * to start an activity if they return {@code false} and {@code true} respectively.
Felipe Lemedb041182017-04-21 17:33:38 -07001562 */
1563 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1564 public static final String ACTION_REQUEST_SET_AUTOFILL_SERVICE =
1565 "android.settings.REQUEST_SET_AUTOFILL_SERVICE";
1566
Felipe Lemed82096e2018-01-22 13:44:01 -08001567 /**
1568 * Activity Action: Show screen for controlling which apps have access on volume directories.
1569 * <p>
1570 * Input: Nothing.
1571 * <p>
1572 * Output: Nothing.
1573 * <p>
1574 * Applications typically use this action to ask the user to revert the "Do not ask again"
1575 * status of directory access requests made by
1576 * {@link android.os.storage.StorageVolume#createAccessIntent(String)}.
1577 */
1578 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1579 public static final String ACTION_STORAGE_VOLUME_ACCESS_SETTINGS =
1580 "android.settings.STORAGE_VOLUME_ACCESS_SETTINGS";
1581
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001582 // End of Intent actions for Settings
1583
Erikeebc8e22010-02-18 13:27:19 -08001584 /**
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001585 * @hide - Private call() method on SettingsProvider to read from 'system' table.
1586 */
1587 public static final String CALL_METHOD_GET_SYSTEM = "GET_system";
1588
1589 /**
1590 * @hide - Private call() method on SettingsProvider to read from 'secure' table.
1591 */
1592 public static final String CALL_METHOD_GET_SECURE = "GET_secure";
1593
1594 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001595 * @hide - Private call() method on SettingsProvider to read from 'global' table.
1596 */
1597 public static final String CALL_METHOD_GET_GLOBAL = "GET_global";
1598
1599 /**
Svet Ganov53a441c2016-04-19 19:38:00 -07001600 * @hide - Specifies that the caller of the fast-path call()-based flow tracks
1601 * the settings generation in order to cache values locally. If this key is
1602 * mapped to a <code>null</code> string extra in the request bundle, the response
1603 * bundle will contain the same key mapped to a parcelable extra which would be
1604 * an {@link android.util.MemoryIntArray}. The response will also contain an
1605 * integer mapped to the {@link #CALL_METHOD_GENERATION_INDEX_KEY} which is the
1606 * index in the array clients should use to lookup the generation. For efficiency
1607 * the caller should request the generation tracking memory array only if it
1608 * doesn't already have it.
1609 *
1610 * @see #CALL_METHOD_GENERATION_INDEX_KEY
1611 */
1612 public static final String CALL_METHOD_TRACK_GENERATION_KEY = "_track_generation";
1613
1614 /**
1615 * @hide Key with the location in the {@link android.util.MemoryIntArray} where
Svetoslav Ganov8c35dcc2016-06-17 15:27:43 -07001616 * to look up the generation id of the backing table. The value is an integer.
Svet Ganov53a441c2016-04-19 19:38:00 -07001617 *
1618 * @see #CALL_METHOD_TRACK_GENERATION_KEY
1619 */
1620 public static final String CALL_METHOD_GENERATION_INDEX_KEY = "_generation_index";
1621
1622 /**
Svetoslav Ganov8c35dcc2016-06-17 15:27:43 -07001623 * @hide Key with the settings table generation. The value is an integer.
1624 *
1625 * @see #CALL_METHOD_TRACK_GENERATION_KEY
1626 */
1627 public static final String CALL_METHOD_GENERATION_KEY = "_generation";
1628
1629 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001630 * @hide - User handle argument extra to the fast-path call()-based requests
1631 */
1632 public static final String CALL_METHOD_USER_KEY = "_user";
1633
Svetoslav Ganove080da92016-12-21 17:10:35 -08001634 /**
1635 * @hide - Boolean argument extra to the fast-path call()-based requests
1636 */
1637 public static final String CALL_METHOD_MAKE_DEFAULT_KEY = "_make_default";
1638
1639 /**
1640 * @hide - User handle argument extra to the fast-path call()-based requests
1641 */
1642 public static final String CALL_METHOD_RESET_MODE_KEY = "_reset_mode";
1643
1644 /**
1645 * @hide - String argument extra to the fast-path call()-based requests
1646 */
1647 public static final String CALL_METHOD_TAG_KEY = "_tag";
1648
Christopher Tate06efb532012-08-24 15:29:27 -07001649 /** @hide - Private call() method to write to 'system' table */
1650 public static final String CALL_METHOD_PUT_SYSTEM = "PUT_system";
1651
1652 /** @hide - Private call() method to write to 'secure' table */
1653 public static final String CALL_METHOD_PUT_SECURE = "PUT_secure";
1654
1655 /** @hide - Private call() method to write to 'global' table */
1656 public static final String CALL_METHOD_PUT_GLOBAL= "PUT_global";
1657
Svetoslav Ganove080da92016-12-21 17:10:35 -08001658 /** @hide - Private call() method to reset to defaults the 'global' table */
1659 public static final String CALL_METHOD_RESET_GLOBAL = "RESET_global";
1660
1661 /** @hide - Private call() method to reset to defaults the 'secure' table */
1662 public static final String CALL_METHOD_RESET_SECURE = "RESET_secure";
1663
Christopher Tate06efb532012-08-24 15:29:27 -07001664 /**
Erikeebc8e22010-02-18 13:27:19 -08001665 * Activity Extra: Limit available options in launched activity based on the given authority.
1666 * <p>
1667 * This can be passed as an extra field in an Activity Intent with one or more syncable content
1668 * provider's authorities as a String[]. This field is used by some intents to alter the
1669 * behavior of the called activity.
1670 * <p>
1671 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types available based
1672 * on the authority given.
1673 */
Alon Albert50359c22013-02-26 14:47:48 -08001674 public static final String EXTRA_AUTHORITIES = "authorities";
1675
Alon Albertd35bf1f2013-04-18 14:26:51 -07001676 /**
1677 * Activity Extra: Limit available options in launched activity based on the given account
1678 * types.
1679 * <p>
1680 * This can be passed as an extra field in an Activity Intent with one or more account types
1681 * as a String[]. This field is used by some intents to alter the behavior of the called
1682 * activity.
1683 * <p>
1684 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types to the specified
1685 * list.
1686 */
Alon Albert50359c22013-02-26 14:47:48 -08001687 public static final String EXTRA_ACCOUNT_TYPES = "account_types";
Erikeebc8e22010-02-18 13:27:19 -08001688
Tadashi G. Takaoka25480202011-01-20 23:13:02 +09001689 public static final String EXTRA_INPUT_METHOD_ID = "input_method_id";
1690
Barnaby James48f35522014-07-16 14:27:39 -07001691 /**
Michael Wrightc93fbd12014-09-22 20:07:59 -07001692 * Activity Extra: The device identifier to act upon.
1693 * <p>
1694 * This can be passed as an extra field in an Activity Intent with a single
1695 * InputDeviceIdentifier. This field is used by some activities to jump straight into the
1696 * settings for the given device.
1697 * <p>
Dianne Hackbornad6a99b2014-11-18 10:11:10 -08001698 * Example: The {@link #ACTION_INPUT_METHOD_SETTINGS} intent opens the keyboard layout
1699 * dialog for the given device.
Michael Wrightc93fbd12014-09-22 20:07:59 -07001700 * @hide
1701 */
1702 public static final String EXTRA_INPUT_DEVICE_IDENTIFIER = "input_device_identifier";
1703
1704 /**
Barnaby James48f35522014-07-16 14:27:39 -07001705 * Activity Extra: Enable or disable Airplane Mode.
1706 * <p>
1707 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_AIRPLANE_MODE}
Barnaby Jamesb3006d32015-04-02 17:49:54 -07001708 * intent as a boolean to indicate if it should be enabled.
Barnaby James48f35522014-07-16 14:27:39 -07001709 */
1710 public static final String EXTRA_AIRPLANE_MODE_ENABLED = "airplane_mode_enabled";
1711
Barnaby Jamesb3006d32015-04-02 17:49:54 -07001712 /**
1713 * Activity Extra: Enable or disable Battery saver mode.
1714 * <p>
1715 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE}
1716 * intent as a boolean to indicate if it should be enabled.
1717 */
1718 public static final String EXTRA_BATTERY_SAVER_MODE_ENABLED =
1719 "android.settings.extra.battery_saver_mode_enabled";
1720
1721 /**
1722 * Activity Extra: Enable or disable Do Not Disturb mode.
1723 * <p>
1724 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE}
1725 * intent as a boolean to indicate if it should be enabled.
1726 */
1727 public static final String EXTRA_DO_NOT_DISTURB_MODE_ENABLED =
1728 "android.settings.extra.do_not_disturb_mode_enabled";
1729
1730 /**
1731 * Activity Extra: How many minutes to enable do not disturb mode for.
1732 * <p>
1733 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE}
1734 * intent to indicate how long do not disturb mode should be enabled for.
1735 */
1736 public static final String EXTRA_DO_NOT_DISTURB_MODE_MINUTES =
1737 "android.settings.extra.do_not_disturb_mode_minutes";
1738
Victor Chang355d4762016-04-07 21:23:15 +01001739 /**
Svetoslav Ganove080da92016-12-21 17:10:35 -08001740 * Reset mode: reset to defaults only settings changed by the
1741 * calling package. If there is a default set the setting
1742 * will be set to it, otherwise the setting will be deleted.
1743 * This is the only type of reset available to non-system clients.
1744 * @hide
1745 */
1746 public static final int RESET_MODE_PACKAGE_DEFAULTS = 1;
1747
1748 /**
1749 * Reset mode: reset all settings set by untrusted packages, which is
1750 * packages that aren't a part of the system, to the current defaults.
1751 * If there is a default set the setting will be set to it, otherwise
1752 * the setting will be deleted. This mode is only available to the system.
1753 * @hide
1754 */
1755 public static final int RESET_MODE_UNTRUSTED_DEFAULTS = 2;
1756
1757 /**
1758 * Reset mode: delete all settings set by untrusted packages, which is
1759 * packages that aren't a part of the system. If a setting is set by an
1760 * untrusted package it will be deleted if its default is not provided
1761 * by the system, otherwise the setting will be set to its default.
1762 * This mode is only available to the system.
1763 * @hide
1764 */
1765 public static final int RESET_MODE_UNTRUSTED_CHANGES = 3;
1766
1767 /**
1768 * Reset mode: reset all settings to defaults specified by trusted
1769 * packages, which is packages that are a part of the system, and
1770 * delete all settings set by untrusted packages. If a setting has
1771 * a default set by a system package it will be set to the default,
1772 * otherwise the setting will be deleted. This mode is only available
1773 * to the system.
1774 * @hide
1775 */
1776 public static final int RESET_MODE_TRUSTED_DEFAULTS = 4;
1777
1778 /** @hide */
1779 @Retention(RetentionPolicy.SOURCE)
Jeff Sharkeyce8db992017-12-13 20:05:05 -07001780 @IntDef(prefix = { "RESET_MODE_" }, value = {
Svetoslav Ganove080da92016-12-21 17:10:35 -08001781 RESET_MODE_PACKAGE_DEFAULTS,
1782 RESET_MODE_UNTRUSTED_DEFAULTS,
1783 RESET_MODE_UNTRUSTED_CHANGES,
1784 RESET_MODE_TRUSTED_DEFAULTS
1785 })
1786 public @interface ResetMode{}
1787
Ajay Nadathur702fc642018-03-09 11:56:01 -08001788
1789 /**
1790 * User has not started setup personalization.
1791 * @hide
1792 */
1793 public static final int USER_SETUP_PERSONALIZATION_NOT_STARTED = 0;
1794
1795 /**
1796 * User has not yet completed setup personalization.
1797 * @hide
1798 */
1799 public static final int USER_SETUP_PERSONALIZATION_STARTED = 1;
1800
1801 /**
Ajay Nadathur43bda822018-04-30 14:27:33 -07001802 * User has snoozed personalization and will complete it later.
1803 * @hide
1804 */
1805 public static final int USER_SETUP_PERSONALIZATION_PAUSED = 2;
1806
1807 /**
Ajay Nadathur702fc642018-03-09 11:56:01 -08001808 * User has completed setup personalization.
1809 * @hide
1810 */
1811 public static final int USER_SETUP_PERSONALIZATION_COMPLETE = 10;
1812
1813 /** @hide */
1814 @Retention(RetentionPolicy.SOURCE)
1815 @IntDef({
1816 USER_SETUP_PERSONALIZATION_NOT_STARTED,
1817 USER_SETUP_PERSONALIZATION_STARTED,
Ajay Nadathur43bda822018-04-30 14:27:33 -07001818 USER_SETUP_PERSONALIZATION_PAUSED,
Ajay Nadathur702fc642018-03-09 11:56:01 -08001819 USER_SETUP_PERSONALIZATION_COMPLETE
1820 })
1821 public @interface UserSetupPersonalization {}
1822
Svetoslav Ganove080da92016-12-21 17:10:35 -08001823 /**
Victor Chang355d4762016-04-07 21:23:15 +01001824 * Activity Extra: Number of certificates
1825 * <p>
1826 * This can be passed as an extra field to the {@link #ACTION_MONITORING_CERT_INFO}
1827 * intent to indicate the number of certificates
1828 * @hide
1829 */
1830 public static final String EXTRA_NUMBER_OF_CERTIFICATES =
1831 "android.settings.extra.number_of_certificates";
1832
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001833 private static final String JID_RESOURCE_PREFIX = "android";
1834
1835 public static final String AUTHORITY = "settings";
1836
1837 private static final String TAG = "Settings";
Christopher Tate06efb532012-08-24 15:29:27 -07001838 private static final boolean LOCAL_LOGV = false;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001839
David Christie3f7b6522013-08-06 19:19:08 -07001840 // Lock ensures that when enabling/disabling the master location switch, we don't end up
1841 // with a partial enable/disable state in multi-threaded situations.
1842 private static final Object mLocationSettingsLock = new Object();
1843
Chad Brubaker97bccee2017-01-05 15:51:41 -08001844 // Used in system server calling uid workaround in call()
1845 private static boolean sInSystemServer = false;
1846 private static final Object sInSystemServerLock = new Object();
1847
1848 /** @hide */
1849 public static void setInSystemServer() {
1850 synchronized (sInSystemServerLock) {
1851 sInSystemServer = true;
1852 }
1853 }
1854
1855 /** @hide */
1856 public static boolean isInSystemServer() {
1857 synchronized (sInSystemServerLock) {
1858 return sInSystemServer;
1859 }
1860 }
1861
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001862 public static class SettingNotFoundException extends AndroidException {
1863 public SettingNotFoundException(String msg) {
1864 super(msg);
1865 }
1866 }
1867
1868 /**
1869 * Common base for tables of name/value settings.
1870 */
1871 public static class NameValueTable implements BaseColumns {
1872 public static final String NAME = "name";
1873 public static final String VALUE = "value";
1874
1875 protected static boolean putString(ContentResolver resolver, Uri uri,
1876 String name, String value) {
1877 // The database will take care of replacing duplicates.
1878 try {
1879 ContentValues values = new ContentValues();
1880 values.put(NAME, name);
1881 values.put(VALUE, value);
1882 resolver.insert(uri, values);
1883 return true;
1884 } catch (SQLException e) {
Dianne Hackborna33e3f72009-09-29 17:28:24 -07001885 Log.w(TAG, "Can't set key " + name + " in " + uri, e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001886 return false;
1887 }
1888 }
1889
1890 public static Uri getUriFor(Uri uri, String name) {
1891 return Uri.withAppendedPath(uri, name);
1892 }
1893 }
1894
Svet Ganov53a441c2016-04-19 19:38:00 -07001895 private static final class GenerationTracker {
1896 private final MemoryIntArray mArray;
Svetoslav Ganov04df7382016-05-10 18:55:47 -07001897 private final Runnable mErrorHandler;
Svet Ganov53a441c2016-04-19 19:38:00 -07001898 private final int mIndex;
1899 private int mCurrentGeneration;
1900
Svetoslav Ganov04df7382016-05-10 18:55:47 -07001901 public GenerationTracker(@NonNull MemoryIntArray array, int index,
Svetoslav Ganov8c35dcc2016-06-17 15:27:43 -07001902 int generation, Runnable errorHandler) {
Svet Ganov53a441c2016-04-19 19:38:00 -07001903 mArray = array;
1904 mIndex = index;
Svetoslav Ganov04df7382016-05-10 18:55:47 -07001905 mErrorHandler = errorHandler;
Svetoslav Ganov8c35dcc2016-06-17 15:27:43 -07001906 mCurrentGeneration = generation;
Svet Ganov53a441c2016-04-19 19:38:00 -07001907 }
1908
1909 public boolean isGenerationChanged() {
1910 final int currentGeneration = readCurrentGeneration();
1911 if (currentGeneration >= 0) {
1912 if (currentGeneration == mCurrentGeneration) {
1913 return false;
1914 }
1915 mCurrentGeneration = currentGeneration;
1916 }
1917 return true;
1918 }
1919
xulichenga5db9b42017-08-24 11:29:03 +08001920 public int getCurrentGeneration() {
1921 return mCurrentGeneration;
1922 }
1923
Svet Ganov53a441c2016-04-19 19:38:00 -07001924 private int readCurrentGeneration() {
1925 try {
1926 return mArray.get(mIndex);
1927 } catch (IOException e) {
1928 Log.e(TAG, "Error getting current generation", e);
Svetoslav Ganov04df7382016-05-10 18:55:47 -07001929 if (mErrorHandler != null) {
1930 mErrorHandler.run();
1931 }
Svet Ganov53a441c2016-04-19 19:38:00 -07001932 }
1933 return -1;
1934 }
Svetoslav Ganov04df7382016-05-10 18:55:47 -07001935
1936 public void destroy() {
1937 try {
1938 mArray.close();
1939 } catch (IOException e) {
1940 Log.e(TAG, "Error closing backing array", e);
1941 if (mErrorHandler != null) {
1942 mErrorHandler.run();
1943 }
1944 }
1945 }
Svet Ganov53a441c2016-04-19 19:38:00 -07001946 }
1947
Svetoslav Ganove080da92016-12-21 17:10:35 -08001948 private static final class ContentProviderHolder {
1949 private final Object mLock = new Object();
1950
1951 @GuardedBy("mLock")
1952 private final Uri mUri;
1953 @GuardedBy("mLock")
1954 private IContentProvider mContentProvider;
1955
1956 public ContentProviderHolder(Uri uri) {
1957 mUri = uri;
1958 }
1959
1960 public IContentProvider getProvider(ContentResolver contentResolver) {
1961 synchronized (mLock) {
1962 if (mContentProvider == null) {
1963 mContentProvider = contentResolver
1964 .acquireProvider(mUri.getAuthority());
1965 }
1966 return mContentProvider;
1967 }
1968 }
Sudheer Shankaaa3c30d2017-05-23 15:19:10 -07001969
1970 public void clearProviderForTest() {
1971 synchronized (mLock) {
1972 mContentProvider = null;
1973 }
1974 }
Svetoslav Ganove080da92016-12-21 17:10:35 -08001975 }
1976
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001977 // Thread-safe.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001978 private static class NameValueCache {
Svet Ganov53a441c2016-04-19 19:38:00 -07001979 private static final boolean DEBUG = false;
1980
Steve McKayea93fe72016-12-02 11:35:35 -08001981 private static final String[] SELECT_VALUE_PROJECTION = new String[] {
1982 Settings.NameValueTable.VALUE
1983 };
Svetoslav Ganove080da92016-12-21 17:10:35 -08001984
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001985 private static final String NAME_EQ_PLACEHOLDER = "name=?";
1986
1987 // Must synchronize on 'this' to access mValues and mValuesVersion.
Steve McKayea93fe72016-12-02 11:35:35 -08001988 private final HashMap<String, String> mValues = new HashMap<>();
Dan Egnor799f7212009-11-24 16:24:44 -08001989
Svetoslav Ganove080da92016-12-21 17:10:35 -08001990 private final Uri mUri;
1991 private final ContentProviderHolder mProviderHolder;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001992
1993 // The method we'll call (or null, to not use) on the provider
1994 // for the fast path of retrieving settings.
Christopher Tate06efb532012-08-24 15:29:27 -07001995 private final String mCallGetCommand;
1996 private final String mCallSetCommand;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001997
Svet Ganov53a441c2016-04-19 19:38:00 -07001998 @GuardedBy("this")
1999 private GenerationTracker mGenerationTracker;
2000
Svetoslav Ganove080da92016-12-21 17:10:35 -08002001 public NameValueCache(Uri uri, String getCommand, String setCommand,
2002 ContentProviderHolder providerHolder) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002003 mUri = uri;
Christopher Tate06efb532012-08-24 15:29:27 -07002004 mCallGetCommand = getCommand;
2005 mCallSetCommand = setCommand;
Svetoslav Ganove080da92016-12-21 17:10:35 -08002006 mProviderHolder = providerHolder;
Christopher Tate06efb532012-08-24 15:29:27 -07002007 }
2008
2009 public boolean putStringForUser(ContentResolver cr, String name, String value,
Svetoslav Ganove080da92016-12-21 17:10:35 -08002010 String tag, boolean makeDefault, final int userHandle) {
Christopher Tate06efb532012-08-24 15:29:27 -07002011 try {
2012 Bundle arg = new Bundle();
2013 arg.putString(Settings.NameValueTable.VALUE, value);
Christopher Tated5fe1472012-09-10 15:48:38 -07002014 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
Svetoslav Ganove080da92016-12-21 17:10:35 -08002015 if (tag != null) {
2016 arg.putString(CALL_METHOD_TAG_KEY, tag);
2017 }
2018 if (makeDefault) {
2019 arg.putBoolean(CALL_METHOD_MAKE_DEFAULT_KEY, true);
2020 }
2021 IContentProvider cp = mProviderHolder.getProvider(cr);
Dianne Hackborn35654b62013-01-14 17:38:02 -08002022 cp.call(cr.getPackageName(), mCallSetCommand, name, arg);
Christopher Tate06efb532012-08-24 15:29:27 -07002023 } catch (RemoteException e) {
2024 Log.w(TAG, "Can't set key " + name + " in " + mUri, e);
2025 return false;
2026 }
2027 return true;
2028 }
2029
Christopher Tate06efb532012-08-24 15:29:27 -07002030 public String getStringForUser(ContentResolver cr, String name, final int userHandle) {
Christopher Tate78d2a662012-09-13 16:19:44 -07002031 final boolean isSelf = (userHandle == UserHandle.myUserId());
xulichenga5db9b42017-08-24 11:29:03 +08002032 int currentGeneration = -1;
Christopher Tate78d2a662012-09-13 16:19:44 -07002033 if (isSelf) {
Svet Ganov51b83952016-07-06 12:16:53 -07002034 synchronized (NameValueCache.this) {
Svet Ganov53a441c2016-04-19 19:38:00 -07002035 if (mGenerationTracker != null) {
2036 if (mGenerationTracker.isGenerationChanged()) {
2037 if (DEBUG) {
2038 Log.i(TAG, "Generation changed for type:"
2039 + mUri.getPath() + " in package:"
2040 + cr.getPackageName() +" and user:" + userHandle);
2041 }
2042 mValues.clear();
2043 } else if (mValues.containsKey(name)) {
2044 return mValues.get(name);
Christopher Tate78d2a662012-09-13 16:19:44 -07002045 }
xulichenga5db9b42017-08-24 11:29:03 +08002046 if (mGenerationTracker != null) {
2047 currentGeneration = mGenerationTracker.getCurrentGeneration();
2048 }
Christopher Tate78d2a662012-09-13 16:19:44 -07002049 }
Dan Egnor799f7212009-11-24 16:24:44 -08002050 }
Christopher Tate78d2a662012-09-13 16:19:44 -07002051 } else {
2052 if (LOCAL_LOGV) Log.v(TAG, "get setting for user " + userHandle
2053 + " by user " + UserHandle.myUserId() + " so skipping cache");
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002054 }
Dan Egnor799f7212009-11-24 16:24:44 -08002055
Svetoslav Ganove080da92016-12-21 17:10:35 -08002056 IContentProvider cp = mProviderHolder.getProvider(cr);
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08002057
2058 // Try the fast path first, not using query(). If this
2059 // fails (alternate Settings provider that doesn't support
2060 // this interface?) then we fall back to the query/table
2061 // interface.
Christopher Tate06efb532012-08-24 15:29:27 -07002062 if (mCallGetCommand != null) {
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08002063 try {
Christopher Tate06efb532012-08-24 15:29:27 -07002064 Bundle args = null;
Christopher Tate5e08af02012-09-21 17:17:22 -07002065 if (!isSelf) {
Christopher Tate06efb532012-08-24 15:29:27 -07002066 args = new Bundle();
2067 args.putInt(CALL_METHOD_USER_KEY, userHandle);
2068 }
Svet Ganov53a441c2016-04-19 19:38:00 -07002069 boolean needsGenerationTracker = false;
Svet Ganov51b83952016-07-06 12:16:53 -07002070 synchronized (NameValueCache.this) {
Svet Ganov53a441c2016-04-19 19:38:00 -07002071 if (isSelf && mGenerationTracker == null) {
2072 needsGenerationTracker = true;
2073 if (args == null) {
2074 args = new Bundle();
2075 }
2076 args.putString(CALL_METHOD_TRACK_GENERATION_KEY, null);
2077 if (DEBUG) {
2078 Log.i(TAG, "Requested generation tracker for type: "+ mUri.getPath()
2079 + " in package:" + cr.getPackageName() +" and user:"
2080 + userHandle);
2081 }
2082 }
2083 }
Chad Brubaker97bccee2017-01-05 15:51:41 -08002084 Bundle b;
2085 // If we're in system server and in a binder transaction we need to clear the
2086 // calling uid. This works around code in system server that did not call
2087 // clearCallingIdentity, previously this wasn't needed because reading settings
2088 // did not do permission checking but thats no longer the case.
2089 // Long term this should be removed and callers should properly call
2090 // clearCallingIdentity or use a ContentResolver from the caller as needed.
2091 if (Settings.isInSystemServer() && Binder.getCallingUid() != Process.myUid()) {
2092 final long token = Binder.clearCallingIdentity();
2093 try {
2094 b = cp.call(cr.getPackageName(), mCallGetCommand, name, args);
2095 } finally {
2096 Binder.restoreCallingIdentity(token);
2097 }
2098 } else {
2099 b = cp.call(cr.getPackageName(), mCallGetCommand, name, args);
2100 }
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08002101 if (b != null) {
Svet Ganov53a441c2016-04-19 19:38:00 -07002102 String value = b.getString(Settings.NameValueTable.VALUE);
Christopher Tate78d2a662012-09-13 16:19:44 -07002103 // Don't update our cache for reads of other users' data
2104 if (isSelf) {
Svet Ganov51b83952016-07-06 12:16:53 -07002105 synchronized (NameValueCache.this) {
Svet Ganov53a441c2016-04-19 19:38:00 -07002106 if (needsGenerationTracker) {
2107 MemoryIntArray array = b.getParcelable(
2108 CALL_METHOD_TRACK_GENERATION_KEY);
2109 final int index = b.getInt(
2110 CALL_METHOD_GENERATION_INDEX_KEY, -1);
2111 if (array != null && index >= 0) {
Svetoslav Ganov8c35dcc2016-06-17 15:27:43 -07002112 final int generation = b.getInt(
2113 CALL_METHOD_GENERATION_KEY, 0);
Svet Ganov53a441c2016-04-19 19:38:00 -07002114 if (DEBUG) {
2115 Log.i(TAG, "Received generation tracker for type:"
2116 + mUri.getPath() + " in package:"
2117 + cr.getPackageName() + " and user:"
2118 + userHandle + " with index:" + index);
2119 }
Svet Ganov9d723d32016-08-27 11:05:56 -07002120 if (mGenerationTracker != null) {
2121 mGenerationTracker.destroy();
2122 }
Svetoslav Ganov04df7382016-05-10 18:55:47 -07002123 mGenerationTracker = new GenerationTracker(array, index,
Svetoslav Ganov8c35dcc2016-06-17 15:27:43 -07002124 generation, () -> {
Svet Ganov51b83952016-07-06 12:16:53 -07002125 synchronized (NameValueCache.this) {
Svetoslav Ganov04df7382016-05-10 18:55:47 -07002126 Log.e(TAG, "Error accessing generation"
2127 + " tracker - removing");
2128 if (mGenerationTracker != null) {
2129 GenerationTracker generationTracker =
2130 mGenerationTracker;
2131 mGenerationTracker = null;
2132 generationTracker.destroy();
2133 mValues.clear();
2134 }
2135 }
2136 });
Svet Ganov53a441c2016-04-19 19:38:00 -07002137 }
2138 }
xulichenga5db9b42017-08-24 11:29:03 +08002139 if (mGenerationTracker != null && currentGeneration ==
2140 mGenerationTracker.getCurrentGeneration()) {
2141 mValues.put(name, value);
2142 }
Christopher Tate78d2a662012-09-13 16:19:44 -07002143 }
2144 } else {
2145 if (LOCAL_LOGV) Log.i(TAG, "call-query of user " + userHandle
2146 + " by " + UserHandle.myUserId()
2147 + " so not updating cache");
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08002148 }
2149 return value;
2150 }
2151 // If the response Bundle is null, we fall through
2152 // to the query interface below.
2153 } catch (RemoteException e) {
2154 // Not supported by the remote side? Fall through
2155 // to query().
2156 }
2157 }
2158
Dan Egnor799f7212009-11-24 16:24:44 -08002159 Cursor c = null;
2160 try {
Steve McKayea93fe72016-12-02 11:35:35 -08002161 Bundle queryArgs = ContentResolver.createSqlQueryBundle(
2162 NAME_EQ_PLACEHOLDER, new String[]{name}, null);
Chad Brubaker97bccee2017-01-05 15:51:41 -08002163 // Same workaround as above.
2164 if (Settings.isInSystemServer() && Binder.getCallingUid() != Process.myUid()) {
2165 final long token = Binder.clearCallingIdentity();
2166 try {
2167 c = cp.query(cr.getPackageName(), mUri, SELECT_VALUE_PROJECTION, queryArgs,
2168 null);
2169 } finally {
2170 Binder.restoreCallingIdentity(token);
2171 }
2172 } else {
2173 c = cp.query(cr.getPackageName(), mUri, SELECT_VALUE_PROJECTION, queryArgs,
2174 null);
2175 }
Dan Egnor799f7212009-11-24 16:24:44 -08002176 if (c == null) {
2177 Log.w(TAG, "Can't get key " + name + " from " + mUri);
2178 return null;
2179 }
2180
2181 String value = c.moveToNext() ? c.getString(0) : null;
Svet Ganov51b83952016-07-06 12:16:53 -07002182 synchronized (NameValueCache.this) {
xulichenga5db9b42017-08-24 11:29:03 +08002183 if(mGenerationTracker != null &&
2184 currentGeneration == mGenerationTracker.getCurrentGeneration()) {
2185 mValues.put(name, value);
2186 }
Dan Egnor799f7212009-11-24 16:24:44 -08002187 }
2188 if (LOCAL_LOGV) {
2189 Log.v(TAG, "cache miss [" + mUri.getLastPathSegment() + "]: " +
2190 name + " = " + (value == null ? "(null)" : value));
2191 }
2192 return value;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08002193 } catch (RemoteException e) {
Dan Egnor799f7212009-11-24 16:24:44 -08002194 Log.w(TAG, "Can't get key " + name + " from " + mUri, e);
2195 return null; // Return null, but don't cache it.
2196 } finally {
2197 if (c != null) c.close();
2198 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002199 }
Sudheer Shankaaa3c30d2017-05-23 15:19:10 -07002200
2201 public void clearGenerationTrackerForTest() {
2202 synchronized (NameValueCache.this) {
2203 if (mGenerationTracker != null) {
2204 mGenerationTracker.destroy();
2205 }
2206 mValues.clear();
2207 mGenerationTracker = null;
2208 }
2209 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002210 }
2211
2212 /**
Trevor Johns682c24e2016-04-12 10:13:47 -07002213 * Checks if the specified context can draw on top of other apps. As of API
2214 * level 23, an app cannot draw on top of other apps unless it declares the
2215 * {@link android.Manifest.permission#SYSTEM_ALERT_WINDOW} permission in its
2216 * manifest, <em>and</em> the user specifically grants the app this
2217 * capability. To prompt the user to grant this approval, the app must send an
2218 * intent with the action
2219 * {@link android.provider.Settings#ACTION_MANAGE_OVERLAY_PERMISSION}, which
2220 * causes the system to display a permission management screen.
Billy Lau6ad2d662015-07-18 00:26:58 +01002221 *
Trevor Johns682c24e2016-04-12 10:13:47 -07002222 * @param context App context.
2223 * @return true if the specified context can draw on top of other apps, false otherwise
Billy Lau6ad2d662015-07-18 00:26:58 +01002224 */
2225 public static boolean canDrawOverlays(Context context) {
Svet Ganov94ba40172016-04-03 22:04:22 -07002226 return Settings.isCallingPackageAllowedToDrawOverlays(context, Process.myUid(),
2227 context.getOpPackageName(), false);
Billy Lau6ad2d662015-07-18 00:26:58 +01002228 }
2229
2230 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002231 * System settings, containing miscellaneous system preferences. This
2232 * table holds simple name/value pairs. There are convenience
2233 * functions for accessing individual settings entries.
2234 */
2235 public static final class System extends NameValueTable {
Kweku Adamsb0886f32017-10-31 15:32:09 -07002236 // NOTE: If you add new settings here, be sure to add them to
2237 // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoSystemSettingsLocked.
2238
Alan Viverette04fd67c2016-04-12 10:54:04 -04002239 private static final float DEFAULT_FONT_SCALE = 1.0f;
2240
Dianne Hackborn139748f2012-09-24 11:36:57 -07002241 /**
2242 * The content:// style URL for this table
2243 */
2244 public static final Uri CONTENT_URI =
2245 Uri.parse("content://" + AUTHORITY + "/system");
2246
Svetoslav Ganove080da92016-12-21 17:10:35 -08002247 private static final ContentProviderHolder sProviderHolder =
2248 new ContentProviderHolder(CONTENT_URI);
2249
Dianne Hackborn139748f2012-09-24 11:36:57 -07002250 private static final NameValueCache sNameValueCache = new NameValueCache(
Dianne Hackborn139748f2012-09-24 11:36:57 -07002251 CONTENT_URI,
2252 CALL_METHOD_GET_SYSTEM,
Svetoslav Ganove080da92016-12-21 17:10:35 -08002253 CALL_METHOD_PUT_SYSTEM,
2254 sProviderHolder);
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002255
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002256 private static final HashSet<String> MOVED_TO_SECURE;
2257 static {
Steve McKayea93fe72016-12-02 11:35:35 -08002258 MOVED_TO_SECURE = new HashSet<>(30);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002259 MOVED_TO_SECURE.add(Secure.ANDROID_ID);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002260 MOVED_TO_SECURE.add(Secure.HTTP_PROXY);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002261 MOVED_TO_SECURE.add(Secure.LOCATION_PROVIDERS_ALLOWED);
Danielle Millett925a7d82012-03-19 18:02:20 -04002262 MOVED_TO_SECURE.add(Secure.LOCK_BIOMETRIC_WEAK_FLAGS);
Amith Yamasani156c4352010-03-05 17:10:03 -08002263 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_ENABLED);
2264 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_VISIBLE);
2265 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002266 MOVED_TO_SECURE.add(Secure.LOGGING_ID);
2267 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_ENABLED);
2268 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_LAST_UPDATE);
2269 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_REDIRECT_URL);
2270 MOVED_TO_SECURE.add(Secure.SETTINGS_CLASSNAME);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002271 MOVED_TO_SECURE.add(Secure.USE_GOOGLE_MAIL);
2272 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
2273 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
2274 MOVED_TO_SECURE.add(Secure.WIFI_NUM_OPEN_NETWORKS_KEPT);
2275 MOVED_TO_SECURE.add(Secure.WIFI_ON);
2276 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE);
2277 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_AP_COUNT);
2278 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS);
2279 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED);
2280 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS);
2281 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT);
2282 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_MAX_AP_CHECKS);
2283 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ON);
2284 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_COUNT);
2285 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_DELAY_MS);
2286 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS);
Christopher Tateaa036a22014-05-19 16:33:27 -07002287
2288 // At one time in System, then Global, but now back in Secure
2289 MOVED_TO_SECURE.add(Secure.INSTALL_NON_MARKET_APPS);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002290 }
2291
Christopher Tate06efb532012-08-24 15:29:27 -07002292 private static final HashSet<String> MOVED_TO_GLOBAL;
Christopher Tate66488d62012-10-02 11:58:01 -07002293 private static final HashSet<String> MOVED_TO_SECURE_THEN_GLOBAL;
Christopher Tate06efb532012-08-24 15:29:27 -07002294 static {
Steve McKayea93fe72016-12-02 11:35:35 -08002295 MOVED_TO_GLOBAL = new HashSet<>();
2296 MOVED_TO_SECURE_THEN_GLOBAL = new HashSet<>();
Christopher Tate66488d62012-10-02 11:58:01 -07002297
Christopher Tate92198742012-09-07 12:00:13 -07002298 // these were originally in system but migrated to secure in the past,
2299 // so are duplicated in the Secure.* namespace
Christopher Tate66488d62012-10-02 11:58:01 -07002300 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.ADB_ENABLED);
2301 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.BLUETOOTH_ON);
2302 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DATA_ROAMING);
2303 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DEVICE_PROVISIONED);
Christopher Tate66488d62012-10-02 11:58:01 -07002304 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.USB_MASS_STORAGE_ENABLED);
2305 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.HTTP_PROXY);
Christopher Tate06efb532012-08-24 15:29:27 -07002306
Christopher Tate92198742012-09-07 12:00:13 -07002307 // these are moving directly from system to global
Christopher Tate06efb532012-08-24 15:29:27 -07002308 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_ON);
2309 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_RADIOS);
2310 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS);
2311 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME);
2312 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME_ZONE);
2313 MOVED_TO_GLOBAL.add(Settings.Global.CAR_DOCK_SOUND);
2314 MOVED_TO_GLOBAL.add(Settings.Global.CAR_UNDOCK_SOUND);
2315 MOVED_TO_GLOBAL.add(Settings.Global.DESK_DOCK_SOUND);
2316 MOVED_TO_GLOBAL.add(Settings.Global.DESK_UNDOCK_SOUND);
2317 MOVED_TO_GLOBAL.add(Settings.Global.DOCK_SOUNDS_ENABLED);
2318 MOVED_TO_GLOBAL.add(Settings.Global.LOCK_SOUND);
2319 MOVED_TO_GLOBAL.add(Settings.Global.UNLOCK_SOUND);
2320 MOVED_TO_GLOBAL.add(Settings.Global.LOW_BATTERY_SOUND);
2321 MOVED_TO_GLOBAL.add(Settings.Global.POWER_SOUNDS_ENABLED);
2322 MOVED_TO_GLOBAL.add(Settings.Global.STAY_ON_WHILE_PLUGGED_IN);
2323 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SLEEP_POLICY);
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07002324 MOVED_TO_GLOBAL.add(Settings.Global.MODE_RINGER);
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002325 MOVED_TO_GLOBAL.add(Settings.Global.WINDOW_ANIMATION_SCALE);
2326 MOVED_TO_GLOBAL.add(Settings.Global.TRANSITION_ANIMATION_SCALE);
2327 MOVED_TO_GLOBAL.add(Settings.Global.ANIMATOR_DURATION_SCALE);
2328 MOVED_TO_GLOBAL.add(Settings.Global.FANCY_IME_ANIMATIONS);
2329 MOVED_TO_GLOBAL.add(Settings.Global.COMPATIBILITY_MODE);
2330 MOVED_TO_GLOBAL.add(Settings.Global.EMERGENCY_TONE);
2331 MOVED_TO_GLOBAL.add(Settings.Global.CALL_AUTO_RETRY);
2332 MOVED_TO_GLOBAL.add(Settings.Global.DEBUG_APP);
2333 MOVED_TO_GLOBAL.add(Settings.Global.WAIT_FOR_DEBUGGER);
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002334 MOVED_TO_GLOBAL.add(Settings.Global.ALWAYS_FINISH_ACTIVITIES);
Geremy Condraa0735112013-03-26 21:49:26 -07002335 MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_CONTENT_URL);
2336 MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_METADATA_URL);
2337 MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_CONTENT_URL);
2338 MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_METADATA_URL);
2339 MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_CONTENT_URL);
2340 MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_METADATA_URL);
2341 MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_CONTENT_URL);
2342 MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_METADATA_URL);
Christopher Tate06efb532012-08-24 15:29:27 -07002343 }
2344
Christopher Tate66488d62012-10-02 11:58:01 -07002345 /** @hide */
Svetoslav683914b2015-01-15 14:22:26 -08002346 public static void getMovedToGlobalSettings(Set<String> outKeySet) {
Christopher Tate66488d62012-10-02 11:58:01 -07002347 outKeySet.addAll(MOVED_TO_GLOBAL);
2348 outKeySet.addAll(MOVED_TO_SECURE_THEN_GLOBAL);
2349 }
2350
2351 /** @hide */
Svetoslav683914b2015-01-15 14:22:26 -08002352 public static void getMovedToSecureSettings(Set<String> outKeySet) {
2353 outKeySet.addAll(MOVED_TO_SECURE);
2354 }
2355
2356 /** @hide */
Christopher Tate66488d62012-10-02 11:58:01 -07002357 public static void getNonLegacyMovedKeys(HashSet<String> outKeySet) {
2358 outKeySet.addAll(MOVED_TO_GLOBAL);
2359 }
2360
Sudheer Shankaaa3c30d2017-05-23 15:19:10 -07002361 /** @hide */
2362 public static void clearProviderForTest() {
2363 sProviderHolder.clearProviderForTest();
2364 sNameValueCache.clearGenerationTrackerForTest();
2365 }
2366
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002367 /**
2368 * Look up a name in the database.
2369 * @param resolver to access the database with
2370 * @param name to look up in the table
2371 * @return the corresponding value, or null if not present
2372 */
Dianne Hackborn139748f2012-09-24 11:36:57 -07002373 public static String getString(ContentResolver resolver, String name) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07002374 return getStringForUser(resolver, name, resolver.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07002375 }
2376
2377 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -07002378 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -07002379 int userHandle) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002380 if (MOVED_TO_SECURE.contains(name)) {
2381 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
2382 + " to android.provider.Settings.Secure, returning read-only value.");
Christopher Tate06efb532012-08-24 15:29:27 -07002383 return Secure.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002384 }
Christopher Tate66488d62012-10-02 11:58:01 -07002385 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07002386 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
2387 + " to android.provider.Settings.Global, returning read-only value.");
2388 return Global.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002389 }
Christopher Tate06efb532012-08-24 15:29:27 -07002390 return sNameValueCache.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002391 }
2392
2393 /**
2394 * Store a name/value pair into the database.
2395 * @param resolver to access the database with
2396 * @param name to store
2397 * @param value to associate with the name
2398 * @return true if the value was set, false on database errors
2399 */
2400 public static boolean putString(ContentResolver resolver, String name, String value) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07002401 return putStringForUser(resolver, name, value, resolver.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07002402 }
2403
2404 /** @hide */
2405 public static boolean putStringForUser(ContentResolver resolver, String name, String value,
2406 int userHandle) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002407 if (MOVED_TO_SECURE.contains(name)) {
2408 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
2409 + " to android.provider.Settings.Secure, value is unchanged.");
2410 return false;
2411 }
Christopher Tate66488d62012-10-02 11:58:01 -07002412 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07002413 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
2414 + " to android.provider.Settings.Global, value is unchanged.");
2415 return false;
2416 }
Svetoslav Ganove080da92016-12-21 17:10:35 -08002417 return sNameValueCache.putStringForUser(resolver, name, value, null, false, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002418 }
2419
2420 /**
2421 * Construct the content URI for a particular name/value pair,
2422 * useful for monitoring changes with a ContentObserver.
2423 * @param name to look up in the table
2424 * @return the corresponding content URI, or null if not present
2425 */
2426 public static Uri getUriFor(String name) {
2427 if (MOVED_TO_SECURE.contains(name)) {
2428 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
2429 + " to android.provider.Settings.Secure, returning Secure URI.");
2430 return Secure.getUriFor(Secure.CONTENT_URI, name);
2431 }
Christopher Tate66488d62012-10-02 11:58:01 -07002432 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07002433 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
2434 + " to android.provider.Settings.Global, returning read-only global URI.");
2435 return Global.getUriFor(Global.CONTENT_URI, name);
2436 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002437 return getUriFor(CONTENT_URI, name);
2438 }
2439
2440 /**
2441 * Convenience function for retrieving a single system settings value
2442 * as an integer. Note that internally setting values are always
2443 * stored as strings; this function converts the string to an integer
2444 * for you. The default value will be returned if the setting is
2445 * not defined or not an integer.
2446 *
2447 * @param cr The ContentResolver to access.
2448 * @param name The name of the setting to retrieve.
2449 * @param def Value to return if the setting is not defined.
2450 *
2451 * @return The setting's current value, or 'def' if it is not defined
2452 * or not a valid integer.
2453 */
2454 public static int getInt(ContentResolver cr, String name, int def) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07002455 return getIntForUser(cr, name, def, cr.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07002456 }
2457
2458 /** @hide */
2459 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
2460 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002461 try {
2462 return v != null ? Integer.parseInt(v) : def;
2463 } catch (NumberFormatException e) {
2464 return def;
2465 }
2466 }
2467
2468 /**
2469 * Convenience function for retrieving a single system settings value
2470 * as an integer. Note that internally setting values are always
2471 * stored as strings; this function converts the string to an integer
2472 * for you.
2473 * <p>
2474 * This version does not take a default value. If the setting has not
2475 * been set, or the string value is not a number,
2476 * it throws {@link SettingNotFoundException}.
2477 *
2478 * @param cr The ContentResolver to access.
2479 * @param name The name of the setting to retrieve.
2480 *
2481 * @throws SettingNotFoundException Thrown if a setting by the given
2482 * name can't be found or the setting value is not an integer.
2483 *
2484 * @return The setting's current value.
2485 */
2486 public static int getInt(ContentResolver cr, String name)
2487 throws SettingNotFoundException {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07002488 return getIntForUser(cr, name, cr.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07002489 }
2490
2491 /** @hide */
2492 public static int getIntForUser(ContentResolver cr, String name, int userHandle)
2493 throws SettingNotFoundException {
2494 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002495 try {
2496 return Integer.parseInt(v);
2497 } catch (NumberFormatException e) {
2498 throw new SettingNotFoundException(name);
2499 }
2500 }
2501
2502 /**
2503 * Convenience function for updating a single settings value as an
2504 * integer. This will either create a new entry in the table if the
2505 * given name does not exist, or modify the value of the existing row
2506 * with that name. Note that internally setting values are always
2507 * stored as strings, so this function converts the given value to a
2508 * string before storing it.
2509 *
2510 * @param cr The ContentResolver to access.
2511 * @param name The name of the setting to modify.
2512 * @param value The new value for the setting.
2513 * @return true if the value was set, false on database errors
2514 */
2515 public static boolean putInt(ContentResolver cr, String name, int value) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07002516 return putIntForUser(cr, name, value, cr.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07002517 }
2518
2519 /** @hide */
2520 public static boolean putIntForUser(ContentResolver cr, String name, int value,
2521 int userHandle) {
2522 return putStringForUser(cr, name, Integer.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002523 }
2524
2525 /**
2526 * Convenience function for retrieving a single system settings value
2527 * as a {@code long}. Note that internally setting values are always
2528 * stored as strings; this function converts the string to a {@code long}
2529 * for you. The default value will be returned if the setting is
2530 * not defined or not a {@code long}.
2531 *
2532 * @param cr The ContentResolver to access.
2533 * @param name The name of the setting to retrieve.
2534 * @param def Value to return if the setting is not defined.
2535 *
2536 * @return The setting's current value, or 'def' if it is not defined
2537 * or not a valid {@code long}.
2538 */
2539 public static long getLong(ContentResolver cr, String name, long def) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07002540 return getLongForUser(cr, name, def, cr.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07002541 }
2542
2543 /** @hide */
2544 public static long getLongForUser(ContentResolver cr, String name, long def,
2545 int userHandle) {
2546 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002547 long value;
2548 try {
2549 value = valString != null ? Long.parseLong(valString) : def;
2550 } catch (NumberFormatException e) {
2551 value = def;
2552 }
2553 return value;
2554 }
2555
2556 /**
2557 * Convenience function for retrieving a single system settings value
2558 * as a {@code long}. Note that internally setting values are always
2559 * stored as strings; this function converts the string to a {@code long}
2560 * for you.
2561 * <p>
2562 * This version does not take a default value. If the setting has not
2563 * been set, or the string value is not a number,
2564 * it throws {@link SettingNotFoundException}.
2565 *
2566 * @param cr The ContentResolver to access.
2567 * @param name The name of the setting to retrieve.
2568 *
2569 * @return The setting's current value.
2570 * @throws SettingNotFoundException Thrown if a setting by the given
2571 * name can't be found or the setting value is not an integer.
2572 */
2573 public static long getLong(ContentResolver cr, String name)
2574 throws SettingNotFoundException {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07002575 return getLongForUser(cr, name, cr.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07002576 }
2577
2578 /** @hide */
2579 public static long getLongForUser(ContentResolver cr, String name, int userHandle)
2580 throws SettingNotFoundException {
2581 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002582 try {
2583 return Long.parseLong(valString);
2584 } catch (NumberFormatException e) {
2585 throw new SettingNotFoundException(name);
2586 }
2587 }
2588
2589 /**
2590 * Convenience function for updating a single settings value as a long
2591 * integer. This will either create a new entry in the table if the
2592 * given name does not exist, or modify the value of the existing row
2593 * with that name. Note that internally setting values are always
2594 * stored as strings, so this function converts the given value to a
2595 * string before storing it.
2596 *
2597 * @param cr The ContentResolver to access.
2598 * @param name The name of the setting to modify.
2599 * @param value The new value for the setting.
2600 * @return true if the value was set, false on database errors
2601 */
2602 public static boolean putLong(ContentResolver cr, String name, long value) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07002603 return putLongForUser(cr, name, value, cr.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07002604 }
2605
2606 /** @hide */
2607 public static boolean putLongForUser(ContentResolver cr, String name, long value,
2608 int userHandle) {
2609 return putStringForUser(cr, name, Long.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002610 }
2611
2612 /**
2613 * Convenience function for retrieving a single system settings value
2614 * as a floating point number. Note that internally setting values are
2615 * always stored as strings; this function converts the string to an
2616 * float for you. The default value will be returned if the setting
2617 * is not defined or not a valid float.
2618 *
2619 * @param cr The ContentResolver to access.
2620 * @param name The name of the setting to retrieve.
2621 * @param def Value to return if the setting is not defined.
2622 *
2623 * @return The setting's current value, or 'def' if it is not defined
2624 * or not a valid float.
2625 */
2626 public static float getFloat(ContentResolver cr, String name, float def) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07002627 return getFloatForUser(cr, name, def, cr.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07002628 }
2629
2630 /** @hide */
2631 public static float getFloatForUser(ContentResolver cr, String name, float def,
2632 int userHandle) {
2633 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002634 try {
2635 return v != null ? Float.parseFloat(v) : def;
2636 } catch (NumberFormatException e) {
2637 return def;
2638 }
2639 }
2640
2641 /**
2642 * Convenience function for retrieving a single system settings value
2643 * as a float. Note that internally setting values are always
2644 * stored as strings; this function converts the string to a float
2645 * for you.
2646 * <p>
2647 * This version does not take a default value. If the setting has not
2648 * been set, or the string value is not a number,
2649 * it throws {@link SettingNotFoundException}.
2650 *
2651 * @param cr The ContentResolver to access.
2652 * @param name The name of the setting to retrieve.
2653 *
2654 * @throws SettingNotFoundException Thrown if a setting by the given
2655 * name can't be found or the setting value is not a float.
2656 *
2657 * @return The setting's current value.
2658 */
2659 public static float getFloat(ContentResolver cr, String name)
2660 throws SettingNotFoundException {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07002661 return getFloatForUser(cr, name, cr.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07002662 }
2663
2664 /** @hide */
2665 public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
2666 throws SettingNotFoundException {
2667 String v = getStringForUser(cr, name, userHandle);
Brian Muramatsue1d46982010-12-06 17:34:20 -08002668 if (v == null) {
2669 throw new SettingNotFoundException(name);
2670 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002671 try {
2672 return Float.parseFloat(v);
2673 } catch (NumberFormatException e) {
2674 throw new SettingNotFoundException(name);
2675 }
2676 }
2677
2678 /**
2679 * Convenience function for updating a single settings value as a
2680 * floating point number. This will either create a new entry in the
2681 * table if the given name does not exist, or modify the value of the
2682 * existing row with that name. Note that internally setting values
2683 * are always stored as strings, so this function converts the given
2684 * value to a string before storing it.
2685 *
2686 * @param cr The ContentResolver to access.
2687 * @param name The name of the setting to modify.
2688 * @param value The new value for the setting.
2689 * @return true if the value was set, false on database errors
2690 */
2691 public static boolean putFloat(ContentResolver cr, String name, float value) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07002692 return putFloatForUser(cr, name, value, cr.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07002693 }
2694
2695 /** @hide */
2696 public static boolean putFloatForUser(ContentResolver cr, String name, float value,
2697 int userHandle) {
2698 return putStringForUser(cr, name, Float.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002699 }
2700
2701 /**
2702 * Convenience function to read all of the current
2703 * configuration-related settings into a
2704 * {@link Configuration} object.
2705 *
2706 * @param cr The ContentResolver to access.
2707 * @param outConfig Where to place the configuration settings.
2708 */
2709 public static void getConfiguration(ContentResolver cr, Configuration outConfig) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07002710 adjustConfigurationForUser(cr, outConfig, cr.getUserId(),
Seigo Nonakaea906b32016-05-18 17:33:04 +09002711 false /* updateSettingsIfEmpty */);
Christopher Tate06efb532012-08-24 15:29:27 -07002712 }
2713
2714 /** @hide */
Seigo Nonakaea906b32016-05-18 17:33:04 +09002715 public static void adjustConfigurationForUser(ContentResolver cr, Configuration outConfig,
2716 int userHandle, boolean updateSettingsIfEmpty) {
Christopher Tate06efb532012-08-24 15:29:27 -07002717 outConfig.fontScale = Settings.System.getFloatForUser(
Alan Viverette04fd67c2016-04-12 10:54:04 -04002718 cr, FONT_SCALE, DEFAULT_FONT_SCALE, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002719 if (outConfig.fontScale < 0) {
Alan Viverette04fd67c2016-04-12 10:54:04 -04002720 outConfig.fontScale = DEFAULT_FONT_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002721 }
Seigo Nonakaea906b32016-05-18 17:33:04 +09002722
2723 final String localeValue =
2724 Settings.System.getStringForUser(cr, SYSTEM_LOCALES, userHandle);
2725 if (localeValue != null) {
2726 outConfig.setLocales(LocaleList.forLanguageTags(localeValue));
2727 } else {
2728 // Do not update configuration with emtpy settings since we need to take over the
2729 // locale list of previous user if the settings value is empty. This happens when a
2730 // new user is created.
2731
2732 if (updateSettingsIfEmpty) {
2733 // Make current configuration persistent. This is necessary the first time a
2734 // user log in. At the first login, the configuration settings are empty, so we
2735 // need to store the adjusted configuration as the initial settings.
2736 Settings.System.putStringForUser(
2737 cr, SYSTEM_LOCALES, outConfig.getLocales().toLanguageTags(),
2738 userHandle);
2739 }
2740 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002741 }
2742
2743 /**
Dianne Hackborn31ca8542011-07-19 14:58:28 -07002744 * @hide Erase the fields in the Configuration that should be applied
2745 * by the settings.
2746 */
2747 public static void clearConfiguration(Configuration inoutConfig) {
2748 inoutConfig.fontScale = 0;
Seigo Nonakad4031512016-03-17 21:18:53 +09002749 if (!inoutConfig.userSetLocale && !inoutConfig.getLocales().isEmpty()) {
Seigo Nonakabd5cac62016-05-13 15:11:37 +09002750 inoutConfig.clearLocales();
Seigo Nonakabd5cbdd2016-01-25 19:40:28 +09002751 }
Dianne Hackborn31ca8542011-07-19 14:58:28 -07002752 }
Narayan Kamath6d632962011-08-24 11:51:37 +01002753
Dianne Hackborn31ca8542011-07-19 14:58:28 -07002754 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002755 * Convenience function to write a batch of configuration-related
2756 * settings from a {@link Configuration} object.
2757 *
2758 * @param cr The ContentResolver to access.
2759 * @param config The settings to write.
2760 * @return true if the values were set, false on database errors
2761 */
2762 public static boolean putConfiguration(ContentResolver cr, Configuration config) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07002763 return putConfigurationForUser(cr, config, cr.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07002764 }
2765
2766 /** @hide */
2767 public static boolean putConfigurationForUser(ContentResolver cr, Configuration config,
2768 int userHandle) {
Seigo Nonakabd5cbdd2016-01-25 19:40:28 +09002769 return Settings.System.putFloatForUser(cr, FONT_SCALE, config.fontScale, userHandle) &&
2770 Settings.System.putStringForUser(
2771 cr, SYSTEM_LOCALES, config.getLocales().toLanguageTags(), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002772 }
2773
Dianne Hackbornb8b11a02010-03-10 15:53:11 -08002774 /** @hide */
2775 public static boolean hasInterestingConfigurationChanges(int changes) {
Seigo Nonakabd5cbdd2016-01-25 19:40:28 +09002776 return (changes & ActivityInfo.CONFIG_FONT_SCALE) != 0 ||
2777 (changes & ActivityInfo.CONFIG_LOCALE) != 0;
Dianne Hackbornb8b11a02010-03-10 15:53:11 -08002778 }
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07002779
Christopher Tate06efb532012-08-24 15:29:27 -07002780 /** @deprecated - Do not use */
2781 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002782 public static boolean getShowGTalkServiceStatus(ContentResolver cr) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07002783 return getShowGTalkServiceStatusForUser(cr, cr.getUserId());
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002784 }
2785
Christopher Tate06efb532012-08-24 15:29:27 -07002786 /**
2787 * @hide
2788 * @deprecated - Do not use
2789 */
Aurimas Liutikas514c5ef2016-05-24 15:22:55 -07002790 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002791 public static boolean getShowGTalkServiceStatusForUser(ContentResolver cr,
2792 int userHandle) {
2793 return getIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, 0, userHandle) != 0;
2794 }
2795
2796 /** @deprecated - Do not use */
2797 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002798 public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07002799 setShowGTalkServiceStatusForUser(cr, flag, cr.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07002800 }
2801
2802 /**
2803 * @hide
2804 * @deprecated - Do not use
2805 */
2806 @Deprecated
2807 public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean flag,
2808 int userHandle) {
2809 putIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, flag ? 1 : 0, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002810 }
2811
2812 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002813 * @deprecated Use {@link android.provider.Settings.Global#STAY_ON_WHILE_PLUGGED_IN} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002814 */
Christopher Tate06efb532012-08-24 15:29:27 -07002815 @Deprecated
2816 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 -08002817
Michal Karpinski2c37b082018-01-18 16:14:27 +00002818 private static final Validator STAY_ON_WHILE_PLUGGED_IN_VALIDATOR = new Validator() {
2819 @Override
2820 public boolean validate(String value) {
2821 try {
2822 int val = Integer.parseInt(value);
2823 return (val == 0)
2824 || (val == BatteryManager.BATTERY_PLUGGED_AC)
2825 || (val == BatteryManager.BATTERY_PLUGGED_USB)
2826 || (val == BatteryManager.BATTERY_PLUGGED_WIRELESS)
2827 || (val == (BatteryManager.BATTERY_PLUGGED_AC
2828 | BatteryManager.BATTERY_PLUGGED_USB))
2829 || (val == (BatteryManager.BATTERY_PLUGGED_AC
2830 | BatteryManager.BATTERY_PLUGGED_WIRELESS))
2831 || (val == (BatteryManager.BATTERY_PLUGGED_USB
2832 | BatteryManager.BATTERY_PLUGGED_WIRELESS))
2833 || (val == (BatteryManager.BATTERY_PLUGGED_AC
2834 | BatteryManager.BATTERY_PLUGGED_USB
2835 | BatteryManager.BATTERY_PLUGGED_WIRELESS));
2836 } catch (NumberFormatException e) {
2837 return false;
2838 }
2839 }
2840 };
2841
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002842 /**
2843 * What happens when the user presses the end call button if they're not
2844 * on a call.<br/>
2845 * <b>Values:</b><br/>
2846 * 0 - The end button does nothing.<br/>
2847 * 1 - The end button goes to the home screen.<br/>
2848 * 2 - The end button puts the device to sleep and locks the keyguard.<br/>
2849 * 3 - The end button goes to the home screen. If the user is already on the
2850 * home screen, it puts the device to sleep.
2851 */
2852 public static final String END_BUTTON_BEHAVIOR = "end_button_behavior";
2853
Svetoslav683914b2015-01-15 14:22:26 -08002854 private static final Validator END_BUTTON_BEHAVIOR_VALIDATOR =
Michal Karpinski2c37b082018-01-18 16:14:27 +00002855 new SettingsValidators.InclusiveIntegerRangeValidator(0, 3);
Svetoslav683914b2015-01-15 14:22:26 -08002856
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002857 /**
David Brown458e8062010-03-08 21:52:11 -08002858 * END_BUTTON_BEHAVIOR value for "go home".
2859 * @hide
2860 */
2861 public static final int END_BUTTON_BEHAVIOR_HOME = 0x1;
2862
2863 /**
2864 * END_BUTTON_BEHAVIOR value for "go to sleep".
2865 * @hide
2866 */
2867 public static final int END_BUTTON_BEHAVIOR_SLEEP = 0x2;
2868
2869 /**
2870 * END_BUTTON_BEHAVIOR default value.
2871 * @hide
2872 */
2873 public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_SLEEP;
2874
2875 /**
Joe Onorato9cdffa12011-04-06 18:27:27 -07002876 * Is advanced settings mode turned on. 0 == no, 1 == yes
2877 * @hide
2878 */
2879 public static final String ADVANCED_SETTINGS = "advanced_settings";
2880
Michal Karpinski2c37b082018-01-18 16:14:27 +00002881 private static final Validator ADVANCED_SETTINGS_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08002882
Joe Onorato9cdffa12011-04-06 18:27:27 -07002883 /**
2884 * ADVANCED_SETTINGS default value.
2885 * @hide
2886 */
2887 public static final int ADVANCED_SETTINGS_DEFAULT = 0;
2888
2889 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002890 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002891 */
Christopher Tate06efb532012-08-24 15:29:27 -07002892 @Deprecated
2893 public static final String AIRPLANE_MODE_ON = Global.AIRPLANE_MODE_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002894
2895 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002896 * @deprecated Use {@link android.provider.Settings.Global#RADIO_BLUETOOTH} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002897 */
Christopher Tate06efb532012-08-24 15:29:27 -07002898 @Deprecated
2899 public static final String RADIO_BLUETOOTH = Global.RADIO_BLUETOOTH;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002900
2901 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002902 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIFI} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002903 */
Christopher Tate06efb532012-08-24 15:29:27 -07002904 @Deprecated
2905 public static final String RADIO_WIFI = Global.RADIO_WIFI;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002906
Robert Greenwalt8588e472011-11-08 10:12:25 -08002907 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002908 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIMAX} instead
Robert Greenwalt8588e472011-11-08 10:12:25 -08002909 * {@hide}
2910 */
Christopher Tate06efb532012-08-24 15:29:27 -07002911 @Deprecated
2912 public static final String RADIO_WIMAX = Global.RADIO_WIMAX;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002913
2914 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002915 * @deprecated Use {@link android.provider.Settings.Global#RADIO_CELL} instead
Nick Pelly8d32a012011-08-09 07:03:49 -07002916 */
Christopher Tate06efb532012-08-24 15:29:27 -07002917 @Deprecated
2918 public static final String RADIO_CELL = Global.RADIO_CELL;
Nick Pelly8d32a012011-08-09 07:03:49 -07002919
2920 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002921 * @deprecated Use {@link android.provider.Settings.Global#RADIO_NFC} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002922 */
Christopher Tate06efb532012-08-24 15:29:27 -07002923 @Deprecated
2924 public static final String RADIO_NFC = Global.RADIO_NFC;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002925
2926 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002927 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_RADIOS} instead
2928 */
2929 @Deprecated
2930 public static final String AIRPLANE_MODE_RADIOS = Global.AIRPLANE_MODE_RADIOS;
2931
2932 /**
2933 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_TOGGLEABLE_RADIOS} instead
Mike Lockwoodbd5ddf02009-07-29 21:37:14 -07002934 *
2935 * {@hide}
2936 */
Christopher Tate06efb532012-08-24 15:29:27 -07002937 @Deprecated
2938 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS =
2939 Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS;
Mike Lockwoodbd5ddf02009-07-29 21:37:14 -07002940
2941 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002942 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002943 */
Christopher Tate06efb532012-08-24 15:29:27 -07002944 @Deprecated
2945 public static final String WIFI_SLEEP_POLICY = Global.WIFI_SLEEP_POLICY;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002946
2947 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002948 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_DEFAULT} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002949 */
Christopher Tate06efb532012-08-24 15:29:27 -07002950 @Deprecated
2951 public static final int WIFI_SLEEP_POLICY_DEFAULT = Global.WIFI_SLEEP_POLICY_DEFAULT;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002952
2953 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002954 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002955 */
Christopher Tate06efb532012-08-24 15:29:27 -07002956 @Deprecated
2957 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED =
2958 Global.WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002959
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002960 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002961 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002962 */
Christopher Tate06efb532012-08-24 15:29:27 -07002963 @Deprecated
2964 public static final int WIFI_SLEEP_POLICY_NEVER = Global.WIFI_SLEEP_POLICY_NEVER;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002965
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07002966 /**
2967 * @deprecated Use {@link android.provider.Settings.Global#MODE_RINGER} instead
2968 */
2969 @Deprecated
2970 public static final String MODE_RINGER = Global.MODE_RINGER;
2971
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002972 /**
2973 * Whether to use static IP and other static network attributes.
2974 * <p>
2975 * Set to 1 for true and 0 for false.
Jeff Sharkey625239a2012-09-26 22:03:49 -07002976 *
2977 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002978 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002979 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002980 public static final String WIFI_USE_STATIC_IP = "wifi_use_static_ip";
2981
Michal Karpinski2c37b082018-01-18 16:14:27 +00002982 private static final Validator WIFI_USE_STATIC_IP_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08002983
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002984 /**
2985 * The static IP address.
2986 * <p>
2987 * Example: "192.168.1.51"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002988 *
2989 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002990 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002991 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002992 public static final String WIFI_STATIC_IP = "wifi_static_ip";
2993
Michal Karpinski2c37b082018-01-18 16:14:27 +00002994 private static final Validator WIFI_STATIC_IP_VALIDATOR = LENIENT_IP_ADDRESS_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08002995
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002996 /**
2997 * If using static IP, the gateway's IP address.
2998 * <p>
2999 * Example: "192.168.1.1"
Jeff Sharkey625239a2012-09-26 22:03:49 -07003000 *
3001 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003002 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07003003 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003004 public static final String WIFI_STATIC_GATEWAY = "wifi_static_gateway";
3005
Michal Karpinski2c37b082018-01-18 16:14:27 +00003006 private static final Validator WIFI_STATIC_GATEWAY_VALIDATOR = LENIENT_IP_ADDRESS_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003007
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003008 /**
3009 * If using static IP, the net mask.
3010 * <p>
3011 * Example: "255.255.255.0"
Jeff Sharkey625239a2012-09-26 22:03:49 -07003012 *
3013 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003014 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07003015 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003016 public static final String WIFI_STATIC_NETMASK = "wifi_static_netmask";
3017
Michal Karpinski2c37b082018-01-18 16:14:27 +00003018 private static final Validator WIFI_STATIC_NETMASK_VALIDATOR = LENIENT_IP_ADDRESS_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003019
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003020 /**
3021 * If using static IP, the primary DNS's IP address.
3022 * <p>
3023 * Example: "192.168.1.1"
Jeff Sharkey625239a2012-09-26 22:03:49 -07003024 *
3025 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003026 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07003027 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003028 public static final String WIFI_STATIC_DNS1 = "wifi_static_dns1";
3029
Michal Karpinski2c37b082018-01-18 16:14:27 +00003030 private static final Validator WIFI_STATIC_DNS1_VALIDATOR = LENIENT_IP_ADDRESS_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003031
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003032 /**
3033 * If using static IP, the secondary DNS's IP address.
3034 * <p>
3035 * Example: "192.168.1.2"
Jeff Sharkey625239a2012-09-26 22:03:49 -07003036 *
3037 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003038 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07003039 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003040 public static final String WIFI_STATIC_DNS2 = "wifi_static_dns2";
3041
Michal Karpinski2c37b082018-01-18 16:14:27 +00003042 private static final Validator WIFI_STATIC_DNS2_VALIDATOR = LENIENT_IP_ADDRESS_VALIDATOR;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003043
3044 /**
3045 * Determines whether remote devices may discover and/or connect to
3046 * this device.
3047 * <P>Type: INT</P>
3048 * 2 -- discoverable and connectable
3049 * 1 -- connectable but not discoverable
3050 * 0 -- neither connectable nor discoverable
3051 */
3052 public static final String BLUETOOTH_DISCOVERABILITY =
3053 "bluetooth_discoverability";
3054
Svetoslav683914b2015-01-15 14:22:26 -08003055 private static final Validator BLUETOOTH_DISCOVERABILITY_VALIDATOR =
Michal Karpinski2c37b082018-01-18 16:14:27 +00003056 new SettingsValidators.InclusiveIntegerRangeValidator(0, 2);
Svetoslav683914b2015-01-15 14:22:26 -08003057
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003058 /**
3059 * Bluetooth discoverability timeout. If this value is nonzero, then
3060 * Bluetooth becomes discoverable for a certain number of seconds,
3061 * after which is becomes simply connectable. The value is in seconds.
3062 */
3063 public static final String BLUETOOTH_DISCOVERABILITY_TIMEOUT =
3064 "bluetooth_discoverability_timeout";
3065
Svetoslav683914b2015-01-15 14:22:26 -08003066 private static final Validator BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR =
Michal Karpinski2c37b082018-01-18 16:14:27 +00003067 NON_NEGATIVE_INTEGER_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003068
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003069 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08003070 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_ENABLED}
3071 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003072 */
Amith Yamasani156c4352010-03-05 17:10:03 -08003073 @Deprecated
3074 public static final String LOCK_PATTERN_ENABLED = Secure.LOCK_PATTERN_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003075
3076 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08003077 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_VISIBLE}
3078 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003079 */
Amith Yamasani156c4352010-03-05 17:10:03 -08003080 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003081 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
3082
3083 /**
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07003084 * @deprecated Use
Amith Yamasani156c4352010-03-05 17:10:03 -08003085 * {@link android.provider.Settings.Secure#LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED}
3086 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003087 */
Amith Yamasani156c4352010-03-05 17:10:03 -08003088 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003089 public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED =
3090 "lock_pattern_tactile_feedback_enabled";
3091
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003092 /**
3093 * A formatted string of the next alarm that is set, or the empty string
3094 * if there is no alarm set.
Adrian Roosc42a1e12014-07-07 23:35:53 +02003095 *
3096 * @deprecated Use {@link android.app.AlarmManager#getNextAlarmClock()}.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003097 */
Adrian Roosc42a1e12014-07-07 23:35:53 +02003098 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003099 public static final String NEXT_ALARM_FORMATTED = "next_alarm_formatted";
3100
Svetoslav683914b2015-01-15 14:22:26 -08003101 private static final Validator NEXT_ALARM_FORMATTED_VALIDATOR = new Validator() {
3102 private static final int MAX_LENGTH = 1000;
Svetoslav1b71ea92015-02-17 18:20:29 -08003103
Svetoslav683914b2015-01-15 14:22:26 -08003104 @Override
3105 public boolean validate(String value) {
3106 // TODO: No idea what the correct format is.
Svetoslav64d6e9c2015-02-12 11:30:36 -08003107 return value == null || value.length() < MAX_LENGTH;
Svetoslav683914b2015-01-15 14:22:26 -08003108 }
3109 };
3110
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003111 /**
3112 * Scaling factor for fonts, float.
3113 */
3114 public static final String FONT_SCALE = "font_scale";
3115
Svetoslav683914b2015-01-15 14:22:26 -08003116 private static final Validator FONT_SCALE_VALIDATOR = new Validator() {
3117 @Override
Annie Mengeed1b812018-05-21 16:34:52 +01003118 public boolean validate(@Nullable String value) {
Svetoslav683914b2015-01-15 14:22:26 -08003119 try {
3120 return Float.parseFloat(value) >= 0;
Annie Mengeed1b812018-05-21 16:34:52 +01003121 } catch (NumberFormatException | NullPointerException e) {
Svetoslav683914b2015-01-15 14:22:26 -08003122 return false;
3123 }
3124 }
3125 };
3126
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003127 /**
Seigo Nonakabd5cbdd2016-01-25 19:40:28 +09003128 * The serialized system locale value.
3129 *
3130 * Do not use this value directory.
Yohei Yukawa23cbe852016-05-17 16:42:58 -07003131 * To get system locale, use {@link LocaleList#getDefault} instead.
Seigo Nonakabd5cbdd2016-01-25 19:40:28 +09003132 * To update system locale, use {@link com.android.internal.app.LocalePicker#updateLocales}
3133 * instead.
3134 * @hide
3135 */
3136 public static final String SYSTEM_LOCALES = "system_locales";
3137
3138
3139 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003140 * Name of an application package to be debugged.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003141 *
3142 * @deprecated Use {@link Global#DEBUG_APP} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003143 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003144 @Deprecated
3145 public static final String DEBUG_APP = Global.DEBUG_APP;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003146
3147 /**
3148 * If 1, when launching DEBUG_APP it will wait for the debugger before
3149 * starting user code. If 0, it will run normally.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003150 *
3151 * @deprecated Use {@link Global#WAIT_FOR_DEBUGGER} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003152 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003153 @Deprecated
3154 public static final String WAIT_FOR_DEBUGGER = Global.WAIT_FOR_DEBUGGER;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003155
3156 /**
3157 * Whether or not to dim the screen. 0=no 1=yes
Jeff Brown96307042012-07-27 15:51:34 -07003158 * @deprecated This setting is no longer used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003159 */
Jeff Brown96307042012-07-27 15:51:34 -07003160 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003161 public static final String DIM_SCREEN = "dim_screen";
3162
Michal Karpinski2c37b082018-01-18 16:14:27 +00003163 private static final Validator DIM_SCREEN_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003164
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003165 /**
Christine Franks8ad71492017-10-24 19:04:22 -07003166 * The display color mode.
3167 * @hide
3168 */
3169 public static final String DISPLAY_COLOR_MODE = "display_color_mode";
3170
Christine Franks12699602017-10-30 18:38:48 -07003171 private static final Validator DISPLAY_COLOR_MODE_VALIDATOR =
Chia-I Wu1e0e7172018-03-14 15:45:29 -07003172 new SettingsValidators.InclusiveIntegerRangeValidator(
3173 ColorDisplayController.COLOR_MODE_NATURAL,
3174 ColorDisplayController.COLOR_MODE_AUTOMATIC);
Christine Franks12699602017-10-30 18:38:48 -07003175
Christine Franks8ad71492017-10-24 19:04:22 -07003176 /**
Jeff Brown05af6ad2014-09-30 20:54:30 -07003177 * The amount of time in milliseconds before the device goes to sleep or begins
3178 * to dream after a period of inactivity. This value is also known as the
3179 * user activity timeout period since the screen isn't necessarily turned off
3180 * when it expires.
yuemingw0de748d2017-11-15 19:22:27 +00003181 *
3182 * <p>
3183 * This value is bounded by maximum timeout set by
3184 * {@link android.app.admin.DevicePolicyManager#setMaximumTimeToLock(ComponentName, long)}.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003185 */
3186 public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout";
3187
Michal Karpinski2c37b082018-01-18 16:14:27 +00003188 private static final Validator SCREEN_OFF_TIMEOUT_VALIDATOR =
3189 NON_NEGATIVE_INTEGER_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003190
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003191 /**
3192 * The screen backlight brightness between 0 and 255.
3193 */
3194 public static final String SCREEN_BRIGHTNESS = "screen_brightness";
3195
3196 /**
Santos Cordon3107d292016-09-20 15:50:35 -07003197 * The screen backlight brightness between 0 and 255.
3198 * @hide
3199 */
3200 public static final String SCREEN_BRIGHTNESS_FOR_VR = "screen_brightness_for_vr";
3201
3202 private static final Validator SCREEN_BRIGHTNESS_FOR_VR_VALIDATOR =
Michal Karpinski2c37b082018-01-18 16:14:27 +00003203 new SettingsValidators.InclusiveIntegerRangeValidator(0, 255);
Santos Cordon3107d292016-09-20 15:50:35 -07003204
3205 /**
Dan Murphy951764b2009-08-27 14:59:03 -05003206 * Control whether to enable automatic brightness mode.
Dan Murphy951764b2009-08-27 14:59:03 -05003207 */
3208 public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode";
3209
Michal Karpinski2c37b082018-01-18 16:14:27 +00003210 private static final Validator SCREEN_BRIGHTNESS_MODE_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003211
Dan Murphy951764b2009-08-27 14:59:03 -05003212 /**
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08003213 * Adjustment to auto-brightness to make it generally more (>0.0 <1.0)
3214 * or less (<0.0 >-1.0) bright.
Dianne Hackborn518a3d82012-05-09 16:30:49 -07003215 * @hide
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08003216 */
3217 public static final String SCREEN_AUTO_BRIGHTNESS_ADJ = "screen_auto_brightness_adj";
3218
Svetoslav683914b2015-01-15 14:22:26 -08003219 private static final Validator SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR =
Michal Karpinski2c37b082018-01-18 16:14:27 +00003220 new SettingsValidators.InclusiveFloatRangeValidator(-1, 1);
Svetoslav683914b2015-01-15 14:22:26 -08003221
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08003222 /**
Mike Lockwooddc3494e2009-10-14 21:17:09 -07003223 * SCREEN_BRIGHTNESS_MODE value for manual mode.
Mike Lockwooddc3494e2009-10-14 21:17:09 -07003224 */
3225 public static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0;
3226
3227 /**
Scott Main52bfc242012-02-09 10:09:14 -08003228 * SCREEN_BRIGHTNESS_MODE value for automatic mode.
Mike Lockwooddc3494e2009-10-14 21:17:09 -07003229 */
3230 public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1;
3231
3232 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003233 * Control whether the process CPU usage meter should be shown.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003234 *
Nick Kralevichfc4a5c22016-10-11 09:01:38 -07003235 * @deprecated This functionality is no longer available as of
3236 * {@link android.os.Build.VERSION_CODES#N_MR1}.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003237 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003238 @Deprecated
3239 public static final String SHOW_PROCESSES = Global.SHOW_PROCESSES;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003240
3241 /**
3242 * If 1, the activity manager will aggressively finish activities and
3243 * processes as soon as they are no longer needed. If 0, the normal
3244 * extended lifetime is used.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003245 *
3246 * @deprecated Use {@link Global#ALWAYS_FINISH_ACTIVITIES} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003247 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003248 @Deprecated
3249 public static final String ALWAYS_FINISH_ACTIVITIES = Global.ALWAYS_FINISH_ACTIVITIES;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003250
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003251 /**
Beverlyd6964762018-02-16 14:07:03 -05003252 * Determines which streams are affected by ringer and zen mode changes. The
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003253 * stream type's bit should be set to 1 if it should be muted when going
3254 * into an inaudible ringer mode.
3255 */
3256 public static final String MODE_RINGER_STREAMS_AFFECTED = "mode_ringer_streams_affected";
3257
Svetoslav683914b2015-01-15 14:22:26 -08003258 private static final Validator MODE_RINGER_STREAMS_AFFECTED_VALIDATOR =
Michal Karpinski2c37b082018-01-18 16:14:27 +00003259 NON_NEGATIVE_INTEGER_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003260
3261 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003262 * Determines which streams are affected by mute. The
3263 * stream type's bit should be set to 1 if it should be muted when a mute request
3264 * is received.
3265 */
Svetoslav683914b2015-01-15 14:22:26 -08003266 public static final String MUTE_STREAMS_AFFECTED = "mute_streams_affected";
3267
3268 private static final Validator MUTE_STREAMS_AFFECTED_VALIDATOR =
Michal Karpinski2c37b082018-01-18 16:14:27 +00003269 NON_NEGATIVE_INTEGER_VALIDATOR;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003270
3271 /**
3272 * Whether vibrate is on for different events. This is used internally,
3273 * changing this value will not change the vibrate. See AudioManager.
3274 */
3275 public static final String VIBRATE_ON = "vibrate_on";
3276
Michal Karpinski2c37b082018-01-18 16:14:27 +00003277 private static final Validator VIBRATE_ON_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003278
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003279 /**
Jeff Brown7f6c2312012-04-13 20:38:38 -07003280 * If 1, redirects the system vibrator to all currently attached input devices
3281 * that support vibration. If there are no such input devices, then the system
3282 * vibrator is used instead.
3283 * If 0, does not register the system vibrator.
3284 *
3285 * This setting is mainly intended to provide a compatibility mechanism for
3286 * applications that only know about the system vibrator and do not use the
3287 * input device vibrator API.
3288 *
3289 * @hide
3290 */
3291 public static final String VIBRATE_INPUT_DEVICES = "vibrate_input_devices";
3292
Michal Karpinski2c37b082018-01-18 16:14:27 +00003293 private static final Validator VIBRATE_INPUT_DEVICES_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003294
Jeff Brown7f6c2312012-04-13 20:38:38 -07003295 /**
Michael Wright35a0c672018-01-24 00:32:53 +00003296 * The intensity of notification vibrations, if configurable.
3297 *
3298 * Not all devices are capable of changing their vibration intensity; on these devices
3299 * there will likely be no difference between the various vibration intensities except for
3300 * intensity 0 (off) and the rest.
3301 *
3302 * <b>Values:</b><br/>
3303 * 0 - Vibration is disabled<br/>
3304 * 1 - Weak vibrations<br/>
3305 * 2 - Medium vibrations<br/>
3306 * 3 - Strong vibrations
3307 * @hide
3308 */
3309 public static final String NOTIFICATION_VIBRATION_INTENSITY =
3310 "notification_vibration_intensity";
3311
3312 /**
3313 * The intensity of haptic feedback vibrations, if configurable.
3314 *
3315 * Not all devices are capable of changing their feedback intensity; on these devices
3316 * there will likely be no difference between the various vibration intensities except for
3317 * intensity 0 (off) and the rest.
3318 *
3319 * <b>Values:</b><br/>
3320 * 0 - Vibration is disabled<br/>
3321 * 1 - Weak vibrations<br/>
3322 * 2 - Medium vibrations<br/>
3323 * 3 - Strong vibrations
3324 * @hide
3325 */
3326 public static final String HAPTIC_FEEDBACK_INTENSITY =
3327 "haptic_feedback_intensity";
3328
3329 private static final Validator VIBRATION_INTENSITY_VALIDATOR =
3330 new SettingsValidators.InclusiveIntegerRangeValidator(0, 3);
3331
3332 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003333 * Ringer volume. This is used internally, changing this value will not
3334 * change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08003335 *
3336 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003337 */
3338 public static final String VOLUME_RING = "volume_ring";
3339
3340 /**
3341 * System/notifications volume. This is used internally, changing this
3342 * value will not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08003343 *
3344 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003345 */
3346 public static final String VOLUME_SYSTEM = "volume_system";
3347
3348 /**
3349 * Voice call volume. This is used internally, changing this value will
3350 * not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08003351 *
3352 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003353 */
3354 public static final String VOLUME_VOICE = "volume_voice";
3355
3356 /**
3357 * Music/media/gaming volume. This is used internally, changing this
3358 * value will not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08003359 *
3360 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003361 */
3362 public static final String VOLUME_MUSIC = "volume_music";
3363
3364 /**
3365 * Alarm volume. This is used internally, changing this
3366 * value will not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08003367 *
3368 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003369 */
3370 public static final String VOLUME_ALARM = "volume_alarm";
3371
3372 /**
3373 * Notification volume. This is used internally, changing this
3374 * value will not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08003375 *
3376 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003377 */
3378 public static final String VOLUME_NOTIFICATION = "volume_notification";
3379
3380 /**
Eric Laurent484d2882009-12-08 09:05:45 -08003381 * Bluetooth Headset volume. This is used internally, changing this value will
3382 * not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08003383 *
3384 * @removed Not used by anything since API 2.
Eric Laurent484d2882009-12-08 09:05:45 -08003385 */
3386 public static final String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco";
3387
3388 /**
Jean-Michel Trivia53b7052017-04-12 18:27:01 -07003389 * @hide
3390 * Acessibility volume. This is used internally, changing this
3391 * value will not change the volume.
3392 */
3393 public static final String VOLUME_ACCESSIBILITY = "volume_a11y";
3394
3395 /**
Mike Lockwood8517e462011-10-25 14:47:19 -04003396 * Master volume (float in the range 0.0f to 1.0f).
Svetoslavdbbeeb32015-02-18 19:16:25 -08003397 *
Mike Lockwood8517e462011-10-25 14:47:19 -04003398 * @hide
3399 */
3400 public static final String VOLUME_MASTER = "volume_master";
3401
3402 /**
Andy Hungf04b84d2015-12-18 17:33:27 -08003403 * Master mono (int 1 = mono, 0 = normal).
3404 *
3405 * @hide
3406 */
3407 public static final String MASTER_MONO = "master_mono";
3408
Michal Karpinski2c37b082018-01-18 16:14:27 +00003409 private static final Validator MASTER_MONO_VALIDATOR = BOOLEAN_VALIDATOR;
Andy Hungf04b84d2015-12-18 17:33:27 -08003410
3411 /**
Justin Koh57978ed2012-04-03 17:37:58 -07003412 * Whether the notifications should use the ring volume (value of 1) or
3413 * a separate notification volume (value of 0). In most cases, users
3414 * will have this enabled so the notification and ringer volumes will be
3415 * the same. However, power users can disable this and use the separate
3416 * notification volume control.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003417 * <p>
Justin Koh57978ed2012-04-03 17:37:58 -07003418 * Note: This is a one-off setting that will be removed in the future
3419 * when there is profile support. For this reason, it is kept hidden
3420 * from the public APIs.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003421 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003422 * @hide
Amith Yamasani42722bf2011-07-22 10:34:27 -07003423 * @deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003424 */
Gilles Debunnee90bed12011-08-30 14:28:27 -07003425 @Deprecated
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003426 public static final String NOTIFICATIONS_USE_RING_VOLUME =
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003427 "notifications_use_ring_volume";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003428
Michal Karpinski2c37b082018-01-18 16:14:27 +00003429 private static final Validator NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003430
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003431 /**
Daniel Sandler6329bf72010-02-26 15:17:44 -05003432 * Whether silent mode should allow vibration feedback. This is used
3433 * internally in AudioService and the Sound settings activity to
3434 * coordinate decoupling of vibrate and silent modes. This setting
3435 * will likely be removed in a future release with support for
3436 * audio/vibe feedback profiles.
3437 *
Eric Laurentbffc3d12012-05-07 17:43:49 -07003438 * Not used anymore. On devices with vibrator, the user explicitly selects
3439 * silent or vibrate mode.
3440 * Kept for use by legacy database upgrade code in DatabaseHelper.
Daniel Sandler6329bf72010-02-26 15:17:44 -05003441 * @hide
3442 */
3443 public static final String VIBRATE_IN_SILENT = "vibrate_in_silent";
3444
Michal Karpinski2c37b082018-01-18 16:14:27 +00003445 private static final Validator VIBRATE_IN_SILENT_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003446
Daniel Sandler6329bf72010-02-26 15:17:44 -05003447 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003448 * The mapping of stream type (integer) to its setting.
Svetoslavdbbeeb32015-02-18 19:16:25 -08003449 *
3450 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003451 */
3452 public static final String[] VOLUME_SETTINGS = {
3453 VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC,
Eric Laurent484d2882009-12-08 09:05:45 -08003454 VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003455 };
3456
3457 /**
Jean-Michel Trivia53b7052017-04-12 18:27:01 -07003458 * @hide
3459 * The mapping of stream type (integer) to its setting.
3460 * Unlike the VOLUME_SETTINGS array, this one contains as many entries as
3461 * AudioSystem.NUM_STREAM_TYPES, and has empty strings for stream types whose volumes
3462 * are never persisted.
3463 */
3464 public static final String[] VOLUME_SETTINGS_INT = {
3465 VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC,
3466 VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO,
3467 "" /*STREAM_SYSTEM_ENFORCED, no setting for this stream*/,
3468 "" /*STREAM_DTMF, no setting for this stream*/,
3469 "" /*STREAM_TTS, no setting for this stream*/,
3470 VOLUME_ACCESSIBILITY
3471 };
3472
3473 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003474 * Appended to various volume related settings to record the previous
3475 * values before they the settings were affected by a silent/vibrate
3476 * ringer mode change.
Svetoslavdbbeeb32015-02-18 19:16:25 -08003477 *
3478 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003479 */
3480 public static final String APPEND_FOR_LAST_AUDIBLE = "_last_audible";
3481
3482 /**
3483 * Persistent store for the system-wide default ringtone URI.
3484 * <p>
3485 * If you need to play the default ringtone at any given time, it is recommended
3486 * you give {@link #DEFAULT_RINGTONE_URI} to the media player. It will resolve
3487 * to the set default ringtone at the time of playing.
3488 *
3489 * @see #DEFAULT_RINGTONE_URI
3490 */
3491 public static final String RINGTONE = "ringtone";
3492
Michal Karpinski2c37b082018-01-18 16:14:27 +00003493 private static final Validator RINGTONE_VALIDATOR = URI_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003494
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003495 /**
3496 * A {@link Uri} that will point to the current default ringtone at any
3497 * given time.
3498 * <p>
3499 * If the current default ringtone is in the DRM provider and the caller
3500 * does not have permission, the exception will be a
3501 * FileNotFoundException.
3502 */
3503 public static final Uri DEFAULT_RINGTONE_URI = getUriFor(RINGTONE);
3504
Jeff Sharkey413573a2016-02-22 17:52:45 -07003505 /** {@hide} */
3506 public static final String RINGTONE_CACHE = "ringtone_cache";
3507 /** {@hide} */
3508 public static final Uri RINGTONE_CACHE_URI = getUriFor(RINGTONE_CACHE);
3509
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003510 /**
3511 * Persistent store for the system-wide default notification sound.
3512 *
3513 * @see #RINGTONE
3514 * @see #DEFAULT_NOTIFICATION_URI
3515 */
3516 public static final String NOTIFICATION_SOUND = "notification_sound";
3517
Michal Karpinski2c37b082018-01-18 16:14:27 +00003518 private static final Validator NOTIFICATION_SOUND_VALIDATOR = URI_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003519
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003520 /**
3521 * A {@link Uri} that will point to the current default notification
3522 * sound at any given time.
3523 *
3524 * @see #DEFAULT_RINGTONE_URI
3525 */
3526 public static final Uri DEFAULT_NOTIFICATION_URI = getUriFor(NOTIFICATION_SOUND);
3527
Jeff Sharkey413573a2016-02-22 17:52:45 -07003528 /** {@hide} */
3529 public static final String NOTIFICATION_SOUND_CACHE = "notification_sound_cache";
3530 /** {@hide} */
3531 public static final Uri NOTIFICATION_SOUND_CACHE_URI = getUriFor(NOTIFICATION_SOUND_CACHE);
3532
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003533 /**
Patrick Scott3156bb002009-04-13 09:57:38 -07003534 * Persistent store for the system-wide default alarm alert.
3535 *
3536 * @see #RINGTONE
3537 * @see #DEFAULT_ALARM_ALERT_URI
3538 */
3539 public static final String ALARM_ALERT = "alarm_alert";
3540
Michal Karpinski2c37b082018-01-18 16:14:27 +00003541 private static final Validator ALARM_ALERT_VALIDATOR = URI_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003542
Patrick Scott3156bb002009-04-13 09:57:38 -07003543 /**
3544 * A {@link Uri} that will point to the current default alarm alert at
3545 * any given time.
3546 *
3547 * @see #DEFAULT_ALARM_ALERT_URI
3548 */
3549 public static final Uri DEFAULT_ALARM_ALERT_URI = getUriFor(ALARM_ALERT);
3550
Jeff Sharkey413573a2016-02-22 17:52:45 -07003551 /** {@hide} */
3552 public static final String ALARM_ALERT_CACHE = "alarm_alert_cache";
3553 /** {@hide} */
3554 public static final Uri ALARM_ALERT_CACHE_URI = getUriFor(ALARM_ALERT_CACHE);
3555
Patrick Scott3156bb002009-04-13 09:57:38 -07003556 /**
Jean-Michel Trivid589fea2011-04-15 11:28:10 -07003557 * Persistent store for the system default media button event receiver.
3558 *
3559 * @hide
3560 */
3561 public static final String MEDIA_BUTTON_RECEIVER = "media_button_receiver";
3562
Michal Karpinski2c37b082018-01-18 16:14:27 +00003563 private static final Validator MEDIA_BUTTON_RECEIVER_VALIDATOR = COMPONENT_NAME_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003564
Jean-Michel Trivid589fea2011-04-15 11:28:10 -07003565 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003566 * Setting to enable Auto Replace (AutoText) in text editors. 1 = On, 0 = Off
3567 */
3568 public static final String TEXT_AUTO_REPLACE = "auto_replace";
3569
Michal Karpinski2c37b082018-01-18 16:14:27 +00003570 private static final Validator TEXT_AUTO_REPLACE_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003571
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003572 /**
3573 * Setting to enable Auto Caps in text editors. 1 = On, 0 = Off
3574 */
3575 public static final String TEXT_AUTO_CAPS = "auto_caps";
3576
Michal Karpinski2c37b082018-01-18 16:14:27 +00003577 private static final Validator TEXT_AUTO_CAPS_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003578
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003579 /**
3580 * Setting to enable Auto Punctuate in text editors. 1 = On, 0 = Off. This
3581 * feature converts two spaces to a "." and space.
3582 */
3583 public static final String TEXT_AUTO_PUNCTUATE = "auto_punctuate";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003584
Michal Karpinski2c37b082018-01-18 16:14:27 +00003585 private static final Validator TEXT_AUTO_PUNCTUATE_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003586
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003587 /**
3588 * Setting to showing password characters in text editors. 1 = On, 0 = Off
3589 */
3590 public static final String TEXT_SHOW_PASSWORD = "show_password";
3591
Michal Karpinski2c37b082018-01-18 16:14:27 +00003592 private static final Validator TEXT_SHOW_PASSWORD_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003593
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003594 public static final String SHOW_GTALK_SERVICE_STATUS =
3595 "SHOW_GTALK_SERVICE_STATUS";
3596
Michal Karpinski2c37b082018-01-18 16:14:27 +00003597 private static final Validator SHOW_GTALK_SERVICE_STATUS_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003598
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003599 /**
3600 * Name of activity to use for wallpaper on the home screen.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003601 *
3602 * @deprecated Use {@link WallpaperManager} instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003603 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003604 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003605 public static final String WALLPAPER_ACTIVITY = "wallpaper_activity";
3606
Svetoslav683914b2015-01-15 14:22:26 -08003607 private static final Validator WALLPAPER_ACTIVITY_VALIDATOR = new Validator() {
3608 private static final int MAX_LENGTH = 1000;
3609
3610 @Override
3611 public boolean validate(String value) {
3612 if (value != null && value.length() > MAX_LENGTH) {
3613 return false;
3614 }
3615 return ComponentName.unflattenFromString(value) != null;
3616 }
3617 };
3618
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003619 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003620 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME}
3621 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003622 */
Christopher Tate06efb532012-08-24 15:29:27 -07003623 @Deprecated
3624 public static final String AUTO_TIME = Global.AUTO_TIME;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003625
Michal Karpinski2c37b082018-01-18 16:14:27 +00003626 private static final Validator AUTO_TIME_VALIDATOR = BOOLEAN_VALIDATOR;
3627
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003628 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003629 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME_ZONE}
3630 * instead
Amith Yamasaniad450be2010-09-16 16:47:00 -07003631 */
Christopher Tate06efb532012-08-24 15:29:27 -07003632 @Deprecated
3633 public static final String AUTO_TIME_ZONE = Global.AUTO_TIME_ZONE;
Amith Yamasaniad450be2010-09-16 16:47:00 -07003634
Michal Karpinski2c37b082018-01-18 16:14:27 +00003635 private static final Validator AUTO_TIME_ZONE_VALIDATOR = BOOLEAN_VALIDATOR;
3636
Amith Yamasaniad450be2010-09-16 16:47:00 -07003637 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003638 * Display times as 12 or 24 hours
3639 * 12
3640 * 24
3641 */
3642 public static final String TIME_12_24 = "time_12_24";
3643
Svetoslav683914b2015-01-15 14:22:26 -08003644 /** @hide */
3645 public static final Validator TIME_12_24_VALIDATOR =
Michal Karpinski2c37b082018-01-18 16:14:27 +00003646 new SettingsValidators.DiscreteValueValidator(new String[] {"12", "24", null});
Svetoslav683914b2015-01-15 14:22:26 -08003647
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003648 /**
3649 * Date format string
3650 * mm/dd/yyyy
3651 * dd/mm/yyyy
3652 * yyyy/mm/dd
3653 */
3654 public static final String DATE_FORMAT = "date_format";
3655
Svetoslav683914b2015-01-15 14:22:26 -08003656 /** @hide */
3657 public static final Validator DATE_FORMAT_VALIDATOR = new Validator() {
3658 @Override
Annie Mengeed1b812018-05-21 16:34:52 +01003659 public boolean validate(@Nullable String value) {
Svetoslav683914b2015-01-15 14:22:26 -08003660 try {
3661 new SimpleDateFormat(value);
3662 return true;
Annie Mengeed1b812018-05-21 16:34:52 +01003663 } catch (IllegalArgumentException | NullPointerException e) {
Svetoslav683914b2015-01-15 14:22:26 -08003664 return false;
3665 }
3666 }
3667 };
3668
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003669 /**
3670 * Whether the setup wizard has been run before (on first boot), or if
3671 * it still needs to be run.
3672 *
3673 * nonzero = it has been run in the past
3674 * 0 = it has not been run in the past
3675 */
3676 public static final String SETUP_WIZARD_HAS_RUN = "setup_wizard_has_run";
3677
Svetoslav683914b2015-01-15 14:22:26 -08003678 /** @hide */
Michal Karpinski2c37b082018-01-18 16:14:27 +00003679 public static final Validator SETUP_WIZARD_HAS_RUN_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003680
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003681 /**
3682 * Scaling factor for normal window animations. Setting to 0 will disable window
3683 * animations.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003684 *
3685 * @deprecated Use {@link Global#WINDOW_ANIMATION_SCALE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003686 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003687 @Deprecated
3688 public static final String WINDOW_ANIMATION_SCALE = Global.WINDOW_ANIMATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003689
3690 /**
3691 * Scaling factor for activity transition animations. Setting to 0 will disable window
3692 * animations.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003693 *
3694 * @deprecated Use {@link Global#TRANSITION_ANIMATION_SCALE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003695 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003696 @Deprecated
3697 public static final String TRANSITION_ANIMATION_SCALE = Global.TRANSITION_ANIMATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003698
3699 /**
Chet Haasec38fa1f2012-02-01 16:37:46 -08003700 * Scaling factor for Animator-based animations. This affects both the start delay and
3701 * duration of all such animations. Setting to 0 will cause animations to end immediately.
3702 * The default value is 1.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003703 *
3704 * @deprecated Use {@link Global#ANIMATOR_DURATION_SCALE} instead
Chet Haasec38fa1f2012-02-01 16:37:46 -08003705 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003706 @Deprecated
3707 public static final String ANIMATOR_DURATION_SCALE = Global.ANIMATOR_DURATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003708
3709 /**
3710 * Control whether the accelerometer will be used to change screen
3711 * orientation. If 0, it will not be used unless explicitly requested
3712 * by the application; if 1, it will be used by default unless explicitly
3713 * disabled by the application.
3714 */
3715 public static final String ACCELEROMETER_ROTATION = "accelerometer_rotation";
3716
Svetoslav683914b2015-01-15 14:22:26 -08003717 /** @hide */
Michal Karpinski2c37b082018-01-18 16:14:27 +00003718 public static final Validator ACCELEROMETER_ROTATION_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003719
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003720 /**
Daniel Sandlerb73617d2010-08-17 00:41:00 -04003721 * Default screen rotation when no other policy applies.
3722 * When {@link #ACCELEROMETER_ROTATION} is zero and no on-screen Activity expresses a
3723 * preference, this rotation value will be used. Must be one of the
Brian Muramatsue1d46982010-12-06 17:34:20 -08003724 * {@link android.view.Surface#ROTATION_0 Surface rotation constants}.
Daniel Sandlerb73617d2010-08-17 00:41:00 -04003725 *
Dianne Hackborn16ec0802014-08-15 18:32:33 -07003726 * @see android.view.Display#getRotation
Daniel Sandlerb73617d2010-08-17 00:41:00 -04003727 */
3728 public static final String USER_ROTATION = "user_rotation";
3729
Svetoslav683914b2015-01-15 14:22:26 -08003730 /** @hide */
3731 public static final Validator USER_ROTATION_VALIDATOR =
Michal Karpinski2c37b082018-01-18 16:14:27 +00003732 new SettingsValidators.InclusiveIntegerRangeValidator(0, 3);
Svetoslav683914b2015-01-15 14:22:26 -08003733
Daniel Sandlerb73617d2010-08-17 00:41:00 -04003734 /**
Jeff Brown207673cd2012-06-05 17:47:11 -07003735 * Control whether the rotation lock toggle in the System UI should be hidden.
3736 * Typically this is done for accessibility purposes to make it harder for
3737 * the user to accidentally toggle the rotation lock while the display rotation
3738 * has been locked for accessibility.
3739 *
3740 * If 0, then rotation lock toggle is not hidden for accessibility (although it may be
3741 * unavailable for other reasons). If 1, then the rotation lock toggle is hidden.
3742 *
3743 * @hide
3744 */
3745 public static final String HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY =
3746 "hide_rotation_lock_toggle_for_accessibility";
3747
Svetoslav683914b2015-01-15 14:22:26 -08003748 /** @hide */
3749 public static final Validator HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR =
Michal Karpinski2c37b082018-01-18 16:14:27 +00003750 BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003751
Jeff Brown207673cd2012-06-05 17:47:11 -07003752 /**
Daisuke Miyakawa3c60eeb2012-05-08 12:08:25 -07003753 * Whether the phone vibrates when it is ringing due to an incoming call. This will
3754 * be used by Phone and Setting apps; it shouldn't affect other apps.
3755 * The value is boolean (1 or 0).
3756 *
3757 * Note: this is not same as "vibrate on ring", which had been available until ICS.
3758 * It was about AudioManager's setting and thus affected all the applications which
3759 * relied on the setting, while this is purely about the vibration setting for incoming
3760 * calls.
Daisuke Miyakawa3c60eeb2012-05-08 12:08:25 -07003761 */
3762 public static final String VIBRATE_WHEN_RINGING = "vibrate_when_ringing";
3763
Svetoslav683914b2015-01-15 14:22:26 -08003764 /** @hide */
Michal Karpinski2c37b082018-01-18 16:14:27 +00003765 public static final Validator VIBRATE_WHEN_RINGING_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003766
Daisuke Miyakawa3c60eeb2012-05-08 12:08:25 -07003767 /**
Tyler Gunn37ce6692018-03-12 14:31:45 -07003768 * When {@code 1}, Telecom enhanced call blocking functionality is enabled. When
3769 * {@code 0}, enhanced call blocking functionality is disabled.
3770 * @hide
3771 */
3772 public static final String DEBUG_ENABLE_ENHANCED_CALL_BLOCKING =
3773 "debug.enable_enhanced_calling";
3774
3775 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003776 * Whether the audible DTMF tones are played by the dialer when dialing. The value is
3777 * boolean (1 or 0).
3778 */
3779 public static final String DTMF_TONE_WHEN_DIALING = "dtmf_tone";
3780
Svetoslav683914b2015-01-15 14:22:26 -08003781 /** @hide */
Michal Karpinski2c37b082018-01-18 16:14:27 +00003782 public static final Validator DTMF_TONE_WHEN_DIALING_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003783
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003784 /**
David Kraused0f67152009-06-13 18:01:13 -05003785 * CDMA only settings
3786 * DTMF tone type played by the dialer when dialing.
3787 * 0 = Normal
3788 * 1 = Long
David Kraused0f67152009-06-13 18:01:13 -05003789 */
3790 public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type";
3791
Svetoslav683914b2015-01-15 14:22:26 -08003792 /** @hide */
Michal Karpinski2c37b082018-01-18 16:14:27 +00003793 public static final Validator DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003794
David Kraused0f67152009-06-13 18:01:13 -05003795 /**
David Kraused0f67152009-06-13 18:01:13 -05003796 * Whether the hearing aid is enabled. The value is
3797 * boolean (1 or 0).
3798 * @hide
3799 */
3800 public static final String HEARING_AID = "hearing_aid";
3801
Svetoslav683914b2015-01-15 14:22:26 -08003802 /** @hide */
Michal Karpinski2c37b082018-01-18 16:14:27 +00003803 public static final Validator HEARING_AID_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003804
David Kraused0f67152009-06-13 18:01:13 -05003805 /**
3806 * CDMA only settings
3807 * TTY Mode
3808 * 0 = OFF
3809 * 1 = FULL
3810 * 2 = VCO
3811 * 3 = HCO
3812 * @hide
3813 */
3814 public static final String TTY_MODE = "tty_mode";
3815
Svetoslav683914b2015-01-15 14:22:26 -08003816 /** @hide */
Michal Karpinski2c37b082018-01-18 16:14:27 +00003817 public static final Validator TTY_MODE_VALIDATOR =
3818 new SettingsValidators.InclusiveIntegerRangeValidator(0, 3);
Svetoslav683914b2015-01-15 14:22:26 -08003819
David Kraused0f67152009-06-13 18:01:13 -05003820 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003821 * Whether the sounds effects (key clicks, lid open ...) are enabled. The value is
3822 * boolean (1 or 0).
3823 */
3824 public static final String SOUND_EFFECTS_ENABLED = "sound_effects_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003825
Svetoslav683914b2015-01-15 14:22:26 -08003826 /** @hide */
Michal Karpinski2c37b082018-01-18 16:14:27 +00003827 public static final Validator SOUND_EFFECTS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003828
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003829 /**
Antony Sargent4457bb82018-03-12 16:10:56 -07003830 * Whether haptic feedback (Vibrate on tap) is enabled. The value is
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003831 * boolean (1 or 0).
3832 */
3833 public static final String HAPTIC_FEEDBACK_ENABLED = "haptic_feedback_enabled";
Sanjay Jeyakumar21bf2412009-07-09 13:31:48 -07003834
Svetoslav683914b2015-01-15 14:22:26 -08003835 /** @hide */
Michal Karpinski2c37b082018-01-18 16:14:27 +00003836 public static final Validator HAPTIC_FEEDBACK_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003837
Mike LeBeau48603e72009-06-05 00:27:00 +01003838 /**
Bjorn Bringert24abb662010-09-21 12:21:18 +01003839 * @deprecated Each application that shows web suggestions should have its own
3840 * setting for this.
Mike LeBeau48603e72009-06-05 00:27:00 +01003841 */
Bjorn Bringert24abb662010-09-21 12:21:18 +01003842 @Deprecated
Mike LeBeau48603e72009-06-05 00:27:00 +01003843 public static final String SHOW_WEB_SUGGESTIONS = "show_web_suggestions";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003844
Svetoslav683914b2015-01-15 14:22:26 -08003845 /** @hide */
Michal Karpinski2c37b082018-01-18 16:14:27 +00003846 public static final Validator SHOW_WEB_SUGGESTIONS_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003847
-b master501eec92009-07-06 13:53:11 -07003848 /**
Amith Yamasaniae3ed702009-12-01 19:02:05 -08003849 * Whether the notification LED should repeatedly flash when a notification is
3850 * pending. The value is boolean (1 or 0).
3851 * @hide
3852 */
3853 public static final String NOTIFICATION_LIGHT_PULSE = "notification_light_pulse";
3854
Svetoslav683914b2015-01-15 14:22:26 -08003855 /** @hide */
Michal Karpinski2c37b082018-01-18 16:14:27 +00003856 public static final Validator NOTIFICATION_LIGHT_PULSE_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003857
Amith Yamasaniae3ed702009-12-01 19:02:05 -08003858 /**
Dianne Hackborn90d2db32010-02-11 22:19:06 -08003859 * Show pointer location on screen?
3860 * 0 = no
3861 * 1 = yes
3862 * @hide
3863 */
3864 public static final String POINTER_LOCATION = "pointer_location";
3865
Svetoslav683914b2015-01-15 14:22:26 -08003866 /** @hide */
Michal Karpinski2c37b082018-01-18 16:14:27 +00003867 public static final Validator POINTER_LOCATION_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003868
Dianne Hackborn90d2db32010-02-11 22:19:06 -08003869 /**
Jeff Browndaf4a122011-08-26 17:14:14 -07003870 * Show touch positions on screen?
3871 * 0 = no
3872 * 1 = yes
3873 * @hide
3874 */
3875 public static final String SHOW_TOUCHES = "show_touches";
3876
Svetoslav683914b2015-01-15 14:22:26 -08003877 /** @hide */
Michal Karpinski2c37b082018-01-18 16:14:27 +00003878 public static final Validator SHOW_TOUCHES_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003879
Jeff Browndaf4a122011-08-26 17:14:14 -07003880 /**
Dianne Hackborn16ec0802014-08-15 18:32:33 -07003881 * Log raw orientation data from
Jorim Jaggib10e33f2015-02-04 21:57:40 +01003882 * {@link com.android.server.policy.WindowOrientationListener} for use with the
Jeff Brown4519f072011-01-23 13:16:01 -08003883 * orientationplot.py tool.
3884 * 0 = no
3885 * 1 = yes
3886 * @hide
3887 */
3888 public static final String WINDOW_ORIENTATION_LISTENER_LOG =
3889 "window_orientation_listener_log";
3890
Svetoslav683914b2015-01-15 14:22:26 -08003891 /** @hide */
Michal Karpinski2c37b082018-01-18 16:14:27 +00003892 public static final Validator WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003893
Jeff Brown4519f072011-01-23 13:16:01 -08003894 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003895 * @deprecated Use {@link android.provider.Settings.Global#POWER_SOUNDS_ENABLED}
3896 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003897 * @hide
3898 */
Christopher Tate06efb532012-08-24 15:29:27 -07003899 @Deprecated
3900 public static final String POWER_SOUNDS_ENABLED = Global.POWER_SOUNDS_ENABLED;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003901
Michal Karpinski2c37b082018-01-18 16:14:27 +00003902 private static final Validator POWER_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
3903
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003904 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003905 * @deprecated Use {@link android.provider.Settings.Global#DOCK_SOUNDS_ENABLED}
3906 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003907 * @hide
3908 */
Christopher Tate06efb532012-08-24 15:29:27 -07003909 @Deprecated
3910 public static final String DOCK_SOUNDS_ENABLED = Global.DOCK_SOUNDS_ENABLED;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003911
Michal Karpinski2c37b082018-01-18 16:14:27 +00003912 private static final Validator DOCK_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
3913
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003914 /**
3915 * Whether to play sounds when the keyguard is shown and dismissed.
3916 * @hide
3917 */
3918 public static final String LOCKSCREEN_SOUNDS_ENABLED = "lockscreen_sounds_enabled";
3919
Svetoslav683914b2015-01-15 14:22:26 -08003920 /** @hide */
Michal Karpinski2c37b082018-01-18 16:14:27 +00003921 public static final Validator LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003922
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003923 /**
Mike Lockwood7bef7392011-10-20 16:51:53 -04003924 * Whether the lockscreen should be completely disabled.
3925 * @hide
3926 */
3927 public static final String LOCKSCREEN_DISABLED = "lockscreen.disabled";
3928
Svetoslav683914b2015-01-15 14:22:26 -08003929 /** @hide */
Michal Karpinski2c37b082018-01-18 16:14:27 +00003930 public static final Validator LOCKSCREEN_DISABLED_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003931
Mike Lockwood7bef7392011-10-20 16:51:53 -04003932 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003933 * @deprecated Use {@link android.provider.Settings.Global#LOW_BATTERY_SOUND}
3934 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003935 * @hide
3936 */
Christopher Tate06efb532012-08-24 15:29:27 -07003937 @Deprecated
3938 public static final String LOW_BATTERY_SOUND = Global.LOW_BATTERY_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003939
3940 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003941 * @deprecated Use {@link android.provider.Settings.Global#DESK_DOCK_SOUND}
3942 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003943 * @hide
3944 */
Christopher Tate06efb532012-08-24 15:29:27 -07003945 @Deprecated
3946 public static final String DESK_DOCK_SOUND = Global.DESK_DOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003947
3948 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003949 * @deprecated Use {@link android.provider.Settings.Global#DESK_UNDOCK_SOUND}
3950 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003951 * @hide
3952 */
Christopher Tate06efb532012-08-24 15:29:27 -07003953 @Deprecated
3954 public static final String DESK_UNDOCK_SOUND = Global.DESK_UNDOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003955
3956 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003957 * @deprecated Use {@link android.provider.Settings.Global#CAR_DOCK_SOUND}
3958 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003959 * @hide
3960 */
Christopher Tate06efb532012-08-24 15:29:27 -07003961 @Deprecated
3962 public static final String CAR_DOCK_SOUND = Global.CAR_DOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003963
3964 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003965 * @deprecated Use {@link android.provider.Settings.Global#CAR_UNDOCK_SOUND}
3966 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003967 * @hide
3968 */
Christopher Tate06efb532012-08-24 15:29:27 -07003969 @Deprecated
3970 public static final String CAR_UNDOCK_SOUND = Global.CAR_UNDOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003971
3972 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003973 * @deprecated Use {@link android.provider.Settings.Global#LOCK_SOUND}
3974 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003975 * @hide
3976 */
Christopher Tate06efb532012-08-24 15:29:27 -07003977 @Deprecated
3978 public static final String LOCK_SOUND = Global.LOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003979
3980 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003981 * @deprecated Use {@link android.provider.Settings.Global#UNLOCK_SOUND}
3982 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003983 * @hide
3984 */
Christopher Tate06efb532012-08-24 15:29:27 -07003985 @Deprecated
3986 public static final String UNLOCK_SOUND = Global.UNLOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003987
3988 /**
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003989 * Receive incoming SIP calls?
3990 * 0 = no
3991 * 1 = yes
3992 * @hide
3993 */
3994 public static final String SIP_RECEIVE_CALLS = "sip_receive_calls";
3995
Svetoslav683914b2015-01-15 14:22:26 -08003996 /** @hide */
Michal Karpinski2c37b082018-01-18 16:14:27 +00003997 public static final Validator SIP_RECEIVE_CALLS_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003998
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003999 /**
4000 * Call Preference String.
4001 * "SIP_ALWAYS" : Always use SIP with network access
4002 * "SIP_ADDRESS_ONLY" : Only if destination is a SIP address
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08004003 * @hide
4004 */
4005 public static final String SIP_CALL_OPTIONS = "sip_call_options";
4006
Svetoslav683914b2015-01-15 14:22:26 -08004007 /** @hide */
Michal Karpinski2c37b082018-01-18 16:14:27 +00004008 public static final Validator SIP_CALL_OPTIONS_VALIDATOR =
4009 new SettingsValidators.DiscreteValueValidator(
4010 new String[] {"SIP_ALWAYS", "SIP_ADDRESS_ONLY"});
Svetoslav683914b2015-01-15 14:22:26 -08004011
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08004012 /**
4013 * One of the sip call options: Always use SIP with network access.
4014 * @hide
4015 */
4016 public static final String SIP_ALWAYS = "SIP_ALWAYS";
4017
Svetoslav683914b2015-01-15 14:22:26 -08004018 /** @hide */
Michal Karpinski2c37b082018-01-18 16:14:27 +00004019 public static final Validator SIP_ALWAYS_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08004020
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08004021 /**
4022 * One of the sip call options: Only if destination is a SIP address.
4023 * @hide
4024 */
4025 public static final String SIP_ADDRESS_ONLY = "SIP_ADDRESS_ONLY";
4026
Svetoslav683914b2015-01-15 14:22:26 -08004027 /** @hide */
Michal Karpinski2c37b082018-01-18 16:14:27 +00004028 public static final Validator SIP_ADDRESS_ONLY_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08004029
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08004030 /**
Tyler Gunn2c830a22014-09-02 08:39:35 -07004031 * @deprecated Use SIP_ALWAYS or SIP_ADDRESS_ONLY instead. Formerly used to indicate that
4032 * the user should be prompted each time a call is made whether it should be placed using
4033 * SIP. The {@link com.android.providers.settings.DatabaseHelper} replaces this with
4034 * SIP_ADDRESS_ONLY.
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08004035 * @hide
4036 */
Tyler Gunn2c830a22014-09-02 08:39:35 -07004037 @Deprecated
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08004038 public static final String SIP_ASK_ME_EACH_TIME = "SIP_ASK_ME_EACH_TIME";
4039
Svetoslav683914b2015-01-15 14:22:26 -08004040 /** @hide */
Michal Karpinski2c37b082018-01-18 16:14:27 +00004041 public static final Validator SIP_ASK_ME_EACH_TIME_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08004042
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08004043 /**
Jeff Brown1a84fd12011-06-02 01:26:32 -07004044 * Pointer speed setting.
4045 * This is an integer value in a range between -7 and +7, so there are 15 possible values.
4046 * -7 = slowest
4047 * 0 = default speed
4048 * +7 = fastest
4049 * @hide
4050 */
4051 public static final String POINTER_SPEED = "pointer_speed";
4052
Svetoslav683914b2015-01-15 14:22:26 -08004053 /** @hide */
4054 public static final Validator POINTER_SPEED_VALIDATOR =
Michal Karpinski2c37b082018-01-18 16:14:27 +00004055 new SettingsValidators.InclusiveFloatRangeValidator(-7, 7);
Svetoslav683914b2015-01-15 14:22:26 -08004056
Jeff Brown1a84fd12011-06-02 01:26:32 -07004057 /**
Jason Monk56e09b42014-07-18 10:29:14 -04004058 * Whether lock-to-app will be triggered by long-press on recents.
4059 * @hide
4060 */
4061 public static final String LOCK_TO_APP_ENABLED = "lock_to_app_enabled";
4062
Svetoslav683914b2015-01-15 14:22:26 -08004063 /** @hide */
Michal Karpinski2c37b082018-01-18 16:14:27 +00004064 public static final Validator LOCK_TO_APP_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08004065
Jason Monk56e09b42014-07-18 10:29:14 -04004066 /**
Daniel Sandler2fdb68b2013-10-03 00:12:11 -04004067 * I am the lolrus.
4068 * <p>
4069 * Nonzero values indicate that the user has a bukkit.
4070 * Backward-compatible with <code>PrefGetPreference(prefAllowEasterEggs)</code>.
4071 * @hide
4072 */
4073 public static final String EGG_MODE = "egg_mode";
4074
Svetoslav683914b2015-01-15 14:22:26 -08004075 /** @hide */
Svet Ganovb1918a02015-05-15 09:32:55 -07004076 public static final Validator EGG_MODE_VALIDATOR = new Validator() {
4077 @Override
Annie Mengeed1b812018-05-21 16:34:52 +01004078 public boolean validate(@Nullable String value) {
Svet Ganovb1918a02015-05-15 09:32:55 -07004079 try {
4080 return Long.parseLong(value) >= 0;
4081 } catch (NumberFormatException e) {
4082 return false;
4083 }
4084 }
4085 };
Svetoslav683914b2015-01-15 14:22:26 -08004086
4087 /**
Evan Lairdbcf631d2017-03-10 10:56:45 -05004088 * Setting to determine whether or not to show the battery percentage in the status bar.
4089 * 0 - Don't show percentage
4090 * 1 - Show percentage
4091 * @hide
4092 */
4093 public static final String SHOW_BATTERY_PERCENT = "status_bar_show_battery_percent";
4094
4095 /** @hide */
Michal Karpinski2c37b082018-01-18 16:14:27 +00004096 private static final Validator SHOW_BATTERY_PERCENT_VALIDATOR = BOOLEAN_VALIDATOR;
Evan Lairdbcf631d2017-03-10 10:56:45 -05004097
4098 /**
Svetoslav683914b2015-01-15 14:22:26 -08004099 * IMPORTANT: If you add a new public settings you also have to add it to
4100 * PUBLIC_SETTINGS below. If the new setting is hidden you have to add
4101 * it to PRIVATE_SETTINGS below. Also add a validator that can validate
4102 * the setting value. See an example above.
4103 */
4104
Daniel Sandler2fdb68b2013-10-03 00:12:11 -04004105 /**
-b master501eec92009-07-06 13:53:11 -07004106 * Settings to backup. This is here so that it's in the same place as the settings
4107 * keys and easy to update.
Svetoslav Ganova571a582011-09-20 18:32:20 -07004108 *
4109 * NOTE: Settings are backed up and restored in the order they appear
4110 * in this array. If you have one setting depending on another,
4111 * make sure that they are ordered appropriately.
4112 *
-b master501eec92009-07-06 13:53:11 -07004113 * @hide
4114 */
4115 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate66488d62012-10-02 11:58:01 -07004116 STAY_ON_WHILE_PLUGGED_IN, // moved to global
-b master501eec92009-07-06 13:53:11 -07004117 WIFI_USE_STATIC_IP,
4118 WIFI_STATIC_IP,
4119 WIFI_STATIC_GATEWAY,
4120 WIFI_STATIC_NETMASK,
4121 WIFI_STATIC_DNS1,
4122 WIFI_STATIC_DNS2,
4123 BLUETOOTH_DISCOVERABILITY,
4124 BLUETOOTH_DISCOVERABILITY_TIMEOUT,
Casey Burkhardt86b867f2015-12-29 18:03:36 -08004125 FONT_SCALE,
-b master501eec92009-07-06 13:53:11 -07004126 DIM_SCREEN,
4127 SCREEN_OFF_TIMEOUT,
Christopher Tate362aca62009-09-25 15:58:03 -07004128 SCREEN_BRIGHTNESS_MODE,
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08004129 SCREEN_AUTO_BRIGHTNESS_ADJ,
Santos Cordonbd9dd552017-02-13 13:37:45 -08004130 SCREEN_BRIGHTNESS_FOR_VR,
Jeff Brown7f6c2312012-04-13 20:38:38 -07004131 VIBRATE_INPUT_DEVICES,
Amith Yamasani8823c0a82009-07-07 14:30:17 -07004132 MODE_RINGER_STREAMS_AFFECTED,
-b master501eec92009-07-06 13:53:11 -07004133 TEXT_AUTO_REPLACE,
4134 TEXT_AUTO_CAPS,
4135 TEXT_AUTO_PUNCTUATE,
4136 TEXT_SHOW_PASSWORD,
Christopher Tate66488d62012-10-02 11:58:01 -07004137 AUTO_TIME, // moved to global
4138 AUTO_TIME_ZONE, // moved to global
-b master501eec92009-07-06 13:53:11 -07004139 TIME_12_24,
4140 DATE_FORMAT,
-b master501eec92009-07-06 13:53:11 -07004141 DTMF_TONE_WHEN_DIALING,
4142 DTMF_TONE_TYPE_WHEN_DIALING,
-b master501eec92009-07-06 13:53:11 -07004143 HEARING_AID,
4144 TTY_MODE,
Christopher Tateea2d6e82016-05-19 16:55:49 -07004145 MASTER_MONO,
-b master501eec92009-07-06 13:53:11 -07004146 SOUND_EFFECTS_ENABLED,
4147 HAPTIC_FEEDBACK_ENABLED,
Christopher Tate66488d62012-10-02 11:58:01 -07004148 POWER_SOUNDS_ENABLED, // moved to global
4149 DOCK_SOUNDS_ENABLED, // moved to global
Christopher Tate14c2d792010-02-25 16:49:44 -08004150 LOCKSCREEN_SOUNDS_ENABLED,
Amith Yamasaniae3ed702009-12-01 19:02:05 -08004151 SHOW_WEB_SUGGESTIONS,
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08004152 SIP_CALL_OPTIONS,
Nick Pelly038cabe2010-09-23 16:12:11 -07004153 SIP_RECEIVE_CALLS,
Jeff Brown1a84fd12011-06-02 01:26:32 -07004154 POINTER_SPEED,
Amith Yamasani622bf2222013-09-06 13:54:28 -07004155 VIBRATE_WHEN_RINGING,
4156 RINGTONE,
Jason Monk94cfd9d2014-10-31 13:18:21 -04004157 LOCK_TO_APP_ENABLED,
Anna Galuszafa7786c2015-12-22 10:53:44 -08004158 NOTIFICATION_SOUND,
Evan Lairdbcf631d2017-03-10 10:56:45 -05004159 ACCELEROMETER_ROTATION,
Michael Wright35a0c672018-01-24 00:32:53 +00004160 SHOW_BATTERY_PERCENT,
4161 NOTIFICATION_VIBRATION_INTENSITY,
4162 HAPTIC_FEEDBACK_INTENSITY,
chenedwardc47329b2018-05-03 12:13:45 +08004163 DISPLAY_COLOR_MODE,
4164 ALARM_ALERT
-b master501eec92009-07-06 13:53:11 -07004165 };
4166
Sailesh Nepal1bd78762014-02-11 22:32:21 -08004167 /**
Christopher Tate1d0fca32017-06-06 13:30:00 -07004168 * Keys we no longer back up under the current schema, but want to continue to
4169 * process when restoring historical backup datasets.
4170 *
Michal Karpinski964943a2018-01-19 16:28:26 +00004171 * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator,
4172 * otherwise they won't be restored.
4173 *
Christopher Tate1d0fca32017-06-06 13:30:00 -07004174 * @hide
4175 */
4176 public static final String[] LEGACY_RESTORE_SETTINGS = {
4177 };
4178
4179 /**
Amith Yamasanib0ff3222015-03-04 09:56:14 -08004180 * These are all public system settings
Svetoslav683914b2015-01-15 14:22:26 -08004181 *
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07004182 * @hide
4183 */
Svetoslav683914b2015-01-15 14:22:26 -08004184 public static final Set<String> PUBLIC_SETTINGS = new ArraySet<>();
4185 static {
4186 PUBLIC_SETTINGS.add(END_BUTTON_BEHAVIOR);
4187 PUBLIC_SETTINGS.add(WIFI_USE_STATIC_IP);
4188 PUBLIC_SETTINGS.add(WIFI_STATIC_IP);
4189 PUBLIC_SETTINGS.add(WIFI_STATIC_GATEWAY);
4190 PUBLIC_SETTINGS.add(WIFI_STATIC_NETMASK);
4191 PUBLIC_SETTINGS.add(WIFI_STATIC_DNS1);
4192 PUBLIC_SETTINGS.add(WIFI_STATIC_DNS2);
4193 PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY);
4194 PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY_TIMEOUT);
4195 PUBLIC_SETTINGS.add(NEXT_ALARM_FORMATTED);
4196 PUBLIC_SETTINGS.add(FONT_SCALE);
4197 PUBLIC_SETTINGS.add(DIM_SCREEN);
4198 PUBLIC_SETTINGS.add(SCREEN_OFF_TIMEOUT);
4199 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS);
Santos Cordon5177da32018-02-07 14:03:14 -08004200 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_FOR_VR);
Svetoslav683914b2015-01-15 14:22:26 -08004201 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_MODE);
4202 PUBLIC_SETTINGS.add(MODE_RINGER_STREAMS_AFFECTED);
4203 PUBLIC_SETTINGS.add(MUTE_STREAMS_AFFECTED);
4204 PUBLIC_SETTINGS.add(VIBRATE_ON);
4205 PUBLIC_SETTINGS.add(VOLUME_RING);
4206 PUBLIC_SETTINGS.add(VOLUME_SYSTEM);
4207 PUBLIC_SETTINGS.add(VOLUME_VOICE);
4208 PUBLIC_SETTINGS.add(VOLUME_MUSIC);
4209 PUBLIC_SETTINGS.add(VOLUME_ALARM);
4210 PUBLIC_SETTINGS.add(VOLUME_NOTIFICATION);
4211 PUBLIC_SETTINGS.add(VOLUME_BLUETOOTH_SCO);
4212 PUBLIC_SETTINGS.add(RINGTONE);
4213 PUBLIC_SETTINGS.add(NOTIFICATION_SOUND);
4214 PUBLIC_SETTINGS.add(ALARM_ALERT);
4215 PUBLIC_SETTINGS.add(TEXT_AUTO_REPLACE);
4216 PUBLIC_SETTINGS.add(TEXT_AUTO_CAPS);
4217 PUBLIC_SETTINGS.add(TEXT_AUTO_PUNCTUATE);
4218 PUBLIC_SETTINGS.add(TEXT_SHOW_PASSWORD);
4219 PUBLIC_SETTINGS.add(SHOW_GTALK_SERVICE_STATUS);
4220 PUBLIC_SETTINGS.add(WALLPAPER_ACTIVITY);
4221 PUBLIC_SETTINGS.add(TIME_12_24);
4222 PUBLIC_SETTINGS.add(DATE_FORMAT);
4223 PUBLIC_SETTINGS.add(SETUP_WIZARD_HAS_RUN);
4224 PUBLIC_SETTINGS.add(ACCELEROMETER_ROTATION);
4225 PUBLIC_SETTINGS.add(USER_ROTATION);
4226 PUBLIC_SETTINGS.add(DTMF_TONE_WHEN_DIALING);
4227 PUBLIC_SETTINGS.add(SOUND_EFFECTS_ENABLED);
4228 PUBLIC_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED);
4229 PUBLIC_SETTINGS.add(SHOW_WEB_SUGGESTIONS);
Svetoslav Ganovd2631632015-12-09 16:29:22 -08004230 PUBLIC_SETTINGS.add(VIBRATE_WHEN_RINGING);
Svetoslav683914b2015-01-15 14:22:26 -08004231 }
4232
4233 /**
4234 * These are all hidden system settings.
4235 *
4236 * @hide
4237 */
4238 public static final Set<String> PRIVATE_SETTINGS = new ArraySet<>();
4239 static {
4240 PRIVATE_SETTINGS.add(WIFI_USE_STATIC_IP);
4241 PRIVATE_SETTINGS.add(END_BUTTON_BEHAVIOR);
4242 PRIVATE_SETTINGS.add(ADVANCED_SETTINGS);
4243 PRIVATE_SETTINGS.add(SCREEN_AUTO_BRIGHTNESS_ADJ);
4244 PRIVATE_SETTINGS.add(VIBRATE_INPUT_DEVICES);
4245 PRIVATE_SETTINGS.add(VOLUME_MASTER);
Andy Hungf04b84d2015-12-18 17:33:27 -08004246 PRIVATE_SETTINGS.add(MASTER_MONO);
Svetoslav683914b2015-01-15 14:22:26 -08004247 PRIVATE_SETTINGS.add(NOTIFICATIONS_USE_RING_VOLUME);
4248 PRIVATE_SETTINGS.add(VIBRATE_IN_SILENT);
4249 PRIVATE_SETTINGS.add(MEDIA_BUTTON_RECEIVER);
4250 PRIVATE_SETTINGS.add(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY);
Svetoslav683914b2015-01-15 14:22:26 -08004251 PRIVATE_SETTINGS.add(DTMF_TONE_TYPE_WHEN_DIALING);
4252 PRIVATE_SETTINGS.add(HEARING_AID);
4253 PRIVATE_SETTINGS.add(TTY_MODE);
4254 PRIVATE_SETTINGS.add(NOTIFICATION_LIGHT_PULSE);
4255 PRIVATE_SETTINGS.add(POINTER_LOCATION);
4256 PRIVATE_SETTINGS.add(SHOW_TOUCHES);
4257 PRIVATE_SETTINGS.add(WINDOW_ORIENTATION_LISTENER_LOG);
4258 PRIVATE_SETTINGS.add(POWER_SOUNDS_ENABLED);
4259 PRIVATE_SETTINGS.add(DOCK_SOUNDS_ENABLED);
4260 PRIVATE_SETTINGS.add(LOCKSCREEN_SOUNDS_ENABLED);
4261 PRIVATE_SETTINGS.add(LOCKSCREEN_DISABLED);
4262 PRIVATE_SETTINGS.add(LOW_BATTERY_SOUND);
4263 PRIVATE_SETTINGS.add(DESK_DOCK_SOUND);
4264 PRIVATE_SETTINGS.add(DESK_UNDOCK_SOUND);
4265 PRIVATE_SETTINGS.add(CAR_DOCK_SOUND);
4266 PRIVATE_SETTINGS.add(CAR_UNDOCK_SOUND);
4267 PRIVATE_SETTINGS.add(LOCK_SOUND);
4268 PRIVATE_SETTINGS.add(UNLOCK_SOUND);
4269 PRIVATE_SETTINGS.add(SIP_RECEIVE_CALLS);
4270 PRIVATE_SETTINGS.add(SIP_CALL_OPTIONS);
4271 PRIVATE_SETTINGS.add(SIP_ALWAYS);
4272 PRIVATE_SETTINGS.add(SIP_ADDRESS_ONLY);
4273 PRIVATE_SETTINGS.add(SIP_ASK_ME_EACH_TIME);
4274 PRIVATE_SETTINGS.add(POINTER_SPEED);
4275 PRIVATE_SETTINGS.add(LOCK_TO_APP_ENABLED);
4276 PRIVATE_SETTINGS.add(EGG_MODE);
Evan Lairdbcf631d2017-03-10 10:56:45 -05004277 PRIVATE_SETTINGS.add(SHOW_BATTERY_PERCENT);
Christine Franks12699602017-10-30 18:38:48 -07004278 PRIVATE_SETTINGS.add(DISPLAY_COLOR_MODE);
Svetoslav683914b2015-01-15 14:22:26 -08004279 }
4280
4281 /**
Amith Yamasanib0ff3222015-03-04 09:56:14 -08004282 * These are all public system settings
Svetoslav683914b2015-01-15 14:22:26 -08004283 *
Michal Karpinski964943a2018-01-19 16:28:26 +00004284 * All settings in {@link SETTINGS_TO_BACKUP} array *must* have a non-null validator,
4285 * otherwise they won't be restored.
4286 *
Svetoslav683914b2015-01-15 14:22:26 -08004287 * @hide
4288 */
4289 public static final Map<String, Validator> VALIDATORS = new ArrayMap<>();
4290 static {
Michal Karpinski2c37b082018-01-18 16:14:27 +00004291 VALIDATORS.put(STAY_ON_WHILE_PLUGGED_IN, STAY_ON_WHILE_PLUGGED_IN_VALIDATOR);
4292 VALIDATORS.put(END_BUTTON_BEHAVIOR, END_BUTTON_BEHAVIOR_VALIDATOR);
Svetoslav683914b2015-01-15 14:22:26 -08004293 VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR);
4294 VALIDATORS.put(BLUETOOTH_DISCOVERABILITY, BLUETOOTH_DISCOVERABILITY_VALIDATOR);
4295 VALIDATORS.put(BLUETOOTH_DISCOVERABILITY_TIMEOUT,
4296 BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR);
4297 VALIDATORS.put(NEXT_ALARM_FORMATTED, NEXT_ALARM_FORMATTED_VALIDATOR);
4298 VALIDATORS.put(FONT_SCALE, FONT_SCALE_VALIDATOR);
4299 VALIDATORS.put(DIM_SCREEN, DIM_SCREEN_VALIDATOR);
Christine Franks12699602017-10-30 18:38:48 -07004300 VALIDATORS.put(DISPLAY_COLOR_MODE, DISPLAY_COLOR_MODE_VALIDATOR);
Svetoslav683914b2015-01-15 14:22:26 -08004301 VALIDATORS.put(SCREEN_OFF_TIMEOUT, SCREEN_OFF_TIMEOUT_VALIDATOR);
Santos Cordon3107d292016-09-20 15:50:35 -07004302 VALIDATORS.put(SCREEN_BRIGHTNESS_FOR_VR, SCREEN_BRIGHTNESS_FOR_VR_VALIDATOR);
Svetoslav683914b2015-01-15 14:22:26 -08004303 VALIDATORS.put(SCREEN_BRIGHTNESS_MODE, SCREEN_BRIGHTNESS_MODE_VALIDATOR);
4304 VALIDATORS.put(MODE_RINGER_STREAMS_AFFECTED, MODE_RINGER_STREAMS_AFFECTED_VALIDATOR);
4305 VALIDATORS.put(MUTE_STREAMS_AFFECTED, MUTE_STREAMS_AFFECTED_VALIDATOR);
4306 VALIDATORS.put(VIBRATE_ON, VIBRATE_ON_VALIDATOR);
Michael Wright35a0c672018-01-24 00:32:53 +00004307 VALIDATORS.put(NOTIFICATION_VIBRATION_INTENSITY, VIBRATION_INTENSITY_VALIDATOR);
4308 VALIDATORS.put(HAPTIC_FEEDBACK_INTENSITY, VIBRATION_INTENSITY_VALIDATOR);
Svetoslav683914b2015-01-15 14:22:26 -08004309 VALIDATORS.put(RINGTONE, RINGTONE_VALIDATOR);
4310 VALIDATORS.put(NOTIFICATION_SOUND, NOTIFICATION_SOUND_VALIDATOR);
4311 VALIDATORS.put(ALARM_ALERT, ALARM_ALERT_VALIDATOR);
4312 VALIDATORS.put(TEXT_AUTO_REPLACE, TEXT_AUTO_REPLACE_VALIDATOR);
4313 VALIDATORS.put(TEXT_AUTO_CAPS, TEXT_AUTO_CAPS_VALIDATOR);
4314 VALIDATORS.put(TEXT_AUTO_PUNCTUATE, TEXT_AUTO_PUNCTUATE_VALIDATOR);
4315 VALIDATORS.put(TEXT_SHOW_PASSWORD, TEXT_SHOW_PASSWORD_VALIDATOR);
Michal Karpinski2c37b082018-01-18 16:14:27 +00004316 VALIDATORS.put(AUTO_TIME, AUTO_TIME_VALIDATOR);
4317 VALIDATORS.put(AUTO_TIME_ZONE, AUTO_TIME_ZONE_VALIDATOR);
Svetoslav683914b2015-01-15 14:22:26 -08004318 VALIDATORS.put(SHOW_GTALK_SERVICE_STATUS, SHOW_GTALK_SERVICE_STATUS_VALIDATOR);
4319 VALIDATORS.put(WALLPAPER_ACTIVITY, WALLPAPER_ACTIVITY_VALIDATOR);
4320 VALIDATORS.put(TIME_12_24, TIME_12_24_VALIDATOR);
4321 VALIDATORS.put(DATE_FORMAT, DATE_FORMAT_VALIDATOR);
4322 VALIDATORS.put(SETUP_WIZARD_HAS_RUN, SETUP_WIZARD_HAS_RUN_VALIDATOR);
4323 VALIDATORS.put(ACCELEROMETER_ROTATION, ACCELEROMETER_ROTATION_VALIDATOR);
4324 VALIDATORS.put(USER_ROTATION, USER_ROTATION_VALIDATOR);
4325 VALIDATORS.put(DTMF_TONE_WHEN_DIALING, DTMF_TONE_WHEN_DIALING_VALIDATOR);
4326 VALIDATORS.put(SOUND_EFFECTS_ENABLED, SOUND_EFFECTS_ENABLED_VALIDATOR);
4327 VALIDATORS.put(HAPTIC_FEEDBACK_ENABLED, HAPTIC_FEEDBACK_ENABLED_VALIDATOR);
Michal Karpinski2c37b082018-01-18 16:14:27 +00004328 VALIDATORS.put(POWER_SOUNDS_ENABLED, POWER_SOUNDS_ENABLED_VALIDATOR);
4329 VALIDATORS.put(DOCK_SOUNDS_ENABLED, DOCK_SOUNDS_ENABLED_VALIDATOR);
Svetoslav683914b2015-01-15 14:22:26 -08004330 VALIDATORS.put(SHOW_WEB_SUGGESTIONS, SHOW_WEB_SUGGESTIONS_VALIDATOR);
4331 VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR);
4332 VALIDATORS.put(END_BUTTON_BEHAVIOR, END_BUTTON_BEHAVIOR_VALIDATOR);
4333 VALIDATORS.put(ADVANCED_SETTINGS, ADVANCED_SETTINGS_VALIDATOR);
4334 VALIDATORS.put(SCREEN_AUTO_BRIGHTNESS_ADJ, SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR);
4335 VALIDATORS.put(VIBRATE_INPUT_DEVICES, VIBRATE_INPUT_DEVICES_VALIDATOR);
Andy Hungf04b84d2015-12-18 17:33:27 -08004336 VALIDATORS.put(MASTER_MONO, MASTER_MONO_VALIDATOR);
Svetoslav683914b2015-01-15 14:22:26 -08004337 VALIDATORS.put(NOTIFICATIONS_USE_RING_VOLUME, NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR);
4338 VALIDATORS.put(VIBRATE_IN_SILENT, VIBRATE_IN_SILENT_VALIDATOR);
4339 VALIDATORS.put(MEDIA_BUTTON_RECEIVER, MEDIA_BUTTON_RECEIVER_VALIDATOR);
4340 VALIDATORS.put(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY,
4341 HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR);
4342 VALIDATORS.put(VIBRATE_WHEN_RINGING, VIBRATE_WHEN_RINGING_VALIDATOR);
4343 VALIDATORS.put(DTMF_TONE_TYPE_WHEN_DIALING, DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR);
4344 VALIDATORS.put(HEARING_AID, HEARING_AID_VALIDATOR);
4345 VALIDATORS.put(TTY_MODE, TTY_MODE_VALIDATOR);
4346 VALIDATORS.put(NOTIFICATION_LIGHT_PULSE, NOTIFICATION_LIGHT_PULSE_VALIDATOR);
4347 VALIDATORS.put(POINTER_LOCATION, POINTER_LOCATION_VALIDATOR);
4348 VALIDATORS.put(SHOW_TOUCHES, SHOW_TOUCHES_VALIDATOR);
4349 VALIDATORS.put(WINDOW_ORIENTATION_LISTENER_LOG,
4350 WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR);
4351 VALIDATORS.put(LOCKSCREEN_SOUNDS_ENABLED, LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR);
4352 VALIDATORS.put(LOCKSCREEN_DISABLED, LOCKSCREEN_DISABLED_VALIDATOR);
4353 VALIDATORS.put(SIP_RECEIVE_CALLS, SIP_RECEIVE_CALLS_VALIDATOR);
4354 VALIDATORS.put(SIP_CALL_OPTIONS, SIP_CALL_OPTIONS_VALIDATOR);
4355 VALIDATORS.put(SIP_ALWAYS, SIP_ALWAYS_VALIDATOR);
4356 VALIDATORS.put(SIP_ADDRESS_ONLY, SIP_ADDRESS_ONLY_VALIDATOR);
4357 VALIDATORS.put(SIP_ASK_ME_EACH_TIME, SIP_ASK_ME_EACH_TIME_VALIDATOR);
4358 VALIDATORS.put(POINTER_SPEED, POINTER_SPEED_VALIDATOR);
4359 VALIDATORS.put(LOCK_TO_APP_ENABLED, LOCK_TO_APP_ENABLED_VALIDATOR);
4360 VALIDATORS.put(EGG_MODE, EGG_MODE_VALIDATOR);
4361 VALIDATORS.put(WIFI_STATIC_IP, WIFI_STATIC_IP_VALIDATOR);
4362 VALIDATORS.put(WIFI_STATIC_GATEWAY, WIFI_STATIC_GATEWAY_VALIDATOR);
4363 VALIDATORS.put(WIFI_STATIC_NETMASK, WIFI_STATIC_NETMASK_VALIDATOR);
4364 VALIDATORS.put(WIFI_STATIC_DNS1, WIFI_STATIC_DNS1_VALIDATOR);
4365 VALIDATORS.put(WIFI_STATIC_DNS2, WIFI_STATIC_DNS2_VALIDATOR);
Evan Lairdbcf631d2017-03-10 10:56:45 -05004366 VALIDATORS.put(SHOW_BATTERY_PERCENT, SHOW_BATTERY_PERCENT_VALIDATOR);
Svetoslav683914b2015-01-15 14:22:26 -08004367 }
4368
4369 /**
4370 * These entries are considered common between the personal and the managed profile,
4371 * since the managed profile doesn't get to change them.
4372 */
4373 private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>();
4374 static {
4375 CLONE_TO_MANAGED_PROFILE.add(DATE_FORMAT);
4376 CLONE_TO_MANAGED_PROFILE.add(HAPTIC_FEEDBACK_ENABLED);
4377 CLONE_TO_MANAGED_PROFILE.add(SOUND_EFFECTS_ENABLED);
4378 CLONE_TO_MANAGED_PROFILE.add(TEXT_SHOW_PASSWORD);
4379 CLONE_TO_MANAGED_PROFILE.add(TIME_12_24);
4380 }
4381
4382 /** @hide */
4383 public static void getCloneToManagedProfileSettings(Set<String> outKeySet) {
4384 outKeySet.addAll(CLONE_TO_MANAGED_PROFILE);
4385 }
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07004386
4387 /**
Andre Lago3fa139c2016-08-04 13:53:44 +01004388 * These entries should be cloned from this profile's parent only if the dependency's
4389 * value is true ("1")
4390 *
4391 * Note: the dependencies must be Secure settings
4392 *
4393 * @hide
4394 */
4395 public static final Map<String, String> CLONE_FROM_PARENT_ON_VALUE = new ArrayMap<>();
4396 static {
4397 CLONE_FROM_PARENT_ON_VALUE.put(RINGTONE, Secure.SYNC_PARENT_SOUNDS);
4398 CLONE_FROM_PARENT_ON_VALUE.put(NOTIFICATION_SOUND, Secure.SYNC_PARENT_SOUNDS);
4399 CLONE_FROM_PARENT_ON_VALUE.put(ALARM_ALERT, Secure.SYNC_PARENT_SOUNDS);
4400 }
4401
4402 /** @hide */
4403 public static void getCloneFromParentOnValueSettings(Map<String, String> outMap) {
4404 outMap.putAll(CLONE_FROM_PARENT_ON_VALUE);
4405 }
4406
4407 /**
Todd Kennedybe0b8892017-02-15 14:13:52 -08004408 * System settings which can be accessed by instant apps.
Chad Brubaker97bccee2017-01-05 15:51:41 -08004409 * @hide
4410 */
Todd Kennedybe0b8892017-02-15 14:13:52 -08004411 public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>();
Chad Brubaker97bccee2017-01-05 15:51:41 -08004412 static {
Todd Kennedybe0b8892017-02-15 14:13:52 -08004413 INSTANT_APP_SETTINGS.add(TEXT_AUTO_REPLACE);
4414 INSTANT_APP_SETTINGS.add(TEXT_AUTO_CAPS);
4415 INSTANT_APP_SETTINGS.add(TEXT_AUTO_PUNCTUATE);
4416 INSTANT_APP_SETTINGS.add(TEXT_SHOW_PASSWORD);
4417 INSTANT_APP_SETTINGS.add(DATE_FORMAT);
4418 INSTANT_APP_SETTINGS.add(FONT_SCALE);
4419 INSTANT_APP_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED);
4420 INSTANT_APP_SETTINGS.add(TIME_12_24);
4421 INSTANT_APP_SETTINGS.add(SOUND_EFFECTS_ENABLED);
Chad Brubaker562afaf2017-04-10 13:32:37 -07004422 INSTANT_APP_SETTINGS.add(ACCELEROMETER_ROTATION);
Chad Brubaker97bccee2017-01-05 15:51:41 -08004423 }
4424
4425 /**
Sailesh Nepal1bd78762014-02-11 22:32:21 -08004426 * When to use Wi-Fi calling
4427 *
4428 * @see android.telephony.TelephonyManager.WifiCallingChoices
4429 * @hide
4430 */
4431 public static final String WHEN_TO_MAKE_WIFI_CALLS = "when_to_make_wifi_calls";
4432
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004433 // Settings moved to Settings.Secure
4434
4435 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004436 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004437 * instead
4438 */
4439 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07004440 public static final String ADB_ENABLED = Global.ADB_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004441
4442 /**
4443 * @deprecated Use {@link android.provider.Settings.Secure#ANDROID_ID} instead
4444 */
4445 @Deprecated
4446 public static final String ANDROID_ID = Secure.ANDROID_ID;
4447
4448 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004449 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004450 */
4451 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07004452 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004453
Michal Karpinski5db1e432018-01-18 20:10:24 +00004454 private static final Validator BLUETOOTH_ON_VALIDATOR = BOOLEAN_VALIDATOR;
4455
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004456 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004457 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004458 */
4459 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07004460 public static final String DATA_ROAMING = Global.DATA_ROAMING;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004461
4462 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004463 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004464 */
4465 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07004466 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004467
4468 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07004469 * @deprecated Use {@link android.provider.Settings.Global#HTTP_PROXY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004470 */
4471 @Deprecated
Jeff Sharkey625239a2012-09-26 22:03:49 -07004472 public static final String HTTP_PROXY = Global.HTTP_PROXY;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004473
4474 /**
Christopher Tateaa036a22014-05-19 16:33:27 -07004475 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004476 */
4477 @Deprecated
Christopher Tateaa036a22014-05-19 16:33:27 -07004478 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004479
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004480 /**
4481 * @deprecated Use {@link android.provider.Settings.Secure#LOCATION_PROVIDERS_ALLOWED}
4482 * instead
4483 */
4484 @Deprecated
4485 public static final String LOCATION_PROVIDERS_ALLOWED = Secure.LOCATION_PROVIDERS_ALLOWED;
4486
4487 /**
4488 * @deprecated Use {@link android.provider.Settings.Secure#LOGGING_ID} instead
4489 */
4490 @Deprecated
4491 public static final String LOGGING_ID = Secure.LOGGING_ID;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004492
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004493 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004494 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004495 */
4496 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07004497 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004498
4499 /**
4500 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_ENABLED}
4501 * instead
4502 */
4503 @Deprecated
4504 public static final String PARENTAL_CONTROL_ENABLED = Secure.PARENTAL_CONTROL_ENABLED;
4505
4506 /**
4507 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_LAST_UPDATE}
4508 * instead
4509 */
4510 @Deprecated
4511 public static final String PARENTAL_CONTROL_LAST_UPDATE = Secure.PARENTAL_CONTROL_LAST_UPDATE;
4512
4513 /**
4514 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_REDIRECT_URL}
4515 * instead
4516 */
4517 @Deprecated
4518 public static final String PARENTAL_CONTROL_REDIRECT_URL =
4519 Secure.PARENTAL_CONTROL_REDIRECT_URL;
4520
4521 /**
4522 * @deprecated Use {@link android.provider.Settings.Secure#SETTINGS_CLASSNAME} instead
4523 */
4524 @Deprecated
4525 public static final String SETTINGS_CLASSNAME = Secure.SETTINGS_CLASSNAME;
4526
4527 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004528 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004529 */
4530 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07004531 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004532
Michal Karpinski5db1e432018-01-18 20:10:24 +00004533 private static final Validator USB_MASS_STORAGE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
4534
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004535 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004536 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004537 */
4538 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07004539 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004540
Dianne Hackborn4a51c202009-08-21 15:14:02 -07004541 /**
4542 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07004543 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
Dianne Hackborn4a51c202009-08-21 15:14:02 -07004544 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004545 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07004546 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 -08004547
Dianne Hackborn4a51c202009-08-21 15:14:02 -07004548 /**
4549 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07004550 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
Dianne Hackborn4a51c202009-08-21 15:14:02 -07004551 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004552 @Deprecated
4553 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
Christopher Tate06efb532012-08-24 15:29:27 -07004554 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004555
4556 /**
4557 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07004558 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004559 */
4560 @Deprecated
4561 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
Christopher Tate06efb532012-08-24 15:29:27 -07004562 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004563
Michal Karpinski964943a2018-01-19 16:28:26 +00004564 private static final Validator WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR =
4565 BOOLEAN_VALIDATOR;
Michal Karpinski5db1e432018-01-18 20:10:24 +00004566
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004567 /**
4568 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07004569 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004570 */
4571 @Deprecated
4572 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
Christopher Tate06efb532012-08-24 15:29:27 -07004573 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004574
Michal Karpinski964943a2018-01-19 16:28:26 +00004575 private static final Validator WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_VALIDATOR =
4576 NON_NEGATIVE_INTEGER_VALIDATOR;
4577
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004578 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004579 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004580 * instead
4581 */
4582 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07004583 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 -08004584
Michal Karpinski964943a2018-01-19 16:28:26 +00004585 private static final Validator WIFI_NUM_OPEN_NETWORKS_KEPT_VALIDATOR =
4586 NON_NEGATIVE_INTEGER_VALIDATOR;
4587
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004588 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004589 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004590 */
4591 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07004592 public static final String WIFI_ON = Global.WIFI_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004593
4594 /**
4595 * @deprecated Use
4596 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE}
4597 * instead
4598 */
4599 @Deprecated
4600 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
4601 Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE;
4602
4603 /**
4604 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_AP_COUNT} instead
4605 */
4606 @Deprecated
4607 public static final String WIFI_WATCHDOG_AP_COUNT = Secure.WIFI_WATCHDOG_AP_COUNT;
4608
4609 /**
4610 * @deprecated Use
4611 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS} instead
4612 */
4613 @Deprecated
4614 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
4615 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004616
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004617 /**
4618 * @deprecated Use
4619 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED} instead
4620 */
4621 @Deprecated
4622 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
4623 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED;
4624
4625 /**
4626 * @deprecated Use
4627 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS}
4628 * instead
4629 */
4630 @Deprecated
4631 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
4632 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS;
4633
4634 /**
4635 * @deprecated Use
4636 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT} instead
4637 */
4638 @Deprecated
4639 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
4640 Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT;
4641
4642 /**
4643 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_MAX_AP_CHECKS}
4644 * instead
4645 */
4646 @Deprecated
4647 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = Secure.WIFI_WATCHDOG_MAX_AP_CHECKS;
4648
4649 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004650 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004651 */
4652 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07004653 public static final String WIFI_WATCHDOG_ON = Global.WIFI_WATCHDOG_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004654
4655 /**
4656 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_COUNT} instead
4657 */
4658 @Deprecated
4659 public static final String WIFI_WATCHDOG_PING_COUNT = Secure.WIFI_WATCHDOG_PING_COUNT;
4660
4661 /**
4662 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_DELAY_MS}
4663 * instead
4664 */
4665 @Deprecated
4666 public static final String WIFI_WATCHDOG_PING_DELAY_MS = Secure.WIFI_WATCHDOG_PING_DELAY_MS;
4667
4668 /**
4669 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_TIMEOUT_MS}
4670 * instead
4671 */
4672 @Deprecated
4673 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS =
4674 Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS;
Billy Lau6ad2d662015-07-18 00:26:58 +01004675
4676 /**
Trevor Johns682c24e2016-04-12 10:13:47 -07004677 * Checks if the specified app can modify system settings. As of API
4678 * level 23, an app cannot modify system settings unless it declares the
4679 * {@link android.Manifest.permission#WRITE_SETTINGS}
4680 * permission in its manifest, <em>and</em> the user specifically grants
4681 * the app this capability. To prompt the user to grant this approval,
4682 * the app must send an intent with the action {@link
4683 * android.provider.Settings#ACTION_MANAGE_WRITE_SETTINGS}, which causes
4684 * the system to display a permission management screen.
Billy Lau6ad2d662015-07-18 00:26:58 +01004685 *
Trevor Johns682c24e2016-04-12 10:13:47 -07004686 * @param context App context.
Billy Lau6ad2d662015-07-18 00:26:58 +01004687 * @return true if the calling app can write to system settings, false otherwise
4688 */
4689 public static boolean canWrite(Context context) {
Svet Ganov94ba40172016-04-03 22:04:22 -07004690 return isCallingPackageAllowedToWriteSettings(context, Process.myUid(),
4691 context.getOpPackageName(), false);
Billy Lau6ad2d662015-07-18 00:26:58 +01004692 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004693 }
4694
4695 /**
4696 * Secure system settings, containing system preferences that applications
4697 * can read but are not allowed to write. These are for preferences that
4698 * the user must explicitly modify through the system UI or specialized
4699 * APIs for those values, not modified directly by applications.
4700 */
4701 public static final class Secure extends NameValueTable {
Kweku Adamsb0886f32017-10-31 15:32:09 -07004702 // NOTE: If you add new settings here, be sure to add them to
4703 // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoSecureSettingsLocked.
4704
Dianne Hackborn139748f2012-09-24 11:36:57 -07004705 /**
4706 * The content:// style URL for this table
4707 */
4708 public static final Uri CONTENT_URI =
4709 Uri.parse("content://" + AUTHORITY + "/secure");
4710
Svetoslav Ganove080da92016-12-21 17:10:35 -08004711 private static final ContentProviderHolder sProviderHolder =
4712 new ContentProviderHolder(CONTENT_URI);
4713
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08004714 // Populated lazily, guarded by class object:
Dianne Hackborn139748f2012-09-24 11:36:57 -07004715 private static final NameValueCache sNameValueCache = new NameValueCache(
Dianne Hackborn139748f2012-09-24 11:36:57 -07004716 CONTENT_URI,
4717 CALL_METHOD_GET_SECURE,
Svetoslav Ganove080da92016-12-21 17:10:35 -08004718 CALL_METHOD_PUT_SECURE,
4719 sProviderHolder);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004720
Amith Yamasani52c489c2012-03-28 11:42:42 -07004721 private static ILockSettings sLockSettings = null;
4722
Amith Yamasani7ab8c4a2012-04-06 09:27:12 -07004723 private static boolean sIsSystemProcess;
Amith Yamasani52c489c2012-03-28 11:42:42 -07004724 private static final HashSet<String> MOVED_TO_LOCK_SETTINGS;
Christopher Tate06efb532012-08-24 15:29:27 -07004725 private static final HashSet<String> MOVED_TO_GLOBAL;
Amith Yamasani52c489c2012-03-28 11:42:42 -07004726 static {
Steve McKayea93fe72016-12-02 11:35:35 -08004727 MOVED_TO_LOCK_SETTINGS = new HashSet<>(3);
Amith Yamasani52c489c2012-03-28 11:42:42 -07004728 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_ENABLED);
4729 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_VISIBLE);
4730 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
Christopher Tate06efb532012-08-24 15:29:27 -07004731
Steve McKayea93fe72016-12-02 11:35:35 -08004732 MOVED_TO_GLOBAL = new HashSet<>();
Christopher Tate06efb532012-08-24 15:29:27 -07004733 MOVED_TO_GLOBAL.add(Settings.Global.ADB_ENABLED);
4734 MOVED_TO_GLOBAL.add(Settings.Global.ASSISTED_GPS_ENABLED);
4735 MOVED_TO_GLOBAL.add(Settings.Global.BLUETOOTH_ON);
Christopher Tate58f41ec2013-01-11 15:40:36 -08004736 MOVED_TO_GLOBAL.add(Settings.Global.BUGREPORT_IN_POWER_MENU);
Christopher Tate06efb532012-08-24 15:29:27 -07004737 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_CELL_BROADCAST_SMS);
4738 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_ROAMING_MODE);
4739 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_SUBSCRIPTION_MODE);
4740 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_MOBILE);
4741 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_WIFI);
4742 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ROAMING);
4743 MOVED_TO_GLOBAL.add(Settings.Global.DEVELOPMENT_SETTINGS_ENABLED);
4744 MOVED_TO_GLOBAL.add(Settings.Global.DEVICE_PROVISIONED);
Christopher Tate06efb532012-08-24 15:29:27 -07004745 MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_SIZE_FORCED);
4746 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_MAX_BYTES_OVER_MOBILE);
4747 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE);
Christopher Tate06efb532012-08-24 15:29:27 -07004748 MOVED_TO_GLOBAL.add(Settings.Global.MOBILE_DATA);
4749 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_BUCKET_DURATION);
4750 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_DELETE_AGE);
4751 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_PERSIST_BYTES);
4752 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_ROTATE_AGE);
4753 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_ENABLED);
4754 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_GLOBAL_ALERT_BYTES);
4755 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_POLL_INTERVAL);
Christopher Tate06efb532012-08-24 15:29:27 -07004756 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_SAMPLE_ENABLED);
4757 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_TIME_CACHE_MAX_AGE);
4758 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_BUCKET_DURATION);
4759 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_DELETE_AGE);
4760 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_PERSIST_BYTES);
4761 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_ROTATE_AGE);
4762 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_BUCKET_DURATION);
4763 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_DELETE_AGE);
4764 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_PERSIST_BYTES);
4765 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_ROTATE_AGE);
4766 MOVED_TO_GLOBAL.add(Settings.Global.NETWORK_PREFERENCE);
4767 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_DIFF);
4768 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_SPACING);
4769 MOVED_TO_GLOBAL.add(Settings.Global.NTP_SERVER);
4770 MOVED_TO_GLOBAL.add(Settings.Global.NTP_TIMEOUT);
4771 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_ERROR_POLL_COUNT);
4772 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_LONG_POLL_INTERVAL_MS);
4773 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT);
4774 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_POLL_INTERVAL_MS);
4775 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_TRIGGER_PACKET_COUNT);
Christopher Tate06efb532012-08-24 15:29:27 -07004776 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DATA_SERVICE_URL);
4777 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_REDIR_HOST);
4778 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_TARGET_URL);
4779 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_APN);
4780 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_REQUIRED);
4781 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_SUPPORTED);
Christopher Tate06efb532012-08-24 15:29:27 -07004782 MOVED_TO_GLOBAL.add(Settings.Global.USB_MASS_STORAGE_ENABLED);
4783 MOVED_TO_GLOBAL.add(Settings.Global.USE_GOOGLE_MAIL);
Robert Greenwalt3ea0c992013-10-03 21:13:49 +00004784 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_COUNTRY_CODE);
Christopher Tate06efb532012-08-24 15:29:27 -07004785 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FRAMEWORK_SCAN_INTERVAL_MS);
4786 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FREQUENCY_BAND);
4787 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_IDLE_MS);
4788 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MAX_DHCP_RETRY_COUNT);
4789 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS);
4790 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
4791 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
4792 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NUM_OPEN_NETWORKS_KEPT);
4793 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ON);
4794 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_P2P_DEVICE_NAME);
4795 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SAVED_STATE);
4796 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUPPLICANT_SCAN_INTERVAL_MS);
4797 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUSPEND_OPTIMIZATIONS_ENABLED);
Nathan Harold29589fc2016-03-30 21:53:48 -07004798 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_VERBOSE_LOGGING_ENABLED);
vandwalle7c3606c2014-03-31 19:12:07 -07004799 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ENHANCED_AUTO_JOIN);
4800 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORK_SHOW_RSSI);
Christopher Tate06efb532012-08-24 15:29:27 -07004801 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_ON);
4802 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED);
Christopher Tate06efb532012-08-24 15:29:27 -07004803 MOVED_TO_GLOBAL.add(Settings.Global.WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON);
Christopher Tatec868b642012-09-12 17:41:04 -07004804 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_ENABLE);
4805 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_TIMEOUT);
4806 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_DEFAULT_RESPONSE);
4807 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS);
4808 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS);
4809 MOVED_TO_GLOBAL.add(Settings.Global.GPRS_REGISTER_CHECK_PERIOD_MS);
Christopher Tate06efb532012-08-24 15:29:27 -07004810 MOVED_TO_GLOBAL.add(Settings.Global.WTF_IS_FATAL);
Jeff Sharkey625239a2012-09-26 22:03:49 -07004811 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_DURATION_THRESHOLD);
4812 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_THRESHOLD);
4813 MOVED_TO_GLOBAL.add(Settings.Global.SEND_ACTION_APP_ERROR);
4814 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_AGE_SECONDS);
4815 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_MAX_FILES);
4816 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_KB);
4817 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_PERCENT);
4818 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_RESERVE_PERCENT);
4819 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_TAG_PREFIX);
4820 MOVED_TO_GLOBAL.add(Settings.Global.ERROR_LOGCAT_PREFIX);
4821 MOVED_TO_GLOBAL.add(Settings.Global.SYS_FREE_STORAGE_LOG_INTERVAL);
4822 MOVED_TO_GLOBAL.add(Settings.Global.DISK_FREE_CHANGE_REPORTING_THRESHOLD);
4823 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_PERCENTAGE);
4824 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_MAX_BYTES);
4825 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_FULL_THRESHOLD_BYTES);
4826 MOVED_TO_GLOBAL.add(Settings.Global.SYNC_MAX_RETRY_DELAY_IN_SECONDS);
4827 MOVED_TO_GLOBAL.add(Settings.Global.CONNECTIVITY_CHANGE_DELAY);
4828 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED);
4829 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_SERVER);
4830 MOVED_TO_GLOBAL.add(Settings.Global.NSD_ON);
4831 MOVED_TO_GLOBAL.add(Settings.Global.SET_INSTALL_LOCATION);
4832 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_INSTALL_LOCATION);
4833 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_UP_DELAY);
4834 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_DOWN_DELAY);
4835 MOVED_TO_GLOBAL.add(Settings.Global.READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT);
4836 MOVED_TO_GLOBAL.add(Settings.Global.HTTP_PROXY);
4837 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_HOST);
4838 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_PORT);
4839 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST);
4840 MOVED_TO_GLOBAL.add(Settings.Global.SET_GLOBAL_HTTP_PROXY);
4841 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_DNS_SERVER);
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07004842 MOVED_TO_GLOBAL.add(Settings.Global.PREFERRED_NETWORK_MODE);
Hui Shu22671772014-10-01 21:41:07 +00004843 MOVED_TO_GLOBAL.add(Settings.Global.WEBVIEW_DATA_REDUCTION_PROXY_KEY);
Christopher Tate06efb532012-08-24 15:29:27 -07004844 }
4845
Christopher Tate66488d62012-10-02 11:58:01 -07004846 /** @hide */
Svetoslav683914b2015-01-15 14:22:26 -08004847 public static void getMovedToGlobalSettings(Set<String> outKeySet) {
Christopher Tate66488d62012-10-02 11:58:01 -07004848 outKeySet.addAll(MOVED_TO_GLOBAL);
4849 }
4850
Sudheer Shankaaa3c30d2017-05-23 15:19:10 -07004851 /** @hide */
4852 public static void clearProviderForTest() {
4853 sProviderHolder.clearProviderForTest();
4854 sNameValueCache.clearGenerationTrackerForTest();
4855 }
4856
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004857 /**
4858 * Look up a name in the database.
4859 * @param resolver to access the database with
4860 * @param name to look up in the table
4861 * @return the corresponding value, or null if not present
4862 */
Dianne Hackborn139748f2012-09-24 11:36:57 -07004863 public static String getString(ContentResolver resolver, String name) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07004864 return getStringForUser(resolver, name, resolver.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07004865 }
4866
4867 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -07004868 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -07004869 int userHandle) {
4870 if (MOVED_TO_GLOBAL.contains(name)) {
4871 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
4872 + " to android.provider.Settings.Global.");
4873 return Global.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004874 }
Amith Yamasani52c489c2012-03-28 11:42:42 -07004875
Dianne Hackborn139748f2012-09-24 11:36:57 -07004876 if (MOVED_TO_LOCK_SETTINGS.contains(name)) {
4877 synchronized (Secure.class) {
4878 if (sLockSettings == null) {
4879 sLockSettings = ILockSettings.Stub.asInterface(
4880 (IBinder) ServiceManager.getService("lock_settings"));
4881 sIsSystemProcess = Process.myUid() == Process.SYSTEM_UID;
4882 }
4883 }
4884 if (sLockSettings != null && !sIsSystemProcess) {
Adrian Roos7811d9f2015-07-27 15:10:13 -07004885 // No context; use the ActivityThread's context as an approximation for
4886 // determining the target API level.
4887 Application application = ActivityThread.currentApplication();
4888
4889 boolean isPreMnc = application != null
4890 && application.getApplicationInfo() != null
4891 && application.getApplicationInfo().targetSdkVersion
4892 <= VERSION_CODES.LOLLIPOP_MR1;
4893 if (isPreMnc) {
4894 try {
4895 return sLockSettings.getString(name, "0", userHandle);
4896 } catch (RemoteException re) {
4897 // Fall through
4898 }
4899 } else {
4900 throw new SecurityException("Settings.Secure." + name
4901 + " is deprecated and no longer accessible."
4902 + " See API documentation for potential replacements.");
Dianne Hackborn139748f2012-09-24 11:36:57 -07004903 }
Amith Yamasani52c489c2012-03-28 11:42:42 -07004904 }
4905 }
4906
Christopher Tate06efb532012-08-24 15:29:27 -07004907 return sNameValueCache.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004908 }
4909
4910 /**
4911 * Store a name/value pair into the database.
4912 * @param resolver to access the database with
4913 * @param name to store
4914 * @param value to associate with the name
4915 * @return true if the value was set, false on database errors
4916 */
Christopher Tate06efb532012-08-24 15:29:27 -07004917 public static boolean putString(ContentResolver resolver, String name, String value) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07004918 return putStringForUser(resolver, name, value, resolver.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07004919 }
4920
4921 /** @hide */
4922 public static boolean putStringForUser(ContentResolver resolver, String name, String value,
4923 int userHandle) {
Svetoslav Ganove080da92016-12-21 17:10:35 -08004924 return putStringForUser(resolver, name, value, null, false, userHandle);
4925 }
4926
4927 /** @hide */
4928 public static boolean putStringForUser(@NonNull ContentResolver resolver,
4929 @NonNull String name, @Nullable String value, @Nullable String tag,
4930 boolean makeDefault, @UserIdInt int userHandle) {
Julia Reynolds82735bc2014-09-04 16:43:30 -04004931 if (LOCATION_MODE.equals(name)) {
Tom O'Neill87c7fad2016-08-04 08:16:12 -07004932 // Map LOCATION_MODE to underlying location provider storage API
Julia Reynolds82735bc2014-09-04 16:43:30 -04004933 return setLocationModeForUser(resolver, Integer.parseInt(value), userHandle);
4934 }
Christopher Tate06efb532012-08-24 15:29:27 -07004935 if (MOVED_TO_GLOBAL.contains(name)) {
Robin Lee7af9a742017-02-20 14:47:30 +00004936 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
Christopher Tate06efb532012-08-24 15:29:27 -07004937 + " to android.provider.Settings.Global");
Svetoslav Ganove080da92016-12-21 17:10:35 -08004938 return Global.putStringForUser(resolver, name, value,
4939 tag, makeDefault, userHandle);
Christopher Tate06efb532012-08-24 15:29:27 -07004940 }
Svetoslav Ganove080da92016-12-21 17:10:35 -08004941 return sNameValueCache.putStringForUser(resolver, name, value, tag,
4942 makeDefault, userHandle);
4943 }
4944
4945 /**
4946 * Store a name/value pair into the database.
4947 * <p>
4948 * The method takes an optional tag to associate with the setting
4949 * which can be used to clear only settings made by your package and
4950 * associated with this tag by passing the tag to {@link
4951 * #resetToDefaults(ContentResolver, String)}. Anyone can override
4952 * the current tag. Also if another package changes the setting
4953 * then the tag will be set to the one specified in the set call
4954 * which can be null. Also any of the settings setters that do not
4955 * take a tag as an argument effectively clears the tag.
4956 * </p><p>
4957 * For example, if you set settings A and B with tags T1 and T2 and
4958 * another app changes setting A (potentially to the same value), it
4959 * can assign to it a tag T3 (note that now the package that changed
4960 * the setting is not yours). Now if you reset your changes for T1 and
4961 * T2 only setting B will be reset and A not (as it was changed by
4962 * another package) but since A did not change you are in the desired
4963 * initial state. Now if the other app changes the value of A (assuming
4964 * you registered an observer in the beginning) you would detect that
4965 * the setting was changed by another app and handle this appropriately
4966 * (ignore, set back to some value, etc).
4967 * </p><p>
4968 * Also the method takes an argument whether to make the value the
4969 * default for this setting. If the system already specified a default
4970 * value, then the one passed in here will <strong>not</strong>
4971 * be set as the default.
4972 * </p>
4973 *
4974 * @param resolver to access the database with.
4975 * @param name to store.
4976 * @param value to associate with the name.
4977 * @param tag to associate with the setting.
4978 * @param makeDefault whether to make the value the default one.
4979 * @return true if the value was set, false on database errors.
4980 *
4981 * @see #resetToDefaults(ContentResolver, String)
4982 *
4983 * @hide
4984 */
4985 @SystemApi
4986 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
4987 public static boolean putString(@NonNull ContentResolver resolver,
4988 @NonNull String name, @Nullable String value, @Nullable String tag,
4989 boolean makeDefault) {
4990 return putStringForUser(resolver, name, value, tag, makeDefault,
Jeff Sharkeyad357d12018-02-02 13:25:31 -07004991 resolver.getUserId());
Svetoslav Ganove080da92016-12-21 17:10:35 -08004992 }
4993
4994 /**
4995 * Reset the settings to their defaults. This would reset <strong>only</strong>
4996 * settings set by the caller's package. Think of it of a way to undo your own
4997 * changes to the global settings. Passing in the optional tag will reset only
4998 * settings changed by your package and associated with this tag.
4999 *
5000 * @param resolver Handle to the content resolver.
5001 * @param tag Optional tag which should be associated with the settings to reset.
5002 *
5003 * @see #putString(ContentResolver, String, String, String, boolean)
5004 *
5005 * @hide
5006 */
5007 @SystemApi
5008 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
5009 public static void resetToDefaults(@NonNull ContentResolver resolver,
5010 @Nullable String tag) {
5011 resetToDefaultsAsUser(resolver, tag, RESET_MODE_PACKAGE_DEFAULTS,
Jeff Sharkeyad357d12018-02-02 13:25:31 -07005012 resolver.getUserId());
Svetoslav Ganove080da92016-12-21 17:10:35 -08005013 }
5014
5015 /**
5016 *
5017 * Reset the settings to their defaults for a given user with a specific mode. The
5018 * optional tag argument is valid only for {@link #RESET_MODE_PACKAGE_DEFAULTS}
5019 * allowing resetting the settings made by a package and associated with the tag.
5020 *
5021 * @param resolver Handle to the content resolver.
5022 * @param tag Optional tag which should be associated with the settings to reset.
5023 * @param mode The reset mode.
5024 * @param userHandle The user for which to reset to defaults.
5025 *
5026 * @see #RESET_MODE_PACKAGE_DEFAULTS
5027 * @see #RESET_MODE_UNTRUSTED_DEFAULTS
5028 * @see #RESET_MODE_UNTRUSTED_CHANGES
5029 * @see #RESET_MODE_TRUSTED_DEFAULTS
5030 *
5031 * @hide
5032 */
5033 public static void resetToDefaultsAsUser(@NonNull ContentResolver resolver,
5034 @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle) {
5035 try {
5036 Bundle arg = new Bundle();
5037 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
5038 if (tag != null) {
5039 arg.putString(CALL_METHOD_TAG_KEY, tag);
5040 }
5041 arg.putInt(CALL_METHOD_RESET_MODE_KEY, mode);
5042 IContentProvider cp = sProviderHolder.getProvider(resolver);
5043 cp.call(resolver.getPackageName(), CALL_METHOD_RESET_SECURE, null, arg);
5044 } catch (RemoteException e) {
5045 Log.w(TAG, "Can't reset do defaults for " + CONTENT_URI, e);
5046 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005047 }
5048
5049 /**
5050 * Construct the content URI for a particular name/value pair,
5051 * useful for monitoring changes with a ContentObserver.
5052 * @param name to look up in the table
5053 * @return the corresponding content URI, or null if not present
5054 */
5055 public static Uri getUriFor(String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07005056 if (MOVED_TO_GLOBAL.contains(name)) {
5057 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
5058 + " to android.provider.Settings.Global, returning global URI.");
5059 return Global.getUriFor(Global.CONTENT_URI, name);
5060 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005061 return getUriFor(CONTENT_URI, name);
5062 }
5063
5064 /**
5065 * Convenience function for retrieving a single secure settings value
5066 * as an integer. Note that internally setting values are always
5067 * stored as strings; this function converts the string to an integer
5068 * for you. The default value will be returned if the setting is
5069 * not defined or not an integer.
5070 *
5071 * @param cr The ContentResolver to access.
5072 * @param name The name of the setting to retrieve.
5073 * @param def Value to return if the setting is not defined.
5074 *
5075 * @return The setting's current value, or 'def' if it is not defined
5076 * or not a valid integer.
5077 */
5078 public static int getInt(ContentResolver cr, String name, int def) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07005079 return getIntForUser(cr, name, def, cr.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07005080 }
5081
5082 /** @hide */
5083 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
Tom O'Neill7f6f4572013-08-27 10:53:15 -07005084 if (LOCATION_MODE.equals(name)) {
Tom O'Neill87c7fad2016-08-04 08:16:12 -07005085 // Map from to underlying location provider storage API to location mode
Tom O'Neill7f6f4572013-08-27 10:53:15 -07005086 return getLocationModeForUser(cr, userHandle);
5087 }
Christopher Tate06efb532012-08-24 15:29:27 -07005088 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005089 try {
5090 return v != null ? Integer.parseInt(v) : def;
5091 } catch (NumberFormatException e) {
5092 return def;
5093 }
5094 }
5095
5096 /**
5097 * Convenience function for retrieving a single secure settings value
5098 * as an integer. Note that internally setting values are always
5099 * stored as strings; this function converts the string to an integer
5100 * for you.
5101 * <p>
5102 * This version does not take a default value. If the setting has not
5103 * been set, or the string value is not a number,
5104 * it throws {@link SettingNotFoundException}.
5105 *
5106 * @param cr The ContentResolver to access.
5107 * @param name The name of the setting to retrieve.
5108 *
5109 * @throws SettingNotFoundException Thrown if a setting by the given
5110 * name can't be found or the setting value is not an integer.
5111 *
5112 * @return The setting's current value.
5113 */
5114 public static int getInt(ContentResolver cr, String name)
5115 throws SettingNotFoundException {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07005116 return getIntForUser(cr, name, cr.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07005117 }
5118
5119 /** @hide */
5120 public static int getIntForUser(ContentResolver cr, String name, int userHandle)
5121 throws SettingNotFoundException {
Tom O'Neill7f6f4572013-08-27 10:53:15 -07005122 if (LOCATION_MODE.equals(name)) {
Tom O'Neill87c7fad2016-08-04 08:16:12 -07005123 // Map from to underlying location provider storage API to location mode
Tom O'Neill7f6f4572013-08-27 10:53:15 -07005124 return getLocationModeForUser(cr, userHandle);
5125 }
Christopher Tate06efb532012-08-24 15:29:27 -07005126 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005127 try {
5128 return Integer.parseInt(v);
5129 } catch (NumberFormatException e) {
5130 throw new SettingNotFoundException(name);
5131 }
5132 }
5133
5134 /**
5135 * Convenience function for updating a single settings value as an
5136 * integer. This will either create a new entry in the table if the
5137 * given name does not exist, or modify the value of the existing row
5138 * with that name. Note that internally setting values are always
5139 * stored as strings, so this function converts the given value to a
5140 * string before storing it.
5141 *
5142 * @param cr The ContentResolver to access.
5143 * @param name The name of the setting to modify.
5144 * @param value The new value for the setting.
5145 * @return true if the value was set, false on database errors
5146 */
5147 public static boolean putInt(ContentResolver cr, String name, int value) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07005148 return putIntForUser(cr, name, value, cr.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07005149 }
5150
5151 /** @hide */
5152 public static boolean putIntForUser(ContentResolver cr, String name, int value,
5153 int userHandle) {
5154 return putStringForUser(cr, name, Integer.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005155 }
5156
5157 /**
5158 * Convenience function for retrieving a single secure settings value
5159 * as a {@code long}. Note that internally setting values are always
5160 * stored as strings; this function converts the string to a {@code long}
5161 * for you. The default value will be returned if the setting is
5162 * not defined or not a {@code long}.
5163 *
5164 * @param cr The ContentResolver to access.
5165 * @param name The name of the setting to retrieve.
5166 * @param def Value to return if the setting is not defined.
5167 *
5168 * @return The setting's current value, or 'def' if it is not defined
5169 * or not a valid {@code long}.
5170 */
5171 public static long getLong(ContentResolver cr, String name, long def) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07005172 return getLongForUser(cr, name, def, cr.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07005173 }
5174
5175 /** @hide */
5176 public static long getLongForUser(ContentResolver cr, String name, long def,
5177 int userHandle) {
5178 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005179 long value;
5180 try {
5181 value = valString != null ? Long.parseLong(valString) : def;
5182 } catch (NumberFormatException e) {
5183 value = def;
5184 }
5185 return value;
5186 }
5187
5188 /**
5189 * Convenience function for retrieving a single secure settings value
5190 * as a {@code long}. Note that internally setting values are always
5191 * stored as strings; this function converts the string to a {@code long}
5192 * for you.
5193 * <p>
5194 * This version does not take a default value. If the setting has not
5195 * been set, or the string value is not a number,
5196 * it throws {@link SettingNotFoundException}.
5197 *
5198 * @param cr The ContentResolver to access.
5199 * @param name The name of the setting to retrieve.
5200 *
5201 * @return The setting's current value.
5202 * @throws SettingNotFoundException Thrown if a setting by the given
5203 * name can't be found or the setting value is not an integer.
5204 */
5205 public static long getLong(ContentResolver cr, String name)
5206 throws SettingNotFoundException {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07005207 return getLongForUser(cr, name, cr.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07005208 }
5209
5210 /** @hide */
5211 public static long getLongForUser(ContentResolver cr, String name, int userHandle)
5212 throws SettingNotFoundException {
5213 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005214 try {
5215 return Long.parseLong(valString);
5216 } catch (NumberFormatException e) {
5217 throw new SettingNotFoundException(name);
5218 }
5219 }
5220
5221 /**
5222 * Convenience function for updating a secure settings value as a long
5223 * integer. This will either create a new entry in the table if the
5224 * given name does not exist, or modify the value of the existing row
5225 * with that name. Note that internally setting values are always
5226 * stored as strings, so this function converts the given value to a
5227 * string before storing it.
5228 *
5229 * @param cr The ContentResolver to access.
5230 * @param name The name of the setting to modify.
5231 * @param value The new value for the setting.
5232 * @return true if the value was set, false on database errors
5233 */
5234 public static boolean putLong(ContentResolver cr, String name, long value) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07005235 return putLongForUser(cr, name, value, cr.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07005236 }
5237
5238 /** @hide */
5239 public static boolean putLongForUser(ContentResolver cr, String name, long value,
5240 int userHandle) {
5241 return putStringForUser(cr, name, Long.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005242 }
5243
5244 /**
5245 * Convenience function for retrieving a single secure settings value
5246 * as a floating point number. Note that internally setting values are
5247 * always stored as strings; this function converts the string to an
5248 * float for you. The default value will be returned if the setting
5249 * is not defined or not a valid float.
5250 *
5251 * @param cr The ContentResolver to access.
5252 * @param name The name of the setting to retrieve.
5253 * @param def Value to return if the setting is not defined.
5254 *
5255 * @return The setting's current value, or 'def' if it is not defined
5256 * or not a valid float.
5257 */
5258 public static float getFloat(ContentResolver cr, String name, float def) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07005259 return getFloatForUser(cr, name, def, cr.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07005260 }
5261
5262 /** @hide */
5263 public static float getFloatForUser(ContentResolver cr, String name, float def,
5264 int userHandle) {
5265 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005266 try {
5267 return v != null ? Float.parseFloat(v) : def;
5268 } catch (NumberFormatException e) {
5269 return def;
5270 }
5271 }
5272
5273 /**
5274 * Convenience function for retrieving a single secure settings value
5275 * as a float. Note that internally setting values are always
5276 * stored as strings; this function converts the string to a float
5277 * for you.
5278 * <p>
5279 * This version does not take a default value. If the setting has not
5280 * been set, or the string value is not a number,
5281 * it throws {@link SettingNotFoundException}.
5282 *
5283 * @param cr The ContentResolver to access.
5284 * @param name The name of the setting to retrieve.
5285 *
5286 * @throws SettingNotFoundException Thrown if a setting by the given
5287 * name can't be found or the setting value is not a float.
5288 *
5289 * @return The setting's current value.
5290 */
5291 public static float getFloat(ContentResolver cr, String name)
5292 throws SettingNotFoundException {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07005293 return getFloatForUser(cr, name, cr.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07005294 }
5295
5296 /** @hide */
5297 public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
5298 throws SettingNotFoundException {
5299 String v = getStringForUser(cr, name, userHandle);
Brian Muramatsue1d46982010-12-06 17:34:20 -08005300 if (v == null) {
5301 throw new SettingNotFoundException(name);
5302 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005303 try {
5304 return Float.parseFloat(v);
5305 } catch (NumberFormatException e) {
5306 throw new SettingNotFoundException(name);
5307 }
5308 }
5309
5310 /**
5311 * Convenience function for updating a single settings value as a
5312 * floating point number. This will either create a new entry in the
5313 * table if the given name does not exist, or modify the value of the
5314 * existing row with that name. Note that internally setting values
5315 * are always stored as strings, so this function converts the given
5316 * value to a string before storing it.
5317 *
5318 * @param cr The ContentResolver to access.
5319 * @param name The name of the setting to modify.
5320 * @param value The new value for the setting.
5321 * @return true if the value was set, false on database errors
5322 */
5323 public static boolean putFloat(ContentResolver cr, String name, float value) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07005324 return putFloatForUser(cr, name, value, cr.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07005325 }
5326
5327 /** @hide */
5328 public static boolean putFloatForUser(ContentResolver cr, String name, float value,
5329 int userHandle) {
5330 return putStringForUser(cr, name, Float.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005331 }
5332
5333 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005334 * @deprecated Use {@link android.provider.Settings.Global#DEVELOPMENT_SETTINGS_ENABLED}
5335 * instead
Dianne Hackborn895f99e2012-02-02 11:49:12 -08005336 */
Christopher Tate06efb532012-08-24 15:29:27 -07005337 @Deprecated
5338 public static final String DEVELOPMENT_SETTINGS_ENABLED =
5339 Global.DEVELOPMENT_SETTINGS_ENABLED;
Dianne Hackborn895f99e2012-02-02 11:49:12 -08005340
5341 /**
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07005342 * When the user has enable the option to have a "bug report" command
5343 * in the power menu.
Christopher Tate58f41ec2013-01-11 15:40:36 -08005344 * @deprecated Use {@link android.provider.Settings.Global#BUGREPORT_IN_POWER_MENU} instead
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07005345 * @hide
5346 */
Christopher Tate58f41ec2013-01-11 15:40:36 -08005347 @Deprecated
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07005348 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
5349
Michal Karpinski5db1e432018-01-18 20:10:24 +00005350 private static final Validator BUGREPORT_IN_POWER_MENU_VALIDATOR = BOOLEAN_VALIDATOR;
5351
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07005352 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005353 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005354 */
Christopher Tate06efb532012-08-24 15:29:27 -07005355 @Deprecated
5356 public static final String ADB_ENABLED = Global.ADB_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005357
5358 /**
5359 * Setting to allow mock locations and location provider status to be injected into the
5360 * LocationManager service for testing purposes during application development. These
5361 * locations and status values override actual location and status information generated
5362 * by network, gps, or other location providers.
Svet Ganovf7e9cf42015-05-13 10:40:31 -07005363 *
5364 * @deprecated This settings is not used anymore.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005365 */
Svet Ganovf7e9cf42015-05-13 10:40:31 -07005366 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005367 public static final String ALLOW_MOCK_LOCATION = "mock_location";
5368
Michal Karpinski964943a2018-01-19 16:28:26 +00005369 private static final Validator ALLOW_MOCK_LOCATION_VALIDATOR = BOOLEAN_VALIDATOR;
5370
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005371 /**
Dave Friedman4b3a4b52017-06-14 18:45:58 -07005372 * On Android 8.0 (API level 26) and higher versions of the platform,
5373 * a 64-bit number (expressed as a hexadecimal string), unique to
5374 * each combination of app-signing key, user, and device.
5375 * Values of {@code ANDROID_ID} are scoped by signing key and user.
5376 * The value may change if a factory reset is performed on the
5377 * device or if an APK signing key changes.
Chad Brubaker0d277a72017-04-12 16:56:53 -07005378 *
Dave Friedman4b3a4b52017-06-14 18:45:58 -07005379 * For more information about how the platform handles {@code ANDROID_ID}
5380 * in Android 8.0 (API level 26) and higher, see <a
Christopher Tate4be780e2018-04-06 12:25:18 -07005381 * href="{@docRoot}about/versions/oreo/android-8.0-changes.html#privacy-all">
Dave Friedman4b3a4b52017-06-14 18:45:58 -07005382 * Android 8.0 Behavior Changes</a>.
5383 *
5384 * <p class="note"><strong>Note:</strong> For apps that were installed
5385 * prior to updating the device to a version of Android 8.0
5386 * (API level 26) or higher, the value of {@code ANDROID_ID} changes
5387 * if the app is uninstalled and then reinstalled after the OTA.
5388 * To preserve values across uninstalls after an OTA to Android 8.0
5389 * or higher, developers can use
5390 * <a href="{@docRoot}guide/topics/data/keyvaluebackup.html">
5391 * Key/Value Backup</a>.</p>
5392 *
5393 * <p>In versions of the platform lower than Android 8.0 (API level 26),
5394 * a 64-bit number (expressed as a hexadecimal string) that is randomly
5395 * generated when the user first sets up the device and should remain
5396 * constant for the lifetime of the user's device.
5397 *
5398 * On devices that have
5399 * <a href="{@docRoot}about/versions/android-4.2.html#MultipleUsers">
5400 * multiple users</a>, each user appears as a
5401 * completely separate device, so the {@code ANDROID_ID} value is
5402 * unique to each user.</p>
5403 *
5404 * <p class="note"><strong>Note:</strong> If the caller is an Instant App the ID is scoped
Chad Brubaker0d277a72017-04-12 16:56:53 -07005405 * to the Instant App, it is generated when the Instant App is first installed and reset if
5406 * the user clears the Instant App.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005407 */
5408 public static final String ANDROID_ID = "android_id";
5409
5410 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005411 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005412 */
Christopher Tate06efb532012-08-24 15:29:27 -07005413 @Deprecated
5414 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005415
Michal Karpinski5db1e432018-01-18 20:10:24 +00005416 private static final Validator BLUETOOTH_ON_VALIDATOR = BOOLEAN_VALIDATOR;
5417
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005418 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005419 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005420 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07005421 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07005422 public static final String DATA_ROAMING = Global.DATA_ROAMING;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005423
5424 /**
5425 * Setting to record the input method used by default, holding the ID
5426 * of the desired method.
5427 */
5428 public static final String DEFAULT_INPUT_METHOD = "default_input_method";
5429
5430 /**
satokab751aa2010-09-14 19:17:36 +09005431 * Setting to record the input method subtype used by default, holding the ID
5432 * of the desired method.
5433 */
5434 public static final String SELECTED_INPUT_METHOD_SUBTYPE =
5435 "selected_input_method_subtype";
5436
5437 /**
satok723a27e2010-11-11 14:58:11 +09005438 * Setting to record the history of input method subtype, holding the pair of ID of IME
5439 * and its last used subtype.
5440 * @hide
5441 */
5442 public static final String INPUT_METHODS_SUBTYPE_HISTORY =
5443 "input_methods_subtype_history";
5444
5445 /**
satok5c58dfc2010-12-14 21:54:47 +09005446 * Setting to record the visibility of input method selector
5447 */
5448 public static final String INPUT_METHOD_SELECTOR_VISIBILITY =
5449 "input_method_selector_visibility";
5450
5451 /**
Dianne Hackborn91097de2014-04-04 18:02:06 -07005452 * The currently selected voice interaction service flattened ComponentName.
5453 * @hide
5454 */
Jeff Sharkeya73b8fd2016-01-06 17:02:08 -07005455 @TestApi
Dianne Hackborn91097de2014-04-04 18:02:06 -07005456 public static final String VOICE_INTERACTION_SERVICE = "voice_interaction_service";
5457
5458 /**
Felipe Leme640f30a2017-03-06 15:44:06 -08005459 * The currently selected autofill service flattened ComponentName.
Felipe Leme5381aa42016-10-13 09:02:32 -07005460 * @hide
5461 */
5462 @TestApi
Felipe Leme640f30a2017-03-06 15:44:06 -08005463 public static final String AUTOFILL_SERVICE = "autofill_service";
Felipe Leme5381aa42016-10-13 09:02:32 -07005464
Annie Meng44511792018-05-17 18:49:24 +01005465 private static final Validator AUTOFILL_SERVICE_VALIDATOR =
5466 NULLABLE_COMPONENT_NAME_VALIDATOR;
Michal Karpinski964943a2018-01-19 16:28:26 +00005467
Felipe Leme5381aa42016-10-13 09:02:32 -07005468 /**
Felipe Leme78172e72017-12-08 17:01:15 -08005469 * Boolean indicating if Autofill supports field classification.
Felipe Leme24d71732017-10-20 10:32:57 -07005470 *
Felipe Leme78172e72017-12-08 17:01:15 -08005471 * @see android.service.autofill.AutofillService
5472 *
Felipe Leme24d71732017-10-20 10:32:57 -07005473 * @hide
5474 */
Felipe Leme78172e72017-12-08 17:01:15 -08005475 @SystemApi
Felipe Leme24d71732017-10-20 10:32:57 -07005476 @TestApi
Felipe Leme329d0402017-12-06 09:22:43 -08005477 public static final String AUTOFILL_FEATURE_FIELD_CLASSIFICATION =
5478 "autofill_field_classification";
Felipe Leme24d71732017-10-20 10:32:57 -07005479
5480 /**
Felipe Leme78172e72017-12-08 17:01:15 -08005481 * Defines value returned by {@link android.service.autofill.UserData#getMaxUserDataSize()}.
Felipe Leme452886a2017-11-27 13:09:13 -08005482 *
Felipe Leme452886a2017-11-27 13:09:13 -08005483 * @hide
5484 */
Felipe Leme78172e72017-12-08 17:01:15 -08005485 @SystemApi
Felipe Lemebbfed902017-12-20 15:54:33 -08005486 @TestApi
Felipe Leme452886a2017-11-27 13:09:13 -08005487 public static final String AUTOFILL_USER_DATA_MAX_USER_DATA_SIZE =
5488 "autofill_user_data_max_user_data_size";
5489
5490 /**
Felipe Leme78172e72017-12-08 17:01:15 -08005491 * Defines value returned by
5492 * {@link android.service.autofill.UserData#getMaxFieldClassificationIdsSize()}.
Felipe Leme452886a2017-11-27 13:09:13 -08005493 *
Felipe Leme452886a2017-11-27 13:09:13 -08005494 * @hide
5495 */
Felipe Leme78172e72017-12-08 17:01:15 -08005496 @SystemApi
Felipe Lemebbfed902017-12-20 15:54:33 -08005497 @TestApi
Felipe Leme452886a2017-11-27 13:09:13 -08005498 public static final String AUTOFILL_USER_DATA_MAX_FIELD_CLASSIFICATION_IDS_SIZE =
5499 "autofill_user_data_max_field_classification_size";
5500
5501 /**
Felipe Lemefebb7332018-02-12 18:12:55 -08005502 * Defines value returned by
5503 * {@link android.service.autofill.UserData#getMaxCategoryCount()}.
5504 *
5505 * @hide
5506 */
5507 @SystemApi
5508 @TestApi
5509 public static final String AUTOFILL_USER_DATA_MAX_CATEGORY_COUNT =
5510 "autofill_user_data_max_category_count";
5511
5512 /**
Felipe Leme78172e72017-12-08 17:01:15 -08005513 * Defines value returned by {@link android.service.autofill.UserData#getMaxValueLength()}.
Felipe Leme452886a2017-11-27 13:09:13 -08005514 *
Felipe Leme452886a2017-11-27 13:09:13 -08005515 * @hide
5516 */
Felipe Leme78172e72017-12-08 17:01:15 -08005517 @SystemApi
Felipe Lemebbfed902017-12-20 15:54:33 -08005518 @TestApi
Felipe Leme452886a2017-11-27 13:09:13 -08005519 public static final String AUTOFILL_USER_DATA_MAX_VALUE_LENGTH =
5520 "autofill_user_data_max_value_length";
5521
5522 /**
Felipe Leme78172e72017-12-08 17:01:15 -08005523 * Defines value returned by {@link android.service.autofill.UserData#getMinValueLength()}.
Felipe Leme452886a2017-11-27 13:09:13 -08005524 *
Felipe Leme452886a2017-11-27 13:09:13 -08005525 * @hide
5526 */
Felipe Leme78172e72017-12-08 17:01:15 -08005527 @SystemApi
Felipe Lemebbfed902017-12-20 15:54:33 -08005528 @TestApi
Felipe Leme452886a2017-11-27 13:09:13 -08005529 public static final String AUTOFILL_USER_DATA_MIN_VALUE_LENGTH =
5530 "autofill_user_data_min_value_length";
5531
5532 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005533 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005534 */
Christopher Tate06efb532012-08-24 15:29:27 -07005535 @Deprecated
5536 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005537
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005538 /**
Russell Brennerde6ae442012-09-26 20:53:10 -07005539 * Whether the current user has been set up via setup wizard (0 = false, 1 = true)
5540 * @hide
5541 */
Felipe Leme99230122017-06-12 14:33:02 -07005542 @TestApi
Russell Brennerde6ae442012-09-26 20:53:10 -07005543 public static final String USER_SETUP_COMPLETE = "user_setup_complete";
5544
5545 /**
Ajay Nadathur702fc642018-03-09 11:56:01 -08005546 * The current state of device personalization.
5547 *
5548 * @hide
5549 * @see UserSetupPersonalization
5550 */
5551 public static final String USER_SETUP_PERSONALIZATION_STATE =
5552 "user_setup_personalization_state";
5553
5554 /**
Sujith Ramakrishnan314df162017-06-16 18:03:18 -07005555 * Whether the current user has been set up via setup wizard (0 = false, 1 = true)
5556 * This value differs from USER_SETUP_COMPLETE in that it can be reset back to 0
5557 * in case SetupWizard has been re-enabled on TV devices.
5558 *
5559 * @hide
5560 */
5561 public static final String TV_USER_SETUP_COMPLETE = "tv_user_setup_complete";
5562
5563 /**
Ido Ofird193c672016-03-01 13:27:54 -08005564 * Prefix for category name that marks whether a suggested action from that category was
5565 * completed.
5566 * @hide
5567 */
5568 public static final String COMPLETED_CATEGORY_PREFIX = "suggested.completed_category.";
5569
5570 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005571 * List of input methods that are currently enabled. This is a string
5572 * containing the IDs of all enabled input methods, each ID separated
5573 * by ':'.
Michal Karpinski964943a2018-01-19 16:28:26 +00005574 *
5575 * Format like "ime0;subtype0;subtype1;subtype2:ime1:ime2;subtype0"
5576 * where imeId is ComponentName and subtype is int32.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005577 */
5578 public static final String ENABLED_INPUT_METHODS = "enabled_input_methods";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005579
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005580 /**
Amith Yamasanie861ec12010-03-24 21:39:27 -07005581 * List of system input methods that are currently disabled. This is a string
5582 * containing the IDs of all disabled input methods, each ID separated
5583 * by ':'.
5584 * @hide
5585 */
5586 public static final String DISABLED_SYSTEM_INPUT_METHODS = "disabled_system_input_methods";
5587
5588 /**
Michael Wright7b5a96b2014-08-09 19:28:42 -07005589 * Whether to show the IME when a hard keyboard is connected. This is a boolean that
5590 * determines if the IME should be shown when a hard keyboard is attached.
5591 * @hide
5592 */
5593 public static final String SHOW_IME_WITH_HARD_KEYBOARD = "show_ime_with_hard_keyboard";
5594
Michal Karpinski964943a2018-01-19 16:28:26 +00005595 private static final Validator SHOW_IME_WITH_HARD_KEYBOARD_VALIDATOR = BOOLEAN_VALIDATOR;
5596
Michael Wright7b5a96b2014-08-09 19:28:42 -07005597 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07005598 * Host name and port for global http proxy. Uses ':' seperator for
5599 * between host and port.
5600 *
5601 * @deprecated Use {@link Global#HTTP_PROXY}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005602 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07005603 @Deprecated
5604 public static final String HTTP_PROXY = Global.HTTP_PROXY;
Robert Greenwalte90aa5e2010-09-01 11:34:05 -07005605
5606 /**
Robin Lee244ce8e2016-01-05 18:03:46 +00005607 * Package designated as always-on VPN provider.
5608 *
5609 * @hide
5610 */
5611 public static final String ALWAYS_ON_VPN_APP = "always_on_vpn_app";
5612
5613 /**
Robin Lee17e61832016-05-09 13:46:28 +01005614 * Whether to block networking outside of VPN connections while always-on is set.
5615 * @see #ALWAYS_ON_VPN_APP
5616 *
5617 * @hide
5618 */
5619 public static final String ALWAYS_ON_VPN_LOCKDOWN = "always_on_vpn_lockdown";
5620
5621 /**
Christopher Tateaa036a22014-05-19 16:33:27 -07005622 * Whether applications can be installed for this user via the system's
5623 * {@link Intent#ACTION_INSTALL_PACKAGE} mechanism.
5624 *
5625 * <p>1 = permit app installation via the system package installer intent
5626 * <p>0 = do not allow use of the package installer
Suprabh Shuklaaef25132017-01-23 18:09:03 -08005627 * @deprecated Starting from {@link android.os.Build.VERSION_CODES#O}, apps should use
5628 * {@link PackageManager#canRequestPackageInstalls()}
5629 * @see PackageManager#canRequestPackageInstalls()
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005630 */
Christopher Tateaa036a22014-05-19 16:33:27 -07005631 public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005632
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005633 /**
Suprabh Shukla0b1356f2017-02-21 14:33:50 -08005634 * A flag to tell {@link com.android.server.devicepolicy.DevicePolicyManagerService} that
5635 * the default for {@link #INSTALL_NON_MARKET_APPS} is reversed for this user on OTA. So it
5636 * can set the restriction {@link android.os.UserManager#DISALLOW_INSTALL_UNKNOWN_SOURCES}
5637 * on behalf of the profile owner if needed to make the change transparent for profile
5638 * owners.
5639 *
5640 * @hide
5641 */
5642 public static final String UNKNOWN_SOURCES_DEFAULT_REVERSED =
5643 "unknown_sources_default_reversed";
5644
5645 /**
Tom O'Neill923c0dc2014-03-03 11:07:55 -08005646 * Comma-separated list of location providers that activities may access. Do not rely on
5647 * this value being present in settings.db or on ContentObserver notifications on the
5648 * corresponding Uri.
Tom O'Neilla324ac72013-08-26 14:40:23 -07005649 *
Tom O'Neill923c0dc2014-03-03 11:07:55 -08005650 * @deprecated use {@link #LOCATION_MODE} and
5651 * {@link LocationManager#MODE_CHANGED_ACTION} (or
5652 * {@link LocationManager#PROVIDERS_CHANGED_ACTION})
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005653 */
Tom O'Neilla324ac72013-08-26 14:40:23 -07005654 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005655 public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005656
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005657 /**
Tom O'Neill7f6f4572013-08-27 10:53:15 -07005658 * The degree of location access enabled by the user.
Tom O'Neill923c0dc2014-03-03 11:07:55 -08005659 * <p>
Tom O'Neill7f6f4572013-08-27 10:53:15 -07005660 * When used with {@link #putInt(ContentResolver, String, int)}, must be one of {@link
5661 * #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY}, {@link
5662 * #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}. When used with {@link
5663 * #getInt(ContentResolver, String)}, the caller must gracefully handle additional location
5664 * modes that might be added in the future.
Tom O'Neill923c0dc2014-03-03 11:07:55 -08005665 * <p>
5666 * Note: do not rely on this value being present in settings.db or on ContentObserver
5667 * notifications for the corresponding Uri. Use {@link LocationManager#MODE_CHANGED_ACTION}
5668 * to receive changes in this value.
Maggieaa080f92018-01-04 15:35:11 -08005669 *
5670 * @deprecated To check location status, use {@link LocationManager#isLocationEnabled()}. To
5671 * get the status of a location provider, use
5672 * {@link LocationManager#isProviderEnabled(String)}.
Tom O'Neilla324ac72013-08-26 14:40:23 -07005673 */
Maggieaa080f92018-01-04 15:35:11 -08005674 @Deprecated
Tom O'Neilla324ac72013-08-26 14:40:23 -07005675 public static final String LOCATION_MODE = "location_mode";
5676
5677 /**
Lifu Tang0cba58f2018-01-23 21:14:15 -08005678 * The App or module that changes the location mode.
5679 * @hide
5680 */
5681 public static final String LOCATION_CHANGER = "location_changer";
5682 /**
5683 * The location changer is unknown or unable to detect.
5684 * @hide
5685 */
5686 public static final int LOCATION_CHANGER_UNKNOWN = 0;
5687 /**
5688 * Location settings in system settings.
5689 * @hide
5690 */
5691 public static final int LOCATION_CHANGER_SYSTEM_SETTINGS = 1;
5692 /**
5693 * The location icon in drop down notification drawer.
5694 * @hide
5695 */
5696 public static final int LOCATION_CHANGER_QUICK_SETTINGS = 2;
5697
5698 /**
Tom O'Neill7f6f4572013-08-27 10:53:15 -07005699 * Location access disabled.
Maggieaa080f92018-01-04 15:35:11 -08005700 *
5701 * @deprecated To check location status, use {@link LocationManager#isLocationEnabled()}. To
5702 * get the status of a location provider, use
5703 * {@link LocationManager#isProviderEnabled(String)}.
Tom O'Neill1f48b782013-08-19 18:14:56 -07005704 */
Maggieaa080f92018-01-04 15:35:11 -08005705 @Deprecated
Tom O'Neill1f48b782013-08-19 18:14:56 -07005706 public static final int LOCATION_MODE_OFF = 0;
Maggieaa080f92018-01-04 15:35:11 -08005707
Tom O'Neill1f48b782013-08-19 18:14:56 -07005708 /**
5709 * Network Location Provider disabled, but GPS and other sensors enabled.
Maggieaa080f92018-01-04 15:35:11 -08005710 *
5711 * @deprecated To check location status, use {@link LocationManager#isLocationEnabled()}. To
5712 * get the status of a location provider, use
5713 * {@link LocationManager#isProviderEnabled(String)}.
Tom O'Neill1f48b782013-08-19 18:14:56 -07005714 */
Maggieaa080f92018-01-04 15:35:11 -08005715 @Deprecated
Tom O'Neill1f48b782013-08-19 18:14:56 -07005716 public static final int LOCATION_MODE_SENSORS_ONLY = 1;
Maggieaa080f92018-01-04 15:35:11 -08005717
Tom O'Neill1f48b782013-08-19 18:14:56 -07005718 /**
Tom O'Neilld5759432013-09-11 11:03:03 -07005719 * Reduced power usage, such as limiting the number of GPS updates per hour. Requests
5720 * with {@link android.location.Criteria#POWER_HIGH} may be downgraded to
5721 * {@link android.location.Criteria#POWER_MEDIUM}.
Maggieaa080f92018-01-04 15:35:11 -08005722 *
5723 * @deprecated To check location status, use {@link LocationManager#isLocationEnabled()}. To
5724 * get the status of a location provider, use
5725 * {@link LocationManager#isProviderEnabled(String)}.
Tom O'Neill1f48b782013-08-19 18:14:56 -07005726 */
Maggieaa080f92018-01-04 15:35:11 -08005727 @Deprecated
Tom O'Neill1f48b782013-08-19 18:14:56 -07005728 public static final int LOCATION_MODE_BATTERY_SAVING = 2;
Maggieaa080f92018-01-04 15:35:11 -08005729
Tom O'Neill1f48b782013-08-19 18:14:56 -07005730 /**
5731 * Best-effort location computation allowed.
Maggieaa080f92018-01-04 15:35:11 -08005732 *
5733 * @deprecated To check location status, use {@link LocationManager#isLocationEnabled()}. To
5734 * get the status of a location provider, use
5735 * {@link LocationManager#isProviderEnabled(String)}.
Tom O'Neill1f48b782013-08-19 18:14:56 -07005736 */
Maggieaa080f92018-01-04 15:35:11 -08005737 @Deprecated
Tom O'Neill1f48b782013-08-19 18:14:56 -07005738 public static final int LOCATION_MODE_HIGH_ACCURACY = 3;
5739
5740 /**
Danielle Millett925a7d82012-03-19 18:02:20 -04005741 * A flag containing settings used for biometric weak
5742 * @hide
5743 */
Adrian Roos230635e2015-01-07 20:50:29 +01005744 @Deprecated
Danielle Millett925a7d82012-03-19 18:02:20 -04005745 public static final String LOCK_BIOMETRIC_WEAK_FLAGS =
5746 "lock_biometric_weak_flags";
5747
5748 /**
Jason Monk94cfd9d2014-10-31 13:18:21 -04005749 * Whether lock-to-app will lock the keyguard when exiting.
5750 * @hide
5751 */
5752 public static final String LOCK_TO_APP_EXIT_LOCKED = "lock_to_app_exit_locked";
5753
5754 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08005755 * Whether autolock is enabled (0 = false, 1 = true)
Adrian Roos9dd16eb2015-01-08 16:20:49 +01005756 *
5757 * @deprecated Use {@link android.app.KeyguardManager} to determine the state and security
Adrian Roos7811d9f2015-07-27 15:10:13 -07005758 * level of the keyguard. Accessing this setting from an app that is targeting
Deepanshu Guptae836a222015-07-31 12:11:07 -07005759 * {@link VERSION_CODES#M} or later throws a {@code SecurityException}.
Amith Yamasani156c4352010-03-05 17:10:03 -08005760 */
Adrian Roos9dd16eb2015-01-08 16:20:49 +01005761 @Deprecated
Amith Yamasani156c4352010-03-05 17:10:03 -08005762 public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock";
5763
5764 /**
5765 * Whether lock pattern is visible as user enters (0 = false, 1 = true)
Adrian Roos7811d9f2015-07-27 15:10:13 -07005766 *
5767 * @deprecated Accessing this setting from an app that is targeting
Deepanshu Guptae836a222015-07-31 12:11:07 -07005768 * {@link VERSION_CODES#M} or later throws a {@code SecurityException}.
Amith Yamasani156c4352010-03-05 17:10:03 -08005769 */
Adrian Roos7811d9f2015-07-27 15:10:13 -07005770 @Deprecated
Amith Yamasani156c4352010-03-05 17:10:03 -08005771 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
5772
5773 /**
Jeff Sharkey5ed9d682012-10-10 14:28:27 -07005774 * Whether lock pattern will vibrate as user enters (0 = false, 1 =
5775 * true)
5776 *
5777 * @deprecated Starting in {@link VERSION_CODES#JELLY_BEAN_MR1} the
5778 * lockscreen uses
5779 * {@link Settings.System#HAPTIC_FEEDBACK_ENABLED}.
Adrian Roos7811d9f2015-07-27 15:10:13 -07005780 * Accessing this setting from an app that is targeting
Deepanshu Guptae836a222015-07-31 12:11:07 -07005781 * {@link VERSION_CODES#M} or later throws a {@code SecurityException}.
Amith Yamasani156c4352010-03-05 17:10:03 -08005782 */
Jeff Sharkey5ed9d682012-10-10 14:28:27 -07005783 @Deprecated
5784 public static final String
5785 LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = "lock_pattern_tactile_feedback_enabled";
Amith Yamasani156c4352010-03-05 17:10:03 -08005786
5787 /**
Jim Millerbc4603b2010-08-30 21:21:34 -07005788 * This preference allows the device to be locked given time after screen goes off,
5789 * subject to current DeviceAdmin policy limits.
5790 * @hide
5791 */
5792 public static final String LOCK_SCREEN_LOCK_AFTER_TIMEOUT = "lock_screen_lock_after_timeout";
5793
5794
5795 /**
John Spurlock5f050e52012-10-27 10:44:19 -04005796 * This preference contains the string that shows for owner info on LockScreen.
Jim Miller253a5ef2010-10-13 20:57:29 -07005797 * @hide
Jim Miller187ec582013-04-15 18:27:54 -07005798 * @deprecated
Jim Miller253a5ef2010-10-13 20:57:29 -07005799 */
Aurimas Liutikas514c5ef2016-05-24 15:22:55 -07005800 @Deprecated
Jim Miller253a5ef2010-10-13 20:57:29 -07005801 public static final String LOCK_SCREEN_OWNER_INFO = "lock_screen_owner_info";
5802
5803 /**
John Spurlock5f050e52012-10-27 10:44:19 -04005804 * Ids of the user-selected appwidgets on the lockscreen (comma-delimited).
Jim Millerf229e4d2012-09-12 20:32:50 -07005805 * @hide
5806 */
Adrian Roos230635e2015-01-07 20:50:29 +01005807 @Deprecated
Michael Jurkaaa2859a2012-10-24 12:46:49 -07005808 public static final String LOCK_SCREEN_APPWIDGET_IDS =
5809 "lock_screen_appwidget_ids";
Jim Millerf229e4d2012-09-12 20:32:50 -07005810
5811 /**
Jim Miller51117262012-11-04 17:58:09 -08005812 * Id of the appwidget shown on the lock screen when appwidgets are disabled.
5813 * @hide
5814 */
Adrian Roos230635e2015-01-07 20:50:29 +01005815 @Deprecated
Jim Miller51117262012-11-04 17:58:09 -08005816 public static final String LOCK_SCREEN_FALLBACK_APPWIDGET_ID =
5817 "lock_screen_fallback_appwidget_id";
5818
5819 /**
John Spurlock5f050e52012-10-27 10:44:19 -04005820 * Index of the lockscreen appwidget to restore, -1 if none.
5821 * @hide
5822 */
Adrian Roos230635e2015-01-07 20:50:29 +01005823 @Deprecated
John Spurlock5f050e52012-10-27 10:44:19 -04005824 public static final String LOCK_SCREEN_STICKY_APPWIDGET =
5825 "lock_screen_sticky_appwidget";
5826
5827 /**
5828 * This preference enables showing the owner info on LockScreen.
Jim Miller253a5ef2010-10-13 20:57:29 -07005829 * @hide
Jim Miller187ec582013-04-15 18:27:54 -07005830 * @deprecated
Jim Miller253a5ef2010-10-13 20:57:29 -07005831 */
Aurimas Liutikas514c5ef2016-05-24 15:22:55 -07005832 @Deprecated
Jim Miller253a5ef2010-10-13 20:57:29 -07005833 public static final String LOCK_SCREEN_OWNER_INFO_ENABLED =
5834 "lock_screen_owner_info_enabled";
5835
5836 /**
Dan Sandler5d7c3cc2014-02-18 17:35:15 -05005837 * When set by a user, allows notifications to be shown atop a securely locked screen
5838 * in their full "private" form (same as when the device is unlocked).
Dan Sandlerfd16d562014-02-13 18:43:31 -08005839 * @hide
5840 */
5841 public static final String LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS =
5842 "lock_screen_allow_private_notifications";
5843
5844 /**
Adrian Roos3aec6382016-02-05 14:19:01 -08005845 * When set by a user, allows notification remote input atop a securely locked screen
5846 * without having to unlock
5847 * @hide
5848 */
5849 public static final String LOCK_SCREEN_ALLOW_REMOTE_INPUT =
5850 "lock_screen_allow_remote_input";
5851
5852 /**
Chris Wrencd8f4f72014-08-27 18:48:13 -04005853 * Set by the system to track if the user needs to see the call to action for
5854 * the lockscreen notification policy.
5855 * @hide
5856 */
5857 public static final String SHOW_NOTE_ABOUT_NOTIFICATION_HIDING =
5858 "show_note_about_notification_hiding";
5859
5860 /**
Adrian Roos3870d452014-09-05 18:22:28 +02005861 * Set to 1 by the system after trust agents have been initialized.
5862 * @hide
5863 */
5864 public static final String TRUST_AGENTS_INITIALIZED =
5865 "trust_agents_initialized";
5866
5867 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005868 * The Logging ID (a unique 64-bit value) as a hex string.
5869 * Used as a pseudonymous identifier for logging.
5870 * @deprecated This identifier is poorly initialized and has
5871 * many collisions. It should not be used.
5872 */
5873 @Deprecated
5874 public static final String LOGGING_ID = "logging_id";
5875
5876 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005877 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005878 */
Christopher Tate06efb532012-08-24 15:29:27 -07005879 @Deprecated
5880 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005881
5882 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08005883 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005884 */
5885 public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005886
5887 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08005888 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005889 */
5890 public static final String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005891
5892 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08005893 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005894 */
5895 public static final String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005896
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005897 /**
5898 * Settings classname to launch when Settings is clicked from All
5899 * Applications. Needed because of user testing between the old
5900 * and new Settings apps.
5901 */
5902 // TODO: 881807
5903 public static final String SETTINGS_CLASSNAME = "settings_classname";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005904
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005905 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005906 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005907 */
Christopher Tate06efb532012-08-24 15:29:27 -07005908 @Deprecated
5909 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005910
Michal Karpinski5db1e432018-01-18 20:10:24 +00005911 private static final Validator USB_MASS_STORAGE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
5912
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005913 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005914 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005915 */
Christopher Tate06efb532012-08-24 15:29:27 -07005916 @Deprecated
5917 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005918
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005919 /**
svetoslavganov75986cf2009-05-14 22:28:01 -07005920 * If accessibility is enabled.
5921 */
5922 public static final String ACCESSIBILITY_ENABLED = "accessibility_enabled";
5923
Michal Karpinski964943a2018-01-19 16:28:26 +00005924 private static final Validator ACCESSIBILITY_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
5925
svetoslavganov75986cf2009-05-14 22:28:01 -07005926 /**
Phil Weaverce687c52017-03-15 08:51:52 -07005927 * Setting specifying if the accessibility shortcut is enabled.
5928 * @hide
5929 */
5930 public static final String ACCESSIBILITY_SHORTCUT_ENABLED =
5931 "accessibility_shortcut_enabled";
5932
Michal Karpinski964943a2018-01-19 16:28:26 +00005933 private static final Validator ACCESSIBILITY_SHORTCUT_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
5934
Phil Weaverce687c52017-03-15 08:51:52 -07005935 /**
5936 * Setting specifying if the accessibility shortcut is enabled.
5937 * @hide
5938 */
5939 public static final String ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN =
5940 "accessibility_shortcut_on_lock_screen";
5941
Michal Karpinski964943a2018-01-19 16:28:26 +00005942 private static final Validator ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN_VALIDATOR =
5943 BOOLEAN_VALIDATOR;
5944
Phil Weaverce687c52017-03-15 08:51:52 -07005945 /**
Phil Weaver106fe732016-11-22 18:18:39 -08005946 * Setting specifying if the accessibility shortcut dialog has been shown to this user.
5947 * @hide
5948 */
5949 public static final String ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN =
5950 "accessibility_shortcut_dialog_shown";
5951
Michal Karpinski964943a2018-01-19 16:28:26 +00005952 private static final Validator ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN_VALIDATOR =
5953 BOOLEAN_VALIDATOR;
5954
Phil Weaver106fe732016-11-22 18:18:39 -08005955 /**
Phil Weaverce687c52017-03-15 08:51:52 -07005956 * Setting specifying the accessibility service to be toggled via the accessibility
Phil Weaver106fe732016-11-22 18:18:39 -08005957 * shortcut. Must be its flattened {@link ComponentName}.
5958 * @hide
5959 */
5960 public static final String ACCESSIBILITY_SHORTCUT_TARGET_SERVICE =
5961 "accessibility_shortcut_target_service";
5962
Michal Karpinski964943a2018-01-19 16:28:26 +00005963 private static final Validator ACCESSIBILITY_SHORTCUT_TARGET_SERVICE_VALIDATOR =
Annie Meng44511792018-05-17 18:49:24 +01005964 NULLABLE_COMPONENT_NAME_VALIDATOR;
Michal Karpinski964943a2018-01-19 16:28:26 +00005965
Phil Weaver106fe732016-11-22 18:18:39 -08005966 /**
Casey Burkhardt5e8b9802017-03-24 10:07:20 -07005967 * Setting specifying the accessibility service or feature to be toggled via the
5968 * accessibility button in the navigation bar. This is either a flattened
5969 * {@link ComponentName} or the class name of a system class implementing a supported
5970 * accessibility feature.
5971 * @hide
5972 */
5973 public static final String ACCESSIBILITY_BUTTON_TARGET_COMPONENT =
5974 "accessibility_button_target_component";
5975
Michal Karpinski964943a2018-01-19 16:28:26 +00005976 private static final Validator ACCESSIBILITY_BUTTON_TARGET_COMPONENT_VALIDATOR =
5977 new Validator() {
5978 @Override
Annie Mengeed1b812018-05-21 16:34:52 +01005979 public boolean validate(@Nullable String value) {
Michal Karpinski964943a2018-01-19 16:28:26 +00005980 // technically either ComponentName or class name, but there's proper value
5981 // validation at callsites, so allow any non-null string
5982 return value != null;
5983 }
5984 };
5985
Casey Burkhardt5e8b9802017-03-24 10:07:20 -07005986 /**
Svetoslav Ganov00aabf72011-07-21 11:35:03 -07005987 * If touch exploration is enabled.
Svetoslav Ganov35bfede2011-07-14 17:57:06 -07005988 */
Svetoslav Ganov00aabf72011-07-21 11:35:03 -07005989 public static final String TOUCH_EXPLORATION_ENABLED = "touch_exploration_enabled";
Svetoslav Ganov35bfede2011-07-14 17:57:06 -07005990
Michal Karpinski964943a2018-01-19 16:28:26 +00005991 private static final Validator TOUCH_EXPLORATION_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
5992
Svetoslav Ganov35bfede2011-07-14 17:57:06 -07005993 /**
svetoslavganov75986cf2009-05-14 22:28:01 -07005994 * List of the enabled accessibility providers.
5995 */
5996 public static final String ENABLED_ACCESSIBILITY_SERVICES =
5997 "enabled_accessibility_services";
5998
Michal Karpinski964943a2018-01-19 16:28:26 +00005999 private static final Validator ENABLED_ACCESSIBILITY_SERVICES_VALIDATOR =
6000 new SettingsValidators.ComponentNameListValidator(":");
6001
svetoslavganov75986cf2009-05-14 22:28:01 -07006002 /**
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07006003 * List of the accessibility services to which the user has granted
Svetoslav Ganov9a4c5cd2012-05-30 14:06:32 -07006004 * permission to put the device into touch exploration mode.
6005 *
6006 * @hide
6007 */
6008 public static final String TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES =
6009 "touch_exploration_granted_accessibility_services";
6010
Michal Karpinski964943a2018-01-19 16:28:26 +00006011 private static final Validator TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES_VALIDATOR =
6012 new SettingsValidators.ComponentNameListValidator(":");
6013
Svetoslav Ganov9a4c5cd2012-05-30 14:06:32 -07006014 /**
Beverly38fcfd02018-05-18 17:33:40 -04006015 * Whether the hush gesture has ever been used // TODO: beverlyt
6016 * @hide
6017 */
6018 public static final String HUSH_GESTURE_USED = "hush_gesture_used";
6019
6020 private static final Validator HUSH_GESTURE_USED_VALIDATOR = BOOLEAN_VALIDATOR;
6021
6022 /**
6023 * Number of times the user has manually clicked the ringer toggle
6024 * @hide
6025 */
6026 public static final String MANUAL_RINGER_TOGGLE_COUNT = "manual_ringer_toggle_count";
6027
6028 private static final Validator MANUAL_RINGER_TOGGLE_COUNT_VALIDATOR =
6029 NON_NEGATIVE_INTEGER_VALIDATOR;
6030
6031 /**
Lucas Dupin6bd86012017-12-05 17:58:57 -08006032 * Uri of the slice that's presented on the keyguard.
6033 * Defaults to a slice with the date and next alarm.
6034 *
6035 * @hide
6036 */
6037 public static final String KEYGUARD_SLICE_URI = "keyguard_slice_uri";
6038
6039 /**
Svetoslav Ganov55f937a2011-12-05 11:42:07 -08006040 * Whether to speak passwords while in accessibility mode.
Phil Weaver385912e2017-02-10 10:06:56 -08006041 *
6042 * @deprecated The speaking of passwords is controlled by individual accessibility services.
6043 * Apps should ignore this setting and provide complete information to accessibility
6044 * at all times, which was the behavior when this value was {@code true}.
Svetoslav Ganov55f937a2011-12-05 11:42:07 -08006045 */
Phil Weaver385912e2017-02-10 10:06:56 -08006046 @Deprecated
Svetoslav Ganov55f937a2011-12-05 11:42:07 -08006047 public static final String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password";
6048
6049 /**
Chris Craikcce47eb2014-07-16 15:12:15 -07006050 * Whether to draw text with high contrast while in accessibility mode.
6051 *
6052 * @hide
6053 */
6054 public static final String ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED =
6055 "high_text_contrast_enabled";
6056
Michal Karpinski964943a2018-01-19 16:28:26 +00006057 private static final Validator ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED_VALIDATOR =
6058 BOOLEAN_VALIDATOR;
6059
Chris Craikcce47eb2014-07-16 15:12:15 -07006060 /**
Casey Burkhardt74922c62017-02-13 12:43:16 -08006061 * Setting that specifies whether the display magnification is enabled via a system-wide
6062 * triple tap gesture. Display magnifications allows the user to zoom in the display content
6063 * and is targeted to low vision users. The current magnification scale is controlled by
6064 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}.
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07006065 *
6066 * @hide
6067 */
Eugene Suslaa55f74e2017-09-21 13:48:50 -07006068 @TestApi
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07006069 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED =
6070 "accessibility_display_magnification_enabled";
6071
Michal Karpinski964943a2018-01-19 16:28:26 +00006072 private static final Validator ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED_VALIDATOR =
6073 BOOLEAN_VALIDATOR;
6074
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07006075 /**
Casey Burkhardt74922c62017-02-13 12:43:16 -08006076 * Setting that specifies whether the display magnification is enabled via a shortcut
6077 * affordance within the system's navigation area. Display magnifications allows the user to
6078 * zoom in the display content and is targeted to low vision users. The current
6079 * magnification scale is controlled by {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}.
6080 *
6081 * @hide
6082 */
6083 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED =
6084 "accessibility_display_magnification_navbar_enabled";
6085
Michal Karpinski964943a2018-01-19 16:28:26 +00006086 private static final Validator ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED_VALIDATOR
6087 = BOOLEAN_VALIDATOR;
6088
Casey Burkhardt74922c62017-02-13 12:43:16 -08006089 /**
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07006090 * Setting that specifies what the display magnification scale is.
6091 * Display magnifications allows the user to zoom in the display
6092 * content and is targeted to low vision users. Whether a display
6093 * magnification is performed is controlled by
Casey Burkhardt74922c62017-02-13 12:43:16 -08006094 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED} and
6095 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED}
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07006096 *
6097 * @hide
6098 */
6099 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE =
6100 "accessibility_display_magnification_scale";
6101
Michal Karpinski964943a2018-01-19 16:28:26 +00006102 private static final Validator ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE_VALIDATOR =
6103 new SettingsValidators.InclusiveFloatRangeValidator(1.0f, Float.MAX_VALUE);
6104
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07006105 /**
Phil Weaver89e3ffc2016-09-19 13:51:10 -07006106 * Unused mangnification setting
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07006107 *
6108 * @hide
Phil Weaver89e3ffc2016-09-19 13:51:10 -07006109 * @deprecated
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07006110 */
Steve McKayea93fe72016-12-02 11:35:35 -08006111 @Deprecated
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07006112 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE =
6113 "accessibility_display_magnification_auto_update";
6114
6115 /**
Anna Galusza9b278112016-01-04 11:37:37 -08006116 * Setting that specifies what mode the soft keyboard is in (default or hidden). Can be
6117 * modified from an AccessibilityService using the SoftKeyboardController.
6118 *
6119 * @hide
6120 */
6121 public static final String ACCESSIBILITY_SOFT_KEYBOARD_MODE =
6122 "accessibility_soft_keyboard_mode";
6123
6124 /**
6125 * Default soft keyboard behavior.
6126 *
6127 * @hide
6128 */
6129 public static final int SHOW_MODE_AUTO = 0;
6130
6131 /**
6132 * Soft keyboard is never shown.
6133 *
6134 * @hide
6135 */
6136 public static final int SHOW_MODE_HIDDEN = 1;
6137
6138 /**
Alan Viveretteef793802013-07-23 14:15:28 -07006139 * Setting that specifies whether timed text (captions) should be
6140 * displayed in video content. Text display properties are controlled by
6141 * the following settings:
6142 * <ul>
6143 * <li>{@link #ACCESSIBILITY_CAPTIONING_LOCALE}
6144 * <li>{@link #ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR}
6145 * <li>{@link #ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR}
6146 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_COLOR}
6147 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_TYPE}
6148 * <li>{@link #ACCESSIBILITY_CAPTIONING_TYPEFACE}
Alan Viverette69ce69b2013-08-29 12:23:48 -07006149 * <li>{@link #ACCESSIBILITY_CAPTIONING_FONT_SCALE}
Alan Viveretteef793802013-07-23 14:15:28 -07006150 * </ul>
6151 *
6152 * @hide
6153 */
6154 public static final String ACCESSIBILITY_CAPTIONING_ENABLED =
6155 "accessibility_captioning_enabled";
6156
Michal Karpinski964943a2018-01-19 16:28:26 +00006157 private static final Validator ACCESSIBILITY_CAPTIONING_ENABLED_VALIDATOR =
6158 BOOLEAN_VALIDATOR;
6159
Alan Viveretteef793802013-07-23 14:15:28 -07006160 /**
6161 * Setting that specifies the language for captions as a locale string,
6162 * e.g. en_US.
6163 *
6164 * @see java.util.Locale#toString
6165 * @hide
6166 */
6167 public static final String ACCESSIBILITY_CAPTIONING_LOCALE =
6168 "accessibility_captioning_locale";
6169
Michal Karpinski964943a2018-01-19 16:28:26 +00006170 private static final Validator ACCESSIBILITY_CAPTIONING_LOCALE_VALIDATOR = LOCALE_VALIDATOR;
6171
Alan Viveretteef793802013-07-23 14:15:28 -07006172 /**
Alan Viverette43a1e3d2013-08-02 16:45:03 -07006173 * Integer property that specifies the preset style for captions, one
6174 * of:
6175 * <ul>
Alan Viverette69ce69b2013-08-29 12:23:48 -07006176 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESET_CUSTOM}
6177 * <li>a valid index of {@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESETS}
Alan Viverette43a1e3d2013-08-02 16:45:03 -07006178 * </ul>
6179 *
6180 * @see java.util.Locale#toString
6181 * @hide
6182 */
6183 public static final String ACCESSIBILITY_CAPTIONING_PRESET =
6184 "accessibility_captioning_preset";
6185
Michal Karpinski964943a2018-01-19 16:28:26 +00006186 private static final Validator ACCESSIBILITY_CAPTIONING_PRESET_VALIDATOR =
6187 new SettingsValidators.DiscreteValueValidator(new String[]{"-1", "0", "1", "2",
6188 "3", "4"});
6189
Alan Viverette43a1e3d2013-08-02 16:45:03 -07006190 /**
Alan Viveretteef793802013-07-23 14:15:28 -07006191 * Integer property that specifes the background color for captions as a
6192 * packed 32-bit color.
6193 *
6194 * @see android.graphics.Color#argb
6195 * @hide
6196 */
6197 public static final String ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR =
6198 "accessibility_captioning_background_color";
6199
Michal Karpinski964943a2018-01-19 16:28:26 +00006200 private static final Validator ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR_VALIDATOR =
6201 ANY_INTEGER_VALIDATOR;
6202
Alan Viveretteef793802013-07-23 14:15:28 -07006203 /**
6204 * Integer property that specifes the foreground color for captions as a
6205 * packed 32-bit color.
6206 *
6207 * @see android.graphics.Color#argb
6208 * @hide
6209 */
6210 public static final String ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR =
6211 "accessibility_captioning_foreground_color";
6212
Michal Karpinski964943a2018-01-19 16:28:26 +00006213 private static final Validator ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR_VALIDATOR =
6214 ANY_INTEGER_VALIDATOR;
6215
Alan Viveretteef793802013-07-23 14:15:28 -07006216 /**
6217 * Integer property that specifes the edge type for captions, one of:
6218 * <ul>
Alan Viverette69ce69b2013-08-29 12:23:48 -07006219 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_NONE}
6220 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_OUTLINE}
6221 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_DROP_SHADOW}
Alan Viveretteef793802013-07-23 14:15:28 -07006222 * </ul>
6223 *
6224 * @see #ACCESSIBILITY_CAPTIONING_EDGE_COLOR
6225 * @hide
6226 */
6227 public static final String ACCESSIBILITY_CAPTIONING_EDGE_TYPE =
6228 "accessibility_captioning_edge_type";
6229
Michal Karpinski964943a2018-01-19 16:28:26 +00006230 private static final Validator ACCESSIBILITY_CAPTIONING_EDGE_TYPE_VALIDATOR =
6231 new SettingsValidators.DiscreteValueValidator(new String[]{"0", "1", "2"});
6232
Alan Viveretteef793802013-07-23 14:15:28 -07006233 /**
6234 * Integer property that specifes the edge color for captions as a
6235 * packed 32-bit color.
6236 *
6237 * @see #ACCESSIBILITY_CAPTIONING_EDGE_TYPE
6238 * @see android.graphics.Color#argb
6239 * @hide
6240 */
6241 public static final String ACCESSIBILITY_CAPTIONING_EDGE_COLOR =
6242 "accessibility_captioning_edge_color";
6243
Michal Karpinski964943a2018-01-19 16:28:26 +00006244 private static final Validator ACCESSIBILITY_CAPTIONING_EDGE_COLOR_VALIDATOR =
6245 ANY_INTEGER_VALIDATOR;
6246
Alan Viveretteef793802013-07-23 14:15:28 -07006247 /**
Alan Viverette55d70622013-12-11 15:22:14 -08006248 * Integer property that specifes the window color for captions as a
6249 * packed 32-bit color.
6250 *
6251 * @see android.graphics.Color#argb
6252 * @hide
6253 */
6254 public static final String ACCESSIBILITY_CAPTIONING_WINDOW_COLOR =
6255 "accessibility_captioning_window_color";
6256
Michal Karpinski964943a2018-01-19 16:28:26 +00006257 private static final Validator ACCESSIBILITY_CAPTIONING_WINDOW_COLOR_VALIDATOR =
6258 ANY_INTEGER_VALIDATOR;
6259
Alan Viverette55d70622013-12-11 15:22:14 -08006260 /**
Alan Viveretteef793802013-07-23 14:15:28 -07006261 * String property that specifies the typeface for captions, one of:
6262 * <ul>
6263 * <li>DEFAULT
6264 * <li>MONOSPACE
6265 * <li>SANS_SERIF
6266 * <li>SERIF
6267 * </ul>
6268 *
6269 * @see android.graphics.Typeface
6270 * @hide
6271 */
6272 public static final String ACCESSIBILITY_CAPTIONING_TYPEFACE =
6273 "accessibility_captioning_typeface";
6274
Michal Karpinski964943a2018-01-19 16:28:26 +00006275 private static final Validator ACCESSIBILITY_CAPTIONING_TYPEFACE_VALIDATOR =
6276 new SettingsValidators.DiscreteValueValidator(new String[]{"DEFAULT",
6277 "MONOSPACE", "SANS_SERIF", "SERIF"});
6278
Alan Viveretteef793802013-07-23 14:15:28 -07006279 /**
Alan Viverette69ce69b2013-08-29 12:23:48 -07006280 * Floating point property that specifies font scaling for captions.
Alan Viveretteef793802013-07-23 14:15:28 -07006281 *
6282 * @hide
6283 */
Alan Viverette69ce69b2013-08-29 12:23:48 -07006284 public static final String ACCESSIBILITY_CAPTIONING_FONT_SCALE =
6285 "accessibility_captioning_font_scale";
Alan Viveretteef793802013-07-23 14:15:28 -07006286
Michal Karpinski964943a2018-01-19 16:28:26 +00006287 private static final Validator ACCESSIBILITY_CAPTIONING_FONT_SCALE_VALIDATOR =
6288 new SettingsValidators.InclusiveFloatRangeValidator(0.5f, 2.0f);
6289
Alan Viveretteef793802013-07-23 14:15:28 -07006290 /**
Alan Viverette410d4e32013-09-30 15:37:38 -07006291 * Setting that specifies whether display color inversion is enabled.
Alan Viverette410d4e32013-09-30 15:37:38 -07006292 */
6293 public static final String ACCESSIBILITY_DISPLAY_INVERSION_ENABLED =
6294 "accessibility_display_inversion_enabled";
6295
Michal Karpinski964943a2018-01-19 16:28:26 +00006296 private static final Validator ACCESSIBILITY_DISPLAY_INVERSION_ENABLED_VALIDATOR =
6297 BOOLEAN_VALIDATOR;
6298
Alan Viverette410d4e32013-09-30 15:37:38 -07006299 /**
Alan Viverette410d4e32013-09-30 15:37:38 -07006300 * Setting that specifies whether display color space adjustment is
6301 * enabled.
6302 *
6303 * @hide
6304 */
6305 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED =
6306 "accessibility_display_daltonizer_enabled";
6307
Michal Karpinski964943a2018-01-19 16:28:26 +00006308 private static final Validator ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED_VALIDATOR =
6309 BOOLEAN_VALIDATOR;
6310
Alan Viverette410d4e32013-09-30 15:37:38 -07006311 /**
6312 * Integer property that specifies the type of color space adjustment to
Phil Weaver7b8c8e22018-03-09 09:58:09 -08006313 * perform. Valid values are defined in AccessibilityManager and Settings arrays.xml:
Michal Karpinski964943a2018-01-19 16:28:26 +00006314 * - AccessibilityManager.DALTONIZER_DISABLED = -1
6315 * - AccessibilityManager.DALTONIZER_SIMULATE_MONOCHROMACY = 0
Phil Weaver7b8c8e22018-03-09 09:58:09 -08006316 * - <item>@string/daltonizer_mode_protanomaly</item> = 11
6317 * - AccessibilityManager.DALTONIZER_CORRECT_DEUTERANOMALY and
6318 * <item>@string/daltonizer_mode_deuteranomaly</item> = 12
6319 * - <item>@string/daltonizer_mode_tritanomaly</item> = 13
Alan Viverette410d4e32013-09-30 15:37:38 -07006320 *
6321 * @hide
6322 */
6323 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER =
6324 "accessibility_display_daltonizer";
6325
Michal Karpinski964943a2018-01-19 16:28:26 +00006326 private static final Validator ACCESSIBILITY_DISPLAY_DALTONIZER_VALIDATOR =
Phil Weaver7b8c8e22018-03-09 09:58:09 -08006327 new SettingsValidators.DiscreteValueValidator(
6328 new String[] {"-1", "0", "11", "12", "13"});
Michal Karpinski964943a2018-01-19 16:28:26 +00006329
Alan Viverette410d4e32013-09-30 15:37:38 -07006330 /**
Toni Barzic386f8342015-09-09 12:30:41 -07006331 * Setting that specifies whether automatic click when the mouse pointer stops moving is
6332 * enabled.
6333 *
6334 * @hide
6335 */
6336 public static final String ACCESSIBILITY_AUTOCLICK_ENABLED =
6337 "accessibility_autoclick_enabled";
6338
Michal Karpinski964943a2018-01-19 16:28:26 +00006339 private static final Validator ACCESSIBILITY_AUTOCLICK_ENABLED_VALIDATOR =
6340 BOOLEAN_VALIDATOR;
6341
Toni Barzic386f8342015-09-09 12:30:41 -07006342 /**
6343 * Integer setting specifying amount of time in ms the mouse pointer has to stay still
6344 * before performing click when {@link #ACCESSIBILITY_AUTOCLICK_ENABLED} is set.
6345 *
6346 * @see #ACCESSIBILITY_AUTOCLICK_ENABLED
6347 * @hide
6348 */
6349 public static final String ACCESSIBILITY_AUTOCLICK_DELAY =
6350 "accessibility_autoclick_delay";
6351
Michal Karpinski964943a2018-01-19 16:28:26 +00006352 private static final Validator ACCESSIBILITY_AUTOCLICK_DELAY_VALIDATOR =
6353 NON_NEGATIVE_INTEGER_VALIDATOR;
6354
Toni Barzic386f8342015-09-09 12:30:41 -07006355 /**
Jun Mukai19a56012015-11-24 11:25:52 -08006356 * Whether or not larger size icons are used for the pointer of mouse/trackpad for
6357 * accessibility.
6358 * (0 = false, 1 = true)
6359 * @hide
6360 */
6361 public static final String ACCESSIBILITY_LARGE_POINTER_ICON =
6362 "accessibility_large_pointer_icon";
6363
Michal Karpinski964943a2018-01-19 16:28:26 +00006364 private static final Validator ACCESSIBILITY_LARGE_POINTER_ICON_VALIDATOR =
6365 BOOLEAN_VALIDATOR;
6366
Jun Mukai19a56012015-11-24 11:25:52 -08006367 /**
Toni Barzic386f8342015-09-09 12:30:41 -07006368 * The timeout for considering a press to be a long press in milliseconds.
Svetoslav Ganov54d068e2011-03-02 12:58:40 -08006369 * @hide
6370 */
6371 public static final String LONG_PRESS_TIMEOUT = "long_press_timeout";
6372
Michal Karpinski964943a2018-01-19 16:28:26 +00006373 private static final Validator LONG_PRESS_TIMEOUT_VALIDATOR =
6374 NON_NEGATIVE_INTEGER_VALIDATOR;
6375
Svetoslav Ganov54d068e2011-03-02 12:58:40 -08006376 /**
Anthony Hugh96e9cc52016-07-12 15:17:24 -07006377 * The duration in milliseconds between the first tap's up event and the second tap's
6378 * down event for an interaction to be considered part of the same multi-press.
6379 * @hide
6380 */
6381 public static final String MULTI_PRESS_TIMEOUT = "multi_press_timeout";
6382
6383 /**
Svetoslav Ganov6bd20bc2013-09-02 15:24:45 -07006384 * List of the enabled print services.
Philip P. Moltmann8141bdf2015-12-21 17:03:05 -08006385 *
6386 * N and beyond uses {@link #DISABLED_PRINT_SERVICES}. But this might be used in an upgrade
6387 * from pre-N.
6388 *
Svetoslav Ganov4b9a4d12013-06-11 15:20:06 -07006389 * @hide
6390 */
6391 public static final String ENABLED_PRINT_SERVICES =
6392 "enabled_print_services";
6393
6394 /**
Philip P. Moltmann8141bdf2015-12-21 17:03:05 -08006395 * List of the disabled print services.
6396 *
Svetoslav Ganov6bd20bc2013-09-02 15:24:45 -07006397 * @hide
6398 */
Svetoslav Ganov2dcedc122017-06-07 18:50:02 -07006399 @TestApi
Philip P. Moltmann8141bdf2015-12-21 17:03:05 -08006400 public static final String DISABLED_PRINT_SERVICES =
6401 "disabled_print_services";
Svetoslav Ganov6bd20bc2013-09-02 15:24:45 -07006402
6403 /**
Alan Viverette5e8d8372016-02-03 15:38:59 -05006404 * The saved value for WindowManagerService.setForcedDisplayDensity()
6405 * formatted as a single integer representing DPI. If unset, then use
6406 * the real display density.
6407 *
6408 * @hide
6409 */
6410 public static final String DISPLAY_DENSITY_FORCED = "display_density_forced";
6411
6412 /**
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07006413 * Setting to always use the default text-to-speech settings regardless
6414 * of the application settings.
6415 * 1 = override application settings,
6416 * 0 = use application settings (if specified).
Narayan Kamath6d632962011-08-24 11:51:37 +01006417 *
6418 * @deprecated The value of this setting is no longer respected by
6419 * the framework text to speech APIs as of the Ice Cream Sandwich release.
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07006420 */
Narayan Kamath6d632962011-08-24 11:51:37 +01006421 @Deprecated
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07006422 public static final String TTS_USE_DEFAULTS = "tts_use_defaults";
6423
6424 /**
6425 * Default text-to-speech engine speech rate. 100 = 1x
6426 */
6427 public static final String TTS_DEFAULT_RATE = "tts_default_rate";
6428
Michal Karpinski964943a2018-01-19 16:28:26 +00006429 private static final Validator TTS_DEFAULT_RATE_VALIDATOR = NON_NEGATIVE_INTEGER_VALIDATOR;
6430
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07006431 /**
6432 * Default text-to-speech engine pitch. 100 = 1x
6433 */
6434 public static final String TTS_DEFAULT_PITCH = "tts_default_pitch";
6435
Michal Karpinski964943a2018-01-19 16:28:26 +00006436 private static final Validator TTS_DEFAULT_PITCH_VALIDATOR = NON_NEGATIVE_INTEGER_VALIDATOR;
6437
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07006438 /**
6439 * Default text-to-speech engine.
6440 */
6441 public static final String TTS_DEFAULT_SYNTH = "tts_default_synth";
6442
Michal Karpinski964943a2018-01-19 16:28:26 +00006443 private static final Validator TTS_DEFAULT_SYNTH_VALIDATOR = PACKAGE_NAME_VALIDATOR;
6444
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07006445 /**
Jean-Michel Trivif4782672009-06-09 16:22:48 -07006446 * Default text-to-speech language.
Narayan Kamath6d632962011-08-24 11:51:37 +01006447 *
6448 * @deprecated this setting is no longer in use, as of the Ice Cream
6449 * Sandwich release. Apps should never need to read this setting directly,
6450 * instead can query the TextToSpeech framework classes for the default
6451 * locale. {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivif4782672009-06-09 16:22:48 -07006452 */
Narayan Kamath6d632962011-08-24 11:51:37 +01006453 @Deprecated
Jean-Michel Trivif4782672009-06-09 16:22:48 -07006454 public static final String TTS_DEFAULT_LANG = "tts_default_lang";
6455
6456 /**
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07006457 * Default text-to-speech country.
Narayan Kamath6d632962011-08-24 11:51:37 +01006458 *
6459 * @deprecated this setting is no longer in use, as of the Ice Cream
6460 * Sandwich release. Apps should never need to read this setting directly,
6461 * instead can query the TextToSpeech framework classes for the default
6462 * locale. {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07006463 */
Narayan Kamath6d632962011-08-24 11:51:37 +01006464 @Deprecated
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07006465 public static final String TTS_DEFAULT_COUNTRY = "tts_default_country";
6466
6467 /**
6468 * Default text-to-speech locale variant.
Narayan Kamath6d632962011-08-24 11:51:37 +01006469 *
6470 * @deprecated this setting is no longer in use, as of the Ice Cream
6471 * Sandwich release. Apps should never need to read this setting directly,
6472 * instead can query the TextToSpeech framework classes for the
6473 * locale that is in use {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07006474 */
Narayan Kamath6d632962011-08-24 11:51:37 +01006475 @Deprecated
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07006476 public static final String TTS_DEFAULT_VARIANT = "tts_default_variant";
6477
6478 /**
Narayan Kamathe5b8c4d2011-08-22 15:37:47 +01006479 * Stores the default tts locales on a per engine basis. Stored as
6480 * a comma seperated list of values, each value being of the form
6481 * {@code engine_name:locale} for example,
Narayan Kamath6d632962011-08-24 11:51:37 +01006482 * {@code com.foo.ttsengine:eng-USA,com.bar.ttsengine:esp-ESP}. This
6483 * supersedes {@link #TTS_DEFAULT_LANG}, {@link #TTS_DEFAULT_COUNTRY} and
6484 * {@link #TTS_DEFAULT_VARIANT}. Apps should never need to read this
6485 * setting directly, and can query the TextToSpeech framework classes
6486 * for the locale that is in use.
Narayan Kamathe5b8c4d2011-08-22 15:37:47 +01006487 *
6488 * @hide
6489 */
6490 public static final String TTS_DEFAULT_LOCALE = "tts_default_locale";
6491
Michal Karpinski964943a2018-01-19 16:28:26 +00006492 private static final Validator TTS_DEFAULT_LOCALE_VALIDATOR = new Validator() {
6493 @Override
Annie Mengeed1b812018-05-21 16:34:52 +01006494 public boolean validate(@Nullable String value) {
Michal Karpinski964943a2018-01-19 16:28:26 +00006495 if (value == null || value.length() == 0) {
6496 return false;
6497 }
6498 String[] ttsLocales = value.split(",");
6499 boolean valid = true;
6500 for (String ttsLocale : ttsLocales) {
6501 String[] parts = ttsLocale.split(":");
6502 valid |= ((parts.length == 2)
6503 && (parts[0].length() > 0)
6504 && ANY_STRING_VALIDATOR.validate(parts[0])
6505 && LOCALE_VALIDATOR.validate(parts[1]));
6506 }
6507 return valid;
6508 }
6509 };
6510
Narayan Kamathe5b8c4d2011-08-22 15:37:47 +01006511 /**
Charles Chenceffa152010-03-16 21:18:10 -07006512 * Space delimited list of plugin packages that are enabled.
6513 */
6514 public static final String TTS_ENABLED_PLUGINS = "tts_enabled_plugins";
6515
Michal Karpinski964943a2018-01-19 16:28:26 +00006516 private static final Validator TTS_ENABLED_PLUGINS_VALIDATOR =
6517 new SettingsValidators.PackageNameListValidator(" ");
6518
Charles Chenceffa152010-03-16 21:18:10 -07006519 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07006520 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON}
6521 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006522 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07006523 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006524 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
Christopher Tate6f5a9a92012-09-14 17:24:28 -07006525 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006526
Michal Karpinski964943a2018-01-19 16:28:26 +00006527 private static final Validator WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR =
6528 BOOLEAN_VALIDATOR;
Michal Karpinski5db1e432018-01-18 20:10:24 +00006529
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006530 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07006531 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY}
6532 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006533 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07006534 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006535 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
Christopher Tate6f5a9a92012-09-14 17:24:28 -07006536 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006537
Michal Karpinski964943a2018-01-19 16:28:26 +00006538 private static final Validator WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_VALIDATOR =
6539 NON_NEGATIVE_INTEGER_VALIDATOR;
6540
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006541 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07006542 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
6543 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006544 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07006545 @Deprecated
6546 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT =
6547 Global.WIFI_NUM_OPEN_NETWORKS_KEPT;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006548
Michal Karpinski964943a2018-01-19 16:28:26 +00006549 private static final Validator WIFI_NUM_OPEN_NETWORKS_KEPT_VALIDATOR =
6550 NON_NEGATIVE_INTEGER_VALIDATOR;
6551
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006552 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07006553 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON}
6554 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006555 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07006556 @Deprecated
6557 public static final String WIFI_ON = Global.WIFI_ON;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006558
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006559 /**
6560 * The acceptable packet loss percentage (range 0 - 100) before trying
6561 * another AP on the same network.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006562 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006563 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07006564 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006565 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
6566 "wifi_watchdog_acceptable_packet_loss_percentage";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006567
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006568 /**
6569 * The number of access points required for a network in order for the
6570 * watchdog to monitor it.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006571 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006572 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07006573 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006574 public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006575
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006576 /**
6577 * The delay between background checks.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006578 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006579 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07006580 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006581 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
6582 "wifi_watchdog_background_check_delay_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006583
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006584 /**
6585 * Whether the Wi-Fi watchdog is enabled for background checking even
6586 * after it thinks the user has connected to a good access point.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006587 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006588 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07006589 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006590 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
6591 "wifi_watchdog_background_check_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006592
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006593 /**
6594 * The timeout for a background ping
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006595 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006596 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07006597 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006598 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
6599 "wifi_watchdog_background_check_timeout_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006600
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006601 /**
6602 * The number of initial pings to perform that *may* be ignored if they
6603 * fail. Again, if these fail, they will *not* be used in packet loss
6604 * calculation. For example, one network always seemed to time out for
6605 * the first couple pings, so this is set to 3 by default.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006606 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006607 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07006608 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006609 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
6610 "wifi_watchdog_initial_ignored_ping_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006611
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006612 /**
6613 * The maximum number of access points (per network) to attempt to test.
6614 * If this number is reached, the watchdog will no longer monitor the
6615 * initial connection state for the network. This is a safeguard for
6616 * networks containing multiple APs whose DNS does not respond to pings.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006617 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006618 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07006619 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006620 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = "wifi_watchdog_max_ap_checks";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006621
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006622 /**
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07006623 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006624 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07006625 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006626 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
6627
6628 /**
6629 * A comma-separated list of SSIDs for which the Wi-Fi watchdog should be enabled.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006630 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006631 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07006632 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006633 public static final String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list";
6634
6635 /**
6636 * The number of pings to test if an access point is a good connection.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006637 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006638 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07006639 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006640 public static final String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006641
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006642 /**
6643 * The delay between pings.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006644 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006645 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07006646 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006647 public static final String WIFI_WATCHDOG_PING_DELAY_MS = "wifi_watchdog_ping_delay_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006648
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006649 /**
6650 * The timeout per ping.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006651 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006652 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07006653 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006654 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006655
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006656 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006657 * @deprecated Use
6658 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006659 */
Christopher Tate06efb532012-08-24 15:29:27 -07006660 @Deprecated
6661 public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006662
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006663 /**
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006664 * @deprecated Use
6665 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006666 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07006667 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006668 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006669 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006670
6671 /**
Jeremy Joslin79294842014-12-03 17:15:28 -08006672 * The number of milliseconds to hold on to a PendingIntent based request. This delay gives
6673 * the receivers of the PendingIntent an opportunity to make a new network request before
6674 * the Network satisfying the request is potentially removed.
6675 *
6676 * @hide
6677 */
6678 public static final String CONNECTIVITY_RELEASE_PENDING_INTENT_DELAY_MS =
6679 "connectivity_release_pending_intent_delay_ms";
6680
6681 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07006682 * Whether background data usage is allowed.
6683 *
6684 * @deprecated As of {@link VERSION_CODES#ICE_CREAM_SANDWICH},
6685 * availability of background data depends on several
6686 * combined factors. When background data is unavailable,
6687 * {@link ConnectivityManager#getActiveNetworkInfo()} will
6688 * now appear disconnected.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006689 */
Jeff Sharkey3a844fc2011-08-16 14:37:57 -07006690 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006691 public static final String BACKGROUND_DATA = "background_data";
Wink Saville04e71b32009-04-02 11:00:54 -07006692
6693 /**
Bjorn Bringert98bfa392010-03-24 10:59:48 +00006694 * Origins for which browsers should allow geolocation by default.
6695 * The value is a space-separated list of origins.
6696 */
6697 public static final String ALLOWED_GEOLOCATION_ORIGINS
6698 = "allowed_geolocation_origins";
6699
6700 /**
Wink Savillee9b06d72009-05-18 21:47:50 -07006701 * The preferred TTY mode 0 = TTy Off, CDMA default
6702 * 1 = TTY Full
6703 * 2 = TTY HCO
6704 * 3 = TTY VCO
6705 * @hide
6706 */
6707 public static final String PREFERRED_TTY_MODE =
6708 "preferred_tty_mode";
6709
Michal Karpinski964943a2018-01-19 16:28:26 +00006710 private static final Validator PREFERRED_TTY_MODE_VALIDATOR =
6711 new SettingsValidators.DiscreteValueValidator(new String[]{"0", "1", "2", "3"});
6712
Wink Saville04e71b32009-04-02 11:00:54 -07006713 /**
Wink Saville04e71b32009-04-02 11:00:54 -07006714 * Whether the enhanced voice privacy mode is enabled.
6715 * 0 = normal voice privacy
6716 * 1 = enhanced voice privacy
6717 * @hide
6718 */
6719 public static final String ENHANCED_VOICE_PRIVACY_ENABLED = "enhanced_voice_privacy_enabled";
6720
Michal Karpinski964943a2018-01-19 16:28:26 +00006721 private static final Validator ENHANCED_VOICE_PRIVACY_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
6722
Wink Saville04e71b32009-04-02 11:00:54 -07006723 /**
6724 * Whether the TTY mode mode is enabled.
6725 * 0 = disabled
6726 * 1 = enabled
6727 * @hide
6728 */
6729 public static final String TTY_MODE_ENABLED = "tty_mode_enabled";
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07006730
Michal Karpinski964943a2018-01-19 16:28:26 +00006731 private static final Validator TTY_MODE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
6732
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07006733 /**
Hall Liu44e41012018-04-02 15:41:07 -07006734 * User-selected RTT mode. When on, outgoing and incoming calls will be answered as RTT
6735 * calls when supported by the device and carrier. Boolean value.
6736 * 0 = OFF
6737 * 1 = ON
6738 */
6739 public static final String RTT_CALLING_MODE = "rtt_calling_mode";
6740
6741 private static final Validator RTT_CALLING_MODE_VALIDATOR = BOOLEAN_VALIDATOR;
6742
6743 /**
6744 /**
Christopher Tate8031a3d2009-07-06 16:36:05 -07006745 * Controls whether settings backup is enabled.
Dianne Hackborncf098292009-07-01 19:55:20 -07006746 * Type: int ( 0 = disabled, 1 = enabled )
6747 * @hide
6748 */
6749 public static final String BACKUP_ENABLED = "backup_enabled";
6750
6751 /**
Christopher Tatecce9da52010-02-03 15:11:15 -08006752 * Controls whether application data is automatically restored from backup
6753 * at install time.
6754 * Type: int ( 0 = disabled, 1 = enabled )
6755 * @hide
6756 */
6757 public static final String BACKUP_AUTO_RESTORE = "backup_auto_restore";
6758
6759 /**
Christopher Tate8031a3d2009-07-06 16:36:05 -07006760 * Indicates whether settings backup has been fully provisioned.
6761 * Type: int ( 0 = unprovisioned, 1 = fully provisioned )
6762 * @hide
6763 */
6764 public static final String BACKUP_PROVISIONED = "backup_provisioned";
6765
6766 /**
Dianne Hackborncf098292009-07-01 19:55:20 -07006767 * Component of the transport to use for backup/restore.
6768 * @hide
6769 */
6770 public static final String BACKUP_TRANSPORT = "backup_transport";
Sanjay Jeyakumar21bf2412009-07-09 13:31:48 -07006771
Dianne Hackbornd7cd29d2009-07-01 11:22:45 -07006772 /**
6773 * Version for which the setup wizard was last shown. Bumped for
6774 * each release when there is new setup information to show.
6775 * @hide
6776 */
6777 public static final String LAST_SETUP_SHOWN = "last_setup_shown";
Dianne Hackborncf098292009-07-01 19:55:20 -07006778
6779 /**
Doug Zongker43866e02010-01-07 12:09:54 -08006780 * The interval in milliseconds after which Wi-Fi is considered idle.
6781 * When idle, it is possible for the device to be switched from Wi-Fi to
6782 * the mobile data network.
6783 * @hide
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006784 * @deprecated Use {@link android.provider.Settings.Global#WIFI_IDLE_MS}
6785 * instead.
Doug Zongker43866e02010-01-07 12:09:54 -08006786 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07006787 @Deprecated
6788 public static final String WIFI_IDLE_MS = Global.WIFI_IDLE_MS;
Doug Zongker43866e02010-01-07 12:09:54 -08006789
6790 /**
Narayan Kamathee69ff42011-06-28 12:07:18 +01006791 * The global search provider chosen by the user (if multiple global
6792 * search providers are installed). This will be the provider returned
6793 * by {@link SearchManager#getGlobalSearchActivity()} if it's still
6794 * installed. This setting is stored as a flattened component name as
6795 * per {@link ComponentName#flattenToString()}.
6796 *
6797 * @hide
6798 */
6799 public static final String SEARCH_GLOBAL_SEARCH_ACTIVITY =
6800 "search_global_search_activity";
6801
6802 /**
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08006803 * The number of promoted sources in GlobalSearch.
6804 * @hide
6805 */
6806 public static final String SEARCH_NUM_PROMOTED_SOURCES = "search_num_promoted_sources";
6807 /**
6808 * The maximum number of suggestions returned by GlobalSearch.
6809 * @hide
6810 */
6811 public static final String SEARCH_MAX_RESULTS_TO_DISPLAY = "search_max_results_to_display";
6812 /**
6813 * The number of suggestions GlobalSearch will ask each non-web search source for.
6814 * @hide
6815 */
6816 public static final String SEARCH_MAX_RESULTS_PER_SOURCE = "search_max_results_per_source";
6817 /**
6818 * The number of suggestions the GlobalSearch will ask the web search source for.
6819 * @hide
6820 */
6821 public static final String SEARCH_WEB_RESULTS_OVERRIDE_LIMIT =
6822 "search_web_results_override_limit";
6823 /**
6824 * The number of milliseconds that GlobalSearch will wait for suggestions from
6825 * promoted sources before continuing with all other sources.
6826 * @hide
6827 */
6828 public static final String SEARCH_PROMOTED_SOURCE_DEADLINE_MILLIS =
6829 "search_promoted_source_deadline_millis";
6830 /**
6831 * The number of milliseconds before GlobalSearch aborts search suggesiton queries.
6832 * @hide
6833 */
6834 public static final String SEARCH_SOURCE_TIMEOUT_MILLIS = "search_source_timeout_millis";
6835 /**
6836 * The maximum number of milliseconds that GlobalSearch shows the previous results
6837 * after receiving a new query.
6838 * @hide
6839 */
6840 public static final String SEARCH_PREFILL_MILLIS = "search_prefill_millis";
6841 /**
6842 * The maximum age of log data used for shortcuts in GlobalSearch.
6843 * @hide
6844 */
6845 public static final String SEARCH_MAX_STAT_AGE_MILLIS = "search_max_stat_age_millis";
6846 /**
6847 * The maximum age of log data used for source ranking in GlobalSearch.
6848 * @hide
6849 */
6850 public static final String SEARCH_MAX_SOURCE_EVENT_AGE_MILLIS =
6851 "search_max_source_event_age_millis";
6852 /**
6853 * The minimum number of impressions needed to rank a source in GlobalSearch.
6854 * @hide
6855 */
6856 public static final String SEARCH_MIN_IMPRESSIONS_FOR_SOURCE_RANKING =
6857 "search_min_impressions_for_source_ranking";
6858 /**
6859 * The minimum number of clicks needed to rank a source in GlobalSearch.
6860 * @hide
6861 */
6862 public static final String SEARCH_MIN_CLICKS_FOR_SOURCE_RANKING =
6863 "search_min_clicks_for_source_ranking";
6864 /**
6865 * The maximum number of shortcuts shown by GlobalSearch.
6866 * @hide
6867 */
6868 public static final String SEARCH_MAX_SHORTCUTS_RETURNED = "search_max_shortcuts_returned";
6869 /**
6870 * The size of the core thread pool for suggestion queries in GlobalSearch.
6871 * @hide
6872 */
6873 public static final String SEARCH_QUERY_THREAD_CORE_POOL_SIZE =
6874 "search_query_thread_core_pool_size";
6875 /**
6876 * The maximum size of the thread pool for suggestion queries in GlobalSearch.
6877 * @hide
6878 */
6879 public static final String SEARCH_QUERY_THREAD_MAX_POOL_SIZE =
6880 "search_query_thread_max_pool_size";
6881 /**
6882 * The size of the core thread pool for shortcut refreshing in GlobalSearch.
6883 * @hide
6884 */
6885 public static final String SEARCH_SHORTCUT_REFRESH_CORE_POOL_SIZE =
6886 "search_shortcut_refresh_core_pool_size";
6887 /**
6888 * The maximum size of the thread pool for shortcut refreshing in GlobalSearch.
6889 * @hide
6890 */
6891 public static final String SEARCH_SHORTCUT_REFRESH_MAX_POOL_SIZE =
6892 "search_shortcut_refresh_max_pool_size";
6893 /**
6894 * The maximun time that excess threads in the GlobalSeach thread pools will
6895 * wait before terminating.
6896 * @hide
6897 */
6898 public static final String SEARCH_THREAD_KEEPALIVE_SECONDS =
6899 "search_thread_keepalive_seconds";
6900 /**
6901 * The maximum number of concurrent suggestion queries to each source.
6902 * @hide
6903 */
6904 public static final String SEARCH_PER_SOURCE_CONCURRENT_QUERY_LIMIT =
6905 "search_per_source_concurrent_query_limit";
6906
San Mehat87734d32010-01-08 12:53:06 -08006907 /**
Sudheer Shanka2250d562016-11-07 15:41:02 -08006908 * Whether or not alert sounds are played on StorageManagerService events.
6909 * (0 = false, 1 = true)
San Mehat87734d32010-01-08 12:53:06 -08006910 * @hide
6911 */
6912 public static final String MOUNT_PLAY_NOTIFICATION_SND = "mount_play_not_snd";
6913
Michal Karpinski964943a2018-01-19 16:28:26 +00006914 private static final Validator MOUNT_PLAY_NOTIFICATION_SND_VALIDATOR = BOOLEAN_VALIDATOR;
6915
San Mehat87734d32010-01-08 12:53:06 -08006916 /**
6917 * Whether or not UMS auto-starts on UMS host detection. (0 = false, 1 = true)
6918 * @hide
6919 */
6920 public static final String MOUNT_UMS_AUTOSTART = "mount_ums_autostart";
6921
Michal Karpinski964943a2018-01-19 16:28:26 +00006922 private static final Validator MOUNT_UMS_AUTOSTART_VALIDATOR = BOOLEAN_VALIDATOR;
6923
San Mehat87734d32010-01-08 12:53:06 -08006924 /**
6925 * Whether or not a notification is displayed on UMS host detection. (0 = false, 1 = true)
6926 * @hide
6927 */
6928 public static final String MOUNT_UMS_PROMPT = "mount_ums_prompt";
6929
Michal Karpinski964943a2018-01-19 16:28:26 +00006930 private static final Validator MOUNT_UMS_PROMPT_VALIDATOR = BOOLEAN_VALIDATOR;
6931
San Mehat87734d32010-01-08 12:53:06 -08006932 /**
6933 * Whether or not a notification is displayed while UMS is enabled. (0 = false, 1 = true)
6934 * @hide
6935 */
6936 public static final String MOUNT_UMS_NOTIFY_ENABLED = "mount_ums_notify_enabled";
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08006937
Michal Karpinski964943a2018-01-19 16:28:26 +00006938 private static final Validator MOUNT_UMS_NOTIFY_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
6939
Dan Egnor42471dd2010-01-07 17:25:22 -08006940 /**
6941 * If nonzero, ANRs in invisible background processes bring up a dialog.
6942 * Otherwise, the process will be silently killed.
Adrian Roos6a7e0892016-08-23 14:26:39 +02006943 *
6944 * Also prevents ANRs and crash dialogs from being suppressed.
Dan Egnor42471dd2010-01-07 17:25:22 -08006945 * @hide
6946 */
6947 public static final String ANR_SHOW_BACKGROUND = "anr_show_background";
Erikeebc8e22010-02-18 13:27:19 -08006948
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08006949 /**
Andrew Sapperstein43643ae2017-12-20 15:17:33 -08006950 * If nonzero, crashes in foreground processes will bring up a dialog.
6951 * Otherwise, the process will be silently killed.
6952 * @hide
6953 */
6954 public static final String SHOW_FIRST_CRASH_DIALOG_DEV_OPTION =
6955 "show_first_crash_dialog_dev_option";
6956
Michal Karpinski964943a2018-01-19 16:28:26 +00006957 private static final Validator SHOW_FIRST_CRASH_DIALOG_DEV_OPTION_VALIDATOR =
6958 BOOLEAN_VALIDATOR;
6959
Andrew Sapperstein43643ae2017-12-20 15:17:33 -08006960 /**
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08006961 * The {@link ComponentName} string of the service to be used as the voice recognition
6962 * service.
Erikeebc8e22010-02-18 13:27:19 -08006963 *
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08006964 * @hide
6965 */
6966 public static final String VOICE_RECOGNITION_SERVICE = "voice_recognition_service";
Dan Egnor42471dd2010-01-07 17:25:22 -08006967
William Luh623a4282013-06-24 12:14:18 -07006968 /**
6969 * Stores whether an user has consented to have apps verified through PAM.
6970 * The value is boolean (1 or 0).
6971 *
6972 * @hide
6973 */
6974 public static final String PACKAGE_VERIFIER_USER_CONSENT =
6975 "package_verifier_user_consent";
satok988323c2011-06-22 16:38:13 +09006976
6977 /**
satokada8c4e2011-08-23 14:56:56 +09006978 * The {@link ComponentName} string of the selected spell checker service which is
6979 * one of the services managed by the text service manager.
6980 *
6981 * @hide
6982 */
6983 public static final String SELECTED_SPELL_CHECKER = "selected_spell_checker";
6984
Michal Karpinski964943a2018-01-19 16:28:26 +00006985 private static final Validator SELECTED_SPELL_CHECKER_VALIDATOR = COMPONENT_NAME_VALIDATOR;
6986
satokada8c4e2011-08-23 14:56:56 +09006987 /**
6988 * The {@link ComponentName} string of the selected subtype of the selected spell checker
satok988323c2011-06-22 16:38:13 +09006989 * service which is one of the services managed by the text service manager.
6990 *
6991 * @hide
6992 */
satokada8c4e2011-08-23 14:56:56 +09006993 public static final String SELECTED_SPELL_CHECKER_SUBTYPE =
6994 "selected_spell_checker_subtype";
satok988323c2011-06-22 16:38:13 +09006995
Michal Karpinski964943a2018-01-19 16:28:26 +00006996 private static final Validator SELECTED_SPELL_CHECKER_SUBTYPE_VALIDATOR =
6997 COMPONENT_NAME_VALIDATOR;
6998
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08006999 /**
Michal Karpinski964943a2018-01-19 16:28:26 +00007000 * Whether spell checker is enabled or not.
satoka33c4fc2011-08-25 16:50:11 +09007001 *
7002 * @hide
7003 */
7004 public static final String SPELL_CHECKER_ENABLED = "spell_checker_enabled";
7005
Michal Karpinski964943a2018-01-19 16:28:26 +00007006 private static final Validator SPELL_CHECKER_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
7007
satoka33c4fc2011-08-25 16:50:11 +09007008 /**
David Brown458e8062010-03-08 21:52:11 -08007009 * What happens when the user presses the Power button while in-call
7010 * and the screen is on.<br/>
7011 * <b>Values:</b><br/>
7012 * 1 - The Power button turns off the screen and locks the device. (Default behavior)<br/>
7013 * 2 - The Power button hangs up the current call.<br/>
7014 *
7015 * @hide
7016 */
7017 public static final String INCALL_POWER_BUTTON_BEHAVIOR = "incall_power_button_behavior";
7018
Michal Karpinski964943a2018-01-19 16:28:26 +00007019 private static final Validator INCALL_POWER_BUTTON_BEHAVIOR_VALIDATOR =
7020 new SettingsValidators.DiscreteValueValidator(new String[]{"1", "2"});
7021
David Brown458e8062010-03-08 21:52:11 -08007022 /**
7023 * INCALL_POWER_BUTTON_BEHAVIOR value for "turn off screen".
7024 * @hide
7025 */
7026 public static final int INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF = 0x1;
7027
7028 /**
7029 * INCALL_POWER_BUTTON_BEHAVIOR value for "hang up".
7030 * @hide
7031 */
7032 public static final int INCALL_POWER_BUTTON_BEHAVIOR_HANGUP = 0x2;
7033
7034 /**
7035 * INCALL_POWER_BUTTON_BEHAVIOR default value.
7036 * @hide
7037 */
7038 public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT =
7039 INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF;
7040
7041 /**
Bryce Leedb776ce2016-09-03 15:02:00 -07007042 * What happens when the user presses the Back button while in-call
7043 * and the screen is on.<br/>
7044 * <b>Values:</b><br/>
7045 * 0 - The Back buttons does nothing different.<br/>
7046 * 1 - The Back button hangs up the current call.<br/>
7047 *
7048 * @hide
7049 */
7050 public static final String INCALL_BACK_BUTTON_BEHAVIOR = "incall_back_button_behavior";
7051
7052 /**
7053 * INCALL_BACK_BUTTON_BEHAVIOR value for no action.
7054 * @hide
7055 */
7056 public static final int INCALL_BACK_BUTTON_BEHAVIOR_NONE = 0x0;
7057
7058 /**
7059 * INCALL_BACK_BUTTON_BEHAVIOR value for "hang up".
7060 * @hide
7061 */
7062 public static final int INCALL_BACK_BUTTON_BEHAVIOR_HANGUP = 0x1;
7063
7064 /**
7065 * INCALL_POWER_BUTTON_BEHAVIOR default value.
7066 * @hide
7067 */
7068 public static final int INCALL_BACK_BUTTON_BEHAVIOR_DEFAULT =
7069 INCALL_BACK_BUTTON_BEHAVIOR_NONE;
7070
7071 /**
Jeff Browna20dda42014-05-27 20:57:24 -07007072 * Whether the device should wake when the wake gesture sensor detects motion.
7073 * @hide
7074 */
7075 public static final String WAKE_GESTURE_ENABLED = "wake_gesture_enabled";
7076
Michal Karpinski964943a2018-01-19 16:28:26 +00007077 private static final Validator WAKE_GESTURE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
7078
Jeff Browna20dda42014-05-27 20:57:24 -07007079 /**
John Spurlocka4215ce2014-08-04 14:50:38 -04007080 * Whether the device should doze if configured.
7081 * @hide
7082 */
7083 public static final String DOZE_ENABLED = "doze_enabled";
7084
Michal Karpinski964943a2018-01-19 16:28:26 +00007085 private static final Validator DOZE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
7086
John Spurlocka4215ce2014-08-04 14:50:38 -04007087 /**
Adrian Roosebea7a72016-10-26 12:51:26 -07007088 * Whether doze should be always on.
7089 * @hide
7090 */
7091 public static final String DOZE_ALWAYS_ON = "doze_always_on";
7092
Lucas Dupina0c0cf72018-06-05 12:02:14 -07007093 private static final Validator DOZE_ALWAYS_ON_VALIDATOR = BOOLEAN_VALIDATOR;
7094
Adrian Roosebea7a72016-10-26 12:51:26 -07007095 /**
Doris Ling6403b402016-09-09 14:29:19 -07007096 * Whether the device should pulse on pick up gesture.
7097 * @hide
7098 */
7099 public static final String DOZE_PULSE_ON_PICK_UP = "doze_pulse_on_pick_up";
7100
Michal Karpinski964943a2018-01-19 16:28:26 +00007101 private static final Validator DOZE_PULSE_ON_PICK_UP_VALIDATOR = BOOLEAN_VALIDATOR;
7102
Doris Ling6403b402016-09-09 14:29:19 -07007103 /**
Adrian Roosd0963a02017-05-15 14:33:37 -07007104 * Whether the device should pulse on long press gesture.
7105 * @hide
7106 */
7107 public static final String DOZE_PULSE_ON_LONG_PRESS = "doze_pulse_on_long_press";
7108
7109 /**
Doris Ling6403b402016-09-09 14:29:19 -07007110 * Whether the device should pulse on double tap gesture.
7111 * @hide
7112 */
7113 public static final String DOZE_PULSE_ON_DOUBLE_TAP = "doze_pulse_on_double_tap";
7114
Michal Karpinski964943a2018-01-19 16:28:26 +00007115 private static final Validator DOZE_PULSE_ON_DOUBLE_TAP_VALIDATOR = BOOLEAN_VALIDATOR;
7116
Doris Ling6403b402016-09-09 14:29:19 -07007117 /**
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07007118 * The current night mode that has been selected by the user. Owned
7119 * and controlled by UiModeManagerService. Constants are as per
7120 * UiModeManager.
7121 * @hide
7122 */
7123 public static final String UI_NIGHT_MODE = "ui_night_mode";
Suchi Amalapurapu40e47252010-04-07 16:15:50 -07007124
7125 /**
Tony Huangf0800fa2018-05-02 10:53:52 +08007126 * The current device UI theme mode effect SystemUI and Launcher.<br/>
7127 * <b>Values:</b><br/>
7128 * 0 - The mode that theme will controlled by wallpaper color.<br/>
7129 * 1 - The mode that will always light theme.<br/>
7130 * 2 - The mode that will always dark theme.<br/>
7131 *
7132 * @hide
7133 */
7134 public static final String THEME_MODE = "theme_mode";
7135
7136 /**
7137 * THEME_MODE value for wallpaper mode.
7138 * @hide
7139 */
7140 public static final int THEME_MODE_WALLPAPER = 0;
7141
7142 /**
7143 * THEME_MODE value for light theme mode.
7144 * @hide
7145 */
7146 public static final int THEME_MODE_LIGHT = 1;
7147
7148 /**
7149 * THEME_MODE value for dark theme mode.
7150 * @hide
7151 */
7152 public static final int THEME_MODE_DARK = 2;
7153
7154 /**
John Spurlock1a868b72012-08-22 09:56:51 -04007155 * Whether screensavers are enabled.
Daniel Sandler0601eb72011-04-13 01:01:32 -04007156 * @hide
7157 */
Daniel Sandler2d545362011-11-17 10:38:37 -08007158 public static final String SCREENSAVER_ENABLED = "screensaver_enabled";
Daniel Sandler0601eb72011-04-13 01:01:32 -04007159
Michal Karpinski964943a2018-01-19 16:28:26 +00007160 private static final Validator SCREENSAVER_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
7161
Daniel Sandler0601eb72011-04-13 01:01:32 -04007162 /**
John Spurlock1a868b72012-08-22 09:56:51 -04007163 * The user's chosen screensaver components.
Daniel Sandler2d545362011-11-17 10:38:37 -08007164 *
John Spurlock1a868b72012-08-22 09:56:51 -04007165 * These will be launched by the PhoneWindowManager after a timeout when not on
Daniel Sandler2d545362011-11-17 10:38:37 -08007166 * battery, or upon dock insertion (if SCREENSAVER_ACTIVATE_ON_DOCK is set to 1).
Daniel Sandler0601eb72011-04-13 01:01:32 -04007167 * @hide
7168 */
John Spurlock1a868b72012-08-22 09:56:51 -04007169 public static final String SCREENSAVER_COMPONENTS = "screensaver_components";
Daniel Sandler2d545362011-11-17 10:38:37 -08007170
Michal Karpinski964943a2018-01-19 16:28:26 +00007171 private static final Validator SCREENSAVER_COMPONENTS_VALIDATOR =
7172 new SettingsValidators.ComponentNameListValidator(",");
7173
Daniel Sandler2d545362011-11-17 10:38:37 -08007174 /**
John Spurlock1a868b72012-08-22 09:56:51 -04007175 * If screensavers are enabled, whether the screensaver should be automatically launched
7176 * when the device is inserted into a (desk) dock.
Daniel Sandler2d545362011-11-17 10:38:37 -08007177 * @hide
7178 */
7179 public static final String SCREENSAVER_ACTIVATE_ON_DOCK = "screensaver_activate_on_dock";
Daniel Sandler0601eb72011-04-13 01:01:32 -04007180
Michal Karpinski964943a2018-01-19 16:28:26 +00007181 private static final Validator SCREENSAVER_ACTIVATE_ON_DOCK_VALIDATOR = BOOLEAN_VALIDATOR;
7182
John Spurlock1a868b72012-08-22 09:56:51 -04007183 /**
7184 * If screensavers are enabled, whether the screensaver should be automatically launched
7185 * when the screen times out when not on battery.
7186 * @hide
7187 */
7188 public static final String SCREENSAVER_ACTIVATE_ON_SLEEP = "screensaver_activate_on_sleep";
7189
Michal Karpinski964943a2018-01-19 16:28:26 +00007190 private static final Validator SCREENSAVER_ACTIVATE_ON_SLEEP_VALIDATOR = BOOLEAN_VALIDATOR;
7191
John Spurlock1a868b72012-08-22 09:56:51 -04007192 /**
7193 * If screensavers are enabled, the default screensaver component.
7194 * @hide
7195 */
7196 public static final String SCREENSAVER_DEFAULT_COMPONENT = "screensaver_default_component";
7197
Daniel Sandler0601eb72011-04-13 01:01:32 -04007198 /**
Martijn Coenena7397882013-07-30 20:07:47 -07007199 * The default NFC payment component
7200 * @hide
7201 */
7202 public static final String NFC_PAYMENT_DEFAULT_COMPONENT = "nfc_payment_default_component";
7203
Michal Karpinski964943a2018-01-19 16:28:26 +00007204 private static final Validator NFC_PAYMENT_DEFAULT_COMPONENT_VALIDATOR =
7205 COMPONENT_NAME_VALIDATOR;
7206
Martijn Coenena7397882013-07-30 20:07:47 -07007207 /**
Martijn Coenen2f6f3a012014-04-25 17:00:21 -07007208 * Whether NFC payment is handled by the foreground application or a default.
7209 * @hide
7210 */
7211 public static final String NFC_PAYMENT_FOREGROUND = "nfc_payment_foreground";
7212
7213 /**
David Braunf5d83192013-09-16 13:43:51 -07007214 * Specifies the package name currently configured to be the primary sms application
7215 * @hide
7216 */
7217 public static final String SMS_DEFAULT_APPLICATION = "sms_default_application";
7218
7219 /**
Yorke Lee014de022015-04-21 17:15:47 -07007220 * Specifies the package name currently configured to be the default dialer application
7221 * @hide
7222 */
7223 public static final String DIALER_DEFAULT_APPLICATION = "dialer_default_application";
7224
7225 /**
Adrian Roos943eb862015-03-26 12:31:16 -07007226 * Specifies the package name currently configured to be the emergency assistance application
7227 *
7228 * @see android.telephony.TelephonyManager#ACTION_EMERGENCY_ASSISTANCE
7229 *
7230 * @hide
7231 */
7232 public static final String EMERGENCY_ASSISTANCE_APPLICATION = "emergency_assistance_application";
7233
7234 /**
Jorim Jaggi9d910832015-05-18 17:35:26 -07007235 * Specifies whether the current app context on scren (assist data) will be sent to the
7236 * assist application (active voice interaction service).
7237 *
7238 * @hide
7239 */
7240 public static final String ASSIST_STRUCTURE_ENABLED = "assist_structure_enabled";
7241
7242 /**
Jorim Jaggia133f0b2015-06-26 16:40:00 -07007243 * Specifies whether a screenshot of the screen contents will be sent to the assist
7244 * application (active voice interaction service).
7245 *
7246 * @hide
7247 */
7248 public static final String ASSIST_SCREENSHOT_ENABLED = "assist_screenshot_enabled";
7249
7250 /**
Adrian Roos2335bd62016-08-11 15:42:40 -07007251 * Specifies whether the screen will show an animation if screen contents are sent to the
7252 * assist application (active voice interaction service).
7253 *
7254 * Note that the disclosure will be forced for third-party assistants or if the device
7255 * does not support disabling it.
7256 *
7257 * @hide
7258 */
7259 public static final String ASSIST_DISCLOSURE_ENABLED = "assist_disclosure_enabled";
7260
7261 /**
Mike Digmane14e6632018-01-11 10:43:08 -08007262 * Control if rotation suggestions are sent to System UI when in rotation locked mode.
7263 * Done to enable screen rotation while the the screen rotation is locked. Enabling will
7264 * poll the accelerometer in rotation locked mode.
7265 *
7266 * If 0, then rotation suggestions are not sent to System UI. If 1, suggestions are sent.
7267 *
7268 * @hide
7269 */
7270
7271 public static final String SHOW_ROTATION_SUGGESTIONS = "show_rotation_suggestions";
7272
7273 /**
7274 * The disabled state of SHOW_ROTATION_SUGGESTIONS.
7275 * @hide
7276 */
7277 public static final int SHOW_ROTATION_SUGGESTIONS_DISABLED = 0x0;
7278
7279 /**
7280 * The enabled state of SHOW_ROTATION_SUGGESTIONS.
7281 * @hide
7282 */
7283 public static final int SHOW_ROTATION_SUGGESTIONS_ENABLED = 0x1;
7284
7285 /**
7286 * The default state of SHOW_ROTATION_SUGGESTIONS.
7287 * @hide
7288 */
7289 public static final int SHOW_ROTATION_SUGGESTIONS_DEFAULT =
Mike Digman02856ba2018-01-16 11:21:23 -08007290 SHOW_ROTATION_SUGGESTIONS_ENABLED;
Mike Digmane14e6632018-01-11 10:43:08 -08007291
7292 /**
Mike Digman50752642018-02-15 13:36:09 -08007293 * The number of accepted rotation suggestions. Used to determine if the user has been
7294 * introduced to rotation suggestions.
7295 * @hide
7296 */
7297 public static final String NUM_ROTATION_SUGGESTIONS_ACCEPTED =
7298 "num_rotation_suggestions_accepted";
7299
7300 /**
Julia Reynoldsb852e562017-06-06 16:14:18 -04007301 * Read only list of the service components that the current user has explicitly allowed to
Julia Reynolds77b2cc92016-11-08 14:41:09 -05007302 * see and assist with all of the user's notifications.
7303 *
Julia Reynoldsb852e562017-06-06 16:14:18 -04007304 * @deprecated Use
7305 * {@link NotificationManager#isNotificationListenerAccessGranted(ComponentName)}.
Julia Reynolds77b2cc92016-11-08 14:41:09 -05007306 * @hide
7307 */
Julia Reynoldsb852e562017-06-06 16:14:18 -04007308 @Deprecated
Julia Reynolds77b2cc92016-11-08 14:41:09 -05007309 public static final String ENABLED_NOTIFICATION_ASSISTANT =
7310 "enabled_notification_assistant";
7311
Michal Karpinski964943a2018-01-19 16:28:26 +00007312 private static final Validator ENABLED_NOTIFICATION_ASSISTANT_VALIDATOR =
7313 new SettingsValidators.ComponentNameListValidator(":");
7314
Julia Reynolds77b2cc92016-11-08 14:41:09 -05007315 /**
Julia Reynoldsb852e562017-06-06 16:14:18 -04007316 * Read only list of the service components that the current user has explicitly allowed to
Chris Wren8326a8a2014-10-22 14:13:32 -04007317 * see all of the user's notifications, separated by ':'.
Daniel Sandler4b749ef2013-03-18 21:53:04 -04007318 *
7319 * @hide
Julia Reynoldsb852e562017-06-06 16:14:18 -04007320 * @deprecated Use
7321 * {@link NotificationManager#isNotificationAssistantAccessGranted(ComponentName)}.
Daniel Sandler4b749ef2013-03-18 21:53:04 -04007322 */
Julia Reynoldsb852e562017-06-06 16:14:18 -04007323 @Deprecated
Daniel Sandler4b749ef2013-03-18 21:53:04 -04007324 public static final String ENABLED_NOTIFICATION_LISTENERS = "enabled_notification_listeners";
7325
Michal Karpinski964943a2018-01-19 16:28:26 +00007326 private static final Validator ENABLED_NOTIFICATION_LISTENERS_VALIDATOR =
7327 new SettingsValidators.ComponentNameListValidator(":");
7328
John Spurlock7340fc82014-04-24 18:50:12 -04007329 /**
Julia Reynoldsb852e562017-06-06 16:14:18 -04007330 * Read only list of the packages that the current user has explicitly allowed to
7331 * manage do not disturb, separated by ':'.
Julia Reynolds0aa7d612016-04-25 14:57:33 -04007332 *
Julia Reynoldsb852e562017-06-06 16:14:18 -04007333 * @deprecated Use {@link NotificationManager#isNotificationPolicyAccessGranted()}.
Julia Reynolds0aa7d612016-04-25 14:57:33 -04007334 * @hide
John Spurlock7c74f782015-06-04 13:01:42 -04007335 */
Julia Reynoldsb852e562017-06-06 16:14:18 -04007336 @Deprecated
Julia Reynolds0aa7d612016-04-25 14:57:33 -04007337 @TestApi
John Spurlock7c74f782015-06-04 13:01:42 -04007338 public static final String ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES =
7339 "enabled_notification_policy_access_packages";
7340
Michal Karpinski964943a2018-01-19 16:28:26 +00007341 private static final Validator ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES_VALIDATOR =
7342 new SettingsValidators.PackageNameListValidator(":");
7343
Andre Lagoea35e072016-08-04 13:41:13 +01007344 /**
7345 * Defines whether managed profile ringtones should be synced from it's parent profile
7346 * <p>
7347 * 0 = ringtones are not synced
7348 * 1 = ringtones are synced from the profile's parent (default)
7349 * <p>
7350 * This value is only used for managed profiles.
7351 * @hide
7352 */
Robin Leec74d85f2017-03-16 17:19:42 +00007353 @TestApi
7354 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
Andre Lagoea35e072016-08-04 13:41:13 +01007355 public static final String SYNC_PARENT_SOUNDS = "sync_parent_sounds";
7356
Michal Karpinski964943a2018-01-19 16:28:26 +00007357 private static final Validator SYNC_PARENT_SOUNDS_VALIDATOR = BOOLEAN_VALIDATOR;
7358
John Spurlockcdb57ae2015-02-11 19:04:11 -05007359 /** @hide */
John Spurlockf1a36642013-10-12 17:50:42 -04007360 public static final String IMMERSIVE_MODE_CONFIRMATIONS = "immersive_mode_confirmations";
John Spurlockd67ec252013-09-05 11:31:54 -04007361
Yorke Lee647f8f32013-05-07 10:49:44 -07007362 /**
Svetoslavf43e8512013-09-30 17:33:05 -07007363 * This is the query URI for finding a print service to install.
7364 *
7365 * @hide
7366 */
7367 public static final String PRINT_SERVICE_SEARCH_URI = "print_service_search_uri";
7368
7369 /**
7370 * This is the query URI for finding a NFC payment service to install.
7371 *
7372 * @hide
7373 */
7374 public static final String PAYMENT_SERVICE_SEARCH_URI = "payment_service_search_uri";
7375
7376 /**
Philip P. Moltmanna30d6e02017-04-27 15:40:02 -07007377 * This is the query URI for finding a auto fill service to install.
7378 *
7379 * @hide
7380 */
7381 public static final String AUTOFILL_SERVICE_SEARCH_URI = "autofill_service_search_uri";
7382
7383 /**
Amith Yamasani1e9c2182014-06-11 17:25:51 -07007384 * If enabled, apps should try to skip any introductory hints on first launch. This might
Amith Yamasani0c416392014-06-13 15:54:39 -07007385 * apply to users that are already familiar with the environment or temporary users.
Amith Yamasani1e9c2182014-06-11 17:25:51 -07007386 * <p>
7387 * Type : int (0 to show hints, 1 to skip showing hints)
Amith Yamasani1e9c2182014-06-11 17:25:51 -07007388 */
7389 public static final String SKIP_FIRST_USE_HINTS = "skip_first_use_hints";
7390
7391 /**
John Spurlockaa5ee4d2014-07-25 13:05:12 -04007392 * Persisted playback time after a user confirmation of an unsafe volume level.
7393 *
7394 * @hide
7395 */
7396 public static final String UNSAFE_VOLUME_MUSIC_ACTIVE_MS = "unsafe_volume_music_active_ms";
7397
7398 /**
Dan Sandler52e5701e2014-07-22 23:14:54 -04007399 * This preference enables notification display on the lockscreen.
7400 * @hide
7401 */
7402 public static final String LOCK_SCREEN_SHOW_NOTIFICATIONS =
7403 "lock_screen_show_notifications";
7404
7405 /**
Dongwon Kang4d933a02014-08-07 22:51:47 -07007406 * List of TV inputs that are currently hidden. This is a string
Jaewan Kimf0e530e2014-08-22 00:43:31 +09007407 * containing the IDs of all hidden TV inputs. Each ID is encoded by
7408 * {@link android.net.Uri#encode(String)} and separated by ':'.
Dongwon Kang4d933a02014-08-07 22:51:47 -07007409 * @hide
7410 */
7411 public static final String TV_INPUT_HIDDEN_INPUTS = "tv_input_hidden_inputs";
7412
7413 /**
7414 * List of custom TV input labels. This is a string containing <TV input id, custom name>
Jaewan Kimf0e530e2014-08-22 00:43:31 +09007415 * pairs. TV input id and custom name are encoded by {@link android.net.Uri#encode(String)}
7416 * and separated by ','. Each pair is separated by ':'.
Dongwon Kang4d933a02014-08-07 22:51:47 -07007417 * @hide
7418 */
7419 public static final String TV_INPUT_CUSTOM_LABELS = "tv_input_custom_labels";
7420
7421 /**
Glenn Kasten34cc4db2014-08-13 10:56:38 -07007422 * Whether automatic routing of system audio to USB audio peripheral is disabled.
7423 * The value is boolean (1 or 0), where 1 means automatic routing is disabled,
7424 * and 0 means automatic routing is enabled.
7425 *
7426 * @hide
7427 */
7428 public static final String USB_AUDIO_AUTOMATIC_ROUTING_DISABLED =
7429 "usb_audio_automatic_routing_disabled";
7430
7431 /**
Jeff Brown05af6ad2014-09-30 20:54:30 -07007432 * The timeout in milliseconds before the device fully goes to sleep after
7433 * a period of inactivity. This value sets an upper bound on how long the device
7434 * will stay awake or dreaming without user activity. It should generally
Dianne Hackbornad6a99b2014-11-18 10:11:10 -08007435 * be longer than {@link Settings.System#SCREEN_OFF_TIMEOUT} as otherwise the device
Jeff Brown05af6ad2014-09-30 20:54:30 -07007436 * will sleep before it ever has a chance to dream.
7437 * <p>
7438 * Use -1 to disable this timeout.
7439 * </p>
7440 *
7441 * @hide
7442 */
7443 public static final String SLEEP_TIMEOUT = "sleep_timeout";
7444
Michal Karpinski964943a2018-01-19 16:28:26 +00007445 private static final Validator SLEEP_TIMEOUT_VALIDATOR =
7446 new SettingsValidators.InclusiveIntegerRangeValidator(-1, Integer.MAX_VALUE);
7447
Jeff Brown05af6ad2014-09-30 20:54:30 -07007448 /**
Jason Monk27bbb2d2015-03-31 16:46:39 -04007449 * Controls whether double tap to wake is enabled.
7450 * @hide
7451 */
7452 public static final String DOUBLE_TAP_TO_WAKE = "double_tap_to_wake";
7453
Michal Karpinski964943a2018-01-19 16:28:26 +00007454 private static final Validator DOUBLE_TAP_TO_WAKE_VALIDATOR = BOOLEAN_VALIDATOR;
7455
Jason Monk27bbb2d2015-03-31 16:46:39 -04007456 /**
Xiyuan Xiae6de8b92015-06-06 22:18:05 -07007457 * The current assistant component. It could be a voice interaction service,
7458 * or an activity that handles ACTION_ASSIST, or empty which means using the default
7459 * handling.
7460 *
7461 * @hide
7462 */
7463 public static final String ASSISTANT = "assistant";
7464
7465 /**
Jason Monk5a5e7d62015-08-04 11:20:25 -04007466 * Whether the camera launch gesture should be disabled.
7467 *
7468 * @hide
7469 */
7470 public static final String CAMERA_GESTURE_DISABLED = "camera_gesture_disabled";
7471
Michal Karpinski964943a2018-01-19 16:28:26 +00007472 private static final Validator CAMERA_GESTURE_DISABLED_VALIDATOR = BOOLEAN_VALIDATOR;
7473
Jason Monk5a5e7d62015-08-04 11:20:25 -04007474 /**
Adrian Roos5941c982015-09-03 15:59:49 -07007475 * Whether the camera launch gesture to double tap the power button when the screen is off
7476 * should be disabled.
7477 *
7478 * @hide
7479 */
7480 public static final String CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED =
7481 "camera_double_tap_power_gesture_disabled";
7482
Michal Karpinski964943a2018-01-19 16:28:26 +00007483 private static final Validator CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED_VALIDATOR =
7484 BOOLEAN_VALIDATOR;
7485
Adrian Roos5941c982015-09-03 15:59:49 -07007486 /**
Doris Linga60d31d2016-07-06 13:39:05 -07007487 * Whether the camera double twist gesture to flip between front and back mode should be
7488 * enabled.
7489 *
7490 * @hide
7491 */
7492 public static final String CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED =
7493 "camera_double_twist_to_flip_enabled";
7494
Michal Karpinski964943a2018-01-19 16:28:26 +00007495 private static final Validator CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED_VALIDATOR =
7496 BOOLEAN_VALIDATOR;
7497
Doris Linga60d31d2016-07-06 13:39:05 -07007498 /**
Mehdi Alizadeh1264d882018-04-03 18:38:34 -07007499 * Whether the swipe up gesture to switch apps should be enabled.
7500 *
7501 * @hide
7502 */
7503 public static final String SWIPE_UP_TO_SWITCH_APPS_ENABLED =
7504 "swipe_up_to_switch_apps_enabled";
7505
7506 private static final Validator SWIPE_UP_TO_SWITCH_APPS_ENABLED_VALIDATOR =
7507 BOOLEAN_VALIDATOR;
7508
7509 /**
Daniel Sheng45e0d342017-04-17 17:27:22 -07007510 * Whether or not the smart camera lift trigger that launches the camera when the user moves
7511 * the phone into a position for taking photos should be enabled.
7512 *
7513 * @hide
7514 */
7515 public static final String CAMERA_LIFT_TRIGGER_ENABLED = "camera_lift_trigger_enabled";
7516
7517 /**
Daniel Sheng834e5722017-05-30 09:28:52 -07007518 * The default enable state of the camera lift trigger.
7519 *
7520 * @hide
7521 */
7522 public static final int CAMERA_LIFT_TRIGGER_ENABLED_DEFAULT = 1;
7523
7524 /**
Steven Wua680beb2018-05-23 20:04:58 -04007525 * Whether or not the flashlight (camera torch mode) is available required to turn
7526 * on flashlight.
7527 *
7528 * @hide
7529 */
7530 public static final String FLASHLIGHT_AVAILABLE = "flashlight_available";
7531
7532 /**
7533 * Whether or not flashlight is enabled.
7534 *
7535 * @hide
7536 */
7537 public static final String FLASHLIGHT_ENABLED = "flashlight_enabled";
7538
7539 /**
Philip Quinnc4cc3082017-02-13 20:18:16 -08007540 * Whether the assist gesture should be enabled.
7541 *
7542 * @hide
7543 */
7544 public static final String ASSIST_GESTURE_ENABLED = "assist_gesture_enabled";
7545
Michal Karpinski964943a2018-01-19 16:28:26 +00007546 private static final Validator ASSIST_GESTURE_ENABLED_VALIDATOR =
7547 BOOLEAN_VALIDATOR;
7548
Philip Quinnc4cc3082017-02-13 20:18:16 -08007549 /**
Philip Quinn80274ca2017-03-03 10:38:38 -08007550 * Sensitivity control for the assist gesture.
7551 *
7552 * @hide
7553 */
7554 public static final String ASSIST_GESTURE_SENSITIVITY = "assist_gesture_sensitivity";
7555
Michal Karpinski964943a2018-01-19 16:28:26 +00007556 private static final Validator ASSIST_GESTURE_SENSITIVITY_VALIDATOR =
7557 new SettingsValidators.InclusiveFloatRangeValidator(0.0f, 1.0f);
7558
Philip Quinn80274ca2017-03-03 10:38:38 -08007559 /**
Kevin Chyn80939372017-06-09 15:40:18 -07007560 * Whether the assist gesture should silence alerts.
7561 *
7562 * @hide
7563 */
7564 public static final String ASSIST_GESTURE_SILENCE_ALERTS_ENABLED =
7565 "assist_gesture_silence_alerts_enabled";
7566
Michal Karpinski964943a2018-01-19 16:28:26 +00007567 private static final Validator ASSIST_GESTURE_SILENCE_ALERTS_ENABLED_VALIDATOR =
7568 BOOLEAN_VALIDATOR;
7569
Kevin Chyn80939372017-06-09 15:40:18 -07007570 /**
7571 * Whether the assist gesture should wake the phone.
7572 *
7573 * @hide
7574 */
7575 public static final String ASSIST_GESTURE_WAKE_ENABLED =
7576 "assist_gesture_wake_enabled";
7577
Michal Karpinski964943a2018-01-19 16:28:26 +00007578 private static final Validator ASSIST_GESTURE_WAKE_ENABLED_VALIDATOR =
7579 BOOLEAN_VALIDATOR;
7580
Kevin Chyn80939372017-06-09 15:40:18 -07007581 /**
Kevin Chyncfd641e2017-06-05 11:28:09 -07007582 * Whether Assist Gesture Deferred Setup has been completed
7583 *
7584 * @hide
7585 */
7586 public static final String ASSIST_GESTURE_SETUP_COMPLETE = "assist_gesture_setup_complete";
7587
Michal Karpinski964943a2018-01-19 16:28:26 +00007588 private static final Validator ASSIST_GESTURE_SETUP_COMPLETE_VALIDATOR = BOOLEAN_VALIDATOR;
7589
Kevin Chyncfd641e2017-06-05 11:28:09 -07007590 /**
Justin Klaassen911e8892016-06-21 18:24:24 -07007591 * Control whether Night display is currently activated.
7592 * @hide
7593 */
7594 public static final String NIGHT_DISPLAY_ACTIVATED = "night_display_activated";
7595
7596 /**
7597 * Control whether Night display will automatically activate/deactivate.
7598 * @hide
7599 */
7600 public static final String NIGHT_DISPLAY_AUTO_MODE = "night_display_auto_mode";
7601
Christine Frankseafb5412018-02-06 11:09:39 -08007602 private static final Validator NIGHT_DISPLAY_AUTO_MODE_VALIDATOR =
7603 new SettingsValidators.InclusiveIntegerRangeValidator(0, 2);
Michal Karpinski964943a2018-01-19 16:28:26 +00007604
Justin Klaassen911e8892016-06-21 18:24:24 -07007605 /**
Christine Franks6418d0b2017-02-13 09:48:00 -08007606 * Control the color temperature of Night Display, represented in Kelvin.
7607 * @hide
7608 */
7609 public static final String NIGHT_DISPLAY_COLOR_TEMPERATURE =
7610 "night_display_color_temperature";
7611
Michal Karpinski964943a2018-01-19 16:28:26 +00007612 private static final Validator NIGHT_DISPLAY_COLOR_TEMPERATURE_VALIDATOR =
7613 NON_NEGATIVE_INTEGER_VALIDATOR;
7614
Christine Franks6418d0b2017-02-13 09:48:00 -08007615 /**
Justin Klaassen911e8892016-06-21 18:24:24 -07007616 * Custom time when Night display is scheduled to activate.
7617 * Represented as milliseconds from midnight (e.g. 79200000 == 10pm).
7618 * @hide
7619 */
Christine Frankse5bb03e2017-02-10 17:36:10 -08007620 public static final String NIGHT_DISPLAY_CUSTOM_START_TIME =
7621 "night_display_custom_start_time";
Justin Klaassen911e8892016-06-21 18:24:24 -07007622
Michal Karpinski964943a2018-01-19 16:28:26 +00007623 private static final Validator NIGHT_DISPLAY_CUSTOM_START_TIME_VALIDATOR =
7624 NON_NEGATIVE_INTEGER_VALIDATOR;
7625
Justin Klaassen911e8892016-06-21 18:24:24 -07007626 /**
7627 * Custom time when Night display is scheduled to deactivate.
7628 * Represented as milliseconds from midnight (e.g. 21600000 == 6am).
7629 * @hide
7630 */
7631 public static final String NIGHT_DISPLAY_CUSTOM_END_TIME = "night_display_custom_end_time";
Jason Monk5dbd4aa2016-02-07 13:13:39 -05007632
Michal Karpinski964943a2018-01-19 16:28:26 +00007633 private static final Validator NIGHT_DISPLAY_CUSTOM_END_TIME_VALIDATOR =
7634 NON_NEGATIVE_INTEGER_VALIDATOR;
7635
Jason Monk5dbd4aa2016-02-07 13:13:39 -05007636 /**
Christine Franks03213462017-08-25 13:57:26 -07007637 * A String representing the LocalDateTime when Night display was last activated. Use to
7638 * decide whether to apply the current activated state after a reboot or user change. In
7639 * legacy cases, this is represented by the time in milliseconds (since epoch).
Christine Frankse5bb03e2017-02-10 17:36:10 -08007640 * @hide
7641 */
7642 public static final String NIGHT_DISPLAY_LAST_ACTIVATED_TIME =
7643 "night_display_last_activated_time";
7644
7645 /**
Ruben Brunke24b9a62016-02-16 21:38:24 -08007646 * Names of the service components that the current user has explicitly allowed to
7647 * be a VR mode listener, separated by ':'.
7648 *
7649 * @hide
7650 */
7651 public static final String ENABLED_VR_LISTENERS = "enabled_vr_listeners";
7652
Michal Karpinski964943a2018-01-19 16:28:26 +00007653 private static final Validator ENABLED_VR_LISTENERS_VALIDATOR =
7654 new SettingsValidators.ComponentNameListValidator(":");
7655
Ruben Brunke24b9a62016-02-16 21:38:24 -08007656 /**
Ruben Brunk49506e02016-04-18 18:10:47 -07007657 * Behavior of the display while in VR mode.
7658 *
7659 * One of {@link #VR_DISPLAY_MODE_LOW_PERSISTENCE} or {@link #VR_DISPLAY_MODE_OFF}.
7660 *
7661 * @hide
7662 */
7663 public static final String VR_DISPLAY_MODE = "vr_display_mode";
7664
Michal Karpinski964943a2018-01-19 16:28:26 +00007665 private static final Validator VR_DISPLAY_MODE_VALIDATOR =
7666 new SettingsValidators.DiscreteValueValidator(new String[]{"0", "1"});
7667
Ruben Brunk49506e02016-04-18 18:10:47 -07007668 /**
7669 * Lower the display persistence while the system is in VR mode.
7670 *
7671 * @see PackageManager#FEATURE_VR_MODE_HIGH_PERFORMANCE
7672 *
7673 * @hide.
7674 */
7675 public static final int VR_DISPLAY_MODE_LOW_PERSISTENCE = 0;
7676
7677 /**
7678 * Do not alter the display persistence while the system is in VR mode.
7679 *
7680 * @see PackageManager#FEATURE_VR_MODE_HIGH_PERFORMANCE
7681 *
7682 * @hide.
7683 */
7684 public static final int VR_DISPLAY_MODE_OFF = 1;
7685
7686 /**
Jeff Davidson24b9d962016-07-21 12:35:10 -07007687 * Whether CarrierAppUtils#disableCarrierAppsUntilPrivileged has been executed at least
7688 * once.
7689 *
7690 * <p>This is used to ensure that we only take one pass which will disable apps that are not
7691 * privileged (if any). From then on, we only want to enable apps (when a matching SIM is
7692 * inserted), to avoid disabling an app that the user might actively be using.
7693 *
7694 * <p>Will be set to 1 once executed.
7695 *
7696 * @hide
7697 */
7698 public static final String CARRIER_APPS_HANDLED = "carrier_apps_handled";
7699
7700 /**
Tony Makc820cc52016-05-03 18:58:28 +01007701 * Whether parent user can access remote contact in managed profile.
7702 *
7703 * @hide
7704 */
7705 public static final String MANAGED_PROFILE_CONTACT_REMOTE_SEARCH =
7706 "managed_profile_contact_remote_search";
7707
7708 /**
Daniel Nishi395d3872016-05-23 13:25:21 -07007709 * Whether or not the automatic storage manager is enabled and should run on the device.
7710 *
7711 * @hide
7712 */
7713 public static final String AUTOMATIC_STORAGE_MANAGER_ENABLED =
7714 "automatic_storage_manager_enabled";
7715
7716 /**
Daniel Nishic535be12016-06-10 13:51:36 -07007717 * How many days of information for the automatic storage manager to retain on the device.
7718 *
7719 * @hide
7720 */
7721 public static final String AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN =
7722 "automatic_storage_manager_days_to_retain";
7723
Michal Karpinski964943a2018-01-19 16:28:26 +00007724 private static final Validator AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN_VALIDATOR =
7725 NON_NEGATIVE_INTEGER_VALIDATOR;
7726
Daniel Nishic535be12016-06-10 13:51:36 -07007727 /**
7728 * Default number of days of information for the automatic storage manager to retain.
7729 *
7730 * @hide
7731 */
7732 public static final int AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN_DEFAULT = 90;
7733
7734 /**
Daniel Nishif678cc92016-06-24 15:49:25 -07007735 * How many bytes the automatic storage manager has cleared out.
7736 *
7737 * @hide
7738 */
7739 public static final String AUTOMATIC_STORAGE_MANAGER_BYTES_CLEARED =
7740 "automatic_storage_manager_bytes_cleared";
7741
7742
7743 /**
7744 * Last run time for the automatic storage manager.
7745 *
7746 * @hide
7747 */
7748 public static final String AUTOMATIC_STORAGE_MANAGER_LAST_RUN =
7749 "automatic_storage_manager_last_run";
7750
Jorge Gil6825a772016-06-30 11:07:18 -07007751 /**
Daniel Nishida7332c2017-06-12 10:17:33 -07007752 * If the automatic storage manager has been disabled by policy. Note that this doesn't
7753 * mean that the automatic storage manager is prevented from being re-enabled -- this only
7754 * means that it was turned off by policy at least once.
7755 *
7756 * @hide
7757 */
7758 public static final String AUTOMATIC_STORAGE_MANAGER_TURNED_OFF_BY_POLICY =
7759 "automatic_storage_manager_turned_off_by_policy";
7760
7761 /**
Doris Linga60d31d2016-07-06 13:39:05 -07007762 * Whether SystemUI navigation keys is enabled.
7763 * @hide
7764 */
7765 public static final String SYSTEM_NAVIGATION_KEYS_ENABLED =
7766 "system_navigation_keys_enabled";
7767
Michal Karpinski964943a2018-01-19 16:28:26 +00007768 private static final Validator SYSTEM_NAVIGATION_KEYS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
7769
Allison Babickf0bc8662016-07-11 15:39:16 -07007770 /**
Jason Monkbaade752016-08-25 15:57:14 -04007771 * Holds comma separated list of ordering of QS tiles.
7772 * @hide
7773 */
7774 public static final String QS_TILES = "sysui_qs_tiles";
7775
Michal Karpinski964943a2018-01-19 16:28:26 +00007776 private static final Validator QS_TILES_VALIDATOR = new Validator() {
7777 @Override
Annie Mengeed1b812018-05-21 16:34:52 +01007778 public boolean validate(@Nullable String value) {
Michal Karpinski964943a2018-01-19 16:28:26 +00007779 if (value == null) {
7780 return false;
7781 }
7782 String[] tiles = value.split(",");
7783 boolean valid = true;
7784 for (String tile : tiles) {
7785 // tile can be any non-empty string as specified by OEM
7786 valid |= ((tile.length() > 0) && ANY_STRING_VALIDATOR.validate(tile));
7787 }
7788 return valid;
7789 }
7790 };
7791
Jason Monkbaade752016-08-25 15:57:14 -04007792 /**
Todd Kennedyefc1c4d2016-07-21 07:44:33 -07007793 * Specifies whether the web action API is enabled.
7794 *
7795 * @hide
7796 */
Jesse Evansfc1bfc42017-04-07 16:11:26 -07007797 @SystemApi
7798 public static final String INSTANT_APPS_ENABLED = "instant_apps_enabled";
Todd Kennedyefc1c4d2016-07-21 07:44:33 -07007799
7800 /**
Greg Plesur35144042016-10-10 16:23:49 -04007801 * Has this pairable device been paired or upgraded from a previously paired system.
7802 * @hide
7803 */
7804 public static final String DEVICE_PAIRED = "device_paired";
7805
7806 /**
Shahriyar Amini9343f572017-01-12 12:03:24 -08007807 * Integer state indicating whether package verifier is enabled.
7808 * TODO(b/34259924): Remove this setting.
7809 *
7810 * @hide
7811 */
7812 public static final String PACKAGE_VERIFIER_STATE = "package_verifier_state";
7813
7814 /**
Jack Yu39028572017-02-23 09:49:25 -08007815 * Specifies additional package name for broadcasting the CMAS messages.
7816 * @hide
7817 */
7818 public static final String CMAS_ADDITIONAL_BROADCAST_PKG = "cmas_additional_broadcast_pkg";
7819
7820 /**
Chris Wren89aa2262017-05-05 18:05:56 -04007821 * Whether the launcher should show any notification badges.
7822 * The value is boolean (1 or 0).
7823 * @hide
7824 */
7825 public static final String NOTIFICATION_BADGING = "notification_badging";
7826
Michal Karpinski964943a2018-01-19 16:28:26 +00007827 private static final Validator NOTIFICATION_BADGING_VALIDATOR = BOOLEAN_VALIDATOR;
7828
Chris Wren89aa2262017-05-05 18:05:56 -04007829 /**
Jason Monkcb5296a2017-06-30 10:28:18 -04007830 * Comma separated list of QS tiles that have been auto-added already.
7831 * @hide
7832 */
7833 public static final String QS_AUTO_ADDED_TILES = "qs_auto_tiles";
7834
Michal Karpinski964943a2018-01-19 16:28:26 +00007835 private static final Validator QS_AUTO_ADDED_TILES_VALIDATOR = new Validator() {
7836 @Override
Annie Mengeed1b812018-05-21 16:34:52 +01007837 public boolean validate(@Nullable String value) {
Michal Karpinski964943a2018-01-19 16:28:26 +00007838 if (value == null) {
7839 return false;
7840 }
7841 String[] tiles = value.split(",");
7842 boolean valid = true;
7843 for (String tile : tiles) {
7844 // tile can be any non-empty string as specified by OEM
7845 valid |= ((tile.length() > 0) && ANY_STRING_VALIDATOR.validate(tile));
7846 }
7847 return valid;
7848 }
7849 };
7850
Jason Monkcb5296a2017-06-30 10:28:18 -04007851 /**
Chad Brubaker4f28f0d2017-09-07 14:28:13 -07007852 * Whether the Lockdown button should be shown in the power menu.
7853 * @hide
7854 */
7855 public static final String LOCKDOWN_IN_POWER_MENU = "lockdown_in_power_menu";
Tim Zhengcc1e76a2017-08-30 17:46:19 -07007856
Michal Karpinski964943a2018-01-19 16:28:26 +00007857 private static final Validator LOCKDOWN_IN_POWER_MENU_VALIDATOR = BOOLEAN_VALIDATOR;
7858
Tim Zhengcc1e76a2017-08-30 17:46:19 -07007859 /**
7860 * Backup manager behavioral parameters.
7861 * This is encoded as a key=value list, separated by commas. Ex:
7862 *
7863 * "key_value_backup_interval_milliseconds=14400000,key_value_backup_require_charging=true"
7864 *
7865 * The following keys are supported:
7866 *
7867 * <pre>
7868 * key_value_backup_interval_milliseconds (long)
7869 * key_value_backup_fuzz_milliseconds (long)
7870 * key_value_backup_require_charging (boolean)
7871 * key_value_backup_required_network_type (int)
7872 * full_backup_interval_milliseconds (long)
7873 * full_backup_require_charging (boolean)
7874 * full_backup_required_network_type (int)
Denis Kuznetsov02a1c082017-12-27 16:21:22 +01007875 * backup_finished_notification_receivers (String[])
Tim Zhengcc1e76a2017-08-30 17:46:19 -07007876 * </pre>
7877 *
Denis Kuznetsov02a1c082017-12-27 16:21:22 +01007878 * backup_finished_notification_receivers uses ":" as delimeter for values.
7879 *
Tim Zhengcc1e76a2017-08-30 17:46:19 -07007880 * <p>
7881 * Type: string
7882 * @hide
7883 */
7884 public static final String BACKUP_MANAGER_CONSTANTS = "backup_manager_constants";
7885
Bernardo Rufinoeaa78b92018-01-26 11:25:37 +00007886
7887 /**
7888 * Local transport parameters so we can configure it for tests.
7889 * This is encoded as a key=value list, separated by commas.
7890 *
7891 * The following keys are supported:
7892 *
7893 * <pre>
7894 * fake_encryption_flag (boolean)
7895 * </pre>
7896 *
7897 * <p>
7898 * Type: string
7899 * @hide
7900 */
7901 public static final String BACKUP_LOCAL_TRANSPORT_PARAMETERS =
7902 "backup_local_transport_parameters";
7903
Chad Brubaker4f28f0d2017-09-07 14:28:13 -07007904 /**
Daniel Nishi797641272018-01-02 16:48:33 -08007905 * Flag to set if the system should predictively attempt to re-enable Bluetooth while
7906 * the user is driving.
7907 * @hide
7908 */
7909 public static final String BLUETOOTH_ON_WHILE_DRIVING = "bluetooth_on_while_driving";
7910
7911 /**
Mike Digman55272862018-02-20 14:35:17 -08007912 * What behavior should be invoked when the volume hush gesture is triggered
7913 * One of VOLUME_HUSH_OFF, VOLUME_HUSH_VIBRATE, VOLUME_HUSH_MUTE.
7914 *
7915 * @hide
7916 */
7917 public static final String VOLUME_HUSH_GESTURE = "volume_hush_gesture";
7918
7919 /** @hide */ public static final int VOLUME_HUSH_OFF = 0;
7920 /** @hide */ public static final int VOLUME_HUSH_VIBRATE = 1;
7921 /** @hide */ public static final int VOLUME_HUSH_MUTE = 2;
7922
7923 private static final Validator VOLUME_HUSH_GESTURE_VALIDATOR =
7924 NON_NEGATIVE_INTEGER_VALIDATOR;
7925
7926 /**
Makoto Onuki16a0dd22018-03-20 10:40:37 -07007927 * The number of times (integer) the user has manually enabled battery saver.
7928 * @hide
7929 */
7930 public static final String LOW_POWER_MANUAL_ACTIVATION_COUNT =
7931 "low_power_manual_activation_count";
7932
7933 /**
7934 * Whether the "first time battery saver warning" dialog needs to be shown (0: default)
7935 * or not (1).
7936 *
7937 * @hide
7938 */
7939 public static final String LOW_POWER_WARNING_ACKNOWLEDGED =
7940 "low_power_warning_acknowledged";
7941
7942 /**
Makoto Onuki52c62952018-03-22 10:43:03 -07007943 * 0 (default) Auto battery saver suggestion has not been suppressed. 1) it has been
7944 * suppressed.
7945 * @hide
7946 */
7947 public static final String SUPPRESS_AUTO_BATTERY_SAVER_SUGGESTION =
7948 "suppress_auto_battery_saver_suggestion";
7949
7950 /**
Artem Iglikov5b538752018-03-27 15:12:18 +01007951 * List of packages, which data need to be unconditionally cleared before full restore.
7952 * Type: string
7953 * @hide
7954 */
7955 public static final String PACKAGES_TO_CLEAR_DATA_BEFORE_FULL_RESTORE =
7956 "packages_to_clear_data_before_full_restore";
7957
7958 /**
Svetoslav Ganova571a582011-09-20 18:32:20 -07007959 * This are the settings to be backed up.
7960 *
7961 * NOTE: Settings are backed up and restored in the order they appear
7962 * in this array. If you have one setting depending on another,
7963 * make sure that they are ordered appropriately.
7964 *
-b master501eec92009-07-06 13:53:11 -07007965 * @hide
7966 */
7967 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate58f41ec2013-01-11 15:40:36 -08007968 BUGREPORT_IN_POWER_MENU, // moved to global
Amith Yamasani8823c0a82009-07-07 14:30:17 -07007969 ALLOW_MOCK_LOCATION,
Christopher Tate66488d62012-10-02 11:58:01 -07007970 USB_MASS_STORAGE_ENABLED, // moved to global
Anna Galuszafa7786c2015-12-22 10:53:44 -08007971 ACCESSIBILITY_DISPLAY_INVERSION_ENABLED,
7972 ACCESSIBILITY_DISPLAY_DALTONIZER,
Anna Galuszafa7786c2015-12-22 10:53:44 -08007973 ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED,
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07007974 ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED,
Casey Burkhardt74922c62017-02-13 12:43:16 -08007975 ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED,
Svetoslav Ganovd8561a22017-04-25 15:26:03 -07007976 AUTOFILL_SERVICE,
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07007977 ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE,
-b master501eec92009-07-06 13:53:11 -07007978 ENABLED_ACCESSIBILITY_SERVICES,
Ruben Brunke24b9a62016-02-16 21:38:24 -08007979 ENABLED_VR_LISTENERS,
Svetoslav Ganov9a4c5cd2012-05-30 14:06:32 -07007980 TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES,
Svetoslav Ganova28a16d2011-07-28 11:24:21 -07007981 TOUCH_EXPLORATION_ENABLED,
Svetoslav Ganova571a582011-09-20 18:32:20 -07007982 ACCESSIBILITY_ENABLED,
Phil Weaver106fe732016-11-22 18:18:39 -08007983 ACCESSIBILITY_SHORTCUT_TARGET_SERVICE,
Casey Burkhardt5e8b9802017-03-24 10:07:20 -07007984 ACCESSIBILITY_BUTTON_TARGET_COMPONENT,
Phil Weaver106fe732016-11-22 18:18:39 -08007985 ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN,
Phil Weaverce687c52017-03-15 08:51:52 -07007986 ACCESSIBILITY_SHORTCUT_ENABLED,
7987 ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN,
Chris Craikcce47eb2014-07-16 15:12:15 -07007988 ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED,
Anna Galuszafa7786c2015-12-22 10:53:44 -08007989 ACCESSIBILITY_CAPTIONING_PRESET,
Alan Viveretteef793802013-07-23 14:15:28 -07007990 ACCESSIBILITY_CAPTIONING_ENABLED,
7991 ACCESSIBILITY_CAPTIONING_LOCALE,
7992 ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR,
7993 ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR,
7994 ACCESSIBILITY_CAPTIONING_EDGE_TYPE,
7995 ACCESSIBILITY_CAPTIONING_EDGE_COLOR,
7996 ACCESSIBILITY_CAPTIONING_TYPEFACE,
Alan Viverette69ce69b2013-08-29 12:23:48 -07007997 ACCESSIBILITY_CAPTIONING_FONT_SCALE,
Anna Galuszafa7786c2015-12-22 10:53:44 -08007998 ACCESSIBILITY_CAPTIONING_WINDOW_COLOR,
-b master501eec92009-07-06 13:53:11 -07007999 TTS_DEFAULT_RATE,
8000 TTS_DEFAULT_PITCH,
8001 TTS_DEFAULT_SYNTH,
Charles Chenceffa152010-03-16 21:18:10 -07008002 TTS_ENABLED_PLUGINS,
Narayan Kamath6d632962011-08-24 11:51:37 +01008003 TTS_DEFAULT_LOCALE,
Anna Galuszafa7786c2015-12-22 10:53:44 -08008004 SHOW_IME_WITH_HARD_KEYBOARD,
Christopher Tate66488d62012-10-02 11:58:01 -07008005 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, // moved to global
8006 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, // moved to global
8007 WIFI_NUM_OPEN_NETWORKS_KEPT, // moved to global
Christopher Tate06cbadd2015-03-16 18:29:42 -07008008 SELECTED_SPELL_CHECKER,
8009 SELECTED_SPELL_CHECKER_SUBTYPE,
8010 SPELL_CHECKER_ENABLED,
San Mehat87734d32010-01-08 12:53:06 -08008011 MOUNT_PLAY_NOTIFICATION_SND,
8012 MOUNT_UMS_AUTOSTART,
8013 MOUNT_UMS_PROMPT,
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07008014 MOUNT_UMS_NOTIFY_ENABLED,
Jason Monk27bbb2d2015-03-31 16:46:39 -04008015 SLEEP_TIMEOUT,
8016 DOUBLE_TAP_TO_WAKE,
Anna Galuszafa7786c2015-12-22 10:53:44 -08008017 WAKE_GESTURE_ENABLED,
8018 LONG_PRESS_TIMEOUT,
Jason Monk5a5e7d62015-08-04 11:20:25 -04008019 CAMERA_GESTURE_DISABLED,
Toni Barzic386f8342015-09-09 12:30:41 -07008020 ACCESSIBILITY_AUTOCLICK_ENABLED,
Anna Galuszafa7786c2015-12-22 10:53:44 -08008021 ACCESSIBILITY_AUTOCLICK_DELAY,
8022 ACCESSIBILITY_LARGE_POINTER_ICON,
8023 PREFERRED_TTY_MODE,
8024 ENHANCED_VOICE_PRIVACY_ENABLED,
8025 TTY_MODE_ENABLED,
Hall Liu44e41012018-04-02 15:41:07 -07008026 RTT_CALLING_MODE,
Mike Tsaofc47ba72016-07-15 09:54:07 -07008027 INCALL_POWER_BUTTON_BEHAVIOR,
8028 NIGHT_DISPLAY_CUSTOM_START_TIME,
8029 NIGHT_DISPLAY_CUSTOM_END_TIME,
Christine Franks6418d0b2017-02-13 09:48:00 -08008030 NIGHT_DISPLAY_COLOR_TEMPERATURE,
Mike Tsaofc47ba72016-07-15 09:54:07 -07008031 NIGHT_DISPLAY_AUTO_MODE,
Doris Ling5fafa3c2016-08-26 15:00:49 -07008032 SYNC_PARENT_SOUNDS,
Doris Ling8a332732016-08-24 15:05:43 -07008033 CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED,
Mehdi Alizadeh1264d882018-04-03 18:38:34 -07008034 SWIPE_UP_TO_SWITCH_APPS_ENABLED,
Doris Ling8a332732016-08-24 15:05:43 -07008035 CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED,
Jason Monkbaade752016-08-25 15:57:14 -04008036 SYSTEM_NAVIGATION_KEYS_ENABLED,
8037 QS_TILES,
Doris Ling6403b402016-09-09 14:29:19 -07008038 DOZE_ENABLED,
Lucas Dupina0c0cf72018-06-05 12:02:14 -07008039 DOZE_ALWAYS_ON,
Doris Ling6403b402016-09-09 14:29:19 -07008040 DOZE_PULSE_ON_PICK_UP,
Ruchi Kandoi104e0b42016-12-29 13:31:43 -08008041 DOZE_PULSE_ON_DOUBLE_TAP,
Daniel Nishieb70ad42017-01-27 10:51:35 -08008042 NFC_PAYMENT_DEFAULT_COMPONENT,
Philip Quinnc4cc3082017-02-13 20:18:16 -08008043 AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN,
Santos Cordon5bce4942017-02-27 11:50:18 -08008044 ASSIST_GESTURE_ENABLED,
Philip Quinn80274ca2017-03-03 10:38:38 -08008045 ASSIST_GESTURE_SENSITIVITY,
Kevin Chyn80939372017-06-09 15:40:18 -07008046 ASSIST_GESTURE_SETUP_COMPLETE,
8047 ASSIST_GESTURE_SILENCE_ALERTS_ENABLED,
8048 ASSIST_GESTURE_WAKE_ENABLED,
Chris Wren89aa2262017-05-05 18:05:56 -04008049 VR_DISPLAY_MODE,
Jason Monkcb5296a2017-06-30 10:28:18 -04008050 NOTIFICATION_BADGING,
8051 QS_AUTO_ADDED_TILES,
Jason Monkdf31eff2017-07-10 11:14:19 -04008052 SCREENSAVER_ENABLED,
8053 SCREENSAVER_COMPONENTS,
8054 SCREENSAVER_ACTIVATE_ON_DOCK,
8055 SCREENSAVER_ACTIVATE_ON_SLEEP,
Chad Brubaker4f28f0d2017-09-07 14:28:13 -07008056 LOCKDOWN_IN_POWER_MENU,
Andrew Sapperstein43643ae2017-12-20 15:17:33 -08008057 SHOW_FIRST_CRASH_DIALOG_DEV_OPTION,
Beverly38fcfd02018-05-18 17:33:40 -04008058 VOLUME_HUSH_GESTURE,
8059 MANUAL_RINGER_TOGGLE_COUNT,
8060 HUSH_GESTURE_USED,
-b master501eec92009-07-06 13:53:11 -07008061 };
8062
Michal Karpinski964943a2018-01-19 16:28:26 +00008063 /**
8064 * All settings in {@link SETTINGS_TO_BACKUP} array *must* have a non-null validator,
8065 * otherwise they won't be restored.
8066 *
8067 * @hide
8068 */
8069 public static final Map<String, Validator> VALIDATORS = new ArrayMap<>();
8070 static {
8071 VALIDATORS.put(BUGREPORT_IN_POWER_MENU, BUGREPORT_IN_POWER_MENU_VALIDATOR);
8072 VALIDATORS.put(ALLOW_MOCK_LOCATION, ALLOW_MOCK_LOCATION_VALIDATOR);
8073 VALIDATORS.put(USB_MASS_STORAGE_ENABLED, USB_MASS_STORAGE_ENABLED_VALIDATOR);
8074 VALIDATORS.put(ACCESSIBILITY_DISPLAY_INVERSION_ENABLED,
8075 ACCESSIBILITY_DISPLAY_INVERSION_ENABLED_VALIDATOR);
8076 VALIDATORS.put(ACCESSIBILITY_DISPLAY_DALTONIZER,
8077 ACCESSIBILITY_DISPLAY_DALTONIZER_VALIDATOR);
8078 VALIDATORS.put(ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED,
8079 ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED_VALIDATOR);
8080 VALIDATORS.put(ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED,
8081 ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED_VALIDATOR);
8082 VALIDATORS.put(ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED,
8083 ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED_VALIDATOR);
8084 VALIDATORS.put(AUTOFILL_SERVICE, AUTOFILL_SERVICE_VALIDATOR);
8085 VALIDATORS.put(ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE,
8086 ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE_VALIDATOR);
8087 VALIDATORS.put(ENABLED_ACCESSIBILITY_SERVICES,
8088 ENABLED_ACCESSIBILITY_SERVICES_VALIDATOR);
8089 VALIDATORS.put(ENABLED_VR_LISTENERS, ENABLED_VR_LISTENERS_VALIDATOR);
Michal Karpinski964943a2018-01-19 16:28:26 +00008090 VALIDATORS.put(TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES,
8091 TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES_VALIDATOR);
8092 VALIDATORS.put(TOUCH_EXPLORATION_ENABLED, TOUCH_EXPLORATION_ENABLED_VALIDATOR);
8093 VALIDATORS.put(ACCESSIBILITY_ENABLED, ACCESSIBILITY_ENABLED_VALIDATOR);
8094 VALIDATORS.put(ACCESSIBILITY_SHORTCUT_TARGET_SERVICE,
8095 ACCESSIBILITY_SHORTCUT_TARGET_SERVICE_VALIDATOR);
8096 VALIDATORS.put(ACCESSIBILITY_BUTTON_TARGET_COMPONENT,
8097 ACCESSIBILITY_BUTTON_TARGET_COMPONENT_VALIDATOR);
8098 VALIDATORS.put(ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN,
8099 ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN_VALIDATOR);
8100 VALIDATORS.put(ACCESSIBILITY_SHORTCUT_ENABLED,
8101 ACCESSIBILITY_SHORTCUT_ENABLED_VALIDATOR);
8102 VALIDATORS.put(ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN,
8103 ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN_VALIDATOR);
Michal Karpinski964943a2018-01-19 16:28:26 +00008104 VALIDATORS.put(ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED,
8105 ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED_VALIDATOR);
8106 VALIDATORS.put(ACCESSIBILITY_CAPTIONING_PRESET,
8107 ACCESSIBILITY_CAPTIONING_PRESET_VALIDATOR);
8108 VALIDATORS.put(ACCESSIBILITY_CAPTIONING_ENABLED,
8109 ACCESSIBILITY_CAPTIONING_ENABLED_VALIDATOR);
8110 VALIDATORS.put(ACCESSIBILITY_CAPTIONING_LOCALE,
8111 ACCESSIBILITY_CAPTIONING_LOCALE_VALIDATOR);
8112 VALIDATORS.put(ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR,
8113 ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR_VALIDATOR);
8114 VALIDATORS.put(ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR,
8115 ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR_VALIDATOR);
8116 VALIDATORS.put(ACCESSIBILITY_CAPTIONING_EDGE_TYPE,
8117 ACCESSIBILITY_CAPTIONING_EDGE_TYPE_VALIDATOR);
8118 VALIDATORS.put(ACCESSIBILITY_CAPTIONING_EDGE_COLOR,
8119 ACCESSIBILITY_CAPTIONING_EDGE_COLOR_VALIDATOR);
8120 VALIDATORS.put(ACCESSIBILITY_CAPTIONING_TYPEFACE,
8121 ACCESSIBILITY_CAPTIONING_TYPEFACE_VALIDATOR);
8122 VALIDATORS.put(ACCESSIBILITY_CAPTIONING_FONT_SCALE,
8123 ACCESSIBILITY_CAPTIONING_FONT_SCALE_VALIDATOR);
8124 VALIDATORS.put(ACCESSIBILITY_CAPTIONING_WINDOW_COLOR,
8125 ACCESSIBILITY_CAPTIONING_WINDOW_COLOR_VALIDATOR);
8126 VALIDATORS.put(TTS_DEFAULT_RATE, TTS_DEFAULT_RATE_VALIDATOR);
8127 VALIDATORS.put(TTS_DEFAULT_PITCH, TTS_DEFAULT_PITCH_VALIDATOR);
8128 VALIDATORS.put(TTS_DEFAULT_SYNTH, TTS_DEFAULT_SYNTH_VALIDATOR);
8129 VALIDATORS.put(TTS_ENABLED_PLUGINS, TTS_ENABLED_PLUGINS_VALIDATOR);
8130 VALIDATORS.put(TTS_DEFAULT_LOCALE, TTS_DEFAULT_LOCALE_VALIDATOR);
8131 VALIDATORS.put(SHOW_IME_WITH_HARD_KEYBOARD, SHOW_IME_WITH_HARD_KEYBOARD_VALIDATOR);
8132 VALIDATORS.put(WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
8133 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR);
8134 VALIDATORS.put(WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY,
8135 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_VALIDATOR);
8136 VALIDATORS.put(WIFI_NUM_OPEN_NETWORKS_KEPT, WIFI_NUM_OPEN_NETWORKS_KEPT_VALIDATOR);
8137 VALIDATORS.put(SELECTED_SPELL_CHECKER, SELECTED_SPELL_CHECKER_VALIDATOR);
8138 VALIDATORS.put(SELECTED_SPELL_CHECKER_SUBTYPE,
8139 SELECTED_SPELL_CHECKER_SUBTYPE_VALIDATOR);
8140 VALIDATORS.put(SPELL_CHECKER_ENABLED, SPELL_CHECKER_ENABLED_VALIDATOR);
8141 VALIDATORS.put(MOUNT_PLAY_NOTIFICATION_SND, MOUNT_PLAY_NOTIFICATION_SND_VALIDATOR);
8142 VALIDATORS.put(MOUNT_UMS_AUTOSTART, MOUNT_UMS_AUTOSTART_VALIDATOR);
8143 VALIDATORS.put(MOUNT_UMS_PROMPT, MOUNT_UMS_PROMPT_VALIDATOR);
8144 VALIDATORS.put(MOUNT_UMS_NOTIFY_ENABLED, MOUNT_UMS_NOTIFY_ENABLED_VALIDATOR);
8145 VALIDATORS.put(SLEEP_TIMEOUT, SLEEP_TIMEOUT_VALIDATOR);
8146 VALIDATORS.put(DOUBLE_TAP_TO_WAKE, DOUBLE_TAP_TO_WAKE_VALIDATOR);
8147 VALIDATORS.put(WAKE_GESTURE_ENABLED, WAKE_GESTURE_ENABLED_VALIDATOR);
8148 VALIDATORS.put(LONG_PRESS_TIMEOUT, LONG_PRESS_TIMEOUT_VALIDATOR);
8149 VALIDATORS.put(CAMERA_GESTURE_DISABLED, CAMERA_GESTURE_DISABLED_VALIDATOR);
8150 VALIDATORS.put(ACCESSIBILITY_AUTOCLICK_ENABLED,
8151 ACCESSIBILITY_AUTOCLICK_ENABLED_VALIDATOR);
8152 VALIDATORS.put(ACCESSIBILITY_AUTOCLICK_DELAY, ACCESSIBILITY_AUTOCLICK_DELAY_VALIDATOR);
8153 VALIDATORS.put(ACCESSIBILITY_LARGE_POINTER_ICON,
8154 ACCESSIBILITY_LARGE_POINTER_ICON_VALIDATOR);
8155 VALIDATORS.put(PREFERRED_TTY_MODE, PREFERRED_TTY_MODE_VALIDATOR);
8156 VALIDATORS.put(ENHANCED_VOICE_PRIVACY_ENABLED,
8157 ENHANCED_VOICE_PRIVACY_ENABLED_VALIDATOR);
8158 VALIDATORS.put(TTY_MODE_ENABLED, TTY_MODE_ENABLED_VALIDATOR);
Hall Liu44e41012018-04-02 15:41:07 -07008159 VALIDATORS.put(RTT_CALLING_MODE, RTT_CALLING_MODE_VALIDATOR);
Michal Karpinski964943a2018-01-19 16:28:26 +00008160 VALIDATORS.put(INCALL_POWER_BUTTON_BEHAVIOR, INCALL_POWER_BUTTON_BEHAVIOR_VALIDATOR);
8161 VALIDATORS.put(NIGHT_DISPLAY_CUSTOM_START_TIME,
8162 NIGHT_DISPLAY_CUSTOM_START_TIME_VALIDATOR);
8163 VALIDATORS.put(NIGHT_DISPLAY_CUSTOM_END_TIME, NIGHT_DISPLAY_CUSTOM_END_TIME_VALIDATOR);
8164 VALIDATORS.put(NIGHT_DISPLAY_COLOR_TEMPERATURE,
8165 NIGHT_DISPLAY_COLOR_TEMPERATURE_VALIDATOR);
8166 VALIDATORS.put(NIGHT_DISPLAY_AUTO_MODE, NIGHT_DISPLAY_AUTO_MODE_VALIDATOR);
8167 VALIDATORS.put(SYNC_PARENT_SOUNDS, SYNC_PARENT_SOUNDS_VALIDATOR);
8168 VALIDATORS.put(CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED,
8169 CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED_VALIDATOR);
Mehdi Alizadeh1264d882018-04-03 18:38:34 -07008170 VALIDATORS.put(SWIPE_UP_TO_SWITCH_APPS_ENABLED,
8171 SWIPE_UP_TO_SWITCH_APPS_ENABLED_VALIDATOR);
Michal Karpinski964943a2018-01-19 16:28:26 +00008172 VALIDATORS.put(CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED,
8173 CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED_VALIDATOR);
8174 VALIDATORS.put(SYSTEM_NAVIGATION_KEYS_ENABLED,
8175 SYSTEM_NAVIGATION_KEYS_ENABLED_VALIDATOR);
8176 VALIDATORS.put(QS_TILES, QS_TILES_VALIDATOR);
8177 VALIDATORS.put(DOZE_ENABLED, DOZE_ENABLED_VALIDATOR);
Lucas Dupina0c0cf72018-06-05 12:02:14 -07008178 VALIDATORS.put(DOZE_ALWAYS_ON, DOZE_ALWAYS_ON_VALIDATOR);
Michal Karpinski964943a2018-01-19 16:28:26 +00008179 VALIDATORS.put(DOZE_PULSE_ON_PICK_UP, DOZE_PULSE_ON_PICK_UP_VALIDATOR);
8180 VALIDATORS.put(DOZE_PULSE_ON_DOUBLE_TAP, DOZE_PULSE_ON_DOUBLE_TAP_VALIDATOR);
8181 VALIDATORS.put(NFC_PAYMENT_DEFAULT_COMPONENT, NFC_PAYMENT_DEFAULT_COMPONENT_VALIDATOR);
8182 VALIDATORS.put(AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN,
8183 AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN_VALIDATOR);
8184 VALIDATORS.put(ASSIST_GESTURE_ENABLED, ASSIST_GESTURE_ENABLED_VALIDATOR);
8185 VALIDATORS.put(ASSIST_GESTURE_SENSITIVITY, ASSIST_GESTURE_SENSITIVITY_VALIDATOR);
8186 VALIDATORS.put(ASSIST_GESTURE_SETUP_COMPLETE, ASSIST_GESTURE_SETUP_COMPLETE_VALIDATOR);
8187 VALIDATORS.put(ASSIST_GESTURE_SILENCE_ALERTS_ENABLED,
8188 ASSIST_GESTURE_SILENCE_ALERTS_ENABLED_VALIDATOR);
8189 VALIDATORS.put(ASSIST_GESTURE_WAKE_ENABLED, ASSIST_GESTURE_WAKE_ENABLED_VALIDATOR);
8190 VALIDATORS.put(VR_DISPLAY_MODE, VR_DISPLAY_MODE_VALIDATOR);
8191 VALIDATORS.put(NOTIFICATION_BADGING, NOTIFICATION_BADGING_VALIDATOR);
8192 VALIDATORS.put(QS_AUTO_ADDED_TILES, QS_AUTO_ADDED_TILES_VALIDATOR);
8193 VALIDATORS.put(SCREENSAVER_ENABLED, SCREENSAVER_ENABLED_VALIDATOR);
8194 VALIDATORS.put(SCREENSAVER_COMPONENTS, SCREENSAVER_COMPONENTS_VALIDATOR);
8195 VALIDATORS.put(SCREENSAVER_ACTIVATE_ON_DOCK, SCREENSAVER_ACTIVATE_ON_DOCK_VALIDATOR);
8196 VALIDATORS.put(SCREENSAVER_ACTIVATE_ON_SLEEP, SCREENSAVER_ACTIVATE_ON_SLEEP_VALIDATOR);
8197 VALIDATORS.put(LOCKDOWN_IN_POWER_MENU, LOCKDOWN_IN_POWER_MENU_VALIDATOR);
8198 VALIDATORS.put(SHOW_FIRST_CRASH_DIALOG_DEV_OPTION,
8199 SHOW_FIRST_CRASH_DIALOG_DEV_OPTION_VALIDATOR);
Mike Digman55272862018-02-20 14:35:17 -08008200 VALIDATORS.put(VOLUME_HUSH_GESTURE, VOLUME_HUSH_GESTURE_VALIDATOR);
Michal Karpinski964943a2018-01-19 16:28:26 +00008201 VALIDATORS.put(ENABLED_NOTIFICATION_LISTENERS,
8202 ENABLED_NOTIFICATION_LISTENERS_VALIDATOR); //legacy restore setting
8203 VALIDATORS.put(ENABLED_NOTIFICATION_ASSISTANT,
8204 ENABLED_NOTIFICATION_ASSISTANT_VALIDATOR); //legacy restore setting
8205 VALIDATORS.put(ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES,
8206 ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES_VALIDATOR); //legacy restore setting
Beverly38fcfd02018-05-18 17:33:40 -04008207 VALIDATORS.put(HUSH_GESTURE_USED, HUSH_GESTURE_USED_VALIDATOR);
8208 VALIDATORS.put(MANUAL_RINGER_TOGGLE_COUNT, MANUAL_RINGER_TOGGLE_COUNT_VALIDATOR);
Michal Karpinski964943a2018-01-19 16:28:26 +00008209 }
8210
8211 /**
8212 * Keys we no longer back up under the current schema, but want to continue to
8213 * process when restoring historical backup datasets.
8214 *
8215 * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator,
8216 * otherwise they won't be restored.
8217 *
8218 * @hide
8219 */
Christopher Tate1d0fca32017-06-06 13:30:00 -07008220 public static final String[] LEGACY_RESTORE_SETTINGS = {
Julia Reynoldsb852e562017-06-06 16:14:18 -04008221 ENABLED_NOTIFICATION_LISTENERS,
8222 ENABLED_NOTIFICATION_ASSISTANT,
8223 ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES
Christopher Tate1d0fca32017-06-06 13:30:00 -07008224 };
8225
-b master501eec92009-07-06 13:53:11 -07008226 /**
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07008227 * These entries are considered common between the personal and the managed profile,
8228 * since the managed profile doesn't get to change them.
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07008229 */
Svetoslav683914b2015-01-15 14:22:26 -08008230 private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>();
Amith Yamasanib0ff3222015-03-04 09:56:14 -08008231
Svetoslav683914b2015-01-15 14:22:26 -08008232 static {
8233 CLONE_TO_MANAGED_PROFILE.add(ACCESSIBILITY_ENABLED);
8234 CLONE_TO_MANAGED_PROFILE.add(ALLOW_MOCK_LOCATION);
8235 CLONE_TO_MANAGED_PROFILE.add(ALLOWED_GEOLOCATION_ORIGINS);
Felipe Lemeaa008962017-04-18 14:54:33 -07008236 CLONE_TO_MANAGED_PROFILE.add(AUTOFILL_SERVICE);
Svetoslav683914b2015-01-15 14:22:26 -08008237 CLONE_TO_MANAGED_PROFILE.add(DEFAULT_INPUT_METHOD);
8238 CLONE_TO_MANAGED_PROFILE.add(ENABLED_ACCESSIBILITY_SERVICES);
8239 CLONE_TO_MANAGED_PROFILE.add(ENABLED_INPUT_METHODS);
Lifu Tang0cba58f2018-01-23 21:14:15 -08008240 CLONE_TO_MANAGED_PROFILE.add(LOCATION_CHANGER);
Svetoslav683914b2015-01-15 14:22:26 -08008241 CLONE_TO_MANAGED_PROFILE.add(LOCATION_MODE);
8242 CLONE_TO_MANAGED_PROFILE.add(LOCATION_PROVIDERS_ALLOWED);
Svetoslav683914b2015-01-15 14:22:26 -08008243 CLONE_TO_MANAGED_PROFILE.add(SELECTED_INPUT_METHOD_SUBTYPE);
Yohei Yukawa3f8c5682018-03-01 13:10:23 -08008244 if (TextServicesManager.DISABLE_PER_PROFILE_SPELL_CHECKER) {
8245 CLONE_TO_MANAGED_PROFILE.add(SELECTED_SPELL_CHECKER);
8246 CLONE_TO_MANAGED_PROFILE.add(SELECTED_SPELL_CHECKER_SUBTYPE);
8247 }
Svetoslav683914b2015-01-15 14:22:26 -08008248 }
8249
8250 /** @hide */
8251 public static void getCloneToManagedProfileSettings(Set<String> outKeySet) {
8252 outKeySet.addAll(CLONE_TO_MANAGED_PROFILE);
8253 }
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07008254
8255 /**
Todd Kennedybe0b8892017-02-15 14:13:52 -08008256 * Secure settings which can be accessed by instant apps.
Chad Brubaker97bccee2017-01-05 15:51:41 -08008257 * @hide
8258 */
Todd Kennedybe0b8892017-02-15 14:13:52 -08008259 public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>();
Chad Brubaker97bccee2017-01-05 15:51:41 -08008260 static {
Todd Kennedybe0b8892017-02-15 14:13:52 -08008261 INSTANT_APP_SETTINGS.add(ENABLED_ACCESSIBILITY_SERVICES);
8262 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_SPEAK_PASSWORD);
8263 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_INVERSION_ENABLED);
Chad Brubaker9408d512017-03-28 16:11:38 -07008264 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_ENABLED);
8265 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_PRESET);
8266 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_EDGE_TYPE);
8267 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_EDGE_COLOR);
8268 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_LOCALE);
8269 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR);
8270 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR);
8271 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_TYPEFACE);
8272 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_FONT_SCALE);
Chad Brubakerd9285b52017-04-27 15:28:57 -07008273 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_WINDOW_COLOR);
8274 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED);
8275 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_DALTONIZER);
8276 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_AUTOCLICK_DELAY);
8277 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_AUTOCLICK_ENABLED);
8278 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_LARGE_POINTER_ICON);
Chad Brubaker97bccee2017-01-05 15:51:41 -08008279
Todd Kennedybe0b8892017-02-15 14:13:52 -08008280 INSTANT_APP_SETTINGS.add(DEFAULT_INPUT_METHOD);
8281 INSTANT_APP_SETTINGS.add(ENABLED_INPUT_METHODS);
Chad Brubaker1bed9372017-03-20 10:52:52 -07008282
8283 INSTANT_APP_SETTINGS.add(ANDROID_ID);
Chad Brubaker8d7b36f2017-04-06 22:57:18 -07008284
8285 INSTANT_APP_SETTINGS.add(PACKAGE_VERIFIER_USER_CONSENT);
Chad Brubaker562afaf2017-04-10 13:32:37 -07008286 INSTANT_APP_SETTINGS.add(ALLOW_MOCK_LOCATION);
Chad Brubaker97bccee2017-01-05 15:51:41 -08008287 }
8288
8289 /**
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07008290 * Helper method for determining if a location provider is enabled.
Tom O'Neilld5759432013-09-11 11:03:03 -07008291 *
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07008292 * @param cr the content resolver to use
8293 * @param provider the location provider to query
8294 * @return true if the provider is enabled
Tom O'Neilld5759432013-09-11 11:03:03 -07008295 *
Maggieaa080f92018-01-04 15:35:11 -08008296 * @deprecated use {@link LocationManager#isProviderEnabled(String)}
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07008297 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07008298 @Deprecated
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07008299 public static final boolean isLocationProviderEnabled(ContentResolver cr, String provider) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07008300 return isLocationProviderEnabledForUser(cr, provider, cr.getUserId());
Victoria Leaseb711d572012-10-02 13:14:11 -07008301 }
8302
8303 /**
8304 * Helper method for determining if a location provider is enabled.
8305 * @param cr the content resolver to use
8306 * @param provider the location provider to query
8307 * @param userId the userId to query
8308 * @return true if the provider is enabled
Maggieaa080f92018-01-04 15:35:11 -08008309 *
8310 * @deprecated use {@link LocationManager#isProviderEnabled(String)}
Victoria Leaseb711d572012-10-02 13:14:11 -07008311 * @hide
8312 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07008313 @Deprecated
Maggieaa080f92018-01-04 15:35:11 -08008314 public static final boolean isLocationProviderEnabledForUser(
8315 ContentResolver cr, String provider, int userId) {
Victoria Leaseb711d572012-10-02 13:14:11 -07008316 String allowedProviders = Settings.Secure.getStringForUser(cr,
8317 LOCATION_PROVIDERS_ALLOWED, userId);
Brad Fitzpatrick11fe1812010-09-10 16:07:52 -07008318 return TextUtils.delimitedStringContains(allowedProviders, ',', provider);
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07008319 }
8320
8321 /**
8322 * Thread-safe method for enabling or disabling a single location provider.
8323 * @param cr the content resolver to use
8324 * @param provider the location provider to enable or disable
8325 * @param enabled true if the provider should be enabled
Maggieaa080f92018-01-04 15:35:11 -08008326 * @deprecated This API is deprecated. It requires WRITE_SECURE_SETTINGS permission to
8327 * change location settings.
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07008328 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07008329 @Deprecated
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07008330 public static final void setLocationProviderEnabled(ContentResolver cr,
8331 String provider, boolean enabled) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07008332 setLocationProviderEnabledForUser(cr, provider, enabled, cr.getUserId());
Victoria Leaseb711d572012-10-02 13:14:11 -07008333 }
8334
8335 /**
8336 * Thread-safe method for enabling or disabling a single location provider.
Tom O'Neilla324ac72013-08-26 14:40:23 -07008337 *
Victoria Leaseb711d572012-10-02 13:14:11 -07008338 * @param cr the content resolver to use
8339 * @param provider the location provider to enable or disable
8340 * @param enabled true if the provider should be enabled
8341 * @param userId the userId for which to enable/disable providers
Tom O'Neilla324ac72013-08-26 14:40:23 -07008342 * @return true if the value was set, false on database errors
Maggieaa080f92018-01-04 15:35:11 -08008343 *
8344 * @deprecated use {@link LocationManager#setProviderEnabledForUser(String, boolean, int)}
Victoria Leaseb711d572012-10-02 13:14:11 -07008345 * @hide
8346 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07008347 @Deprecated
Tom O'Neilla324ac72013-08-26 14:40:23 -07008348 public static final boolean setLocationProviderEnabledForUser(ContentResolver cr,
Victoria Leaseb711d572012-10-02 13:14:11 -07008349 String provider, boolean enabled, int userId) {
David Christie3f7b6522013-08-06 19:19:08 -07008350 synchronized (mLocationSettingsLock) {
8351 // to ensure thread safety, we write the provider name with a '+' or '-'
8352 // and let the SettingsProvider handle it rather than reading and modifying
8353 // the list of enabled providers.
8354 if (enabled) {
8355 provider = "+" + provider;
8356 } else {
8357 provider = "-" + provider;
8358 }
Tom O'Neilla324ac72013-08-26 14:40:23 -07008359 return putStringForUser(cr, Settings.Secure.LOCATION_PROVIDERS_ALLOWED, provider,
David Christie3f7b6522013-08-06 19:19:08 -07008360 userId);
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07008361 }
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07008362 }
Tom O'Neill1f48b782013-08-19 18:14:56 -07008363
8364 /**
8365 * Thread-safe method for setting the location mode to one of
8366 * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY},
8367 * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}.
Tom O'Neill87c7fad2016-08-04 08:16:12 -07008368 * Necessary because the mode is a composite of the underlying location provider
8369 * settings.
Tom O'Neill1f48b782013-08-19 18:14:56 -07008370 *
Tom O'Neill1f48b782013-08-19 18:14:56 -07008371 * @param cr the content resolver to use
8372 * @param mode such as {@link #LOCATION_MODE_HIGH_ACCURACY}
8373 * @param userId the userId for which to change mode
Tom O'Neilla324ac72013-08-26 14:40:23 -07008374 * @return true if the value was set, false on database errors
Tom O'Neill1f48b782013-08-19 18:14:56 -07008375 *
8376 * @throws IllegalArgumentException if mode is not one of the supported values
Maggieaa080f92018-01-04 15:35:11 -08008377 *
8378 * @deprecated To enable/disable location, use
8379 * {@link LocationManager#setLocationEnabledForUser(boolean, int)}.
8380 * To enable/disable a specific location provider, use
8381 * {@link LocationManager#setProviderEnabledForUser(String, boolean, int)}.
Tom O'Neill1f48b782013-08-19 18:14:56 -07008382 */
Maggieaa080f92018-01-04 15:35:11 -08008383 @Deprecated
8384 private static boolean setLocationModeForUser(
8385 ContentResolver cr, int mode, int userId) {
Tom O'Neill1f48b782013-08-19 18:14:56 -07008386 synchronized (mLocationSettingsLock) {
8387 boolean gps = false;
8388 boolean network = false;
8389 switch (mode) {
8390 case LOCATION_MODE_OFF:
8391 break;
8392 case LOCATION_MODE_SENSORS_ONLY:
8393 gps = true;
8394 break;
8395 case LOCATION_MODE_BATTERY_SAVING:
8396 network = true;
8397 break;
8398 case LOCATION_MODE_HIGH_ACCURACY:
8399 gps = true;
8400 network = true;
8401 break;
8402 default:
8403 throw new IllegalArgumentException("Invalid location mode: " + mode);
8404 }
Maggieaa080f92018-01-04 15:35:11 -08008405
Tom O'Neilla324ac72013-08-26 14:40:23 -07008406 boolean nlpSuccess = Settings.Secure.setLocationProviderEnabledForUser(
Tom O'Neill1f48b782013-08-19 18:14:56 -07008407 cr, LocationManager.NETWORK_PROVIDER, network, userId);
Tom O'Neill7731a992014-10-09 11:30:49 -07008408 boolean gpsSuccess = Settings.Secure.setLocationProviderEnabledForUser(
8409 cr, LocationManager.GPS_PROVIDER, gps, userId);
Tom O'Neilla324ac72013-08-26 14:40:23 -07008410 return gpsSuccess && nlpSuccess;
Tom O'Neill1f48b782013-08-19 18:14:56 -07008411 }
8412 }
8413
8414 /**
Tom O'Neill1f48b782013-08-19 18:14:56 -07008415 * Thread-safe method for reading the location mode, returns one of
8416 * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY},
Tom O'Neill87c7fad2016-08-04 08:16:12 -07008417 * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}. Necessary
8418 * because the mode is a composite of the underlying location provider settings.
Tom O'Neill1f48b782013-08-19 18:14:56 -07008419 *
8420 * @param cr the content resolver to use
8421 * @param userId the userId for which to read the mode
8422 * @return the location mode
8423 */
Tom O'Neill7f6f4572013-08-27 10:53:15 -07008424 private static final int getLocationModeForUser(ContentResolver cr, int userId) {
Tom O'Neill1f48b782013-08-19 18:14:56 -07008425 synchronized (mLocationSettingsLock) {
8426 boolean gpsEnabled = Settings.Secure.isLocationProviderEnabledForUser(
8427 cr, LocationManager.GPS_PROVIDER, userId);
8428 boolean networkEnabled = Settings.Secure.isLocationProviderEnabledForUser(
8429 cr, LocationManager.NETWORK_PROVIDER, userId);
8430 if (gpsEnabled && networkEnabled) {
8431 return LOCATION_MODE_HIGH_ACCURACY;
8432 } else if (gpsEnabled) {
8433 return LOCATION_MODE_SENSORS_ONLY;
8434 } else if (networkEnabled) {
8435 return LOCATION_MODE_BATTERY_SAVING;
8436 } else {
8437 return LOCATION_MODE_OFF;
8438 }
8439 }
8440 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008441 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07008442
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008443 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008444 * Global system settings, containing preferences that always apply identically
8445 * to all defined users. Applications can read these but are not allowed to write;
8446 * like the "Secure" settings, these are for preferences that the user must
8447 * explicitly modify through the system UI or specialized APIs for those values.
8448 */
8449 public static final class Global extends NameValueTable {
Kweku Adamsb0886f32017-10-31 15:32:09 -07008450 // NOTE: If you add new settings here, be sure to add them to
8451 // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoGlobalSettingsLocked.
8452
Christopher Tate06efb532012-08-24 15:29:27 -07008453 /**
8454 * The content:// style URL for global secure settings items. Not public.
8455 */
8456 public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/global");
8457
8458 /**
Amith Yamasani23a0f052014-07-25 12:26:53 -07008459 * Whether users are allowed to add more users or guest from lockscreen.
8460 * <p>
8461 * Type: int
8462 * @hide
8463 */
8464 public static final String ADD_USERS_WHEN_LOCKED = "add_users_when_locked";
8465
8466 /**
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07008467 * Setting whether the global gesture for enabling accessibility is enabled.
8468 * If this gesture is enabled the user will be able to perfrom it to enable
8469 * the accessibility state without visiting the settings app.
Phil Weaver106fe732016-11-22 18:18:39 -08008470 *
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07008471 * @hide
Phil Weaver106fe732016-11-22 18:18:39 -08008472 * No longer used. Should be removed once all dependencies have been updated.
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07008473 */
8474 public static final String ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED =
8475 "enable_accessibility_global_gesture_enabled";
8476
8477 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008478 * Whether Airplane Mode is on.
8479 */
8480 public static final String AIRPLANE_MODE_ON = "airplane_mode_on";
8481
8482 /**
Bryce Lee584a4452014-10-21 15:55:55 -07008483 * Whether Theater Mode is on.
8484 * {@hide}
8485 */
Bryce Leecdfebd62015-02-02 08:19:11 -08008486 @SystemApi
Bryce Lee584a4452014-10-21 15:55:55 -07008487 public static final String THEATER_MODE_ON = "theater_mode_on";
8488
8489 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008490 * Constant for use in AIRPLANE_MODE_RADIOS to specify Bluetooth radio.
8491 */
8492 public static final String RADIO_BLUETOOTH = "bluetooth";
8493
8494 /**
8495 * Constant for use in AIRPLANE_MODE_RADIOS to specify Wi-Fi radio.
8496 */
8497 public static final String RADIO_WIFI = "wifi";
8498
8499 /**
8500 * {@hide}
8501 */
8502 public static final String RADIO_WIMAX = "wimax";
8503 /**
8504 * Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio.
8505 */
8506 public static final String RADIO_CELL = "cell";
8507
8508 /**
8509 * Constant for use in AIRPLANE_MODE_RADIOS to specify NFC radio.
8510 */
8511 public static final String RADIO_NFC = "nfc";
8512
8513 /**
8514 * A comma separated list of radios that need to be disabled when airplane mode
8515 * is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are
8516 * included in the comma separated list.
8517 */
8518 public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios";
8519
8520 /**
8521 * A comma separated list of radios that should to be disabled when airplane mode
8522 * is on, but can be manually reenabled by the user. For example, if RADIO_WIFI is
8523 * added to both AIRPLANE_MODE_RADIOS and AIRPLANE_MODE_TOGGLEABLE_RADIOS, then Wifi
8524 * will be turned off when entering airplane mode, but the user will be able to reenable
8525 * Wifi in the Settings app.
8526 *
8527 * {@hide}
8528 */
8529 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios";
8530
8531 /**
Pulkit Bhuwalka547853d2017-09-25 17:55:12 -07008532 * An integer representing the Bluetooth Class of Device (CoD).
8533 *
8534 * @hide
8535 */
8536 public static final String BLUETOOTH_CLASS_OF_DEVICE = "bluetooth_class_of_device";
8537
8538 /**
Bryce Leeec85f342015-12-16 13:32:28 -08008539 * A Long representing a bitmap of profiles that should be disabled when bluetooth starts.
8540 * See {@link android.bluetooth.BluetoothProfile}.
8541 * {@hide}
8542 */
8543 public static final String BLUETOOTH_DISABLED_PROFILES = "bluetooth_disabled_profiles";
8544
8545 /**
Andre Eisenbach82a94d92016-01-14 14:20:34 -08008546 * A semi-colon separated list of Bluetooth interoperability workarounds.
8547 * Each entry is a partial Bluetooth device address string and an integer representing
8548 * the feature to be disabled, separated by a comma. The integer must correspond
8549 * to a interoperability feature as defined in "interop.h" in /system/bt.
8550 * <p>
8551 * Example: <br/>
8552 * "00:11:22,0;01:02:03:04,2"
8553 * @hide
8554 */
8555 public static final String BLUETOOTH_INTEROPERABILITY_LIST = "bluetooth_interoperability_list";
8556
8557 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008558 * The policy for deciding when Wi-Fi should go to sleep (which will in
8559 * turn switch to using the mobile data as an Internet connection).
8560 * <p>
8561 * Set to one of {@link #WIFI_SLEEP_POLICY_DEFAULT},
8562 * {@link #WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED}, or
8563 * {@link #WIFI_SLEEP_POLICY_NEVER}.
8564 */
8565 public static final String WIFI_SLEEP_POLICY = "wifi_sleep_policy";
8566
8567 /**
8568 * Value for {@link #WIFI_SLEEP_POLICY} to use the default Wi-Fi sleep
8569 * policy, which is to sleep shortly after the turning off
8570 * according to the {@link #STAY_ON_WHILE_PLUGGED_IN} setting.
8571 */
8572 public static final int WIFI_SLEEP_POLICY_DEFAULT = 0;
8573
8574 /**
8575 * Value for {@link #WIFI_SLEEP_POLICY} to use the default policy when
8576 * the device is on battery, and never go to sleep when the device is
8577 * plugged in.
8578 */
8579 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1;
8580
8581 /**
8582 * Value for {@link #WIFI_SLEEP_POLICY} to never go to sleep.
8583 */
8584 public static final int WIFI_SLEEP_POLICY_NEVER = 2;
8585
8586 /**
8587 * Value to specify if the user prefers the date, time and time zone
8588 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
8589 */
8590 public static final String AUTO_TIME = "auto_time";
8591
Michal Karpinski2c37b082018-01-18 16:14:27 +00008592 private static final Validator AUTO_TIME_VALIDATOR = BOOLEAN_VALIDATOR;
8593
Christopher Tate06efb532012-08-24 15:29:27 -07008594 /**
8595 * Value to specify if the user prefers the time zone
8596 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
8597 */
8598 public static final String AUTO_TIME_ZONE = "auto_time_zone";
8599
Michal Karpinski2c37b082018-01-18 16:14:27 +00008600 private static final Validator AUTO_TIME_ZONE_VALIDATOR = BOOLEAN_VALIDATOR;
8601
Christopher Tate06efb532012-08-24 15:29:27 -07008602 /**
8603 * URI for the car dock "in" event sound.
8604 * @hide
8605 */
8606 public static final String CAR_DOCK_SOUND = "car_dock_sound";
8607
8608 /**
8609 * URI for the car dock "out" event sound.
8610 * @hide
8611 */
8612 public static final String CAR_UNDOCK_SOUND = "car_undock_sound";
8613
8614 /**
8615 * URI for the desk dock "in" event sound.
8616 * @hide
8617 */
8618 public static final String DESK_DOCK_SOUND = "desk_dock_sound";
8619
8620 /**
8621 * URI for the desk dock "out" event sound.
8622 * @hide
8623 */
8624 public static final String DESK_UNDOCK_SOUND = "desk_undock_sound";
8625
8626 /**
8627 * Whether to play a sound for dock events.
8628 * @hide
8629 */
8630 public static final String DOCK_SOUNDS_ENABLED = "dock_sounds_enabled";
8631
Michal Karpinski2c37b082018-01-18 16:14:27 +00008632 private static final Validator DOCK_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
8633
Christopher Tate06efb532012-08-24 15:29:27 -07008634 /**
Vinod Krishnancf11cea2016-10-20 22:57:02 -07008635 * Whether to play a sound for dock events, only when an accessibility service is on.
8636 * @hide
8637 */
8638 public static final String DOCK_SOUNDS_ENABLED_WHEN_ACCESSIBILITY = "dock_sounds_enabled_when_accessbility";
8639
8640 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008641 * URI for the "device locked" (keyguard shown) sound.
8642 * @hide
8643 */
8644 public static final String LOCK_SOUND = "lock_sound";
8645
8646 /**
8647 * URI for the "device unlocked" sound.
8648 * @hide
8649 */
8650 public static final String UNLOCK_SOUND = "unlock_sound";
8651
8652 /**
Adrian Roos49e057d2014-08-13 17:14:51 +02008653 * URI for the "device is trusted" sound, which is played when the device enters the trusted
8654 * state without unlocking.
8655 * @hide
8656 */
8657 public static final String TRUSTED_SOUND = "trusted_sound";
8658
8659 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008660 * URI for the low battery sound file.
8661 * @hide
8662 */
8663 public static final String LOW_BATTERY_SOUND = "low_battery_sound";
8664
8665 /**
8666 * Whether to play a sound for low-battery alerts.
8667 * @hide
8668 */
8669 public static final String POWER_SOUNDS_ENABLED = "power_sounds_enabled";
8670
Michal Karpinski2c37b082018-01-18 16:14:27 +00008671 private static final Validator POWER_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
8672
Christopher Tate06efb532012-08-24 15:29:27 -07008673 /**
Beverlyc1313eb2018-01-31 18:07:21 -05008674 * URI for the "wireless charging started" and "wired charging started" sound.
Jeff Brown84e27562012-12-07 13:56:34 -08008675 * @hide
8676 */
Beverlyc1313eb2018-01-31 18:07:21 -05008677 public static final String CHARGING_STARTED_SOUND =
Jeff Brown84e27562012-12-07 13:56:34 -08008678 "wireless_charging_started_sound";
8679
8680 /**
John Spurlock51a871d2015-05-06 17:41:30 -04008681 * Whether to play a sound for charging events.
8682 * @hide
8683 */
8684 public static final String CHARGING_SOUNDS_ENABLED = "charging_sounds_enabled";
8685
Michal Karpinski5db1e432018-01-18 20:10:24 +00008686 private static final Validator CHARGING_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
8687
John Spurlock51a871d2015-05-06 17:41:30 -04008688 /**
Beverly69721d62018-05-09 17:41:44 -04008689 * Whether to vibrate for wireless charging events.
8690 * @hide
8691 */
8692 public static final String CHARGING_VIBRATION_ENABLED = "charging_vibration_enabled";
8693
8694 private static final Validator CHARGING_VIBRATION_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
8695
8696 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008697 * Whether we keep the device on while the device is plugged in.
8698 * Supported values are:
8699 * <ul>
8700 * <li>{@code 0} to never stay on while plugged in</li>
8701 * <li>{@link BatteryManager#BATTERY_PLUGGED_AC} to stay on for AC charger</li>
8702 * <li>{@link BatteryManager#BATTERY_PLUGGED_USB} to stay on for USB charger</li>
8703 * <li>{@link BatteryManager#BATTERY_PLUGGED_WIRELESS} to stay on for wireless charger</li>
8704 * </ul>
8705 * These values can be OR-ed together.
8706 */
8707 public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in";
8708
Michal Karpinski2c37b082018-01-18 16:14:27 +00008709 private static final Validator STAY_ON_WHILE_PLUGGED_IN_VALIDATOR = new Validator() {
8710 @Override
Annie Mengeed1b812018-05-21 16:34:52 +01008711 public boolean validate(@Nullable String value) {
Michal Karpinski2c37b082018-01-18 16:14:27 +00008712 try {
8713 int val = Integer.parseInt(value);
8714 return (val == 0)
8715 || (val == BatteryManager.BATTERY_PLUGGED_AC)
8716 || (val == BatteryManager.BATTERY_PLUGGED_USB)
8717 || (val == BatteryManager.BATTERY_PLUGGED_WIRELESS)
8718 || (val == (BatteryManager.BATTERY_PLUGGED_AC
8719 | BatteryManager.BATTERY_PLUGGED_USB))
8720 || (val == (BatteryManager.BATTERY_PLUGGED_AC
8721 | BatteryManager.BATTERY_PLUGGED_WIRELESS))
8722 || (val == (BatteryManager.BATTERY_PLUGGED_USB
8723 | BatteryManager.BATTERY_PLUGGED_WIRELESS))
8724 || (val == (BatteryManager.BATTERY_PLUGGED_AC
8725 | BatteryManager.BATTERY_PLUGGED_USB
8726 | BatteryManager.BATTERY_PLUGGED_WIRELESS));
8727 } catch (NumberFormatException e) {
8728 return false;
8729 }
8730 }
8731 };
8732
Christopher Tate06efb532012-08-24 15:29:27 -07008733 /**
Christopher Tate58f41ec2013-01-11 15:40:36 -08008734 * When the user has enable the option to have a "bug report" command
8735 * in the power menu.
8736 * @hide
8737 */
8738 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
8739
Michal Karpinski5db1e432018-01-18 20:10:24 +00008740 private static final Validator BUGREPORT_IN_POWER_MENU_VALIDATOR = BOOLEAN_VALIDATOR;
8741
Christopher Tate58f41ec2013-01-11 15:40:36 -08008742 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008743 * Whether ADB is enabled.
8744 */
8745 public static final String ADB_ENABLED = "adb_enabled";
8746
8747 /**
Jon Miranda836c0a82014-08-11 12:32:26 -07008748 * Whether Views are allowed to save their attribute data.
8749 * @hide
8750 */
8751 public static final String DEBUG_VIEW_ATTRIBUTES = "debug_view_attributes";
8752
8753 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008754 * Whether assisted GPS should be enabled or not.
8755 * @hide
8756 */
8757 public static final String ASSISTED_GPS_ENABLED = "assisted_gps_enabled";
8758
8759 /**
8760 * Whether bluetooth is enabled/disabled
8761 * 0=disabled. 1=enabled.
8762 */
8763 public static final String BLUETOOTH_ON = "bluetooth_on";
8764
Michal Karpinski5db1e432018-01-18 20:10:24 +00008765 private static final Validator BLUETOOTH_ON_VALIDATOR = BOOLEAN_VALIDATOR;
8766
Christopher Tate06efb532012-08-24 15:29:27 -07008767 /**
8768 * CDMA Cell Broadcast SMS
8769 * 0 = CDMA Cell Broadcast SMS disabled
8770 * 1 = CDMA Cell Broadcast SMS enabled
8771 * @hide
8772 */
8773 public static final String CDMA_CELL_BROADCAST_SMS =
8774 "cdma_cell_broadcast_sms";
8775
8776 /**
8777 * The CDMA roaming mode 0 = Home Networks, CDMA default
8778 * 1 = Roaming on Affiliated networks
8779 * 2 = Roaming on any networks
8780 * @hide
8781 */
8782 public static final String CDMA_ROAMING_MODE = "roaming_settings";
8783
8784 /**
8785 * The CDMA subscription mode 0 = RUIM/SIM (default)
8786 * 1 = NV
8787 * @hide
8788 */
8789 public static final String CDMA_SUBSCRIPTION_MODE = "subscription_mode";
8790
Narayan Kamath94bcdbc2017-07-17 15:32:53 +01008791 /**
8792 * The default value for whether background data is enabled or not.
8793 *
8794 * Used by {@code NetworkPolicyManagerService}.
8795 *
8796 * @hide
8797 */
8798 public static final String DEFAULT_RESTRICT_BACKGROUND_DATA =
8799 "default_restrict_background_data";
8800
Christopher Tate06efb532012-08-24 15:29:27 -07008801 /** Inactivity timeout to track mobile data activity.
8802 *
8803 * If set to a positive integer, it indicates the inactivity timeout value in seconds to
8804 * infer the data activity of mobile network. After a period of no activity on mobile
8805 * networks with length specified by the timeout, an {@code ACTION_DATA_ACTIVITY_CHANGE}
8806 * intent is fired to indicate a transition of network status from "active" to "idle". Any
8807 * subsequent activity on mobile networks triggers the firing of {@code
8808 * ACTION_DATA_ACTIVITY_CHANGE} intent indicating transition from "idle" to "active".
8809 *
8810 * Network activity refers to transmitting or receiving data on the network interfaces.
8811 *
8812 * Tracking is disabled if set to zero or negative value.
8813 *
8814 * @hide
8815 */
8816 public static final String DATA_ACTIVITY_TIMEOUT_MOBILE = "data_activity_timeout_mobile";
8817
8818 /** Timeout to tracking Wifi data activity. Same as {@code DATA_ACTIVITY_TIMEOUT_MOBILE}
8819 * but for Wifi network.
8820 * @hide
8821 */
8822 public static final String DATA_ACTIVITY_TIMEOUT_WIFI = "data_activity_timeout_wifi";
8823
8824 /**
8825 * Whether or not data roaming is enabled. (0 = false, 1 = true)
8826 */
8827 public static final String DATA_ROAMING = "data_roaming";
8828
8829 /**
Wink Saville75c1e692013-03-20 17:06:50 -07008830 * The value passed to a Mobile DataConnection via bringUp which defines the
8831 * number of retries to preform when setting up the initial connection. The default
8832 * value defined in DataConnectionTrackerBase#DEFAULT_MDC_INITIAL_RETRY is currently 1.
8833 * @hide
8834 */
8835 public static final String MDC_INITIAL_MAX_RETRY = "mdc_initial_max_retry";
8836
8837 /**
Todd Kennedyf39ca8f2015-08-07 14:15:07 -07008838 * Whether any package can be on external storage. When this is true, any
8839 * package, regardless of manifest values, is a candidate for installing
8840 * or moving onto external storage. (0 = false, 1 = true)
8841 * @hide
8842 */
8843 public static final String FORCE_ALLOW_ON_EXTERNAL = "force_allow_on_external";
8844
Jorim Jaggi8ccdf3a2015-10-22 12:50:31 +02008845 /**
Jeff Davidson91c3d072017-04-12 12:17:11 -07008846 * The default SM-DP+ configured for this device.
8847 *
8848 * <p>An SM-DP+ is used by an LPA (see {@link android.service.euicc.EuiccService}) to
8849 * download profiles. If this value is set, the LPA will query this server for any profiles
8850 * available to this device. If any are available, they may be downloaded during device
8851 * provisioning or in settings without needing the user to enter an activation code.
8852 *
8853 * @see android.service.euicc.EuiccService
8854 * @hide
Jeff Davidson91c3d072017-04-12 12:17:11 -07008855 */
Holly Jiuyu Sun4f73b9c2017-12-12 20:17:09 -08008856 @SystemApi
Jeff Davidson91c3d072017-04-12 12:17:11 -07008857 public static final String DEFAULT_SM_DP_PLUS = "default_sm_dp_plus";
8858
8859 /**
Jeff Davidsondff39332017-05-19 17:07:48 -07008860 * Whether any profile has ever been downloaded onto a eUICC on the device.
8861 *
8862 * <p>Used to hide eUICC UI from users who have never made use of it and would only be
8863 * confused by seeing references to it in settings.
8864 * (0 = false, 1 = true)
8865 * @hide
8866 */
Holly Jiuyu Sunb85013a2018-02-21 20:34:22 -08008867 @SystemApi
Jeff Davidsondff39332017-05-19 17:07:48 -07008868 public static final String EUICC_PROVISIONED = "euicc_provisioned";
8869
8870 /**
Qingxi Liead12712018-04-11 15:14:56 -07008871 * List of ISO country codes in which eUICC UI is shown. Country codes should be separated
8872 * by comma.
8873 *
8874 * <p>Used to hide eUICC UI from users who are currently in countries no carriers support
8875 * eUICC.
8876 * @hide
8877 */
8878 //TODO(b/77914569) Changes this to System Api.
8879 public static final String EUICC_SUPPORTED_COUNTRIES = "euicc_supported_countries";
8880
8881 /**
Jorim Jaggi8ccdf3a2015-10-22 12:50:31 +02008882 * Whether any activity can be resized. When this is true, any
8883 * activity, regardless of manifest values, can be resized for multi-window.
8884 * (0 = false, 1 = true)
8885 * @hide
8886 */
8887 public static final String DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES
8888 = "force_resizable_activities";
8889
Jorim Jaggi6f2efd32015-12-23 12:04:39 +01008890 /**
8891 * Whether to enable experimental freeform support for windows.
8892 * @hide
8893 */
8894 public static final String DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT
8895 = "enable_freeform_support";
8896
Todd Kennedyf39ca8f2015-08-07 14:15:07 -07008897 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008898 * Whether user has enabled development settings.
8899 */
8900 public static final String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled";
8901
8902 /**
Amith Yamasanicb15d662015-11-10 11:11:15 -08008903 * Whether the device has been provisioned (0 = false, 1 = true).
8904 * <p>On a multiuser device with a separate system user, the screen may be locked
8905 * as soon as this is set to true and further activities cannot be launched on the
8906 * system user unless they are marked to show over keyguard.
Christopher Tate06efb532012-08-24 15:29:27 -07008907 */
8908 public static final String DEVICE_PROVISIONED = "device_provisioned";
8909
8910 /**
Robert Greenwaltbeb482c2016-03-28 15:40:56 -07008911 * Whether mobile data should be allowed while the device is being provisioned.
8912 * This allows the provisioning process to turn off mobile data before the user
8913 * has an opportunity to set things up, preventing other processes from burning
8914 * precious bytes before wifi is setup.
8915 * (0 = false, 1 = true)
8916 * @hide
8917 */
8918 public static final String DEVICE_PROVISIONING_MOBILE_DATA_ENABLED =
8919 "device_provisioning_mobile_data";
8920
8921 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008922 * The saved value for WindowManagerService.setForcedDisplaySize().
8923 * Two integers separated by a comma. If unset, then use the real display size.
8924 * @hide
8925 */
8926 public static final String DISPLAY_SIZE_FORCED = "display_size_forced";
8927
8928 /**
Jeff Brownd46747a2015-04-15 19:02:36 -07008929 * The saved value for WindowManagerService.setForcedDisplayScalingMode().
8930 * 0 or unset if scaling is automatic, 1 if scaling is disabled.
8931 * @hide
8932 */
8933 public static final String DISPLAY_SCALING_FORCE = "display_scaling_force";
8934
8935 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008936 * The maximum size, in bytes, of a download that the download manager will transfer over
8937 * a non-wifi connection.
8938 * @hide
8939 */
8940 public static final String DOWNLOAD_MAX_BYTES_OVER_MOBILE =
8941 "download_manager_max_bytes_over_mobile";
8942
8943 /**
8944 * The recommended maximum size, in bytes, of a download that the download manager should
8945 * transfer over a non-wifi connection. Over this size, the use will be warned, but will
8946 * have the option to start the download over the mobile connection anyway.
8947 * @hide
8948 */
8949 public static final String DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE =
8950 "download_manager_recommended_max_bytes_over_mobile";
8951
8952 /**
Christopher Tateaa036a22014-05-19 16:33:27 -07008953 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
Christopher Tate06efb532012-08-24 15:29:27 -07008954 */
Christopher Tateaa036a22014-05-19 16:33:27 -07008955 @Deprecated
8956 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
Christopher Tate06efb532012-08-24 15:29:27 -07008957
8958 /**
Jinsuk Kimb3d91772014-07-10 12:48:54 +09008959 * Whether HDMI control shall be enabled. If disabled, no CEC/MHL command will be
8960 * sent or processed. (0 = false, 1 = true)
8961 * @hide
8962 */
8963 public static final String HDMI_CONTROL_ENABLED = "hdmi_control_enabled";
8964
8965 /**
Donghyun Choc1fa9af2016-12-27 18:31:09 +09008966 * Whether HDMI System Audio Control feature is enabled. If enabled, TV will try to turn on
8967 * system audio mode if there's a connected CEC-enabled AV Receiver. Then audio stream will
8968 * be played on AVR instead of TV spaeker. If disabled, the system audio mode will never be
8969 * activated.
Jinsuk Kimb3d91772014-07-10 12:48:54 +09008970 * @hide
8971 */
Donghyun Choc1fa9af2016-12-27 18:31:09 +09008972 public static final String HDMI_SYSTEM_AUDIO_CONTROL_ENABLED =
8973 "hdmi_system_audio_control_enabled";
Jinsuk Kimb3d91772014-07-10 12:48:54 +09008974
Alex Salo8994a1f2017-11-01 14:52:59 -07008975 /**
8976 * Whether TV will automatically turn on upon reception of the CEC command
8977 * &lt;Text View On&gt; or &lt;Image View On&gt;. (0 = false, 1 = true)
8978 *
8979 * @hide
8980 */
8981 public static final String HDMI_CONTROL_AUTO_WAKEUP_ENABLED =
8982 "hdmi_control_auto_wakeup_enabled";
Jinsuk Kimb3d91772014-07-10 12:48:54 +09008983
Alex Salo8994a1f2017-11-01 14:52:59 -07008984 /**
8985 * Whether TV will also turn off other CEC devices when it goes to standby mode.
8986 * (0 = false, 1 = true)
8987 *
8988 * @hide
8989 */
8990 public static final String HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED =
8991 "hdmi_control_auto_device_off_enabled";
Jinsuk Kimb3d91772014-07-10 12:48:54 +09008992
Alex Salo8994a1f2017-11-01 14:52:59 -07008993 /**
8994 * If <b>true</b>, enables out-of-the-box execution for priv apps.
8995 * Default: false
8996 * Values: 0 = false, 1 = true
8997 *
8998 * @hide
8999 */
9000 public static final String PRIV_APP_OOB_ENABLED = "priv_app_oob_enabled";
9001
9002 /**
Victor Hsieh785d6182018-04-19 14:26:28 -07009003 * Comma separated list of privileged package names, which will be running out-of-box APK.
9004 * Default: "ALL"
9005 *
9006 * @hide
9007 */
9008 public static final String PRIV_APP_OOB_LIST = "priv_app_oob_list";
9009
9010 /**
Alex Salo8994a1f2017-11-01 14:52:59 -07009011 * The interval in milliseconds at which location requests will be throttled when they are
9012 * coming from the background.
9013 *
9014 * @hide
9015 */
9016 public static final String LOCATION_BACKGROUND_THROTTLE_INTERVAL_MS =
Soonil Nagarkar7decfb62017-01-18 12:18:49 -08009017 "location_background_throttle_interval_ms";
9018
Soonil Nagarkar2f1f7e82017-01-24 12:52:10 -08009019 /**
Lifu Tangc94ef4d2017-03-23 23:48:00 -07009020 * Most frequent location update interval in milliseconds that proximity alert is allowed
9021 * to request.
9022 * @hide
9023 */
9024 public static final String LOCATION_BACKGROUND_THROTTLE_PROXIMITY_ALERT_INTERVAL_MS =
9025 "location_background_throttle_proximity_alert_interval_ms";
9026
9027 /**
Soonil Nagarkar2f1f7e82017-01-24 12:52:10 -08009028 * Packages that are whitelisted for background throttling (throttling will not be applied).
9029 * @hide
9030 */
9031 public static final String LOCATION_BACKGROUND_THROTTLE_PACKAGE_WHITELIST =
9032 "location_background_throttle_package_whitelist";
9033
Wei Wangcdbffa92017-04-17 19:49:29 -07009034 /**
Jinsuk Kimb3d91772014-07-10 12:48:54 +09009035 * Whether TV will switch to MHL port when a mobile device is plugged in.
9036 * (0 = false, 1 = true)
9037 * @hide
9038 */
9039 public static final String MHL_INPUT_SWITCHING_ENABLED = "mhl_input_switching_enabled";
9040
9041 /**
9042 * Whether TV will charge the mobile device connected at MHL port. (0 = false, 1 = true)
9043 * @hide
9044 */
9045 public static final String MHL_POWER_CHARGE_ENABLED = "mhl_power_charge_enabled";
9046
9047 /**
Christopher Tate06efb532012-08-24 15:29:27 -07009048 * Whether mobile data connections are allowed by the user. See
9049 * ConnectivityManager for more info.
9050 * @hide
9051 */
9052 public static final String MOBILE_DATA = "mobile_data";
9053
Erik Klineda4bfa82015-04-30 12:58:40 +09009054 /**
9055 * Whether the mobile data connection should remain active even when higher
9056 * priority networks like WiFi are active, to help make network switching faster.
9057 *
9058 * See ConnectivityService for more info.
9059 *
9060 * (0 = disabled, 1 = enabled)
9061 * @hide
9062 */
9063 public static final String MOBILE_DATA_ALWAYS_ON = "mobile_data_always_on";
9064
Hugo Benichi05686db2016-10-19 11:17:28 +09009065 /**
9066 * Size of the event buffer for IP connectivity metrics.
9067 * @hide
9068 */
9069 public static final String CONNECTIVITY_METRICS_BUFFER_SIZE =
9070 "connectivity_metrics_buffer_size";
9071
Christopher Tate06efb532012-08-24 15:29:27 -07009072 /** {@hide} */
9073 public static final String NETSTATS_ENABLED = "netstats_enabled";
9074 /** {@hide} */
9075 public static final String NETSTATS_POLL_INTERVAL = "netstats_poll_interval";
9076 /** {@hide} */
Jeff Sharkey9911a282018-02-14 22:29:11 -07009077 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07009078 public static final String NETSTATS_TIME_CACHE_MAX_AGE = "netstats_time_cache_max_age";
9079 /** {@hide} */
9080 public static final String NETSTATS_GLOBAL_ALERT_BYTES = "netstats_global_alert_bytes";
9081 /** {@hide} */
9082 public static final String NETSTATS_SAMPLE_ENABLED = "netstats_sample_enabled";
Jeff Sharkeyf4de2942017-08-29 15:32:13 -06009083 /** {@hide} */
9084 public static final String NETSTATS_AUGMENT_ENABLED = "netstats_augment_enabled";
Christopher Tate06efb532012-08-24 15:29:27 -07009085
9086 /** {@hide} */
9087 public static final String NETSTATS_DEV_BUCKET_DURATION = "netstats_dev_bucket_duration";
9088 /** {@hide} */
9089 public static final String NETSTATS_DEV_PERSIST_BYTES = "netstats_dev_persist_bytes";
9090 /** {@hide} */
9091 public static final String NETSTATS_DEV_ROTATE_AGE = "netstats_dev_rotate_age";
9092 /** {@hide} */
9093 public static final String NETSTATS_DEV_DELETE_AGE = "netstats_dev_delete_age";
9094
9095 /** {@hide} */
9096 public static final String NETSTATS_UID_BUCKET_DURATION = "netstats_uid_bucket_duration";
9097 /** {@hide} */
9098 public static final String NETSTATS_UID_PERSIST_BYTES = "netstats_uid_persist_bytes";
9099 /** {@hide} */
9100 public static final String NETSTATS_UID_ROTATE_AGE = "netstats_uid_rotate_age";
9101 /** {@hide} */
9102 public static final String NETSTATS_UID_DELETE_AGE = "netstats_uid_delete_age";
9103
9104 /** {@hide} */
9105 public static final String NETSTATS_UID_TAG_BUCKET_DURATION = "netstats_uid_tag_bucket_duration";
9106 /** {@hide} */
9107 public static final String NETSTATS_UID_TAG_PERSIST_BYTES = "netstats_uid_tag_persist_bytes";
9108 /** {@hide} */
9109 public static final String NETSTATS_UID_TAG_ROTATE_AGE = "netstats_uid_tag_rotate_age";
9110 /** {@hide} */
9111 public static final String NETSTATS_UID_TAG_DELETE_AGE = "netstats_uid_tag_delete_age";
9112
Jeff Sharkey36b414b2018-03-30 11:00:03 -06009113 /** {@hide} */
9114 public static final String NETPOLICY_QUOTA_ENABLED = "netpolicy_quota_enabled";
9115 /** {@hide} */
9116 public static final String NETPOLICY_QUOTA_UNLIMITED = "netpolicy_quota_unlimited";
9117 /** {@hide} */
9118 public static final String NETPOLICY_QUOTA_LIMITED = "netpolicy_quota_limited";
9119 /** {@hide} */
9120 public static final String NETPOLICY_QUOTA_FRAC_JOBS = "netpolicy_quota_frac_jobs";
9121 /** {@hide} */
9122 public static final String NETPOLICY_QUOTA_FRAC_MULTIPATH = "netpolicy_quota_frac_multipath";
9123
9124 /** {@hide} */
9125 public static final String NETPOLICY_OVERRIDE_ENABLED = "netpolicy_override_enabled";
9126
Christopher Tate06efb532012-08-24 15:29:27 -07009127 /**
9128 * User preference for which network(s) should be used. Only the
9129 * connectivity service should touch this.
9130 */
9131 public static final String NETWORK_PREFERENCE = "network_preference";
9132
9133 /**
Jeff Davidsondd6fd1e2014-04-14 15:14:30 -07009134 * Which package name to use for network scoring. If null, or if the package is not a valid
9135 * scorer app, external network scores will neither be requested nor accepted.
9136 * @hide
9137 */
9138 public static final String NETWORK_SCORER_APP = "network_scorer_app";
9139
Christine Franks8ad6f6d2017-12-13 18:40:43 -08009140 /**
9141 * Whether night display forced auto mode is available.
9142 * 0 = unavailable, 1 = available.
9143 * @hide
9144 */
9145 public static final String NIGHT_DISPLAY_FORCED_AUTO_MODE_AVAILABLE =
9146 "night_display_forced_auto_mode_available";
9147
Jeff Davidsondd6fd1e2014-04-14 15:14:30 -07009148 /**
Christopher Tate06efb532012-08-24 15:29:27 -07009149 * If the NITZ_UPDATE_DIFF time is exceeded then an automatic adjustment
9150 * to SystemClock will be allowed even if NITZ_UPDATE_SPACING has not been
9151 * exceeded.
9152 * @hide
9153 */
9154 public static final String NITZ_UPDATE_DIFF = "nitz_update_diff";
9155
9156 /**
9157 * The length of time in milli-seconds that automatic small adjustments to
9158 * SystemClock are ignored if NITZ_UPDATE_DIFF is not exceeded.
9159 * @hide
9160 */
9161 public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing";
9162
9163 /** Preferred NTP server. {@hide} */
9164 public static final String NTP_SERVER = "ntp_server";
9165 /** Timeout in milliseconds to wait for NTP server. {@hide} */
9166 public static final String NTP_TIMEOUT = "ntp_timeout";
9167
Jeff Sharkeye8a4b662015-06-27 15:43:45 -07009168 /** {@hide} */
9169 public static final String STORAGE_BENCHMARK_INTERVAL = "storage_benchmark_interval";
9170
Christopher Tate06efb532012-08-24 15:29:27 -07009171 /**
Pierre Imai8e48e672016-04-21 13:30:43 +09009172 * Sample validity in seconds to configure for the system DNS resolver.
9173 * {@hide}
9174 */
9175 public static final String DNS_RESOLVER_SAMPLE_VALIDITY_SECONDS =
9176 "dns_resolver_sample_validity_seconds";
9177
9178 /**
9179 * Success threshold in percent for use with the system DNS resolver.
9180 * {@hide}
9181 */
9182 public static final String DNS_RESOLVER_SUCCESS_THRESHOLD_PERCENT =
9183 "dns_resolver_success_threshold_percent";
9184
9185 /**
9186 * Minimum number of samples needed for statistics to be considered meaningful in the
9187 * system DNS resolver.
9188 * {@hide}
9189 */
9190 public static final String DNS_RESOLVER_MIN_SAMPLES = "dns_resolver_min_samples";
9191
9192 /**
9193 * Maximum number taken into account for statistics purposes in the system DNS resolver.
9194 * {@hide}
9195 */
9196 public static final String DNS_RESOLVER_MAX_SAMPLES = "dns_resolver_max_samples";
9197
9198 /**
Tao Baofdf7c5d2016-02-15 20:59:15 -08009199 * Whether to disable the automatic scheduling of system updates.
9200 * 1 = system updates won't be automatically scheduled (will always
9201 * present notification instead).
9202 * 0 = system updates will be automatically scheduled. (default)
9203 * @hide
9204 */
9205 @SystemApi
9206 public static final String OTA_DISABLE_AUTOMATIC_UPDATE = "ota_disable_automatic_update";
9207
9208 /**
rich cannings4d8fc792012-09-07 14:43:43 -07009209 * Whether the package manager should send package verification broadcasts for verifiers to
9210 * review apps prior to installation.
9211 * 1 = request apps to be verified prior to installation, if a verifier exists.
9212 * 0 = do not verify apps before installation
rich cannings4e5753f2012-09-19 16:03:56 -07009213 * @hide
rich cannings4d8fc792012-09-07 14:43:43 -07009214 */
9215 public static final String PACKAGE_VERIFIER_ENABLE = "package_verifier_enable";
9216
9217 /** Timeout for package verification.
rich cannings4e5753f2012-09-19 16:03:56 -07009218 * @hide */
rich cannings4d8fc792012-09-07 14:43:43 -07009219 public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout";
9220
9221 /** Default response code for package verification.
rich cannings4e5753f2012-09-19 16:03:56 -07009222 * @hide */
rich cannings4d8fc792012-09-07 14:43:43 -07009223 public static final String PACKAGE_VERIFIER_DEFAULT_RESPONSE = "verifier_default_response";
9224
rich cannings4e5753f2012-09-19 16:03:56 -07009225 /**
9226 * Show package verification setting in the Settings app.
rich canningse6686b32012-09-16 14:02:20 -07009227 * 1 = show (default)
9228 * 0 = hide
rich cannings4e5753f2012-09-19 16:03:56 -07009229 * @hide
rich canningse6686b32012-09-16 14:02:20 -07009230 */
9231 public static final String PACKAGE_VERIFIER_SETTING_VISIBLE = "verifier_setting_visible";
9232
rich cannings4d8fc792012-09-07 14:43:43 -07009233 /**
Fabrice Di Meglio1c1b4712014-11-19 17:12:32 -08009234 * Run package verification on apps installed through ADB/ADT/USB
rich cannings4e5753f2012-09-19 16:03:56 -07009235 * 1 = perform package verification on ADB installs (default)
9236 * 0 = bypass package verification on ADB installs
9237 * @hide
9238 */
9239 public static final String PACKAGE_VERIFIER_INCLUDE_ADB = "verifier_verify_adb_installs";
9240
9241 /**
Christopher Tate7265abe2014-11-21 13:54:45 -08009242 * Time since last fstrim (milliseconds) after which we force one to happen
9243 * during device startup. If unset, the default is 3 days.
9244 * @hide
9245 */
9246 public static final String FSTRIM_MANDATORY_INTERVAL = "fstrim_mandatory_interval";
9247
9248 /**
Christopher Tate06efb532012-08-24 15:29:27 -07009249 * The interval in milliseconds at which to check packet counts on the
9250 * mobile data interface when screen is on, to detect possible data
9251 * connection problems.
9252 * @hide
9253 */
9254 public static final String PDP_WATCHDOG_POLL_INTERVAL_MS =
9255 "pdp_watchdog_poll_interval_ms";
9256
9257 /**
9258 * The interval in milliseconds at which to check packet counts on the
9259 * mobile data interface when screen is off, to detect possible data
9260 * connection problems.
9261 * @hide
9262 */
9263 public static final String PDP_WATCHDOG_LONG_POLL_INTERVAL_MS =
9264 "pdp_watchdog_long_poll_interval_ms";
9265
9266 /**
9267 * The interval in milliseconds at which to check packet counts on the
9268 * mobile data interface after {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT}
9269 * outgoing packets has been reached without incoming packets.
9270 * @hide
9271 */
9272 public static final String PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS =
9273 "pdp_watchdog_error_poll_interval_ms";
9274
9275 /**
9276 * The number of outgoing packets sent without seeing an incoming packet
9277 * that triggers a countdown (of {@link #PDP_WATCHDOG_ERROR_POLL_COUNT}
9278 * device is logged to the event log
9279 * @hide
9280 */
9281 public static final String PDP_WATCHDOG_TRIGGER_PACKET_COUNT =
9282 "pdp_watchdog_trigger_packet_count";
9283
9284 /**
9285 * The number of polls to perform (at {@link #PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS})
9286 * after hitting {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} before
9287 * attempting data connection recovery.
9288 * @hide
9289 */
9290 public static final String PDP_WATCHDOG_ERROR_POLL_COUNT =
9291 "pdp_watchdog_error_poll_count";
9292
9293 /**
9294 * The number of failed PDP reset attempts before moving to something more
9295 * drastic: re-registering to the network.
9296 * @hide
9297 */
9298 public static final String PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT =
9299 "pdp_watchdog_max_pdp_reset_fail_count";
9300
9301 /**
Christopher Tate06efb532012-08-24 15:29:27 -07009302 * URL to open browser on to allow user to manage a prepay account
9303 * @hide
9304 */
9305 public static final String SETUP_PREPAID_DATA_SERVICE_URL =
9306 "setup_prepaid_data_service_url";
9307
9308 /**
9309 * URL to attempt a GET on to see if this is a prepay device
9310 * @hide
9311 */
9312 public static final String SETUP_PREPAID_DETECTION_TARGET_URL =
9313 "setup_prepaid_detection_target_url";
9314
9315 /**
9316 * Host to check for a redirect to after an attempt to GET
9317 * SETUP_PREPAID_DETECTION_TARGET_URL. (If we redirected there,
9318 * this is a prepaid device with zero balance.)
9319 * @hide
9320 */
9321 public static final String SETUP_PREPAID_DETECTION_REDIR_HOST =
9322 "setup_prepaid_detection_redir_host";
9323
9324 /**
Jake Hamby76a61422012-09-06 17:40:21 -07009325 * The interval in milliseconds at which to check the number of SMS sent out without asking
9326 * for use permit, to limit the un-authorized SMS usage.
9327 *
9328 * @hide
9329 */
9330 public static final String SMS_OUTGOING_CHECK_INTERVAL_MS =
9331 "sms_outgoing_check_interval_ms";
9332
9333 /**
9334 * The number of outgoing SMS sent without asking for user permit (of {@link
9335 * #SMS_OUTGOING_CHECK_INTERVAL_MS}
9336 *
9337 * @hide
9338 */
9339 public static final String SMS_OUTGOING_CHECK_MAX_COUNT =
9340 "sms_outgoing_check_max_count";
9341
9342 /**
9343 * Used to disable SMS short code confirmation - defaults to true.
Robert Greenwalt026efcc2012-09-24 10:03:21 -07009344 * True indcates we will do the check, etc. Set to false to disable.
Jake Hamby76a61422012-09-06 17:40:21 -07009345 * @see com.android.internal.telephony.SmsUsageMonitor
9346 * @hide
9347 */
9348 public static final String SMS_SHORT_CODE_CONFIRMATION = "sms_short_code_confirmation";
9349
Robert Greenwalt026efcc2012-09-24 10:03:21 -07009350 /**
9351 * Used to select which country we use to determine premium sms codes.
9352 * One of com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_SIM,
9353 * com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_NETWORK,
9354 * or com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_BOTH.
9355 * @hide
9356 */
9357 public static final String SMS_SHORT_CODE_RULE = "sms_short_code_rule";
9358
Jake Hamby76a61422012-09-06 17:40:21 -07009359 /**
JP Abgrall32d1ac4d2014-02-21 12:05:20 -08009360 * Used to select TCP's default initial receiver window size in segments - defaults to a build config value
9361 * @hide
9362 */
9363 public static final String TCP_DEFAULT_INIT_RWND = "tcp_default_init_rwnd";
9364
9365 /**
Christopher Tate06efb532012-08-24 15:29:27 -07009366 * Used to disable Tethering on a device - defaults to true
9367 * @hide
9368 */
9369 public static final String TETHER_SUPPORTED = "tether_supported";
9370
9371 /**
9372 * Used to require DUN APN on the device or not - defaults to a build config value
9373 * which defaults to false
9374 * @hide
9375 */
9376 public static final String TETHER_DUN_REQUIRED = "tether_dun_required";
9377
9378 /**
9379 * Used to hold a gservices-provisioned apn value for DUN. If set, or the
9380 * corresponding build config values are set it will override the APN DB
9381 * values.
9382 * Consists of a comma seperated list of strings:
9383 * "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type"
Erik Kline19841792018-05-16 16:41:57 +09009384 * note that empty fields can be omitted: "name,apn,,,,,,,,,310,260,,DUN"
Christopher Tate06efb532012-08-24 15:29:27 -07009385 * @hide
9386 */
9387 public static final String TETHER_DUN_APN = "tether_dun_apn";
9388
Erik Kline92c4db02017-05-31 10:21:32 +09009389 /**
9390 * Used to disable trying to talk to any available tethering offload HAL.
9391 *
9392 * Integer values are interpreted as boolean, and the absence of an explicit setting
9393 * is interpreted as |false|.
9394 * @hide
9395 */
9396 public static final String TETHER_OFFLOAD_DISABLED = "tether_offload_disabled";
9397
goneil6db18a9b2018-01-10 16:23:11 -08009398 /**
9399 * List of certificate (hex string representation of the application's certificate - SHA-1
9400 * or SHA-256) and carrier app package pairs which are whitelisted to prompt the user for
9401 * install when a sim card with matching UICC carrier privilege rules is inserted. The
9402 * certificate is used as a key, so the certificate encoding here must be the same as the
9403 * certificate encoding used on the SIM.
9404 *
9405 * The value is "cert1:package1;cert2:package2;..."
9406 * @hide
9407 */
9408 @SystemApi
9409 public static final String CARRIER_APP_WHITELIST = "carrier_app_whitelist";
Junda Liu0c35fbc2016-01-19 23:20:15 -08009410
goneil15f5a7e2018-02-16 17:33:56 -08009411 /**
goneil986fae22018-03-29 17:30:58 -07009412 * Map of package name to application names. The application names cannot and will not be
9413 * localized. App names may not contain colons or semicolons.
goneil15f5a7e2018-02-16 17:33:56 -08009414 *
9415 * The value is "packageName1:appName1;packageName2:appName2;..."
9416 * @hide
9417 */
9418 @SystemApi
9419 public static final String CARRIER_APP_NAMES = "carrier_app_names";
9420
Junda Liu0c35fbc2016-01-19 23:20:15 -08009421 /**
Christopher Tate06efb532012-08-24 15:29:27 -07009422 * USB Mass Storage Enabled
9423 */
9424 public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled";
9425
Michal Karpinski5db1e432018-01-18 20:10:24 +00009426 private static final Validator USB_MASS_STORAGE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
9427
Christopher Tate06efb532012-08-24 15:29:27 -07009428 /**
9429 * If this setting is set (to anything), then all references
9430 * to Gmail on the device must change to Google Mail.
9431 */
9432 public static final String USE_GOOGLE_MAIL = "use_google_mail";
9433
Hui Shu22671772014-10-01 21:41:07 +00009434 /**
9435 * Webview Data reduction proxy key.
9436 * @hide
9437 */
9438 public static final String WEBVIEW_DATA_REDUCTION_PROXY_KEY =
9439 "webview_data_reduction_proxy_key";
9440
Lorenzo Colitti84e6f1232016-08-29 14:03:11 +09009441 /**
9442 * Whether or not the WebView fallback mechanism should be enabled.
9443 * 0=disabled, 1=enabled.
9444 * @hide
9445 */
9446 public static final String WEBVIEW_FALLBACK_LOGIC_ENABLED =
9447 "webview_fallback_logic_enabled";
Gustav Senntonc83e3fa2016-02-18 12:19:13 +00009448
Lorenzo Colitti84e6f1232016-08-29 14:03:11 +09009449 /**
9450 * Name of the package used as WebView provider (if unset the provider is instead determined
9451 * by the system).
9452 * @hide
9453 */
9454 public static final String WEBVIEW_PROVIDER = "webview_provider";
Gustav Sennton14c033c2016-02-11 12:51:27 +00009455
Lorenzo Colitti84e6f1232016-08-29 14:03:11 +09009456 /**
9457 * Developer setting to enable WebView multiprocess rendering.
9458 * @hide
9459 */
9460 @SystemApi
9461 public static final String WEBVIEW_MULTIPROCESS = "webview_multiprocess";
9462
9463 /**
9464 * The maximum number of notifications shown in 24 hours when switching networks.
9465 * @hide
9466 */
9467 public static final String NETWORK_SWITCH_NOTIFICATION_DAILY_LIMIT =
9468 "network_switch_notification_daily_limit";
9469
9470 /**
9471 * The minimum time in milliseconds between notifications when switching networks.
9472 * @hide
9473 */
9474 public static final String NETWORK_SWITCH_NOTIFICATION_RATE_LIMIT_MILLIS =
9475 "network_switch_notification_rate_limit_millis";
Tobias Sargeantda857102016-02-11 14:52:28 +00009476
Christopher Tate06efb532012-08-24 15:29:27 -07009477 /**
Hugo Benichic8e9e122016-09-14 23:23:08 +00009478 * Whether to automatically switch away from wifi networks that lose Internet access.
Lorenzo Colitti165c51c2016-09-19 01:00:19 +09009479 * Only meaningful if config_networkAvoidBadWifi is set to 0, otherwise the system always
9480 * avoids such networks. Valid values are:
9481 *
9482 * 0: Don't avoid bad wifi, don't prompt the user. Get stuck on bad wifi like it's 2013.
9483 * null: Ask the user whether to switch away from bad wifi.
9484 * 1: Avoid bad wifi.
9485 *
Hugo Benichic8e9e122016-09-14 23:23:08 +00009486 * @hide
9487 */
9488 public static final String NETWORK_AVOID_BAD_WIFI = "network_avoid_bad_wifi";
9489
9490 /**
Lorenzo Colitti2de49252017-01-24 18:08:41 +09009491 * User setting for ConnectivityManager.getMeteredMultipathPreference(). This value may be
9492 * overridden by the system based on device or application state. If null, the value
9493 * specified by config_networkMeteredMultipathPreference is used.
9494 *
9495 * @hide
9496 */
9497 public static final String NETWORK_METERED_MULTIPATH_PREFERENCE =
9498 "network_metered_multipath_preference";
9499
Ricky Wai1a6e6672017-10-27 14:46:01 +01009500 /**
Remi NGUYEN VANe0ec9922018-03-29 16:17:19 +09009501 * Default daily multipath budget used by ConnectivityManager.getMultipathPreference()
9502 * on metered networks. This default quota is only used if quota could not be determined
9503 * from data plan or data limit/warning set by the user.
9504 * @hide
9505 */
9506 public static final String NETWORK_DEFAULT_DAILY_MULTIPATH_QUOTA_BYTES =
9507 "network_default_daily_multipath_quota_bytes";
9508
9509 /**
Ricky Wai1a6e6672017-10-27 14:46:01 +01009510 * Network watchlist last report time.
9511 * @hide
9512 */
9513 public static final String NETWORK_WATCHLIST_LAST_REPORT_TIME =
9514 "network_watchlist_last_report_time";
9515
Lorenzo Colitti2de49252017-01-24 18:08:41 +09009516 /**
William Meecd62f3a2017-01-24 18:01:38 -08009517 * The thresholds of the wifi throughput badging (SD, HD etc.) as a comma-delimited list of
9518 * colon-delimited key-value pairs. The key is the badging enum value defined in
9519 * android.net.ScoredNetwork and the value is the minimum sustained network throughput in
9520 * kbps required for the badge. For example: "10:3000,20:5000,30:25000"
9521 *
9522 * @hide
9523 */
9524 @SystemApi
9525 public static final String WIFI_BADGING_THRESHOLDS = "wifi_badging_thresholds";
9526
9527 /**
Jeff Brown89d55462012-09-19 11:33:42 -07009528 * Whether Wifi display is enabled/disabled
9529 * 0=disabled. 1=enabled.
9530 * @hide
9531 */
9532 public static final String WIFI_DISPLAY_ON = "wifi_display_on";
9533
9534 /**
Chong Zhang1f3ecaa2013-05-03 15:55:36 -07009535 * Whether Wifi display certification mode is enabled/disabled
9536 * 0=disabled. 1=enabled.
9537 * @hide
9538 */
9539 public static final String WIFI_DISPLAY_CERTIFICATION_ON =
9540 "wifi_display_certification_on";
9541
9542 /**
Chong Zhange38af812013-08-29 17:25:17 -07009543 * WPS Configuration method used by Wifi display, this setting only
9544 * takes effect when WIFI_DISPLAY_CERTIFICATION_ON is 1 (enabled).
9545 *
9546 * Possible values are:
9547 *
9548 * WpsInfo.INVALID: use default WPS method chosen by framework
9549 * WpsInfo.PBC : use Push button
9550 * WpsInfo.KEYPAD : use Keypad
9551 * WpsInfo.DISPLAY: use Display
9552 * @hide
9553 */
9554 public static final String WIFI_DISPLAY_WPS_CONFIG =
9555 "wifi_display_wps_config";
9556
9557 /**
Christopher Tate06efb532012-08-24 15:29:27 -07009558 * Whether to notify the user of open networks.
9559 * <p>
9560 * If not connected and the scan results have an open network, we will
9561 * put this notification up. If we attempt to connect to a network or
9562 * the open network(s) disappear, we remove the notification. When we
9563 * show the notification, we will not show it again for
9564 * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time.
Amin Shaikh3087e322017-03-24 17:34:24 -07009565 *
9566 * @deprecated This feature is no longer controlled by this setting in
9567 * {@link android.os.Build.VERSION_CODES#O}.
Christopher Tate06efb532012-08-24 15:29:27 -07009568 */
Amin Shaikh3087e322017-03-24 17:34:24 -07009569 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07009570 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
9571 "wifi_networks_available_notification_on";
Amin Shaikh3087e322017-03-24 17:34:24 -07009572
Michal Karpinski5db1e432018-01-18 20:10:24 +00009573 private static final Validator WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR =
9574 BOOLEAN_VALIDATOR;
9575
Christopher Tate06efb532012-08-24 15:29:27 -07009576 /**
Glen Kuhne22ae9d52017-11-28 14:06:25 -08009577 * Whether to notify the user of carrier networks.
9578 * <p>
9579 * If not connected and the scan results have a carrier network, we will
9580 * put this notification up. If we attempt to connect to a network or
9581 * the carrier network(s) disappear, we remove the notification. When we
9582 * show the notification, we will not show it again for
9583 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time.
9584 * @hide
9585 */
9586 public static final String WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON =
9587 "wifi_carrier_networks_available_notification_on";
9588
9589 private static final Validator WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR =
9590 BOOLEAN_VALIDATOR;
9591
9592 /**
Christopher Tate06efb532012-08-24 15:29:27 -07009593 * {@hide}
9594 */
9595 public static final String WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON =
9596 "wimax_networks_available_notification_on";
9597
9598 /**
9599 * Delay (in seconds) before repeating the Wi-Fi networks available notification.
9600 * Connecting to a network will reset the timer.
9601 */
9602 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
9603 "wifi_networks_available_repeat_delay";
9604
Michal Karpinski964943a2018-01-19 16:28:26 +00009605 private static final Validator WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_VALIDATOR =
9606 NON_NEGATIVE_INTEGER_VALIDATOR;
9607
Christopher Tate06efb532012-08-24 15:29:27 -07009608 /**
Robert Greenwalt3ea0c992013-10-03 21:13:49 +00009609 * 802.11 country code in ISO 3166 format
9610 * @hide
9611 */
9612 public static final String WIFI_COUNTRY_CODE = "wifi_country_code";
9613
9614 /**
Christopher Tate06efb532012-08-24 15:29:27 -07009615 * The interval in milliseconds to issue wake up scans when wifi needs
9616 * to connect. This is necessary to connect to an access point when
9617 * device is on the move and the screen is off.
9618 * @hide
9619 */
9620 public static final String WIFI_FRAMEWORK_SCAN_INTERVAL_MS =
9621 "wifi_framework_scan_interval_ms";
9622
9623 /**
9624 * The interval in milliseconds after which Wi-Fi is considered idle.
9625 * When idle, it is possible for the device to be switched from Wi-Fi to
9626 * the mobile data network.
9627 * @hide
9628 */
9629 public static final String WIFI_IDLE_MS = "wifi_idle_ms";
9630
9631 /**
9632 * When the number of open networks exceeds this number, the
9633 * least-recently-used excess networks will be removed.
9634 */
9635 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept";
9636
Michal Karpinski964943a2018-01-19 16:28:26 +00009637 private static final Validator WIFI_NUM_OPEN_NETWORKS_KEPT_VALIDATOR =
9638 NON_NEGATIVE_INTEGER_VALIDATOR;
9639
Christopher Tate06efb532012-08-24 15:29:27 -07009640 /**
9641 * Whether the Wi-Fi should be on. Only the Wi-Fi service should touch this.
9642 */
9643 public static final String WIFI_ON = "wifi_on";
9644
9645 /**
Irfan Sheriff11aefad2013-03-06 07:57:41 -08009646 * Setting to allow scans to be enabled even wifi is turned off for connectivity.
9647 * @hide
9648 */
9649 public static final String WIFI_SCAN_ALWAYS_AVAILABLE =
9650 "wifi_scan_always_enabled";
9651
Stephen Chen8ca96c12016-11-16 15:46:51 -08009652 /**
Wei Wangb6e04d52018-04-30 19:49:02 -07009653 * The interval in milliseconds at which wifi rtt ranging requests will be throttled when
9654 * they are coming from the background.
9655 *
9656 * @hide
9657 */
9658 public static final String WIFI_RTT_BACKGROUND_EXEC_GAP_MS =
9659 "wifi_rtt_background_exec_gap_ms";
9660
9661 /**
Mehdi Alizadehdcc0da22017-11-10 15:37:13 -08009662 * Whether soft AP will shut down after a timeout period when no devices are connected.
Mehdi Alizadeh57ae55c2018-01-08 16:41:19 -08009663 *
9664 * Type: int (0 for false, 1 for true)
Mehdi Alizadehdcc0da22017-11-10 15:37:13 -08009665 * @hide
9666 */
9667 public static final String SOFT_AP_TIMEOUT_ENABLED = "soft_ap_timeout_enabled";
9668
Michal Karpinski5db1e432018-01-18 20:10:24 +00009669 private static final Validator SOFT_AP_TIMEOUT_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
9670
Mehdi Alizadehdcc0da22017-11-10 15:37:13 -08009671 /**
Stephen Chen8ca96c12016-11-16 15:46:51 -08009672 * Value to specify if Wi-Fi Wakeup feature is enabled.
Stephen Chenf1b75642016-12-06 16:08:52 -08009673 *
9674 * Type: int (0 for false, 1 for true)
Stephen Chen8ca96c12016-11-16 15:46:51 -08009675 * @hide
9676 */
9677 @SystemApi
9678 public static final String WIFI_WAKEUP_ENABLED = "wifi_wakeup_enabled";
9679
Michal Karpinski5db1e432018-01-18 20:10:24 +00009680 private static final Validator WIFI_WAKEUP_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
9681
Stephen Chen6a0c8792016-11-16 15:46:51 -08009682 /**
Sundeep Ghumane869d832017-01-25 16:23:43 -08009683 * Value to specify whether network quality scores and badging should be shown in the UI.
9684 *
9685 * Type: int (0 for false, 1 for true)
9686 * @hide
9687 */
9688 public static final String NETWORK_SCORING_UI_ENABLED = "network_scoring_ui_enabled";
9689
9690 /**
Sundeep Ghuman9bb85d32017-08-28 17:04:16 -07009691 * Value to specify how long in milliseconds to retain seen score cache curves to be used
9692 * when generating SSID only bases score curves.
9693 *
9694 * Type: long
9695 * @hide
9696 */
9697 public static final String SPEED_LABEL_CACHE_EVICTION_AGE_MILLIS =
9698 "speed_label_cache_eviction_age_millis";
9699
9700 /**
Stephen Chen6a0c8792016-11-16 15:46:51 -08009701 * Value to specify if network recommendations from
9702 * {@link com.android.server.NetworkScoreService} are enabled.
Stephen Chenf1b75642016-12-06 16:08:52 -08009703 *
Jeremy Joslin9925c6a2017-03-06 10:39:35 -08009704 * Type: int
9705 * Valid values:
9706 * -1 = Forced off
9707 * 0 = Disabled
9708 * 1 = Enabled
9709 *
9710 * Most readers of this setting should simply check if value == 1 to determined the
9711 * enabled state.
Stephen Chen6a0c8792016-11-16 15:46:51 -08009712 * @hide
9713 */
Stephen Chen6a0c8792016-11-16 15:46:51 -08009714 public static final String NETWORK_RECOMMENDATIONS_ENABLED =
9715 "network_recommendations_enabled";
9716
Michal Karpinski5db1e432018-01-18 20:10:24 +00009717 private static final Validator NETWORK_RECOMMENDATIONS_ENABLED_VALIDATOR =
9718 new SettingsValidators.DiscreteValueValidator(new String[] {"-1", "0", "1"});
9719
Jeremy Joslincb594f32017-01-03 17:31:23 -08009720 /**
Jeremy Joslinc9eb3c42017-02-08 10:45:30 -08009721 * Which package name to use for network recommendations. If null, network recommendations
9722 * will neither be requested nor accepted.
9723 *
9724 * Use {@link NetworkScoreManager#getActiveScorerPackage()} to read this value and
9725 * {@link NetworkScoreManager#setActiveScorer(String)} to write it.
9726 *
9727 * Type: string - package name
9728 * @hide
9729 */
9730 public static final String NETWORK_RECOMMENDATIONS_PACKAGE =
9731 "network_recommendations_package";
9732
9733 /**
Amin Shaikhbc9a8e62017-02-02 15:39:12 -08009734 * The package name of the application that connect and secures high quality open wifi
9735 * networks automatically.
9736 *
9737 * Type: string package name or null if the feature is either not provided or disabled.
9738 * @hide
9739 */
Eric Enslen1e423b92017-12-18 11:30:21 -08009740 @TestApi
Amin Shaikhbc9a8e62017-02-02 15:39:12 -08009741 public static final String USE_OPEN_WIFI_PACKAGE = "use_open_wifi_package";
9742
Michal Karpinski5db1e432018-01-18 20:10:24 +00009743 private static final Validator USE_OPEN_WIFI_PACKAGE_VALIDATOR = new Validator() {
9744 @Override
Annie Mengeed1b812018-05-21 16:34:52 +01009745 public boolean validate(@Nullable String value) {
Michal Karpinski5db1e432018-01-18 20:10:24 +00009746 return (value == null) || PACKAGE_NAME_VALIDATOR.validate(value);
9747 }
9748 };
9749
Amin Shaikhbc9a8e62017-02-02 15:39:12 -08009750 /**
Jeremy Joslincb594f32017-01-03 17:31:23 -08009751 * The number of milliseconds the {@link com.android.server.NetworkScoreService}
9752 * will give a recommendation request to complete before returning a default response.
9753 *
9754 * Type: long
9755 * @hide
Jeremy Joslinb1a01392017-04-14 13:35:48 -07009756 * @deprecated to be removed
Jeremy Joslincb594f32017-01-03 17:31:23 -08009757 */
9758 public static final String NETWORK_RECOMMENDATION_REQUEST_TIMEOUT_MS =
9759 "network_recommendation_request_timeout_ms";
9760
Amin Shaikhd3c81932017-02-06 16:22:42 -08009761 /**
9762 * The expiration time in milliseconds for the {@link android.net.WifiKey} request cache in
9763 * {@link com.android.server.wifi.RecommendedNetworkEvaluator}.
9764 *
9765 * Type: long
9766 * @hide
9767 */
9768 public static final String RECOMMENDED_NETWORK_EVALUATOR_CACHE_EXPIRY_MS =
9769 "recommended_network_evaluator_cache_expiry_ms";
9770
Jeremy Klein45a9b5d2018-01-10 18:01:46 -08009771 /**
Wei Wangd91f1932015-03-19 15:09:56 -07009772 * Settings to allow BLE scans to be enabled even when Bluetooth is turned off for
9773 * connectivity.
9774 * @hide
9775 */
Jeremy Klein45a9b5d2018-01-10 18:01:46 -08009776 public static final String BLE_SCAN_ALWAYS_AVAILABLE = "ble_scan_always_enabled";
9777
9778 /**
9779 * The length in milliseconds of a BLE scan window in a low-power scan mode.
9780 * @hide
9781 */
9782 public static final String BLE_SCAN_LOW_POWER_WINDOW_MS = "ble_scan_low_power_window_ms";
9783
9784 /**
9785 * The length in milliseconds of a BLE scan window in a balanced scan mode.
9786 * @hide
9787 */
9788 public static final String BLE_SCAN_BALANCED_WINDOW_MS = "ble_scan_balanced_window_ms";
9789
9790 /**
9791 * The length in milliseconds of a BLE scan window in a low-latency scan mode.
9792 * @hide
9793 */
9794 public static final String BLE_SCAN_LOW_LATENCY_WINDOW_MS =
9795 "ble_scan_low_latency_window_ms";
9796
9797 /**
9798 * The length in milliseconds of a BLE scan interval in a low-power scan mode.
9799 * @hide
9800 */
9801 public static final String BLE_SCAN_LOW_POWER_INTERVAL_MS =
9802 "ble_scan_low_power_interval_ms";
9803
9804 /**
9805 * The length in milliseconds of a BLE scan interval in a balanced scan mode.
9806 * @hide
9807 */
9808 public static final String BLE_SCAN_BALANCED_INTERVAL_MS =
9809 "ble_scan_balanced_interval_ms";
9810
9811 /**
9812 * The length in milliseconds of a BLE scan interval in a low-latency scan mode.
9813 * @hide
9814 */
9815 public static final String BLE_SCAN_LOW_LATENCY_INTERVAL_MS =
9816 "ble_scan_low_latency_interval_ms";
Wei Wangd91f1932015-03-19 15:09:56 -07009817
Anthony Stangec97870a2018-03-14 01:09:45 +00009818 /**
9819 * The mode that BLE scanning clients will be moved to when in the background.
9820 * @hide
9821 */
9822 public static final String BLE_SCAN_BACKGROUND_MODE = "ble_scan_background_mode";
9823
Wei Wangd91f1932015-03-19 15:09:56 -07009824 /**
Christopher Tate06efb532012-08-24 15:29:27 -07009825 * Used to save the Wifi_ON state prior to tethering.
9826 * This state will be checked to restore Wifi after
9827 * the user turns off tethering.
9828 *
9829 * @hide
9830 */
9831 public static final String WIFI_SAVED_STATE = "wifi_saved_state";
9832
9833 /**
9834 * The interval in milliseconds to scan as used by the wifi supplicant
9835 * @hide
9836 */
9837 public static final String WIFI_SUPPLICANT_SCAN_INTERVAL_MS =
9838 "wifi_supplicant_scan_interval_ms";
9839
vandwalle7c3606c2014-03-31 19:12:07 -07009840 /**
9841 * whether frameworks handles wifi auto-join
9842 * @hide
9843 */
9844 public static final String WIFI_ENHANCED_AUTO_JOIN =
9845 "wifi_enhanced_auto_join";
9846
9847 /**
9848 * whether settings show RSSI
9849 * @hide
9850 */
9851 public static final String WIFI_NETWORK_SHOW_RSSI =
9852 "wifi_network_show_rssi";
9853
9854 /**
Irfan Sheriff3809f502012-09-17 16:04:57 -07009855 * The interval in milliseconds to scan at supplicant when p2p is connected
9856 * @hide
9857 */
9858 public static final String WIFI_SCAN_INTERVAL_WHEN_P2P_CONNECTED_MS =
9859 "wifi_scan_interval_p2p_connected_ms";
9860
9861 /**
Christopher Tate06efb532012-08-24 15:29:27 -07009862 * Whether the Wi-Fi watchdog is enabled.
9863 */
9864 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
9865
9866 /**
Christopher Tate06efb532012-08-24 15:29:27 -07009867 * Setting to turn off poor network avoidance on Wi-Fi. Feature is enabled by default and
9868 * the setting needs to be set to 0 to disable it.
9869 * @hide
9870 */
9871 public static final String WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED =
9872 "wifi_watchdog_poor_network_test_enabled";
9873
Michal Karpinski5db1e432018-01-18 20:10:24 +00009874 private static final Validator WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED_VALIDATOR =
9875 ANY_STRING_VALIDATOR;
9876
Christopher Tate06efb532012-08-24 15:29:27 -07009877 /**
9878 * Setting to turn on suspend optimizations at screen off on Wi-Fi. Enabled by default and
9879 * needs to be set to 0 to disable it.
9880 * @hide
9881 */
9882 public static final String WIFI_SUSPEND_OPTIMIZATIONS_ENABLED =
9883 "wifi_suspend_optimizations_enabled";
9884
9885 /**
Nathan Harold29589fc2016-03-30 21:53:48 -07009886 * Setting to enable verbose logging in Wi-Fi; disabled by default, and setting to 1
9887 * will enable it. In the future, additional values may be supported.
9888 * @hide
9889 */
9890 public static final String WIFI_VERBOSE_LOGGING_ENABLED =
9891 "wifi_verbose_logging_enabled";
9892
Jong Wook Kim0a20eda2018-01-05 18:40:25 -08009893 /**
9894 * Setting to enable connected MAC randomization in Wi-Fi; disabled by default, and
9895 * setting to 1 will enable it. In the future, additional values may be supported.
9896 * @hide
9897 */
9898 public static final String WIFI_CONNECTED_MAC_RANDOMIZATION_ENABLED =
9899 "wifi_connected_mac_randomization_enabled";
9900
Michael Plassf1510fb2018-02-28 16:08:47 -08009901 /**
9902 * Parameters to adjust the performance of framework wifi scoring methods.
9903 * <p>
9904 * Encoded as a comma-separated key=value list, for example:
9905 * "rssi5=-80:-77:-70:-57,rssi2=-83:-80:-73:-60,horizon=15"
9906 * This is intended for experimenting with new parameter values,
9907 * and is normally unset or empty. The example does not include all
9908 * parameters that may be honored.
9909 * Default values are provided by code or device configurations.
9910 * Errors in the parameters will cause the entire setting to be ignored.
9911 * @hide
9912 */
9913 public static final String WIFI_SCORE_PARAMS =
9914 "wifi_score_params";
9915
Nathan Harold29589fc2016-03-30 21:53:48 -07009916 /**
Christopher Tate06efb532012-08-24 15:29:27 -07009917 * The maximum number of times we will retry a connection to an access
9918 * point for which we have failed in acquiring an IP address from DHCP.
9919 * A value of N means that we will make N+1 connection attempts in all.
9920 */
9921 public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count";
9922
9923 /**
9924 * Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile
9925 * data connectivity to be established after a disconnect from Wi-Fi.
9926 */
9927 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
9928 "wifi_mobile_data_transition_wakelock_timeout_ms";
9929
9930 /**
Zoltan Szatmary-Ban4045d242015-05-27 12:42:39 +01009931 * This setting controls whether WiFi configurations created by a Device Owner app
9932 * should be locked down (that is, be editable or removable only by the Device Owner App,
9933 * not even by Settings app).
9934 * This setting takes integer values. Non-zero values mean DO created configurations
9935 * are locked down. Value of zero means they are not. Default value in the absence of
9936 * actual value to this setting is 0.
9937 */
9938 public static final String WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN =
9939 "wifi_device_owner_configs_lockdown";
9940
9941 /**
Christopher Tate06efb532012-08-24 15:29:27 -07009942 * The operational wifi frequency band
9943 * Set to one of {@link WifiManager#WIFI_FREQUENCY_BAND_AUTO},
9944 * {@link WifiManager#WIFI_FREQUENCY_BAND_5GHZ} or
9945 * {@link WifiManager#WIFI_FREQUENCY_BAND_2GHZ}
9946 *
9947 * @hide
9948 */
9949 public static final String WIFI_FREQUENCY_BAND = "wifi_frequency_band";
9950
9951 /**
9952 * The Wi-Fi peer-to-peer device name
9953 * @hide
9954 */
9955 public static final String WIFI_P2P_DEVICE_NAME = "wifi_p2p_device_name";
9956
9957 /**
Robert Greenwaltc12783a2013-05-16 12:48:20 -07009958 * The min time between wifi disable and wifi enable
9959 * @hide
9960 */
9961 public static final String WIFI_REENABLE_DELAY_MS = "wifi_reenable_delay";
9962
9963 /**
Jeff Davidsona20ca67d2014-12-16 11:48:54 -08009964 * Timeout for ephemeral networks when all known BSSIDs go out of range. We will disconnect
9965 * from an ephemeral network if there is no BSSID for that network with a non-null score that
9966 * has been seen in this time period.
9967 *
9968 * If this is less than or equal to zero, we use a more conservative behavior and only check
9969 * for a non-null score from the currently connected or target BSSID.
9970 * @hide
9971 */
9972 public static final String WIFI_EPHEMERAL_OUT_OF_RANGE_TIMEOUT_MS =
9973 "wifi_ephemeral_out_of_range_timeout_ms";
9974
9975 /**
Christopher Tatec868b642012-09-12 17:41:04 -07009976 * The number of milliseconds to delay when checking for data stalls during
9977 * non-aggressive detection. (screen is turned off.)
9978 * @hide
9979 */
9980 public static final String DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS =
9981 "data_stall_alarm_non_aggressive_delay_in_ms";
9982
9983 /**
9984 * The number of milliseconds to delay when checking for data stalls during
9985 * aggressive detection. (screen on or suspected data stall)
9986 * @hide
9987 */
9988 public static final String DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS =
9989 "data_stall_alarm_aggressive_delay_in_ms";
9990
9991 /**
Wink Savillece1e3792013-09-03 16:41:44 -07009992 * The number of milliseconds to allow the provisioning apn to remain active
9993 * @hide
9994 */
9995 public static final String PROVISIONING_APN_ALARM_DELAY_IN_MS =
9996 "provisioning_apn_alarm_delay_in_ms";
9997
9998 /**
Christopher Tatec868b642012-09-12 17:41:04 -07009999 * The interval in milliseconds at which to check gprs registration
10000 * after the first registration mismatch of gprs and voice service,
10001 * to detect possible data network registration problems.
10002 *
10003 * @hide
10004 */
10005 public static final String GPRS_REGISTER_CHECK_PERIOD_MS =
10006 "gprs_register_check_period_ms";
10007
10008 /**
Christopher Tate06efb532012-08-24 15:29:27 -070010009 * Nonzero causes Log.wtf() to crash.
10010 * @hide
10011 */
10012 public static final String WTF_IS_FATAL = "wtf_is_fatal";
10013
Eric Laurentbc0fab1f2012-09-19 11:24:41 -070010014 /**
10015 * Ringer mode. This is used internally, changing this value will not
10016 * change the ringer mode. See AudioManager.
10017 */
10018 public static final String MODE_RINGER = "mode_ringer";
Christopher Tate06efb532012-08-24 15:29:27 -070010019
Jeff Brownd4935962012-09-25 13:27:20 -070010020 /**
10021 * Overlay display devices setting.
10022 * The associated value is a specially formatted string that describes the
10023 * size and density of simulated secondary display devices.
10024 * <p>
10025 * Format: {width}x{height}/{dpi};...
10026 * </p><p>
10027 * Example:
10028 * <ul>
10029 * <li><code>1280x720/213</code>: make one overlay that is 1280x720 at 213dpi.</li>
10030 * <li><code>1920x1080/320;1280x720/213</code>: make two overlays, the first
10031 * at 1080p and the second at 720p.</li>
10032 * <li>If the value is empty, then no overlay display devices are created.</li>
10033 * </ul></p>
10034 *
10035 * @hide
10036 */
10037 public static final String OVERLAY_DISPLAY_DEVICES = "overlay_display_devices";
Christopher Tate06efb532012-08-24 15:29:27 -070010038
Jeff Sharkey625239a2012-09-26 22:03:49 -070010039 /**
10040 * Threshold values for the duration and level of a discharge cycle,
10041 * under which we log discharge cycle info.
10042 *
10043 * @hide
10044 */
10045 public static final String
10046 BATTERY_DISCHARGE_DURATION_THRESHOLD = "battery_discharge_duration_threshold";
10047
10048 /** @hide */
10049 public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold";
10050
10051 /**
10052 * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR
10053 * intents on application crashes and ANRs. If this is disabled, the
10054 * crash/ANR dialog will never display the "Report" button.
10055 * <p>
10056 * Type: int (0 = disallow, 1 = allow)
10057 *
10058 * @hide
10059 */
10060 public static final String SEND_ACTION_APP_ERROR = "send_action_app_error";
10061
10062 /**
10063 * Maximum age of entries kept by {@link DropBoxManager}.
10064 *
10065 * @hide
10066 */
10067 public static final String DROPBOX_AGE_SECONDS = "dropbox_age_seconds";
10068
10069 /**
10070 * Maximum number of entry files which {@link DropBoxManager} will keep
10071 * around.
10072 *
10073 * @hide
10074 */
10075 public static final String DROPBOX_MAX_FILES = "dropbox_max_files";
10076
10077 /**
10078 * Maximum amount of disk space used by {@link DropBoxManager} no matter
10079 * what.
10080 *
10081 * @hide
10082 */
10083 public static final String DROPBOX_QUOTA_KB = "dropbox_quota_kb";
10084
10085 /**
10086 * Percent of free disk (excluding reserve) which {@link DropBoxManager}
10087 * will use.
10088 *
10089 * @hide
10090 */
10091 public static final String DROPBOX_QUOTA_PERCENT = "dropbox_quota_percent";
10092
10093 /**
10094 * Percent of total disk which {@link DropBoxManager} will never dip
10095 * into.
10096 *
10097 * @hide
10098 */
10099 public static final String DROPBOX_RESERVE_PERCENT = "dropbox_reserve_percent";
10100
10101 /**
10102 * Prefix for per-tag dropbox disable/enable settings.
10103 *
10104 * @hide
10105 */
10106 public static final String DROPBOX_TAG_PREFIX = "dropbox:";
10107
10108 /**
10109 * Lines of logcat to include with system crash/ANR/etc. reports, as a
10110 * prefix of the dropbox tag of the report type. For example,
10111 * "logcat_for_system_server_anr" controls the lines of logcat captured
10112 * with system server ANR reports. 0 to disable.
10113 *
10114 * @hide
10115 */
10116 public static final String ERROR_LOGCAT_PREFIX = "logcat_for_";
10117
10118 /**
10119 * The interval in minutes after which the amount of free storage left
10120 * on the device is logged to the event log
10121 *
10122 * @hide
10123 */
10124 public static final String SYS_FREE_STORAGE_LOG_INTERVAL = "sys_free_storage_log_interval";
10125
10126 /**
10127 * Threshold for the amount of change in disk free space required to
10128 * report the amount of free space. Used to prevent spamming the logs
10129 * when the disk free space isn't changing frequently.
10130 *
10131 * @hide
10132 */
10133 public static final String
10134 DISK_FREE_CHANGE_REPORTING_THRESHOLD = "disk_free_change_reporting_threshold";
10135
10136 /**
10137 * Minimum percentage of free storage on the device that is used to
10138 * determine if the device is running low on storage. The default is 10.
10139 * <p>
10140 * Say this value is set to 10, the device is considered running low on
10141 * storage if 90% or more of the device storage is filled up.
10142 *
10143 * @hide
10144 */
10145 public static final String
10146 SYS_STORAGE_THRESHOLD_PERCENTAGE = "sys_storage_threshold_percentage";
10147
10148 /**
10149 * Maximum byte size of the low storage threshold. This is to ensure
10150 * that {@link #SYS_STORAGE_THRESHOLD_PERCENTAGE} does not result in an
10151 * overly large threshold for large storage devices. Currently this must
10152 * be less than 2GB. This default is 500MB.
10153 *
10154 * @hide
10155 */
10156 public static final String
10157 SYS_STORAGE_THRESHOLD_MAX_BYTES = "sys_storage_threshold_max_bytes";
10158
10159 /**
10160 * Minimum bytes of free storage on the device before the data partition
10161 * is considered full. By default, 1 MB is reserved to avoid system-wide
10162 * SQLite disk full exceptions.
10163 *
10164 * @hide
10165 */
10166 public static final String
10167 SYS_STORAGE_FULL_THRESHOLD_BYTES = "sys_storage_full_threshold_bytes";
10168
10169 /**
Jeff Sharkeyd5d5e922017-02-21 10:51:23 -070010170 * Minimum percentage of storage on the device that is reserved for
10171 * cached data.
10172 *
10173 * @hide
10174 */
10175 public static final String
10176 SYS_STORAGE_CACHE_PERCENTAGE = "sys_storage_cache_percentage";
10177
10178 /**
10179 * Maximum bytes of storage on the device that is reserved for cached
10180 * data.
10181 *
10182 * @hide
10183 */
10184 public static final String
10185 SYS_STORAGE_CACHE_MAX_BYTES = "sys_storage_cache_max_bytes";
10186
10187 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -070010188 * The maximum reconnect delay for short network outages or when the
10189 * network is suspended due to phone use.
10190 *
10191 * @hide
10192 */
10193 public static final String
10194 SYNC_MAX_RETRY_DELAY_IN_SECONDS = "sync_max_retry_delay_in_seconds";
10195
10196 /**
10197 * The number of milliseconds to delay before sending out
Erik Kline8f29dcf2014-12-08 16:25:20 +090010198 * {@link ConnectivityManager#CONNECTIVITY_ACTION} broadcasts. Ignored.
Jeff Sharkey625239a2012-09-26 22:03:49 -070010199 *
10200 * @hide
10201 */
10202 public static final String CONNECTIVITY_CHANGE_DELAY = "connectivity_change_delay";
10203
Vinit Deshapnde1f12cb52013-08-21 13:09:01 -070010204
10205 /**
10206 * Network sampling interval, in seconds. We'll generate link information
10207 * about bytes/packets sent and error rates based on data sampled in this interval
10208 *
10209 * @hide
10210 */
10211
10212 public static final String CONNECTIVITY_SAMPLING_INTERVAL_IN_SECONDS =
10213 "connectivity_sampling_interval_in_seconds";
10214
Jeff Sharkey625239a2012-09-26 22:03:49 -070010215 /**
Jason Monk602b2322013-07-03 17:04:33 -040010216 * The series of successively longer delays used in retrying to download PAC file.
10217 * Last delay is used between successful PAC downloads.
10218 *
10219 * @hide
10220 */
10221 public static final String PAC_CHANGE_DELAY = "pac_change_delay";
10222
10223 /**
Calvin Onbe96da12016-10-11 15:10:46 -070010224 * Don't attempt to detect captive portals.
Jeff Sharkey625239a2012-09-26 22:03:49 -070010225 *
10226 * @hide
10227 */
Calvin Onbe96da12016-10-11 15:10:46 -070010228 public static final int CAPTIVE_PORTAL_MODE_IGNORE = 0;
10229
10230 /**
10231 * When detecting a captive portal, display a notification that
10232 * prompts the user to sign in.
10233 *
10234 * @hide
10235 */
10236 public static final int CAPTIVE_PORTAL_MODE_PROMPT = 1;
10237
10238 /**
10239 * When detecting a captive portal, immediately disconnect from the
10240 * network and do not reconnect to that network in the future.
10241 *
10242 * @hide
10243 */
10244 public static final int CAPTIVE_PORTAL_MODE_AVOID = 2;
10245
10246 /**
10247 * What to do when connecting a network that presents a captive portal.
10248 * Must be one of the CAPTIVE_PORTAL_MODE_* constants above.
10249 *
10250 * The default for this setting is CAPTIVE_PORTAL_MODE_PROMPT.
10251 * @hide
10252 */
10253 public static final String CAPTIVE_PORTAL_MODE = "captive_portal_mode";
10254
10255 /**
10256 * Setting to turn off captive portal detection. Feature is enabled by
10257 * default and the setting needs to be set to 0 to disable it.
10258 *
10259 * @deprecated use CAPTIVE_PORTAL_MODE_IGNORE to disable captive portal detection
10260 * @hide
10261 */
10262 @Deprecated
Jeff Sharkey625239a2012-09-26 22:03:49 -070010263 public static final String
10264 CAPTIVE_PORTAL_DETECTION_ENABLED = "captive_portal_detection_enabled";
10265
10266 /**
10267 * The server used for captive portal detection upon a new conection. A
10268 * 204 response code from the server is used for validation.
Hugo Benichi92eb22fd2016-09-27 13:01:41 +090010269 * TODO: remove this deprecated symbol.
Jeff Sharkey625239a2012-09-26 22:03:49 -070010270 *
10271 * @hide
10272 */
10273 public static final String CAPTIVE_PORTAL_SERVER = "captive_portal_server";
10274
10275 /**
Hugo Benichi92eb22fd2016-09-27 13:01:41 +090010276 * The URL used for HTTPS captive portal detection upon a new connection.
10277 * A 204 response code from the server is used for validation.
10278 *
10279 * @hide
10280 */
10281 public static final String CAPTIVE_PORTAL_HTTPS_URL = "captive_portal_https_url";
10282
10283 /**
10284 * The URL used for HTTP captive portal detection upon a new connection.
10285 * A 204 response code from the server is used for validation.
10286 *
10287 * @hide
10288 */
10289 public static final String CAPTIVE_PORTAL_HTTP_URL = "captive_portal_http_url";
10290
10291 /**
10292 * The URL used for fallback HTTP captive portal detection when previous HTTP
10293 * and HTTPS captive portal detection attemps did not return a conclusive answer.
10294 *
10295 * @hide
10296 */
10297 public static final String CAPTIVE_PORTAL_FALLBACK_URL = "captive_portal_fallback_url";
10298
10299 /**
Hugo Benichieef918a2017-04-10 17:43:08 +090010300 * A comma separated list of URLs used for captive portal detection in addition to the
10301 * fallback HTTP url associated with the CAPTIVE_PORTAL_FALLBACK_URL settings.
10302 *
10303 * @hide
10304 */
10305 public static final String CAPTIVE_PORTAL_OTHER_FALLBACK_URLS =
10306 "captive_portal_other_fallback_urls";
10307
10308 /**
Remi NGUYEN VAN8255c2d2018-05-22 10:01:53 +090010309 * A list of captive portal detection specifications used in addition to the fallback URLs.
10310 * Each spec has the format url@@/@@statusCodeRegex@@/@@contentRegex. Specs are separated
10311 * by "@@,@@".
10312 * @hide
10313 */
10314 public static final String CAPTIVE_PORTAL_FALLBACK_PROBE_SPECS =
10315 "captive_portal_fallback_probe_specs";
10316
10317 /**
Lorenzo Colittic5be12e2016-04-19 21:57:31 +090010318 * Whether to use HTTPS for network validation. This is enabled by default and the setting
10319 * needs to be set to 0 to disable it. This setting is a misnomer because captive portals
10320 * don't actually use HTTPS, but it's consistent with the other settings.
10321 *
10322 * @hide
10323 */
10324 public static final String CAPTIVE_PORTAL_USE_HTTPS = "captive_portal_use_https";
10325
10326 /**
Hugo Benichi92eb22fd2016-09-27 13:01:41 +090010327 * Which User-Agent string to use in the header of the captive portal detection probes.
10328 * The User-Agent field is unset when this setting has no value (HttpUrlConnection default).
10329 *
10330 * @hide
10331 */
10332 public static final String CAPTIVE_PORTAL_USER_AGENT = "captive_portal_user_agent";
10333
10334 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -070010335 * Whether network service discovery is enabled.
10336 *
10337 * @hide
10338 */
10339 public static final String NSD_ON = "nsd_on";
10340
10341 /**
10342 * Let user pick default install location.
10343 *
10344 * @hide
10345 */
10346 public static final String SET_INSTALL_LOCATION = "set_install_location";
10347
10348 /**
10349 * Default install location value.
10350 * 0 = auto, let system decide
10351 * 1 = internal
10352 * 2 = sdcard
10353 * @hide
10354 */
10355 public static final String DEFAULT_INSTALL_LOCATION = "default_install_location";
10356
10357 /**
10358 * ms during which to consume extra events related to Inet connection
10359 * condition after a transtion to fully-connected
10360 *
10361 * @hide
10362 */
10363 public static final String
10364 INET_CONDITION_DEBOUNCE_UP_DELAY = "inet_condition_debounce_up_delay";
10365
10366 /**
10367 * ms during which to consume extra events related to Inet connection
10368 * condtion after a transtion to partly-connected
10369 *
10370 * @hide
10371 */
10372 public static final String
10373 INET_CONDITION_DEBOUNCE_DOWN_DELAY = "inet_condition_debounce_down_delay";
10374
10375 /** {@hide} */
10376 public static final String
10377 READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT = "read_external_storage_enforced_default";
10378
10379 /**
10380 * Host name and port for global http proxy. Uses ':' seperator for
10381 * between host and port.
10382 */
10383 public static final String HTTP_PROXY = "http_proxy";
10384
10385 /**
10386 * Host name for global http proxy. Set via ConnectivityManager.
10387 *
10388 * @hide
10389 */
10390 public static final String GLOBAL_HTTP_PROXY_HOST = "global_http_proxy_host";
10391
10392 /**
10393 * Integer host port for global http proxy. Set via ConnectivityManager.
10394 *
10395 * @hide
10396 */
10397 public static final String GLOBAL_HTTP_PROXY_PORT = "global_http_proxy_port";
10398
10399 /**
10400 * Exclusion list for global proxy. This string contains a list of
10401 * comma-separated domains where the global proxy does not apply.
10402 * Domains should be listed in a comma- separated list. Example of
10403 * acceptable formats: ".domain1.com,my.domain2.com" Use
10404 * ConnectivityManager to set/get.
10405 *
10406 * @hide
10407 */
10408 public static final String
10409 GLOBAL_HTTP_PROXY_EXCLUSION_LIST = "global_http_proxy_exclusion_list";
10410
10411 /**
Jason Monk602b2322013-07-03 17:04:33 -040010412 * The location PAC File for the proxy.
10413 * @hide
10414 */
10415 public static final String
10416 GLOBAL_HTTP_PROXY_PAC = "global_proxy_pac_url";
10417
10418 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -070010419 * Enables the UI setting to allow the user to specify the global HTTP
10420 * proxy and associated exclusion list.
10421 *
10422 * @hide
10423 */
10424 public static final String SET_GLOBAL_HTTP_PROXY = "set_global_http_proxy";
10425
10426 /**
10427 * Setting for default DNS in case nobody suggests one
10428 *
10429 * @hide
10430 */
10431 public static final String DEFAULT_DNS_SERVER = "default_dns_server";
10432
Ben Schwartzbccbd002017-10-02 13:27:13 -040010433 /**
Erik Kline4d092232017-10-30 15:29:44 +090010434 * The requested Private DNS mode (string), and an accompanying specifier (string).
10435 *
10436 * Currently, the specifier holds the chosen provider name when the mode requests
10437 * a specific provider. It may be used to store the provider name even when the
10438 * mode changes so that temporarily disabling and re-enabling the specific
10439 * provider mode does not necessitate retyping the provider hostname.
Ben Schwartzbccbd002017-10-02 13:27:13 -040010440 *
10441 * @hide
10442 */
Erik Kline4d092232017-10-30 15:29:44 +090010443 public static final String PRIVATE_DNS_MODE = "private_dns_mode";
Michal Karpinski5db1e432018-01-18 20:10:24 +000010444
10445 private static final Validator PRIVATE_DNS_MODE_VALIDATOR = ANY_STRING_VALIDATOR;
10446
Erik Kline4d092232017-10-30 15:29:44 +090010447 /**
10448 * @hide
10449 */
10450 public static final String PRIVATE_DNS_SPECIFIER = "private_dns_specifier";
Ben Schwartzbccbd002017-10-02 13:27:13 -040010451
Michal Karpinski5db1e432018-01-18 20:10:24 +000010452 private static final Validator PRIVATE_DNS_SPECIFIER_VALIDATOR = ANY_STRING_VALIDATOR;
10453
Erik Kline19841792018-05-16 16:41:57 +090010454 /**
10455 * Forced override of the default mode (hardcoded as "automatic", nee "opportunistic").
10456 * This allows changing the default mode without effectively disabling other modes,
10457 * all of which require explicit user action to enable/configure. See also b/79719289.
10458 *
10459 * Value is a string, suitable for assignment to PRIVATE_DNS_MODE above.
10460 *
10461 * {@hide}
10462 */
10463 public static final String PRIVATE_DNS_DEFAULT_MODE = "private_dns_default_mode";
10464
Jeff Sharkey0ac10282012-10-01 12:50:22 -070010465 /** {@hide} */
10466 public static final String
10467 BLUETOOTH_HEADSET_PRIORITY_PREFIX = "bluetooth_headset_priority_";
10468 /** {@hide} */
10469 public static final String
10470 BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX = "bluetooth_a2dp_sink_priority_";
10471 /** {@hide} */
10472 public static final String
Sanket Agarwal1bec6a52015-10-21 18:23:27 -070010473 BLUETOOTH_A2DP_SRC_PRIORITY_PREFIX = "bluetooth_a2dp_src_priority_";
10474 /** {@hide} */
Antony Sargentf5772c62017-04-26 16:37:53 -070010475 public static final String BLUETOOTH_A2DP_SUPPORTS_OPTIONAL_CODECS_PREFIX =
10476 "bluetooth_a2dp_supports_optional_codecs_";
10477 /** {@hide} */
10478 public static final String BLUETOOTH_A2DP_OPTIONAL_CODECS_ENABLED_PREFIX =
10479 "bluetooth_a2dp_optional_codecs_enabled_";
10480 /** {@hide} */
Sanket Agarwal1bec6a52015-10-21 18:23:27 -070010481 public static final String
Jeff Sharkey0ac10282012-10-01 12:50:22 -070010482 BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX = "bluetooth_input_device_priority_";
Kim Schulz0d376052013-08-22 11:18:02 +020010483 /** {@hide} */
10484 public static final String
10485 BLUETOOTH_MAP_PRIORITY_PREFIX = "bluetooth_map_priority_";
Casper Bonde2a5f6082015-03-19 10:36:45 +010010486 /** {@hide} */
10487 public static final String
Joseph Pirozzo631768d2016-09-01 14:19:28 -070010488 BLUETOOTH_MAP_CLIENT_PRIORITY_PREFIX = "bluetooth_map_client_priority_";
10489 /** {@hide} */
10490 public static final String
Joseph Pirozzo563c7002016-03-21 15:49:48 -070010491 BLUETOOTH_PBAP_CLIENT_PRIORITY_PREFIX = "bluetooth_pbap_client_priority_";
10492 /** {@hide} */
10493 public static final String
Casper Bonde2a5f6082015-03-19 10:36:45 +010010494 BLUETOOTH_SAP_PRIORITY_PREFIX = "bluetooth_sap_priority_";
Sanket Agarwal773297a2016-08-04 16:16:20 -070010495 /** {@hide} */
10496 public static final String
10497 BLUETOOTH_PAN_PRIORITY_PREFIX = "bluetooth_pan_priority_";
Jakub Pawlowskic2d7be62017-11-22 10:57:42 -080010498 /** {@hide} */
10499 public static final String
10500 BLUETOOTH_HEARING_AID_PRIORITY_PREFIX = "bluetooth_hearing_aid_priority_";
Jeff Sharkey0ac10282012-10-01 12:50:22 -070010501
10502 /**
Dianne Hackborn0ef403e2017-01-24 18:22:15 -080010503 * Activity manager specific settings.
10504 * This is encoded as a key=value list, separated by commas. Ex:
10505 *
Dianne Hackborn83b40f62017-04-26 13:59:47 -070010506 * "gc_timeout=5000,max_cached_processes=24"
Dianne Hackborn0ef403e2017-01-24 18:22:15 -080010507 *
10508 * The following keys are supported:
10509 *
10510 * <pre>
Dianne Hackborn0ef403e2017-01-24 18:22:15 -080010511 * max_cached_processes (int)
Dianne Hackborn83b40f62017-04-26 13:59:47 -070010512 * background_settle_time (long)
Dianne Hackborncb015632017-06-14 17:30:15 -070010513 * fgservice_min_shown_time (long)
10514 * fgservice_min_report_time (long)
10515 * fgservice_screen_on_before_time (long)
10516 * fgservice_screen_on_after_time (long)
Dianne Hackborn83b40f62017-04-26 13:59:47 -070010517 * content_provider_retain_time (long)
10518 * gc_timeout (long)
10519 * gc_min_interval (long)
10520 * full_pss_min_interval (long)
10521 * full_pss_lowered_interval (long)
Dianne Hackbornffca58b2017-05-24 16:15:45 -070010522 * power_check_interval (long)
10523 * power_check_max_cpu_1 (int)
10524 * power_check_max_cpu_2 (int)
10525 * power_check_max_cpu_3 (int)
10526 * power_check_max_cpu_4 (int)
Dianne Hackborn83b40f62017-04-26 13:59:47 -070010527 * service_usage_interaction_time (long)
10528 * usage_stats_interaction_interval (long)
10529 * service_restart_duration (long)
10530 * service_reset_run_duration (long)
10531 * service_restart_duration_factor (int)
10532 * service_min_restart_time_between (long)
10533 * service_max_inactivity (long)
10534 * service_bg_start_timeout (long)
Sudheer Shankaf6690102017-10-16 10:20:32 -070010535 * process_start_async (boolean)
Dianne Hackborn0ef403e2017-01-24 18:22:15 -080010536 * </pre>
10537 *
10538 * <p>
10539 * Type: string
10540 * @hide
10541 * @see com.android.server.am.ActivityManagerConstants
10542 */
10543 public static final String ACTIVITY_MANAGER_CONSTANTS = "activity_manager_constants";
10544
10545 /**
Dianne Hackborn65a4f252018-05-08 17:30:48 -070010546 * App ops specific settings.
10547 * This is encoded as a key=value list, separated by commas. Ex:
10548 *
10549 * "state_settle_time=10000"
10550 *
10551 * The following keys are supported:
10552 *
10553 * <pre>
Dianne Hackborne93ab412018-05-14 17:52:30 -070010554 * top_state_settle_time (long)
10555 * fg_service_state_settle_time (long)
10556 * bg_state_settle_time (long)
Dianne Hackborn65a4f252018-05-08 17:30:48 -070010557 * </pre>
10558 *
10559 * <p>
10560 * Type: string
10561 * @hide
10562 * @see com.android.server.AppOpsService.Constants
10563 */
10564 public static final String APP_OPS_CONSTANTS = "app_ops_constants";
10565
10566 /**
Adam Lesinski31c05d12015-06-09 17:34:04 -070010567 * Device Idle (Doze) specific settings.
10568 * This is encoded as a key=value list, separated by commas. Ex:
10569 *
Henrik Baardeac10ab2016-04-19 07:50:24 +020010570 * "inactive_to=60000,sensing_to=400000"
Adam Lesinski31c05d12015-06-09 17:34:04 -070010571 *
10572 * The following keys are supported:
10573 *
10574 * <pre>
10575 * inactive_to (long)
10576 * sensing_to (long)
10577 * motion_inactive_to (long)
10578 * idle_after_inactive_to (long)
10579 * idle_pending_to (long)
10580 * max_idle_pending_to (long)
10581 * idle_pending_factor (float)
10582 * idle_to (long)
10583 * max_idle_to (long)
10584 * idle_factor (float)
10585 * min_time_to_alarm (long)
10586 * max_temp_app_whitelist_duration (long)
Felipe Lemea1b79bf2016-05-24 13:06:54 -070010587 * notification_whitelist_duration (long)
Adam Lesinski31c05d12015-06-09 17:34:04 -070010588 * </pre>
10589 *
10590 * <p>
10591 * Type: string
10592 * @hide
10593 * @see com.android.server.DeviceIdleController.Constants
10594 */
10595 public static final String DEVICE_IDLE_CONSTANTS = "device_idle_constants";
10596
10597 /**
jackqdyulei455e90a2017-02-09 15:29:16 -080010598 * Battery Saver specific settings
10599 * This is encoded as a key=value list, separated by commas. Ex:
10600 *
10601 * "vibration_disabled=true,adjust_brightness_factor=0.5"
10602 *
10603 * The following keys are supported:
10604 *
10605 * <pre>
10606 * vibration_disabled (boolean)
10607 * animation_disabled (boolean)
10608 * soundtrigger_disabled (boolean)
10609 * fullbackup_deferred (boolean)
10610 * keyvaluebackup_deferred (boolean)
10611 * firewall_disabled (boolean)
10612 * gps_mode (int)
10613 * adjust_brightness_disabled (boolean)
10614 * adjust_brightness_factor (float)
10615 * </pre>
10616 * @hide
10617 * @see com.android.server.power.BatterySaverPolicy
10618 */
10619 public static final String BATTERY_SAVER_CONSTANTS = "battery_saver_constants";
10620
10621 /**
Makoto Onuki66a78122017-11-14 15:03:21 -080010622 * Battery Saver device specific settings
10623 * This is encoded as a key=value list, separated by commas.
10624 * See {@link com.android.server.power.BatterySaverPolicy} for the details.
10625 *
10626 * @hide
10627 */
10628 public static final String BATTERY_SAVER_DEVICE_SPECIFIC_CONSTANTS =
10629 "battery_saver_device_specific_constants";
10630
10631 /**
jackqdyulei29f91ea2017-12-13 15:01:43 -080010632 * Battery tip specific settings
10633 * This is encoded as a key=value list, separated by commas. Ex:
10634 *
10635 * "battery_tip_enabled=true,summary_enabled=true,high_usage_enabled=true,"
jackqdyulei87321192018-01-19 14:24:54 -080010636 * "high_usage_app_count=3,reduced_battery_enabled=false,reduced_battery_percent=50,"
10637 * "high_usage_battery_draining=25,high_usage_period_ms=3000"
jackqdyulei29f91ea2017-12-13 15:01:43 -080010638 *
10639 * The following keys are supported:
10640 *
10641 * <pre>
10642 * battery_tip_enabled (boolean)
10643 * summary_enabled (boolean)
10644 * battery_saver_tip_enabled (boolean)
10645 * high_usage_enabled (boolean)
10646 * high_usage_app_count (int)
jackqdyulei87321192018-01-19 14:24:54 -080010647 * high_usage_period_ms (long)
10648 * high_usage_battery_draining (int)
jackqdyulei29f91ea2017-12-13 15:01:43 -080010649 * app_restriction_enabled (boolean)
10650 * reduced_battery_enabled (boolean)
10651 * reduced_battery_percent (int)
10652 * low_battery_enabled (boolean)
10653 * low_battery_hour (int)
10654 * </pre>
10655 * @hide
10656 */
10657 public static final String BATTERY_TIP_CONSTANTS = "battery_tip_constants";
10658
10659 /**
Kweku Adams3699c362018-03-13 13:32:34 -070010660 * Battery anomaly detection specific settings
10661 * This is encoded as a key=value list, separated by commas.
10662 * wakeup_blacklisted_tags is a string, encoded as a set of tags, encoded via
10663 * {@link Uri#encode(String)}, separated by colons. Ex:
10664 *
10665 * "anomaly_detection_enabled=true,wakelock_threshold=2000,wakeup_alarm_enabled=true,"
10666 * "wakeup_alarm_threshold=10,wakeup_blacklisted_tags=tag1:tag2:with%2Ccomma:with%3Acolon"
10667 *
10668 * The following keys are supported:
10669 *
10670 * <pre>
10671 * anomaly_detection_enabled (boolean)
10672 * wakelock_enabled (boolean)
10673 * wakelock_threshold (long)
10674 * wakeup_alarm_enabled (boolean)
10675 * wakeup_alarm_threshold (long)
10676 * wakeup_blacklisted_tags (string)
10677 * bluetooth_scan_enabled (boolean)
10678 * bluetooth_scan_threshold (long)
10679 * </pre>
10680 * @hide
10681 */
10682 public static final String ANOMALY_DETECTION_CONSTANTS = "anomaly_detection_constants";
10683
10684 /**
jackqdyuleifa81bee2018-02-01 11:16:23 -080010685 * An integer to show the version of the anomaly config. Ex: 1, which means
10686 * current version is 1.
10687 * @hide
10688 */
10689 public static final String ANOMALY_CONFIG_VERSION = "anomaly_config_version";
10690
10691 /**
10692 * A base64-encoded string represents anomaly stats config, used for
10693 * {@link android.app.StatsManager}.
10694 * @hide
10695 */
10696 public static final String ANOMALY_CONFIG = "anomaly_config";
10697
10698 /**
jackqdyulei8443dd02017-08-24 16:14:34 -070010699 * Always on display(AOD) specific settings
10700 * This is encoded as a key=value list, separated by commas. Ex:
10701 *
10702 * "prox_screen_off_delay=10000,screen_brightness_array=0:1:2:3:4"
10703 *
10704 * The following keys are supported:
10705 *
10706 * <pre>
Chris Wren41707512017-12-06 00:12:17 -050010707 * screen_brightness_array (int[])
10708 * dimming_scrim_array (int[])
jackqdyulei8443dd02017-08-24 16:14:34 -070010709 * prox_screen_off_delay (long)
10710 * prox_cooldown_trigger (long)
10711 * prox_cooldown_period (long)
10712 * </pre>
10713 * @hide
10714 */
10715 public static final String ALWAYS_ON_DISPLAY_CONSTANTS = "always_on_display_constants";
10716
10717 /**
Shikhar Srivastav9a896a6c2018-01-09 16:58:36 -080010718 * System VDSO global setting. This links to the "sys.vdso" system property.
10719 * The following values are supported:
10720 * false -> both 32 and 64 bit vdso disabled
10721 * 32 -> 32 bit vdso enabled
10722 * 64 -> 64 bit vdso enabled
10723 * Any other value defaults to both 32 bit and 64 bit true.
10724 * @hide
10725 */
10726 public static final String SYS_VDSO = "sys_vdso";
10727
10728 /**
Marissa Wall04e7a9b2018-02-02 09:35:58 -080010729 * UidCpuPower global setting. This links the sys.uidcpupower system property.
10730 * The following values are supported:
10731 * 0 -> /proc/uid_cpupower/* are disabled
10732 * 1 -> /proc/uid_cpupower/* are enabled
10733 * Any other value defaults to enabled.
10734 * @hide
10735 */
10736 public static final String SYS_UIDCPUPOWER = "sys_uidcpupower";
10737
10738 /**
Hector Dearmancf92ca12018-03-07 11:12:35 +000010739 * traced global setting. This controls weather the deamons: traced and
10740 * traced_probes run. This links the sys.traced system property.
10741 * The following values are supported:
10742 * 0 -> traced and traced_probes are disabled
10743 * 1 -> traced and traced_probes are enabled
10744 * Any other value defaults to disabled.
10745 * @hide
10746 */
10747 public static final String SYS_TRACED = "sys_traced";
10748
10749 /**
Makoto Onuki3c9c9982018-01-17 10:46:48 -080010750 * An integer to reduce the FPS by this factor. Only for experiments. Need to reboot the
10751 * device for this setting to take full effect.
10752 *
10753 * @hide
10754 */
10755 public static final String FPS_DEVISOR = "fps_divisor";
10756
10757 /**
Ajay Dudanibcfcd6c2018-02-05 10:44:27 -080010758 * Flag to enable or disable display panel low power mode (lpm)
10759 * false -> Display panel power saving mode is disabled.
10760 * true -> Display panel power saving mode is enabled.
10761 *
10762 * @hide
10763 */
10764 public static final String DISPLAY_PANEL_LPM = "display_panel_lpm";
10765
10766 /**
Adam Lesinskia6232df2015-06-11 18:16:41 -070010767 * App standby (app idle) specific settings.
10768 * This is encoded as a key=value list, separated by commas. Ex:
Amith Yamasani172612c2017-12-15 10:51:53 -080010769 * <p>
Michael Wachenschwanz5ca5cb62018-04-25 16:12:59 -070010770 * "idle_duration=5000,parole_interval=4500,screen_thresholds=0/0/60000/120000"
Amith Yamasani172612c2017-12-15 10:51:53 -080010771 * <p>
10772 * All durations are in millis.
Michael Wachenschwanz5ca5cb62018-04-25 16:12:59 -070010773 * Array values are separated by forward slashes
Adam Lesinskia6232df2015-06-11 18:16:41 -070010774 * The following keys are supported:
10775 *
10776 * <pre>
Michael Wachenschwanz5ca5cb62018-04-25 16:12:59 -070010777 * parole_interval (long)
10778 * parole_window (long)
10779 * parole_duration (long)
10780 * screen_thresholds (long[4])
10781 * elapsed_thresholds (long[4])
10782 * strong_usage_duration (long)
10783 * notification_seen_duration (long)
10784 * system_update_usage_duration (long)
10785 * prediction_timeout (long)
10786 * sync_adapter_duration (long)
10787 * exempted_sync_duration (long)
10788 * system_interaction_duration (long)
10789 * stable_charging_threshold (long)
Adam Lesinskif0ef3c12016-01-13 12:26:07 -080010790 *
10791 * idle_duration (long) // This is deprecated and used to circumvent b/26355386.
Michael Wachenschwanz5ca5cb62018-04-25 16:12:59 -070010792 * idle_duration2 (long) // deprecated
10793 * wallclock_threshold (long) // deprecated
Adam Lesinskia6232df2015-06-11 18:16:41 -070010794 * </pre>
10795 *
10796 * <p>
10797 * Type: string
10798 * @hide
10799 * @see com.android.server.usage.UsageStatsService.SettingsObserver
10800 */
10801 public static final String APP_IDLE_CONSTANTS = "app_idle_constants";
10802
10803 /**
Dianne Hackborn0ef403e2017-01-24 18:22:15 -080010804 * Power manager specific settings.
10805 * This is encoded as a key=value list, separated by commas. Ex:
10806 *
10807 * "no_cached_wake_locks=1"
10808 *
10809 * The following keys are supported:
10810 *
10811 * <pre>
10812 * no_cached_wake_locks (boolean)
10813 * </pre>
10814 *
10815 * <p>
10816 * Type: string
10817 * @hide
10818 * @see com.android.server.power.PowerManagerConstants
10819 */
10820 public static final String POWER_MANAGER_CONSTANTS = "power_manager_constants";
10821
10822 /**
Dianne Hackborna750a632015-06-16 17:18:23 -070010823 * Alarm manager specific settings.
10824 * This is encoded as a key=value list, separated by commas. Ex:
10825 *
10826 * "min_futurity=5000,allow_while_idle_short_time=4500"
10827 *
10828 * The following keys are supported:
10829 *
10830 * <pre>
10831 * min_futurity (long)
10832 * min_interval (long)
10833 * allow_while_idle_short_time (long)
10834 * allow_while_idle_long_time (long)
10835 * allow_while_idle_whitelist_duration (long)
10836 * </pre>
10837 *
10838 * <p>
10839 * Type: string
10840 * @hide
10841 * @see com.android.server.AlarmManagerService.Constants
10842 */
10843 public static final String ALARM_MANAGER_CONSTANTS = "alarm_manager_constants";
10844
10845 /**
Dianne Hackborne9a988c2016-05-27 17:59:40 -070010846 * Job scheduler specific settings.
10847 * This is encoded as a key=value list, separated by commas. Ex:
10848 *
10849 * "min_ready_jobs_count=2,moderate_use_factor=.5"
10850 *
10851 * The following keys are supported:
10852 *
10853 * <pre>
10854 * min_idle_count (int)
10855 * min_charging_count (int)
10856 * min_connectivity_count (int)
10857 * min_content_count (int)
10858 * min_ready_jobs_count (int)
10859 * heavy_use_factor (float)
10860 * moderate_use_factor (float)
10861 * fg_job_count (int)
10862 * bg_normal_job_count (int)
10863 * bg_moderate_job_count (int)
10864 * bg_low_job_count (int)
10865 * bg_critical_job_count (int)
10866 * </pre>
10867 *
10868 * <p>
10869 * Type: string
10870 * @hide
10871 * @see com.android.server.job.JobSchedulerService.Constants
10872 */
10873 public static final String JOB_SCHEDULER_CONSTANTS = "job_scheduler_constants";
10874
10875 /**
Makoto Onuki4362a662016-03-08 18:59:09 -080010876 * ShortcutManager specific settings.
10877 * This is encoded as a key=value list, separated by commas. Ex:
10878 *
Makoto Onukib6d35232016-04-04 15:57:17 -070010879 * "reset_interval_sec=86400,max_updates_per_interval=1"
Makoto Onuki4362a662016-03-08 18:59:09 -080010880 *
10881 * The following keys are supported:
10882 *
10883 * <pre>
10884 * reset_interval_sec (long)
Makoto Onukib6d35232016-04-04 15:57:17 -070010885 * max_updates_per_interval (int)
Makoto Onuki4362a662016-03-08 18:59:09 -080010886 * max_icon_dimension_dp (int, DP)
10887 * max_icon_dimension_dp_lowram (int, DP)
10888 * max_shortcuts (int)
10889 * icon_quality (int, 0-100)
10890 * icon_format (String)
10891 * </pre>
10892 *
10893 * <p>
10894 * Type: string
10895 * @hide
10896 * @see com.android.server.pm.ShortcutService.ConfigConstants
10897 */
10898 public static final String SHORTCUT_MANAGER_CONSTANTS = "shortcut_manager_constants";
10899
10900 /**
Makoto Onuki09c529a2017-05-01 10:05:28 -070010901 * DevicePolicyManager specific settings.
10902 * This is encoded as a key=value list, separated by commas. Ex:
10903 *
10904 * <pre>
10905 * das_died_service_reconnect_backoff_sec (long)
10906 * das_died_service_reconnect_backoff_increase (float)
10907 * das_died_service_reconnect_max_backoff_sec (long)
10908 * </pre>
10909 *
10910 * <p>
10911 * Type: string
10912 * @hide
10913 * see also com.android.server.devicepolicy.DevicePolicyConstants
10914 */
10915 public static final String DEVICE_POLICY_CONSTANTS = "device_policy_constants";
10916
10917 /**
Abodunrinwa Toki0e6b43e2017-09-19 23:18:40 +010010918 * TextClassifier specific settings.
Jan Althaus0aacdb62018-02-19 11:44:37 +010010919 * This is encoded as a key=value list, separated by commas. String[] types like
10920 * entity_list_default use ":" as delimiter for values. Ex:
Abodunrinwa Toki0e6b43e2017-09-19 23:18:40 +010010921 *
10922 * <pre>
Abodunrinwa Tokic7073a42018-02-28 23:02:13 +000010923 * smart_linkify_enabled (boolean)
10924 * system_textclassifier_enabled (boolean)
Abodunrinwa Tokidb8fc312018-02-26 21:37:51 +000010925 * model_dark_launch_enabled (boolean)
10926 * smart_selection_enabled (boolean)
10927 * smart_text_share_enabled (boolean)
10928 * smart_linkify_enabled (boolean)
10929 * smart_select_animation_enabled (boolean)
Jan Althaus108aad32018-01-30 15:26:55 +010010930 * suggest_selection_max_range_length (int)
10931 * classify_text_max_range_length (int)
10932 * generate_links_max_text_length (int)
Jan Althaus31efdc32018-02-19 22:23:13 +010010933 * generate_links_log_sample_rate (int)
Jan Althaus0aacdb62018-02-19 11:44:37 +010010934 * entity_list_default (String[])
10935 * entity_list_not_editable (String[])
10936 * entity_list_editable (String[])
Abodunrinwa Toki0e6b43e2017-09-19 23:18:40 +010010937 * </pre>
10938 *
10939 * <p>
10940 * Type: string
10941 * @hide
Abodunrinwa Tokidb8fc312018-02-26 21:37:51 +000010942 * see also android.view.textclassifier.TextClassificationConstants
Abodunrinwa Toki0e6b43e2017-09-19 23:18:40 +010010943 */
10944 public static final String TEXT_CLASSIFIER_CONSTANTS = "text_classifier_constants";
10945
10946 /**
Sudheer Shanka5c19b892018-01-05 17:25:46 -080010947 * BatteryStats specific settings.
10948 * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true"
10949 *
10950 * The following keys are supported:
10951 * <pre>
10952 * track_cpu_times_by_proc_state (boolean)
Mike Mafae87da2018-01-19 20:07:20 -080010953 * track_cpu_active_cluster_time (boolean)
10954 * read_binary_cpu_time (boolean)
Sudheer Shankac20379e2018-02-15 00:06:21 -080010955 * proc_state_cpu_times_read_delay_ms (long)
Sudheer Shankae56013a2018-04-23 11:22:15 -070010956 * external_stats_collection_rate_limit_ms (long)
Sudheer Shanka0719c6a2018-04-24 11:12:11 -070010957 * battery_level_collection_delay_ms (long)
Sudheer Shanka5c19b892018-01-05 17:25:46 -080010958 * </pre>
10959 *
10960 * <p>
10961 * Type: string
10962 * @hide
10963 * see also com.android.internal.os.BatteryStatsImpl.Constants
10964 */
10965 public static final String BATTERY_STATS_CONSTANTS = "battery_stats_constants";
10966
10967 /**
Makoto Onukiaad2b512018-02-07 09:31:46 -080010968 * SyncManager specific settings.
10969 *
10970 * <p>
10971 * Type: string
10972 * @hide
10973 * @see com.android.server.content.SyncManagerConstants
10974 */
10975 public static final String SYNC_MANAGER_CONSTANTS = "sync_manager_constants";
10976
10977 /**
Lei Yu4b976ad2018-04-19 10:38:58 -070010978 * Whether or not App Standby feature is enabled by system. This controls throttling of apps
10979 * based on usage patterns and predictions. Platform will turn on this feature if both this
10980 * flag and {@link #ADAPTIVE_BATTERY_MANAGEMENT_ENABLED} is on.
Amith Yamasani172612c2017-12-15 10:51:53 -080010981 * Type: int (0 for false, 1 for true)
10982 * Default: 1
10983 * @hide
Lei Yu4b976ad2018-04-19 10:38:58 -070010984 * @see #ADAPTIVE_BATTERY_MANAGEMENT_ENABLED
Amith Yamasani172612c2017-12-15 10:51:53 -080010985 */
Suprabh Shuklaa55b2ad2018-04-04 15:16:27 -070010986 @SystemApi
Kweku Adams3699c362018-03-13 13:32:34 -070010987 public static final String APP_STANDBY_ENABLED = "app_standby_enabled";
Amith Yamasani172612c2017-12-15 10:51:53 -080010988
10989 /**
Lei Yu4b976ad2018-04-19 10:38:58 -070010990 * Whether or not adaptive battery feature is enabled by user. Platform will turn on this
10991 * feature if both this flag and {@link #APP_STANDBY_ENABLED} is on.
10992 * Type: int (0 for false, 1 for true)
10993 * Default: 1
10994 * @hide
10995 * @see #APP_STANDBY_ENABLED
10996 */
10997 public static final String ADAPTIVE_BATTERY_MANAGEMENT_ENABLED =
10998 "adaptive_battery_management_enabled";
10999
11000 /**
jackqdyulei3cd42a02018-02-27 11:18:00 -080011001 * Whether or not app auto restriction is enabled. When it is enabled, settings app will
11002 * auto restrict the app if it has bad behavior(e.g. hold wakelock for long time).
11003 *
11004 * Type: boolean (0 for false, 1 for true)
11005 * Default: 1
11006 *
11007 * @hide
11008 */
Kweku Adams3699c362018-03-13 13:32:34 -070011009 public static final String APP_AUTO_RESTRICTION_ENABLED =
jackqdyulei3cd42a02018-02-27 11:18:00 -080011010 "app_auto_restriction_enabled";
11011
11012 private static final Validator APP_AUTO_RESTRICTION_ENABLED_VALIDATOR =
11013 BOOLEAN_VALIDATOR;
11014
11015 /**
Suprabh Shukla4deb8522018-01-08 16:27:10 -080011016 * Feature flag to enable or disable the Forced App Standby feature.
11017 * Type: int (0 for false, 1 for true)
11018 * Default: 1
11019 * @hide
11020 */
11021 public static final String FORCED_APP_STANDBY_ENABLED = "forced_app_standby_enabled";
11022
11023 /**
Nancy Zheng525aaa12018-01-12 11:45:37 -080011024 * Whether or not to enable Forced App Standby on small battery devices.
11025 * Type: int (0 for false, 1 for true)
11026 * Default: 0
11027 * @hide
11028 */
11029 public static final String FORCED_APP_STANDBY_FOR_SMALL_BATTERY_ENABLED
11030 = "forced_app_standby_for_small_battery_enabled";
11031
11032 /**
Damien Bargiacchi68bbaad2018-05-09 18:29:43 -070011033 * Whether or not to enable the User Absent, Radios Off feature on small battery devices.
Damien Bargiacchi50b61102018-02-15 16:45:37 -080011034 * Type: int (0 for false, 1 for true)
11035 * Default: 0
11036 * @hide
11037 */
Damien Bargiacchi68bbaad2018-05-09 18:29:43 -070011038 public static final String USER_ABSENT_RADIOS_OFF_FOR_SMALL_BATTERY_ENABLED
11039 = "user_absent_radios_off_for_small_battery_enabled";
Damien Bargiacchi50b61102018-02-15 16:45:37 -080011040
11041 /**
Damien Bargiacchi2e9b8c32018-05-30 13:19:41 -070011042 * Whether or not to enable the User Absent, Touch Off feature on small battery devices.
11043 * Type: int (0 for false, 1 for true)
11044 * Default: 0
11045 * @hide
11046 */
11047 public static final String USER_ABSENT_TOUCH_OFF_FOR_SMALL_BATTERY_ENABLED
11048 = "user_absent_touch_off_for_small_battery_enabled";
11049
11050 /**
yuanlub6b04952018-02-20 14:28:13 -080011051 * Whether or not to turn on Wifi when proxy is disconnected.
11052 * Type: int (0 for false, 1 for true)
11053 * Default: 1
11054 * @hide
11055 */
11056 public static final String WIFI_ON_WHEN_PROXY_DISCONNECTED
11057 = "wifi_on_when_proxy_disconnected";
11058
11059 /**
Michael Kwan5f5a0bf2018-03-16 12:25:50 -070011060 * Time Only Mode specific settings.
11061 * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true"
11062 *
11063 * The following keys are supported:
11064 *
11065 * <pre>
11066 * enabled (boolean)
11067 * disable_tilt_to_wake (boolean)
11068 * disable_touch_to_wake (boolean)
11069 * </pre>
11070 * Type: string
Michael Kwan47abf8c2018-01-23 13:57:18 -080011071 * @hide
11072 */
Michael Kwan5f5a0bf2018-03-16 12:25:50 -070011073 public static final String TIME_ONLY_MODE_CONSTANTS
11074 = "time_only_mode_constants";
Michael Kwan47abf8c2018-01-23 13:57:18 -080011075
11076 /**
Robin Bennett1193a352018-03-28 14:49:58 +010011077 * Whether of not to send keycode sleep for ungaze when Home is the foreground activity on
11078 * watch type devices.
11079 * Type: int (0 for false, 1 for true)
11080 * Default: 0
11081 * @hide
11082 */
11083 public static final String UNGAZE_SLEEP_ENABLED = "ungaze_sleep_enabled";
11084
11085 /**
Ricky Waieef50652017-12-21 16:27:40 +000011086 * Whether or not Network Watchlist feature is enabled.
11087 * Type: int (0 for false, 1 for true)
11088 * Default: 0
11089 * @hide
11090 */
11091 public static final String NETWORK_WATCHLIST_ENABLED = "network_watchlist_enabled";
11092
11093 /**
Robin Lee81ad9722018-01-19 16:34:31 +010011094 * Flag to keep background restricted profiles running after exiting. If disabled,
11095 * the restricted profile can be put into stopped state as soon as the user leaves it.
11096 * Type: int (0 for false, 1 for true)
11097 *
11098 * Overridden by the system based on device information. If null, the value specified
11099 * by {@code config_keepRestrictedProfilesInBackground} is used.
11100 *
11101 * @hide
11102 */
11103 public static final String KEEP_PROFILE_IN_BACKGROUND = "keep_profile_in_background";
11104
11105 /**
Jeff Sharkey0ac10282012-10-01 12:50:22 -070011106 * Get the key that retrieves a bluetooth headset's priority.
11107 * @hide
11108 */
11109 public static final String getBluetoothHeadsetPriorityKey(String address) {
Elliott Hughescb64d432013-08-02 10:00:44 -070011110 return BLUETOOTH_HEADSET_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
Jeff Sharkey0ac10282012-10-01 12:50:22 -070011111 }
11112
11113 /**
11114 * Get the key that retrieves a bluetooth a2dp sink's priority.
11115 * @hide
11116 */
11117 public static final String getBluetoothA2dpSinkPriorityKey(String address) {
Elliott Hughescb64d432013-08-02 10:00:44 -070011118 return BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
Jeff Sharkey0ac10282012-10-01 12:50:22 -070011119 }
11120
11121 /**
Sanket Agarwal1bec6a52015-10-21 18:23:27 -070011122 * Get the key that retrieves a bluetooth a2dp src's priority.
11123 * @hide
11124 */
11125 public static final String getBluetoothA2dpSrcPriorityKey(String address) {
11126 return BLUETOOTH_A2DP_SRC_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
11127 }
11128
11129 /**
Antony Sargentf5772c62017-04-26 16:37:53 -070011130 * Get the key that retrieves a bluetooth a2dp device's ability to support optional codecs.
11131 * @hide
11132 */
11133 public static final String getBluetoothA2dpSupportsOptionalCodecsKey(String address) {
11134 return BLUETOOTH_A2DP_SUPPORTS_OPTIONAL_CODECS_PREFIX +
11135 address.toUpperCase(Locale.ROOT);
11136 }
11137
11138 /**
11139 * Get the key that retrieves whether a bluetooth a2dp device should have optional codecs
11140 * enabled.
11141 * @hide
11142 */
11143 public static final String getBluetoothA2dpOptionalCodecsEnabledKey(String address) {
11144 return BLUETOOTH_A2DP_OPTIONAL_CODECS_ENABLED_PREFIX +
11145 address.toUpperCase(Locale.ROOT);
11146 }
11147
11148 /**
Jeff Sharkey0ac10282012-10-01 12:50:22 -070011149 * Get the key that retrieves a bluetooth Input Device's priority.
11150 * @hide
11151 */
Hansong Zhangc26c76c2017-10-20 15:55:59 -070011152 public static final String getBluetoothHidHostPriorityKey(String address) {
Elliott Hughescb64d432013-08-02 10:00:44 -070011153 return BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
Jeff Sharkey0ac10282012-10-01 12:50:22 -070011154 }
11155
Jeff Sharkey6e2bee72012-10-01 13:39:08 -070011156 /**
Sanket Agarwal773297a2016-08-04 16:16:20 -070011157 * Get the key that retrieves a bluetooth pan client priority.
11158 * @hide
11159 */
11160 public static final String getBluetoothPanPriorityKey(String address) {
11161 return BLUETOOTH_PAN_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
11162 }
11163
11164 /**
Jakub Pawlowskic2d7be62017-11-22 10:57:42 -080011165 * Get the key that retrieves a bluetooth hearing aid priority.
11166 * @hide
11167 */
11168 public static final String getBluetoothHearingAidPriorityKey(String address) {
11169 return BLUETOOTH_HEARING_AID_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
11170 }
11171
11172 /**
Kim Schulz0d376052013-08-22 11:18:02 +020011173 * Get the key that retrieves a bluetooth map priority.
11174 * @hide
11175 */
11176 public static final String getBluetoothMapPriorityKey(String address) {
11177 return BLUETOOTH_MAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
11178 }
Casper Bonde2a5f6082015-03-19 10:36:45 +010011179
11180 /**
Joseph Pirozzo631768d2016-09-01 14:19:28 -070011181 * Get the key that retrieves a bluetooth map client priority.
11182 * @hide
11183 */
11184 public static final String getBluetoothMapClientPriorityKey(String address) {
11185 return BLUETOOTH_MAP_CLIENT_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
11186 }
11187
11188 /**
Joseph Pirozzo563c7002016-03-21 15:49:48 -070011189 * Get the key that retrieves a bluetooth pbap client priority.
11190 * @hide
11191 */
11192 public static final String getBluetoothPbapClientPriorityKey(String address) {
11193 return BLUETOOTH_PBAP_CLIENT_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
11194 }
11195
11196 /**
Joseph Pirozzo631768d2016-09-01 14:19:28 -070011197 * Get the key that retrieves a bluetooth sap priority.
Casper Bonde2a5f6082015-03-19 10:36:45 +010011198 * @hide
11199 */
11200 public static final String getBluetoothSapPriorityKey(String address) {
11201 return BLUETOOTH_SAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
11202 }
11203
Kim Schulz0d376052013-08-22 11:18:02 +020011204 /**
Jeff Sharkey6e2bee72012-10-01 13:39:08 -070011205 * Scaling factor for normal window animations. Setting to 0 will
11206 * disable window animations.
11207 */
11208 public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale";
11209
11210 /**
11211 * Scaling factor for activity transition animations. Setting to 0 will
11212 * disable window animations.
11213 */
11214 public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale";
11215
11216 /**
11217 * Scaling factor for Animator-based animations. This affects both the
11218 * start delay and duration of all such animations. Setting to 0 will
11219 * cause animations to end immediately. The default value is 1.
11220 */
11221 public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale";
11222
11223 /**
11224 * Scaling factor for normal window animations. Setting to 0 will
11225 * disable window animations.
11226 *
11227 * @hide
11228 */
11229 public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations";
11230
11231 /**
11232 * If 0, the compatibility mode is off for all applications.
11233 * If 1, older applications run under compatibility mode.
11234 * TODO: remove this settings before code freeze (bug/1907571)
11235 * @hide
11236 */
11237 public static final String COMPATIBILITY_MODE = "compatibility_mode";
11238
11239 /**
11240 * CDMA only settings
11241 * Emergency Tone 0 = Off
11242 * 1 = Alert
11243 * 2 = Vibrate
11244 * @hide
11245 */
11246 public static final String EMERGENCY_TONE = "emergency_tone";
11247
Michal Karpinski5db1e432018-01-18 20:10:24 +000011248 private static final Validator EMERGENCY_TONE_VALIDATOR =
11249 new SettingsValidators.DiscreteValueValidator(new String[] {"0", "1", "2"});
11250
Jeff Sharkey6e2bee72012-10-01 13:39:08 -070011251 /**
11252 * CDMA only settings
11253 * Whether the auto retry is enabled. The value is
11254 * boolean (1 or 0).
11255 * @hide
11256 */
11257 public static final String CALL_AUTO_RETRY = "call_auto_retry";
11258
Michal Karpinski5db1e432018-01-18 20:10:24 +000011259 private static final Validator CALL_AUTO_RETRY_VALIDATOR = BOOLEAN_VALIDATOR;
11260
Jeff Sharkey6e2bee72012-10-01 13:39:08 -070011261 /**
Selim Cinek705442f2016-09-13 16:02:33 -070011262 * A setting that can be read whether the emergency affordance is currently needed.
11263 * The value is a boolean (1 or 0).
11264 * @hide
11265 */
11266 public static final String EMERGENCY_AFFORDANCE_NEEDED = "emergency_affordance_needed";
11267
11268 /**
Sungmin Choie099ab12014-06-09 14:45:51 +090011269 * See RIL_PreferredNetworkType in ril.h
Jeff Sharkey6e2bee72012-10-01 13:39:08 -070011270 * @hide
11271 */
11272 public static final String PREFERRED_NETWORK_MODE =
11273 "preferred_network_mode";
11274
11275 /**
Jeff Sharkey6e2bee72012-10-01 13:39:08 -070011276 * Name of an application package to be debugged.
11277 */
11278 public static final String DEBUG_APP = "debug_app";
11279
11280 /**
11281 * If 1, when launching DEBUG_APP it will wait for the debugger before
11282 * starting user code. If 0, it will run normally.
11283 */
11284 public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger";
11285
11286 /**
Cody Northrop86cedcb2017-10-20 09:03:13 -060011287 * Allow GPU debug layers?
11288 * 0 = no
11289 * 1 = yes
11290 * @hide
11291 */
11292 public static final String ENABLE_GPU_DEBUG_LAYERS = "enable_gpu_debug_layers";
11293
11294 /**
11295 * App allowed to load GPU debug layers
11296 * @hide
11297 */
11298 public static final String GPU_DEBUG_APP = "gpu_debug_app";
11299
11300 /**
11301 * Ordered GPU debug layer list
11302 * i.e. <layer1>:<layer2>:...:<layerN>
11303 * @hide
11304 */
11305 public static final String GPU_DEBUG_LAYERS = "gpu_debug_layers";
11306
11307 /**
Jeff Sharkey6e2bee72012-10-01 13:39:08 -070011308 * Control whether the process CPU usage meter should be shown.
Nick Kralevichfc4a5c22016-10-11 09:01:38 -070011309 *
11310 * @deprecated This functionality is no longer available as of
11311 * {@link android.os.Build.VERSION_CODES#N_MR1}.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -070011312 */
Nick Kralevichfc4a5c22016-10-11 09:01:38 -070011313 @Deprecated
Jeff Sharkey6e2bee72012-10-01 13:39:08 -070011314 public static final String SHOW_PROCESSES = "show_processes";
11315
11316 /**
Makoto Onukia3cd7b92018-03-19 14:47:05 -070011317 * If 1 low power mode (aka battery saver) is enabled.
Ruchi Kandoi62b8a492014-04-17 18:01:40 -070011318 * @hide
11319 */
Makoto Onukif9046a22018-01-12 10:32:32 -080011320 @TestApi
Ruchi Kandoi62b8a492014-04-17 18:01:40 -070011321 public static final String LOW_POWER_MODE = "low_power";
11322
John Spurlockf8f524c2014-06-10 14:47:29 -040011323 /**
Makoto Onukia3cd7b92018-03-19 14:47:05 -070011324 * If 1, battery saver ({@link #LOW_POWER_MODE}) will be re-activated after the device
11325 * is unplugged from a charger or rebooted.
11326 * @hide
11327 */
11328 @TestApi
11329 public static final String LOW_POWER_MODE_STICKY = "low_power_sticky";
11330
11331 /**
Makoto Onuki45a772e2018-02-01 15:27:53 -080011332 * Battery level [1-100] at which low power mode automatically turns on.
Dianne Hackborn14272302014-06-10 23:13:02 -070011333 * If 0, it will not automatically turn on.
John Spurlockf8f524c2014-06-10 14:47:29 -040011334 * @hide
11335 */
11336 public static final String LOW_POWER_MODE_TRIGGER_LEVEL = "low_power_trigger_level";
11337
Michal Karpinski5db1e432018-01-18 20:10:24 +000011338 private static final Validator LOW_POWER_MODE_TRIGGER_LEVEL_VALIDATOR =
Makoto Onuki45a772e2018-02-01 15:27:53 -080011339 new SettingsValidators.InclusiveIntegerRangeValidator(0, 100);
Michal Karpinski5db1e432018-01-18 20:10:24 +000011340
Makoto Onuki524b4dfe2018-03-06 17:34:15 -080011341
11342 /**
11343 * The max value for {@link #LOW_POWER_MODE_TRIGGER_LEVEL}. If this setting is not set
11344 * or the value is 0, the default max will be used.
11345 *
11346 * @hide
11347 */
11348 public static final String LOW_POWER_MODE_TRIGGER_LEVEL_MAX = "low_power_trigger_level_max";
11349
Makoto Onukibc064d4b2018-03-27 14:48:42 -070011350 /**
11351 * See com.android.settingslib.fuelgauge.BatterySaverUtils.
11352 * @hide
11353 */
11354 public static final String LOW_POWER_MODE_SUGGESTION_PARAMS =
11355 "low_power_mode_suggestion_params";
11356
11357 /**
Dianne Hackbornb2117d12016-02-16 18:26:35 -080011358 * If not 0, the activity manager will aggressively finish activities and
Jeff Sharkey6e2bee72012-10-01 13:39:08 -070011359 * processes as soon as they are no longer needed. If 0, the normal
11360 * extended lifetime is used.
11361 */
Dianne Hackborn89ad4562014-08-24 16:45:38 -070011362 public static final String ALWAYS_FINISH_ACTIVITIES = "always_finish_activities";
Jeff Sharkey6e2bee72012-10-01 13:39:08 -070011363
Christopher Tate66488d62012-10-02 11:58:01 -070011364 /**
Dianne Hackborn82b17ca2018-04-06 16:00:08 -070011365 * If nonzero, all system error dialogs will be hidden. For example, the
11366 * crash and ANR dialogs will not be shown, and the system will just proceed
11367 * as if they had been accepted by the user.
11368 * @hide
11369 */
11370 public static final String HIDE_ERROR_DIALOGS = "hide_error_dialogs";
11371
11372 /**
Eric Laurent7ee1e4f2012-10-26 18:11:21 -070011373 * Use Dock audio output for media:
11374 * 0 = disabled
11375 * 1 = enabled
11376 * @hide
11377 */
11378 public static final String DOCK_AUDIO_MEDIA_ENABLED = "dock_audio_media_enabled";
11379
Michal Karpinski5db1e432018-01-18 20:10:24 +000011380 private static final Validator DOCK_AUDIO_MEDIA_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
11381
Eric Laurent7ee1e4f2012-10-26 18:11:21 -070011382 /**
Phil Burkdeaa8d92016-02-23 17:12:04 -080011383 * The surround sound formats AC3, DTS or IEC61937 are
11384 * available for use if they are detected.
11385 * This is the default mode.
11386 *
11387 * Note that AUTO is equivalent to ALWAYS for Android TVs and other
11388 * devices that have an S/PDIF output. This is because S/PDIF
11389 * is unidirectional and the TV cannot know if a decoder is
11390 * connected. So it assumes they are always available.
11391 * @hide
11392 */
11393 public static final int ENCODED_SURROUND_OUTPUT_AUTO = 0;
11394
11395 /**
11396 * AC3, DTS or IEC61937 are NEVER available, even if they
11397 * are detected by the hardware. Those formats will not be
11398 * reported.
11399 *
11400 * An example use case would be an AVR reports that it is capable of
11401 * surround sound decoding but is broken. If NEVER is chosen
11402 * then apps must use PCM output instead of encoded output.
11403 * @hide
11404 */
11405 public static final int ENCODED_SURROUND_OUTPUT_NEVER = 1;
11406
11407 /**
11408 * AC3, DTS or IEC61937 are ALWAYS available, even if they
11409 * are not detected by the hardware. Those formats will be
11410 * reported as part of the HDMI output capability. Applications
11411 * are then free to use either PCM or encoded output.
11412 *
11413 * An example use case would be a when TV was connected over
11414 * TOS-link to an AVR. But the TV could not see it because TOS-link
11415 * is unidirectional.
11416 * @hide
11417 */
11418 public static final int ENCODED_SURROUND_OUTPUT_ALWAYS = 2;
11419
11420 /**
jiabin39940752018-04-02 18:18:45 -070011421 * Surround sound formats are available according to the choice
11422 * of user, even if they are not detected by the hardware. Those
11423 * formats will be reported as part of the HDMI output capability.
11424 * Applications are then free to use either PCM or encoded output.
11425 *
11426 * An example use case would be an AVR that doesn't report a surround
11427 * format while the user knows the AVR does support it.
11428 * @hide
11429 */
11430 public static final int ENCODED_SURROUND_OUTPUT_MANUAL = 3;
11431
11432 /**
Phil Burkdeaa8d92016-02-23 17:12:04 -080011433 * Set to ENCODED_SURROUND_OUTPUT_AUTO,
jiabin39940752018-04-02 18:18:45 -070011434 * ENCODED_SURROUND_OUTPUT_NEVER,
11435 * ENCODED_SURROUND_OUTPUT_ALWAYS or
11436 * ENCODED_SURROUND_OUTPUT_MANUAL
Phil Burkdeaa8d92016-02-23 17:12:04 -080011437 * @hide
11438 */
11439 public static final String ENCODED_SURROUND_OUTPUT = "encoded_surround_output";
11440
Michal Karpinski5db1e432018-01-18 20:10:24 +000011441 private static final Validator ENCODED_SURROUND_OUTPUT_VALIDATOR =
jiabin39940752018-04-02 18:18:45 -070011442 new SettingsValidators.DiscreteValueValidator(new String[] {"0", "1", "2", "3"});
11443
11444 /**
11445 * Surround sounds formats that are enabled when ENCODED_SURROUND_OUTPUT is set to
11446 * ENCODED_SURROUND_OUTPUT_MANUAL. Encoded as comma separated list. Allowed values
11447 * are the format constants defined in AudioFormat.java. Ex:
11448 *
11449 * "5,6"
11450 *
11451 * @hide
11452 */
11453 public static final String ENCODED_SURROUND_OUTPUT_ENABLED_FORMATS =
11454 "encoded_surround_output_enabled_formats";
11455
11456 private static final Validator ENCODED_SURROUND_OUTPUT_ENABLED_FORMATS_VALIDATOR =
11457 new Validator() {
11458 @Override
Annie Mengeed1b812018-05-21 16:34:52 +010011459 public boolean validate(@Nullable String value) {
jiabin39940752018-04-02 18:18:45 -070011460 try {
11461 String[] surroundFormats = TextUtils.split(value, ",");
11462 for (String format : surroundFormats) {
11463 int audioFormat = Integer.valueOf(format);
11464 boolean isSurroundFormat = false;
11465 for (int sf : AudioFormat.SURROUND_SOUND_ENCODING) {
11466 if (sf == audioFormat) {
11467 isSurroundFormat = true;
11468 break;
11469 }
11470 }
11471 if (!isSurroundFormat) {
11472 return false;
11473 }
11474 }
11475 return true;
11476 } catch (NumberFormatException e) {
11477 return false;
11478 }
11479 }
11480 };
Michal Karpinski5db1e432018-01-18 20:10:24 +000011481
Phil Burkdeaa8d92016-02-23 17:12:04 -080011482 /**
Eric Laurent05274f32012-11-29 12:48:18 -080011483 * Persisted safe headphone volume management state by AudioService
11484 * @hide
11485 */
11486 public static final String AUDIO_SAFE_VOLUME_STATE = "audio_safe_volume_state";
11487
11488 /**
Geremy Condraa0735112013-03-26 21:49:26 -070011489 * URL for tzinfo (time zone) updates
11490 * @hide
11491 */
11492 public static final String TZINFO_UPDATE_CONTENT_URL = "tzinfo_content_url";
11493
11494 /**
11495 * URL for tzinfo (time zone) update metadata
11496 * @hide
11497 */
11498 public static final String TZINFO_UPDATE_METADATA_URL = "tzinfo_metadata_url";
11499
11500 /**
11501 * URL for selinux (mandatory access control) updates
11502 * @hide
11503 */
11504 public static final String SELINUX_UPDATE_CONTENT_URL = "selinux_content_url";
11505
11506 /**
11507 * URL for selinux (mandatory access control) update metadata
11508 * @hide
11509 */
11510 public static final String SELINUX_UPDATE_METADATA_URL = "selinux_metadata_url";
11511
11512 /**
11513 * URL for sms short code updates
11514 * @hide
11515 */
11516 public static final String SMS_SHORT_CODES_UPDATE_CONTENT_URL =
11517 "sms_short_codes_content_url";
11518
11519 /**
11520 * URL for sms short code update metadata
11521 * @hide
11522 */
11523 public static final String SMS_SHORT_CODES_UPDATE_METADATA_URL =
11524 "sms_short_codes_metadata_url";
11525
11526 /**
Amit Mahajan9069fab2015-05-01 11:05:47 -070011527 * URL for apn_db updates
11528 * @hide
11529 */
11530 public static final String APN_DB_UPDATE_CONTENT_URL = "apn_db_content_url";
11531
11532 /**
11533 * URL for apn_db update metadata
11534 * @hide
11535 */
11536 public static final String APN_DB_UPDATE_METADATA_URL = "apn_db_metadata_url";
11537
11538 /**
Geremy Condraa0735112013-03-26 21:49:26 -070011539 * URL for cert pinlist updates
11540 * @hide
11541 */
11542 public static final String CERT_PIN_UPDATE_CONTENT_URL = "cert_pin_content_url";
11543
11544 /**
11545 * URL for cert pinlist updates
11546 * @hide
11547 */
11548 public static final String CERT_PIN_UPDATE_METADATA_URL = "cert_pin_metadata_url";
11549
Geremy Condra757ee522013-03-29 16:39:45 -070011550 /**
Ben Gruver633dc9b2013-04-04 12:05:49 -070011551 * URL for intent firewall updates
11552 * @hide
11553 */
11554 public static final String INTENT_FIREWALL_UPDATE_CONTENT_URL =
11555 "intent_firewall_content_url";
11556
11557 /**
11558 * URL for intent firewall update metadata
11559 * @hide
11560 */
11561 public static final String INTENT_FIREWALL_UPDATE_METADATA_URL =
11562 "intent_firewall_metadata_url";
11563
11564 /**
Abodunrinwa Toki51c42032017-04-02 19:16:01 +010011565 * URL for lang id model updates
11566 * @hide
11567 */
11568 public static final String LANG_ID_UPDATE_CONTENT_URL = "lang_id_content_url";
11569
11570 /**
11571 * URL for lang id model update metadata
11572 * @hide
11573 */
11574 public static final String LANG_ID_UPDATE_METADATA_URL = "lang_id_metadata_url";
11575
11576 /**
Abodunrinwa Tokibb957d12017-04-12 14:40:46 +010011577 * URL for smart selection model updates
11578 * @hide
11579 */
11580 public static final String SMART_SELECTION_UPDATE_CONTENT_URL =
11581 "smart_selection_content_url";
11582
11583 /**
11584 * URL for smart selection model update metadata
11585 * @hide
11586 */
11587 public static final String SMART_SELECTION_UPDATE_METADATA_URL =
11588 "smart_selection_metadata_url";
11589
11590 /**
Geremy Condra4e7f7e82013-03-26 21:09:01 -070011591 * SELinux enforcement status. If 0, permissive; if 1, enforcing.
11592 * @hide
11593 */
11594 public static final String SELINUX_STATUS = "selinux_status";
11595
Geremy Condraa0735112013-03-26 21:49:26 -070011596 /**
Amith Yamasanid8415f42013-08-07 20:15:10 -070011597 * Developer setting to force RTL layout.
11598 * @hide
11599 */
11600 public static final String DEVELOPMENT_FORCE_RTL = "debug.force_rtl";
11601
11602 /**
Daniel Sandlerdea64622013-09-23 16:05:57 -040011603 * Milliseconds after screen-off after which low battery sounds will be silenced.
11604 *
11605 * If zero, battery sounds will always play.
11606 * Defaults to @integer/def_low_battery_sound_timeout in SettingsProvider.
11607 *
11608 * @hide
11609 */
11610 public static final String LOW_BATTERY_SOUND_TIMEOUT = "low_battery_sound_timeout";
11611
11612 /**
Evan Charltoncc7b0432014-01-14 14:47:11 -080011613 * Milliseconds to wait before bouncing Wi-Fi after settings is restored. Note that after
Dianne Hackborna3fb40d2014-08-12 15:06:50 -070011614 * the caller is done with this, they should call {@link ContentResolver#delete} to
Evan Charltoncc7b0432014-01-14 14:47:11 -080011615 * clean up any value that they may have written.
11616 *
11617 * @hide
11618 */
11619 public static final String WIFI_BOUNCE_DELAY_OVERRIDE_MS = "wifi_bounce_delay_override_ms";
11620
John Spurlockc6d1c602014-01-17 15:22:06 -050011621 /**
11622 * Defines global runtime overrides to window policy.
11623 *
Jorim Jaggib10e33f2015-02-04 21:57:40 +010011624 * See {@link com.android.server.policy.PolicyControl} for value format.
John Spurlockc6d1c602014-01-17 15:22:06 -050011625 *
11626 * @hide
11627 */
11628 public static final String POLICY_CONTROL = "policy_control";
Evan Charltoncc7b0432014-01-14 14:47:11 -080011629
11630 /**
Adrian Roos000cf5e2017-11-10 15:55:18 +010011631 * {@link android.view.DisplayCutout DisplayCutout} emulation mode.
11632 *
11633 * @hide
11634 */
11635 public static final String EMULATE_DISPLAY_CUTOUT = "emulate_display_cutout";
11636
11637 /** @hide */ public static final int EMULATE_DISPLAY_CUTOUT_OFF = 0;
11638 /** @hide */ public static final int EMULATE_DISPLAY_CUTOUT_ON = 1;
11639
11640 /**
Matthew Fritze7c5fa7ff02018-05-21 14:42:36 -070011641 * A colon separated list of keys for Settings Slices.
11642 *
11643 * @hide
11644 */
11645 public static final String BLOCKED_SLICES = "blocked_slices";
11646
11647 /**
John Spurlockae641c92014-06-30 18:11:40 -040011648 * Defines global zen mode. ZEN_MODE_OFF, ZEN_MODE_IMPORTANT_INTERRUPTIONS,
11649 * or ZEN_MODE_NO_INTERRUPTIONS.
John Spurlocke677d712014-02-13 12:52:19 -050011650 *
11651 * @hide
11652 */
11653 public static final String ZEN_MODE = "zen_mode";
11654
11655 /** @hide */ public static final int ZEN_MODE_OFF = 0;
John Spurlockae641c92014-06-30 18:11:40 -040011656 /** @hide */ public static final int ZEN_MODE_IMPORTANT_INTERRUPTIONS = 1;
11657 /** @hide */ public static final int ZEN_MODE_NO_INTERRUPTIONS = 2;
John Spurlock4f1163c2015-04-02 17:41:21 -040011658 /** @hide */ public static final int ZEN_MODE_ALARMS = 3;
John Spurlocke677d712014-02-13 12:52:19 -050011659
11660 /** @hide */ public static String zenModeToString(int mode) {
John Spurlockae641c92014-06-30 18:11:40 -040011661 if (mode == ZEN_MODE_IMPORTANT_INTERRUPTIONS) return "ZEN_MODE_IMPORTANT_INTERRUPTIONS";
John Spurlock4f1163c2015-04-02 17:41:21 -040011662 if (mode == ZEN_MODE_ALARMS) return "ZEN_MODE_ALARMS";
John Spurlockae641c92014-06-30 18:11:40 -040011663 if (mode == ZEN_MODE_NO_INTERRUPTIONS) return "ZEN_MODE_NO_INTERRUPTIONS";
11664 return "ZEN_MODE_OFF";
John Spurlocke677d712014-02-13 12:52:19 -050011665 }
11666
John Spurlockb2278d62015-04-07 12:47:12 -040011667 /** @hide */ public static boolean isValidZenMode(int value) {
11668 switch (value) {
11669 case Global.ZEN_MODE_OFF:
11670 case Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS:
11671 case Global.ZEN_MODE_ALARMS:
11672 case Global.ZEN_MODE_NO_INTERRUPTIONS:
11673 return true;
11674 default:
11675 return false;
11676 }
11677 }
11678
John Spurlocke677d712014-02-13 12:52:19 -050011679 /**
Julia Reynolds9b11fdb2015-07-31 09:49:55 -040011680 * Value of the ringer before entering zen mode.
11681 *
11682 * @hide
11683 */
11684 public static final String ZEN_MODE_RINGER_LEVEL = "zen_mode_ringer_level";
11685
11686 /**
John Spurlock056c5192014-04-20 21:52:01 -040011687 * Opaque value, changes when persisted zen mode configuration changes.
11688 *
11689 * @hide
11690 */
11691 public static final String ZEN_MODE_CONFIG_ETAG = "zen_mode_config_etag";
11692
11693 /**
Beverly09da25f2018-02-26 09:17:07 -050011694 * If 0, turning on dnd manually will last indefinitely.
11695 * Else if non-negative, turning on dnd manually will last for this many minutes.
11696 * Else (if negative), turning on dnd manually will surface a dialog that prompts
11697 * user to specify a duration.
11698 * @hide
11699 */
11700 public static final String ZEN_DURATION = "zen_duration";
11701
11702 private static final Validator ZEN_DURATION_VALIDATOR = ANY_INTEGER_VALIDATOR;
11703
11704 /** @hide */ public static final int ZEN_DURATION_PROMPT = -1;
11705 /** @hide */ public static final int ZEN_DURATION_FOREVER = 0;
11706
11707 /**
Chris Wren7bd241232014-02-28 16:25:05 -050011708 * Defines global heads up toggle. One of HEADS_UP_OFF, HEADS_UP_ON.
11709 *
11710 * @hide
11711 */
Chris Wren10d82df2014-03-01 10:34:51 -050011712 public static final String HEADS_UP_NOTIFICATIONS_ENABLED =
11713 "heads_up_notifications_enabled";
Chris Wren7bd241232014-02-28 16:25:05 -050011714
11715 /** @hide */ public static final int HEADS_UP_OFF = 0;
11716 /** @hide */ public static final int HEADS_UP_ON = 1;
11717
11718 /**
Jerome Poichet147b4d72014-05-12 18:13:27 -070011719 * The name of the device
Jerome Poichet147b4d72014-05-12 18:13:27 -070011720 */
11721 public static final String DEVICE_NAME = "device_name";
11722
11723 /**
Jeff Davidson56f9f732014-08-14 16:47:23 -070011724 * Whether the NetworkScoringService has been first initialized.
11725 * <p>
11726 * Type: int (0 for false, 1 for true)
11727 * @hide
11728 */
11729 public static final String NETWORK_SCORING_PROVISIONED = "network_scoring_provisioned";
11730
11731 /**
Jim Miller6848dc82014-10-13 18:51:53 -070011732 * Whether the user wants to be prompted for password to decrypt the device on boot.
11733 * This only matters if the storage is encrypted.
11734 * <p>
11735 * Type: int (0 for false, 1 for true)
11736 * @hide
11737 */
11738 public static final String REQUIRE_PASSWORD_TO_DECRYPT = "require_password_to_decrypt";
11739
11740 /**
manabu, shimoda14723e32017-10-06 14:39:01 +090011741 * Whether the Volte is enabled. If this setting is not set then we use the Carrier Config
11742 * value {@link CarrierConfigManager#KEY_ENHANCED_4G_LTE_ON_BY_DEFAULT_BOOL}.
Libin.Tang@motorola.com0499bb52014-10-10 14:55:57 -050011743 * <p>
11744 * Type: int (0 for false, 1 for true)
11745 * @hide
Malcolm Chenc66dee92017-09-26 14:45:40 -070011746 * @deprecated Use {@link android.telephony.SubscriptionManager#ENHANCED_4G_MODE_ENABLED}
11747 * instead.
Libin.Tang@motorola.com0499bb52014-10-10 14:55:57 -050011748 */
Malcolm Chenc66dee92017-09-26 14:45:40 -070011749 @Deprecated
11750 public static final String ENHANCED_4G_MODE_ENABLED =
11751 SubscriptionManager.ENHANCED_4G_MODE_ENABLED;
Libin.Tang@motorola.com0499bb52014-10-10 14:55:57 -050011752
11753 /**
Etan Cohen93bbf272015-05-04 18:01:47 -070011754 * Whether VT (Video Telephony over IMS) is enabled
11755 * <p>
11756 * Type: int (0 for false, 1 for true)
11757 *
11758 * @hide
Malcolm Chenc66dee92017-09-26 14:45:40 -070011759 * @deprecated Use {@link android.telephony.SubscriptionManager#VT_IMS_ENABLED} instead.
Etan Cohen93bbf272015-05-04 18:01:47 -070011760 */
Malcolm Chenc66dee92017-09-26 14:45:40 -070011761 @Deprecated
11762 public static final String VT_IMS_ENABLED = SubscriptionManager.VT_IMS_ENABLED;
Etan Cohen93bbf272015-05-04 18:01:47 -070011763
11764 /**
Etan Cohen9c8f21b2014-12-23 15:02:19 -080011765 * Whether WFC is enabled
11766 * <p>
11767 * Type: int (0 for false, 1 for true)
11768 *
11769 * @hide
Malcolm Chenc66dee92017-09-26 14:45:40 -070011770 * @deprecated Use {@link android.telephony.SubscriptionManager#WFC_IMS_ENABLED} instead.
Etan Cohen9c8f21b2014-12-23 15:02:19 -080011771 */
Malcolm Chenc66dee92017-09-26 14:45:40 -070011772 @Deprecated
11773 public static final String WFC_IMS_ENABLED = SubscriptionManager.WFC_IMS_ENABLED;
Etan Cohen9c8f21b2014-12-23 15:02:19 -080011774
11775 /**
Meng Wang2c25e4a2016-09-19 14:18:05 -070011776 * WFC mode on home/non-roaming network.
Etan Cohen9c8f21b2014-12-23 15:02:19 -080011777 * <p>
11778 * Type: int - 2=Wi-Fi preferred, 1=Cellular preferred, 0=Wi-Fi only
11779 *
11780 * @hide
Malcolm Chenc66dee92017-09-26 14:45:40 -070011781 * @deprecated Use {@link android.telephony.SubscriptionManager#WFC_IMS_MODE} instead.
Etan Cohen9c8f21b2014-12-23 15:02:19 -080011782 */
Malcolm Chenc66dee92017-09-26 14:45:40 -070011783 @Deprecated
11784 public static final String WFC_IMS_MODE = SubscriptionManager.WFC_IMS_MODE;
Etan Cohen9c8f21b2014-12-23 15:02:19 -080011785
11786 /**
Meng Wang2c25e4a2016-09-19 14:18:05 -070011787 * WFC mode on roaming network.
11788 * <p>
Dianne Hackborn0ef403e2017-01-24 18:22:15 -080011789 * Type: int - see {@link #WFC_IMS_MODE} for values
Meng Wang2c25e4a2016-09-19 14:18:05 -070011790 *
11791 * @hide
Malcolm Chenc66dee92017-09-26 14:45:40 -070011792 * @deprecated Use {@link android.telephony.SubscriptionManager#WFC_IMS_ROAMING_MODE}
11793 * instead.
Meng Wang2c25e4a2016-09-19 14:18:05 -070011794 */
Malcolm Chenc66dee92017-09-26 14:45:40 -070011795 @Deprecated
11796 public static final String WFC_IMS_ROAMING_MODE = SubscriptionManager.WFC_IMS_ROAMING_MODE;
Meng Wang2c25e4a2016-09-19 14:18:05 -070011797
11798 /**
Etan Cohen9c8f21b2014-12-23 15:02:19 -080011799 * Whether WFC roaming is enabled
11800 * <p>
11801 * Type: int (0 for false, 1 for true)
11802 *
11803 * @hide
Malcolm Chenc66dee92017-09-26 14:45:40 -070011804 * @deprecated Use {@link android.telephony.SubscriptionManager#WFC_IMS_ROAMING_ENABLED}
11805 * instead
Etan Cohen9c8f21b2014-12-23 15:02:19 -080011806 */
Malcolm Chenc66dee92017-09-26 14:45:40 -070011807 @Deprecated
11808 public static final String WFC_IMS_ROAMING_ENABLED =
11809 SubscriptionManager.WFC_IMS_ROAMING_ENABLED;
Etan Cohen9c8f21b2014-12-23 15:02:19 -080011810
11811 /**
Amit Mahajan4fea0922014-11-18 12:56:28 -080011812 * Whether user can enable/disable LTE as a preferred network. A carrier might control
11813 * this via gservices, OMA-DM, carrier app, etc.
11814 * <p>
11815 * Type: int (0 for false, 1 for true)
11816 * @hide
11817 */
11818 public static final String LTE_SERVICE_FORCED = "lte_service_forced";
11819
11820 /**
Svet Ganov2acf0632015-11-24 19:10:59 -080011821 * Ephemeral app cookie max size in bytes.
11822 * <p>
11823 * Type: int
11824 * @hide
11825 */
11826 public static final String EPHEMERAL_COOKIE_MAX_SIZE_BYTES =
11827 "ephemeral_cookie_max_size_bytes";
11828
11829 /**
Todd Kennedyd15bb752016-09-13 16:38:31 -070011830 * Toggle to enable/disable the entire ephemeral feature. By default, ephemeral is
11831 * enabled. Set to zero to disable.
11832 * <p>
11833 * Type: int (0 for false, 1 for true)
11834 *
11835 * @hide
11836 */
11837 public static final String ENABLE_EPHEMERAL_FEATURE = "enable_ephemeral_feature";
11838
11839 /**
Todd Kennedy133c5da2017-06-15 09:44:34 -070011840 * Toggle to enable/disable dexopt for instant applications. The default is for dexopt
11841 * to be disabled.
11842 * <p>
11843 * Type: int (0 to disable, 1 to enable)
11844 *
11845 * @hide
11846 */
11847 public static final String INSTANT_APP_DEXOPT_ENABLED = "instant_app_dexopt_enabled";
11848
11849 /**
Svet Ganovf36d53c2017-05-24 00:27:21 -070011850 * The min period for caching installed instant apps in milliseconds.
Svet Ganov2acf0632015-11-24 19:10:59 -080011851 * <p>
11852 * Type: long
11853 * @hide
11854 */
Svet Ganovf36d53c2017-05-24 00:27:21 -070011855 public static final String INSTALLED_INSTANT_APP_MIN_CACHE_PERIOD =
11856 "installed_instant_app_min_cache_period";
11857
11858 /**
11859 * The max period for caching installed instant apps in milliseconds.
11860 * <p>
11861 * Type: long
11862 * @hide
11863 */
11864 public static final String INSTALLED_INSTANT_APP_MAX_CACHE_PERIOD =
11865 "installed_instant_app_max_cache_period";
11866
11867 /**
11868 * The min period for caching uninstalled instant apps in milliseconds.
11869 * <p>
11870 * Type: long
11871 * @hide
11872 */
11873 public static final String UNINSTALLED_INSTANT_APP_MIN_CACHE_PERIOD =
11874 "uninstalled_instant_app_min_cache_period";
11875
11876 /**
11877 * The max period for caching uninstalled instant apps in milliseconds.
11878 * <p>
11879 * Type: long
11880 * @hide
11881 */
11882 public static final String UNINSTALLED_INSTANT_APP_MAX_CACHE_PERIOD =
11883 "uninstalled_instant_app_max_cache_period";
11884
11885 /**
11886 * The min period for caching unused static shared libs in milliseconds.
11887 * <p>
11888 * Type: long
11889 * @hide
11890 */
11891 public static final String UNUSED_STATIC_SHARED_LIB_MIN_CACHE_PERIOD =
11892 "unused_static_shared_lib_min_cache_period";
Svet Ganov2acf0632015-11-24 19:10:59 -080011893
11894 /**
Fyodor Kupolov07140f72016-02-17 10:46:11 -080011895 * Allows switching users when system user is locked.
11896 * <p>
11897 * Type: int
11898 * @hide
11899 */
11900 public static final String ALLOW_USER_SWITCHING_WHEN_SYSTEM_USER_LOCKED =
11901 "allow_user_switching_when_system_user_locked";
11902
11903 /**
Kenny Guyc4db5ca2017-09-21 11:40:44 +010011904 * Boot count since the device starts running API level 24.
Daichi Hirono82ab9802016-03-02 13:23:29 +090011905 * <p>
11906 * Type: int
11907 */
11908 public static final String BOOT_COUNT = "boot_count";
11909
11910 /**
Lenka Trochtova6474f0e2016-03-24 16:43:10 +010011911 * Whether the safe boot is disallowed.
11912 *
11913 * <p>This setting should have the identical value as the corresponding user restriction.
11914 * The purpose of the setting is to make the restriction available in early boot stages
11915 * before the user restrictions are loaded.
11916 * @hide
11917 */
11918 public static final String SAFE_BOOT_DISALLOWED = "safe_boot_disallowed";
11919
11920 /**
Amith Yamasanieb437d42016-04-29 09:31:25 -070011921 * Whether this device is currently in retail demo mode. If true, device
11922 * usage is severely limited.
11923 * <p>
11924 * Type: int (0 for false, 1 for true)
11925 * @hide
11926 */
11927 public static final String DEVICE_DEMO_MODE = "device_demo_mode";
11928
11929 /**
Sudheer Shanka5918c672017-03-21 19:31:37 -070011930 * Indicates the maximum time that an app is blocked for the network rules to get updated.
11931 *
11932 * Type: long
11933 *
11934 * @hide
11935 */
11936 public static final String NETWORK_ACCESS_TIMEOUT_MS = "network_access_timeout_ms";
11937
11938 /**
Svetoslav Ganov264c7a92016-08-24 17:31:14 -070011939 * The reason for the settings database being downgraded. This is only for
11940 * troubleshooting purposes and its value should not be interpreted in any way.
11941 *
11942 * Type: string
11943 *
11944 * @hide
11945 */
11946 public static final String DATABASE_DOWNGRADE_REASON = "database_downgrade_reason";
11947
11948 /**
Amith Yamasani39452022017-03-21 15:23:47 -070011949 * The build id of when the settings database was first created (or re-created due it
11950 * being missing).
11951 *
11952 * Type: string
11953 *
11954 * @hide
11955 */
11956 public static final String DATABASE_CREATION_BUILDID = "database_creation_buildid";
11957
11958 /**
Suprabh Shukla502fd882016-09-30 15:06:00 -070011959 * Flag to toggle journal mode WAL on or off for the contacts database. WAL is enabled by
11960 * default. Set to 0 to disable.
11961 *
11962 * @hide
11963 */
11964 public static final String CONTACTS_DATABASE_WAL_ENABLED = "contacts_database_wal_enabled";
11965
11966 /**
songchenxi825f69a2017-01-19 14:18:41 -080011967 * Flag to enable the link to location permissions in location setting. Set to 0 to disable.
11968 *
11969 * @hide
11970 */
11971 public static final String LOCATION_SETTINGS_LINK_TO_PERMISSIONS_ENABLED =
11972 "location_settings_link_to_permissions_enabled";
11973
11974 /**
qingxi0ca328f2017-05-19 15:20:03 -070011975 * Flag to set the waiting time for euicc factory reset inside System > Settings
11976 * Type: long
11977 *
11978 * @hide
11979 */
qingxi2f231512017-06-23 15:32:53 -070011980 public static final String EUICC_FACTORY_RESET_TIMEOUT_MILLIS =
11981 "euicc_factory_reset_timeout_millis";
qingxi0ca328f2017-05-19 15:20:03 -070011982
11983 /**
Daniel Nishi5782b5c2017-08-24 10:28:52 -070011984 * Flag to set the timeout for when to refresh the storage settings cached data.
11985 * Type: long
11986 *
11987 * @hide
11988 */
11989 public static final String STORAGE_SETTINGS_CLOBBER_THRESHOLD =
11990 "storage_settings_clobber_threshold";
11991
11992 /**
Makoto Onuki0000d322017-11-28 16:31:47 -080011993 * If set to 1, {@link Secure#LOCATION_MODE} will be set to {@link Secure#LOCATION_MODE_OFF}
11994 * temporarily for all users.
11995 *
11996 * @hide
11997 */
Makoto Onuki8e498252018-01-22 17:00:00 -080011998 @TestApi
Makoto Onuki0000d322017-11-28 16:31:47 -080011999 public static final String LOCATION_GLOBAL_KILL_SWITCH =
12000 "location_global_kill_switch";
12001
12002 /**
Michal Karpinskib52575c2018-01-19 17:38:45 +000012003 * If set to 1, SettingsProvider's restoreAnyVersion="true" attribute will be ignored
12004 * and restoring to lower version of platform API will be skipped.
12005 *
12006 * @hide
12007 */
12008 public static final String OVERRIDE_SETTINGS_PROVIDER_RESTORE_ANY_VERSION =
12009 "override_settings_provider_restore_any_version";
Narayan Kamath8d828252018-01-11 15:22:37 +000012010 /**
12011 * Flag to toggle whether system services report attribution chains when they attribute
12012 * battery use via a {@code WorkSource}.
12013 *
12014 * Type: int (0 to disable, 1 to enable)
12015 *
12016 * @hide
12017 */
12018 public static final String CHAINED_BATTERY_ATTRIBUTION_ENABLED =
12019 "chained_battery_attribution_enabled";
Michal Karpinskib52575c2018-01-19 17:38:45 +000012020
12021 /**
Svetoslav Ganova6ebff0f02018-02-14 14:07:02 -080012022 * The packages whitelisted to be run in autofill compatibility mode. The list
Felipe Leme1c7eb0c2018-03-09 14:13:18 -080012023 * of packages is {@code ":"} colon delimited, and each entry has the name of the
12024 * package and an optional list of url bar resource ids (the list is delimited by
12025 * brackets&mdash{@code [} and {@code ]}&mdash and is also comma delimited).
12026 *
12027 * <p>For example, a list with 3 packages {@code p1}, {@code p2}, and {@code p3}, where
12028 * package {@code p1} have one id ({@code url_bar}, {@code p2} has none, and {@code p3 }
12029 * have 2 ids {@code url_foo} and {@code url_bas}) would be
12030 * {@code p1[url_bar]:p2:p3[url_foo,url_bas]}
Svetoslav Ganov24c90452017-12-27 15:17:14 -080012031 *
12032 * @hide
12033 */
12034 @SystemApi
Svet Ganov47b37aa2018-02-16 00:11:39 -080012035 @TestApi
Felipe Lemefd4003b2018-03-20 17:12:17 -070012036 public static final String AUTOFILL_COMPAT_MODE_ALLOWED_PACKAGES =
12037 "autofill_compat_mode_allowed_packages";
Svetoslav Ganov24c90452017-12-27 15:17:14 -080012038
12039 /**
Mathew Inwood169cb3b2018-02-08 12:23:59 +000012040 * Exemptions to the hidden API blacklist.
12041 *
12042 * @hide
12043 */
Mathew Inwood5518c752018-02-27 16:36:11 +000012044 @TestApi
Mathew Inwood169cb3b2018-02-08 12:23:59 +000012045 public static final String HIDDEN_API_BLACKLIST_EXEMPTIONS =
12046 "hidden_api_blacklist_exemptions";
12047
12048 /**
Mathew Inwood04194fe2018-04-04 14:48:03 +010012049 * Sampling rate for hidden API access event logs, as an integer in the range 0 to 0x10000
12050 * inclusive.
12051 *
12052 * @hide
12053 */
12054 public static final String HIDDEN_API_ACCESS_LOG_SAMPLING_RATE =
12055 "hidden_api_access_log_sampling_rate";
12056
12057 /**
Mathew Inwood1ab30252018-04-03 14:47:26 +010012058 * Hidden API enforcement policy for apps targeting SDK versions prior to the latest
12059 * version.
12060 *
12061 * Values correspond to @{@link
12062 * android.content.pm.ApplicationInfo.HiddenApiEnforcementPolicy}
12063 *
12064 * @hide
12065 */
12066 public static final String HIDDEN_API_POLICY_PRE_P_APPS =
12067 "hidden_api_policy_pre_p_apps";
12068
12069 /**
12070 * Hidden API enforcement policy for apps targeting the current SDK version.
12071 *
12072 * Values correspond to @{@link
12073 * android.content.pm.ApplicationInfo.HiddenApiEnforcementPolicy}
12074 *
12075 * @hide
12076 */
12077 public static final String HIDDEN_API_POLICY_P_APPS =
12078 "hidden_api_policy_p_apps";
12079
12080 /**
Philip P. Moltmann18e3eb82018-03-09 16:55:55 -080012081 * Timeout for a single {@link android.media.soundtrigger.SoundTriggerDetectionService}
12082 * operation (in ms).
12083 *
12084 * @hide
12085 */
12086 public static final String SOUND_TRIGGER_DETECTION_SERVICE_OP_TIMEOUT =
12087 "sound_trigger_detection_service_op_timeout";
12088
12089 /**
12090 * Maximum number of {@link android.media.soundtrigger.SoundTriggerDetectionService}
12091 * operations per day.
12092 *
12093 * @hide
12094 */
12095 public static final String MAX_SOUND_TRIGGER_DETECTION_SERVICE_OPS_PER_DAY =
12096 "max_sound_trigger_detection_service_ops_per_day";
12097
12098 /**
Christopher Tate66488d62012-10-02 11:58:01 -070012099 * Settings to backup. This is here so that it's in the same place as the settings
12100 * keys and easy to update.
12101 *
12102 * These keys may be mentioned in the SETTINGS_TO_BACKUP arrays in System
12103 * and Secure as well. This is because those tables drive both backup and
12104 * restore, and restore needs to properly whitelist keys that used to live
12105 * in those namespaces. The keys will only actually be backed up / restored
12106 * if they are also mentioned in this table (Global.SETTINGS_TO_BACKUP).
12107 *
12108 * NOTE: Settings are backed up and restored in the order they appear
12109 * in this array. If you have one setting depending on another,
12110 * make sure that they are ordered appropriately.
12111 *
12112 * @hide
12113 */
12114 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate58f41ec2013-01-11 15:40:36 -080012115 BUGREPORT_IN_POWER_MENU,
Christopher Tate66488d62012-10-02 11:58:01 -070012116 STAY_ON_WHILE_PLUGGED_IN,
jackqdyulei3cd42a02018-02-27 11:18:00 -080012117 APP_AUTO_RESTRICTION_ENABLED,
Christopher Tate66488d62012-10-02 11:58:01 -070012118 AUTO_TIME,
12119 AUTO_TIME_ZONE,
12120 POWER_SOUNDS_ENABLED,
12121 DOCK_SOUNDS_ENABLED,
Ritesh Reddyf8f12132015-11-20 16:43:28 +000012122 CHARGING_SOUNDS_ENABLED,
Christopher Tate66488d62012-10-02 11:58:01 -070012123 USB_MASS_STORAGE_ENABLED,
Stephen Chen42f5f292017-01-20 11:24:08 -080012124 NETWORK_RECOMMENDATIONS_ENABLED,
Stephen Chen42f5f292017-01-20 11:24:08 -080012125 WIFI_WAKEUP_ENABLED,
Christopher Tate66488d62012-10-02 11:58:01 -070012126 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
Glen Kuhne22ae9d52017-11-28 14:06:25 -080012127 WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON,
Amin Shaikhbc9a8e62017-02-02 15:39:12 -080012128 USE_OPEN_WIFI_PACKAGE,
Christopher Tate16eb7cd2012-10-09 15:26:30 -070012129 WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED,
Christopher Tate66488d62012-10-02 11:58:01 -070012130 EMERGENCY_TONE,
12131 CALL_AUTO_RETRY,
Amith Yamasani94005242014-10-31 11:35:13 -070012132 DOCK_AUDIO_MEDIA_ENABLED,
Phil Burkdeaa8d92016-02-23 17:12:04 -080012133 ENCODED_SURROUND_OUTPUT,
jiabin39940752018-04-02 18:18:45 -070012134 ENCODED_SURROUND_OUTPUT_ENABLED_FORMATS,
Stanley Tng767f05f2017-05-01 21:27:31 -070012135 LOW_POWER_MODE_TRIGGER_LEVEL,
Erik Kline4d092232017-10-30 15:29:44 +090012136 BLUETOOTH_ON,
12137 PRIVATE_DNS_MODE,
Mehdi Alizadehdcc0da22017-11-10 15:37:13 -080012138 PRIVATE_DNS_SPECIFIER,
Beverly09da25f2018-02-26 09:17:07 -050012139 SOFT_AP_TIMEOUT_ENABLED,
12140 ZEN_DURATION,
Beverly69721d62018-05-09 17:41:44 -040012141 CHARGING_VIBRATION_ENABLED,
Christopher Tate66488d62012-10-02 11:58:01 -070012142 };
12143
Makoto Onuki53f0e022017-11-29 13:51:01 -080012144 /**
Michal Karpinski5db1e432018-01-18 20:10:24 +000012145 * All settings in {@link SETTINGS_TO_BACKUP} array *must* have a non-null validator,
12146 * otherwise they won't be restored.
12147 *
12148 * @hide
12149 */
12150 public static final Map<String, Validator> VALIDATORS = new ArrayMap<>();
12151 static {
12152 VALIDATORS.put(BUGREPORT_IN_POWER_MENU, BUGREPORT_IN_POWER_MENU_VALIDATOR);
12153 VALIDATORS.put(STAY_ON_WHILE_PLUGGED_IN, STAY_ON_WHILE_PLUGGED_IN_VALIDATOR);
12154 VALIDATORS.put(AUTO_TIME, AUTO_TIME_VALIDATOR);
12155 VALIDATORS.put(AUTO_TIME_ZONE, AUTO_TIME_ZONE_VALIDATOR);
12156 VALIDATORS.put(POWER_SOUNDS_ENABLED, POWER_SOUNDS_ENABLED_VALIDATOR);
12157 VALIDATORS.put(DOCK_SOUNDS_ENABLED, DOCK_SOUNDS_ENABLED_VALIDATOR);
12158 VALIDATORS.put(CHARGING_SOUNDS_ENABLED, CHARGING_SOUNDS_ENABLED_VALIDATOR);
12159 VALIDATORS.put(USB_MASS_STORAGE_ENABLED, USB_MASS_STORAGE_ENABLED_VALIDATOR);
12160 VALIDATORS.put(NETWORK_RECOMMENDATIONS_ENABLED,
12161 NETWORK_RECOMMENDATIONS_ENABLED_VALIDATOR);
12162 VALIDATORS.put(WIFI_WAKEUP_ENABLED, WIFI_WAKEUP_ENABLED_VALIDATOR);
12163 VALIDATORS.put(WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
12164 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR);
12165 VALIDATORS.put(USE_OPEN_WIFI_PACKAGE, USE_OPEN_WIFI_PACKAGE_VALIDATOR);
12166 VALIDATORS.put(WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED,
12167 WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED_VALIDATOR);
12168 VALIDATORS.put(EMERGENCY_TONE, EMERGENCY_TONE_VALIDATOR);
12169 VALIDATORS.put(CALL_AUTO_RETRY, CALL_AUTO_RETRY_VALIDATOR);
12170 VALIDATORS.put(DOCK_AUDIO_MEDIA_ENABLED, DOCK_AUDIO_MEDIA_ENABLED_VALIDATOR);
12171 VALIDATORS.put(ENCODED_SURROUND_OUTPUT, ENCODED_SURROUND_OUTPUT_VALIDATOR);
jiabin39940752018-04-02 18:18:45 -070012172 VALIDATORS.put(ENCODED_SURROUND_OUTPUT_ENABLED_FORMATS,
12173 ENCODED_SURROUND_OUTPUT_ENABLED_FORMATS_VALIDATOR);
Michal Karpinski5db1e432018-01-18 20:10:24 +000012174 VALIDATORS.put(LOW_POWER_MODE_TRIGGER_LEVEL, LOW_POWER_MODE_TRIGGER_LEVEL_VALIDATOR);
Makoto Onuki524b4dfe2018-03-06 17:34:15 -080012175 VALIDATORS.put(LOW_POWER_MODE_TRIGGER_LEVEL_MAX,
12176 LOW_POWER_MODE_TRIGGER_LEVEL_VALIDATOR);
Michal Karpinski5db1e432018-01-18 20:10:24 +000012177 VALIDATORS.put(BLUETOOTH_ON, BLUETOOTH_ON_VALIDATOR);
12178 VALIDATORS.put(PRIVATE_DNS_MODE, PRIVATE_DNS_MODE_VALIDATOR);
12179 VALIDATORS.put(PRIVATE_DNS_SPECIFIER, PRIVATE_DNS_SPECIFIER_VALIDATOR);
12180 VALIDATORS.put(SOFT_AP_TIMEOUT_ENABLED, SOFT_AP_TIMEOUT_ENABLED_VALIDATOR);
Glen Kuhne22ae9d52017-11-28 14:06:25 -080012181 VALIDATORS.put(WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON,
12182 WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR);
jackqdyulei3cd42a02018-02-27 11:18:00 -080012183 VALIDATORS.put(APP_AUTO_RESTRICTION_ENABLED, APP_AUTO_RESTRICTION_ENABLED_VALIDATOR);
Beverly09da25f2018-02-26 09:17:07 -050012184 VALIDATORS.put(ZEN_DURATION, ZEN_DURATION_VALIDATOR);
Beverly69721d62018-05-09 17:41:44 -040012185 VALIDATORS.put(CHARGING_VIBRATION_ENABLED, CHARGING_VIBRATION_ENABLED_VALIDATOR);
Michal Karpinski5db1e432018-01-18 20:10:24 +000012186 }
12187
12188 /**
Makoto Onuki53f0e022017-11-29 13:51:01 -080012189 * Global settings that shouldn't be persisted.
12190 *
12191 * @hide
12192 */
12193 public static final String[] TRANSIENT_SETTINGS = {
12194 LOCATION_GLOBAL_KILL_SWITCH,
12195 };
12196
Michal Karpinski964943a2018-01-19 16:28:26 +000012197 /**
12198 * Keys we no longer back up under the current schema, but want to continue to
12199 * process when restoring historical backup datasets.
12200 *
12201 * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator,
12202 * otherwise they won't be restored.
12203 *
12204 * @hide
12205 */
Christopher Tate1d0fca32017-06-06 13:30:00 -070012206 public static final String[] LEGACY_RESTORE_SETTINGS = {
12207 };
12208
Svetoslav Ganove080da92016-12-21 17:10:35 -080012209 private static final ContentProviderHolder sProviderHolder =
12210 new ContentProviderHolder(CONTENT_URI);
12211
Christopher Tate06efb532012-08-24 15:29:27 -070012212 // Populated lazily, guarded by class object:
Svetoslav Ganove080da92016-12-21 17:10:35 -080012213 private static final NameValueCache sNameValueCache = new NameValueCache(
Dianne Hackborn139748f2012-09-24 11:36:57 -070012214 CONTENT_URI,
12215 CALL_METHOD_GET_GLOBAL,
Svetoslav Ganove080da92016-12-21 17:10:35 -080012216 CALL_METHOD_PUT_GLOBAL,
12217 sProviderHolder);
Christopher Tate06efb532012-08-24 15:29:27 -070012218
Christopher Tateaa036a22014-05-19 16:33:27 -070012219 // Certain settings have been moved from global to the per-user secure namespace
12220 private static final HashSet<String> MOVED_TO_SECURE;
12221 static {
Steve McKayea93fe72016-12-02 11:35:35 -080012222 MOVED_TO_SECURE = new HashSet<>(1);
Christopher Tateaa036a22014-05-19 16:33:27 -070012223 MOVED_TO_SECURE.add(Settings.Global.INSTALL_NON_MARKET_APPS);
12224 }
12225
Svetoslav683914b2015-01-15 14:22:26 -080012226 /** @hide */
12227 public static void getMovedToSecureSettings(Set<String> outKeySet) {
12228 outKeySet.addAll(MOVED_TO_SECURE);
12229 }
12230
Sudheer Shankaaa3c30d2017-05-23 15:19:10 -070012231 /** @hide */
12232 public static void clearProviderForTest() {
12233 sProviderHolder.clearProviderForTest();
12234 sNameValueCache.clearGenerationTrackerForTest();
12235 }
12236
Christopher Tate06efb532012-08-24 15:29:27 -070012237 /**
12238 * Look up a name in the database.
12239 * @param resolver to access the database with
12240 * @param name to look up in the table
12241 * @return the corresponding value, or null if not present
12242 */
Dianne Hackborn139748f2012-09-24 11:36:57 -070012243 public static String getString(ContentResolver resolver, String name) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -070012244 return getStringForUser(resolver, name, resolver.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -070012245 }
12246
12247 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -070012248 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -070012249 int userHandle) {
Christopher Tateaa036a22014-05-19 16:33:27 -070012250 if (MOVED_TO_SECURE.contains(name)) {
12251 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
12252 + " to android.provider.Settings.Secure, returning read-only value.");
12253 return Secure.getStringForUser(resolver, name, userHandle);
12254 }
Christopher Tate06efb532012-08-24 15:29:27 -070012255 return sNameValueCache.getStringForUser(resolver, name, userHandle);
12256 }
12257
12258 /**
12259 * Store a name/value pair into the database.
12260 * @param resolver to access the database with
12261 * @param name to store
12262 * @param value to associate with the name
12263 * @return true if the value was set, false on database errors
12264 */
12265 public static boolean putString(ContentResolver resolver,
12266 String name, String value) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -070012267 return putStringForUser(resolver, name, value, null, false, resolver.getUserId());
Svetoslav Ganove080da92016-12-21 17:10:35 -080012268 }
12269
12270 /**
12271 * Store a name/value pair into the database.
12272 * <p>
12273 * The method takes an optional tag to associate with the setting
12274 * which can be used to clear only settings made by your package and
12275 * associated with this tag by passing the tag to {@link
12276 * #resetToDefaults(ContentResolver, String)}. Anyone can override
12277 * the current tag. Also if another package changes the setting
12278 * then the tag will be set to the one specified in the set call
12279 * which can be null. Also any of the settings setters that do not
12280 * take a tag as an argument effectively clears the tag.
12281 * </p><p>
12282 * For example, if you set settings A and B with tags T1 and T2 and
12283 * another app changes setting A (potentially to the same value), it
12284 * can assign to it a tag T3 (note that now the package that changed
12285 * the setting is not yours). Now if you reset your changes for T1 and
12286 * T2 only setting B will be reset and A not (as it was changed by
12287 * another package) but since A did not change you are in the desired
12288 * initial state. Now if the other app changes the value of A (assuming
12289 * you registered an observer in the beginning) you would detect that
12290 * the setting was changed by another app and handle this appropriately
12291 * (ignore, set back to some value, etc).
12292 * </p><p>
12293 * Also the method takes an argument whether to make the value the
12294 * default for this setting. If the system already specified a default
12295 * value, then the one passed in here will <strong>not</strong>
12296 * be set as the default.
12297 * </p>
12298 *
12299 * @param resolver to access the database with.
12300 * @param name to store.
12301 * @param value to associate with the name.
12302 * @param tag to associated with the setting.
12303 * @param makeDefault whether to make the value the default one.
12304 * @return true if the value was set, false on database errors.
12305 *
12306 * @see #resetToDefaults(ContentResolver, String)
12307 *
12308 * @hide
12309 */
12310 @SystemApi
12311 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
12312 public static boolean putString(@NonNull ContentResolver resolver,
12313 @NonNull String name, @Nullable String value, @Nullable String tag,
12314 boolean makeDefault) {
12315 return putStringForUser(resolver, name, value, tag, makeDefault,
Jeff Sharkeyad357d12018-02-02 13:25:31 -070012316 resolver.getUserId());
Svetoslav Ganove080da92016-12-21 17:10:35 -080012317 }
12318
12319 /**
12320 * Reset the settings to their defaults. This would reset <strong>only</strong>
12321 * settings set by the caller's package. Think of it of a way to undo your own
12322 * changes to the secure settings. Passing in the optional tag will reset only
12323 * settings changed by your package and associated with this tag.
12324 *
12325 * @param resolver Handle to the content resolver.
12326 * @param tag Optional tag which should be associated with the settings to reset.
12327 *
12328 * @see #putString(ContentResolver, String, String, String, boolean)
12329 *
12330 * @hide
12331 */
12332 @SystemApi
12333 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
12334 public static void resetToDefaults(@NonNull ContentResolver resolver,
12335 @Nullable String tag) {
12336 resetToDefaultsAsUser(resolver, tag, RESET_MODE_PACKAGE_DEFAULTS,
Jeff Sharkeyad357d12018-02-02 13:25:31 -070012337 resolver.getUserId());
Svetoslav Ganove080da92016-12-21 17:10:35 -080012338 }
12339
12340 /**
12341 * Reset the settings to their defaults for a given user with a specific mode. The
12342 * optional tag argument is valid only for {@link #RESET_MODE_PACKAGE_DEFAULTS}
12343 * allowing resetting the settings made by a package and associated with the tag.
12344 *
12345 * @param resolver Handle to the content resolver.
12346 * @param tag Optional tag which should be associated with the settings to reset.
12347 * @param mode The reset mode.
12348 * @param userHandle The user for which to reset to defaults.
12349 *
12350 * @see #RESET_MODE_PACKAGE_DEFAULTS
12351 * @see #RESET_MODE_UNTRUSTED_DEFAULTS
12352 * @see #RESET_MODE_UNTRUSTED_CHANGES
12353 * @see #RESET_MODE_TRUSTED_DEFAULTS
12354 *
12355 * @hide
12356 */
12357 public static void resetToDefaultsAsUser(@NonNull ContentResolver resolver,
12358 @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle) {
12359 try {
12360 Bundle arg = new Bundle();
12361 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
12362 if (tag != null) {
12363 arg.putString(CALL_METHOD_TAG_KEY, tag);
12364 }
12365 arg.putInt(CALL_METHOD_RESET_MODE_KEY, mode);
12366 IContentProvider cp = sProviderHolder.getProvider(resolver);
12367 cp.call(resolver.getPackageName(), CALL_METHOD_RESET_GLOBAL, null, arg);
12368 } catch (RemoteException e) {
12369 Log.w(TAG, "Can't reset do defaults for " + CONTENT_URI, e);
12370 }
Christopher Tate06efb532012-08-24 15:29:27 -070012371 }
12372
12373 /** @hide */
12374 public static boolean putStringForUser(ContentResolver resolver,
12375 String name, String value, int userHandle) {
Svetoslav Ganove080da92016-12-21 17:10:35 -080012376 return putStringForUser(resolver, name, value, null, false, userHandle);
12377 }
12378
12379 /** @hide */
12380 public static boolean putStringForUser(@NonNull ContentResolver resolver,
12381 @NonNull String name, @Nullable String value, @Nullable String tag,
12382 boolean makeDefault, @UserIdInt int userHandle) {
Christopher Tate06efb532012-08-24 15:29:27 -070012383 if (LOCAL_LOGV) {
12384 Log.v(TAG, "Global.putString(name=" + name + ", value=" + value
12385 + " for " + userHandle);
12386 }
Christopher Tateaa036a22014-05-19 16:33:27 -070012387 // Global and Secure have the same access policy so we can forward writes
12388 if (MOVED_TO_SECURE.contains(name)) {
12389 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
12390 + " to android.provider.Settings.Secure, value is unchanged.");
Svetoslav Ganove080da92016-12-21 17:10:35 -080012391 return Secure.putStringForUser(resolver, name, value, tag,
12392 makeDefault, userHandle);
Christopher Tateaa036a22014-05-19 16:33:27 -070012393 }
Svetoslav Ganove080da92016-12-21 17:10:35 -080012394 return sNameValueCache.putStringForUser(resolver, name, value, tag,
12395 makeDefault, userHandle);
Christopher Tate06efb532012-08-24 15:29:27 -070012396 }
12397
12398 /**
12399 * Construct the content URI for a particular name/value pair,
12400 * useful for monitoring changes with a ContentObserver.
12401 * @param name to look up in the table
12402 * @return the corresponding content URI, or null if not present
12403 */
12404 public static Uri getUriFor(String name) {
12405 return getUriFor(CONTENT_URI, name);
12406 }
12407
12408 /**
12409 * Convenience function for retrieving a single secure settings value
12410 * as an integer. Note that internally setting values are always
12411 * stored as strings; this function converts the string to an integer
12412 * for you. The default value will be returned if the setting is
12413 * not defined or not an integer.
12414 *
12415 * @param cr The ContentResolver to access.
12416 * @param name The name of the setting to retrieve.
12417 * @param def Value to return if the setting is not defined.
12418 *
12419 * @return The setting's current value, or 'def' if it is not defined
12420 * or not a valid integer.
12421 */
12422 public static int getInt(ContentResolver cr, String name, int def) {
12423 String v = getString(cr, name);
12424 try {
12425 return v != null ? Integer.parseInt(v) : def;
12426 } catch (NumberFormatException e) {
12427 return def;
12428 }
12429 }
12430
12431 /**
12432 * Convenience function for retrieving a single secure settings value
12433 * as an integer. Note that internally setting values are always
12434 * stored as strings; this function converts the string to an integer
12435 * for you.
12436 * <p>
12437 * This version does not take a default value. If the setting has not
12438 * been set, or the string value is not a number,
12439 * it throws {@link SettingNotFoundException}.
12440 *
12441 * @param cr The ContentResolver to access.
12442 * @param name The name of the setting to retrieve.
12443 *
12444 * @throws SettingNotFoundException Thrown if a setting by the given
12445 * name can't be found or the setting value is not an integer.
12446 *
12447 * @return The setting's current value.
12448 */
12449 public static int getInt(ContentResolver cr, String name)
12450 throws SettingNotFoundException {
12451 String v = getString(cr, name);
12452 try {
12453 return Integer.parseInt(v);
12454 } catch (NumberFormatException e) {
12455 throw new SettingNotFoundException(name);
12456 }
12457 }
12458
12459 /**
12460 * Convenience function for updating a single settings value as an
12461 * integer. This will either create a new entry in the table if the
12462 * given name does not exist, or modify the value of the existing row
12463 * with that name. Note that internally setting values are always
12464 * stored as strings, so this function converts the given value to a
12465 * string before storing it.
12466 *
12467 * @param cr The ContentResolver to access.
12468 * @param name The name of the setting to modify.
12469 * @param value The new value for the setting.
12470 * @return true if the value was set, false on database errors
12471 */
12472 public static boolean putInt(ContentResolver cr, String name, int value) {
12473 return putString(cr, name, Integer.toString(value));
12474 }
12475
12476 /**
12477 * Convenience function for retrieving a single secure settings value
12478 * as a {@code long}. Note that internally setting values are always
12479 * stored as strings; this function converts the string to a {@code long}
12480 * for you. The default value will be returned if the setting is
12481 * not defined or not a {@code long}.
12482 *
12483 * @param cr The ContentResolver to access.
12484 * @param name The name of the setting to retrieve.
12485 * @param def Value to return if the setting is not defined.
12486 *
12487 * @return The setting's current value, or 'def' if it is not defined
12488 * or not a valid {@code long}.
12489 */
12490 public static long getLong(ContentResolver cr, String name, long def) {
12491 String valString = getString(cr, name);
12492 long value;
12493 try {
12494 value = valString != null ? Long.parseLong(valString) : def;
12495 } catch (NumberFormatException e) {
12496 value = def;
12497 }
12498 return value;
12499 }
12500
12501 /**
12502 * Convenience function for retrieving a single secure settings value
12503 * as a {@code long}. Note that internally setting values are always
12504 * stored as strings; this function converts the string to a {@code long}
12505 * for you.
12506 * <p>
12507 * This version does not take a default value. If the setting has not
12508 * been set, or the string value is not a number,
12509 * it throws {@link SettingNotFoundException}.
12510 *
12511 * @param cr The ContentResolver to access.
12512 * @param name The name of the setting to retrieve.
12513 *
12514 * @return The setting's current value.
12515 * @throws SettingNotFoundException Thrown if a setting by the given
12516 * name can't be found or the setting value is not an integer.
12517 */
12518 public static long getLong(ContentResolver cr, String name)
12519 throws SettingNotFoundException {
12520 String valString = getString(cr, name);
12521 try {
12522 return Long.parseLong(valString);
12523 } catch (NumberFormatException e) {
12524 throw new SettingNotFoundException(name);
12525 }
12526 }
12527
12528 /**
12529 * Convenience function for updating a secure settings value as a long
12530 * integer. This will either create a new entry in the table if the
12531 * given name does not exist, or modify the value of the existing row
12532 * with that name. Note that internally setting values are always
12533 * stored as strings, so this function converts the given value to a
12534 * string before storing it.
12535 *
12536 * @param cr The ContentResolver to access.
12537 * @param name The name of the setting to modify.
12538 * @param value The new value for the setting.
12539 * @return true if the value was set, false on database errors
12540 */
12541 public static boolean putLong(ContentResolver cr, String name, long value) {
12542 return putString(cr, name, Long.toString(value));
12543 }
12544
12545 /**
12546 * Convenience function for retrieving a single secure settings value
12547 * as a floating point number. Note that internally setting values are
12548 * always stored as strings; this function converts the string to an
12549 * float for you. The default value will be returned if the setting
12550 * is not defined or not a valid float.
12551 *
12552 * @param cr The ContentResolver to access.
12553 * @param name The name of the setting to retrieve.
12554 * @param def Value to return if the setting is not defined.
12555 *
12556 * @return The setting's current value, or 'def' if it is not defined
12557 * or not a valid float.
12558 */
12559 public static float getFloat(ContentResolver cr, String name, float def) {
12560 String v = getString(cr, name);
12561 try {
12562 return v != null ? Float.parseFloat(v) : def;
12563 } catch (NumberFormatException e) {
12564 return def;
12565 }
12566 }
12567
12568 /**
12569 * Convenience function for retrieving a single secure settings value
12570 * as a float. Note that internally setting values are always
12571 * stored as strings; this function converts the string to a float
12572 * for you.
12573 * <p>
12574 * This version does not take a default value. If the setting has not
12575 * been set, or the string value is not a number,
12576 * it throws {@link SettingNotFoundException}.
12577 *
12578 * @param cr The ContentResolver to access.
12579 * @param name The name of the setting to retrieve.
12580 *
12581 * @throws SettingNotFoundException Thrown if a setting by the given
12582 * name can't be found or the setting value is not a float.
12583 *
12584 * @return The setting's current value.
12585 */
12586 public static float getFloat(ContentResolver cr, String name)
12587 throws SettingNotFoundException {
12588 String v = getString(cr, name);
12589 if (v == null) {
12590 throw new SettingNotFoundException(name);
12591 }
12592 try {
12593 return Float.parseFloat(v);
12594 } catch (NumberFormatException e) {
12595 throw new SettingNotFoundException(name);
12596 }
12597 }
12598
12599 /**
12600 * Convenience function for updating a single settings value as a
12601 * floating point number. This will either create a new entry in the
12602 * table if the given name does not exist, or modify the value of the
12603 * existing row with that name. Note that internally setting values
12604 * are always stored as strings, so this function converts the given
12605 * value to a string before storing it.
12606 *
12607 * @param cr The ContentResolver to access.
12608 * @param name The name of the setting to modify.
12609 * @param value The new value for the setting.
12610 * @return true if the value was set, false on database errors
12611 */
12612 public static boolean putFloat(ContentResolver cr, String name, float value) {
12613 return putString(cr, name, Float.toString(value));
12614 }
Wink Savillefb40dd42014-06-12 17:02:31 -070012615
Wink Savillefb40dd42014-06-12 17:02:31 -070012616 /**
12617 * Subscription to be used for voice call on a multi sim device. The supported values
12618 * are 0 = SUB1, 1 = SUB2 and etc.
12619 * @hide
12620 */
12621 public static final String MULTI_SIM_VOICE_CALL_SUBSCRIPTION = "multi_sim_voice_call";
12622
12623 /**
12624 * Used to provide option to user to select subscription during dial.
12625 * The supported values are 0 = disable or 1 = enable prompt.
12626 * @hide
12627 */
12628 public static final String MULTI_SIM_VOICE_PROMPT = "multi_sim_voice_prompt";
12629
12630 /**
12631 * Subscription to be used for data call on a multi sim device. The supported values
12632 * are 0 = SUB1, 1 = SUB2 and etc.
12633 * @hide
12634 */
12635 public static final String MULTI_SIM_DATA_CALL_SUBSCRIPTION = "multi_sim_data_call";
12636
12637 /**
12638 * Subscription to be used for SMS on a multi sim device. The supported values
12639 * are 0 = SUB1, 1 = SUB2 and etc.
12640 * @hide
12641 */
12642 public static final String MULTI_SIM_SMS_SUBSCRIPTION = "multi_sim_sms";
12643
Rohan Shah0350dab2018-05-04 13:42:18 -070012644 /**
Wink Savillefb40dd42014-06-12 17:02:31 -070012645 * Used to provide option to user to select subscription during send SMS.
12646 * The value 1 - enable, 0 - disable
12647 * @hide
12648 */
12649 public static final String MULTI_SIM_SMS_PROMPT = "multi_sim_sms_prompt";
12650
Wink Savillefb40dd42014-06-12 17:02:31 -070012651 /** User preferred subscriptions setting.
12652 * This holds the details of the user selected subscription from the card and
Kweku Adamsb0886f32017-10-31 15:32:09 -070012653 * the activation status. Each settings string have the comma separated values
Wink Savillefb40dd42014-06-12 17:02:31 -070012654 * iccId,appType,appId,activationStatus,3gppIndex,3gpp2Index
12655 * @hide
12656 */
12657 public static final String[] MULTI_SIM_USER_PREFERRED_SUBS = {"user_preferred_sub1",
12658 "user_preferred_sub2","user_preferred_sub3"};
Zheng Fub218ff42015-04-13 16:31:16 -070012659
12660 /**
12661 * Whether to enable new contacts aggregator or not.
12662 * The value 1 - enable, 0 - disable
12663 * @hide
12664 */
12665 public static final String NEW_CONTACT_AGGREGATOR = "new_contact_aggregator";
Zheng Fu31ce78c2015-04-15 16:57:53 -070012666
12667 /**
12668 * Whether to enable contacts metadata syncing or not
12669 * The value 1 - enable, 0 - disable
Tingting Wange0cbda42016-05-10 15:39:37 -070012670 *
12671 * @removed
Zheng Fu31ce78c2015-04-15 16:57:53 -070012672 */
Tingting Wange0cbda42016-05-10 15:39:37 -070012673 @Deprecated
Zheng Fu31ce78c2015-04-15 16:57:53 -070012674 public static final String CONTACT_METADATA_SYNC = "contact_metadata_sync";
Wei Liua1817702015-08-11 21:21:12 -070012675
12676 /**
Tingting Wange0cbda42016-05-10 15:39:37 -070012677 * Whether to enable contacts metadata syncing or not
12678 * The value 1 - enable, 0 - disable
12679 */
12680 public static final String CONTACT_METADATA_SYNC_ENABLED = "contact_metadata_sync_enabled";
12681
12682 /**
Wei Liua1817702015-08-11 21:21:12 -070012683 * Whether to enable cellular on boot.
12684 * The value 1 - enable, 0 - disable
12685 * @hide
12686 */
12687 public static final String ENABLE_CELLULAR_ON_BOOT = "enable_cellular_on_boot";
Steven Ngdc20ba62016-04-26 18:19:04 +010012688
12689 /**
Chris Wren763a9bb2016-05-31 17:14:12 -040012690 * The maximum allowed notification enqueue rate in Hertz.
12691 *
Julia Reynolds76c096d2017-06-19 08:16:04 -040012692 * Should be a float, and includes updates only.
Chris Wren763a9bb2016-05-31 17:14:12 -040012693 * @hide
12694 */
12695 public static final String MAX_NOTIFICATION_ENQUEUE_RATE = "max_notification_enqueue_rate";
Doris Ling628cea42016-06-09 10:35:02 -070012696
12697 /**
Geoffrey Pitsch4c6eef22017-04-19 10:26:45 -040012698 * Displays toasts when an app posts a notification that does not specify a valid channel.
12699 *
12700 * The value 1 - enable, 0 - disable
12701 * @hide
12702 */
12703 public static final String SHOW_NOTIFICATION_CHANNEL_WARNINGS =
12704 "show_notification_channel_warnings";
12705
12706 /**
Chris Manton95a6c892016-03-15 13:26:11 -070012707 * Whether cell is enabled/disabled
12708 * @hide
12709 */
12710 public static final String CELL_ON = "cell_on";
Chad Brubaker97bccee2017-01-05 15:51:41 -080012711
12712 /**
Todd Kennedybe0b8892017-02-15 14:13:52 -080012713 * Global settings which can be accessed by instant apps.
Chad Brubaker97bccee2017-01-05 15:51:41 -080012714 * @hide
12715 */
Todd Kennedybe0b8892017-02-15 14:13:52 -080012716 public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>();
Chad Brubaker97bccee2017-01-05 15:51:41 -080012717 static {
Todd Kennedybe0b8892017-02-15 14:13:52 -080012718 INSTANT_APP_SETTINGS.add(WAIT_FOR_DEBUGGER);
12719 INSTANT_APP_SETTINGS.add(DEVICE_PROVISIONED);
12720 INSTANT_APP_SETTINGS.add(DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES);
12721 INSTANT_APP_SETTINGS.add(DEVELOPMENT_FORCE_RTL);
12722 INSTANT_APP_SETTINGS.add(EPHEMERAL_COOKIE_MAX_SIZE_BYTES);
Chad Brubaker1f6a2662017-03-20 11:11:30 -070012723 INSTANT_APP_SETTINGS.add(AIRPLANE_MODE_ON);
Chad Brubaker91d2e282017-04-03 14:34:50 -070012724 INSTANT_APP_SETTINGS.add(WINDOW_ANIMATION_SCALE);
12725 INSTANT_APP_SETTINGS.add(TRANSITION_ANIMATION_SCALE);
12726 INSTANT_APP_SETTINGS.add(ANIMATOR_DURATION_SCALE);
12727 INSTANT_APP_SETTINGS.add(DEBUG_VIEW_ATTRIBUTES);
Chad Brubaker562afaf2017-04-10 13:32:37 -070012728 INSTANT_APP_SETTINGS.add(WTF_IS_FATAL);
Chad Brubakera6170b82017-09-01 14:48:46 -070012729 INSTANT_APP_SETTINGS.add(SEND_ACTION_APP_ERROR);
Svet Ganov8f90bcc2017-12-22 23:29:24 -080012730 INSTANT_APP_SETTINGS.add(ZEN_MODE);
Chad Brubaker97bccee2017-01-05 15:51:41 -080012731 }
12732
Andrew Sappersteine3352562017-01-20 15:41:03 -080012733 /**
12734 * Whether to show the high temperature warning notification.
12735 * @hide
12736 */
12737 public static final String SHOW_TEMPERATURE_WARNING = "show_temperature_warning";
12738
12739 /**
12740 * Temperature at which the high temperature warning notification should be shown.
12741 * @hide
12742 */
12743 public static final String WARNING_TEMPERATURE = "warning_temperature";
Daniel Nishi88e45dc2017-01-25 11:43:55 -080012744
12745 /**
12746 * Whether the diskstats logging task is enabled/disabled.
12747 * @hide
12748 */
12749 public static final String ENABLE_DISKSTATS_LOGGING = "enable_diskstats_logging";
Daniel Nishi0f703e62017-02-21 15:19:27 -080012750
12751 /**
12752 * Whether the cache quota calculation task is enabled/disabled.
12753 * @hide
12754 */
12755 public static final String ENABLE_CACHE_QUOTA_CALCULATION =
12756 "enable_cache_quota_calculation";
Daniel Nishi4f5320e2017-06-13 17:51:21 -070012757
12758 /**
12759 * Whether the Deletion Helper no threshold toggle is available.
12760 * @hide
12761 */
12762 public static final String ENABLE_DELETION_HELPER_NO_THRESHOLD_TOGGLE =
12763 "enable_deletion_helper_no_threshold_toggle";
Chris Wrene901a7e2017-10-02 17:29:46 -040012764
12765 /**
12766 * The list of snooze options for notifications
12767 * This is encoded as a key=value list, separated by commas. Ex:
12768 *
12769 * "default=60,options_array=15:30:60:120"
12770 *
12771 * The following keys are supported:
12772 *
12773 * <pre>
12774 * default (int)
Chris Wren41707512017-12-06 00:12:17 -050012775 * options_array (int[])
Chris Wrene901a7e2017-10-02 17:29:46 -040012776 * </pre>
12777 *
12778 * All delays in integer minutes. Array order is respected.
12779 * Options will be used in order up to the maximum allowed by the UI.
12780 * @hide
12781 */
12782 public static final String NOTIFICATION_SNOOZE_OPTIONS =
12783 "notification_snooze_options";
gomo48f1a642017-11-10 20:35:46 -080012784
12785 /**
Rohan Shah0350dab2018-05-04 13:42:18 -070012786 * Settings key for the ratio of notification dismissals to notification views - one of the
12787 * criteria for showing the notification blocking helper.
12788 *
12789 * <p>The value is a float ranging from 0.0 to 1.0 (the closer to 0.0, the more intrusive
12790 * the blocking helper will be).
12791 *
12792 * @hide
12793 */
12794 public static final String BLOCKING_HELPER_DISMISS_TO_VIEW_RATIO_LIMIT =
12795 "blocking_helper_dismiss_to_view_ratio";
12796
12797 /**
12798 * Settings key for the longest streak of dismissals - one of the criteria for showing the
12799 * notification blocking helper.
12800 *
12801 * <p>The value is an integer greater than 0.
12802 *
12803 * @hide
12804 */
12805 public static final String BLOCKING_HELPER_STREAK_LIMIT = "blocking_helper_streak_limit";
12806
12807 /**
Fyodor Kupolovee90c032017-12-12 11:52:57 -080012808 * Configuration flags for SQLite Compatibility WAL. Encoded as a key-value list, separated
12809 * by commas. E.g.: compatibility_wal_supported=true, wal_syncmode=OFF
12810 *
12811 * Supported keys:
12812 * compatibility_wal_supported (boolean)
12813 * wal_syncmode (String)
12814 *
12815 * @hide
12816 */
12817 public static final String SQLITE_COMPATIBILITY_WAL_FLAGS =
12818 "sqlite_compatibility_wal_flags";
12819
12820 /**
gomo48f1a642017-11-10 20:35:46 -080012821 * Enable GNSS Raw Measurements Full Tracking?
12822 * 0 = no
12823 * 1 = yes
12824 * @hide
12825 */
12826 public static final String ENABLE_GNSS_RAW_MEAS_FULL_TRACKING =
12827 "enable_gnss_raw_meas_full_tracking";
Daniel Colascione766b6322018-01-08 19:10:36 -080012828
12829 /**
goneil42919602018-01-23 17:37:26 -080012830 * Whether the notification should be ongoing (persistent) when a carrier app install is
12831 * required.
12832 *
12833 * The value is a boolean (1 or 0).
12834 * @hide
12835 */
12836 @SystemApi
12837 public static final String INSTALL_CARRIER_APP_NOTIFICATION_PERSISTENT =
12838 "install_carrier_app_notification_persistent";
12839
12840 /**
12841 * The amount of time (ms) to hide the install carrier app notification after the user has
12842 * ignored it. After this time passes, the notification will be shown again
12843 *
12844 * The value is a long
12845 * @hide
12846 */
12847 @SystemApi
12848 public static final String INSTALL_CARRIER_APP_NOTIFICATION_SLEEP_MILLIS =
12849 "install_carrier_app_notification_sleep_millis";
12850
12851 /**
Daniel Colascione766b6322018-01-08 19:10:36 -080012852 * Whether we've enabled zram on this device. Takes effect on
12853 * reboot. The value "1" enables zram; "0" disables it, and
12854 * everything else is unspecified.
12855 * @hide
12856 */
12857 public static final String ZRAM_ENABLED =
12858 "zram_enabled";
Petr Cermak9669e902018-01-16 16:37:22 +000012859
12860 /**
Petr Cermak10011fa2018-02-05 19:00:54 +000012861 * Configuration flags for smart replies in notifications.
12862 * This is encoded as a key=value list, separated by commas. Ex:
12863 *
12864 * "enabled=1,max_squeeze_remeasure_count=3"
12865 *
12866 * The following keys are supported:
12867 *
12868 * <pre>
12869 * enabled (boolean)
Richard Ledley4069f7a2018-02-26 10:36:00 +000012870 * requires_targeting_p (boolean)
Petr Cermak10011fa2018-02-05 19:00:54 +000012871 * max_squeeze_remeasure_attempts (int)
12872 * </pre>
12873 * @see com.android.systemui.statusbar.policy.SmartReplyConstants
Petr Cermak9669e902018-01-16 16:37:22 +000012874 * @hide
12875 */
Petr Cermak10011fa2018-02-05 19:00:54 +000012876 public static final String SMART_REPLIES_IN_NOTIFICATIONS_FLAGS =
12877 "smart_replies_in_notifications_flags";
Andrew Sapperstein43643ae2017-12-20 15:17:33 -080012878
12879 /**
12880 * If nonzero, crashes in foreground processes will bring up a dialog.
12881 * Otherwise, the process will be silently killed.
12882 * @hide
12883 */
12884 public static final String SHOW_FIRST_CRASH_DIALOG = "show_first_crash_dialog";
Andrew Sapperstein5b679c42018-01-16 11:13:40 -080012885
12886 /**
12887 * If nonzero, crash dialogs will show an option to restart the app.
12888 * @hide
12889 */
12890 public static final String SHOW_RESTART_IN_CRASH_DIALOG = "show_restart_in_crash_dialog";
12891
12892 /**
12893 * If nonzero, crash dialogs will show an option to mute all future crash dialogs for
12894 * this app.
12895 * @hide
12896 */
12897 public static final String SHOW_MUTE_IN_CRASH_DIALOG = "show_mute_in_crash_dialog";
Beverly3bae4e52018-02-07 12:32:02 -050012898
12899 /**
12900 * If nonzero, will show the zen upgrade notification when the user toggles DND on/off.
12901 * @hide
12902 */
12903 public static final String SHOW_ZEN_UPGRADE_NOTIFICATION = "show_zen_upgrade_notification";
Annie Mengd069a882018-03-13 15:31:40 +000012904
12905 /**
Beverly301e92a2018-04-27 09:43:05 -040012906 * If nonzero, will show the zen update settings suggestion.
12907 * @hide
12908 */
12909 public static final String SHOW_ZEN_SETTINGS_SUGGESTION = "show_zen_settings_suggestion";
12910
12911 /**
12912 * If nonzero, zen has not been updated to reflect new changes.
12913 * @hide
12914 */
12915 public static final String ZEN_SETTINGS_UPDATED = "zen_settings_updated";
12916
12917 /**
12918 * If nonzero, zen setting suggestion has beem viewed by user
12919 * @hide
12920 */
12921 public static final String ZEN_SETTINGS_SUGGESTION_VIEWED =
12922 "zen_settings_suggestion_viewed";
12923
12924 /**
Annie Mengd069a882018-03-13 15:31:40 +000012925 * Backup and restore agent timeout parameters.
12926 * These parameters are represented by a comma-delimited key-value list.
12927 *
12928 * The following strings are supported as keys:
12929 * <pre>
12930 * kv_backup_agent_timeout_millis (long)
12931 * full_backup_agent_timeout_millis (long)
12932 * shared_backup_agent_timeout_millis (long)
12933 * restore_agent_timeout_millis (long)
12934 * restore_agent_finished_timeout_millis (long)
12935 * </pre>
12936 *
12937 * They map to milliseconds represented as longs.
12938 *
12939 * Ex: "kv_backup_agent_timeout_millis=30000,full_backup_agent_timeout_millis=300000"
12940 *
12941 * @hide
12942 */
12943 public static final String BACKUP_AGENT_TIMEOUT_PARAMETERS =
12944 "backup_agent_timeout_parameters";
Alice Shengb32b1ad2018-03-14 12:00:44 -070012945
12946 /**
Yu-Han Yang66c7ea92018-03-11 17:17:15 -070012947 * Blacklist of GNSS satellites.
12948 *
12949 * This is a list of integers separated by commas to represent pairs of (constellation,
12950 * svid). Thus, the number of integers should be even.
12951 *
12952 * E.g.: "3,0,5,24" denotes (constellation=3, svid=0) and (constellation=5, svid=24) are
12953 * blacklisted. Note that svid=0 denotes all svids in the
12954 * constellation are blacklisted.
12955 *
12956 * @hide
12957 */
12958 public static final String GNSS_SATELLITE_BLACKLIST = "gnss_satellite_blacklist";
Yu-Han Yangab3e7bd2018-04-06 10:23:28 -070012959
12960 /**
12961 * Duration of updates in millisecond for GNSS location request from HAL to framework.
12962 *
12963 * If zero, the GNSS location request feature is disabled.
12964 *
12965 * The value is a non-negative long.
12966 *
12967 * @hide
12968 */
12969 public static final String GNSS_HAL_LOCATION_REQUEST_DURATION_MILLIS =
12970 "gnss_hal_location_request_duration_millis";
Christopher Tate06efb532012-08-24 15:29:27 -070012971 }
12972
12973 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080012974 * User-defined bookmarks and shortcuts. The target of each bookmark is an
12975 * Intent URL, allowing it to be either a web page or a particular
12976 * application activity.
12977 *
12978 * @hide
12979 */
12980 public static final class Bookmarks implements BaseColumns
12981 {
12982 private static final String TAG = "Bookmarks";
12983
12984 /**
12985 * The content:// style URL for this table
12986 */
12987 public static final Uri CONTENT_URI =
12988 Uri.parse("content://" + AUTHORITY + "/bookmarks");
12989
12990 /**
12991 * The row ID.
12992 * <p>Type: INTEGER</p>
12993 */
12994 public static final String ID = "_id";
12995
12996 /**
12997 * Descriptive name of the bookmark that can be displayed to the user.
12998 * If this is empty, the title should be resolved at display time (use
12999 * {@link #getTitle(Context, Cursor)} any time you want to display the
13000 * title of a bookmark.)
13001 * <P>
13002 * Type: TEXT
13003 * </P>
13004 */
13005 public static final String TITLE = "title";
13006
13007 /**
13008 * Arbitrary string (displayed to the user) that allows bookmarks to be
13009 * organized into categories. There are some special names for
13010 * standard folders, which all start with '@'. The label displayed for
13011 * the folder changes with the locale (via {@link #getLabelForFolder}) but
13012 * the folder name does not change so you can consistently query for
13013 * the folder regardless of the current locale.
13014 *
13015 * <P>Type: TEXT</P>
13016 *
13017 */
13018 public static final String FOLDER = "folder";
13019
13020 /**
13021 * The Intent URL of the bookmark, describing what it points to. This
13022 * value is given to {@link android.content.Intent#getIntent} to create
13023 * an Intent that can be launched.
13024 * <P>Type: TEXT</P>
13025 */
13026 public static final String INTENT = "intent";
13027
13028 /**
13029 * Optional shortcut character associated with this bookmark.
13030 * <P>Type: INTEGER</P>
13031 */
13032 public static final String SHORTCUT = "shortcut";
13033
13034 /**
13035 * The order in which the bookmark should be displayed
13036 * <P>Type: INTEGER</P>
13037 */
13038 public static final String ORDERING = "ordering";
13039
13040 private static final String[] sIntentProjection = { INTENT };
13041 private static final String[] sShortcutProjection = { ID, SHORTCUT };
13042 private static final String sShortcutSelection = SHORTCUT + "=?";
13043
13044 /**
13045 * Convenience function to retrieve the bookmarked Intent for a
13046 * particular shortcut key.
13047 *
13048 * @param cr The ContentResolver to query.
13049 * @param shortcut The shortcut key.
13050 *
13051 * @return Intent The bookmarked URL, or null if there is no bookmark
13052 * matching the given shortcut.
13053 */
13054 public static Intent getIntentForShortcut(ContentResolver cr, char shortcut)
13055 {
13056 Intent intent = null;
13057
13058 Cursor c = cr.query(CONTENT_URI,
13059 sIntentProjection, sShortcutSelection,
13060 new String[] { String.valueOf((int) shortcut) }, ORDERING);
13061 // Keep trying until we find a valid shortcut
13062 try {
13063 while (intent == null && c.moveToNext()) {
13064 try {
13065 String intentURI = c.getString(c.getColumnIndexOrThrow(INTENT));
Christian Mehlmauera34d2c92010-05-25 19:04:20 +020013066 intent = Intent.parseUri(intentURI, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080013067 } catch (java.net.URISyntaxException e) {
13068 // The stored URL is bad... ignore it.
13069 } catch (IllegalArgumentException e) {
13070 // Column not found
Dianne Hackborna33e3f72009-09-29 17:28:24 -070013071 Log.w(TAG, "Intent column not found", e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080013072 }
13073 }
13074 } finally {
13075 if (c != null) c.close();
13076 }
13077
13078 return intent;
13079 }
13080
13081 /**
13082 * Add a new bookmark to the system.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -070013083 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080013084 * @param cr The ContentResolver to query.
13085 * @param intent The desired target of the bookmark.
13086 * @param title Bookmark title that is shown to the user; null if none
13087 * or it should be resolved to the intent's title.
13088 * @param folder Folder in which to place the bookmark; null if none.
13089 * @param shortcut Shortcut that will invoke the bookmark; 0 if none. If
13090 * this is non-zero and there is an existing bookmark entry
13091 * with this same shortcut, then that existing shortcut is
13092 * cleared (the bookmark is not removed).
13093 * @return The unique content URL for the new bookmark entry.
13094 */
13095 public static Uri add(ContentResolver cr,
13096 Intent intent,
13097 String title,
13098 String folder,
13099 char shortcut,
13100 int ordering)
13101 {
13102 // If a shortcut is supplied, and it is already defined for
13103 // another bookmark, then remove the old definition.
13104 if (shortcut != 0) {
Jeff Hamilton7cd51ef2010-05-12 17:30:27 -050013105 cr.delete(CONTENT_URI, sShortcutSelection,
13106 new String[] { String.valueOf((int) shortcut) });
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080013107 }
13108
13109 ContentValues values = new ContentValues();
13110 if (title != null) values.put(TITLE, title);
13111 if (folder != null) values.put(FOLDER, folder);
Jean-Baptiste Queru3b9f0a32010-06-21 13:46:59 -070013112 values.put(INTENT, intent.toUri(0));
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080013113 if (shortcut != 0) values.put(SHORTCUT, (int) shortcut);
13114 values.put(ORDERING, ordering);
13115 return cr.insert(CONTENT_URI, values);
13116 }
13117
13118 /**
13119 * Return the folder name as it should be displayed to the user. This
13120 * takes care of localizing special folders.
13121 *
13122 * @param r Resources object for current locale; only need access to
13123 * system resources.
13124 * @param folder The value found in the {@link #FOLDER} column.
13125 *
13126 * @return CharSequence The label for this folder that should be shown
13127 * to the user.
13128 */
13129 public static CharSequence getLabelForFolder(Resources r, String folder) {
13130 return folder;
13131 }
13132
13133 /**
13134 * Return the title as it should be displayed to the user. This takes
13135 * care of localizing bookmarks that point to activities.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -070013136 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080013137 * @param context A context.
13138 * @param cursor A cursor pointing to the row whose title should be
13139 * returned. The cursor must contain at least the {@link #TITLE}
13140 * and {@link #INTENT} columns.
13141 * @return A title that is localized and can be displayed to the user,
13142 * or the empty string if one could not be found.
13143 */
13144 public static CharSequence getTitle(Context context, Cursor cursor) {
13145 int titleColumn = cursor.getColumnIndex(TITLE);
13146 int intentColumn = cursor.getColumnIndex(INTENT);
13147 if (titleColumn == -1 || intentColumn == -1) {
13148 throw new IllegalArgumentException(
13149 "The cursor must contain the TITLE and INTENT columns.");
13150 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -070013151
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080013152 String title = cursor.getString(titleColumn);
13153 if (!TextUtils.isEmpty(title)) {
13154 return title;
13155 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -070013156
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080013157 String intentUri = cursor.getString(intentColumn);
13158 if (TextUtils.isEmpty(intentUri)) {
13159 return "";
13160 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -070013161
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080013162 Intent intent;
13163 try {
Christian Mehlmauera34d2c92010-05-25 19:04:20 +020013164 intent = Intent.parseUri(intentUri, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080013165 } catch (URISyntaxException e) {
13166 return "";
13167 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -070013168
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080013169 PackageManager packageManager = context.getPackageManager();
13170 ResolveInfo info = packageManager.resolveActivity(intent, 0);
13171 return info != null ? info.loadLabel(packageManager) : "";
13172 }
13173 }
13174
Billy Laua7238a32015-08-01 12:45:02 +010013175 private static final String[] PM_WRITE_SETTINGS = {
13176 android.Manifest.permission.WRITE_SETTINGS
13177 };
13178 private static final String[] PM_CHANGE_NETWORK_STATE = {
13179 android.Manifest.permission.CHANGE_NETWORK_STATE,
13180 android.Manifest.permission.WRITE_SETTINGS
13181 };
13182 private static final String[] PM_SYSTEM_ALERT_WINDOW = {
13183 android.Manifest.permission.SYSTEM_ALERT_WINDOW
13184 };
13185
Billy Lau6ad2d662015-07-18 00:26:58 +010013186 /**
13187 * Performs a strict and comprehensive check of whether a calling package is allowed to
13188 * write/modify system settings, as the condition differs for pre-M, M+, and
13189 * privileged/preinstalled apps. If the provided uid does not match the
13190 * callingPackage, a negative result will be returned.
13191 * @hide
13192 */
13193 public static boolean isCallingPackageAllowedToWriteSettings(Context context, int uid,
13194 String callingPackage, boolean throwException) {
13195 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
13196 callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS,
Billy Laua7238a32015-08-01 12:45:02 +010013197 PM_WRITE_SETTINGS, false);
Billy Lau6ad2d662015-07-18 00:26:58 +010013198 }
13199
13200 /**
13201 * Performs a strict and comprehensive check of whether a calling package is allowed to
13202 * write/modify system settings, as the condition differs for pre-M, M+, and
13203 * privileged/preinstalled apps. If the provided uid does not match the
Billy Laua7238a32015-08-01 12:45:02 +010013204 * callingPackage, a negative result will be returned. The caller is expected to have
Lorenzo Colittid5427052015-10-15 16:29:00 +090013205 * the WRITE_SETTINGS permission declared.
Billy Lau6ad2d662015-07-18 00:26:58 +010013206 *
13207 * Note: if the check is successful, the operation of this app will be updated to the
13208 * current time.
13209 * @hide
13210 */
13211 public static boolean checkAndNoteWriteSettingsOperation(Context context, int uid,
13212 String callingPackage, boolean throwException) {
13213 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
13214 callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS,
Billy Laua7238a32015-08-01 12:45:02 +010013215 PM_WRITE_SETTINGS, true);
13216 }
13217
13218 /**
13219 * Performs a strict and comprehensive check of whether a calling package is allowed to
13220 * change the state of network, as the condition differs for pre-M, M+, and
Lorenzo Colittid5427052015-10-15 16:29:00 +090013221 * privileged/preinstalled apps. The caller is expected to have either the
13222 * CHANGE_NETWORK_STATE or the WRITE_SETTINGS permission declared. Either of these
13223 * permissions allow changing network state; WRITE_SETTINGS is a runtime permission and
13224 * can be revoked, but (except in M, excluding M MRs), CHANGE_NETWORK_STATE is a normal
13225 * permission and cannot be revoked. See http://b/23597341
Billy Laua7238a32015-08-01 12:45:02 +010013226 *
Lorenzo Colittid5427052015-10-15 16:29:00 +090013227 * Note: if the check succeeds because the application holds WRITE_SETTINGS, the operation
13228 * of this app will be updated to the current time.
Billy Laua7238a32015-08-01 12:45:02 +010013229 * @hide
13230 */
13231 public static boolean checkAndNoteChangeNetworkStateOperation(Context context, int uid,
13232 String callingPackage, boolean throwException) {
Lorenzo Colittid5427052015-10-15 16:29:00 +090013233 if (context.checkCallingOrSelfPermission(android.Manifest.permission.CHANGE_NETWORK_STATE)
13234 == PackageManager.PERMISSION_GRANTED) {
13235 return true;
13236 }
Billy Laua7238a32015-08-01 12:45:02 +010013237 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
13238 callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS,
13239 PM_CHANGE_NETWORK_STATE, true);
Billy Lau6ad2d662015-07-18 00:26:58 +010013240 }
13241
13242 /**
13243 * Performs a strict and comprehensive check of whether a calling package is allowed to
13244 * draw on top of other apps, as the conditions differs for pre-M, M+, and
13245 * privileged/preinstalled apps. If the provided uid does not match the callingPackage,
13246 * a negative result will be returned.
13247 * @hide
13248 */
13249 public static boolean isCallingPackageAllowedToDrawOverlays(Context context, int uid,
13250 String callingPackage, boolean throwException) {
13251 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
13252 callingPackage, throwException, AppOpsManager.OP_SYSTEM_ALERT_WINDOW,
Billy Laua7238a32015-08-01 12:45:02 +010013253 PM_SYSTEM_ALERT_WINDOW, false);
Billy Lau6ad2d662015-07-18 00:26:58 +010013254 }
13255
13256 /**
13257 * Performs a strict and comprehensive check of whether a calling package is allowed to
13258 * draw on top of other apps, as the conditions differs for pre-M, M+, and
13259 * privileged/preinstalled apps. If the provided uid does not match the callingPackage,
13260 * a negative result will be returned.
13261 *
13262 * Note: if the check is successful, the operation of this app will be updated to the
13263 * current time.
13264 * @hide
13265 */
13266 public static boolean checkAndNoteDrawOverlaysOperation(Context context, int uid, String
13267 callingPackage, boolean throwException) {
13268 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
13269 callingPackage, throwException, AppOpsManager.OP_SYSTEM_ALERT_WINDOW,
Billy Laua7238a32015-08-01 12:45:02 +010013270 PM_SYSTEM_ALERT_WINDOW, true);
Billy Lau6ad2d662015-07-18 00:26:58 +010013271 }
13272
13273 /**
13274 * Helper method to perform a general and comprehensive check of whether an operation that is
13275 * protected by appops can be performed by a caller or not. e.g. OP_SYSTEM_ALERT_WINDOW and
13276 * OP_WRITE_SETTINGS
13277 * @hide
13278 */
13279 public static boolean isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context context,
Billy Laua7238a32015-08-01 12:45:02 +010013280 int uid, String callingPackage, boolean throwException, int appOpsOpCode, String[]
13281 permissions, boolean makeNote) {
Billy Lau6ad2d662015-07-18 00:26:58 +010013282 if (callingPackage == null) {
13283 return false;
13284 }
13285
13286 AppOpsManager appOpsMgr = (AppOpsManager)context.getSystemService(Context.APP_OPS_SERVICE);
13287 int mode = AppOpsManager.MODE_DEFAULT;
13288 if (makeNote) {
13289 mode = appOpsMgr.noteOpNoThrow(appOpsOpCode, uid, callingPackage);
13290 } else {
13291 mode = appOpsMgr.checkOpNoThrow(appOpsOpCode, uid, callingPackage);
13292 }
13293
13294 switch (mode) {
13295 case AppOpsManager.MODE_ALLOWED:
13296 return true;
Billy Laua7238a32015-08-01 12:45:02 +010013297
Billy Lau6ad2d662015-07-18 00:26:58 +010013298 case AppOpsManager.MODE_DEFAULT:
13299 // this is the default operating mode after an app's installation
Billy Laua7238a32015-08-01 12:45:02 +010013300 // In this case we will check all associated static permission to see
13301 // if it is granted during install time.
13302 for (String permission : permissions) {
13303 if (context.checkCallingOrSelfPermission(permission) == PackageManager
13304 .PERMISSION_GRANTED) {
13305 // if either of the permissions are granted, we will allow it
13306 return true;
13307 }
Billy Lau6ad2d662015-07-18 00:26:58 +010013308 }
Billy Laua7238a32015-08-01 12:45:02 +010013309
Billy Lau6ad2d662015-07-18 00:26:58 +010013310 default:
13311 // this is for all other cases trickled down here...
13312 if (!throwException) {
13313 return false;
13314 }
13315 }
Billy Laua7238a32015-08-01 12:45:02 +010013316
13317 // prepare string to throw SecurityException
13318 StringBuilder exceptionMessage = new StringBuilder();
13319 exceptionMessage.append(callingPackage);
13320 exceptionMessage.append(" was not granted ");
13321 if (permissions.length > 1) {
13322 exceptionMessage.append(" either of these permissions: ");
13323 } else {
13324 exceptionMessage.append(" this permission: ");
13325 }
13326 for (int i = 0; i < permissions.length; i++) {
13327 exceptionMessage.append(permissions[i]);
13328 exceptionMessage.append((i == permissions.length - 1) ? "." : ", ");
13329 }
13330
13331 throw new SecurityException(exceptionMessage.toString());
Billy Lau6ad2d662015-07-18 00:26:58 +010013332 }
13333
13334 /**
13335 * Retrieves a correponding package name for a given uid. It will query all
13336 * packages that are associated with the given uid, but it will return only
13337 * the zeroth result.
13338 * Note: If package could not be found, a null is returned.
13339 * @hide
13340 */
13341 public static String getPackageNameForUid(Context context, int uid) {
13342 String[] packages = context.getPackageManager().getPackagesForUid(uid);
13343 if (packages == null) {
13344 return null;
13345 }
13346 return packages[0];
13347 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080013348}