blob: 4d7c202f78d6c11b24a52907d9c125e19a7f3aeb [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;
Michal Karpinski5db1e432018-01-18 20:10:24 +000026import static android.provider.SettingsValidators.PACKAGE_NAME_VALIDATOR;
Michal Karpinski2c37b082018-01-18 16:14:27 +000027import static android.provider.SettingsValidators.URI_VALIDATOR;
28
Svetoslav Ganove080da92016-12-21 17:10:35 -080029import android.Manifest;
30import android.annotation.IntDef;
31import android.annotation.IntRange;
Svet Ganov53a441c2016-04-19 19:38:00 -070032import android.annotation.NonNull;
Svetoslav Ganove080da92016-12-21 17:10:35 -080033import android.annotation.Nullable;
34import android.annotation.RequiresPermission;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080035import android.annotation.SdkConstant;
36import android.annotation.SdkConstant.SdkConstantType;
Bryce Leecdfebd62015-02-02 08:19:11 -080037import android.annotation.SystemApi;
Jeff Sharkeya73b8fd2016-01-06 17:02:08 -070038import android.annotation.TestApi;
Svetoslav Ganove080da92016-12-21 17:10:35 -080039import android.annotation.UserIdInt;
Adrian Roos7811d9f2015-07-27 15:10:13 -070040import android.app.ActivityThread;
Billy Lau6ad2d662015-07-18 00:26:58 +010041import android.app.AppOpsManager;
Adrian Roos7811d9f2015-07-27 15:10:13 -070042import android.app.Application;
Julia Reynolds9ba0c612017-01-25 10:31:34 -050043import android.app.NotificationChannel;
Julia Reynoldsb852e562017-06-06 16:14:18 -040044import android.app.NotificationManager;
Narayan Kamathee69ff42011-06-28 12:07:18 +010045import android.app.SearchManager;
Jeff Sharkey6e2bee72012-10-01 13:39:08 -070046import android.app.WallpaperManager;
Mike LeBeau5d34e9b2010-02-10 19:34:56 -080047import android.content.ComponentName;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080048import android.content.ContentResolver;
49import android.content.ContentValues;
50import android.content.Context;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -080051import android.content.IContentProvider;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080052import android.content.Intent;
Dianne Hackbornb8b11a02010-03-10 15:53:11 -080053import android.content.pm.ActivityInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080054import android.content.pm.PackageManager;
55import android.content.pm.ResolveInfo;
56import android.content.res.Configuration;
57import android.content.res.Resources;
58import android.database.Cursor;
59import android.database.SQLException;
David Christie3f7b6522013-08-06 19:19:08 -070060import android.location.LocationManager;
Jeff Sharkey625239a2012-09-26 22:03:49 -070061import android.net.ConnectivityManager;
Jeremy Joslinc9eb3c42017-02-08 10:45:30 -080062import android.net.NetworkScoreManager;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080063import android.net.Uri;
Irfan Sheriff36f74132010-11-04 16:57:37 -070064import android.net.wifi.WifiManager;
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -070065import android.os.BatteryManager;
Chad Brubaker97bccee2017-01-05 15:51:41 -080066import android.os.Binder;
Steve McKayea93fe72016-12-02 11:35:35 -080067import android.os.Build.VERSION_CODES;
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -070068import android.os.Bundle;
Jeff Sharkey625239a2012-09-26 22:03:49 -070069import android.os.DropBoxManager;
Amith Yamasani52c489c2012-03-28 11:42:42 -070070import android.os.IBinder;
Yohei Yukawa23cbe852016-05-17 16:42:58 -070071import android.os.LocaleList;
Amith Yamasani7ab8c4a2012-04-06 09:27:12 -070072import android.os.Process;
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -070073import android.os.RemoteException;
Dianne Hackborn0ef403e2017-01-24 18:22:15 -080074import android.os.ResultReceiver;
Amith Yamasani52c489c2012-03-28 11:42:42 -070075import android.os.ServiceManager;
Dianne Hackbornf02b60a2012-08-16 10:48:27 -070076import android.os.UserHandle;
Michal Karpinski2c37b082018-01-18 16:14:27 +000077import android.provider.SettingsValidators.Validator;
Narayan Kamath6d632962011-08-24 11:51:37 +010078import android.speech.tts.TextToSpeech;
Malcolm Chenc66dee92017-09-26 14:45:40 -070079import android.telephony.SubscriptionManager;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080080import android.text.TextUtils;
81import android.util.AndroidException;
Svetoslav683914b2015-01-15 14:22:26 -080082import android.util.ArrayMap;
83import android.util.ArraySet;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080084import android.util.Log;
Svet Ganov53a441c2016-04-19 19:38:00 -070085import android.util.MemoryIntArray;
Yohei Yukawa3f8c5682018-03-01 13:10:23 -080086import android.view.textservice.TextServicesManager;
Felipe Lemea1b79bf2016-05-24 13:06:54 -070087
Svet Ganov53a441c2016-04-19 19:38:00 -070088import com.android.internal.annotations.GuardedBy;
Amith Yamasani52c489c2012-03-28 11:42:42 -070089import com.android.internal.widget.ILockSettings;
90
Svet Ganov53a441c2016-04-19 19:38:00 -070091import java.io.IOException;
Svetoslav Ganove080da92016-12-21 17:10:35 -080092import java.lang.annotation.Retention;
93import java.lang.annotation.RetentionPolicy;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080094import java.net.URISyntaxException;
Svetoslav683914b2015-01-15 14:22:26 -080095import java.text.SimpleDateFormat;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080096import java.util.HashMap;
97import java.util.HashSet;
Elliott Hughescb64d432013-08-02 10:00:44 -070098import java.util.Locale;
Svetoslav683914b2015-01-15 14:22:26 -080099import java.util.Map;
100import java.util.Set;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800101
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800102/**
103 * The Settings provider contains global system-level device preferences.
104 */
105public final class Settings {
106
107 // Intent actions for Settings
108
109 /**
110 * Activity Action: Show system settings.
111 * <p>
112 * Input: Nothing.
113 * <p>
Gilles Debunnee90bed12011-08-30 14:28:27 -0700114 * Output: Nothing.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800115 */
116 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
117 public static final String ACTION_SETTINGS = "android.settings.SETTINGS";
118
119 /**
120 * Activity Action: Show settings to allow configuration of APNs.
121 * <p>
122 * Input: Nothing.
123 * <p>
Gilles Debunnee90bed12011-08-30 14:28:27 -0700124 * Output: Nothing.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800125 */
126 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
127 public static final String ACTION_APN_SETTINGS = "android.settings.APN_SETTINGS";
128
129 /**
130 * Activity Action: Show settings to allow configuration of current location
131 * sources.
132 * <p>
133 * In some cases, a matching Activity may not exist, so ensure you
134 * safeguard against this.
135 * <p>
136 * Input: Nothing.
137 * <p>
138 * Output: Nothing.
139 */
140 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
141 public static final String ACTION_LOCATION_SOURCE_SETTINGS =
142 "android.settings.LOCATION_SOURCE_SETTINGS";
143
144 /**
Lifu Tang58aa11b2018-04-12 10:13:15 -0700145 * Activity Action: Show scanning settings to allow configuration of Wi-Fi
146 * and Bluetooth scanning settings.
147 * <p>
148 * In some cases, a matching Activity may not exist, so ensure you
149 * safeguard against this.
150 * <p>
151 * Input: Nothing.
152 * <p>
153 * Output: Nothing.
154 * @hide
155 */
156 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
157 public static final String ACTION_LOCATION_SCANNING_SETTINGS =
158 "android.settings.LOCATION_SCANNING_SETTINGS";
159
160 /**
Jason Monk76c67aa2016-02-19 14:49:42 -0500161 * Activity Action: Show settings to allow configuration of users.
162 * <p>
163 * In some cases, a matching Activity may not exist, so ensure you
164 * safeguard against this.
165 * <p>
166 * Input: Nothing.
167 * <p>
168 * Output: Nothing.
169 * @hide
170 */
171 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
172 public static final String ACTION_USER_SETTINGS =
173 "android.settings.USER_SETTINGS";
174
175 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800176 * Activity Action: Show settings to allow configuration of wireless controls
177 * such as Wi-Fi, Bluetooth and Mobile networks.
178 * <p>
179 * In some cases, a matching Activity may not exist, so ensure you
180 * safeguard against this.
181 * <p>
182 * Input: Nothing.
183 * <p>
184 * Output: Nothing.
185 */
186 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
187 public static final String ACTION_WIRELESS_SETTINGS =
188 "android.settings.WIRELESS_SETTINGS";
189
190 /**
Jeremy Klein15f3d212016-01-24 17:01:09 -0800191 * Activity Action: Show tether provisioning activity.
192 *
193 * <p>
194 * In some cases, a matching Activity may not exist, so ensure you
195 * safeguard against this.
196 * <p>
Dianne Hackborn0ef403e2017-01-24 18:22:15 -0800197 * Input: {@link ConnectivityManager#EXTRA_TETHER_TYPE} should be included to specify which type
198 * of tethering should be checked. {@link ConnectivityManager#EXTRA_PROVISION_CALLBACK} should
Jeremy Klein15f3d212016-01-24 17:01:09 -0800199 * contain a {@link ResultReceiver} which will be called back with a tether result code.
200 * <p>
201 * Output: The result of the provisioning check.
Dianne Hackborn0ef403e2017-01-24 18:22:15 -0800202 * {@link ConnectivityManager#TETHER_ERROR_NO_ERROR} if successful,
203 * {@link ConnectivityManager#TETHER_ERROR_PROVISION_FAILED} for failure.
Jeremy Klein15f3d212016-01-24 17:01:09 -0800204 *
205 * @hide
206 */
207 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
208 public static final String ACTION_TETHER_PROVISIONING =
209 "android.settings.TETHER_PROVISIONING_UI";
210
211 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800212 * Activity Action: Show settings to allow entering/exiting airplane mode.
213 * <p>
214 * In some cases, a matching Activity may not exist, so ensure you
215 * safeguard against this.
216 * <p>
217 * Input: Nothing.
218 * <p>
219 * Output: Nothing.
220 */
221 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
222 public static final String ACTION_AIRPLANE_MODE_SETTINGS =
223 "android.settings.AIRPLANE_MODE_SETTINGS";
224
225 /**
Malcolm Chen21062542017-06-20 11:36:01 -0700226 * Activity Action: Show mobile data usage list.
227 * <p>
228 * Input: {@link EXTRA_NETWORK_TEMPLATE} and {@link EXTRA_SUB_ID} should be included to specify
229 * how and what mobile data statistics should be collected.
230 * <p>
231 * Output: Nothing
232 * @hide
233 */
234 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
235 public static final String ACTION_MOBILE_DATA_USAGE =
236 "android.settings.MOBILE_DATA_USAGE";
237
238 /** @hide */
239 public static final String EXTRA_NETWORK_TEMPLATE = "network_template";
Jeff Davidsonf32f7b42017-11-03 15:05:07 -0700240
241 /**
242 * An int extra specifying a subscription ID.
243 *
244 * @see android.telephony.SubscriptionInfo#getSubscriptionId
245 */
246 public static final String EXTRA_SUB_ID = "android.provider.extra.SUB_ID";
Malcolm Chen21062542017-06-20 11:36:01 -0700247
248 /**
Barnaby Jamesb3006d32015-04-02 17:49:54 -0700249 * Activity Action: Modify Airplane mode settings using a voice command.
Barnaby James48f35522014-07-16 14:27:39 -0700250 * <p>
251 * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
252 * <p>
253 * This intent MUST be started using
254 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
255 * startVoiceActivity}.
256 * <p>
Barnaby Jamesb3006d32015-04-02 17:49:54 -0700257 * Note: The activity implementing this intent MUST verify that
Barnaby James48f35522014-07-16 14:27:39 -0700258 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before
259 * modifying the setting.
260 * <p>
Barnaby Jamesb3006d32015-04-02 17:49:54 -0700261 * Input: To tell which state airplane mode should be set to, add the
262 * {@link #EXTRA_AIRPLANE_MODE_ENABLED} extra to this Intent with the state specified.
263 * If the extra is not included, no changes will be made.
Barnaby James48f35522014-07-16 14:27:39 -0700264 * <p>
265 * Output: Nothing.
266 */
267 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
268 public static final String ACTION_VOICE_CONTROL_AIRPLANE_MODE =
269 "android.settings.VOICE_CONTROL_AIRPLANE_MODE";
270
271 /**
Dianne Hackborndd9b82c2009-09-03 00:18:47 -0700272 * Activity Action: Show settings for accessibility modules.
273 * <p>
274 * In some cases, a matching Activity may not exist, so ensure you
275 * safeguard against this.
276 * <p>
277 * Input: Nothing.
278 * <p>
279 * Output: Nothing.
280 */
281 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
282 public static final String ACTION_ACCESSIBILITY_SETTINGS =
283 "android.settings.ACCESSIBILITY_SETTINGS";
284
285 /**
Dianne Hackborna3fb40d2014-08-12 15:06:50 -0700286 * Activity Action: Show settings to control access to usage information.
287 * <p>
288 * In some cases, a matching Activity may not exist, so ensure you
289 * safeguard against this.
290 * <p>
291 * Input: Nothing.
292 * <p>
293 * Output: Nothing.
294 */
295 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
296 public static final String ACTION_USAGE_ACCESS_SETTINGS =
297 "android.settings.USAGE_ACCESS_SETTINGS";
298
299 /**
Jason Monk6f909782015-04-17 14:30:25 -0400300 * Activity Category: Show application settings related to usage access.
301 * <p>
302 * An activity that provides a user interface for adjusting usage access related
303 * preferences for its containing application. Optional but recommended for apps that
304 * use {@link android.Manifest.permission#PACKAGE_USAGE_STATS}.
305 * <p>
306 * The activity may define meta-data to describe what usage access is
307 * used for within their app with {@link #METADATA_USAGE_ACCESS_REASON}, which
308 * will be displayed in Settings.
309 * <p>
310 * Input: Nothing.
311 * <p>
312 * Output: Nothing.
313 */
314 @SdkConstant(SdkConstantType.INTENT_CATEGORY)
315 public static final String INTENT_CATEGORY_USAGE_ACCESS_CONFIG =
316 "android.intent.category.USAGE_ACCESS_CONFIG";
317
318 /**
319 * Metadata key: Reason for needing usage access.
320 * <p>
321 * A key for metadata attached to an activity that receives action
322 * {@link #INTENT_CATEGORY_USAGE_ACCESS_CONFIG}, shown to the
323 * user as description of how the app uses usage access.
324 * <p>
325 */
326 public static final String METADATA_USAGE_ACCESS_REASON =
327 "android.settings.metadata.USAGE_ACCESS_REASON";
328
329 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800330 * Activity Action: Show settings to allow configuration of security and
331 * location privacy.
332 * <p>
333 * In some cases, a matching Activity may not exist, so ensure you
334 * safeguard against this.
335 * <p>
336 * Input: Nothing.
337 * <p>
338 * Output: Nothing.
339 */
340 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
341 public static final String ACTION_SECURITY_SETTINGS =
342 "android.settings.SECURITY_SETTINGS";
343
344 /**
Suprabh Shukla2f34b1a2016-12-16 14:47:25 -0800345 * Activity Action: Show settings to allow configuration of trusted external sources
Suprabh Shukla905df002017-05-25 14:21:59 -0700346 *
Suprabh Shukla84d11b42017-03-07 23:40:25 -0800347 * Input: Optionally, the Intent's data URI can specify the application package name to
348 * directly invoke the management GUI specific to the package name. For example
349 * "package:com.my.app".
Suprabh Shukla2f34b1a2016-12-16 14:47:25 -0800350 * <p>
351 * Output: Nothing.
Suprabh Shukla2f34b1a2016-12-16 14:47:25 -0800352 */
353 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
Suprabh Shuklaa1300c82017-04-06 17:52:32 -0700354 public static final String ACTION_MANAGE_UNKNOWN_APP_SOURCES =
Suprabh Shukla89aae442017-04-20 16:04:26 -0700355 "android.settings.MANAGE_UNKNOWN_APP_SOURCES";
Suprabh Shukla2f34b1a2016-12-16 14:47:25 -0800356
357 /**
Maggie Benthall0469f412013-09-05 15:30:26 -0400358 * Activity Action: Show trusted credentials settings, opening to the user tab,
359 * to allow management of installed credentials.
360 * <p>
361 * In some cases, a matching Activity may not exist, so ensure you
362 * safeguard against this.
363 * <p>
364 * Input: Nothing.
365 * <p>
366 * Output: Nothing.
367 * @hide
368 */
369 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
370 public static final String ACTION_TRUSTED_CREDENTIALS_USER =
371 "com.android.settings.TRUSTED_CREDENTIALS_USER";
372
373 /**
374 * Activity Action: Show dialog explaining that an installed CA cert may enable
375 * monitoring of encrypted network traffic.
376 * <p>
377 * In some cases, a matching Activity may not exist, so ensure you
Victor Chang355d4762016-04-07 21:23:15 +0100378 * safeguard against this. Add {@link #EXTRA_NUMBER_OF_CERTIFICATES} extra to indicate the
379 * number of certificates.
Maggie Benthall0469f412013-09-05 15:30:26 -0400380 * <p>
381 * Input: Nothing.
382 * <p>
383 * Output: Nothing.
384 * @hide
385 */
386 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
387 public static final String ACTION_MONITORING_CERT_INFO =
388 "com.android.settings.MONITORING_CERT_INFO";
389
390 /**
Amith Yamasanic15255a2009-09-23 15:33:19 -0700391 * Activity Action: Show settings to allow configuration of privacy options.
392 * <p>
393 * In some cases, a matching Activity may not exist, so ensure you
394 * safeguard against this.
395 * <p>
396 * Input: Nothing.
397 * <p>
398 * Output: Nothing.
399 */
400 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
401 public static final String ACTION_PRIVACY_SETTINGS =
402 "android.settings.PRIVACY_SETTINGS";
403
404 /**
Robin Leea249aee2016-02-03 13:42:56 +0000405 * Activity Action: Show settings to allow configuration of VPN.
406 * <p>
407 * In some cases, a matching Activity may not exist, so ensure you
408 * safeguard against this.
409 * <p>
410 * Input: Nothing.
411 * <p>
412 * Output: Nothing.
413 */
414 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
415 public static final String ACTION_VPN_SETTINGS =
416 "android.settings.VPN_SETTINGS";
417
418 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800419 * Activity Action: Show settings to allow configuration of Wi-Fi.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800420 * <p>
421 * In some cases, a matching Activity may not exist, so ensure you
422 * safeguard against this.
423 * <p>
424 * Input: Nothing.
425 * <p>
426 * Output: Nothing.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800427 */
428 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
429 public static final String ACTION_WIFI_SETTINGS =
430 "android.settings.WIFI_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700431
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800432 /**
433 * Activity Action: Show settings to allow configuration of a static IP
434 * address for Wi-Fi.
435 * <p>
436 * In some cases, a matching Activity may not exist, so ensure you safeguard
437 * against this.
438 * <p>
439 * Input: Nothing.
440 * <p>
441 * Output: Nothing.
442 */
443 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
444 public static final String ACTION_WIFI_IP_SETTINGS =
445 "android.settings.WIFI_IP_SETTINGS";
446
447 /**
Rohan Shah53f3f152018-02-28 15:13:31 -0800448 * Activity Action: Show settings to allow configuration of data and view data usage.
449 * <p>
450 * In some cases, a matching Activity may not exist, so ensure you
451 * safeguard against this.
452 * <p>
453 * Input: Nothing.
454 * <p>
455 * Output: Nothing.
456 */
457 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
458 public static final String ACTION_DATA_USAGE_SETTINGS =
459 "android.settings.DATA_USAGE_SETTINGS";
460
461 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800462 * Activity Action: Show settings to allow configuration of Bluetooth.
463 * <p>
464 * In some cases, a matching Activity may not exist, so ensure you
465 * safeguard against this.
466 * <p>
467 * Input: Nothing.
468 * <p>
469 * Output: Nothing.
470 */
471 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
472 public static final String ACTION_BLUETOOTH_SETTINGS =
473 "android.settings.BLUETOOTH_SETTINGS";
474
475 /**
Kevin Chyn268a96c2017-06-17 17:32:49 -0700476 * Activity Action: Show settings to allow configuration of Assist Gesture.
477 * <p>
478 * In some cases, a matching Activity may not exist, so ensure you
479 * safeguard against this.
480 * <p>
481 * Input: Nothing.
482 * <p>
483 * Output: Nothing.
484 * @hide
485 */
486 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
487 public static final String ACTION_ASSIST_GESTURE_SETTINGS =
488 "android.settings.ASSIST_GESTURE_SETTINGS";
489
490 /**
Kevin Chyn83ff28c2017-10-13 16:35:17 -0700491 * Activity Action: Show settings to enroll fingerprints, and setup PIN/Pattern/Pass if
492 * necessary.
493 * <p>
494 * Input: Nothing.
495 * <p>
496 * Output: Nothing.
497 */
498 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
499 public static final String ACTION_FINGERPRINT_ENROLL =
500 "android.settings.FINGERPRINT_ENROLL";
501
502 /**
Jeff Brownc05c1ae2015-05-05 13:46:30 -0700503 * Activity Action: Show settings to allow configuration of cast endpoints.
Jeff Brown1a937b02014-07-01 22:13:04 -0700504 * <p>
505 * In some cases, a matching Activity may not exist, so ensure you
506 * safeguard against this.
507 * <p>
508 * Input: Nothing.
509 * <p>
510 * Output: Nothing.
511 */
512 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
513 public static final String ACTION_CAST_SETTINGS =
514 "android.settings.CAST_SETTINGS";
515
516 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800517 * Activity Action: Show settings to allow configuration of date and time.
518 * <p>
519 * In some cases, a matching Activity may not exist, so ensure you
520 * safeguard against this.
521 * <p>
522 * Input: Nothing.
523 * <p>
524 * Output: Nothing.
525 */
526 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
527 public static final String ACTION_DATE_SETTINGS =
528 "android.settings.DATE_SETTINGS";
529
530 /**
531 * Activity Action: Show settings to allow configuration of sound and volume.
532 * <p>
533 * In some cases, a matching Activity may not exist, so ensure you
534 * safeguard against this.
535 * <p>
536 * Input: Nothing.
537 * <p>
538 * Output: Nothing.
539 */
540 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
541 public static final String ACTION_SOUND_SETTINGS =
542 "android.settings.SOUND_SETTINGS";
543
544 /**
545 * Activity Action: Show settings to allow configuration of display.
546 * <p>
547 * In some cases, a matching Activity may not exist, so ensure you
548 * safeguard against this.
549 * <p>
550 * Input: Nothing.
551 * <p>
552 * Output: Nothing.
553 */
554 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
555 public static final String ACTION_DISPLAY_SETTINGS =
556 "android.settings.DISPLAY_SETTINGS";
557
558 /**
Justin Klaassen06c0cb72016-07-21 19:22:09 -0700559 * Activity Action: Show settings to allow configuration of Night display.
560 * <p>
561 * In some cases, a matching Activity may not exist, so ensure you
562 * safeguard against this.
563 * <p>
564 * Input: Nothing.
565 * <p>
566 * Output: Nothing.
Justin Klaassen06c0cb72016-07-21 19:22:09 -0700567 */
568 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
569 public static final String ACTION_NIGHT_DISPLAY_SETTINGS =
570 "android.settings.NIGHT_DISPLAY_SETTINGS";
571
572 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800573 * Activity Action: Show settings to allow configuration of locale.
574 * <p>
575 * In some cases, a matching Activity may not exist, so ensure you
576 * safeguard against this.
577 * <p>
578 * Input: Nothing.
579 * <p>
580 * Output: Nothing.
581 */
582 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
583 public static final String ACTION_LOCALE_SETTINGS =
584 "android.settings.LOCALE_SETTINGS";
585
586 /**
587 * Activity Action: Show settings to configure input methods, in particular
588 * allowing the user to enable input methods.
589 * <p>
590 * In some cases, a matching Activity may not exist, so ensure you
591 * safeguard against this.
592 * <p>
593 * Input: Nothing.
594 * <p>
595 * Output: Nothing.
596 */
597 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
Dianne Hackborna3fb40d2014-08-12 15:06:50 -0700598 public static final String ACTION_VOICE_INPUT_SETTINGS =
599 "android.settings.VOICE_INPUT_SETTINGS";
600
601 /**
602 * Activity Action: Show settings to configure input methods, in particular
603 * allowing the user to enable input methods.
604 * <p>
605 * In some cases, a matching Activity may not exist, so ensure you
606 * safeguard against this.
607 * <p>
608 * Input: Nothing.
609 * <p>
610 * Output: Nothing.
611 */
612 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800613 public static final String ACTION_INPUT_METHOD_SETTINGS =
614 "android.settings.INPUT_METHOD_SETTINGS";
615
616 /**
Tadashi G. Takaokaf49688f2011-01-20 17:56:13 +0900617 * Activity Action: Show settings to enable/disable input method subtypes.
satok86417ea2010-10-27 14:11:03 +0900618 * <p>
619 * In some cases, a matching Activity may not exist, so ensure you
620 * safeguard against this.
621 * <p>
Tadashi G. Takaoka25480202011-01-20 23:13:02 +0900622 * To tell which input method's subtypes are displayed in the settings, add
623 * {@link #EXTRA_INPUT_METHOD_ID} extra to this Intent with the input method id.
624 * If there is no extra in this Intent, subtypes from all installed input methods
625 * will be displayed in the settings.
626 *
627 * @see android.view.inputmethod.InputMethodInfo#getId
628 * <p>
satok86417ea2010-10-27 14:11:03 +0900629 * Input: Nothing.
630 * <p>
631 * Output: Nothing.
632 */
633 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
Tadashi G. Takaokaf49688f2011-01-20 17:56:13 +0900634 public static final String ACTION_INPUT_METHOD_SUBTYPE_SETTINGS =
635 "android.settings.INPUT_METHOD_SUBTYPE_SETTINGS";
satok86417ea2010-10-27 14:11:03 +0900636
637 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800638 * Activity Action: Show settings to manage the user input dictionary.
639 * <p>
Chet Haasee8222dd2013-09-05 07:44:18 -0700640 * Starting with {@link android.os.Build.VERSION_CODES#KITKAT},
Satoshi Kataoka2aa2bc52013-07-30 14:25:11 +0900641 * it is guaranteed there will always be an appropriate implementation for this Intent action.
642 * 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 -0800643 * <p>
644 * Input: Nothing.
645 * <p>
646 * Output: Nothing.
647 */
648 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
649 public static final String ACTION_USER_DICTIONARY_SETTINGS =
650 "android.settings.USER_DICTIONARY_SETTINGS";
651
652 /**
Abodunrinwa Toki07177142016-03-22 16:25:48 +0000653 * Activity Action: Show settings to configure the hardware keyboard.
Yohei Yukawad8701bf2016-01-27 16:15:01 -0800654 * <p>
655 * In some cases, a matching Activity may not exist, so ensure you
656 * safeguard against this.
657 * <p>
Yohei Yukawad8701bf2016-01-27 16:15:01 -0800658 * Input: Nothing.
659 * <p>
660 * Output: Nothing.
661 */
662 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
Abodunrinwa Toki07177142016-03-22 16:25:48 +0000663 public static final String ACTION_HARD_KEYBOARD_SETTINGS =
664 "android.settings.HARD_KEYBOARD_SETTINGS";
Yohei Yukawad8701bf2016-01-27 16:15:01 -0800665
666 /**
Gilles Debunnee90bed12011-08-30 14:28:27 -0700667 * Activity Action: Adds a word to the user dictionary.
668 * <p>
669 * In some cases, a matching Activity may not exist, so ensure you
670 * safeguard against this.
671 * <p>
672 * Input: An extra with key <code>word</code> that contains the word
673 * that should be added to the dictionary.
674 * <p>
675 * Output: Nothing.
676 *
677 * @hide
678 */
679 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
680 public static final String ACTION_USER_DICTIONARY_INSERT =
681 "com.android.settings.USER_DICTIONARY_INSERT";
682
683 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800684 * Activity Action: Show settings to allow configuration of application-related settings.
685 * <p>
686 * In some cases, a matching Activity may not exist, so ensure you
687 * safeguard against this.
688 * <p>
689 * Input: Nothing.
690 * <p>
691 * Output: Nothing.
692 */
693 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
694 public static final String ACTION_APPLICATION_SETTINGS =
695 "android.settings.APPLICATION_SETTINGS";
696
697 /**
698 * Activity Action: Show settings to allow configuration of application
Dianne Hackborn8d866e52012-10-10 18:39:45 -0700699 * development-related settings. As of
700 * {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1} this action is
701 * a required part of the platform.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800702 * <p>
703 * Input: Nothing.
704 * <p>
705 * Output: Nothing.
706 */
707 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
708 public static final String ACTION_APPLICATION_DEVELOPMENT_SETTINGS =
709 "android.settings.APPLICATION_DEVELOPMENT_SETTINGS";
710
711 /**
712 * Activity Action: Show settings to allow configuration of quick launch shortcuts.
713 * <p>
714 * In some cases, a matching Activity may not exist, so ensure you
715 * safeguard against this.
716 * <p>
717 * Input: Nothing.
718 * <p>
719 * Output: Nothing.
720 */
721 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
722 public static final String ACTION_QUICK_LAUNCH_SETTINGS =
723 "android.settings.QUICK_LAUNCH_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700724
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800725 /**
726 * Activity Action: Show settings to manage installed applications.
727 * <p>
728 * In some cases, a matching Activity may not exist, so ensure you
729 * safeguard against this.
730 * <p>
731 * Input: Nothing.
732 * <p>
733 * Output: Nothing.
734 */
735 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
736 public static final String ACTION_MANAGE_APPLICATIONS_SETTINGS =
737 "android.settings.MANAGE_APPLICATIONS_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700738
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800739 /**
Winson Chung44e8ff92010-09-27 14:36:52 -0700740 * Activity Action: Show settings to manage all applications.
741 * <p>
742 * In some cases, a matching Activity may not exist, so ensure you
743 * safeguard against this.
744 * <p>
745 * Input: Nothing.
746 * <p>
747 * Output: Nothing.
748 */
749 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
750 public static final String ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS =
751 "android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS";
752
753 /**
Billy Lau6ad2d662015-07-18 00:26:58 +0100754 * Activity Action: Show screen for controlling which apps can draw on top of other apps.
Billy Laucbe540f2015-06-25 01:51:44 +0100755 * <p>
756 * In some cases, a matching Activity may not exist, so ensure you
757 * safeguard against this.
758 * <p>
Billy Lau6ad2d662015-07-18 00:26:58 +0100759 * Input: Optionally, the Intent's data URI can specify the application package name to
760 * directly invoke the management GUI specific to the package name. For example
761 * "package:com.my.app".
Billy Laucbe540f2015-06-25 01:51:44 +0100762 * <p>
763 * Output: Nothing.
764 */
765 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
766 public static final String ACTION_MANAGE_OVERLAY_PERMISSION =
Billy Lau22b3f4c2015-07-08 00:31:01 +0100767 "android.settings.action.MANAGE_OVERLAY_PERMISSION";
768
769 /**
Billy Lau6ad2d662015-07-18 00:26:58 +0100770 * Activity Action: Show screen for controlling which apps are allowed to write/modify
771 * system settings.
Billy Lau22b3f4c2015-07-08 00:31:01 +0100772 * <p>
773 * In some cases, a matching Activity may not exist, so ensure you
774 * safeguard against this.
775 * <p>
Billy Lau6ad2d662015-07-18 00:26:58 +0100776 * Input: Optionally, the Intent's data URI can specify the application package name to
777 * directly invoke the management GUI specific to the package name. For example
778 * "package:com.my.app".
Billy Lau22b3f4c2015-07-08 00:31:01 +0100779 * <p>
780 * Output: Nothing.
781 */
782 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
783 public static final String ACTION_MANAGE_WRITE_SETTINGS =
784 "android.settings.action.MANAGE_WRITE_SETTINGS";
Billy Laucbe540f2015-06-25 01:51:44 +0100785
786 /**
Dianne Hackbornb7bb3b32010-06-06 22:47:50 -0700787 * Activity Action: Show screen of details about a particular application.
788 * <p>
789 * In some cases, a matching Activity may not exist, so ensure you
790 * safeguard against this.
791 * <p>
792 * Input: The Intent's data URI specifies the application package name
793 * to be shown, with the "package" scheme. That is "package:com.my.app".
794 * <p>
795 * Output: Nothing.
796 */
797 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
798 public static final String ACTION_APPLICATION_DETAILS_SETTINGS =
799 "android.settings.APPLICATION_DETAILS_SETTINGS";
800
801 /**
Ben Lin296f80a2018-02-27 15:23:38 -0800802 * Activity Action: Show the "Open by Default" page in a particular application's details page.
803 * <p>
804 * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
805 * <p>
806 * Input: The Intent's data URI specifies the application package name
807 * to be shown, with the "package" scheme. That is "package:com.my.app".
808 * <p>
809 * Output: Nothing.
810 * @hide
811 */
812 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
813 public static final String ACTION_APPLICATION_DETAILS_SETTINGS_OPEN_BY_DEFAULT_PAGE =
814 "android.settings.APPLICATION_DETAILS_SETTINGS_OPEN_BY_DEFAULT_PAGE";
815
816 /**
Dianne Hackborn83b40f62017-04-26 13:59:47 -0700817 * Activity Action: Show list of applications that have been running
818 * foreground services (to the user "running in the background").
819 * <p>
820 * Input: Extras "packages" is a string array of package names.
821 * <p>
822 * Output: Nothing.
823 * @hide
824 */
825 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
826 public static final String ACTION_FOREGROUND_SERVICES_SETTINGS =
827 "android.settings.FOREGROUND_SERVICES_SETTINGS";
828
829 /**
Jason Monk287b8892015-06-10 10:39:23 -0400830 * Activity Action: Show screen for controlling which apps can ignore battery optimizations.
831 * <p>
Dianne Hackbornc7b57b12015-08-10 14:52:52 -0700832 * Input: Nothing.
833 * <p>
834 * Output: Nothing.
835 * <p>
836 * You can use {@link android.os.PowerManager#isIgnoringBatteryOptimizations
837 * PowerManager.isIgnoringBatteryOptimizations()} to determine if an application is
838 * already ignoring optimizations. You can use
839 * {@link #ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS} to ask the user to put you
840 * on this list.
841 */
842 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
843 public static final String ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS =
844 "android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS";
845
846 /**
Felipe Leme5f5d7072016-01-27 10:41:22 -0800847 * Activity Action: Ask the user to allow an app to ignore battery optimizations (that is,
Dianne Hackbornc7b57b12015-08-10 14:52:52 -0700848 * put them on the whitelist of apps shown by
849 * {@link #ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS}). For an app to use this, it also
850 * must hold the {@link android.Manifest.permission#REQUEST_IGNORE_BATTERY_OPTIMIZATIONS}
851 * permission.
852 * <p><b>Note:</b> most applications should <em>not</em> use this; there are many facilities
853 * provided by the platform for applications to operate correctly in the various power
Felipe Leme5f5d7072016-01-27 10:41:22 -0800854 * saving modes. This is only for unusual applications that need to deeply control their own
Dianne Hackbornc7b57b12015-08-10 14:52:52 -0700855 * execution, at the potential expense of the user's battery life. Note that these applications
Kweku Adamseb80f7c2016-01-12 11:46:52 -0800856 * greatly run the risk of showing to the user as high power consumers on their device.</p>
Dianne Hackbornc7b57b12015-08-10 14:52:52 -0700857 * <p>
858 * Input: The Intent's data URI must specify the application package name
Jason Monk287b8892015-06-10 10:39:23 -0400859 * to be shown, with the "package" scheme. That is "package:com.my.app".
860 * <p>
861 * Output: Nothing.
Dianne Hackborn1958e5e2015-06-12 18:11:41 -0700862 * <p>
863 * You can use {@link android.os.PowerManager#isIgnoringBatteryOptimizations
864 * PowerManager.isIgnoringBatteryOptimizations()} to determine if an application is
865 * already ignoring optimizations.
Jason Monk287b8892015-06-10 10:39:23 -0400866 */
867 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
Dianne Hackbornc7b57b12015-08-10 14:52:52 -0700868 public static final String ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS =
869 "android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS";
Jason Monk287b8892015-06-10 10:39:23 -0400870
871 /**
Felipe Leme2850b562016-04-21 17:58:47 -0700872 * Activity Action: Show screen for controlling background data
873 * restrictions for a particular application.
Felipe Leme5f5d7072016-01-27 10:41:22 -0800874 * <p>
Felipe Leme2850b562016-04-21 17:58:47 -0700875 * Input: Intent's data URI set with an application name, using the
876 * "package" schema (like "package:com.my.app").
877 *
Felipe Leme5f5d7072016-01-27 10:41:22 -0800878 * <p>
879 * Output: Nothing.
880 * <p>
881 * Applications can also use {@link android.net.ConnectivityManager#getRestrictBackgroundStatus
Felipe Leme2850b562016-04-21 17:58:47 -0700882 * ConnectivityManager#getRestrictBackgroundStatus()} to determine the
883 * status of the background data restrictions for them.
Felipe Leme5f5d7072016-01-27 10:41:22 -0800884 */
885 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
886 public static final String ACTION_IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS =
887 "android.settings.IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS";
888
889 /**
Dianne Hackborn35654b62013-01-14 17:38:02 -0800890 * @hide
891 * Activity Action: Show the "app ops" settings screen.
892 * <p>
893 * Input: Nothing.
894 * <p>
895 * Output: Nothing.
896 */
897 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
898 public static final String ACTION_APP_OPS_SETTINGS =
899 "android.settings.APP_OPS_SETTINGS";
900
901 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800902 * Activity Action: Show settings for system update functionality.
903 * <p>
904 * In some cases, a matching Activity may not exist, so ensure you
905 * safeguard against this.
906 * <p>
907 * Input: Nothing.
908 * <p>
909 * Output: Nothing.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700910 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800911 * @hide
912 */
913 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
914 public static final String ACTION_SYSTEM_UPDATE_SETTINGS =
915 "android.settings.SYSTEM_UPDATE_SETTINGS";
916
917 /**
Ricky Wai38bb8322017-02-01 15:23:50 +0000918 * Activity Action: Show settings for managed profile settings.
919 * <p>
920 * In some cases, a matching Activity may not exist, so ensure you
921 * safeguard against this.
922 * <p>
923 * Input: Nothing.
924 * <p>
925 * Output: Nothing.
926 *
927 * @hide
928 */
929 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
930 public static final String ACTION_MANAGED_PROFILE_SETTINGS =
931 "android.settings.MANAGED_PROFILE_SETTINGS";
932
933 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800934 * Activity Action: Show settings to allow configuration of sync settings.
935 * <p>
936 * In some cases, a matching Activity may not exist, so ensure you
937 * safeguard against this.
938 * <p>
Erikeebc8e22010-02-18 13:27:19 -0800939 * The account types available to add via the add account button may be restricted by adding an
940 * {@link #EXTRA_AUTHORITIES} extra to this Intent with one or more syncable content provider's
941 * authorities. Only account types which can sync with that content provider will be offered to
942 * the user.
943 * <p>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800944 * Input: Nothing.
945 * <p>
946 * Output: Nothing.
947 */
948 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
949 public static final String ACTION_SYNC_SETTINGS =
950 "android.settings.SYNC_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700951
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800952 /**
Erikeebc8e22010-02-18 13:27:19 -0800953 * Activity Action: Show add account screen for creating a new account.
954 * <p>
955 * In some cases, a matching Activity may not exist, so ensure you
956 * safeguard against this.
957 * <p>
958 * The account types available to add may be restricted by adding an {@link #EXTRA_AUTHORITIES}
959 * extra to the Intent with one or more syncable content provider's authorities. Only account
960 * types which can sync with that content provider will be offered to the user.
961 * <p>
Alon Albert50359c22013-02-26 14:47:48 -0800962 * Account types can also be filtered by adding an {@link #EXTRA_ACCOUNT_TYPES} extra to the
963 * Intent with one or more account types.
964 * <p>
Erikeebc8e22010-02-18 13:27:19 -0800965 * Input: Nothing.
966 * <p>
967 * Output: Nothing.
968 */
969 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
970 public static final String ACTION_ADD_ACCOUNT =
971 "android.settings.ADD_ACCOUNT_SETTINGS";
972
973 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800974 * Activity Action: Show settings for selecting the network operator.
975 * <p>
976 * In some cases, a matching Activity may not exist, so ensure you
977 * safeguard against this.
978 * <p>
Jeff Davidsonf32f7b42017-11-03 15:05:07 -0700979 * The subscription ID of the subscription for which available network operators should be
980 * displayed may be optionally specified with {@link #EXTRA_SUB_ID}.
981 * <p>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800982 * Input: Nothing.
983 * <p>
984 * Output: Nothing.
985 */
986 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
987 public static final String ACTION_NETWORK_OPERATOR_SETTINGS =
988 "android.settings.NETWORK_OPERATOR_SETTINGS";
989
990 /**
991 * Activity Action: Show settings for selection of 2G/3G.
992 * <p>
993 * In some cases, a matching Activity may not exist, so ensure you
994 * safeguard against this.
995 * <p>
996 * Input: Nothing.
997 * <p>
998 * Output: Nothing.
999 */
1000 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1001 public static final String ACTION_DATA_ROAMING_SETTINGS =
1002 "android.settings.DATA_ROAMING_SETTINGS";
1003
1004 /**
1005 * Activity Action: Show settings for internal storage.
1006 * <p>
1007 * In some cases, a matching Activity may not exist, so ensure you
1008 * safeguard against this.
1009 * <p>
1010 * Input: Nothing.
1011 * <p>
1012 * Output: Nothing.
1013 */
1014 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1015 public static final String ACTION_INTERNAL_STORAGE_SETTINGS =
1016 "android.settings.INTERNAL_STORAGE_SETTINGS";
1017 /**
1018 * Activity Action: Show settings for memory card storage.
1019 * <p>
1020 * In some cases, a matching Activity may not exist, so ensure you
1021 * safeguard against this.
1022 * <p>
1023 * Input: Nothing.
1024 * <p>
1025 * Output: Nothing.
1026 */
1027 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1028 public static final String ACTION_MEMORY_CARD_SETTINGS =
1029 "android.settings.MEMORY_CARD_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001030
Justin Mattsonef340352010-01-13 21:05:46 -08001031 /**
1032 * Activity Action: Show settings for global search.
1033 * <p>
1034 * In some cases, a matching Activity may not exist, so ensure you
1035 * safeguard against this.
1036 * <p>
1037 * Input: Nothing.
1038 * <p>
1039 * Output: Nothing
1040 */
1041 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1042 public static final String ACTION_SEARCH_SETTINGS =
1043 "android.search.action.SEARCH_SETTINGS";
1044
Daniel Sandler9d8b8762010-01-22 20:50:15 -05001045 /**
1046 * Activity Action: Show general device information settings (serial
1047 * number, software version, phone number, etc.).
1048 * <p>
1049 * In some cases, a matching Activity may not exist, so ensure you
1050 * safeguard against this.
1051 * <p>
1052 * Input: Nothing.
1053 * <p>
1054 * Output: Nothing
1055 */
1056 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1057 public static final String ACTION_DEVICE_INFO_SETTINGS =
1058 "android.settings.DEVICE_INFO_SETTINGS";
1059
Martijn Coenen9b3c83f2011-07-28 11:21:39 -05001060 /**
Nick Pellycccf01d2011-10-31 14:49:40 -07001061 * Activity Action: Show NFC settings.
1062 * <p>
1063 * This shows UI that allows NFC to be turned on or off.
Martijn Coenen9b3c83f2011-07-28 11:21:39 -05001064 * <p>
1065 * In some cases, a matching Activity may not exist, so ensure you
1066 * safeguard against this.
1067 * <p>
1068 * Input: Nothing.
1069 * <p>
1070 * Output: Nothing
Nick Pellycccf01d2011-10-31 14:49:40 -07001071 * @see android.nfc.NfcAdapter#isEnabled()
1072 */
1073 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1074 public static final String ACTION_NFC_SETTINGS = "android.settings.NFC_SETTINGS";
1075
1076 /**
1077 * Activity Action: Show NFC Sharing settings.
1078 * <p>
1079 * This shows UI that allows NDEF Push (Android Beam) to be turned on or
1080 * off.
1081 * <p>
1082 * In some cases, a matching Activity may not exist, so ensure you
1083 * safeguard against this.
1084 * <p>
1085 * Input: Nothing.
1086 * <p>
1087 * Output: Nothing
1088 * @see android.nfc.NfcAdapter#isNdefPushEnabled()
Martijn Coenen9b3c83f2011-07-28 11:21:39 -05001089 */
1090 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1091 public static final String ACTION_NFCSHARING_SETTINGS =
1092 "android.settings.NFCSHARING_SETTINGS";
1093
Daniel Sandlerc08cd022012-11-27 22:47:37 -05001094 /**
Martijn Coenen62c196a2013-08-09 13:43:34 -07001095 * Activity Action: Show NFC Tap & Pay settings
1096 * <p>
1097 * This shows UI that allows the user to configure Tap&Pay
1098 * settings.
1099 * <p>
1100 * In some cases, a matching Activity may not exist, so ensure you
1101 * safeguard against this.
1102 * <p>
1103 * Input: Nothing.
1104 * <p>
1105 * Output: Nothing
1106 */
1107 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1108 public static final String ACTION_NFC_PAYMENT_SETTINGS =
1109 "android.settings.NFC_PAYMENT_SETTINGS";
1110
1111 /**
Daniel Sandlerc08cd022012-11-27 22:47:37 -05001112 * Activity Action: Show Daydream settings.
1113 * <p>
1114 * In some cases, a matching Activity may not exist, so ensure you
1115 * safeguard against this.
1116 * <p>
1117 * Input: Nothing.
1118 * <p>
1119 * Output: Nothing.
1120 * @see android.service.dreams.DreamService
Daniel Sandlerc08cd022012-11-27 22:47:37 -05001121 */
1122 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1123 public static final String ACTION_DREAM_SETTINGS = "android.settings.DREAM_SETTINGS";
1124
Daniel Sandler5feceeb2013-03-22 18:29:23 -07001125 /**
1126 * Activity Action: Show Notification listener settings.
1127 * <p>
1128 * In some cases, a matching Activity may not exist, so ensure you
1129 * safeguard against this.
1130 * <p>
1131 * Input: Nothing.
1132 * <p>
1133 * Output: Nothing.
1134 * @see android.service.notification.NotificationListenerService
Daniel Sandler5feceeb2013-03-22 18:29:23 -07001135 */
1136 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1137 public static final String ACTION_NOTIFICATION_LISTENER_SETTINGS
Chris Wren8326a8a2014-10-22 14:13:32 -04001138 = "android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS";
Daniel Sandler5feceeb2013-03-22 18:29:23 -07001139
Alan Viverette69ce69b2013-08-29 12:23:48 -07001140 /**
John Spurlock80774932015-05-07 17:38:50 -04001141 * Activity Action: Show Do Not Disturb access settings.
1142 * <p>
John Spurlock7c74f782015-06-04 13:01:42 -04001143 * Users can grant and deny access to Do Not Disturb configuration from here.
1144 * See {@link android.app.NotificationManager#isNotificationPolicyAccessGranted()} for more
1145 * details.
John Spurlock80774932015-05-07 17:38:50 -04001146 * <p>
1147 * Input: Nothing.
1148 * <p>
1149 * Output: Nothing.
1150 */
1151 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
John Spurlock7c74f782015-06-04 13:01:42 -04001152 public static final String ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS
1153 = "android.settings.NOTIFICATION_POLICY_ACCESS_SETTINGS";
John Spurlock80774932015-05-07 17:38:50 -04001154
1155 /**
John Spurlock7340fc82014-04-24 18:50:12 -04001156 * @hide
1157 */
1158 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1159 public static final String ACTION_CONDITION_PROVIDER_SETTINGS
1160 = "android.settings.ACTION_CONDITION_PROVIDER_SETTINGS";
1161
1162 /**
Alan Viverette69ce69b2013-08-29 12:23:48 -07001163 * Activity Action: Show settings for video captioning.
1164 * <p>
1165 * In some cases, a matching Activity may not exist, so ensure you safeguard
1166 * against this.
1167 * <p>
1168 * Input: Nothing.
1169 * <p>
1170 * Output: Nothing.
1171 */
1172 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1173 public static final String ACTION_CAPTIONING_SETTINGS = "android.settings.CAPTIONING_SETTINGS";
1174
Svetoslav773f54d2013-09-03 14:01:43 -07001175 /**
1176 * Activity Action: Show the top level print settings.
1177 * <p>
1178 * In some cases, a matching Activity may not exist, so ensure you
1179 * safeguard against this.
1180 * <p>
1181 * Input: Nothing.
1182 * <p>
1183 * Output: Nothing.
1184 */
1185 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1186 public static final String ACTION_PRINT_SETTINGS =
1187 "android.settings.ACTION_PRINT_SETTINGS";
1188
John Spurlockde547002014-02-28 17:50:39 -05001189 /**
1190 * Activity Action: Show Zen Mode configuration settings.
1191 *
1192 * @hide
1193 */
1194 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1195 public static final String ACTION_ZEN_MODE_SETTINGS = "android.settings.ZEN_MODE_SETTINGS";
1196
Santos Cordona4c75242014-07-09 12:07:51 -07001197 /**
Julia Reynolds9aa1c9e2018-04-09 11:31:15 -04001198 * Activity Action: Show Zen Mode visual effects configuration settings.
1199 *
1200 * @hide
1201 */
1202 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1203 public static final String ZEN_MODE_BLOCKED_EFFECTS_SETTINGS =
1204 "android.settings.ZEN_MODE_BLOCKED_EFFECTS_SETTINGS";
1205
1206 /**
1207 * Activity Action: Show Zen Mode onboarding activity.
1208 *
1209 * @hide
1210 */
1211 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1212 public static final String ZEN_MODE_ONBOARDING = "android.settings.ZEN_MODE_ONBOARDING";
1213
1214 /**
Julia Reynoldsa11d0b12017-02-16 15:01:36 -05001215 * Activity Action: Show Zen Mode (aka Do Not Disturb) priority configuration settings.
John Spurlockfc746f82015-04-03 13:47:14 -04001216 */
1217 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1218 public static final String ACTION_ZEN_MODE_PRIORITY_SETTINGS
1219 = "android.settings.ZEN_MODE_PRIORITY_SETTINGS";
1220
1221 /**
John Spurlock7af10182015-04-03 15:10:31 -04001222 * Activity Action: Show Zen Mode automation configuration settings.
1223 *
1224 * @hide
1225 */
1226 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1227 public static final String ACTION_ZEN_MODE_AUTOMATION_SETTINGS
1228 = "android.settings.ZEN_MODE_AUTOMATION_SETTINGS";
1229
1230 /**
Barnaby Jamesb3006d32015-04-02 17:49:54 -07001231 * Activity Action: Modify do not disturb mode settings.
1232 * <p>
1233 * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
1234 * <p>
1235 * This intent MUST be started using
1236 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
1237 * startVoiceActivity}.
1238 * <p>
1239 * Note: The Activity implementing this intent MUST verify that
1240 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction}.
1241 * returns true before modifying the setting.
1242 * <p>
1243 * Input: The optional {@link #EXTRA_DO_NOT_DISTURB_MODE_MINUTES} extra can be used to indicate
1244 * how long the user wishes to avoid interruptions for. The optional
1245 * {@link #EXTRA_DO_NOT_DISTURB_MODE_ENABLED} extra can be to indicate if the user is
1246 * enabling or disabling do not disturb mode. If either extra is not included, the
1247 * user maybe asked to provide the value.
1248 * <p>
1249 * Output: Nothing.
1250 */
1251 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1252 public static final String ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE =
1253 "android.settings.VOICE_CONTROL_DO_NOT_DISTURB_MODE";
1254
1255 /**
John Spurlockb2278d62015-04-07 12:47:12 -04001256 * Activity Action: Show Zen Mode schedule rule configuration settings.
1257 *
1258 * @hide
1259 */
1260 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1261 public static final String ACTION_ZEN_MODE_SCHEDULE_RULE_SETTINGS
1262 = "android.settings.ZEN_MODE_SCHEDULE_RULE_SETTINGS";
1263
1264 /**
John Spurlockd60258f2015-04-30 09:30:52 -04001265 * Activity Action: Show Zen Mode event rule configuration settings.
1266 *
1267 * @hide
1268 */
1269 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1270 public static final String ACTION_ZEN_MODE_EVENT_RULE_SETTINGS
1271 = "android.settings.ZEN_MODE_EVENT_RULE_SETTINGS";
1272
1273 /**
John Spurlock39581cc2015-04-10 11:59:01 -04001274 * Activity Action: Show Zen Mode external rule configuration settings.
1275 *
1276 * @hide
1277 */
1278 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1279 public static final String ACTION_ZEN_MODE_EXTERNAL_RULE_SETTINGS
1280 = "android.settings.ZEN_MODE_EXTERNAL_RULE_SETTINGS";
1281
1282 /**
Santos Cordona4c75242014-07-09 12:07:51 -07001283 * Activity Action: Show the regulatory information screen for the device.
1284 * <p>
1285 * In some cases, a matching Activity may not exist, so ensure you safeguard
1286 * against this.
1287 * <p>
1288 * Input: Nothing.
1289 * <p>
1290 * Output: Nothing.
1291 */
Jeff Sharkeydd77fda2014-04-16 17:23:08 -07001292 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1293 public static final String
1294 ACTION_SHOW_REGULATORY_INFO = "android.settings.SHOW_REGULATORY_INFO";
1295
Jerome Poichet7974cb32014-05-14 12:04:43 -07001296 /**
1297 * Activity Action: Show Device Name Settings.
1298 * <p>
1299 * In some cases, a matching Activity may not exist, so ensure you safeguard
Tim Kilbourn87cd0dc2014-04-14 15:37:51 -07001300 * against this.
Jerome Poichet7974cb32014-05-14 12:04:43 -07001301 *
1302 * @hide
1303 */
1304 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1305 public static final String DEVICE_NAME_SETTINGS = "android.settings.DEVICE_NAME";
1306
Tim Kilbourn87cd0dc2014-04-14 15:37:51 -07001307 /**
1308 * Activity Action: Show pairing settings.
1309 * <p>
1310 * In some cases, a matching Activity may not exist, so ensure you safeguard
1311 * against this.
1312 *
1313 * @hide
1314 */
1315 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1316 public static final String ACTION_PAIRING_SETTINGS = "android.settings.PAIRING_SETTINGS";
1317
John Spurlockf8f524c2014-06-10 14:47:29 -04001318 /**
1319 * Activity Action: Show battery saver settings.
John Spurlock73466662014-10-30 13:42:05 -04001320 * <p>
1321 * In some cases, a matching Activity may not exist, so ensure you safeguard
1322 * against this.
John Spurlockf8f524c2014-06-10 14:47:29 -04001323 */
1324 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1325 public static final String ACTION_BATTERY_SAVER_SETTINGS
1326 = "android.settings.BATTERY_SAVER_SETTINGS";
1327
Amith Yamasanieb7b94a2014-07-14 18:02:08 -07001328 /**
Barnaby Jamesb3006d32015-04-02 17:49:54 -07001329 * Activity Action: Modify Battery Saver mode setting using a voice command.
1330 * <p>
1331 * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
1332 * <p>
1333 * This intent MUST be started using
1334 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
1335 * startVoiceActivity}.
1336 * <p>
1337 * Note: The activity implementing this intent MUST verify that
1338 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before
1339 * modifying the setting.
1340 * <p>
1341 * Input: To tell which state batter saver mode should be set to, add the
1342 * {@link #EXTRA_BATTERY_SAVER_MODE_ENABLED} extra to this Intent with the state specified.
1343 * If the extra is not included, no changes will be made.
1344 * <p>
1345 * Output: Nothing.
1346 */
1347 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1348 public static final String ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE =
1349 "android.settings.VOICE_CONTROL_BATTERY_SAVER_MODE";
1350
1351 /**
Amith Yamasanieb7b94a2014-07-14 18:02:08 -07001352 * Activity Action: Show Home selection settings. If there are multiple activities
1353 * that can satisfy the {@link Intent#CATEGORY_HOME} intent, this screen allows you
1354 * to pick your preferred activity.
1355 */
1356 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1357 public static final String ACTION_HOME_SETTINGS
1358 = "android.settings.HOME_SETTINGS";
1359
Julia Reynolds7eba5932015-12-11 16:40:39 -05001360 /**
1361 * Activity Action: Show Default apps settings.
1362 * <p>
1363 * In some cases, a matching Activity may not exist, so ensure you
1364 * safeguard against this.
1365 * <p>
1366 * Input: Nothing.
1367 * <p>
1368 * Output: Nothing.
1369 */
1370 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1371 public static final String ACTION_MANAGE_DEFAULT_APPS_SETTINGS
1372 = "android.settings.MANAGE_DEFAULT_APPS_SETTINGS";
1373
John Spurlock2b0e09c2014-07-27 13:27:47 -04001374 /**
1375 * Activity Action: Show notification settings.
1376 *
1377 * @hide
1378 */
1379 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1380 public static final String ACTION_NOTIFICATION_SETTINGS
1381 = "android.settings.NOTIFICATION_SETTINGS";
1382
1383 /**
Julia Reynoldsed1c9af2018-03-21 15:21:09 -04001384 * Activity Action: Show app listing settings, filtered by those that send notifications.
1385 *
1386 * @hide
1387 */
1388 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1389 public static final String ACTION_ALL_APPS_NOTIFICATION_SETTINGS =
1390 "android.settings.ALL_APPS_NOTIFICATION_SETTINGS";
1391
1392 /**
John Spurlock2b0e09c2014-07-27 13:27:47 -04001393 * Activity Action: Show notification settings for a single app.
Jeff Schumacherdc530092017-01-25 18:51:22 -08001394 * <p>
Julia Reynoldsed1c9af2018-03-21 15:21:09 -04001395 * Input: {@link #EXTRA_APP_PACKAGE}, the package to display.
Jeff Schumacherdc530092017-01-25 18:51:22 -08001396 * <p>
1397 * Output: Nothing.
John Spurlock2b0e09c2014-07-27 13:27:47 -04001398 */
1399 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1400 public static final String ACTION_APP_NOTIFICATION_SETTINGS
1401 = "android.settings.APP_NOTIFICATION_SETTINGS";
1402
Chris Wrencd8f4f72014-08-27 18:48:13 -04001403 /**
Julia Reynolds9ba0c612017-01-25 10:31:34 -05001404 * Activity Action: Show notification settings for a single {@link NotificationChannel}.
1405 * <p>
Julia Reynolds9ba0c612017-01-25 10:31:34 -05001406 * Input: {@link #EXTRA_APP_PACKAGE}, the package containing the channel to display.
1407 * Input: {@link #EXTRA_CHANNEL_ID}, the id of the channel to display.
1408 * <p>
1409 * Output: Nothing.
1410 */
1411 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1412 public static final String ACTION_CHANNEL_NOTIFICATION_SETTINGS
1413 = "android.settings.CHANNEL_NOTIFICATION_SETTINGS";
1414
1415 /**
1416 * Activity Extra: The package owner of the notification channel settings to display.
1417 * <p>
1418 * This must be passed as an extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}.
1419 */
1420 public static final String EXTRA_APP_PACKAGE = "android.provider.extra.APP_PACKAGE";
1421
1422 /**
1423 * Activity Extra: The {@link NotificationChannel#getId()} of the notification channel settings
1424 * to display.
1425 * <p>
1426 * This must be passed as an extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}.
1427 */
1428 public static final String EXTRA_CHANNEL_ID = "android.provider.extra.CHANNEL_ID";
1429
1430 /**
Chris Wrencd8f4f72014-08-27 18:48:13 -04001431 * Activity Action: Show notification redaction settings.
1432 *
1433 * @hide
1434 */
1435 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1436 public static final String ACTION_APP_NOTIFICATION_REDACTION
1437 = "android.settings.ACTION_APP_NOTIFICATION_REDACTION";
1438
John Spurlock2b0e09c2014-07-27 13:27:47 -04001439 /** @hide */ public static final String EXTRA_APP_UID = "app_uid";
John Spurlock2b0e09c2014-07-27 13:27:47 -04001440
Sudheer Shanka410e6bd2015-12-31 15:29:50 +00001441 /**
1442 * Activity Action: Show a dialog with disabled by policy message.
1443 * <p> If an user action is disabled by policy, this dialog can be triggered to let
1444 * the user know about this.
1445 * <p>
1446 * Input: Nothing.
1447 * <p>
1448 * Output: Nothing.
Sudheer Shankaaebd5dd2016-02-18 12:37:14 +00001449 *
1450 * @hide
Sudheer Shanka410e6bd2015-12-31 15:29:50 +00001451 */
1452 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1453 public static final String ACTION_SHOW_ADMIN_SUPPORT_DETAILS
1454 = "android.settings.SHOW_ADMIN_SUPPORT_DETAILS";
1455
Michal Karpinskiba244092016-02-25 17:28:24 +00001456 /**
1457 * Activity Action: Show a dialog for remote bugreport flow.
1458 * <p>
1459 * Input: Nothing.
1460 * <p>
1461 * Output: Nothing.
1462 *
1463 * @hide
1464 */
1465 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1466 public static final String ACTION_SHOW_REMOTE_BUGREPORT_DIALOG
1467 = "android.settings.SHOW_REMOTE_BUGREPORT_DIALOG";
1468
Ruben Brunke24b9a62016-02-16 21:38:24 -08001469 /**
1470 * Activity Action: Show VR listener settings.
1471 * <p>
1472 * Input: Nothing.
1473 * <p>
1474 * Output: Nothing.
1475 *
1476 * @see android.service.vr.VrListenerService
1477 */
1478 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1479 public static final String ACTION_VR_LISTENER_SETTINGS
1480 = "android.settings.VR_LISTENER_SETTINGS";
1481
Jason Monk42d01212016-05-03 14:16:56 -04001482 /**
Winson Chung59fda9e2017-01-20 16:14:51 -08001483 * Activity Action: Show Picture-in-picture settings.
1484 * <p>
1485 * Input: Nothing.
1486 * <p>
1487 * Output: Nothing.
1488 *
1489 * @hide
1490 */
1491 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1492 public static final String ACTION_PICTURE_IN_PICTURE_SETTINGS
1493 = "android.settings.PICTURE_IN_PICTURE_SETTINGS";
1494
1495 /**
Daniel Nishie58d2a72016-09-20 16:42:19 -07001496 * Activity Action: Show Storage Manager settings.
1497 * <p>
1498 * Input: Nothing.
1499 * <p>
1500 * Output: Nothing.
1501 *
1502 * @hide
1503 */
1504 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1505 public static final String ACTION_STORAGE_MANAGER_SETTINGS
1506 = "android.settings.STORAGE_MANAGER_SETTINGS";
1507
1508 /**
Jason Monk42d01212016-05-03 14:16:56 -04001509 * Activity Action: Allows user to select current webview implementation.
1510 * <p>
1511 * Input: Nothing.
1512 * <p>
1513 * Output: Nothing.
1514 */
1515 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1516 public static final String ACTION_WEBVIEW_SETTINGS = "android.settings.WEBVIEW_SETTINGS";
1517
Bartosz Fabianowski46bea2e2016-12-06 01:20:29 +01001518 /**
1519 * Activity Action: Show enterprise privacy section.
1520 * <p>
1521 * Input: Nothing.
1522 * <p>
1523 * Output: Nothing.
1524 * @hide
1525 */
1526 @SystemApi
1527 @TestApi
1528 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1529 public static final String ACTION_ENTERPRISE_PRIVACY_SETTINGS
1530 = "android.settings.ENTERPRISE_PRIVACY_SETTINGS";
1531
Felipe Lemedb041182017-04-21 17:33:38 -07001532 /**
1533 * Activity Action: Show screen that let user select its Autofill Service.
1534 * <p>
1535 * Input: Intent's data URI set with an application name, using the
1536 * "package" schema (like "package:com.my.app").
1537 *
1538 * <p>
1539 * Output: {@link android.app.Activity#RESULT_OK} if user selected an Autofill Service belonging
1540 * to the caller package.
1541 *
1542 * <p>
Ricardo Looaec98da2017-07-01 11:19:03 -07001543 * <b>NOTE: </b> Applications should call
Felipe Lemedb041182017-04-21 17:33:38 -07001544 * {@link android.view.autofill.AutofillManager#hasEnabledAutofillServices()} and
Ricardo Looaec98da2017-07-01 11:19:03 -07001545 * {@link android.view.autofill.AutofillManager#isAutofillSupported()}, and only use this action
1546 * to start an activity if they return {@code false} and {@code true} respectively.
Felipe Lemedb041182017-04-21 17:33:38 -07001547 */
1548 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1549 public static final String ACTION_REQUEST_SET_AUTOFILL_SERVICE =
1550 "android.settings.REQUEST_SET_AUTOFILL_SERVICE";
1551
Felipe Lemed82096e2018-01-22 13:44:01 -08001552 /**
1553 * Activity Action: Show screen for controlling which apps have access on volume directories.
1554 * <p>
1555 * Input: Nothing.
1556 * <p>
1557 * Output: Nothing.
1558 * <p>
1559 * Applications typically use this action to ask the user to revert the "Do not ask again"
1560 * status of directory access requests made by
1561 * {@link android.os.storage.StorageVolume#createAccessIntent(String)}.
1562 */
1563 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1564 public static final String ACTION_STORAGE_VOLUME_ACCESS_SETTINGS =
1565 "android.settings.STORAGE_VOLUME_ACCESS_SETTINGS";
1566
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001567 // End of Intent actions for Settings
1568
Erikeebc8e22010-02-18 13:27:19 -08001569 /**
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001570 * @hide - Private call() method on SettingsProvider to read from 'system' table.
1571 */
1572 public static final String CALL_METHOD_GET_SYSTEM = "GET_system";
1573
1574 /**
1575 * @hide - Private call() method on SettingsProvider to read from 'secure' table.
1576 */
1577 public static final String CALL_METHOD_GET_SECURE = "GET_secure";
1578
1579 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001580 * @hide - Private call() method on SettingsProvider to read from 'global' table.
1581 */
1582 public static final String CALL_METHOD_GET_GLOBAL = "GET_global";
1583
1584 /**
Svet Ganov53a441c2016-04-19 19:38:00 -07001585 * @hide - Specifies that the caller of the fast-path call()-based flow tracks
1586 * the settings generation in order to cache values locally. If this key is
1587 * mapped to a <code>null</code> string extra in the request bundle, the response
1588 * bundle will contain the same key mapped to a parcelable extra which would be
1589 * an {@link android.util.MemoryIntArray}. The response will also contain an
1590 * integer mapped to the {@link #CALL_METHOD_GENERATION_INDEX_KEY} which is the
1591 * index in the array clients should use to lookup the generation. For efficiency
1592 * the caller should request the generation tracking memory array only if it
1593 * doesn't already have it.
1594 *
1595 * @see #CALL_METHOD_GENERATION_INDEX_KEY
1596 */
1597 public static final String CALL_METHOD_TRACK_GENERATION_KEY = "_track_generation";
1598
1599 /**
1600 * @hide Key with the location in the {@link android.util.MemoryIntArray} where
Svetoslav Ganov8c35dcc2016-06-17 15:27:43 -07001601 * to look up the generation id of the backing table. The value is an integer.
Svet Ganov53a441c2016-04-19 19:38:00 -07001602 *
1603 * @see #CALL_METHOD_TRACK_GENERATION_KEY
1604 */
1605 public static final String CALL_METHOD_GENERATION_INDEX_KEY = "_generation_index";
1606
1607 /**
Svetoslav Ganov8c35dcc2016-06-17 15:27:43 -07001608 * @hide Key with the settings table generation. The value is an integer.
1609 *
1610 * @see #CALL_METHOD_TRACK_GENERATION_KEY
1611 */
1612 public static final String CALL_METHOD_GENERATION_KEY = "_generation";
1613
1614 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001615 * @hide - User handle argument extra to the fast-path call()-based requests
1616 */
1617 public static final String CALL_METHOD_USER_KEY = "_user";
1618
Svetoslav Ganove080da92016-12-21 17:10:35 -08001619 /**
1620 * @hide - Boolean argument extra to the fast-path call()-based requests
1621 */
1622 public static final String CALL_METHOD_MAKE_DEFAULT_KEY = "_make_default";
1623
1624 /**
1625 * @hide - User handle argument extra to the fast-path call()-based requests
1626 */
1627 public static final String CALL_METHOD_RESET_MODE_KEY = "_reset_mode";
1628
1629 /**
1630 * @hide - String argument extra to the fast-path call()-based requests
1631 */
1632 public static final String CALL_METHOD_TAG_KEY = "_tag";
1633
Christopher Tate06efb532012-08-24 15:29:27 -07001634 /** @hide - Private call() method to write to 'system' table */
1635 public static final String CALL_METHOD_PUT_SYSTEM = "PUT_system";
1636
1637 /** @hide - Private call() method to write to 'secure' table */
1638 public static final String CALL_METHOD_PUT_SECURE = "PUT_secure";
1639
1640 /** @hide - Private call() method to write to 'global' table */
1641 public static final String CALL_METHOD_PUT_GLOBAL= "PUT_global";
1642
Svetoslav Ganove080da92016-12-21 17:10:35 -08001643 /** @hide - Private call() method to reset to defaults the 'global' table */
1644 public static final String CALL_METHOD_RESET_GLOBAL = "RESET_global";
1645
1646 /** @hide - Private call() method to reset to defaults the 'secure' table */
1647 public static final String CALL_METHOD_RESET_SECURE = "RESET_secure";
1648
Christopher Tate06efb532012-08-24 15:29:27 -07001649 /**
Erikeebc8e22010-02-18 13:27:19 -08001650 * Activity Extra: Limit available options in launched activity based on the given authority.
1651 * <p>
1652 * This can be passed as an extra field in an Activity Intent with one or more syncable content
1653 * provider's authorities as a String[]. This field is used by some intents to alter the
1654 * behavior of the called activity.
1655 * <p>
1656 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types available based
1657 * on the authority given.
1658 */
Alon Albert50359c22013-02-26 14:47:48 -08001659 public static final String EXTRA_AUTHORITIES = "authorities";
1660
Alon Albertd35bf1f2013-04-18 14:26:51 -07001661 /**
1662 * Activity Extra: Limit available options in launched activity based on the given account
1663 * types.
1664 * <p>
1665 * This can be passed as an extra field in an Activity Intent with one or more account types
1666 * as a String[]. This field is used by some intents to alter the behavior of the called
1667 * activity.
1668 * <p>
1669 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types to the specified
1670 * list.
1671 */
Alon Albert50359c22013-02-26 14:47:48 -08001672 public static final String EXTRA_ACCOUNT_TYPES = "account_types";
Erikeebc8e22010-02-18 13:27:19 -08001673
Tadashi G. Takaoka25480202011-01-20 23:13:02 +09001674 public static final String EXTRA_INPUT_METHOD_ID = "input_method_id";
1675
Barnaby James48f35522014-07-16 14:27:39 -07001676 /**
Michael Wrightc93fbd12014-09-22 20:07:59 -07001677 * Activity Extra: The device identifier to act upon.
1678 * <p>
1679 * This can be passed as an extra field in an Activity Intent with a single
1680 * InputDeviceIdentifier. This field is used by some activities to jump straight into the
1681 * settings for the given device.
1682 * <p>
Dianne Hackbornad6a99b2014-11-18 10:11:10 -08001683 * Example: The {@link #ACTION_INPUT_METHOD_SETTINGS} intent opens the keyboard layout
1684 * dialog for the given device.
Michael Wrightc93fbd12014-09-22 20:07:59 -07001685 * @hide
1686 */
1687 public static final String EXTRA_INPUT_DEVICE_IDENTIFIER = "input_device_identifier";
1688
1689 /**
Barnaby James48f35522014-07-16 14:27:39 -07001690 * Activity Extra: Enable or disable Airplane Mode.
1691 * <p>
1692 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_AIRPLANE_MODE}
Barnaby Jamesb3006d32015-04-02 17:49:54 -07001693 * intent as a boolean to indicate if it should be enabled.
Barnaby James48f35522014-07-16 14:27:39 -07001694 */
1695 public static final String EXTRA_AIRPLANE_MODE_ENABLED = "airplane_mode_enabled";
1696
Barnaby Jamesb3006d32015-04-02 17:49:54 -07001697 /**
1698 * Activity Extra: Enable or disable Battery saver mode.
1699 * <p>
1700 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE}
1701 * intent as a boolean to indicate if it should be enabled.
1702 */
1703 public static final String EXTRA_BATTERY_SAVER_MODE_ENABLED =
1704 "android.settings.extra.battery_saver_mode_enabled";
1705
1706 /**
1707 * Activity Extra: Enable or disable Do Not Disturb mode.
1708 * <p>
1709 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE}
1710 * intent as a boolean to indicate if it should be enabled.
1711 */
1712 public static final String EXTRA_DO_NOT_DISTURB_MODE_ENABLED =
1713 "android.settings.extra.do_not_disturb_mode_enabled";
1714
1715 /**
1716 * Activity Extra: How many minutes to enable do not disturb mode for.
1717 * <p>
1718 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE}
1719 * intent to indicate how long do not disturb mode should be enabled for.
1720 */
1721 public static final String EXTRA_DO_NOT_DISTURB_MODE_MINUTES =
1722 "android.settings.extra.do_not_disturb_mode_minutes";
1723
Victor Chang355d4762016-04-07 21:23:15 +01001724 /**
Svetoslav Ganove080da92016-12-21 17:10:35 -08001725 * Reset mode: reset to defaults only settings changed by the
1726 * calling package. If there is a default set the setting
1727 * will be set to it, otherwise the setting will be deleted.
1728 * This is the only type of reset available to non-system clients.
1729 * @hide
1730 */
1731 public static final int RESET_MODE_PACKAGE_DEFAULTS = 1;
1732
1733 /**
1734 * Reset mode: reset all settings set by untrusted packages, which is
1735 * packages that aren't a part of the system, to the current defaults.
1736 * If there is a default set the setting will be set to it, otherwise
1737 * the setting will be deleted. This mode is only available to the system.
1738 * @hide
1739 */
1740 public static final int RESET_MODE_UNTRUSTED_DEFAULTS = 2;
1741
1742 /**
1743 * Reset mode: delete all settings set by untrusted packages, which is
1744 * packages that aren't a part of the system. If a setting is set by an
1745 * untrusted package it will be deleted if its default is not provided
1746 * by the system, otherwise the setting will be set to its default.
1747 * This mode is only available to the system.
1748 * @hide
1749 */
1750 public static final int RESET_MODE_UNTRUSTED_CHANGES = 3;
1751
1752 /**
1753 * Reset mode: reset all settings to defaults specified by trusted
1754 * packages, which is packages that are a part of the system, and
1755 * delete all settings set by untrusted packages. If a setting has
1756 * a default set by a system package it will be set to the default,
1757 * otherwise the setting will be deleted. This mode is only available
1758 * to the system.
1759 * @hide
1760 */
1761 public static final int RESET_MODE_TRUSTED_DEFAULTS = 4;
1762
1763 /** @hide */
1764 @Retention(RetentionPolicy.SOURCE)
Jeff Sharkeyce8db992017-12-13 20:05:05 -07001765 @IntDef(prefix = { "RESET_MODE_" }, value = {
Svetoslav Ganove080da92016-12-21 17:10:35 -08001766 RESET_MODE_PACKAGE_DEFAULTS,
1767 RESET_MODE_UNTRUSTED_DEFAULTS,
1768 RESET_MODE_UNTRUSTED_CHANGES,
1769 RESET_MODE_TRUSTED_DEFAULTS
1770 })
1771 public @interface ResetMode{}
1772
Ajay Nadathur702fc642018-03-09 11:56:01 -08001773
1774 /**
1775 * User has not started setup personalization.
1776 * @hide
1777 */
1778 public static final int USER_SETUP_PERSONALIZATION_NOT_STARTED = 0;
1779
1780 /**
1781 * User has not yet completed setup personalization.
1782 * @hide
1783 */
1784 public static final int USER_SETUP_PERSONALIZATION_STARTED = 1;
1785
1786 /**
1787 * User has completed setup personalization.
1788 * @hide
1789 */
1790 public static final int USER_SETUP_PERSONALIZATION_COMPLETE = 10;
1791
1792 /** @hide */
1793 @Retention(RetentionPolicy.SOURCE)
1794 @IntDef({
1795 USER_SETUP_PERSONALIZATION_NOT_STARTED,
1796 USER_SETUP_PERSONALIZATION_STARTED,
1797 USER_SETUP_PERSONALIZATION_COMPLETE
1798 })
1799 public @interface UserSetupPersonalization {}
1800
Svetoslav Ganove080da92016-12-21 17:10:35 -08001801 /**
Victor Chang355d4762016-04-07 21:23:15 +01001802 * Activity Extra: Number of certificates
1803 * <p>
1804 * This can be passed as an extra field to the {@link #ACTION_MONITORING_CERT_INFO}
1805 * intent to indicate the number of certificates
1806 * @hide
1807 */
1808 public static final String EXTRA_NUMBER_OF_CERTIFICATES =
1809 "android.settings.extra.number_of_certificates";
1810
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001811 private static final String JID_RESOURCE_PREFIX = "android";
1812
1813 public static final String AUTHORITY = "settings";
1814
1815 private static final String TAG = "Settings";
Christopher Tate06efb532012-08-24 15:29:27 -07001816 private static final boolean LOCAL_LOGV = false;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001817
David Christie3f7b6522013-08-06 19:19:08 -07001818 // Lock ensures that when enabling/disabling the master location switch, we don't end up
1819 // with a partial enable/disable state in multi-threaded situations.
1820 private static final Object mLocationSettingsLock = new Object();
1821
Chad Brubaker97bccee2017-01-05 15:51:41 -08001822 // Used in system server calling uid workaround in call()
1823 private static boolean sInSystemServer = false;
1824 private static final Object sInSystemServerLock = new Object();
1825
1826 /** @hide */
1827 public static void setInSystemServer() {
1828 synchronized (sInSystemServerLock) {
1829 sInSystemServer = true;
1830 }
1831 }
1832
1833 /** @hide */
1834 public static boolean isInSystemServer() {
1835 synchronized (sInSystemServerLock) {
1836 return sInSystemServer;
1837 }
1838 }
1839
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001840 public static class SettingNotFoundException extends AndroidException {
1841 public SettingNotFoundException(String msg) {
1842 super(msg);
1843 }
1844 }
1845
1846 /**
1847 * Common base for tables of name/value settings.
1848 */
1849 public static class NameValueTable implements BaseColumns {
1850 public static final String NAME = "name";
1851 public static final String VALUE = "value";
1852
1853 protected static boolean putString(ContentResolver resolver, Uri uri,
1854 String name, String value) {
1855 // The database will take care of replacing duplicates.
1856 try {
1857 ContentValues values = new ContentValues();
1858 values.put(NAME, name);
1859 values.put(VALUE, value);
1860 resolver.insert(uri, values);
1861 return true;
1862 } catch (SQLException e) {
Dianne Hackborna33e3f72009-09-29 17:28:24 -07001863 Log.w(TAG, "Can't set key " + name + " in " + uri, e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001864 return false;
1865 }
1866 }
1867
1868 public static Uri getUriFor(Uri uri, String name) {
1869 return Uri.withAppendedPath(uri, name);
1870 }
1871 }
1872
Svet Ganov53a441c2016-04-19 19:38:00 -07001873 private static final class GenerationTracker {
1874 private final MemoryIntArray mArray;
Svetoslav Ganov04df7382016-05-10 18:55:47 -07001875 private final Runnable mErrorHandler;
Svet Ganov53a441c2016-04-19 19:38:00 -07001876 private final int mIndex;
1877 private int mCurrentGeneration;
1878
Svetoslav Ganov04df7382016-05-10 18:55:47 -07001879 public GenerationTracker(@NonNull MemoryIntArray array, int index,
Svetoslav Ganov8c35dcc2016-06-17 15:27:43 -07001880 int generation, Runnable errorHandler) {
Svet Ganov53a441c2016-04-19 19:38:00 -07001881 mArray = array;
1882 mIndex = index;
Svetoslav Ganov04df7382016-05-10 18:55:47 -07001883 mErrorHandler = errorHandler;
Svetoslav Ganov8c35dcc2016-06-17 15:27:43 -07001884 mCurrentGeneration = generation;
Svet Ganov53a441c2016-04-19 19:38:00 -07001885 }
1886
1887 public boolean isGenerationChanged() {
1888 final int currentGeneration = readCurrentGeneration();
1889 if (currentGeneration >= 0) {
1890 if (currentGeneration == mCurrentGeneration) {
1891 return false;
1892 }
1893 mCurrentGeneration = currentGeneration;
1894 }
1895 return true;
1896 }
1897
xulichenga5db9b42017-08-24 11:29:03 +08001898 public int getCurrentGeneration() {
1899 return mCurrentGeneration;
1900 }
1901
Svet Ganov53a441c2016-04-19 19:38:00 -07001902 private int readCurrentGeneration() {
1903 try {
1904 return mArray.get(mIndex);
1905 } catch (IOException e) {
1906 Log.e(TAG, "Error getting current generation", e);
Svetoslav Ganov04df7382016-05-10 18:55:47 -07001907 if (mErrorHandler != null) {
1908 mErrorHandler.run();
1909 }
Svet Ganov53a441c2016-04-19 19:38:00 -07001910 }
1911 return -1;
1912 }
Svetoslav Ganov04df7382016-05-10 18:55:47 -07001913
1914 public void destroy() {
1915 try {
1916 mArray.close();
1917 } catch (IOException e) {
1918 Log.e(TAG, "Error closing backing array", e);
1919 if (mErrorHandler != null) {
1920 mErrorHandler.run();
1921 }
1922 }
1923 }
Svet Ganov53a441c2016-04-19 19:38:00 -07001924 }
1925
Svetoslav Ganove080da92016-12-21 17:10:35 -08001926 private static final class ContentProviderHolder {
1927 private final Object mLock = new Object();
1928
1929 @GuardedBy("mLock")
1930 private final Uri mUri;
1931 @GuardedBy("mLock")
1932 private IContentProvider mContentProvider;
1933
1934 public ContentProviderHolder(Uri uri) {
1935 mUri = uri;
1936 }
1937
1938 public IContentProvider getProvider(ContentResolver contentResolver) {
1939 synchronized (mLock) {
1940 if (mContentProvider == null) {
1941 mContentProvider = contentResolver
1942 .acquireProvider(mUri.getAuthority());
1943 }
1944 return mContentProvider;
1945 }
1946 }
Sudheer Shankaaa3c30d2017-05-23 15:19:10 -07001947
1948 public void clearProviderForTest() {
1949 synchronized (mLock) {
1950 mContentProvider = null;
1951 }
1952 }
Svetoslav Ganove080da92016-12-21 17:10:35 -08001953 }
1954
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001955 // Thread-safe.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001956 private static class NameValueCache {
Svet Ganov53a441c2016-04-19 19:38:00 -07001957 private static final boolean DEBUG = false;
1958
Steve McKayea93fe72016-12-02 11:35:35 -08001959 private static final String[] SELECT_VALUE_PROJECTION = new String[] {
1960 Settings.NameValueTable.VALUE
1961 };
Svetoslav Ganove080da92016-12-21 17:10:35 -08001962
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001963 private static final String NAME_EQ_PLACEHOLDER = "name=?";
1964
1965 // Must synchronize on 'this' to access mValues and mValuesVersion.
Steve McKayea93fe72016-12-02 11:35:35 -08001966 private final HashMap<String, String> mValues = new HashMap<>();
Dan Egnor799f7212009-11-24 16:24:44 -08001967
Svetoslav Ganove080da92016-12-21 17:10:35 -08001968 private final Uri mUri;
1969 private final ContentProviderHolder mProviderHolder;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001970
1971 // The method we'll call (or null, to not use) on the provider
1972 // for the fast path of retrieving settings.
Christopher Tate06efb532012-08-24 15:29:27 -07001973 private final String mCallGetCommand;
1974 private final String mCallSetCommand;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001975
Svet Ganov53a441c2016-04-19 19:38:00 -07001976 @GuardedBy("this")
1977 private GenerationTracker mGenerationTracker;
1978
Svetoslav Ganove080da92016-12-21 17:10:35 -08001979 public NameValueCache(Uri uri, String getCommand, String setCommand,
1980 ContentProviderHolder providerHolder) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001981 mUri = uri;
Christopher Tate06efb532012-08-24 15:29:27 -07001982 mCallGetCommand = getCommand;
1983 mCallSetCommand = setCommand;
Svetoslav Ganove080da92016-12-21 17:10:35 -08001984 mProviderHolder = providerHolder;
Christopher Tate06efb532012-08-24 15:29:27 -07001985 }
1986
1987 public boolean putStringForUser(ContentResolver cr, String name, String value,
Svetoslav Ganove080da92016-12-21 17:10:35 -08001988 String tag, boolean makeDefault, final int userHandle) {
Christopher Tate06efb532012-08-24 15:29:27 -07001989 try {
1990 Bundle arg = new Bundle();
1991 arg.putString(Settings.NameValueTable.VALUE, value);
Christopher Tated5fe1472012-09-10 15:48:38 -07001992 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
Svetoslav Ganove080da92016-12-21 17:10:35 -08001993 if (tag != null) {
1994 arg.putString(CALL_METHOD_TAG_KEY, tag);
1995 }
1996 if (makeDefault) {
1997 arg.putBoolean(CALL_METHOD_MAKE_DEFAULT_KEY, true);
1998 }
1999 IContentProvider cp = mProviderHolder.getProvider(cr);
Dianne Hackborn35654b62013-01-14 17:38:02 -08002000 cp.call(cr.getPackageName(), mCallSetCommand, name, arg);
Christopher Tate06efb532012-08-24 15:29:27 -07002001 } catch (RemoteException e) {
2002 Log.w(TAG, "Can't set key " + name + " in " + mUri, e);
2003 return false;
2004 }
2005 return true;
2006 }
2007
Christopher Tate06efb532012-08-24 15:29:27 -07002008 public String getStringForUser(ContentResolver cr, String name, final int userHandle) {
Christopher Tate78d2a662012-09-13 16:19:44 -07002009 final boolean isSelf = (userHandle == UserHandle.myUserId());
xulichenga5db9b42017-08-24 11:29:03 +08002010 int currentGeneration = -1;
Christopher Tate78d2a662012-09-13 16:19:44 -07002011 if (isSelf) {
Svet Ganov51b83952016-07-06 12:16:53 -07002012 synchronized (NameValueCache.this) {
Svet Ganov53a441c2016-04-19 19:38:00 -07002013 if (mGenerationTracker != null) {
2014 if (mGenerationTracker.isGenerationChanged()) {
2015 if (DEBUG) {
2016 Log.i(TAG, "Generation changed for type:"
2017 + mUri.getPath() + " in package:"
2018 + cr.getPackageName() +" and user:" + userHandle);
2019 }
2020 mValues.clear();
2021 } else if (mValues.containsKey(name)) {
2022 return mValues.get(name);
Christopher Tate78d2a662012-09-13 16:19:44 -07002023 }
xulichenga5db9b42017-08-24 11:29:03 +08002024 if (mGenerationTracker != null) {
2025 currentGeneration = mGenerationTracker.getCurrentGeneration();
2026 }
Christopher Tate78d2a662012-09-13 16:19:44 -07002027 }
Dan Egnor799f7212009-11-24 16:24:44 -08002028 }
Christopher Tate78d2a662012-09-13 16:19:44 -07002029 } else {
2030 if (LOCAL_LOGV) Log.v(TAG, "get setting for user " + userHandle
2031 + " by user " + UserHandle.myUserId() + " so skipping cache");
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002032 }
Dan Egnor799f7212009-11-24 16:24:44 -08002033
Svetoslav Ganove080da92016-12-21 17:10:35 -08002034 IContentProvider cp = mProviderHolder.getProvider(cr);
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08002035
2036 // Try the fast path first, not using query(). If this
2037 // fails (alternate Settings provider that doesn't support
2038 // this interface?) then we fall back to the query/table
2039 // interface.
Christopher Tate06efb532012-08-24 15:29:27 -07002040 if (mCallGetCommand != null) {
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08002041 try {
Christopher Tate06efb532012-08-24 15:29:27 -07002042 Bundle args = null;
Christopher Tate5e08af02012-09-21 17:17:22 -07002043 if (!isSelf) {
Christopher Tate06efb532012-08-24 15:29:27 -07002044 args = new Bundle();
2045 args.putInt(CALL_METHOD_USER_KEY, userHandle);
2046 }
Svet Ganov53a441c2016-04-19 19:38:00 -07002047 boolean needsGenerationTracker = false;
Svet Ganov51b83952016-07-06 12:16:53 -07002048 synchronized (NameValueCache.this) {
Svet Ganov53a441c2016-04-19 19:38:00 -07002049 if (isSelf && mGenerationTracker == null) {
2050 needsGenerationTracker = true;
2051 if (args == null) {
2052 args = new Bundle();
2053 }
2054 args.putString(CALL_METHOD_TRACK_GENERATION_KEY, null);
2055 if (DEBUG) {
2056 Log.i(TAG, "Requested generation tracker for type: "+ mUri.getPath()
2057 + " in package:" + cr.getPackageName() +" and user:"
2058 + userHandle);
2059 }
2060 }
2061 }
Chad Brubaker97bccee2017-01-05 15:51:41 -08002062 Bundle b;
2063 // If we're in system server and in a binder transaction we need to clear the
2064 // calling uid. This works around code in system server that did not call
2065 // clearCallingIdentity, previously this wasn't needed because reading settings
2066 // did not do permission checking but thats no longer the case.
2067 // Long term this should be removed and callers should properly call
2068 // clearCallingIdentity or use a ContentResolver from the caller as needed.
2069 if (Settings.isInSystemServer() && Binder.getCallingUid() != Process.myUid()) {
2070 final long token = Binder.clearCallingIdentity();
2071 try {
2072 b = cp.call(cr.getPackageName(), mCallGetCommand, name, args);
2073 } finally {
2074 Binder.restoreCallingIdentity(token);
2075 }
2076 } else {
2077 b = cp.call(cr.getPackageName(), mCallGetCommand, name, args);
2078 }
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08002079 if (b != null) {
Svet Ganov53a441c2016-04-19 19:38:00 -07002080 String value = b.getString(Settings.NameValueTable.VALUE);
Christopher Tate78d2a662012-09-13 16:19:44 -07002081 // Don't update our cache for reads of other users' data
2082 if (isSelf) {
Svet Ganov51b83952016-07-06 12:16:53 -07002083 synchronized (NameValueCache.this) {
Svet Ganov53a441c2016-04-19 19:38:00 -07002084 if (needsGenerationTracker) {
2085 MemoryIntArray array = b.getParcelable(
2086 CALL_METHOD_TRACK_GENERATION_KEY);
2087 final int index = b.getInt(
2088 CALL_METHOD_GENERATION_INDEX_KEY, -1);
2089 if (array != null && index >= 0) {
Svetoslav Ganov8c35dcc2016-06-17 15:27:43 -07002090 final int generation = b.getInt(
2091 CALL_METHOD_GENERATION_KEY, 0);
Svet Ganov53a441c2016-04-19 19:38:00 -07002092 if (DEBUG) {
2093 Log.i(TAG, "Received generation tracker for type:"
2094 + mUri.getPath() + " in package:"
2095 + cr.getPackageName() + " and user:"
2096 + userHandle + " with index:" + index);
2097 }
Svet Ganov9d723d32016-08-27 11:05:56 -07002098 if (mGenerationTracker != null) {
2099 mGenerationTracker.destroy();
2100 }
Svetoslav Ganov04df7382016-05-10 18:55:47 -07002101 mGenerationTracker = new GenerationTracker(array, index,
Svetoslav Ganov8c35dcc2016-06-17 15:27:43 -07002102 generation, () -> {
Svet Ganov51b83952016-07-06 12:16:53 -07002103 synchronized (NameValueCache.this) {
Svetoslav Ganov04df7382016-05-10 18:55:47 -07002104 Log.e(TAG, "Error accessing generation"
2105 + " tracker - removing");
2106 if (mGenerationTracker != null) {
2107 GenerationTracker generationTracker =
2108 mGenerationTracker;
2109 mGenerationTracker = null;
2110 generationTracker.destroy();
2111 mValues.clear();
2112 }
2113 }
2114 });
Svet Ganov53a441c2016-04-19 19:38:00 -07002115 }
2116 }
xulichenga5db9b42017-08-24 11:29:03 +08002117 if (mGenerationTracker != null && currentGeneration ==
2118 mGenerationTracker.getCurrentGeneration()) {
2119 mValues.put(name, value);
2120 }
Christopher Tate78d2a662012-09-13 16:19:44 -07002121 }
2122 } else {
2123 if (LOCAL_LOGV) Log.i(TAG, "call-query of user " + userHandle
2124 + " by " + UserHandle.myUserId()
2125 + " so not updating cache");
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08002126 }
2127 return value;
2128 }
2129 // If the response Bundle is null, we fall through
2130 // to the query interface below.
2131 } catch (RemoteException e) {
2132 // Not supported by the remote side? Fall through
2133 // to query().
2134 }
2135 }
2136
Dan Egnor799f7212009-11-24 16:24:44 -08002137 Cursor c = null;
2138 try {
Steve McKayea93fe72016-12-02 11:35:35 -08002139 Bundle queryArgs = ContentResolver.createSqlQueryBundle(
2140 NAME_EQ_PLACEHOLDER, new String[]{name}, null);
Chad Brubaker97bccee2017-01-05 15:51:41 -08002141 // Same workaround as above.
2142 if (Settings.isInSystemServer() && Binder.getCallingUid() != Process.myUid()) {
2143 final long token = Binder.clearCallingIdentity();
2144 try {
2145 c = cp.query(cr.getPackageName(), mUri, SELECT_VALUE_PROJECTION, queryArgs,
2146 null);
2147 } finally {
2148 Binder.restoreCallingIdentity(token);
2149 }
2150 } else {
2151 c = cp.query(cr.getPackageName(), mUri, SELECT_VALUE_PROJECTION, queryArgs,
2152 null);
2153 }
Dan Egnor799f7212009-11-24 16:24:44 -08002154 if (c == null) {
2155 Log.w(TAG, "Can't get key " + name + " from " + mUri);
2156 return null;
2157 }
2158
2159 String value = c.moveToNext() ? c.getString(0) : null;
Svet Ganov51b83952016-07-06 12:16:53 -07002160 synchronized (NameValueCache.this) {
xulichenga5db9b42017-08-24 11:29:03 +08002161 if(mGenerationTracker != null &&
2162 currentGeneration == mGenerationTracker.getCurrentGeneration()) {
2163 mValues.put(name, value);
2164 }
Dan Egnor799f7212009-11-24 16:24:44 -08002165 }
2166 if (LOCAL_LOGV) {
2167 Log.v(TAG, "cache miss [" + mUri.getLastPathSegment() + "]: " +
2168 name + " = " + (value == null ? "(null)" : value));
2169 }
2170 return value;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08002171 } catch (RemoteException e) {
Dan Egnor799f7212009-11-24 16:24:44 -08002172 Log.w(TAG, "Can't get key " + name + " from " + mUri, e);
2173 return null; // Return null, but don't cache it.
2174 } finally {
2175 if (c != null) c.close();
2176 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002177 }
Sudheer Shankaaa3c30d2017-05-23 15:19:10 -07002178
2179 public void clearGenerationTrackerForTest() {
2180 synchronized (NameValueCache.this) {
2181 if (mGenerationTracker != null) {
2182 mGenerationTracker.destroy();
2183 }
2184 mValues.clear();
2185 mGenerationTracker = null;
2186 }
2187 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002188 }
2189
2190 /**
Trevor Johns682c24e2016-04-12 10:13:47 -07002191 * Checks if the specified context can draw on top of other apps. As of API
2192 * level 23, an app cannot draw on top of other apps unless it declares the
2193 * {@link android.Manifest.permission#SYSTEM_ALERT_WINDOW} permission in its
2194 * manifest, <em>and</em> the user specifically grants the app this
2195 * capability. To prompt the user to grant this approval, the app must send an
2196 * intent with the action
2197 * {@link android.provider.Settings#ACTION_MANAGE_OVERLAY_PERMISSION}, which
2198 * causes the system to display a permission management screen.
Billy Lau6ad2d662015-07-18 00:26:58 +01002199 *
Trevor Johns682c24e2016-04-12 10:13:47 -07002200 * @param context App context.
2201 * @return true if the specified context can draw on top of other apps, false otherwise
Billy Lau6ad2d662015-07-18 00:26:58 +01002202 */
2203 public static boolean canDrawOverlays(Context context) {
Svet Ganov94ba40172016-04-03 22:04:22 -07002204 return Settings.isCallingPackageAllowedToDrawOverlays(context, Process.myUid(),
2205 context.getOpPackageName(), false);
Billy Lau6ad2d662015-07-18 00:26:58 +01002206 }
2207
2208 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002209 * System settings, containing miscellaneous system preferences. This
2210 * table holds simple name/value pairs. There are convenience
2211 * functions for accessing individual settings entries.
2212 */
2213 public static final class System extends NameValueTable {
Kweku Adamsb0886f32017-10-31 15:32:09 -07002214 // NOTE: If you add new settings here, be sure to add them to
2215 // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoSystemSettingsLocked.
2216
Alan Viverette04fd67c2016-04-12 10:54:04 -04002217 private static final float DEFAULT_FONT_SCALE = 1.0f;
2218
Dianne Hackborn139748f2012-09-24 11:36:57 -07002219 /**
2220 * The content:// style URL for this table
2221 */
2222 public static final Uri CONTENT_URI =
2223 Uri.parse("content://" + AUTHORITY + "/system");
2224
Svetoslav Ganove080da92016-12-21 17:10:35 -08002225 private static final ContentProviderHolder sProviderHolder =
2226 new ContentProviderHolder(CONTENT_URI);
2227
Dianne Hackborn139748f2012-09-24 11:36:57 -07002228 private static final NameValueCache sNameValueCache = new NameValueCache(
Dianne Hackborn139748f2012-09-24 11:36:57 -07002229 CONTENT_URI,
2230 CALL_METHOD_GET_SYSTEM,
Svetoslav Ganove080da92016-12-21 17:10:35 -08002231 CALL_METHOD_PUT_SYSTEM,
2232 sProviderHolder);
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002233
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002234 private static final HashSet<String> MOVED_TO_SECURE;
2235 static {
Steve McKayea93fe72016-12-02 11:35:35 -08002236 MOVED_TO_SECURE = new HashSet<>(30);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002237 MOVED_TO_SECURE.add(Secure.ANDROID_ID);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002238 MOVED_TO_SECURE.add(Secure.HTTP_PROXY);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002239 MOVED_TO_SECURE.add(Secure.LOCATION_PROVIDERS_ALLOWED);
Danielle Millett925a7d82012-03-19 18:02:20 -04002240 MOVED_TO_SECURE.add(Secure.LOCK_BIOMETRIC_WEAK_FLAGS);
Amith Yamasani156c4352010-03-05 17:10:03 -08002241 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_ENABLED);
2242 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_VISIBLE);
2243 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002244 MOVED_TO_SECURE.add(Secure.LOGGING_ID);
2245 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_ENABLED);
2246 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_LAST_UPDATE);
2247 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_REDIRECT_URL);
2248 MOVED_TO_SECURE.add(Secure.SETTINGS_CLASSNAME);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002249 MOVED_TO_SECURE.add(Secure.USE_GOOGLE_MAIL);
2250 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
2251 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
2252 MOVED_TO_SECURE.add(Secure.WIFI_NUM_OPEN_NETWORKS_KEPT);
2253 MOVED_TO_SECURE.add(Secure.WIFI_ON);
2254 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE);
2255 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_AP_COUNT);
2256 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS);
2257 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED);
2258 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS);
2259 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT);
2260 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_MAX_AP_CHECKS);
2261 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ON);
2262 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_COUNT);
2263 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_DELAY_MS);
2264 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS);
Christopher Tateaa036a22014-05-19 16:33:27 -07002265
2266 // At one time in System, then Global, but now back in Secure
2267 MOVED_TO_SECURE.add(Secure.INSTALL_NON_MARKET_APPS);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002268 }
2269
Christopher Tate06efb532012-08-24 15:29:27 -07002270 private static final HashSet<String> MOVED_TO_GLOBAL;
Christopher Tate66488d62012-10-02 11:58:01 -07002271 private static final HashSet<String> MOVED_TO_SECURE_THEN_GLOBAL;
Christopher Tate06efb532012-08-24 15:29:27 -07002272 static {
Steve McKayea93fe72016-12-02 11:35:35 -08002273 MOVED_TO_GLOBAL = new HashSet<>();
2274 MOVED_TO_SECURE_THEN_GLOBAL = new HashSet<>();
Christopher Tate66488d62012-10-02 11:58:01 -07002275
Christopher Tate92198742012-09-07 12:00:13 -07002276 // these were originally in system but migrated to secure in the past,
2277 // so are duplicated in the Secure.* namespace
Christopher Tate66488d62012-10-02 11:58:01 -07002278 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.ADB_ENABLED);
2279 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.BLUETOOTH_ON);
2280 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DATA_ROAMING);
2281 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DEVICE_PROVISIONED);
Christopher Tate66488d62012-10-02 11:58:01 -07002282 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.USB_MASS_STORAGE_ENABLED);
2283 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.HTTP_PROXY);
Christopher Tate06efb532012-08-24 15:29:27 -07002284
Christopher Tate92198742012-09-07 12:00:13 -07002285 // these are moving directly from system to global
Christopher Tate06efb532012-08-24 15:29:27 -07002286 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_ON);
2287 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_RADIOS);
2288 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS);
2289 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME);
2290 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME_ZONE);
2291 MOVED_TO_GLOBAL.add(Settings.Global.CAR_DOCK_SOUND);
2292 MOVED_TO_GLOBAL.add(Settings.Global.CAR_UNDOCK_SOUND);
2293 MOVED_TO_GLOBAL.add(Settings.Global.DESK_DOCK_SOUND);
2294 MOVED_TO_GLOBAL.add(Settings.Global.DESK_UNDOCK_SOUND);
2295 MOVED_TO_GLOBAL.add(Settings.Global.DOCK_SOUNDS_ENABLED);
2296 MOVED_TO_GLOBAL.add(Settings.Global.LOCK_SOUND);
2297 MOVED_TO_GLOBAL.add(Settings.Global.UNLOCK_SOUND);
2298 MOVED_TO_GLOBAL.add(Settings.Global.LOW_BATTERY_SOUND);
2299 MOVED_TO_GLOBAL.add(Settings.Global.POWER_SOUNDS_ENABLED);
2300 MOVED_TO_GLOBAL.add(Settings.Global.STAY_ON_WHILE_PLUGGED_IN);
2301 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SLEEP_POLICY);
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07002302 MOVED_TO_GLOBAL.add(Settings.Global.MODE_RINGER);
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002303 MOVED_TO_GLOBAL.add(Settings.Global.WINDOW_ANIMATION_SCALE);
2304 MOVED_TO_GLOBAL.add(Settings.Global.TRANSITION_ANIMATION_SCALE);
2305 MOVED_TO_GLOBAL.add(Settings.Global.ANIMATOR_DURATION_SCALE);
2306 MOVED_TO_GLOBAL.add(Settings.Global.FANCY_IME_ANIMATIONS);
2307 MOVED_TO_GLOBAL.add(Settings.Global.COMPATIBILITY_MODE);
2308 MOVED_TO_GLOBAL.add(Settings.Global.EMERGENCY_TONE);
2309 MOVED_TO_GLOBAL.add(Settings.Global.CALL_AUTO_RETRY);
2310 MOVED_TO_GLOBAL.add(Settings.Global.DEBUG_APP);
2311 MOVED_TO_GLOBAL.add(Settings.Global.WAIT_FOR_DEBUGGER);
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002312 MOVED_TO_GLOBAL.add(Settings.Global.ALWAYS_FINISH_ACTIVITIES);
Geremy Condraa0735112013-03-26 21:49:26 -07002313 MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_CONTENT_URL);
2314 MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_METADATA_URL);
2315 MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_CONTENT_URL);
2316 MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_METADATA_URL);
2317 MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_CONTENT_URL);
2318 MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_METADATA_URL);
2319 MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_CONTENT_URL);
2320 MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_METADATA_URL);
Christopher Tate06efb532012-08-24 15:29:27 -07002321 }
2322
Christopher Tate66488d62012-10-02 11:58:01 -07002323 /** @hide */
Svetoslav683914b2015-01-15 14:22:26 -08002324 public static void getMovedToGlobalSettings(Set<String> outKeySet) {
Christopher Tate66488d62012-10-02 11:58:01 -07002325 outKeySet.addAll(MOVED_TO_GLOBAL);
2326 outKeySet.addAll(MOVED_TO_SECURE_THEN_GLOBAL);
2327 }
2328
2329 /** @hide */
Svetoslav683914b2015-01-15 14:22:26 -08002330 public static void getMovedToSecureSettings(Set<String> outKeySet) {
2331 outKeySet.addAll(MOVED_TO_SECURE);
2332 }
2333
2334 /** @hide */
Christopher Tate66488d62012-10-02 11:58:01 -07002335 public static void getNonLegacyMovedKeys(HashSet<String> outKeySet) {
2336 outKeySet.addAll(MOVED_TO_GLOBAL);
2337 }
2338
Sudheer Shankaaa3c30d2017-05-23 15:19:10 -07002339 /** @hide */
2340 public static void clearProviderForTest() {
2341 sProviderHolder.clearProviderForTest();
2342 sNameValueCache.clearGenerationTrackerForTest();
2343 }
2344
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002345 /**
2346 * Look up a name in the database.
2347 * @param resolver to access the database with
2348 * @param name to look up in the table
2349 * @return the corresponding value, or null if not present
2350 */
Dianne Hackborn139748f2012-09-24 11:36:57 -07002351 public static String getString(ContentResolver resolver, String name) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07002352 return getStringForUser(resolver, name, resolver.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07002353 }
2354
2355 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -07002356 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -07002357 int userHandle) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002358 if (MOVED_TO_SECURE.contains(name)) {
2359 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
2360 + " to android.provider.Settings.Secure, returning read-only value.");
Christopher Tate06efb532012-08-24 15:29:27 -07002361 return Secure.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002362 }
Christopher Tate66488d62012-10-02 11:58:01 -07002363 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07002364 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
2365 + " to android.provider.Settings.Global, returning read-only value.");
2366 return Global.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002367 }
Christopher Tate06efb532012-08-24 15:29:27 -07002368 return sNameValueCache.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002369 }
2370
2371 /**
2372 * Store a name/value pair into the database.
2373 * @param resolver to access the database with
2374 * @param name to store
2375 * @param value to associate with the name
2376 * @return true if the value was set, false on database errors
2377 */
2378 public static boolean putString(ContentResolver resolver, String name, String value) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07002379 return putStringForUser(resolver, name, value, resolver.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07002380 }
2381
2382 /** @hide */
2383 public static boolean putStringForUser(ContentResolver resolver, String name, String value,
2384 int userHandle) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002385 if (MOVED_TO_SECURE.contains(name)) {
2386 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
2387 + " to android.provider.Settings.Secure, value is unchanged.");
2388 return false;
2389 }
Christopher Tate66488d62012-10-02 11:58:01 -07002390 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07002391 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
2392 + " to android.provider.Settings.Global, value is unchanged.");
2393 return false;
2394 }
Svetoslav Ganove080da92016-12-21 17:10:35 -08002395 return sNameValueCache.putStringForUser(resolver, name, value, null, false, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002396 }
2397
2398 /**
2399 * Construct the content URI for a particular name/value pair,
2400 * useful for monitoring changes with a ContentObserver.
2401 * @param name to look up in the table
2402 * @return the corresponding content URI, or null if not present
2403 */
2404 public static Uri getUriFor(String name) {
2405 if (MOVED_TO_SECURE.contains(name)) {
2406 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
2407 + " to android.provider.Settings.Secure, returning Secure URI.");
2408 return Secure.getUriFor(Secure.CONTENT_URI, name);
2409 }
Christopher Tate66488d62012-10-02 11:58:01 -07002410 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07002411 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
2412 + " to android.provider.Settings.Global, returning read-only global URI.");
2413 return Global.getUriFor(Global.CONTENT_URI, name);
2414 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002415 return getUriFor(CONTENT_URI, name);
2416 }
2417
2418 /**
2419 * Convenience function for retrieving a single system settings value
2420 * as an integer. Note that internally setting values are always
2421 * stored as strings; this function converts the string to an integer
2422 * for you. The default value will be returned if the setting is
2423 * not defined or not an integer.
2424 *
2425 * @param cr The ContentResolver to access.
2426 * @param name The name of the setting to retrieve.
2427 * @param def Value to return if the setting is not defined.
2428 *
2429 * @return The setting's current value, or 'def' if it is not defined
2430 * or not a valid integer.
2431 */
2432 public static int getInt(ContentResolver cr, String name, int def) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07002433 return getIntForUser(cr, name, def, cr.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07002434 }
2435
2436 /** @hide */
2437 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
2438 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002439 try {
2440 return v != null ? Integer.parseInt(v) : def;
2441 } catch (NumberFormatException e) {
2442 return def;
2443 }
2444 }
2445
2446 /**
2447 * Convenience function for retrieving a single system settings value
2448 * as an integer. Note that internally setting values are always
2449 * stored as strings; this function converts the string to an integer
2450 * for you.
2451 * <p>
2452 * This version does not take a default value. If the setting has not
2453 * been set, or the string value is not a number,
2454 * it throws {@link SettingNotFoundException}.
2455 *
2456 * @param cr The ContentResolver to access.
2457 * @param name The name of the setting to retrieve.
2458 *
2459 * @throws SettingNotFoundException Thrown if a setting by the given
2460 * name can't be found or the setting value is not an integer.
2461 *
2462 * @return The setting's current value.
2463 */
2464 public static int getInt(ContentResolver cr, String name)
2465 throws SettingNotFoundException {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07002466 return getIntForUser(cr, name, cr.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07002467 }
2468
2469 /** @hide */
2470 public static int getIntForUser(ContentResolver cr, String name, int userHandle)
2471 throws SettingNotFoundException {
2472 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002473 try {
2474 return Integer.parseInt(v);
2475 } catch (NumberFormatException e) {
2476 throw new SettingNotFoundException(name);
2477 }
2478 }
2479
2480 /**
2481 * Convenience function for updating a single settings value as an
2482 * integer. This will either create a new entry in the table if the
2483 * given name does not exist, or modify the value of the existing row
2484 * with that name. Note that internally setting values are always
2485 * stored as strings, so this function converts the given value to a
2486 * string before storing it.
2487 *
2488 * @param cr The ContentResolver to access.
2489 * @param name The name of the setting to modify.
2490 * @param value The new value for the setting.
2491 * @return true if the value was set, false on database errors
2492 */
2493 public static boolean putInt(ContentResolver cr, String name, int value) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07002494 return putIntForUser(cr, name, value, cr.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07002495 }
2496
2497 /** @hide */
2498 public static boolean putIntForUser(ContentResolver cr, String name, int value,
2499 int userHandle) {
2500 return putStringForUser(cr, name, Integer.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002501 }
2502
2503 /**
2504 * Convenience function for retrieving a single system settings value
2505 * as a {@code long}. Note that internally setting values are always
2506 * stored as strings; this function converts the string to a {@code long}
2507 * for you. The default value will be returned if the setting is
2508 * not defined or not a {@code long}.
2509 *
2510 * @param cr The ContentResolver to access.
2511 * @param name The name of the setting to retrieve.
2512 * @param def Value to return if the setting is not defined.
2513 *
2514 * @return The setting's current value, or 'def' if it is not defined
2515 * or not a valid {@code long}.
2516 */
2517 public static long getLong(ContentResolver cr, String name, long def) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07002518 return getLongForUser(cr, name, def, cr.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07002519 }
2520
2521 /** @hide */
2522 public static long getLongForUser(ContentResolver cr, String name, long def,
2523 int userHandle) {
2524 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002525 long value;
2526 try {
2527 value = valString != null ? Long.parseLong(valString) : def;
2528 } catch (NumberFormatException e) {
2529 value = def;
2530 }
2531 return value;
2532 }
2533
2534 /**
2535 * Convenience function for retrieving a single system settings value
2536 * as a {@code long}. Note that internally setting values are always
2537 * stored as strings; this function converts the string to a {@code long}
2538 * for you.
2539 * <p>
2540 * This version does not take a default value. If the setting has not
2541 * been set, or the string value is not a number,
2542 * it throws {@link SettingNotFoundException}.
2543 *
2544 * @param cr The ContentResolver to access.
2545 * @param name The name of the setting to retrieve.
2546 *
2547 * @return The setting's current value.
2548 * @throws SettingNotFoundException Thrown if a setting by the given
2549 * name can't be found or the setting value is not an integer.
2550 */
2551 public static long getLong(ContentResolver cr, String name)
2552 throws SettingNotFoundException {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07002553 return getLongForUser(cr, name, cr.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07002554 }
2555
2556 /** @hide */
2557 public static long getLongForUser(ContentResolver cr, String name, int userHandle)
2558 throws SettingNotFoundException {
2559 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002560 try {
2561 return Long.parseLong(valString);
2562 } catch (NumberFormatException e) {
2563 throw new SettingNotFoundException(name);
2564 }
2565 }
2566
2567 /**
2568 * Convenience function for updating a single settings value as a long
2569 * integer. This will either create a new entry in the table if the
2570 * given name does not exist, or modify the value of the existing row
2571 * with that name. Note that internally setting values are always
2572 * stored as strings, so this function converts the given value to a
2573 * string before storing it.
2574 *
2575 * @param cr The ContentResolver to access.
2576 * @param name The name of the setting to modify.
2577 * @param value The new value for the setting.
2578 * @return true if the value was set, false on database errors
2579 */
2580 public static boolean putLong(ContentResolver cr, String name, long value) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07002581 return putLongForUser(cr, name, value, cr.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07002582 }
2583
2584 /** @hide */
2585 public static boolean putLongForUser(ContentResolver cr, String name, long value,
2586 int userHandle) {
2587 return putStringForUser(cr, name, Long.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002588 }
2589
2590 /**
2591 * Convenience function for retrieving a single system settings value
2592 * as a floating point number. Note that internally setting values are
2593 * always stored as strings; this function converts the string to an
2594 * float for you. The default value will be returned if the setting
2595 * is not defined or not a valid float.
2596 *
2597 * @param cr The ContentResolver to access.
2598 * @param name The name of the setting to retrieve.
2599 * @param def Value to return if the setting is not defined.
2600 *
2601 * @return The setting's current value, or 'def' if it is not defined
2602 * or not a valid float.
2603 */
2604 public static float getFloat(ContentResolver cr, String name, float def) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07002605 return getFloatForUser(cr, name, def, cr.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07002606 }
2607
2608 /** @hide */
2609 public static float getFloatForUser(ContentResolver cr, String name, float def,
2610 int userHandle) {
2611 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002612 try {
2613 return v != null ? Float.parseFloat(v) : def;
2614 } catch (NumberFormatException e) {
2615 return def;
2616 }
2617 }
2618
2619 /**
2620 * Convenience function for retrieving a single system settings value
2621 * as a float. Note that internally setting values are always
2622 * stored as strings; this function converts the string to a float
2623 * for you.
2624 * <p>
2625 * This version does not take a default value. If the setting has not
2626 * been set, or the string value is not a number,
2627 * it throws {@link SettingNotFoundException}.
2628 *
2629 * @param cr The ContentResolver to access.
2630 * @param name The name of the setting to retrieve.
2631 *
2632 * @throws SettingNotFoundException Thrown if a setting by the given
2633 * name can't be found or the setting value is not a float.
2634 *
2635 * @return The setting's current value.
2636 */
2637 public static float getFloat(ContentResolver cr, String name)
2638 throws SettingNotFoundException {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07002639 return getFloatForUser(cr, name, cr.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07002640 }
2641
2642 /** @hide */
2643 public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
2644 throws SettingNotFoundException {
2645 String v = getStringForUser(cr, name, userHandle);
Brian Muramatsue1d46982010-12-06 17:34:20 -08002646 if (v == null) {
2647 throw new SettingNotFoundException(name);
2648 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002649 try {
2650 return Float.parseFloat(v);
2651 } catch (NumberFormatException e) {
2652 throw new SettingNotFoundException(name);
2653 }
2654 }
2655
2656 /**
2657 * Convenience function for updating a single settings value as a
2658 * floating point number. This will either create a new entry in the
2659 * table if the given name does not exist, or modify the value of the
2660 * existing row with that name. Note that internally setting values
2661 * are always stored as strings, so this function converts the given
2662 * value to a string before storing it.
2663 *
2664 * @param cr The ContentResolver to access.
2665 * @param name The name of the setting to modify.
2666 * @param value The new value for the setting.
2667 * @return true if the value was set, false on database errors
2668 */
2669 public static boolean putFloat(ContentResolver cr, String name, float value) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07002670 return putFloatForUser(cr, name, value, cr.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07002671 }
2672
2673 /** @hide */
2674 public static boolean putFloatForUser(ContentResolver cr, String name, float value,
2675 int userHandle) {
2676 return putStringForUser(cr, name, Float.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002677 }
2678
2679 /**
2680 * Convenience function to read all of the current
2681 * configuration-related settings into a
2682 * {@link Configuration} object.
2683 *
2684 * @param cr The ContentResolver to access.
2685 * @param outConfig Where to place the configuration settings.
2686 */
2687 public static void getConfiguration(ContentResolver cr, Configuration outConfig) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07002688 adjustConfigurationForUser(cr, outConfig, cr.getUserId(),
Seigo Nonakaea906b32016-05-18 17:33:04 +09002689 false /* updateSettingsIfEmpty */);
Christopher Tate06efb532012-08-24 15:29:27 -07002690 }
2691
2692 /** @hide */
Seigo Nonakaea906b32016-05-18 17:33:04 +09002693 public static void adjustConfigurationForUser(ContentResolver cr, Configuration outConfig,
2694 int userHandle, boolean updateSettingsIfEmpty) {
Christopher Tate06efb532012-08-24 15:29:27 -07002695 outConfig.fontScale = Settings.System.getFloatForUser(
Alan Viverette04fd67c2016-04-12 10:54:04 -04002696 cr, FONT_SCALE, DEFAULT_FONT_SCALE, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002697 if (outConfig.fontScale < 0) {
Alan Viverette04fd67c2016-04-12 10:54:04 -04002698 outConfig.fontScale = DEFAULT_FONT_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002699 }
Seigo Nonakaea906b32016-05-18 17:33:04 +09002700
2701 final String localeValue =
2702 Settings.System.getStringForUser(cr, SYSTEM_LOCALES, userHandle);
2703 if (localeValue != null) {
2704 outConfig.setLocales(LocaleList.forLanguageTags(localeValue));
2705 } else {
2706 // Do not update configuration with emtpy settings since we need to take over the
2707 // locale list of previous user if the settings value is empty. This happens when a
2708 // new user is created.
2709
2710 if (updateSettingsIfEmpty) {
2711 // Make current configuration persistent. This is necessary the first time a
2712 // user log in. At the first login, the configuration settings are empty, so we
2713 // need to store the adjusted configuration as the initial settings.
2714 Settings.System.putStringForUser(
2715 cr, SYSTEM_LOCALES, outConfig.getLocales().toLanguageTags(),
2716 userHandle);
2717 }
2718 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002719 }
2720
2721 /**
Dianne Hackborn31ca8542011-07-19 14:58:28 -07002722 * @hide Erase the fields in the Configuration that should be applied
2723 * by the settings.
2724 */
2725 public static void clearConfiguration(Configuration inoutConfig) {
2726 inoutConfig.fontScale = 0;
Seigo Nonakad4031512016-03-17 21:18:53 +09002727 if (!inoutConfig.userSetLocale && !inoutConfig.getLocales().isEmpty()) {
Seigo Nonakabd5cac62016-05-13 15:11:37 +09002728 inoutConfig.clearLocales();
Seigo Nonakabd5cbdd2016-01-25 19:40:28 +09002729 }
Dianne Hackborn31ca8542011-07-19 14:58:28 -07002730 }
Narayan Kamath6d632962011-08-24 11:51:37 +01002731
Dianne Hackborn31ca8542011-07-19 14:58:28 -07002732 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002733 * Convenience function to write a batch of configuration-related
2734 * settings from a {@link Configuration} object.
2735 *
2736 * @param cr The ContentResolver to access.
2737 * @param config The settings to write.
2738 * @return true if the values were set, false on database errors
2739 */
2740 public static boolean putConfiguration(ContentResolver cr, Configuration config) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07002741 return putConfigurationForUser(cr, config, cr.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07002742 }
2743
2744 /** @hide */
2745 public static boolean putConfigurationForUser(ContentResolver cr, Configuration config,
2746 int userHandle) {
Seigo Nonakabd5cbdd2016-01-25 19:40:28 +09002747 return Settings.System.putFloatForUser(cr, FONT_SCALE, config.fontScale, userHandle) &&
2748 Settings.System.putStringForUser(
2749 cr, SYSTEM_LOCALES, config.getLocales().toLanguageTags(), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002750 }
2751
Dianne Hackbornb8b11a02010-03-10 15:53:11 -08002752 /** @hide */
2753 public static boolean hasInterestingConfigurationChanges(int changes) {
Seigo Nonakabd5cbdd2016-01-25 19:40:28 +09002754 return (changes & ActivityInfo.CONFIG_FONT_SCALE) != 0 ||
2755 (changes & ActivityInfo.CONFIG_LOCALE) != 0;
Dianne Hackbornb8b11a02010-03-10 15:53:11 -08002756 }
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07002757
Christopher Tate06efb532012-08-24 15:29:27 -07002758 /** @deprecated - Do not use */
2759 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002760 public static boolean getShowGTalkServiceStatus(ContentResolver cr) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07002761 return getShowGTalkServiceStatusForUser(cr, cr.getUserId());
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002762 }
2763
Christopher Tate06efb532012-08-24 15:29:27 -07002764 /**
2765 * @hide
2766 * @deprecated - Do not use
2767 */
Aurimas Liutikas514c5ef2016-05-24 15:22:55 -07002768 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002769 public static boolean getShowGTalkServiceStatusForUser(ContentResolver cr,
2770 int userHandle) {
2771 return getIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, 0, userHandle) != 0;
2772 }
2773
2774 /** @deprecated - Do not use */
2775 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002776 public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07002777 setShowGTalkServiceStatusForUser(cr, flag, cr.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07002778 }
2779
2780 /**
2781 * @hide
2782 * @deprecated - Do not use
2783 */
2784 @Deprecated
2785 public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean flag,
2786 int userHandle) {
2787 putIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, flag ? 1 : 0, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002788 }
2789
2790 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002791 * @deprecated Use {@link android.provider.Settings.Global#STAY_ON_WHILE_PLUGGED_IN} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002792 */
Christopher Tate06efb532012-08-24 15:29:27 -07002793 @Deprecated
2794 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 -08002795
Michal Karpinski2c37b082018-01-18 16:14:27 +00002796 private static final Validator STAY_ON_WHILE_PLUGGED_IN_VALIDATOR = new Validator() {
2797 @Override
2798 public boolean validate(String value) {
2799 try {
2800 int val = Integer.parseInt(value);
2801 return (val == 0)
2802 || (val == BatteryManager.BATTERY_PLUGGED_AC)
2803 || (val == BatteryManager.BATTERY_PLUGGED_USB)
2804 || (val == BatteryManager.BATTERY_PLUGGED_WIRELESS)
2805 || (val == (BatteryManager.BATTERY_PLUGGED_AC
2806 | BatteryManager.BATTERY_PLUGGED_USB))
2807 || (val == (BatteryManager.BATTERY_PLUGGED_AC
2808 | BatteryManager.BATTERY_PLUGGED_WIRELESS))
2809 || (val == (BatteryManager.BATTERY_PLUGGED_USB
2810 | BatteryManager.BATTERY_PLUGGED_WIRELESS))
2811 || (val == (BatteryManager.BATTERY_PLUGGED_AC
2812 | BatteryManager.BATTERY_PLUGGED_USB
2813 | BatteryManager.BATTERY_PLUGGED_WIRELESS));
2814 } catch (NumberFormatException e) {
2815 return false;
2816 }
2817 }
2818 };
2819
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002820 /**
2821 * What happens when the user presses the end call button if they're not
2822 * on a call.<br/>
2823 * <b>Values:</b><br/>
2824 * 0 - The end button does nothing.<br/>
2825 * 1 - The end button goes to the home screen.<br/>
2826 * 2 - The end button puts the device to sleep and locks the keyguard.<br/>
2827 * 3 - The end button goes to the home screen. If the user is already on the
2828 * home screen, it puts the device to sleep.
2829 */
2830 public static final String END_BUTTON_BEHAVIOR = "end_button_behavior";
2831
Svetoslav683914b2015-01-15 14:22:26 -08002832 private static final Validator END_BUTTON_BEHAVIOR_VALIDATOR =
Michal Karpinski2c37b082018-01-18 16:14:27 +00002833 new SettingsValidators.InclusiveIntegerRangeValidator(0, 3);
Svetoslav683914b2015-01-15 14:22:26 -08002834
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002835 /**
David Brown458e8062010-03-08 21:52:11 -08002836 * END_BUTTON_BEHAVIOR value for "go home".
2837 * @hide
2838 */
2839 public static final int END_BUTTON_BEHAVIOR_HOME = 0x1;
2840
2841 /**
2842 * END_BUTTON_BEHAVIOR value for "go to sleep".
2843 * @hide
2844 */
2845 public static final int END_BUTTON_BEHAVIOR_SLEEP = 0x2;
2846
2847 /**
2848 * END_BUTTON_BEHAVIOR default value.
2849 * @hide
2850 */
2851 public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_SLEEP;
2852
2853 /**
Joe Onorato9cdffa12011-04-06 18:27:27 -07002854 * Is advanced settings mode turned on. 0 == no, 1 == yes
2855 * @hide
2856 */
2857 public static final String ADVANCED_SETTINGS = "advanced_settings";
2858
Michal Karpinski2c37b082018-01-18 16:14:27 +00002859 private static final Validator ADVANCED_SETTINGS_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08002860
Joe Onorato9cdffa12011-04-06 18:27:27 -07002861 /**
2862 * ADVANCED_SETTINGS default value.
2863 * @hide
2864 */
2865 public static final int ADVANCED_SETTINGS_DEFAULT = 0;
2866
2867 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002868 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002869 */
Christopher Tate06efb532012-08-24 15:29:27 -07002870 @Deprecated
2871 public static final String AIRPLANE_MODE_ON = Global.AIRPLANE_MODE_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002872
2873 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002874 * @deprecated Use {@link android.provider.Settings.Global#RADIO_BLUETOOTH} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002875 */
Christopher Tate06efb532012-08-24 15:29:27 -07002876 @Deprecated
2877 public static final String RADIO_BLUETOOTH = Global.RADIO_BLUETOOTH;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002878
2879 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002880 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIFI} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002881 */
Christopher Tate06efb532012-08-24 15:29:27 -07002882 @Deprecated
2883 public static final String RADIO_WIFI = Global.RADIO_WIFI;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002884
Robert Greenwalt8588e472011-11-08 10:12:25 -08002885 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002886 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIMAX} instead
Robert Greenwalt8588e472011-11-08 10:12:25 -08002887 * {@hide}
2888 */
Christopher Tate06efb532012-08-24 15:29:27 -07002889 @Deprecated
2890 public static final String RADIO_WIMAX = Global.RADIO_WIMAX;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002891
2892 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002893 * @deprecated Use {@link android.provider.Settings.Global#RADIO_CELL} instead
Nick Pelly8d32a012011-08-09 07:03:49 -07002894 */
Christopher Tate06efb532012-08-24 15:29:27 -07002895 @Deprecated
2896 public static final String RADIO_CELL = Global.RADIO_CELL;
Nick Pelly8d32a012011-08-09 07:03:49 -07002897
2898 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002899 * @deprecated Use {@link android.provider.Settings.Global#RADIO_NFC} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002900 */
Christopher Tate06efb532012-08-24 15:29:27 -07002901 @Deprecated
2902 public static final String RADIO_NFC = Global.RADIO_NFC;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002903
2904 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002905 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_RADIOS} instead
2906 */
2907 @Deprecated
2908 public static final String AIRPLANE_MODE_RADIOS = Global.AIRPLANE_MODE_RADIOS;
2909
2910 /**
2911 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_TOGGLEABLE_RADIOS} instead
Mike Lockwoodbd5ddf02009-07-29 21:37:14 -07002912 *
2913 * {@hide}
2914 */
Christopher Tate06efb532012-08-24 15:29:27 -07002915 @Deprecated
2916 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS =
2917 Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS;
Mike Lockwoodbd5ddf02009-07-29 21:37:14 -07002918
2919 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002920 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002921 */
Christopher Tate06efb532012-08-24 15:29:27 -07002922 @Deprecated
2923 public static final String WIFI_SLEEP_POLICY = Global.WIFI_SLEEP_POLICY;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002924
2925 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002926 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_DEFAULT} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002927 */
Christopher Tate06efb532012-08-24 15:29:27 -07002928 @Deprecated
2929 public static final int WIFI_SLEEP_POLICY_DEFAULT = Global.WIFI_SLEEP_POLICY_DEFAULT;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002930
2931 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002932 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002933 */
Christopher Tate06efb532012-08-24 15:29:27 -07002934 @Deprecated
2935 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED =
2936 Global.WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002937
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002938 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002939 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002940 */
Christopher Tate06efb532012-08-24 15:29:27 -07002941 @Deprecated
2942 public static final int WIFI_SLEEP_POLICY_NEVER = Global.WIFI_SLEEP_POLICY_NEVER;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002943
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07002944 /**
2945 * @deprecated Use {@link android.provider.Settings.Global#MODE_RINGER} instead
2946 */
2947 @Deprecated
2948 public static final String MODE_RINGER = Global.MODE_RINGER;
2949
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002950 /**
2951 * Whether to use static IP and other static network attributes.
2952 * <p>
2953 * Set to 1 for true and 0 for false.
Jeff Sharkey625239a2012-09-26 22:03:49 -07002954 *
2955 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002956 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002957 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002958 public static final String WIFI_USE_STATIC_IP = "wifi_use_static_ip";
2959
Michal Karpinski2c37b082018-01-18 16:14:27 +00002960 private static final Validator WIFI_USE_STATIC_IP_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08002961
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002962 /**
2963 * The static IP address.
2964 * <p>
2965 * Example: "192.168.1.51"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002966 *
2967 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002968 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002969 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002970 public static final String WIFI_STATIC_IP = "wifi_static_ip";
2971
Michal Karpinski2c37b082018-01-18 16:14:27 +00002972 private static final Validator WIFI_STATIC_IP_VALIDATOR = LENIENT_IP_ADDRESS_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08002973
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002974 /**
2975 * If using static IP, the gateway's IP address.
2976 * <p>
2977 * Example: "192.168.1.1"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002978 *
2979 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002980 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002981 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002982 public static final String WIFI_STATIC_GATEWAY = "wifi_static_gateway";
2983
Michal Karpinski2c37b082018-01-18 16:14:27 +00002984 private static final Validator WIFI_STATIC_GATEWAY_VALIDATOR = LENIENT_IP_ADDRESS_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08002985
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002986 /**
2987 * If using static IP, the net mask.
2988 * <p>
2989 * Example: "255.255.255.0"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002990 *
2991 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002992 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002993 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002994 public static final String WIFI_STATIC_NETMASK = "wifi_static_netmask";
2995
Michal Karpinski2c37b082018-01-18 16:14:27 +00002996 private static final Validator WIFI_STATIC_NETMASK_VALIDATOR = LENIENT_IP_ADDRESS_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08002997
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002998 /**
2999 * If using static IP, the primary DNS's IP address.
3000 * <p>
3001 * Example: "192.168.1.1"
Jeff Sharkey625239a2012-09-26 22:03:49 -07003002 *
3003 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003004 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07003005 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003006 public static final String WIFI_STATIC_DNS1 = "wifi_static_dns1";
3007
Michal Karpinski2c37b082018-01-18 16:14:27 +00003008 private static final Validator WIFI_STATIC_DNS1_VALIDATOR = LENIENT_IP_ADDRESS_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003009
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003010 /**
3011 * If using static IP, the secondary DNS's IP address.
3012 * <p>
3013 * Example: "192.168.1.2"
Jeff Sharkey625239a2012-09-26 22:03:49 -07003014 *
3015 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003016 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07003017 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003018 public static final String WIFI_STATIC_DNS2 = "wifi_static_dns2";
3019
Michal Karpinski2c37b082018-01-18 16:14:27 +00003020 private static final Validator WIFI_STATIC_DNS2_VALIDATOR = LENIENT_IP_ADDRESS_VALIDATOR;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003021
3022 /**
3023 * Determines whether remote devices may discover and/or connect to
3024 * this device.
3025 * <P>Type: INT</P>
3026 * 2 -- discoverable and connectable
3027 * 1 -- connectable but not discoverable
3028 * 0 -- neither connectable nor discoverable
3029 */
3030 public static final String BLUETOOTH_DISCOVERABILITY =
3031 "bluetooth_discoverability";
3032
Svetoslav683914b2015-01-15 14:22:26 -08003033 private static final Validator BLUETOOTH_DISCOVERABILITY_VALIDATOR =
Michal Karpinski2c37b082018-01-18 16:14:27 +00003034 new SettingsValidators.InclusiveIntegerRangeValidator(0, 2);
Svetoslav683914b2015-01-15 14:22:26 -08003035
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003036 /**
3037 * Bluetooth discoverability timeout. If this value is nonzero, then
3038 * Bluetooth becomes discoverable for a certain number of seconds,
3039 * after which is becomes simply connectable. The value is in seconds.
3040 */
3041 public static final String BLUETOOTH_DISCOVERABILITY_TIMEOUT =
3042 "bluetooth_discoverability_timeout";
3043
Svetoslav683914b2015-01-15 14:22:26 -08003044 private static final Validator BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR =
Michal Karpinski2c37b082018-01-18 16:14:27 +00003045 NON_NEGATIVE_INTEGER_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003046
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003047 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08003048 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_ENABLED}
3049 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003050 */
Amith Yamasani156c4352010-03-05 17:10:03 -08003051 @Deprecated
3052 public static final String LOCK_PATTERN_ENABLED = Secure.LOCK_PATTERN_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003053
3054 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08003055 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_VISIBLE}
3056 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003057 */
Amith Yamasani156c4352010-03-05 17:10:03 -08003058 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003059 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
3060
3061 /**
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07003062 * @deprecated Use
Amith Yamasani156c4352010-03-05 17:10:03 -08003063 * {@link android.provider.Settings.Secure#LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED}
3064 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003065 */
Amith Yamasani156c4352010-03-05 17:10:03 -08003066 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003067 public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED =
3068 "lock_pattern_tactile_feedback_enabled";
3069
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003070 /**
3071 * A formatted string of the next alarm that is set, or the empty string
3072 * if there is no alarm set.
Adrian Roosc42a1e12014-07-07 23:35:53 +02003073 *
3074 * @deprecated Use {@link android.app.AlarmManager#getNextAlarmClock()}.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003075 */
Adrian Roosc42a1e12014-07-07 23:35:53 +02003076 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003077 public static final String NEXT_ALARM_FORMATTED = "next_alarm_formatted";
3078
Svetoslav683914b2015-01-15 14:22:26 -08003079 private static final Validator NEXT_ALARM_FORMATTED_VALIDATOR = new Validator() {
3080 private static final int MAX_LENGTH = 1000;
Svetoslav1b71ea92015-02-17 18:20:29 -08003081
Svetoslav683914b2015-01-15 14:22:26 -08003082 @Override
3083 public boolean validate(String value) {
3084 // TODO: No idea what the correct format is.
Svetoslav64d6e9c2015-02-12 11:30:36 -08003085 return value == null || value.length() < MAX_LENGTH;
Svetoslav683914b2015-01-15 14:22:26 -08003086 }
3087 };
3088
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003089 /**
3090 * Scaling factor for fonts, float.
3091 */
3092 public static final String FONT_SCALE = "font_scale";
3093
Svetoslav683914b2015-01-15 14:22:26 -08003094 private static final Validator FONT_SCALE_VALIDATOR = new Validator() {
3095 @Override
3096 public boolean validate(String value) {
3097 try {
3098 return Float.parseFloat(value) >= 0;
3099 } catch (NumberFormatException e) {
3100 return false;
3101 }
3102 }
3103 };
3104
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003105 /**
Seigo Nonakabd5cbdd2016-01-25 19:40:28 +09003106 * The serialized system locale value.
3107 *
3108 * Do not use this value directory.
Yohei Yukawa23cbe852016-05-17 16:42:58 -07003109 * To get system locale, use {@link LocaleList#getDefault} instead.
Seigo Nonakabd5cbdd2016-01-25 19:40:28 +09003110 * To update system locale, use {@link com.android.internal.app.LocalePicker#updateLocales}
3111 * instead.
3112 * @hide
3113 */
3114 public static final String SYSTEM_LOCALES = "system_locales";
3115
3116
3117 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003118 * Name of an application package to be debugged.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003119 *
3120 * @deprecated Use {@link Global#DEBUG_APP} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003121 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003122 @Deprecated
3123 public static final String DEBUG_APP = Global.DEBUG_APP;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003124
3125 /**
3126 * If 1, when launching DEBUG_APP it will wait for the debugger before
3127 * starting user code. If 0, it will run normally.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003128 *
3129 * @deprecated Use {@link Global#WAIT_FOR_DEBUGGER} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003130 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003131 @Deprecated
3132 public static final String WAIT_FOR_DEBUGGER = Global.WAIT_FOR_DEBUGGER;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003133
3134 /**
3135 * Whether or not to dim the screen. 0=no 1=yes
Jeff Brown96307042012-07-27 15:51:34 -07003136 * @deprecated This setting is no longer used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003137 */
Jeff Brown96307042012-07-27 15:51:34 -07003138 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003139 public static final String DIM_SCREEN = "dim_screen";
3140
Michal Karpinski2c37b082018-01-18 16:14:27 +00003141 private static final Validator DIM_SCREEN_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003142
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003143 /**
Christine Franks8ad71492017-10-24 19:04:22 -07003144 * The display color mode.
3145 * @hide
3146 */
3147 public static final String DISPLAY_COLOR_MODE = "display_color_mode";
3148
Christine Franks12699602017-10-30 18:38:48 -07003149 private static final Validator DISPLAY_COLOR_MODE_VALIDATOR =
3150 new SettingsValidators.InclusiveIntegerRangeValidator(0, 2);
3151
Christine Franks8ad71492017-10-24 19:04:22 -07003152 /**
Jeff Brown05af6ad2014-09-30 20:54:30 -07003153 * The amount of time in milliseconds before the device goes to sleep or begins
3154 * to dream after a period of inactivity. This value is also known as the
3155 * user activity timeout period since the screen isn't necessarily turned off
3156 * when it expires.
yuemingw0de748d2017-11-15 19:22:27 +00003157 *
3158 * <p>
3159 * This value is bounded by maximum timeout set by
3160 * {@link android.app.admin.DevicePolicyManager#setMaximumTimeToLock(ComponentName, long)}.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003161 */
3162 public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout";
3163
Michal Karpinski2c37b082018-01-18 16:14:27 +00003164 private static final Validator SCREEN_OFF_TIMEOUT_VALIDATOR =
3165 NON_NEGATIVE_INTEGER_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003166
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003167 /**
3168 * The screen backlight brightness between 0 and 255.
3169 */
3170 public static final String SCREEN_BRIGHTNESS = "screen_brightness";
3171
3172 /**
Santos Cordon3107d292016-09-20 15:50:35 -07003173 * The screen backlight brightness between 0 and 255.
3174 * @hide
3175 */
3176 public static final String SCREEN_BRIGHTNESS_FOR_VR = "screen_brightness_for_vr";
3177
3178 private static final Validator SCREEN_BRIGHTNESS_FOR_VR_VALIDATOR =
Michal Karpinski2c37b082018-01-18 16:14:27 +00003179 new SettingsValidators.InclusiveIntegerRangeValidator(0, 255);
Santos Cordon3107d292016-09-20 15:50:35 -07003180
3181 /**
Dan Murphy951764b2009-08-27 14:59:03 -05003182 * Control whether to enable automatic brightness mode.
Dan Murphy951764b2009-08-27 14:59:03 -05003183 */
3184 public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode";
3185
Michal Karpinski2c37b082018-01-18 16:14:27 +00003186 private static final Validator SCREEN_BRIGHTNESS_MODE_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003187
Dan Murphy951764b2009-08-27 14:59:03 -05003188 /**
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08003189 * Adjustment to auto-brightness to make it generally more (>0.0 <1.0)
3190 * or less (<0.0 >-1.0) bright.
Dianne Hackborn518a3d82012-05-09 16:30:49 -07003191 * @hide
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08003192 */
3193 public static final String SCREEN_AUTO_BRIGHTNESS_ADJ = "screen_auto_brightness_adj";
3194
Svetoslav683914b2015-01-15 14:22:26 -08003195 private static final Validator SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR =
Michal Karpinski2c37b082018-01-18 16:14:27 +00003196 new SettingsValidators.InclusiveFloatRangeValidator(-1, 1);
Svetoslav683914b2015-01-15 14:22:26 -08003197
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08003198 /**
Mike Lockwooddc3494e2009-10-14 21:17:09 -07003199 * SCREEN_BRIGHTNESS_MODE value for manual mode.
Mike Lockwooddc3494e2009-10-14 21:17:09 -07003200 */
3201 public static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0;
3202
3203 /**
Scott Main52bfc242012-02-09 10:09:14 -08003204 * SCREEN_BRIGHTNESS_MODE value for automatic mode.
Mike Lockwooddc3494e2009-10-14 21:17:09 -07003205 */
3206 public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1;
3207
3208 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003209 * Control whether the process CPU usage meter should be shown.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003210 *
Nick Kralevichfc4a5c22016-10-11 09:01:38 -07003211 * @deprecated This functionality is no longer available as of
3212 * {@link android.os.Build.VERSION_CODES#N_MR1}.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003213 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003214 @Deprecated
3215 public static final String SHOW_PROCESSES = Global.SHOW_PROCESSES;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003216
3217 /**
3218 * If 1, the activity manager will aggressively finish activities and
3219 * processes as soon as they are no longer needed. If 0, the normal
3220 * extended lifetime is used.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003221 *
3222 * @deprecated Use {@link Global#ALWAYS_FINISH_ACTIVITIES} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003223 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003224 @Deprecated
3225 public static final String ALWAYS_FINISH_ACTIVITIES = Global.ALWAYS_FINISH_ACTIVITIES;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003226
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003227 /**
Beverlyd6964762018-02-16 14:07:03 -05003228 * Determines which streams are affected by ringer and zen mode changes. The
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003229 * stream type's bit should be set to 1 if it should be muted when going
3230 * into an inaudible ringer mode.
3231 */
3232 public static final String MODE_RINGER_STREAMS_AFFECTED = "mode_ringer_streams_affected";
3233
Svetoslav683914b2015-01-15 14:22:26 -08003234 private static final Validator MODE_RINGER_STREAMS_AFFECTED_VALIDATOR =
Michal Karpinski2c37b082018-01-18 16:14:27 +00003235 NON_NEGATIVE_INTEGER_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003236
3237 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003238 * Determines which streams are affected by mute. The
3239 * stream type's bit should be set to 1 if it should be muted when a mute request
3240 * is received.
3241 */
Svetoslav683914b2015-01-15 14:22:26 -08003242 public static final String MUTE_STREAMS_AFFECTED = "mute_streams_affected";
3243
3244 private static final Validator MUTE_STREAMS_AFFECTED_VALIDATOR =
Michal Karpinski2c37b082018-01-18 16:14:27 +00003245 NON_NEGATIVE_INTEGER_VALIDATOR;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003246
3247 /**
3248 * Whether vibrate is on for different events. This is used internally,
3249 * changing this value will not change the vibrate. See AudioManager.
3250 */
3251 public static final String VIBRATE_ON = "vibrate_on";
3252
Michal Karpinski2c37b082018-01-18 16:14:27 +00003253 private static final Validator VIBRATE_ON_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003254
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003255 /**
Jeff Brown7f6c2312012-04-13 20:38:38 -07003256 * If 1, redirects the system vibrator to all currently attached input devices
3257 * that support vibration. If there are no such input devices, then the system
3258 * vibrator is used instead.
3259 * If 0, does not register the system vibrator.
3260 *
3261 * This setting is mainly intended to provide a compatibility mechanism for
3262 * applications that only know about the system vibrator and do not use the
3263 * input device vibrator API.
3264 *
3265 * @hide
3266 */
3267 public static final String VIBRATE_INPUT_DEVICES = "vibrate_input_devices";
3268
Michal Karpinski2c37b082018-01-18 16:14:27 +00003269 private static final Validator VIBRATE_INPUT_DEVICES_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003270
Jeff Brown7f6c2312012-04-13 20:38:38 -07003271 /**
Michael Wright35a0c672018-01-24 00:32:53 +00003272 * The intensity of notification vibrations, if configurable.
3273 *
3274 * Not all devices are capable of changing their vibration intensity; on these devices
3275 * there will likely be no difference between the various vibration intensities except for
3276 * intensity 0 (off) and the rest.
3277 *
3278 * <b>Values:</b><br/>
3279 * 0 - Vibration is disabled<br/>
3280 * 1 - Weak vibrations<br/>
3281 * 2 - Medium vibrations<br/>
3282 * 3 - Strong vibrations
3283 * @hide
3284 */
3285 public static final String NOTIFICATION_VIBRATION_INTENSITY =
3286 "notification_vibration_intensity";
3287
3288 /**
3289 * The intensity of haptic feedback vibrations, if configurable.
3290 *
3291 * Not all devices are capable of changing their feedback intensity; on these devices
3292 * there will likely be no difference between the various vibration intensities except for
3293 * intensity 0 (off) and the rest.
3294 *
3295 * <b>Values:</b><br/>
3296 * 0 - Vibration is disabled<br/>
3297 * 1 - Weak vibrations<br/>
3298 * 2 - Medium vibrations<br/>
3299 * 3 - Strong vibrations
3300 * @hide
3301 */
3302 public static final String HAPTIC_FEEDBACK_INTENSITY =
3303 "haptic_feedback_intensity";
3304
3305 private static final Validator VIBRATION_INTENSITY_VALIDATOR =
3306 new SettingsValidators.InclusiveIntegerRangeValidator(0, 3);
3307
3308 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003309 * Ringer volume. This is used internally, changing this value will not
3310 * change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08003311 *
3312 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003313 */
3314 public static final String VOLUME_RING = "volume_ring";
3315
3316 /**
3317 * System/notifications volume. This is used internally, changing this
3318 * value will not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08003319 *
3320 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003321 */
3322 public static final String VOLUME_SYSTEM = "volume_system";
3323
3324 /**
3325 * Voice call volume. This is used internally, changing this value will
3326 * not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08003327 *
3328 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003329 */
3330 public static final String VOLUME_VOICE = "volume_voice";
3331
3332 /**
3333 * Music/media/gaming volume. This is used internally, changing this
3334 * value will not 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_MUSIC = "volume_music";
3339
3340 /**
3341 * Alarm 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_ALARM = "volume_alarm";
3347
3348 /**
3349 * Notification volume. This is used internally, changing this
3350 * value will 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_NOTIFICATION = "volume_notification";
3355
3356 /**
Eric Laurent484d2882009-12-08 09:05:45 -08003357 * Bluetooth Headset volume. This is used internally, changing this value will
3358 * not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08003359 *
3360 * @removed Not used by anything since API 2.
Eric Laurent484d2882009-12-08 09:05:45 -08003361 */
3362 public static final String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco";
3363
3364 /**
Jean-Michel Trivia53b7052017-04-12 18:27:01 -07003365 * @hide
3366 * Acessibility volume. This is used internally, changing this
3367 * value will not change the volume.
3368 */
3369 public static final String VOLUME_ACCESSIBILITY = "volume_a11y";
3370
3371 /**
Mike Lockwood8517e462011-10-25 14:47:19 -04003372 * Master volume (float in the range 0.0f to 1.0f).
Svetoslavdbbeeb32015-02-18 19:16:25 -08003373 *
Mike Lockwood8517e462011-10-25 14:47:19 -04003374 * @hide
3375 */
3376 public static final String VOLUME_MASTER = "volume_master";
3377
3378 /**
Andy Hungf04b84d2015-12-18 17:33:27 -08003379 * Master mono (int 1 = mono, 0 = normal).
3380 *
3381 * @hide
3382 */
3383 public static final String MASTER_MONO = "master_mono";
3384
Michal Karpinski2c37b082018-01-18 16:14:27 +00003385 private static final Validator MASTER_MONO_VALIDATOR = BOOLEAN_VALIDATOR;
Andy Hungf04b84d2015-12-18 17:33:27 -08003386
3387 /**
Justin Koh57978ed2012-04-03 17:37:58 -07003388 * Whether the notifications should use the ring volume (value of 1) or
3389 * a separate notification volume (value of 0). In most cases, users
3390 * will have this enabled so the notification and ringer volumes will be
3391 * the same. However, power users can disable this and use the separate
3392 * notification volume control.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003393 * <p>
Justin Koh57978ed2012-04-03 17:37:58 -07003394 * Note: This is a one-off setting that will be removed in the future
3395 * when there is profile support. For this reason, it is kept hidden
3396 * from the public APIs.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003397 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003398 * @hide
Amith Yamasani42722bf2011-07-22 10:34:27 -07003399 * @deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003400 */
Gilles Debunnee90bed12011-08-30 14:28:27 -07003401 @Deprecated
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003402 public static final String NOTIFICATIONS_USE_RING_VOLUME =
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003403 "notifications_use_ring_volume";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003404
Michal Karpinski2c37b082018-01-18 16:14:27 +00003405 private static final Validator NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003406
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003407 /**
Daniel Sandler6329bf72010-02-26 15:17:44 -05003408 * Whether silent mode should allow vibration feedback. This is used
3409 * internally in AudioService and the Sound settings activity to
3410 * coordinate decoupling of vibrate and silent modes. This setting
3411 * will likely be removed in a future release with support for
3412 * audio/vibe feedback profiles.
3413 *
Eric Laurentbffc3d12012-05-07 17:43:49 -07003414 * Not used anymore. On devices with vibrator, the user explicitly selects
3415 * silent or vibrate mode.
3416 * Kept for use by legacy database upgrade code in DatabaseHelper.
Daniel Sandler6329bf72010-02-26 15:17:44 -05003417 * @hide
3418 */
3419 public static final String VIBRATE_IN_SILENT = "vibrate_in_silent";
3420
Michal Karpinski2c37b082018-01-18 16:14:27 +00003421 private static final Validator VIBRATE_IN_SILENT_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003422
Daniel Sandler6329bf72010-02-26 15:17:44 -05003423 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003424 * The mapping of stream type (integer) to its setting.
Svetoslavdbbeeb32015-02-18 19:16:25 -08003425 *
3426 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003427 */
3428 public static final String[] VOLUME_SETTINGS = {
3429 VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC,
Eric Laurent484d2882009-12-08 09:05:45 -08003430 VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003431 };
3432
3433 /**
Jean-Michel Trivia53b7052017-04-12 18:27:01 -07003434 * @hide
3435 * The mapping of stream type (integer) to its setting.
3436 * Unlike the VOLUME_SETTINGS array, this one contains as many entries as
3437 * AudioSystem.NUM_STREAM_TYPES, and has empty strings for stream types whose volumes
3438 * are never persisted.
3439 */
3440 public static final String[] VOLUME_SETTINGS_INT = {
3441 VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC,
3442 VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO,
3443 "" /*STREAM_SYSTEM_ENFORCED, no setting for this stream*/,
3444 "" /*STREAM_DTMF, no setting for this stream*/,
3445 "" /*STREAM_TTS, no setting for this stream*/,
3446 VOLUME_ACCESSIBILITY
3447 };
3448
3449 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003450 * Appended to various volume related settings to record the previous
3451 * values before they the settings were affected by a silent/vibrate
3452 * ringer mode change.
Svetoslavdbbeeb32015-02-18 19:16:25 -08003453 *
3454 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003455 */
3456 public static final String APPEND_FOR_LAST_AUDIBLE = "_last_audible";
3457
3458 /**
3459 * Persistent store for the system-wide default ringtone URI.
3460 * <p>
3461 * If you need to play the default ringtone at any given time, it is recommended
3462 * you give {@link #DEFAULT_RINGTONE_URI} to the media player. It will resolve
3463 * to the set default ringtone at the time of playing.
3464 *
3465 * @see #DEFAULT_RINGTONE_URI
3466 */
3467 public static final String RINGTONE = "ringtone";
3468
Michal Karpinski2c37b082018-01-18 16:14:27 +00003469 private static final Validator RINGTONE_VALIDATOR = URI_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003470
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003471 /**
3472 * A {@link Uri} that will point to the current default ringtone at any
3473 * given time.
3474 * <p>
3475 * If the current default ringtone is in the DRM provider and the caller
3476 * does not have permission, the exception will be a
3477 * FileNotFoundException.
3478 */
3479 public static final Uri DEFAULT_RINGTONE_URI = getUriFor(RINGTONE);
3480
Jeff Sharkey413573a2016-02-22 17:52:45 -07003481 /** {@hide} */
3482 public static final String RINGTONE_CACHE = "ringtone_cache";
3483 /** {@hide} */
3484 public static final Uri RINGTONE_CACHE_URI = getUriFor(RINGTONE_CACHE);
3485
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003486 /**
3487 * Persistent store for the system-wide default notification sound.
3488 *
3489 * @see #RINGTONE
3490 * @see #DEFAULT_NOTIFICATION_URI
3491 */
3492 public static final String NOTIFICATION_SOUND = "notification_sound";
3493
Michal Karpinski2c37b082018-01-18 16:14:27 +00003494 private static final Validator NOTIFICATION_SOUND_VALIDATOR = URI_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003495
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003496 /**
3497 * A {@link Uri} that will point to the current default notification
3498 * sound at any given time.
3499 *
3500 * @see #DEFAULT_RINGTONE_URI
3501 */
3502 public static final Uri DEFAULT_NOTIFICATION_URI = getUriFor(NOTIFICATION_SOUND);
3503
Jeff Sharkey413573a2016-02-22 17:52:45 -07003504 /** {@hide} */
3505 public static final String NOTIFICATION_SOUND_CACHE = "notification_sound_cache";
3506 /** {@hide} */
3507 public static final Uri NOTIFICATION_SOUND_CACHE_URI = getUriFor(NOTIFICATION_SOUND_CACHE);
3508
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003509 /**
Patrick Scott3156bb002009-04-13 09:57:38 -07003510 * Persistent store for the system-wide default alarm alert.
3511 *
3512 * @see #RINGTONE
3513 * @see #DEFAULT_ALARM_ALERT_URI
3514 */
3515 public static final String ALARM_ALERT = "alarm_alert";
3516
Michal Karpinski2c37b082018-01-18 16:14:27 +00003517 private static final Validator ALARM_ALERT_VALIDATOR = URI_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003518
Patrick Scott3156bb002009-04-13 09:57:38 -07003519 /**
3520 * A {@link Uri} that will point to the current default alarm alert at
3521 * any given time.
3522 *
3523 * @see #DEFAULT_ALARM_ALERT_URI
3524 */
3525 public static final Uri DEFAULT_ALARM_ALERT_URI = getUriFor(ALARM_ALERT);
3526
Jeff Sharkey413573a2016-02-22 17:52:45 -07003527 /** {@hide} */
3528 public static final String ALARM_ALERT_CACHE = "alarm_alert_cache";
3529 /** {@hide} */
3530 public static final Uri ALARM_ALERT_CACHE_URI = getUriFor(ALARM_ALERT_CACHE);
3531
Patrick Scott3156bb002009-04-13 09:57:38 -07003532 /**
Jean-Michel Trivid589fea2011-04-15 11:28:10 -07003533 * Persistent store for the system default media button event receiver.
3534 *
3535 * @hide
3536 */
3537 public static final String MEDIA_BUTTON_RECEIVER = "media_button_receiver";
3538
Michal Karpinski2c37b082018-01-18 16:14:27 +00003539 private static final Validator MEDIA_BUTTON_RECEIVER_VALIDATOR = COMPONENT_NAME_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003540
Jean-Michel Trivid589fea2011-04-15 11:28:10 -07003541 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003542 * Setting to enable Auto Replace (AutoText) in text editors. 1 = On, 0 = Off
3543 */
3544 public static final String TEXT_AUTO_REPLACE = "auto_replace";
3545
Michal Karpinski2c37b082018-01-18 16:14:27 +00003546 private static final Validator TEXT_AUTO_REPLACE_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003547
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003548 /**
3549 * Setting to enable Auto Caps in text editors. 1 = On, 0 = Off
3550 */
3551 public static final String TEXT_AUTO_CAPS = "auto_caps";
3552
Michal Karpinski2c37b082018-01-18 16:14:27 +00003553 private static final Validator TEXT_AUTO_CAPS_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003554
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003555 /**
3556 * Setting to enable Auto Punctuate in text editors. 1 = On, 0 = Off. This
3557 * feature converts two spaces to a "." and space.
3558 */
3559 public static final String TEXT_AUTO_PUNCTUATE = "auto_punctuate";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003560
Michal Karpinski2c37b082018-01-18 16:14:27 +00003561 private static final Validator TEXT_AUTO_PUNCTUATE_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003562
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003563 /**
3564 * Setting to showing password characters in text editors. 1 = On, 0 = Off
3565 */
3566 public static final String TEXT_SHOW_PASSWORD = "show_password";
3567
Michal Karpinski2c37b082018-01-18 16:14:27 +00003568 private static final Validator TEXT_SHOW_PASSWORD_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003569
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003570 public static final String SHOW_GTALK_SERVICE_STATUS =
3571 "SHOW_GTALK_SERVICE_STATUS";
3572
Michal Karpinski2c37b082018-01-18 16:14:27 +00003573 private static final Validator SHOW_GTALK_SERVICE_STATUS_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003574
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003575 /**
3576 * Name of activity to use for wallpaper on the home screen.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003577 *
3578 * @deprecated Use {@link WallpaperManager} instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003579 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003580 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003581 public static final String WALLPAPER_ACTIVITY = "wallpaper_activity";
3582
Svetoslav683914b2015-01-15 14:22:26 -08003583 private static final Validator WALLPAPER_ACTIVITY_VALIDATOR = new Validator() {
3584 private static final int MAX_LENGTH = 1000;
3585
3586 @Override
3587 public boolean validate(String value) {
3588 if (value != null && value.length() > MAX_LENGTH) {
3589 return false;
3590 }
3591 return ComponentName.unflattenFromString(value) != null;
3592 }
3593 };
3594
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003595 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003596 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME}
3597 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003598 */
Christopher Tate06efb532012-08-24 15:29:27 -07003599 @Deprecated
3600 public static final String AUTO_TIME = Global.AUTO_TIME;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003601
Michal Karpinski2c37b082018-01-18 16:14:27 +00003602 private static final Validator AUTO_TIME_VALIDATOR = BOOLEAN_VALIDATOR;
3603
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003604 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003605 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME_ZONE}
3606 * instead
Amith Yamasaniad450be2010-09-16 16:47:00 -07003607 */
Christopher Tate06efb532012-08-24 15:29:27 -07003608 @Deprecated
3609 public static final String AUTO_TIME_ZONE = Global.AUTO_TIME_ZONE;
Amith Yamasaniad450be2010-09-16 16:47:00 -07003610
Michal Karpinski2c37b082018-01-18 16:14:27 +00003611 private static final Validator AUTO_TIME_ZONE_VALIDATOR = BOOLEAN_VALIDATOR;
3612
Amith Yamasaniad450be2010-09-16 16:47:00 -07003613 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003614 * Display times as 12 or 24 hours
3615 * 12
3616 * 24
3617 */
3618 public static final String TIME_12_24 = "time_12_24";
3619
Svetoslav683914b2015-01-15 14:22:26 -08003620 /** @hide */
3621 public static final Validator TIME_12_24_VALIDATOR =
Michal Karpinski2c37b082018-01-18 16:14:27 +00003622 new SettingsValidators.DiscreteValueValidator(new String[] {"12", "24", null});
Svetoslav683914b2015-01-15 14:22:26 -08003623
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003624 /**
3625 * Date format string
3626 * mm/dd/yyyy
3627 * dd/mm/yyyy
3628 * yyyy/mm/dd
3629 */
3630 public static final String DATE_FORMAT = "date_format";
3631
Svetoslav683914b2015-01-15 14:22:26 -08003632 /** @hide */
3633 public static final Validator DATE_FORMAT_VALIDATOR = new Validator() {
3634 @Override
3635 public boolean validate(String value) {
3636 try {
3637 new SimpleDateFormat(value);
3638 return true;
3639 } catch (IllegalArgumentException e) {
3640 return false;
3641 }
3642 }
3643 };
3644
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003645 /**
3646 * Whether the setup wizard has been run before (on first boot), or if
3647 * it still needs to be run.
3648 *
3649 * nonzero = it has been run in the past
3650 * 0 = it has not been run in the past
3651 */
3652 public static final String SETUP_WIZARD_HAS_RUN = "setup_wizard_has_run";
3653
Svetoslav683914b2015-01-15 14:22:26 -08003654 /** @hide */
Michal Karpinski2c37b082018-01-18 16:14:27 +00003655 public static final Validator SETUP_WIZARD_HAS_RUN_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003656
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003657 /**
3658 * Scaling factor for normal window animations. Setting to 0 will disable window
3659 * animations.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003660 *
3661 * @deprecated Use {@link Global#WINDOW_ANIMATION_SCALE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003662 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003663 @Deprecated
3664 public static final String WINDOW_ANIMATION_SCALE = Global.WINDOW_ANIMATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003665
3666 /**
3667 * Scaling factor for activity transition animations. Setting to 0 will disable window
3668 * animations.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003669 *
3670 * @deprecated Use {@link Global#TRANSITION_ANIMATION_SCALE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003671 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003672 @Deprecated
3673 public static final String TRANSITION_ANIMATION_SCALE = Global.TRANSITION_ANIMATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003674
3675 /**
Chet Haasec38fa1f2012-02-01 16:37:46 -08003676 * Scaling factor for Animator-based animations. This affects both the start delay and
3677 * duration of all such animations. Setting to 0 will cause animations to end immediately.
3678 * The default value is 1.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003679 *
3680 * @deprecated Use {@link Global#ANIMATOR_DURATION_SCALE} instead
Chet Haasec38fa1f2012-02-01 16:37:46 -08003681 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003682 @Deprecated
3683 public static final String ANIMATOR_DURATION_SCALE = Global.ANIMATOR_DURATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003684
3685 /**
3686 * Control whether the accelerometer will be used to change screen
3687 * orientation. If 0, it will not be used unless explicitly requested
3688 * by the application; if 1, it will be used by default unless explicitly
3689 * disabled by the application.
3690 */
3691 public static final String ACCELEROMETER_ROTATION = "accelerometer_rotation";
3692
Svetoslav683914b2015-01-15 14:22:26 -08003693 /** @hide */
Michal Karpinski2c37b082018-01-18 16:14:27 +00003694 public static final Validator ACCELEROMETER_ROTATION_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003695
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003696 /**
Daniel Sandlerb73617d2010-08-17 00:41:00 -04003697 * Default screen rotation when no other policy applies.
3698 * When {@link #ACCELEROMETER_ROTATION} is zero and no on-screen Activity expresses a
3699 * preference, this rotation value will be used. Must be one of the
Brian Muramatsue1d46982010-12-06 17:34:20 -08003700 * {@link android.view.Surface#ROTATION_0 Surface rotation constants}.
Daniel Sandlerb73617d2010-08-17 00:41:00 -04003701 *
Dianne Hackborn16ec0802014-08-15 18:32:33 -07003702 * @see android.view.Display#getRotation
Daniel Sandlerb73617d2010-08-17 00:41:00 -04003703 */
3704 public static final String USER_ROTATION = "user_rotation";
3705
Svetoslav683914b2015-01-15 14:22:26 -08003706 /** @hide */
3707 public static final Validator USER_ROTATION_VALIDATOR =
Michal Karpinski2c37b082018-01-18 16:14:27 +00003708 new SettingsValidators.InclusiveIntegerRangeValidator(0, 3);
Svetoslav683914b2015-01-15 14:22:26 -08003709
Daniel Sandlerb73617d2010-08-17 00:41:00 -04003710 /**
Jeff Brown207673cd2012-06-05 17:47:11 -07003711 * Control whether the rotation lock toggle in the System UI should be hidden.
3712 * Typically this is done for accessibility purposes to make it harder for
3713 * the user to accidentally toggle the rotation lock while the display rotation
3714 * has been locked for accessibility.
3715 *
3716 * If 0, then rotation lock toggle is not hidden for accessibility (although it may be
3717 * unavailable for other reasons). If 1, then the rotation lock toggle is hidden.
3718 *
3719 * @hide
3720 */
3721 public static final String HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY =
3722 "hide_rotation_lock_toggle_for_accessibility";
3723
Svetoslav683914b2015-01-15 14:22:26 -08003724 /** @hide */
3725 public static final Validator HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR =
Michal Karpinski2c37b082018-01-18 16:14:27 +00003726 BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003727
Jeff Brown207673cd2012-06-05 17:47:11 -07003728 /**
Daisuke Miyakawa3c60eeb2012-05-08 12:08:25 -07003729 * Whether the phone vibrates when it is ringing due to an incoming call. This will
3730 * be used by Phone and Setting apps; it shouldn't affect other apps.
3731 * The value is boolean (1 or 0).
3732 *
3733 * Note: this is not same as "vibrate on ring", which had been available until ICS.
3734 * It was about AudioManager's setting and thus affected all the applications which
3735 * relied on the setting, while this is purely about the vibration setting for incoming
3736 * calls.
Daisuke Miyakawa3c60eeb2012-05-08 12:08:25 -07003737 */
3738 public static final String VIBRATE_WHEN_RINGING = "vibrate_when_ringing";
3739
Svetoslav683914b2015-01-15 14:22:26 -08003740 /** @hide */
Michal Karpinski2c37b082018-01-18 16:14:27 +00003741 public static final Validator VIBRATE_WHEN_RINGING_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003742
Daisuke Miyakawa3c60eeb2012-05-08 12:08:25 -07003743 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003744 * Whether the audible DTMF tones are played by the dialer when dialing. The value is
3745 * boolean (1 or 0).
3746 */
3747 public static final String DTMF_TONE_WHEN_DIALING = "dtmf_tone";
3748
Svetoslav683914b2015-01-15 14:22:26 -08003749 /** @hide */
Michal Karpinski2c37b082018-01-18 16:14:27 +00003750 public static final Validator DTMF_TONE_WHEN_DIALING_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003751
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003752 /**
David Kraused0f67152009-06-13 18:01:13 -05003753 * CDMA only settings
3754 * DTMF tone type played by the dialer when dialing.
3755 * 0 = Normal
3756 * 1 = Long
David Kraused0f67152009-06-13 18:01:13 -05003757 */
3758 public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type";
3759
Svetoslav683914b2015-01-15 14:22:26 -08003760 /** @hide */
Michal Karpinski2c37b082018-01-18 16:14:27 +00003761 public static final Validator DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003762
David Kraused0f67152009-06-13 18:01:13 -05003763 /**
David Kraused0f67152009-06-13 18:01:13 -05003764 * Whether the hearing aid is enabled. The value is
3765 * boolean (1 or 0).
3766 * @hide
3767 */
3768 public static final String HEARING_AID = "hearing_aid";
3769
Svetoslav683914b2015-01-15 14:22:26 -08003770 /** @hide */
Michal Karpinski2c37b082018-01-18 16:14:27 +00003771 public static final Validator HEARING_AID_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003772
David Kraused0f67152009-06-13 18:01:13 -05003773 /**
3774 * CDMA only settings
3775 * TTY Mode
3776 * 0 = OFF
3777 * 1 = FULL
3778 * 2 = VCO
3779 * 3 = HCO
3780 * @hide
3781 */
3782 public static final String TTY_MODE = "tty_mode";
3783
Svetoslav683914b2015-01-15 14:22:26 -08003784 /** @hide */
Michal Karpinski2c37b082018-01-18 16:14:27 +00003785 public static final Validator TTY_MODE_VALIDATOR =
3786 new SettingsValidators.InclusiveIntegerRangeValidator(0, 3);
Svetoslav683914b2015-01-15 14:22:26 -08003787
David Kraused0f67152009-06-13 18:01:13 -05003788 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003789 * Whether the sounds effects (key clicks, lid open ...) are enabled. The value is
3790 * boolean (1 or 0).
3791 */
3792 public static final String SOUND_EFFECTS_ENABLED = "sound_effects_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003793
Svetoslav683914b2015-01-15 14:22:26 -08003794 /** @hide */
Michal Karpinski2c37b082018-01-18 16:14:27 +00003795 public static final Validator SOUND_EFFECTS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003796
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003797 /**
Antony Sargent4457bb82018-03-12 16:10:56 -07003798 * Whether haptic feedback (Vibrate on tap) is enabled. The value is
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003799 * boolean (1 or 0).
3800 */
3801 public static final String HAPTIC_FEEDBACK_ENABLED = "haptic_feedback_enabled";
Sanjay Jeyakumar21bf2412009-07-09 13:31:48 -07003802
Svetoslav683914b2015-01-15 14:22:26 -08003803 /** @hide */
Michal Karpinski2c37b082018-01-18 16:14:27 +00003804 public static final Validator HAPTIC_FEEDBACK_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003805
Mike LeBeau48603e72009-06-05 00:27:00 +01003806 /**
Bjorn Bringert24abb662010-09-21 12:21:18 +01003807 * @deprecated Each application that shows web suggestions should have its own
3808 * setting for this.
Mike LeBeau48603e72009-06-05 00:27:00 +01003809 */
Bjorn Bringert24abb662010-09-21 12:21:18 +01003810 @Deprecated
Mike LeBeau48603e72009-06-05 00:27:00 +01003811 public static final String SHOW_WEB_SUGGESTIONS = "show_web_suggestions";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003812
Svetoslav683914b2015-01-15 14:22:26 -08003813 /** @hide */
Michal Karpinski2c37b082018-01-18 16:14:27 +00003814 public static final Validator SHOW_WEB_SUGGESTIONS_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003815
-b master501eec92009-07-06 13:53:11 -07003816 /**
Amith Yamasaniae3ed702009-12-01 19:02:05 -08003817 * Whether the notification LED should repeatedly flash when a notification is
3818 * pending. The value is boolean (1 or 0).
3819 * @hide
3820 */
3821 public static final String NOTIFICATION_LIGHT_PULSE = "notification_light_pulse";
3822
Svetoslav683914b2015-01-15 14:22:26 -08003823 /** @hide */
Michal Karpinski2c37b082018-01-18 16:14:27 +00003824 public static final Validator NOTIFICATION_LIGHT_PULSE_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003825
Amith Yamasaniae3ed702009-12-01 19:02:05 -08003826 /**
Dianne Hackborn90d2db32010-02-11 22:19:06 -08003827 * Show pointer location on screen?
3828 * 0 = no
3829 * 1 = yes
3830 * @hide
3831 */
3832 public static final String POINTER_LOCATION = "pointer_location";
3833
Svetoslav683914b2015-01-15 14:22:26 -08003834 /** @hide */
Michal Karpinski2c37b082018-01-18 16:14:27 +00003835 public static final Validator POINTER_LOCATION_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003836
Dianne Hackborn90d2db32010-02-11 22:19:06 -08003837 /**
Jeff Browndaf4a122011-08-26 17:14:14 -07003838 * Show touch positions on screen?
3839 * 0 = no
3840 * 1 = yes
3841 * @hide
3842 */
3843 public static final String SHOW_TOUCHES = "show_touches";
3844
Svetoslav683914b2015-01-15 14:22:26 -08003845 /** @hide */
Michal Karpinski2c37b082018-01-18 16:14:27 +00003846 public static final Validator SHOW_TOUCHES_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003847
Jeff Browndaf4a122011-08-26 17:14:14 -07003848 /**
Dianne Hackborn16ec0802014-08-15 18:32:33 -07003849 * Log raw orientation data from
Jorim Jaggib10e33f2015-02-04 21:57:40 +01003850 * {@link com.android.server.policy.WindowOrientationListener} for use with the
Jeff Brown4519f072011-01-23 13:16:01 -08003851 * orientationplot.py tool.
3852 * 0 = no
3853 * 1 = yes
3854 * @hide
3855 */
3856 public static final String WINDOW_ORIENTATION_LISTENER_LOG =
3857 "window_orientation_listener_log";
3858
Svetoslav683914b2015-01-15 14:22:26 -08003859 /** @hide */
Michal Karpinski2c37b082018-01-18 16:14:27 +00003860 public static final Validator WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003861
Jeff Brown4519f072011-01-23 13:16:01 -08003862 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003863 * @deprecated Use {@link android.provider.Settings.Global#POWER_SOUNDS_ENABLED}
3864 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003865 * @hide
3866 */
Christopher Tate06efb532012-08-24 15:29:27 -07003867 @Deprecated
3868 public static final String POWER_SOUNDS_ENABLED = Global.POWER_SOUNDS_ENABLED;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003869
Michal Karpinski2c37b082018-01-18 16:14:27 +00003870 private static final Validator POWER_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
3871
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003872 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003873 * @deprecated Use {@link android.provider.Settings.Global#DOCK_SOUNDS_ENABLED}
3874 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003875 * @hide
3876 */
Christopher Tate06efb532012-08-24 15:29:27 -07003877 @Deprecated
3878 public static final String DOCK_SOUNDS_ENABLED = Global.DOCK_SOUNDS_ENABLED;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003879
Michal Karpinski2c37b082018-01-18 16:14:27 +00003880 private static final Validator DOCK_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
3881
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003882 /**
3883 * Whether to play sounds when the keyguard is shown and dismissed.
3884 * @hide
3885 */
3886 public static final String LOCKSCREEN_SOUNDS_ENABLED = "lockscreen_sounds_enabled";
3887
Svetoslav683914b2015-01-15 14:22:26 -08003888 /** @hide */
Michal Karpinski2c37b082018-01-18 16:14:27 +00003889 public static final Validator LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003890
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003891 /**
Mike Lockwood7bef7392011-10-20 16:51:53 -04003892 * Whether the lockscreen should be completely disabled.
3893 * @hide
3894 */
3895 public static final String LOCKSCREEN_DISABLED = "lockscreen.disabled";
3896
Svetoslav683914b2015-01-15 14:22:26 -08003897 /** @hide */
Michal Karpinski2c37b082018-01-18 16:14:27 +00003898 public static final Validator LOCKSCREEN_DISABLED_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003899
Mike Lockwood7bef7392011-10-20 16:51:53 -04003900 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003901 * @deprecated Use {@link android.provider.Settings.Global#LOW_BATTERY_SOUND}
3902 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003903 * @hide
3904 */
Christopher Tate06efb532012-08-24 15:29:27 -07003905 @Deprecated
3906 public static final String LOW_BATTERY_SOUND = Global.LOW_BATTERY_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003907
3908 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003909 * @deprecated Use {@link android.provider.Settings.Global#DESK_DOCK_SOUND}
3910 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003911 * @hide
3912 */
Christopher Tate06efb532012-08-24 15:29:27 -07003913 @Deprecated
3914 public static final String DESK_DOCK_SOUND = Global.DESK_DOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003915
3916 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003917 * @deprecated Use {@link android.provider.Settings.Global#DESK_UNDOCK_SOUND}
3918 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003919 * @hide
3920 */
Christopher Tate06efb532012-08-24 15:29:27 -07003921 @Deprecated
3922 public static final String DESK_UNDOCK_SOUND = Global.DESK_UNDOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003923
3924 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003925 * @deprecated Use {@link android.provider.Settings.Global#CAR_DOCK_SOUND}
3926 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003927 * @hide
3928 */
Christopher Tate06efb532012-08-24 15:29:27 -07003929 @Deprecated
3930 public static final String CAR_DOCK_SOUND = Global.CAR_DOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003931
3932 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003933 * @deprecated Use {@link android.provider.Settings.Global#CAR_UNDOCK_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 CAR_UNDOCK_SOUND = Global.CAR_UNDOCK_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#LOCK_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 LOCK_SOUND = Global.LOCK_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#UNLOCK_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 UNLOCK_SOUND = Global.UNLOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05003955
3956 /**
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003957 * Receive incoming SIP calls?
3958 * 0 = no
3959 * 1 = yes
3960 * @hide
3961 */
3962 public static final String SIP_RECEIVE_CALLS = "sip_receive_calls";
3963
Svetoslav683914b2015-01-15 14:22:26 -08003964 /** @hide */
Michal Karpinski2c37b082018-01-18 16:14:27 +00003965 public static final Validator SIP_RECEIVE_CALLS_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003966
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003967 /**
3968 * Call Preference String.
3969 * "SIP_ALWAYS" : Always use SIP with network access
3970 * "SIP_ADDRESS_ONLY" : Only if destination is a SIP address
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003971 * @hide
3972 */
3973 public static final String SIP_CALL_OPTIONS = "sip_call_options";
3974
Svetoslav683914b2015-01-15 14:22:26 -08003975 /** @hide */
Michal Karpinski2c37b082018-01-18 16:14:27 +00003976 public static final Validator SIP_CALL_OPTIONS_VALIDATOR =
3977 new SettingsValidators.DiscreteValueValidator(
3978 new String[] {"SIP_ALWAYS", "SIP_ADDRESS_ONLY"});
Svetoslav683914b2015-01-15 14:22:26 -08003979
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003980 /**
3981 * One of the sip call options: Always use SIP with network access.
3982 * @hide
3983 */
3984 public static final String SIP_ALWAYS = "SIP_ALWAYS";
3985
Svetoslav683914b2015-01-15 14:22:26 -08003986 /** @hide */
Michal Karpinski2c37b082018-01-18 16:14:27 +00003987 public static final Validator SIP_ALWAYS_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003988
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003989 /**
3990 * One of the sip call options: Only if destination is a SIP address.
3991 * @hide
3992 */
3993 public static final String SIP_ADDRESS_ONLY = "SIP_ADDRESS_ONLY";
3994
Svetoslav683914b2015-01-15 14:22:26 -08003995 /** @hide */
Michal Karpinski2c37b082018-01-18 16:14:27 +00003996 public static final Validator SIP_ADDRESS_ONLY_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08003997
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003998 /**
Tyler Gunn2c830a22014-09-02 08:39:35 -07003999 * @deprecated Use SIP_ALWAYS or SIP_ADDRESS_ONLY instead. Formerly used to indicate that
4000 * the user should be prompted each time a call is made whether it should be placed using
4001 * SIP. The {@link com.android.providers.settings.DatabaseHelper} replaces this with
4002 * SIP_ADDRESS_ONLY.
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08004003 * @hide
4004 */
Tyler Gunn2c830a22014-09-02 08:39:35 -07004005 @Deprecated
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08004006 public static final String SIP_ASK_ME_EACH_TIME = "SIP_ASK_ME_EACH_TIME";
4007
Svetoslav683914b2015-01-15 14:22:26 -08004008 /** @hide */
Michal Karpinski2c37b082018-01-18 16:14:27 +00004009 public static final Validator SIP_ASK_ME_EACH_TIME_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08004010
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08004011 /**
Jeff Brown1a84fd12011-06-02 01:26:32 -07004012 * Pointer speed setting.
4013 * This is an integer value in a range between -7 and +7, so there are 15 possible values.
4014 * -7 = slowest
4015 * 0 = default speed
4016 * +7 = fastest
4017 * @hide
4018 */
4019 public static final String POINTER_SPEED = "pointer_speed";
4020
Svetoslav683914b2015-01-15 14:22:26 -08004021 /** @hide */
4022 public static final Validator POINTER_SPEED_VALIDATOR =
Michal Karpinski2c37b082018-01-18 16:14:27 +00004023 new SettingsValidators.InclusiveFloatRangeValidator(-7, 7);
Svetoslav683914b2015-01-15 14:22:26 -08004024
Jeff Brown1a84fd12011-06-02 01:26:32 -07004025 /**
Jason Monk56e09b42014-07-18 10:29:14 -04004026 * Whether lock-to-app will be triggered by long-press on recents.
4027 * @hide
4028 */
4029 public static final String LOCK_TO_APP_ENABLED = "lock_to_app_enabled";
4030
Svetoslav683914b2015-01-15 14:22:26 -08004031 /** @hide */
Michal Karpinski2c37b082018-01-18 16:14:27 +00004032 public static final Validator LOCK_TO_APP_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
Svetoslav683914b2015-01-15 14:22:26 -08004033
Jason Monk56e09b42014-07-18 10:29:14 -04004034 /**
Daniel Sandler2fdb68b2013-10-03 00:12:11 -04004035 * I am the lolrus.
4036 * <p>
4037 * Nonzero values indicate that the user has a bukkit.
4038 * Backward-compatible with <code>PrefGetPreference(prefAllowEasterEggs)</code>.
4039 * @hide
4040 */
4041 public static final String EGG_MODE = "egg_mode";
4042
Svetoslav683914b2015-01-15 14:22:26 -08004043 /** @hide */
Svet Ganovb1918a02015-05-15 09:32:55 -07004044 public static final Validator EGG_MODE_VALIDATOR = new Validator() {
4045 @Override
4046 public boolean validate(String value) {
4047 try {
4048 return Long.parseLong(value) >= 0;
4049 } catch (NumberFormatException e) {
4050 return false;
4051 }
4052 }
4053 };
Svetoslav683914b2015-01-15 14:22:26 -08004054
4055 /**
Evan Lairdbcf631d2017-03-10 10:56:45 -05004056 * Setting to determine whether or not to show the battery percentage in the status bar.
4057 * 0 - Don't show percentage
4058 * 1 - Show percentage
4059 * @hide
4060 */
4061 public static final String SHOW_BATTERY_PERCENT = "status_bar_show_battery_percent";
4062
4063 /** @hide */
Michal Karpinski2c37b082018-01-18 16:14:27 +00004064 private static final Validator SHOW_BATTERY_PERCENT_VALIDATOR = BOOLEAN_VALIDATOR;
Evan Lairdbcf631d2017-03-10 10:56:45 -05004065
4066 /**
Svetoslav683914b2015-01-15 14:22:26 -08004067 * IMPORTANT: If you add a new public settings you also have to add it to
4068 * PUBLIC_SETTINGS below. If the new setting is hidden you have to add
4069 * it to PRIVATE_SETTINGS below. Also add a validator that can validate
4070 * the setting value. See an example above.
4071 */
4072
Daniel Sandler2fdb68b2013-10-03 00:12:11 -04004073 /**
-b master501eec92009-07-06 13:53:11 -07004074 * Settings to backup. This is here so that it's in the same place as the settings
4075 * keys and easy to update.
Svetoslav Ganova571a582011-09-20 18:32:20 -07004076 *
4077 * NOTE: Settings are backed up and restored in the order they appear
4078 * in this array. If you have one setting depending on another,
4079 * make sure that they are ordered appropriately.
4080 *
-b master501eec92009-07-06 13:53:11 -07004081 * @hide
4082 */
4083 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate66488d62012-10-02 11:58:01 -07004084 STAY_ON_WHILE_PLUGGED_IN, // moved to global
-b master501eec92009-07-06 13:53:11 -07004085 WIFI_USE_STATIC_IP,
4086 WIFI_STATIC_IP,
4087 WIFI_STATIC_GATEWAY,
4088 WIFI_STATIC_NETMASK,
4089 WIFI_STATIC_DNS1,
4090 WIFI_STATIC_DNS2,
4091 BLUETOOTH_DISCOVERABILITY,
4092 BLUETOOTH_DISCOVERABILITY_TIMEOUT,
Casey Burkhardt86b867f2015-12-29 18:03:36 -08004093 FONT_SCALE,
-b master501eec92009-07-06 13:53:11 -07004094 DIM_SCREEN,
4095 SCREEN_OFF_TIMEOUT,
Christopher Tate362aca62009-09-25 15:58:03 -07004096 SCREEN_BRIGHTNESS_MODE,
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08004097 SCREEN_AUTO_BRIGHTNESS_ADJ,
Santos Cordonbd9dd552017-02-13 13:37:45 -08004098 SCREEN_BRIGHTNESS_FOR_VR,
Jeff Brown7f6c2312012-04-13 20:38:38 -07004099 VIBRATE_INPUT_DEVICES,
Amith Yamasani8823c0a82009-07-07 14:30:17 -07004100 MODE_RINGER_STREAMS_AFFECTED,
-b master501eec92009-07-06 13:53:11 -07004101 TEXT_AUTO_REPLACE,
4102 TEXT_AUTO_CAPS,
4103 TEXT_AUTO_PUNCTUATE,
4104 TEXT_SHOW_PASSWORD,
Christopher Tate66488d62012-10-02 11:58:01 -07004105 AUTO_TIME, // moved to global
4106 AUTO_TIME_ZONE, // moved to global
-b master501eec92009-07-06 13:53:11 -07004107 TIME_12_24,
4108 DATE_FORMAT,
-b master501eec92009-07-06 13:53:11 -07004109 DTMF_TONE_WHEN_DIALING,
4110 DTMF_TONE_TYPE_WHEN_DIALING,
-b master501eec92009-07-06 13:53:11 -07004111 HEARING_AID,
4112 TTY_MODE,
Christopher Tateea2d6e82016-05-19 16:55:49 -07004113 MASTER_MONO,
-b master501eec92009-07-06 13:53:11 -07004114 SOUND_EFFECTS_ENABLED,
4115 HAPTIC_FEEDBACK_ENABLED,
Christopher Tate66488d62012-10-02 11:58:01 -07004116 POWER_SOUNDS_ENABLED, // moved to global
4117 DOCK_SOUNDS_ENABLED, // moved to global
Christopher Tate14c2d792010-02-25 16:49:44 -08004118 LOCKSCREEN_SOUNDS_ENABLED,
Amith Yamasaniae3ed702009-12-01 19:02:05 -08004119 SHOW_WEB_SUGGESTIONS,
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08004120 SIP_CALL_OPTIONS,
Nick Pelly038cabe2010-09-23 16:12:11 -07004121 SIP_RECEIVE_CALLS,
Jeff Brown1a84fd12011-06-02 01:26:32 -07004122 POINTER_SPEED,
Amith Yamasani622bf2222013-09-06 13:54:28 -07004123 VIBRATE_WHEN_RINGING,
4124 RINGTONE,
Jason Monk94cfd9d2014-10-31 13:18:21 -04004125 LOCK_TO_APP_ENABLED,
Anna Galuszafa7786c2015-12-22 10:53:44 -08004126 NOTIFICATION_SOUND,
Evan Lairdbcf631d2017-03-10 10:56:45 -05004127 ACCELEROMETER_ROTATION,
Michael Wright35a0c672018-01-24 00:32:53 +00004128 SHOW_BATTERY_PERCENT,
4129 NOTIFICATION_VIBRATION_INTENSITY,
4130 HAPTIC_FEEDBACK_INTENSITY,
Christine Franks12699602017-10-30 18:38:48 -07004131 DISPLAY_COLOR_MODE
-b master501eec92009-07-06 13:53:11 -07004132 };
4133
Sailesh Nepal1bd78762014-02-11 22:32:21 -08004134 /**
Christopher Tate1d0fca32017-06-06 13:30:00 -07004135 * Keys we no longer back up under the current schema, but want to continue to
4136 * process when restoring historical backup datasets.
4137 *
Michal Karpinski964943a2018-01-19 16:28:26 +00004138 * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator,
4139 * otherwise they won't be restored.
4140 *
Christopher Tate1d0fca32017-06-06 13:30:00 -07004141 * @hide
4142 */
4143 public static final String[] LEGACY_RESTORE_SETTINGS = {
4144 };
4145
4146 /**
Amith Yamasanib0ff3222015-03-04 09:56:14 -08004147 * These are all public system settings
Svetoslav683914b2015-01-15 14:22:26 -08004148 *
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07004149 * @hide
4150 */
Svetoslav683914b2015-01-15 14:22:26 -08004151 public static final Set<String> PUBLIC_SETTINGS = new ArraySet<>();
4152 static {
4153 PUBLIC_SETTINGS.add(END_BUTTON_BEHAVIOR);
4154 PUBLIC_SETTINGS.add(WIFI_USE_STATIC_IP);
4155 PUBLIC_SETTINGS.add(WIFI_STATIC_IP);
4156 PUBLIC_SETTINGS.add(WIFI_STATIC_GATEWAY);
4157 PUBLIC_SETTINGS.add(WIFI_STATIC_NETMASK);
4158 PUBLIC_SETTINGS.add(WIFI_STATIC_DNS1);
4159 PUBLIC_SETTINGS.add(WIFI_STATIC_DNS2);
4160 PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY);
4161 PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY_TIMEOUT);
4162 PUBLIC_SETTINGS.add(NEXT_ALARM_FORMATTED);
4163 PUBLIC_SETTINGS.add(FONT_SCALE);
4164 PUBLIC_SETTINGS.add(DIM_SCREEN);
4165 PUBLIC_SETTINGS.add(SCREEN_OFF_TIMEOUT);
4166 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS);
4167 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_MODE);
4168 PUBLIC_SETTINGS.add(MODE_RINGER_STREAMS_AFFECTED);
4169 PUBLIC_SETTINGS.add(MUTE_STREAMS_AFFECTED);
4170 PUBLIC_SETTINGS.add(VIBRATE_ON);
4171 PUBLIC_SETTINGS.add(VOLUME_RING);
4172 PUBLIC_SETTINGS.add(VOLUME_SYSTEM);
4173 PUBLIC_SETTINGS.add(VOLUME_VOICE);
4174 PUBLIC_SETTINGS.add(VOLUME_MUSIC);
4175 PUBLIC_SETTINGS.add(VOLUME_ALARM);
4176 PUBLIC_SETTINGS.add(VOLUME_NOTIFICATION);
4177 PUBLIC_SETTINGS.add(VOLUME_BLUETOOTH_SCO);
4178 PUBLIC_SETTINGS.add(RINGTONE);
4179 PUBLIC_SETTINGS.add(NOTIFICATION_SOUND);
4180 PUBLIC_SETTINGS.add(ALARM_ALERT);
4181 PUBLIC_SETTINGS.add(TEXT_AUTO_REPLACE);
4182 PUBLIC_SETTINGS.add(TEXT_AUTO_CAPS);
4183 PUBLIC_SETTINGS.add(TEXT_AUTO_PUNCTUATE);
4184 PUBLIC_SETTINGS.add(TEXT_SHOW_PASSWORD);
4185 PUBLIC_SETTINGS.add(SHOW_GTALK_SERVICE_STATUS);
4186 PUBLIC_SETTINGS.add(WALLPAPER_ACTIVITY);
4187 PUBLIC_SETTINGS.add(TIME_12_24);
4188 PUBLIC_SETTINGS.add(DATE_FORMAT);
4189 PUBLIC_SETTINGS.add(SETUP_WIZARD_HAS_RUN);
4190 PUBLIC_SETTINGS.add(ACCELEROMETER_ROTATION);
4191 PUBLIC_SETTINGS.add(USER_ROTATION);
4192 PUBLIC_SETTINGS.add(DTMF_TONE_WHEN_DIALING);
4193 PUBLIC_SETTINGS.add(SOUND_EFFECTS_ENABLED);
4194 PUBLIC_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED);
4195 PUBLIC_SETTINGS.add(SHOW_WEB_SUGGESTIONS);
Svetoslav Ganovd2631632015-12-09 16:29:22 -08004196 PUBLIC_SETTINGS.add(VIBRATE_WHEN_RINGING);
Svetoslav683914b2015-01-15 14:22:26 -08004197 }
4198
4199 /**
4200 * These are all hidden system settings.
4201 *
4202 * @hide
4203 */
4204 public static final Set<String> PRIVATE_SETTINGS = new ArraySet<>();
4205 static {
4206 PRIVATE_SETTINGS.add(WIFI_USE_STATIC_IP);
4207 PRIVATE_SETTINGS.add(END_BUTTON_BEHAVIOR);
4208 PRIVATE_SETTINGS.add(ADVANCED_SETTINGS);
4209 PRIVATE_SETTINGS.add(SCREEN_AUTO_BRIGHTNESS_ADJ);
4210 PRIVATE_SETTINGS.add(VIBRATE_INPUT_DEVICES);
4211 PRIVATE_SETTINGS.add(VOLUME_MASTER);
Andy Hungf04b84d2015-12-18 17:33:27 -08004212 PRIVATE_SETTINGS.add(MASTER_MONO);
Svetoslav683914b2015-01-15 14:22:26 -08004213 PRIVATE_SETTINGS.add(NOTIFICATIONS_USE_RING_VOLUME);
4214 PRIVATE_SETTINGS.add(VIBRATE_IN_SILENT);
4215 PRIVATE_SETTINGS.add(MEDIA_BUTTON_RECEIVER);
4216 PRIVATE_SETTINGS.add(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY);
Svetoslav683914b2015-01-15 14:22:26 -08004217 PRIVATE_SETTINGS.add(DTMF_TONE_TYPE_WHEN_DIALING);
4218 PRIVATE_SETTINGS.add(HEARING_AID);
4219 PRIVATE_SETTINGS.add(TTY_MODE);
4220 PRIVATE_SETTINGS.add(NOTIFICATION_LIGHT_PULSE);
4221 PRIVATE_SETTINGS.add(POINTER_LOCATION);
4222 PRIVATE_SETTINGS.add(SHOW_TOUCHES);
4223 PRIVATE_SETTINGS.add(WINDOW_ORIENTATION_LISTENER_LOG);
4224 PRIVATE_SETTINGS.add(POWER_SOUNDS_ENABLED);
4225 PRIVATE_SETTINGS.add(DOCK_SOUNDS_ENABLED);
4226 PRIVATE_SETTINGS.add(LOCKSCREEN_SOUNDS_ENABLED);
4227 PRIVATE_SETTINGS.add(LOCKSCREEN_DISABLED);
4228 PRIVATE_SETTINGS.add(LOW_BATTERY_SOUND);
4229 PRIVATE_SETTINGS.add(DESK_DOCK_SOUND);
4230 PRIVATE_SETTINGS.add(DESK_UNDOCK_SOUND);
4231 PRIVATE_SETTINGS.add(CAR_DOCK_SOUND);
4232 PRIVATE_SETTINGS.add(CAR_UNDOCK_SOUND);
4233 PRIVATE_SETTINGS.add(LOCK_SOUND);
4234 PRIVATE_SETTINGS.add(UNLOCK_SOUND);
4235 PRIVATE_SETTINGS.add(SIP_RECEIVE_CALLS);
4236 PRIVATE_SETTINGS.add(SIP_CALL_OPTIONS);
4237 PRIVATE_SETTINGS.add(SIP_ALWAYS);
4238 PRIVATE_SETTINGS.add(SIP_ADDRESS_ONLY);
4239 PRIVATE_SETTINGS.add(SIP_ASK_ME_EACH_TIME);
4240 PRIVATE_SETTINGS.add(POINTER_SPEED);
4241 PRIVATE_SETTINGS.add(LOCK_TO_APP_ENABLED);
4242 PRIVATE_SETTINGS.add(EGG_MODE);
Evan Lairdbcf631d2017-03-10 10:56:45 -05004243 PRIVATE_SETTINGS.add(SHOW_BATTERY_PERCENT);
Christine Franks12699602017-10-30 18:38:48 -07004244 PRIVATE_SETTINGS.add(DISPLAY_COLOR_MODE);
Svetoslav683914b2015-01-15 14:22:26 -08004245 }
4246
4247 /**
Amith Yamasanib0ff3222015-03-04 09:56:14 -08004248 * These are all public system settings
Svetoslav683914b2015-01-15 14:22:26 -08004249 *
Michal Karpinski964943a2018-01-19 16:28:26 +00004250 * All settings in {@link SETTINGS_TO_BACKUP} array *must* have a non-null validator,
4251 * otherwise they won't be restored.
4252 *
Svetoslav683914b2015-01-15 14:22:26 -08004253 * @hide
4254 */
4255 public static final Map<String, Validator> VALIDATORS = new ArrayMap<>();
4256 static {
Michal Karpinski2c37b082018-01-18 16:14:27 +00004257 VALIDATORS.put(STAY_ON_WHILE_PLUGGED_IN, STAY_ON_WHILE_PLUGGED_IN_VALIDATOR);
4258 VALIDATORS.put(END_BUTTON_BEHAVIOR, END_BUTTON_BEHAVIOR_VALIDATOR);
Svetoslav683914b2015-01-15 14:22:26 -08004259 VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR);
4260 VALIDATORS.put(BLUETOOTH_DISCOVERABILITY, BLUETOOTH_DISCOVERABILITY_VALIDATOR);
4261 VALIDATORS.put(BLUETOOTH_DISCOVERABILITY_TIMEOUT,
4262 BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR);
4263 VALIDATORS.put(NEXT_ALARM_FORMATTED, NEXT_ALARM_FORMATTED_VALIDATOR);
4264 VALIDATORS.put(FONT_SCALE, FONT_SCALE_VALIDATOR);
4265 VALIDATORS.put(DIM_SCREEN, DIM_SCREEN_VALIDATOR);
Christine Franks12699602017-10-30 18:38:48 -07004266 VALIDATORS.put(DISPLAY_COLOR_MODE, DISPLAY_COLOR_MODE_VALIDATOR);
Svetoslav683914b2015-01-15 14:22:26 -08004267 VALIDATORS.put(SCREEN_OFF_TIMEOUT, SCREEN_OFF_TIMEOUT_VALIDATOR);
Santos Cordon3107d292016-09-20 15:50:35 -07004268 VALIDATORS.put(SCREEN_BRIGHTNESS_FOR_VR, SCREEN_BRIGHTNESS_FOR_VR_VALIDATOR);
Svetoslav683914b2015-01-15 14:22:26 -08004269 VALIDATORS.put(SCREEN_BRIGHTNESS_MODE, SCREEN_BRIGHTNESS_MODE_VALIDATOR);
4270 VALIDATORS.put(MODE_RINGER_STREAMS_AFFECTED, MODE_RINGER_STREAMS_AFFECTED_VALIDATOR);
4271 VALIDATORS.put(MUTE_STREAMS_AFFECTED, MUTE_STREAMS_AFFECTED_VALIDATOR);
4272 VALIDATORS.put(VIBRATE_ON, VIBRATE_ON_VALIDATOR);
Michael Wright35a0c672018-01-24 00:32:53 +00004273 VALIDATORS.put(NOTIFICATION_VIBRATION_INTENSITY, VIBRATION_INTENSITY_VALIDATOR);
4274 VALIDATORS.put(HAPTIC_FEEDBACK_INTENSITY, VIBRATION_INTENSITY_VALIDATOR);
Svetoslav683914b2015-01-15 14:22:26 -08004275 VALIDATORS.put(RINGTONE, RINGTONE_VALIDATOR);
4276 VALIDATORS.put(NOTIFICATION_SOUND, NOTIFICATION_SOUND_VALIDATOR);
4277 VALIDATORS.put(ALARM_ALERT, ALARM_ALERT_VALIDATOR);
4278 VALIDATORS.put(TEXT_AUTO_REPLACE, TEXT_AUTO_REPLACE_VALIDATOR);
4279 VALIDATORS.put(TEXT_AUTO_CAPS, TEXT_AUTO_CAPS_VALIDATOR);
4280 VALIDATORS.put(TEXT_AUTO_PUNCTUATE, TEXT_AUTO_PUNCTUATE_VALIDATOR);
4281 VALIDATORS.put(TEXT_SHOW_PASSWORD, TEXT_SHOW_PASSWORD_VALIDATOR);
Michal Karpinski2c37b082018-01-18 16:14:27 +00004282 VALIDATORS.put(AUTO_TIME, AUTO_TIME_VALIDATOR);
4283 VALIDATORS.put(AUTO_TIME_ZONE, AUTO_TIME_ZONE_VALIDATOR);
Svetoslav683914b2015-01-15 14:22:26 -08004284 VALIDATORS.put(SHOW_GTALK_SERVICE_STATUS, SHOW_GTALK_SERVICE_STATUS_VALIDATOR);
4285 VALIDATORS.put(WALLPAPER_ACTIVITY, WALLPAPER_ACTIVITY_VALIDATOR);
4286 VALIDATORS.put(TIME_12_24, TIME_12_24_VALIDATOR);
4287 VALIDATORS.put(DATE_FORMAT, DATE_FORMAT_VALIDATOR);
4288 VALIDATORS.put(SETUP_WIZARD_HAS_RUN, SETUP_WIZARD_HAS_RUN_VALIDATOR);
4289 VALIDATORS.put(ACCELEROMETER_ROTATION, ACCELEROMETER_ROTATION_VALIDATOR);
4290 VALIDATORS.put(USER_ROTATION, USER_ROTATION_VALIDATOR);
4291 VALIDATORS.put(DTMF_TONE_WHEN_DIALING, DTMF_TONE_WHEN_DIALING_VALIDATOR);
4292 VALIDATORS.put(SOUND_EFFECTS_ENABLED, SOUND_EFFECTS_ENABLED_VALIDATOR);
4293 VALIDATORS.put(HAPTIC_FEEDBACK_ENABLED, HAPTIC_FEEDBACK_ENABLED_VALIDATOR);
Michal Karpinski2c37b082018-01-18 16:14:27 +00004294 VALIDATORS.put(POWER_SOUNDS_ENABLED, POWER_SOUNDS_ENABLED_VALIDATOR);
4295 VALIDATORS.put(DOCK_SOUNDS_ENABLED, DOCK_SOUNDS_ENABLED_VALIDATOR);
Svetoslav683914b2015-01-15 14:22:26 -08004296 VALIDATORS.put(SHOW_WEB_SUGGESTIONS, SHOW_WEB_SUGGESTIONS_VALIDATOR);
4297 VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR);
4298 VALIDATORS.put(END_BUTTON_BEHAVIOR, END_BUTTON_BEHAVIOR_VALIDATOR);
4299 VALIDATORS.put(ADVANCED_SETTINGS, ADVANCED_SETTINGS_VALIDATOR);
4300 VALIDATORS.put(SCREEN_AUTO_BRIGHTNESS_ADJ, SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR);
4301 VALIDATORS.put(VIBRATE_INPUT_DEVICES, VIBRATE_INPUT_DEVICES_VALIDATOR);
Andy Hungf04b84d2015-12-18 17:33:27 -08004302 VALIDATORS.put(MASTER_MONO, MASTER_MONO_VALIDATOR);
Svetoslav683914b2015-01-15 14:22:26 -08004303 VALIDATORS.put(NOTIFICATIONS_USE_RING_VOLUME, NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR);
4304 VALIDATORS.put(VIBRATE_IN_SILENT, VIBRATE_IN_SILENT_VALIDATOR);
4305 VALIDATORS.put(MEDIA_BUTTON_RECEIVER, MEDIA_BUTTON_RECEIVER_VALIDATOR);
4306 VALIDATORS.put(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY,
4307 HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR);
4308 VALIDATORS.put(VIBRATE_WHEN_RINGING, VIBRATE_WHEN_RINGING_VALIDATOR);
4309 VALIDATORS.put(DTMF_TONE_TYPE_WHEN_DIALING, DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR);
4310 VALIDATORS.put(HEARING_AID, HEARING_AID_VALIDATOR);
4311 VALIDATORS.put(TTY_MODE, TTY_MODE_VALIDATOR);
4312 VALIDATORS.put(NOTIFICATION_LIGHT_PULSE, NOTIFICATION_LIGHT_PULSE_VALIDATOR);
4313 VALIDATORS.put(POINTER_LOCATION, POINTER_LOCATION_VALIDATOR);
4314 VALIDATORS.put(SHOW_TOUCHES, SHOW_TOUCHES_VALIDATOR);
4315 VALIDATORS.put(WINDOW_ORIENTATION_LISTENER_LOG,
4316 WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR);
4317 VALIDATORS.put(LOCKSCREEN_SOUNDS_ENABLED, LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR);
4318 VALIDATORS.put(LOCKSCREEN_DISABLED, LOCKSCREEN_DISABLED_VALIDATOR);
4319 VALIDATORS.put(SIP_RECEIVE_CALLS, SIP_RECEIVE_CALLS_VALIDATOR);
4320 VALIDATORS.put(SIP_CALL_OPTIONS, SIP_CALL_OPTIONS_VALIDATOR);
4321 VALIDATORS.put(SIP_ALWAYS, SIP_ALWAYS_VALIDATOR);
4322 VALIDATORS.put(SIP_ADDRESS_ONLY, SIP_ADDRESS_ONLY_VALIDATOR);
4323 VALIDATORS.put(SIP_ASK_ME_EACH_TIME, SIP_ASK_ME_EACH_TIME_VALIDATOR);
4324 VALIDATORS.put(POINTER_SPEED, POINTER_SPEED_VALIDATOR);
4325 VALIDATORS.put(LOCK_TO_APP_ENABLED, LOCK_TO_APP_ENABLED_VALIDATOR);
4326 VALIDATORS.put(EGG_MODE, EGG_MODE_VALIDATOR);
4327 VALIDATORS.put(WIFI_STATIC_IP, WIFI_STATIC_IP_VALIDATOR);
4328 VALIDATORS.put(WIFI_STATIC_GATEWAY, WIFI_STATIC_GATEWAY_VALIDATOR);
4329 VALIDATORS.put(WIFI_STATIC_NETMASK, WIFI_STATIC_NETMASK_VALIDATOR);
4330 VALIDATORS.put(WIFI_STATIC_DNS1, WIFI_STATIC_DNS1_VALIDATOR);
4331 VALIDATORS.put(WIFI_STATIC_DNS2, WIFI_STATIC_DNS2_VALIDATOR);
Evan Lairdbcf631d2017-03-10 10:56:45 -05004332 VALIDATORS.put(SHOW_BATTERY_PERCENT, SHOW_BATTERY_PERCENT_VALIDATOR);
Svetoslav683914b2015-01-15 14:22:26 -08004333 }
4334
4335 /**
4336 * These entries are considered common between the personal and the managed profile,
4337 * since the managed profile doesn't get to change them.
4338 */
4339 private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>();
4340 static {
4341 CLONE_TO_MANAGED_PROFILE.add(DATE_FORMAT);
4342 CLONE_TO_MANAGED_PROFILE.add(HAPTIC_FEEDBACK_ENABLED);
4343 CLONE_TO_MANAGED_PROFILE.add(SOUND_EFFECTS_ENABLED);
4344 CLONE_TO_MANAGED_PROFILE.add(TEXT_SHOW_PASSWORD);
4345 CLONE_TO_MANAGED_PROFILE.add(TIME_12_24);
4346 }
4347
4348 /** @hide */
4349 public static void getCloneToManagedProfileSettings(Set<String> outKeySet) {
4350 outKeySet.addAll(CLONE_TO_MANAGED_PROFILE);
4351 }
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07004352
4353 /**
Andre Lago3fa139c2016-08-04 13:53:44 +01004354 * These entries should be cloned from this profile's parent only if the dependency's
4355 * value is true ("1")
4356 *
4357 * Note: the dependencies must be Secure settings
4358 *
4359 * @hide
4360 */
4361 public static final Map<String, String> CLONE_FROM_PARENT_ON_VALUE = new ArrayMap<>();
4362 static {
4363 CLONE_FROM_PARENT_ON_VALUE.put(RINGTONE, Secure.SYNC_PARENT_SOUNDS);
4364 CLONE_FROM_PARENT_ON_VALUE.put(NOTIFICATION_SOUND, Secure.SYNC_PARENT_SOUNDS);
4365 CLONE_FROM_PARENT_ON_VALUE.put(ALARM_ALERT, Secure.SYNC_PARENT_SOUNDS);
4366 }
4367
4368 /** @hide */
4369 public static void getCloneFromParentOnValueSettings(Map<String, String> outMap) {
4370 outMap.putAll(CLONE_FROM_PARENT_ON_VALUE);
4371 }
4372
4373 /**
Todd Kennedybe0b8892017-02-15 14:13:52 -08004374 * System settings which can be accessed by instant apps.
Chad Brubaker97bccee2017-01-05 15:51:41 -08004375 * @hide
4376 */
Todd Kennedybe0b8892017-02-15 14:13:52 -08004377 public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>();
Chad Brubaker97bccee2017-01-05 15:51:41 -08004378 static {
Todd Kennedybe0b8892017-02-15 14:13:52 -08004379 INSTANT_APP_SETTINGS.add(TEXT_AUTO_REPLACE);
4380 INSTANT_APP_SETTINGS.add(TEXT_AUTO_CAPS);
4381 INSTANT_APP_SETTINGS.add(TEXT_AUTO_PUNCTUATE);
4382 INSTANT_APP_SETTINGS.add(TEXT_SHOW_PASSWORD);
4383 INSTANT_APP_SETTINGS.add(DATE_FORMAT);
4384 INSTANT_APP_SETTINGS.add(FONT_SCALE);
4385 INSTANT_APP_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED);
4386 INSTANT_APP_SETTINGS.add(TIME_12_24);
4387 INSTANT_APP_SETTINGS.add(SOUND_EFFECTS_ENABLED);
Chad Brubaker562afaf2017-04-10 13:32:37 -07004388 INSTANT_APP_SETTINGS.add(ACCELEROMETER_ROTATION);
Chad Brubaker97bccee2017-01-05 15:51:41 -08004389 }
4390
4391 /**
Sailesh Nepal1bd78762014-02-11 22:32:21 -08004392 * When to use Wi-Fi calling
4393 *
4394 * @see android.telephony.TelephonyManager.WifiCallingChoices
4395 * @hide
4396 */
4397 public static final String WHEN_TO_MAKE_WIFI_CALLS = "when_to_make_wifi_calls";
4398
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004399 // Settings moved to Settings.Secure
4400
4401 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004402 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004403 * instead
4404 */
4405 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07004406 public static final String ADB_ENABLED = Global.ADB_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004407
4408 /**
4409 * @deprecated Use {@link android.provider.Settings.Secure#ANDROID_ID} instead
4410 */
4411 @Deprecated
4412 public static final String ANDROID_ID = Secure.ANDROID_ID;
4413
4414 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004415 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004416 */
4417 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07004418 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004419
Michal Karpinski5db1e432018-01-18 20:10:24 +00004420 private static final Validator BLUETOOTH_ON_VALIDATOR = BOOLEAN_VALIDATOR;
4421
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004422 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004423 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004424 */
4425 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07004426 public static final String DATA_ROAMING = Global.DATA_ROAMING;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004427
4428 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004429 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004430 */
4431 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07004432 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004433
4434 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07004435 * @deprecated Use {@link android.provider.Settings.Global#HTTP_PROXY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004436 */
4437 @Deprecated
Jeff Sharkey625239a2012-09-26 22:03:49 -07004438 public static final String HTTP_PROXY = Global.HTTP_PROXY;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004439
4440 /**
Christopher Tateaa036a22014-05-19 16:33:27 -07004441 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004442 */
4443 @Deprecated
Christopher Tateaa036a22014-05-19 16:33:27 -07004444 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004445
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004446 /**
4447 * @deprecated Use {@link android.provider.Settings.Secure#LOCATION_PROVIDERS_ALLOWED}
4448 * instead
4449 */
4450 @Deprecated
4451 public static final String LOCATION_PROVIDERS_ALLOWED = Secure.LOCATION_PROVIDERS_ALLOWED;
4452
4453 /**
4454 * @deprecated Use {@link android.provider.Settings.Secure#LOGGING_ID} instead
4455 */
4456 @Deprecated
4457 public static final String LOGGING_ID = Secure.LOGGING_ID;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004458
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004459 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004460 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004461 */
4462 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07004463 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004464
4465 /**
4466 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_ENABLED}
4467 * instead
4468 */
4469 @Deprecated
4470 public static final String PARENTAL_CONTROL_ENABLED = Secure.PARENTAL_CONTROL_ENABLED;
4471
4472 /**
4473 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_LAST_UPDATE}
4474 * instead
4475 */
4476 @Deprecated
4477 public static final String PARENTAL_CONTROL_LAST_UPDATE = Secure.PARENTAL_CONTROL_LAST_UPDATE;
4478
4479 /**
4480 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_REDIRECT_URL}
4481 * instead
4482 */
4483 @Deprecated
4484 public static final String PARENTAL_CONTROL_REDIRECT_URL =
4485 Secure.PARENTAL_CONTROL_REDIRECT_URL;
4486
4487 /**
4488 * @deprecated Use {@link android.provider.Settings.Secure#SETTINGS_CLASSNAME} instead
4489 */
4490 @Deprecated
4491 public static final String SETTINGS_CLASSNAME = Secure.SETTINGS_CLASSNAME;
4492
4493 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004494 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} 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 USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004498
Michal Karpinski5db1e432018-01-18 20:10:24 +00004499 private static final Validator USB_MASS_STORAGE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
4500
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004501 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004502 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004503 */
4504 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07004505 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004506
Dianne Hackborn4a51c202009-08-21 15:14:02 -07004507 /**
4508 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07004509 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
Dianne Hackborn4a51c202009-08-21 15:14:02 -07004510 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004511 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07004512 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 -08004513
Dianne Hackborn4a51c202009-08-21 15:14:02 -07004514 /**
4515 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07004516 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
Dianne Hackborn4a51c202009-08-21 15:14:02 -07004517 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004518 @Deprecated
4519 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
Christopher Tate06efb532012-08-24 15:29:27 -07004520 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004521
4522 /**
4523 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07004524 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004525 */
4526 @Deprecated
4527 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
Christopher Tate06efb532012-08-24 15:29:27 -07004528 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004529
Michal Karpinski964943a2018-01-19 16:28:26 +00004530 private static final Validator WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR =
4531 BOOLEAN_VALIDATOR;
Michal Karpinski5db1e432018-01-18 20:10:24 +00004532
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004533 /**
4534 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07004535 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004536 */
4537 @Deprecated
4538 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
Christopher Tate06efb532012-08-24 15:29:27 -07004539 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004540
Michal Karpinski964943a2018-01-19 16:28:26 +00004541 private static final Validator WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_VALIDATOR =
4542 NON_NEGATIVE_INTEGER_VALIDATOR;
4543
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004544 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004545 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004546 * instead
4547 */
4548 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07004549 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 -08004550
Michal Karpinski964943a2018-01-19 16:28:26 +00004551 private static final Validator WIFI_NUM_OPEN_NETWORKS_KEPT_VALIDATOR =
4552 NON_NEGATIVE_INTEGER_VALIDATOR;
4553
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004554 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004555 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004556 */
4557 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07004558 public static final String WIFI_ON = Global.WIFI_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004559
4560 /**
4561 * @deprecated Use
4562 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE}
4563 * instead
4564 */
4565 @Deprecated
4566 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
4567 Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE;
4568
4569 /**
4570 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_AP_COUNT} instead
4571 */
4572 @Deprecated
4573 public static final String WIFI_WATCHDOG_AP_COUNT = Secure.WIFI_WATCHDOG_AP_COUNT;
4574
4575 /**
4576 * @deprecated Use
4577 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS} instead
4578 */
4579 @Deprecated
4580 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
4581 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004582
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004583 /**
4584 * @deprecated Use
4585 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED} instead
4586 */
4587 @Deprecated
4588 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
4589 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED;
4590
4591 /**
4592 * @deprecated Use
4593 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS}
4594 * instead
4595 */
4596 @Deprecated
4597 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
4598 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS;
4599
4600 /**
4601 * @deprecated Use
4602 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT} instead
4603 */
4604 @Deprecated
4605 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
4606 Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT;
4607
4608 /**
4609 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_MAX_AP_CHECKS}
4610 * instead
4611 */
4612 @Deprecated
4613 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = Secure.WIFI_WATCHDOG_MAX_AP_CHECKS;
4614
4615 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004616 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004617 */
4618 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07004619 public static final String WIFI_WATCHDOG_ON = Global.WIFI_WATCHDOG_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004620
4621 /**
4622 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_COUNT} instead
4623 */
4624 @Deprecated
4625 public static final String WIFI_WATCHDOG_PING_COUNT = Secure.WIFI_WATCHDOG_PING_COUNT;
4626
4627 /**
4628 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_DELAY_MS}
4629 * instead
4630 */
4631 @Deprecated
4632 public static final String WIFI_WATCHDOG_PING_DELAY_MS = Secure.WIFI_WATCHDOG_PING_DELAY_MS;
4633
4634 /**
4635 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_TIMEOUT_MS}
4636 * instead
4637 */
4638 @Deprecated
4639 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS =
4640 Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS;
Billy Lau6ad2d662015-07-18 00:26:58 +01004641
4642 /**
Trevor Johns682c24e2016-04-12 10:13:47 -07004643 * Checks if the specified app can modify system settings. As of API
4644 * level 23, an app cannot modify system settings unless it declares the
4645 * {@link android.Manifest.permission#WRITE_SETTINGS}
4646 * permission in its manifest, <em>and</em> the user specifically grants
4647 * the app this capability. To prompt the user to grant this approval,
4648 * the app must send an intent with the action {@link
4649 * android.provider.Settings#ACTION_MANAGE_WRITE_SETTINGS}, which causes
4650 * the system to display a permission management screen.
Billy Lau6ad2d662015-07-18 00:26:58 +01004651 *
Trevor Johns682c24e2016-04-12 10:13:47 -07004652 * @param context App context.
Billy Lau6ad2d662015-07-18 00:26:58 +01004653 * @return true if the calling app can write to system settings, false otherwise
4654 */
4655 public static boolean canWrite(Context context) {
Svet Ganov94ba40172016-04-03 22:04:22 -07004656 return isCallingPackageAllowedToWriteSettings(context, Process.myUid(),
4657 context.getOpPackageName(), false);
Billy Lau6ad2d662015-07-18 00:26:58 +01004658 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004659 }
4660
4661 /**
4662 * Secure system settings, containing system preferences that applications
4663 * can read but are not allowed to write. These are for preferences that
4664 * the user must explicitly modify through the system UI or specialized
4665 * APIs for those values, not modified directly by applications.
4666 */
4667 public static final class Secure extends NameValueTable {
Kweku Adamsb0886f32017-10-31 15:32:09 -07004668 // NOTE: If you add new settings here, be sure to add them to
4669 // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoSecureSettingsLocked.
4670
Dianne Hackborn139748f2012-09-24 11:36:57 -07004671 /**
4672 * The content:// style URL for this table
4673 */
4674 public static final Uri CONTENT_URI =
4675 Uri.parse("content://" + AUTHORITY + "/secure");
4676
Svetoslav Ganove080da92016-12-21 17:10:35 -08004677 private static final ContentProviderHolder sProviderHolder =
4678 new ContentProviderHolder(CONTENT_URI);
4679
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08004680 // Populated lazily, guarded by class object:
Dianne Hackborn139748f2012-09-24 11:36:57 -07004681 private static final NameValueCache sNameValueCache = new NameValueCache(
Dianne Hackborn139748f2012-09-24 11:36:57 -07004682 CONTENT_URI,
4683 CALL_METHOD_GET_SECURE,
Svetoslav Ganove080da92016-12-21 17:10:35 -08004684 CALL_METHOD_PUT_SECURE,
4685 sProviderHolder);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004686
Amith Yamasani52c489c2012-03-28 11:42:42 -07004687 private static ILockSettings sLockSettings = null;
4688
Amith Yamasani7ab8c4a2012-04-06 09:27:12 -07004689 private static boolean sIsSystemProcess;
Amith Yamasani52c489c2012-03-28 11:42:42 -07004690 private static final HashSet<String> MOVED_TO_LOCK_SETTINGS;
Christopher Tate06efb532012-08-24 15:29:27 -07004691 private static final HashSet<String> MOVED_TO_GLOBAL;
Amith Yamasani52c489c2012-03-28 11:42:42 -07004692 static {
Steve McKayea93fe72016-12-02 11:35:35 -08004693 MOVED_TO_LOCK_SETTINGS = new HashSet<>(3);
Amith Yamasani52c489c2012-03-28 11:42:42 -07004694 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_ENABLED);
4695 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_VISIBLE);
4696 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
Christopher Tate06efb532012-08-24 15:29:27 -07004697
Steve McKayea93fe72016-12-02 11:35:35 -08004698 MOVED_TO_GLOBAL = new HashSet<>();
Christopher Tate06efb532012-08-24 15:29:27 -07004699 MOVED_TO_GLOBAL.add(Settings.Global.ADB_ENABLED);
4700 MOVED_TO_GLOBAL.add(Settings.Global.ASSISTED_GPS_ENABLED);
4701 MOVED_TO_GLOBAL.add(Settings.Global.BLUETOOTH_ON);
Christopher Tate58f41ec2013-01-11 15:40:36 -08004702 MOVED_TO_GLOBAL.add(Settings.Global.BUGREPORT_IN_POWER_MENU);
Christopher Tate06efb532012-08-24 15:29:27 -07004703 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_CELL_BROADCAST_SMS);
4704 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_ROAMING_MODE);
4705 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_SUBSCRIPTION_MODE);
4706 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_MOBILE);
4707 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_WIFI);
4708 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ROAMING);
4709 MOVED_TO_GLOBAL.add(Settings.Global.DEVELOPMENT_SETTINGS_ENABLED);
4710 MOVED_TO_GLOBAL.add(Settings.Global.DEVICE_PROVISIONED);
Christopher Tate06efb532012-08-24 15:29:27 -07004711 MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_SIZE_FORCED);
4712 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_MAX_BYTES_OVER_MOBILE);
4713 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE);
Christopher Tate06efb532012-08-24 15:29:27 -07004714 MOVED_TO_GLOBAL.add(Settings.Global.MOBILE_DATA);
4715 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_BUCKET_DURATION);
4716 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_DELETE_AGE);
4717 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_PERSIST_BYTES);
4718 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_ROTATE_AGE);
4719 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_ENABLED);
4720 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_GLOBAL_ALERT_BYTES);
4721 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_POLL_INTERVAL);
Christopher Tate06efb532012-08-24 15:29:27 -07004722 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_SAMPLE_ENABLED);
4723 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_TIME_CACHE_MAX_AGE);
4724 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_BUCKET_DURATION);
4725 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_DELETE_AGE);
4726 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_PERSIST_BYTES);
4727 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_ROTATE_AGE);
4728 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_BUCKET_DURATION);
4729 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_DELETE_AGE);
4730 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_PERSIST_BYTES);
4731 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_ROTATE_AGE);
4732 MOVED_TO_GLOBAL.add(Settings.Global.NETWORK_PREFERENCE);
4733 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_DIFF);
4734 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_SPACING);
4735 MOVED_TO_GLOBAL.add(Settings.Global.NTP_SERVER);
4736 MOVED_TO_GLOBAL.add(Settings.Global.NTP_TIMEOUT);
4737 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_ERROR_POLL_COUNT);
4738 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_LONG_POLL_INTERVAL_MS);
4739 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT);
4740 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_POLL_INTERVAL_MS);
4741 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_TRIGGER_PACKET_COUNT);
Christopher Tate06efb532012-08-24 15:29:27 -07004742 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DATA_SERVICE_URL);
4743 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_REDIR_HOST);
4744 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_TARGET_URL);
4745 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_APN);
4746 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_REQUIRED);
4747 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_SUPPORTED);
Christopher Tate06efb532012-08-24 15:29:27 -07004748 MOVED_TO_GLOBAL.add(Settings.Global.USB_MASS_STORAGE_ENABLED);
4749 MOVED_TO_GLOBAL.add(Settings.Global.USE_GOOGLE_MAIL);
Robert Greenwalt3ea0c992013-10-03 21:13:49 +00004750 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_COUNTRY_CODE);
Christopher Tate06efb532012-08-24 15:29:27 -07004751 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FRAMEWORK_SCAN_INTERVAL_MS);
4752 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FREQUENCY_BAND);
4753 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_IDLE_MS);
4754 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MAX_DHCP_RETRY_COUNT);
4755 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS);
4756 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
4757 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
4758 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NUM_OPEN_NETWORKS_KEPT);
4759 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ON);
4760 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_P2P_DEVICE_NAME);
4761 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SAVED_STATE);
4762 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUPPLICANT_SCAN_INTERVAL_MS);
4763 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUSPEND_OPTIMIZATIONS_ENABLED);
Nathan Harold29589fc2016-03-30 21:53:48 -07004764 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_VERBOSE_LOGGING_ENABLED);
vandwalle7c3606c2014-03-31 19:12:07 -07004765 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ENHANCED_AUTO_JOIN);
4766 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORK_SHOW_RSSI);
Christopher Tate06efb532012-08-24 15:29:27 -07004767 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_ON);
4768 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED);
Christopher Tate06efb532012-08-24 15:29:27 -07004769 MOVED_TO_GLOBAL.add(Settings.Global.WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON);
Christopher Tatec868b642012-09-12 17:41:04 -07004770 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_ENABLE);
4771 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_TIMEOUT);
4772 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_DEFAULT_RESPONSE);
4773 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS);
4774 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS);
4775 MOVED_TO_GLOBAL.add(Settings.Global.GPRS_REGISTER_CHECK_PERIOD_MS);
Christopher Tate06efb532012-08-24 15:29:27 -07004776 MOVED_TO_GLOBAL.add(Settings.Global.WTF_IS_FATAL);
Jeff Sharkey625239a2012-09-26 22:03:49 -07004777 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_DURATION_THRESHOLD);
4778 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_THRESHOLD);
4779 MOVED_TO_GLOBAL.add(Settings.Global.SEND_ACTION_APP_ERROR);
4780 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_AGE_SECONDS);
4781 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_MAX_FILES);
4782 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_KB);
4783 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_PERCENT);
4784 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_RESERVE_PERCENT);
4785 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_TAG_PREFIX);
4786 MOVED_TO_GLOBAL.add(Settings.Global.ERROR_LOGCAT_PREFIX);
4787 MOVED_TO_GLOBAL.add(Settings.Global.SYS_FREE_STORAGE_LOG_INTERVAL);
4788 MOVED_TO_GLOBAL.add(Settings.Global.DISK_FREE_CHANGE_REPORTING_THRESHOLD);
4789 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_PERCENTAGE);
4790 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_MAX_BYTES);
4791 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_FULL_THRESHOLD_BYTES);
4792 MOVED_TO_GLOBAL.add(Settings.Global.SYNC_MAX_RETRY_DELAY_IN_SECONDS);
4793 MOVED_TO_GLOBAL.add(Settings.Global.CONNECTIVITY_CHANGE_DELAY);
4794 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED);
4795 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_SERVER);
4796 MOVED_TO_GLOBAL.add(Settings.Global.NSD_ON);
4797 MOVED_TO_GLOBAL.add(Settings.Global.SET_INSTALL_LOCATION);
4798 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_INSTALL_LOCATION);
4799 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_UP_DELAY);
4800 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_DOWN_DELAY);
4801 MOVED_TO_GLOBAL.add(Settings.Global.READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT);
4802 MOVED_TO_GLOBAL.add(Settings.Global.HTTP_PROXY);
4803 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_HOST);
4804 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_PORT);
4805 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST);
4806 MOVED_TO_GLOBAL.add(Settings.Global.SET_GLOBAL_HTTP_PROXY);
4807 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_DNS_SERVER);
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07004808 MOVED_TO_GLOBAL.add(Settings.Global.PREFERRED_NETWORK_MODE);
Hui Shu22671772014-10-01 21:41:07 +00004809 MOVED_TO_GLOBAL.add(Settings.Global.WEBVIEW_DATA_REDUCTION_PROXY_KEY);
Christopher Tate06efb532012-08-24 15:29:27 -07004810 }
4811
Christopher Tate66488d62012-10-02 11:58:01 -07004812 /** @hide */
Svetoslav683914b2015-01-15 14:22:26 -08004813 public static void getMovedToGlobalSettings(Set<String> outKeySet) {
Christopher Tate66488d62012-10-02 11:58:01 -07004814 outKeySet.addAll(MOVED_TO_GLOBAL);
4815 }
4816
Sudheer Shankaaa3c30d2017-05-23 15:19:10 -07004817 /** @hide */
4818 public static void clearProviderForTest() {
4819 sProviderHolder.clearProviderForTest();
4820 sNameValueCache.clearGenerationTrackerForTest();
4821 }
4822
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004823 /**
4824 * Look up a name in the database.
4825 * @param resolver to access the database with
4826 * @param name to look up in the table
4827 * @return the corresponding value, or null if not present
4828 */
Dianne Hackborn139748f2012-09-24 11:36:57 -07004829 public static String getString(ContentResolver resolver, String name) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07004830 return getStringForUser(resolver, name, resolver.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07004831 }
4832
4833 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -07004834 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -07004835 int userHandle) {
4836 if (MOVED_TO_GLOBAL.contains(name)) {
4837 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
4838 + " to android.provider.Settings.Global.");
4839 return Global.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004840 }
Amith Yamasani52c489c2012-03-28 11:42:42 -07004841
Dianne Hackborn139748f2012-09-24 11:36:57 -07004842 if (MOVED_TO_LOCK_SETTINGS.contains(name)) {
4843 synchronized (Secure.class) {
4844 if (sLockSettings == null) {
4845 sLockSettings = ILockSettings.Stub.asInterface(
4846 (IBinder) ServiceManager.getService("lock_settings"));
4847 sIsSystemProcess = Process.myUid() == Process.SYSTEM_UID;
4848 }
4849 }
4850 if (sLockSettings != null && !sIsSystemProcess) {
Adrian Roos7811d9f2015-07-27 15:10:13 -07004851 // No context; use the ActivityThread's context as an approximation for
4852 // determining the target API level.
4853 Application application = ActivityThread.currentApplication();
4854
4855 boolean isPreMnc = application != null
4856 && application.getApplicationInfo() != null
4857 && application.getApplicationInfo().targetSdkVersion
4858 <= VERSION_CODES.LOLLIPOP_MR1;
4859 if (isPreMnc) {
4860 try {
4861 return sLockSettings.getString(name, "0", userHandle);
4862 } catch (RemoteException re) {
4863 // Fall through
4864 }
4865 } else {
4866 throw new SecurityException("Settings.Secure." + name
4867 + " is deprecated and no longer accessible."
4868 + " See API documentation for potential replacements.");
Dianne Hackborn139748f2012-09-24 11:36:57 -07004869 }
Amith Yamasani52c489c2012-03-28 11:42:42 -07004870 }
4871 }
4872
Christopher Tate06efb532012-08-24 15:29:27 -07004873 return sNameValueCache.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004874 }
4875
4876 /**
4877 * Store a name/value pair into the database.
4878 * @param resolver to access the database with
4879 * @param name to store
4880 * @param value to associate with the name
4881 * @return true if the value was set, false on database errors
4882 */
Christopher Tate06efb532012-08-24 15:29:27 -07004883 public static boolean putString(ContentResolver resolver, String name, String value) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07004884 return putStringForUser(resolver, name, value, resolver.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07004885 }
4886
4887 /** @hide */
4888 public static boolean putStringForUser(ContentResolver resolver, String name, String value,
4889 int userHandle) {
Svetoslav Ganove080da92016-12-21 17:10:35 -08004890 return putStringForUser(resolver, name, value, null, false, userHandle);
4891 }
4892
4893 /** @hide */
4894 public static boolean putStringForUser(@NonNull ContentResolver resolver,
4895 @NonNull String name, @Nullable String value, @Nullable String tag,
4896 boolean makeDefault, @UserIdInt int userHandle) {
Julia Reynolds82735bc2014-09-04 16:43:30 -04004897 if (LOCATION_MODE.equals(name)) {
Tom O'Neill87c7fad2016-08-04 08:16:12 -07004898 // Map LOCATION_MODE to underlying location provider storage API
Julia Reynolds82735bc2014-09-04 16:43:30 -04004899 return setLocationModeForUser(resolver, Integer.parseInt(value), userHandle);
4900 }
Christopher Tate06efb532012-08-24 15:29:27 -07004901 if (MOVED_TO_GLOBAL.contains(name)) {
Robin Lee7af9a742017-02-20 14:47:30 +00004902 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
Christopher Tate06efb532012-08-24 15:29:27 -07004903 + " to android.provider.Settings.Global");
Svetoslav Ganove080da92016-12-21 17:10:35 -08004904 return Global.putStringForUser(resolver, name, value,
4905 tag, makeDefault, userHandle);
Christopher Tate06efb532012-08-24 15:29:27 -07004906 }
Svetoslav Ganove080da92016-12-21 17:10:35 -08004907 return sNameValueCache.putStringForUser(resolver, name, value, tag,
4908 makeDefault, userHandle);
4909 }
4910
4911 /**
4912 * Store a name/value pair into the database.
4913 * <p>
4914 * The method takes an optional tag to associate with the setting
4915 * which can be used to clear only settings made by your package and
4916 * associated with this tag by passing the tag to {@link
4917 * #resetToDefaults(ContentResolver, String)}. Anyone can override
4918 * the current tag. Also if another package changes the setting
4919 * then the tag will be set to the one specified in the set call
4920 * which can be null. Also any of the settings setters that do not
4921 * take a tag as an argument effectively clears the tag.
4922 * </p><p>
4923 * For example, if you set settings A and B with tags T1 and T2 and
4924 * another app changes setting A (potentially to the same value), it
4925 * can assign to it a tag T3 (note that now the package that changed
4926 * the setting is not yours). Now if you reset your changes for T1 and
4927 * T2 only setting B will be reset and A not (as it was changed by
4928 * another package) but since A did not change you are in the desired
4929 * initial state. Now if the other app changes the value of A (assuming
4930 * you registered an observer in the beginning) you would detect that
4931 * the setting was changed by another app and handle this appropriately
4932 * (ignore, set back to some value, etc).
4933 * </p><p>
4934 * Also the method takes an argument whether to make the value the
4935 * default for this setting. If the system already specified a default
4936 * value, then the one passed in here will <strong>not</strong>
4937 * be set as the default.
4938 * </p>
4939 *
4940 * @param resolver to access the database with.
4941 * @param name to store.
4942 * @param value to associate with the name.
4943 * @param tag to associate with the setting.
4944 * @param makeDefault whether to make the value the default one.
4945 * @return true if the value was set, false on database errors.
4946 *
4947 * @see #resetToDefaults(ContentResolver, String)
4948 *
4949 * @hide
4950 */
4951 @SystemApi
4952 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
4953 public static boolean putString(@NonNull ContentResolver resolver,
4954 @NonNull String name, @Nullable String value, @Nullable String tag,
4955 boolean makeDefault) {
4956 return putStringForUser(resolver, name, value, tag, makeDefault,
Jeff Sharkeyad357d12018-02-02 13:25:31 -07004957 resolver.getUserId());
Svetoslav Ganove080da92016-12-21 17:10:35 -08004958 }
4959
4960 /**
4961 * Reset the settings to their defaults. This would reset <strong>only</strong>
4962 * settings set by the caller's package. Think of it of a way to undo your own
4963 * changes to the global settings. Passing in the optional tag will reset only
4964 * settings changed by your package and associated with this tag.
4965 *
4966 * @param resolver Handle to the content resolver.
4967 * @param tag Optional tag which should be associated with the settings to reset.
4968 *
4969 * @see #putString(ContentResolver, String, String, String, boolean)
4970 *
4971 * @hide
4972 */
4973 @SystemApi
4974 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
4975 public static void resetToDefaults(@NonNull ContentResolver resolver,
4976 @Nullable String tag) {
4977 resetToDefaultsAsUser(resolver, tag, RESET_MODE_PACKAGE_DEFAULTS,
Jeff Sharkeyad357d12018-02-02 13:25:31 -07004978 resolver.getUserId());
Svetoslav Ganove080da92016-12-21 17:10:35 -08004979 }
4980
4981 /**
4982 *
4983 * Reset the settings to their defaults for a given user with a specific mode. The
4984 * optional tag argument is valid only for {@link #RESET_MODE_PACKAGE_DEFAULTS}
4985 * allowing resetting the settings made by a package and associated with the tag.
4986 *
4987 * @param resolver Handle to the content resolver.
4988 * @param tag Optional tag which should be associated with the settings to reset.
4989 * @param mode The reset mode.
4990 * @param userHandle The user for which to reset to defaults.
4991 *
4992 * @see #RESET_MODE_PACKAGE_DEFAULTS
4993 * @see #RESET_MODE_UNTRUSTED_DEFAULTS
4994 * @see #RESET_MODE_UNTRUSTED_CHANGES
4995 * @see #RESET_MODE_TRUSTED_DEFAULTS
4996 *
4997 * @hide
4998 */
4999 public static void resetToDefaultsAsUser(@NonNull ContentResolver resolver,
5000 @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle) {
5001 try {
5002 Bundle arg = new Bundle();
5003 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
5004 if (tag != null) {
5005 arg.putString(CALL_METHOD_TAG_KEY, tag);
5006 }
5007 arg.putInt(CALL_METHOD_RESET_MODE_KEY, mode);
5008 IContentProvider cp = sProviderHolder.getProvider(resolver);
5009 cp.call(resolver.getPackageName(), CALL_METHOD_RESET_SECURE, null, arg);
5010 } catch (RemoteException e) {
5011 Log.w(TAG, "Can't reset do defaults for " + CONTENT_URI, e);
5012 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005013 }
5014
5015 /**
5016 * Construct the content URI for a particular name/value pair,
5017 * useful for monitoring changes with a ContentObserver.
5018 * @param name to look up in the table
5019 * @return the corresponding content URI, or null if not present
5020 */
5021 public static Uri getUriFor(String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07005022 if (MOVED_TO_GLOBAL.contains(name)) {
5023 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
5024 + " to android.provider.Settings.Global, returning global URI.");
5025 return Global.getUriFor(Global.CONTENT_URI, name);
5026 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005027 return getUriFor(CONTENT_URI, name);
5028 }
5029
5030 /**
5031 * Convenience function for retrieving a single secure settings value
5032 * as an integer. Note that internally setting values are always
5033 * stored as strings; this function converts the string to an integer
5034 * for you. The default value will be returned if the setting is
5035 * not defined or not an integer.
5036 *
5037 * @param cr The ContentResolver to access.
5038 * @param name The name of the setting to retrieve.
5039 * @param def Value to return if the setting is not defined.
5040 *
5041 * @return The setting's current value, or 'def' if it is not defined
5042 * or not a valid integer.
5043 */
5044 public static int getInt(ContentResolver cr, String name, int def) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07005045 return getIntForUser(cr, name, def, cr.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07005046 }
5047
5048 /** @hide */
5049 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
Tom O'Neill7f6f4572013-08-27 10:53:15 -07005050 if (LOCATION_MODE.equals(name)) {
Tom O'Neill87c7fad2016-08-04 08:16:12 -07005051 // Map from to underlying location provider storage API to location mode
Tom O'Neill7f6f4572013-08-27 10:53:15 -07005052 return getLocationModeForUser(cr, userHandle);
5053 }
Christopher Tate06efb532012-08-24 15:29:27 -07005054 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005055 try {
5056 return v != null ? Integer.parseInt(v) : def;
5057 } catch (NumberFormatException e) {
5058 return def;
5059 }
5060 }
5061
5062 /**
5063 * Convenience function for retrieving a single secure settings value
5064 * as an integer. Note that internally setting values are always
5065 * stored as strings; this function converts the string to an integer
5066 * for you.
5067 * <p>
5068 * This version does not take a default value. If the setting has not
5069 * been set, or the string value is not a number,
5070 * it throws {@link SettingNotFoundException}.
5071 *
5072 * @param cr The ContentResolver to access.
5073 * @param name The name of the setting to retrieve.
5074 *
5075 * @throws SettingNotFoundException Thrown if a setting by the given
5076 * name can't be found or the setting value is not an integer.
5077 *
5078 * @return The setting's current value.
5079 */
5080 public static int getInt(ContentResolver cr, String name)
5081 throws SettingNotFoundException {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07005082 return getIntForUser(cr, name, cr.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07005083 }
5084
5085 /** @hide */
5086 public static int getIntForUser(ContentResolver cr, String name, int userHandle)
5087 throws SettingNotFoundException {
Tom O'Neill7f6f4572013-08-27 10:53:15 -07005088 if (LOCATION_MODE.equals(name)) {
Tom O'Neill87c7fad2016-08-04 08:16:12 -07005089 // Map from to underlying location provider storage API to location mode
Tom O'Neill7f6f4572013-08-27 10:53:15 -07005090 return getLocationModeForUser(cr, userHandle);
5091 }
Christopher Tate06efb532012-08-24 15:29:27 -07005092 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005093 try {
5094 return Integer.parseInt(v);
5095 } catch (NumberFormatException e) {
5096 throw new SettingNotFoundException(name);
5097 }
5098 }
5099
5100 /**
5101 * Convenience function for updating a single settings value as an
5102 * integer. This will either create a new entry in the table if the
5103 * given name does not exist, or modify the value of the existing row
5104 * with that name. Note that internally setting values are always
5105 * stored as strings, so this function converts the given value to a
5106 * string before storing it.
5107 *
5108 * @param cr The ContentResolver to access.
5109 * @param name The name of the setting to modify.
5110 * @param value The new value for the setting.
5111 * @return true if the value was set, false on database errors
5112 */
5113 public static boolean putInt(ContentResolver cr, String name, int value) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07005114 return putIntForUser(cr, name, value, cr.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07005115 }
5116
5117 /** @hide */
5118 public static boolean putIntForUser(ContentResolver cr, String name, int value,
5119 int userHandle) {
5120 return putStringForUser(cr, name, Integer.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005121 }
5122
5123 /**
5124 * Convenience function for retrieving a single secure settings value
5125 * as a {@code long}. Note that internally setting values are always
5126 * stored as strings; this function converts the string to a {@code long}
5127 * for you. The default value will be returned if the setting is
5128 * not defined or not a {@code long}.
5129 *
5130 * @param cr The ContentResolver to access.
5131 * @param name The name of the setting to retrieve.
5132 * @param def Value to return if the setting is not defined.
5133 *
5134 * @return The setting's current value, or 'def' if it is not defined
5135 * or not a valid {@code long}.
5136 */
5137 public static long getLong(ContentResolver cr, String name, long def) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07005138 return getLongForUser(cr, name, def, cr.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07005139 }
5140
5141 /** @hide */
5142 public static long getLongForUser(ContentResolver cr, String name, long def,
5143 int userHandle) {
5144 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005145 long value;
5146 try {
5147 value = valString != null ? Long.parseLong(valString) : def;
5148 } catch (NumberFormatException e) {
5149 value = def;
5150 }
5151 return value;
5152 }
5153
5154 /**
5155 * Convenience function for retrieving a single secure settings value
5156 * as a {@code long}. Note that internally setting values are always
5157 * stored as strings; this function converts the string to a {@code long}
5158 * for you.
5159 * <p>
5160 * This version does not take a default value. If the setting has not
5161 * been set, or the string value is not a number,
5162 * it throws {@link SettingNotFoundException}.
5163 *
5164 * @param cr The ContentResolver to access.
5165 * @param name The name of the setting to retrieve.
5166 *
5167 * @return The setting's current value.
5168 * @throws SettingNotFoundException Thrown if a setting by the given
5169 * name can't be found or the setting value is not an integer.
5170 */
5171 public static long getLong(ContentResolver cr, String name)
5172 throws SettingNotFoundException {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07005173 return getLongForUser(cr, name, cr.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07005174 }
5175
5176 /** @hide */
5177 public static long getLongForUser(ContentResolver cr, String name, int userHandle)
5178 throws SettingNotFoundException {
5179 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005180 try {
5181 return Long.parseLong(valString);
5182 } catch (NumberFormatException e) {
5183 throw new SettingNotFoundException(name);
5184 }
5185 }
5186
5187 /**
5188 * Convenience function for updating a secure settings value as a long
5189 * integer. This will either create a new entry in the table if the
5190 * given name does not exist, or modify the value of the existing row
5191 * with that name. Note that internally setting values are always
5192 * stored as strings, so this function converts the given value to a
5193 * string before storing it.
5194 *
5195 * @param cr The ContentResolver to access.
5196 * @param name The name of the setting to modify.
5197 * @param value The new value for the setting.
5198 * @return true if the value was set, false on database errors
5199 */
5200 public static boolean putLong(ContentResolver cr, String name, long value) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07005201 return putLongForUser(cr, name, value, cr.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07005202 }
5203
5204 /** @hide */
5205 public static boolean putLongForUser(ContentResolver cr, String name, long value,
5206 int userHandle) {
5207 return putStringForUser(cr, name, Long.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005208 }
5209
5210 /**
5211 * Convenience function for retrieving a single secure settings value
5212 * as a floating point number. Note that internally setting values are
5213 * always stored as strings; this function converts the string to an
5214 * float for you. The default value will be returned if the setting
5215 * is not defined or not a valid float.
5216 *
5217 * @param cr The ContentResolver to access.
5218 * @param name The name of the setting to retrieve.
5219 * @param def Value to return if the setting is not defined.
5220 *
5221 * @return The setting's current value, or 'def' if it is not defined
5222 * or not a valid float.
5223 */
5224 public static float getFloat(ContentResolver cr, String name, float def) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07005225 return getFloatForUser(cr, name, def, cr.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07005226 }
5227
5228 /** @hide */
5229 public static float getFloatForUser(ContentResolver cr, String name, float def,
5230 int userHandle) {
5231 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005232 try {
5233 return v != null ? Float.parseFloat(v) : def;
5234 } catch (NumberFormatException e) {
5235 return def;
5236 }
5237 }
5238
5239 /**
5240 * Convenience function for retrieving a single secure settings value
5241 * as a float. Note that internally setting values are always
5242 * stored as strings; this function converts the string to a float
5243 * for you.
5244 * <p>
5245 * This version does not take a default value. If the setting has not
5246 * been set, or the string value is not a number,
5247 * it throws {@link SettingNotFoundException}.
5248 *
5249 * @param cr The ContentResolver to access.
5250 * @param name The name of the setting to retrieve.
5251 *
5252 * @throws SettingNotFoundException Thrown if a setting by the given
5253 * name can't be found or the setting value is not a float.
5254 *
5255 * @return The setting's current value.
5256 */
5257 public static float getFloat(ContentResolver cr, String name)
5258 throws SettingNotFoundException {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07005259 return getFloatForUser(cr, name, cr.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07005260 }
5261
5262 /** @hide */
5263 public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
5264 throws SettingNotFoundException {
5265 String v = getStringForUser(cr, name, userHandle);
Brian Muramatsue1d46982010-12-06 17:34:20 -08005266 if (v == null) {
5267 throw new SettingNotFoundException(name);
5268 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005269 try {
5270 return Float.parseFloat(v);
5271 } catch (NumberFormatException e) {
5272 throw new SettingNotFoundException(name);
5273 }
5274 }
5275
5276 /**
5277 * Convenience function for updating a single settings value as a
5278 * floating point number. This will either create a new entry in the
5279 * table if the given name does not exist, or modify the value of the
5280 * existing row with that name. Note that internally setting values
5281 * are always stored as strings, so this function converts the given
5282 * value to a string before storing it.
5283 *
5284 * @param cr The ContentResolver to access.
5285 * @param name The name of the setting to modify.
5286 * @param value The new value for the setting.
5287 * @return true if the value was set, false on database errors
5288 */
5289 public static boolean putFloat(ContentResolver cr, String name, float value) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07005290 return putFloatForUser(cr, name, value, cr.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07005291 }
5292
5293 /** @hide */
5294 public static boolean putFloatForUser(ContentResolver cr, String name, float value,
5295 int userHandle) {
5296 return putStringForUser(cr, name, Float.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005297 }
5298
5299 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005300 * @deprecated Use {@link android.provider.Settings.Global#DEVELOPMENT_SETTINGS_ENABLED}
5301 * instead
Dianne Hackborn895f99e2012-02-02 11:49:12 -08005302 */
Christopher Tate06efb532012-08-24 15:29:27 -07005303 @Deprecated
5304 public static final String DEVELOPMENT_SETTINGS_ENABLED =
5305 Global.DEVELOPMENT_SETTINGS_ENABLED;
Dianne Hackborn895f99e2012-02-02 11:49:12 -08005306
5307 /**
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07005308 * When the user has enable the option to have a "bug report" command
5309 * in the power menu.
Christopher Tate58f41ec2013-01-11 15:40:36 -08005310 * @deprecated Use {@link android.provider.Settings.Global#BUGREPORT_IN_POWER_MENU} instead
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07005311 * @hide
5312 */
Christopher Tate58f41ec2013-01-11 15:40:36 -08005313 @Deprecated
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07005314 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
5315
Michal Karpinski5db1e432018-01-18 20:10:24 +00005316 private static final Validator BUGREPORT_IN_POWER_MENU_VALIDATOR = BOOLEAN_VALIDATOR;
5317
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07005318 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005319 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005320 */
Christopher Tate06efb532012-08-24 15:29:27 -07005321 @Deprecated
5322 public static final String ADB_ENABLED = Global.ADB_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005323
5324 /**
5325 * Setting to allow mock locations and location provider status to be injected into the
5326 * LocationManager service for testing purposes during application development. These
5327 * locations and status values override actual location and status information generated
5328 * by network, gps, or other location providers.
Svet Ganovf7e9cf42015-05-13 10:40:31 -07005329 *
5330 * @deprecated This settings is not used anymore.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005331 */
Svet Ganovf7e9cf42015-05-13 10:40:31 -07005332 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005333 public static final String ALLOW_MOCK_LOCATION = "mock_location";
5334
Michal Karpinski964943a2018-01-19 16:28:26 +00005335 private static final Validator ALLOW_MOCK_LOCATION_VALIDATOR = BOOLEAN_VALIDATOR;
5336
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005337 /**
Dave Friedman4b3a4b52017-06-14 18:45:58 -07005338 * On Android 8.0 (API level 26) and higher versions of the platform,
5339 * a 64-bit number (expressed as a hexadecimal string), unique to
5340 * each combination of app-signing key, user, and device.
5341 * Values of {@code ANDROID_ID} are scoped by signing key and user.
5342 * The value may change if a factory reset is performed on the
5343 * device or if an APK signing key changes.
Chad Brubaker0d277a72017-04-12 16:56:53 -07005344 *
Dave Friedman4b3a4b52017-06-14 18:45:58 -07005345 * For more information about how the platform handles {@code ANDROID_ID}
5346 * in Android 8.0 (API level 26) and higher, see <a
5347 * href="{@docRoot}preview/behavior-changes.html#privacy-all">
5348 * Android 8.0 Behavior Changes</a>.
5349 *
5350 * <p class="note"><strong>Note:</strong> For apps that were installed
5351 * prior to updating the device to a version of Android 8.0
5352 * (API level 26) or higher, the value of {@code ANDROID_ID} changes
5353 * if the app is uninstalled and then reinstalled after the OTA.
5354 * To preserve values across uninstalls after an OTA to Android 8.0
5355 * or higher, developers can use
5356 * <a href="{@docRoot}guide/topics/data/keyvaluebackup.html">
5357 * Key/Value Backup</a>.</p>
5358 *
5359 * <p>In versions of the platform lower than Android 8.0 (API level 26),
5360 * a 64-bit number (expressed as a hexadecimal string) that is randomly
5361 * generated when the user first sets up the device and should remain
5362 * constant for the lifetime of the user's device.
5363 *
5364 * On devices that have
5365 * <a href="{@docRoot}about/versions/android-4.2.html#MultipleUsers">
5366 * multiple users</a>, each user appears as a
5367 * completely separate device, so the {@code ANDROID_ID} value is
5368 * unique to each user.</p>
5369 *
5370 * <p class="note"><strong>Note:</strong> If the caller is an Instant App the ID is scoped
Chad Brubaker0d277a72017-04-12 16:56:53 -07005371 * to the Instant App, it is generated when the Instant App is first installed and reset if
5372 * the user clears the Instant App.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005373 */
5374 public static final String ANDROID_ID = "android_id";
5375
5376 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005377 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005378 */
Christopher Tate06efb532012-08-24 15:29:27 -07005379 @Deprecated
5380 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005381
Michal Karpinski5db1e432018-01-18 20:10:24 +00005382 private static final Validator BLUETOOTH_ON_VALIDATOR = BOOLEAN_VALIDATOR;
5383
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005384 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005385 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005386 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07005387 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07005388 public static final String DATA_ROAMING = Global.DATA_ROAMING;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005389
5390 /**
5391 * Setting to record the input method used by default, holding the ID
5392 * of the desired method.
5393 */
5394 public static final String DEFAULT_INPUT_METHOD = "default_input_method";
5395
5396 /**
satokab751aa2010-09-14 19:17:36 +09005397 * Setting to record the input method subtype used by default, holding the ID
5398 * of the desired method.
5399 */
5400 public static final String SELECTED_INPUT_METHOD_SUBTYPE =
5401 "selected_input_method_subtype";
5402
5403 /**
satok723a27e2010-11-11 14:58:11 +09005404 * Setting to record the history of input method subtype, holding the pair of ID of IME
5405 * and its last used subtype.
5406 * @hide
5407 */
5408 public static final String INPUT_METHODS_SUBTYPE_HISTORY =
5409 "input_methods_subtype_history";
5410
5411 /**
satok5c58dfc2010-12-14 21:54:47 +09005412 * Setting to record the visibility of input method selector
5413 */
5414 public static final String INPUT_METHOD_SELECTOR_VISIBILITY =
5415 "input_method_selector_visibility";
5416
5417 /**
Dianne Hackborn91097de2014-04-04 18:02:06 -07005418 * The currently selected voice interaction service flattened ComponentName.
5419 * @hide
5420 */
Jeff Sharkeya73b8fd2016-01-06 17:02:08 -07005421 @TestApi
Dianne Hackborn91097de2014-04-04 18:02:06 -07005422 public static final String VOICE_INTERACTION_SERVICE = "voice_interaction_service";
5423
5424 /**
Felipe Leme640f30a2017-03-06 15:44:06 -08005425 * The currently selected autofill service flattened ComponentName.
Felipe Leme5381aa42016-10-13 09:02:32 -07005426 * @hide
5427 */
5428 @TestApi
Felipe Leme640f30a2017-03-06 15:44:06 -08005429 public static final String AUTOFILL_SERVICE = "autofill_service";
Felipe Leme5381aa42016-10-13 09:02:32 -07005430
Michal Karpinski964943a2018-01-19 16:28:26 +00005431 private static final Validator AUTOFILL_SERVICE_VALIDATOR = COMPONENT_NAME_VALIDATOR;
5432
Felipe Leme5381aa42016-10-13 09:02:32 -07005433 /**
Felipe Leme78172e72017-12-08 17:01:15 -08005434 * Boolean indicating if Autofill supports field classification.
Felipe Leme24d71732017-10-20 10:32:57 -07005435 *
Felipe Leme78172e72017-12-08 17:01:15 -08005436 * @see android.service.autofill.AutofillService
5437 *
Felipe Leme24d71732017-10-20 10:32:57 -07005438 * @hide
5439 */
Felipe Leme78172e72017-12-08 17:01:15 -08005440 @SystemApi
Felipe Leme24d71732017-10-20 10:32:57 -07005441 @TestApi
Felipe Leme329d0402017-12-06 09:22:43 -08005442 public static final String AUTOFILL_FEATURE_FIELD_CLASSIFICATION =
5443 "autofill_field_classification";
Felipe Leme24d71732017-10-20 10:32:57 -07005444
5445 /**
Felipe Leme78172e72017-12-08 17:01:15 -08005446 * Defines value returned by {@link android.service.autofill.UserData#getMaxUserDataSize()}.
Felipe Leme452886a2017-11-27 13:09:13 -08005447 *
Felipe Leme452886a2017-11-27 13:09:13 -08005448 * @hide
5449 */
Felipe Leme78172e72017-12-08 17:01:15 -08005450 @SystemApi
Felipe Lemebbfed902017-12-20 15:54:33 -08005451 @TestApi
Felipe Leme452886a2017-11-27 13:09:13 -08005452 public static final String AUTOFILL_USER_DATA_MAX_USER_DATA_SIZE =
5453 "autofill_user_data_max_user_data_size";
5454
5455 /**
Felipe Leme78172e72017-12-08 17:01:15 -08005456 * Defines value returned by
5457 * {@link android.service.autofill.UserData#getMaxFieldClassificationIdsSize()}.
Felipe Leme452886a2017-11-27 13:09:13 -08005458 *
Felipe Leme452886a2017-11-27 13:09:13 -08005459 * @hide
5460 */
Felipe Leme78172e72017-12-08 17:01:15 -08005461 @SystemApi
Felipe Lemebbfed902017-12-20 15:54:33 -08005462 @TestApi
Felipe Leme452886a2017-11-27 13:09:13 -08005463 public static final String AUTOFILL_USER_DATA_MAX_FIELD_CLASSIFICATION_IDS_SIZE =
5464 "autofill_user_data_max_field_classification_size";
5465
5466 /**
Felipe Lemefebb7332018-02-12 18:12:55 -08005467 * Defines value returned by
5468 * {@link android.service.autofill.UserData#getMaxCategoryCount()}.
5469 *
5470 * @hide
5471 */
5472 @SystemApi
5473 @TestApi
5474 public static final String AUTOFILL_USER_DATA_MAX_CATEGORY_COUNT =
5475 "autofill_user_data_max_category_count";
5476
5477 /**
Felipe Leme78172e72017-12-08 17:01:15 -08005478 * Defines value returned by {@link android.service.autofill.UserData#getMaxValueLength()}.
Felipe Leme452886a2017-11-27 13:09:13 -08005479 *
Felipe Leme452886a2017-11-27 13:09:13 -08005480 * @hide
5481 */
Felipe Leme78172e72017-12-08 17:01:15 -08005482 @SystemApi
Felipe Lemebbfed902017-12-20 15:54:33 -08005483 @TestApi
Felipe Leme452886a2017-11-27 13:09:13 -08005484 public static final String AUTOFILL_USER_DATA_MAX_VALUE_LENGTH =
5485 "autofill_user_data_max_value_length";
5486
5487 /**
Felipe Leme78172e72017-12-08 17:01:15 -08005488 * Defines value returned by {@link android.service.autofill.UserData#getMinValueLength()}.
Felipe Leme452886a2017-11-27 13:09:13 -08005489 *
Felipe Leme452886a2017-11-27 13:09:13 -08005490 * @hide
5491 */
Felipe Leme78172e72017-12-08 17:01:15 -08005492 @SystemApi
Felipe Lemebbfed902017-12-20 15:54:33 -08005493 @TestApi
Felipe Leme452886a2017-11-27 13:09:13 -08005494 public static final String AUTOFILL_USER_DATA_MIN_VALUE_LENGTH =
5495 "autofill_user_data_min_value_length";
5496
5497 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005498 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005499 */
Christopher Tate06efb532012-08-24 15:29:27 -07005500 @Deprecated
5501 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005502
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005503 /**
Russell Brennerde6ae442012-09-26 20:53:10 -07005504 * Whether the current user has been set up via setup wizard (0 = false, 1 = true)
5505 * @hide
5506 */
Felipe Leme99230122017-06-12 14:33:02 -07005507 @TestApi
Russell Brennerde6ae442012-09-26 20:53:10 -07005508 public static final String USER_SETUP_COMPLETE = "user_setup_complete";
5509
5510 /**
Ajay Nadathur702fc642018-03-09 11:56:01 -08005511 * The current state of device personalization.
5512 *
5513 * @hide
5514 * @see UserSetupPersonalization
5515 */
5516 public static final String USER_SETUP_PERSONALIZATION_STATE =
5517 "user_setup_personalization_state";
5518
5519 /**
Sujith Ramakrishnan314df162017-06-16 18:03:18 -07005520 * Whether the current user has been set up via setup wizard (0 = false, 1 = true)
5521 * This value differs from USER_SETUP_COMPLETE in that it can be reset back to 0
5522 * in case SetupWizard has been re-enabled on TV devices.
5523 *
5524 * @hide
5525 */
5526 public static final String TV_USER_SETUP_COMPLETE = "tv_user_setup_complete";
5527
5528 /**
Ido Ofird193c672016-03-01 13:27:54 -08005529 * Prefix for category name that marks whether a suggested action from that category was
5530 * completed.
5531 * @hide
5532 */
5533 public static final String COMPLETED_CATEGORY_PREFIX = "suggested.completed_category.";
5534
5535 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005536 * List of input methods that are currently enabled. This is a string
5537 * containing the IDs of all enabled input methods, each ID separated
5538 * by ':'.
Michal Karpinski964943a2018-01-19 16:28:26 +00005539 *
5540 * Format like "ime0;subtype0;subtype1;subtype2:ime1:ime2;subtype0"
5541 * where imeId is ComponentName and subtype is int32.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005542 */
5543 public static final String ENABLED_INPUT_METHODS = "enabled_input_methods";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005544
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005545 /**
Amith Yamasanie861ec12010-03-24 21:39:27 -07005546 * List of system input methods that are currently disabled. This is a string
5547 * containing the IDs of all disabled input methods, each ID separated
5548 * by ':'.
5549 * @hide
5550 */
5551 public static final String DISABLED_SYSTEM_INPUT_METHODS = "disabled_system_input_methods";
5552
5553 /**
Michael Wright7b5a96b2014-08-09 19:28:42 -07005554 * Whether to show the IME when a hard keyboard is connected. This is a boolean that
5555 * determines if the IME should be shown when a hard keyboard is attached.
5556 * @hide
5557 */
5558 public static final String SHOW_IME_WITH_HARD_KEYBOARD = "show_ime_with_hard_keyboard";
5559
Michal Karpinski964943a2018-01-19 16:28:26 +00005560 private static final Validator SHOW_IME_WITH_HARD_KEYBOARD_VALIDATOR = BOOLEAN_VALIDATOR;
5561
Michael Wright7b5a96b2014-08-09 19:28:42 -07005562 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07005563 * Host name and port for global http proxy. Uses ':' seperator for
5564 * between host and port.
5565 *
5566 * @deprecated Use {@link Global#HTTP_PROXY}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005567 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07005568 @Deprecated
5569 public static final String HTTP_PROXY = Global.HTTP_PROXY;
Robert Greenwalte90aa5e2010-09-01 11:34:05 -07005570
5571 /**
Robin Lee244ce8e2016-01-05 18:03:46 +00005572 * Package designated as always-on VPN provider.
5573 *
5574 * @hide
5575 */
5576 public static final String ALWAYS_ON_VPN_APP = "always_on_vpn_app";
5577
5578 /**
Robin Lee17e61832016-05-09 13:46:28 +01005579 * Whether to block networking outside of VPN connections while always-on is set.
5580 * @see #ALWAYS_ON_VPN_APP
5581 *
5582 * @hide
5583 */
5584 public static final String ALWAYS_ON_VPN_LOCKDOWN = "always_on_vpn_lockdown";
5585
5586 /**
Christopher Tateaa036a22014-05-19 16:33:27 -07005587 * Whether applications can be installed for this user via the system's
5588 * {@link Intent#ACTION_INSTALL_PACKAGE} mechanism.
5589 *
5590 * <p>1 = permit app installation via the system package installer intent
5591 * <p>0 = do not allow use of the package installer
Suprabh Shuklaaef25132017-01-23 18:09:03 -08005592 * @deprecated Starting from {@link android.os.Build.VERSION_CODES#O}, apps should use
5593 * {@link PackageManager#canRequestPackageInstalls()}
5594 * @see PackageManager#canRequestPackageInstalls()
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005595 */
Christopher Tateaa036a22014-05-19 16:33:27 -07005596 public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005597
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005598 /**
Suprabh Shukla0b1356f2017-02-21 14:33:50 -08005599 * A flag to tell {@link com.android.server.devicepolicy.DevicePolicyManagerService} that
5600 * the default for {@link #INSTALL_NON_MARKET_APPS} is reversed for this user on OTA. So it
5601 * can set the restriction {@link android.os.UserManager#DISALLOW_INSTALL_UNKNOWN_SOURCES}
5602 * on behalf of the profile owner if needed to make the change transparent for profile
5603 * owners.
5604 *
5605 * @hide
5606 */
5607 public static final String UNKNOWN_SOURCES_DEFAULT_REVERSED =
5608 "unknown_sources_default_reversed";
5609
5610 /**
Tom O'Neill923c0dc2014-03-03 11:07:55 -08005611 * Comma-separated list of location providers that activities may access. Do not rely on
5612 * this value being present in settings.db or on ContentObserver notifications on the
5613 * corresponding Uri.
Tom O'Neilla324ac72013-08-26 14:40:23 -07005614 *
Tom O'Neill923c0dc2014-03-03 11:07:55 -08005615 * @deprecated use {@link #LOCATION_MODE} and
5616 * {@link LocationManager#MODE_CHANGED_ACTION} (or
5617 * {@link LocationManager#PROVIDERS_CHANGED_ACTION})
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005618 */
Tom O'Neilla324ac72013-08-26 14:40:23 -07005619 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005620 public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005621
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005622 /**
Tom O'Neill7f6f4572013-08-27 10:53:15 -07005623 * The degree of location access enabled by the user.
Tom O'Neill923c0dc2014-03-03 11:07:55 -08005624 * <p>
Tom O'Neill7f6f4572013-08-27 10:53:15 -07005625 * When used with {@link #putInt(ContentResolver, String, int)}, must be one of {@link
5626 * #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY}, {@link
5627 * #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}. When used with {@link
5628 * #getInt(ContentResolver, String)}, the caller must gracefully handle additional location
5629 * modes that might be added in the future.
Tom O'Neill923c0dc2014-03-03 11:07:55 -08005630 * <p>
5631 * Note: do not rely on this value being present in settings.db or on ContentObserver
5632 * notifications for the corresponding Uri. Use {@link LocationManager#MODE_CHANGED_ACTION}
5633 * to receive changes in this value.
Maggieaa080f92018-01-04 15:35:11 -08005634 *
5635 * @deprecated To check location status, use {@link LocationManager#isLocationEnabled()}. To
5636 * get the status of a location provider, use
5637 * {@link LocationManager#isProviderEnabled(String)}.
Tom O'Neilla324ac72013-08-26 14:40:23 -07005638 */
Maggieaa080f92018-01-04 15:35:11 -08005639 @Deprecated
Tom O'Neilla324ac72013-08-26 14:40:23 -07005640 public static final String LOCATION_MODE = "location_mode";
5641
5642 /**
Lifu Tang0cba58f2018-01-23 21:14:15 -08005643 * The App or module that changes the location mode.
5644 * @hide
5645 */
5646 public static final String LOCATION_CHANGER = "location_changer";
5647 /**
5648 * The location changer is unknown or unable to detect.
5649 * @hide
5650 */
5651 public static final int LOCATION_CHANGER_UNKNOWN = 0;
5652 /**
5653 * Location settings in system settings.
5654 * @hide
5655 */
5656 public static final int LOCATION_CHANGER_SYSTEM_SETTINGS = 1;
5657 /**
5658 * The location icon in drop down notification drawer.
5659 * @hide
5660 */
5661 public static final int LOCATION_CHANGER_QUICK_SETTINGS = 2;
5662
5663 /**
Tom O'Neill7f6f4572013-08-27 10:53:15 -07005664 * Location access disabled.
Maggieaa080f92018-01-04 15:35:11 -08005665 *
5666 * @deprecated To check location status, use {@link LocationManager#isLocationEnabled()}. To
5667 * get the status of a location provider, use
5668 * {@link LocationManager#isProviderEnabled(String)}.
Tom O'Neill1f48b782013-08-19 18:14:56 -07005669 */
Maggieaa080f92018-01-04 15:35:11 -08005670 @Deprecated
Tom O'Neill1f48b782013-08-19 18:14:56 -07005671 public static final int LOCATION_MODE_OFF = 0;
Maggieaa080f92018-01-04 15:35:11 -08005672
Tom O'Neill1f48b782013-08-19 18:14:56 -07005673 /**
5674 * Network Location Provider disabled, but GPS and other sensors enabled.
Maggieaa080f92018-01-04 15:35:11 -08005675 *
5676 * @deprecated To check location status, use {@link LocationManager#isLocationEnabled()}. To
5677 * get the status of a location provider, use
5678 * {@link LocationManager#isProviderEnabled(String)}.
Tom O'Neill1f48b782013-08-19 18:14:56 -07005679 */
Maggieaa080f92018-01-04 15:35:11 -08005680 @Deprecated
Tom O'Neill1f48b782013-08-19 18:14:56 -07005681 public static final int LOCATION_MODE_SENSORS_ONLY = 1;
Maggieaa080f92018-01-04 15:35:11 -08005682
Tom O'Neill1f48b782013-08-19 18:14:56 -07005683 /**
Tom O'Neilld5759432013-09-11 11:03:03 -07005684 * Reduced power usage, such as limiting the number of GPS updates per hour. Requests
5685 * with {@link android.location.Criteria#POWER_HIGH} may be downgraded to
5686 * {@link android.location.Criteria#POWER_MEDIUM}.
Maggieaa080f92018-01-04 15:35:11 -08005687 *
5688 * @deprecated To check location status, use {@link LocationManager#isLocationEnabled()}. To
5689 * get the status of a location provider, use
5690 * {@link LocationManager#isProviderEnabled(String)}.
Tom O'Neill1f48b782013-08-19 18:14:56 -07005691 */
Maggieaa080f92018-01-04 15:35:11 -08005692 @Deprecated
Tom O'Neill1f48b782013-08-19 18:14:56 -07005693 public static final int LOCATION_MODE_BATTERY_SAVING = 2;
Maggieaa080f92018-01-04 15:35:11 -08005694
Tom O'Neill1f48b782013-08-19 18:14:56 -07005695 /**
5696 * Best-effort location computation allowed.
Maggieaa080f92018-01-04 15:35:11 -08005697 *
5698 * @deprecated To check location status, use {@link LocationManager#isLocationEnabled()}. To
5699 * get the status of a location provider, use
5700 * {@link LocationManager#isProviderEnabled(String)}.
Tom O'Neill1f48b782013-08-19 18:14:56 -07005701 */
Maggieaa080f92018-01-04 15:35:11 -08005702 @Deprecated
Tom O'Neill1f48b782013-08-19 18:14:56 -07005703 public static final int LOCATION_MODE_HIGH_ACCURACY = 3;
5704
5705 /**
Danielle Millett925a7d82012-03-19 18:02:20 -04005706 * A flag containing settings used for biometric weak
5707 * @hide
5708 */
Adrian Roos230635e2015-01-07 20:50:29 +01005709 @Deprecated
Danielle Millett925a7d82012-03-19 18:02:20 -04005710 public static final String LOCK_BIOMETRIC_WEAK_FLAGS =
5711 "lock_biometric_weak_flags";
5712
5713 /**
Jason Monk94cfd9d2014-10-31 13:18:21 -04005714 * Whether lock-to-app will lock the keyguard when exiting.
5715 * @hide
5716 */
5717 public static final String LOCK_TO_APP_EXIT_LOCKED = "lock_to_app_exit_locked";
5718
5719 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08005720 * Whether autolock is enabled (0 = false, 1 = true)
Adrian Roos9dd16eb2015-01-08 16:20:49 +01005721 *
5722 * @deprecated Use {@link android.app.KeyguardManager} to determine the state and security
Adrian Roos7811d9f2015-07-27 15:10:13 -07005723 * level of the keyguard. Accessing this setting from an app that is targeting
Deepanshu Guptae836a222015-07-31 12:11:07 -07005724 * {@link VERSION_CODES#M} or later throws a {@code SecurityException}.
Amith Yamasani156c4352010-03-05 17:10:03 -08005725 */
Adrian Roos9dd16eb2015-01-08 16:20:49 +01005726 @Deprecated
Amith Yamasani156c4352010-03-05 17:10:03 -08005727 public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock";
5728
5729 /**
5730 * Whether lock pattern is visible as user enters (0 = false, 1 = true)
Adrian Roos7811d9f2015-07-27 15:10:13 -07005731 *
5732 * @deprecated Accessing this setting from an app that is targeting
Deepanshu Guptae836a222015-07-31 12:11:07 -07005733 * {@link VERSION_CODES#M} or later throws a {@code SecurityException}.
Amith Yamasani156c4352010-03-05 17:10:03 -08005734 */
Adrian Roos7811d9f2015-07-27 15:10:13 -07005735 @Deprecated
Amith Yamasani156c4352010-03-05 17:10:03 -08005736 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
5737
5738 /**
Jeff Sharkey5ed9d682012-10-10 14:28:27 -07005739 * Whether lock pattern will vibrate as user enters (0 = false, 1 =
5740 * true)
5741 *
5742 * @deprecated Starting in {@link VERSION_CODES#JELLY_BEAN_MR1} the
5743 * lockscreen uses
5744 * {@link Settings.System#HAPTIC_FEEDBACK_ENABLED}.
Adrian Roos7811d9f2015-07-27 15:10:13 -07005745 * Accessing this setting from an app that is targeting
Deepanshu Guptae836a222015-07-31 12:11:07 -07005746 * {@link VERSION_CODES#M} or later throws a {@code SecurityException}.
Amith Yamasani156c4352010-03-05 17:10:03 -08005747 */
Jeff Sharkey5ed9d682012-10-10 14:28:27 -07005748 @Deprecated
5749 public static final String
5750 LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = "lock_pattern_tactile_feedback_enabled";
Amith Yamasani156c4352010-03-05 17:10:03 -08005751
5752 /**
Jim Millerbc4603b2010-08-30 21:21:34 -07005753 * This preference allows the device to be locked given time after screen goes off,
5754 * subject to current DeviceAdmin policy limits.
5755 * @hide
5756 */
5757 public static final String LOCK_SCREEN_LOCK_AFTER_TIMEOUT = "lock_screen_lock_after_timeout";
5758
5759
5760 /**
John Spurlock5f050e52012-10-27 10:44:19 -04005761 * This preference contains the string that shows for owner info on LockScreen.
Jim Miller253a5ef2010-10-13 20:57:29 -07005762 * @hide
Jim Miller187ec582013-04-15 18:27:54 -07005763 * @deprecated
Jim Miller253a5ef2010-10-13 20:57:29 -07005764 */
Aurimas Liutikas514c5ef2016-05-24 15:22:55 -07005765 @Deprecated
Jim Miller253a5ef2010-10-13 20:57:29 -07005766 public static final String LOCK_SCREEN_OWNER_INFO = "lock_screen_owner_info";
5767
5768 /**
John Spurlock5f050e52012-10-27 10:44:19 -04005769 * Ids of the user-selected appwidgets on the lockscreen (comma-delimited).
Jim Millerf229e4d2012-09-12 20:32:50 -07005770 * @hide
5771 */
Adrian Roos230635e2015-01-07 20:50:29 +01005772 @Deprecated
Michael Jurkaaa2859a2012-10-24 12:46:49 -07005773 public static final String LOCK_SCREEN_APPWIDGET_IDS =
5774 "lock_screen_appwidget_ids";
Jim Millerf229e4d2012-09-12 20:32:50 -07005775
5776 /**
Jim Miller51117262012-11-04 17:58:09 -08005777 * Id of the appwidget shown on the lock screen when appwidgets are disabled.
5778 * @hide
5779 */
Adrian Roos230635e2015-01-07 20:50:29 +01005780 @Deprecated
Jim Miller51117262012-11-04 17:58:09 -08005781 public static final String LOCK_SCREEN_FALLBACK_APPWIDGET_ID =
5782 "lock_screen_fallback_appwidget_id";
5783
5784 /**
John Spurlock5f050e52012-10-27 10:44:19 -04005785 * Index of the lockscreen appwidget to restore, -1 if none.
5786 * @hide
5787 */
Adrian Roos230635e2015-01-07 20:50:29 +01005788 @Deprecated
John Spurlock5f050e52012-10-27 10:44:19 -04005789 public static final String LOCK_SCREEN_STICKY_APPWIDGET =
5790 "lock_screen_sticky_appwidget";
5791
5792 /**
5793 * This preference enables showing the owner info on LockScreen.
Jim Miller253a5ef2010-10-13 20:57:29 -07005794 * @hide
Jim Miller187ec582013-04-15 18:27:54 -07005795 * @deprecated
Jim Miller253a5ef2010-10-13 20:57:29 -07005796 */
Aurimas Liutikas514c5ef2016-05-24 15:22:55 -07005797 @Deprecated
Jim Miller253a5ef2010-10-13 20:57:29 -07005798 public static final String LOCK_SCREEN_OWNER_INFO_ENABLED =
5799 "lock_screen_owner_info_enabled";
5800
5801 /**
Dan Sandler5d7c3cc2014-02-18 17:35:15 -05005802 * When set by a user, allows notifications to be shown atop a securely locked screen
5803 * in their full "private" form (same as when the device is unlocked).
Dan Sandlerfd16d562014-02-13 18:43:31 -08005804 * @hide
5805 */
5806 public static final String LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS =
5807 "lock_screen_allow_private_notifications";
5808
5809 /**
Adrian Roos3aec6382016-02-05 14:19:01 -08005810 * When set by a user, allows notification remote input atop a securely locked screen
5811 * without having to unlock
5812 * @hide
5813 */
5814 public static final String LOCK_SCREEN_ALLOW_REMOTE_INPUT =
5815 "lock_screen_allow_remote_input";
5816
5817 /**
Chris Wrencd8f4f72014-08-27 18:48:13 -04005818 * Set by the system to track if the user needs to see the call to action for
5819 * the lockscreen notification policy.
5820 * @hide
5821 */
5822 public static final String SHOW_NOTE_ABOUT_NOTIFICATION_HIDING =
5823 "show_note_about_notification_hiding";
5824
5825 /**
Adrian Roos3870d452014-09-05 18:22:28 +02005826 * Set to 1 by the system after trust agents have been initialized.
5827 * @hide
5828 */
5829 public static final String TRUST_AGENTS_INITIALIZED =
5830 "trust_agents_initialized";
5831
5832 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005833 * The Logging ID (a unique 64-bit value) as a hex string.
5834 * Used as a pseudonymous identifier for logging.
5835 * @deprecated This identifier is poorly initialized and has
5836 * many collisions. It should not be used.
5837 */
5838 @Deprecated
5839 public static final String LOGGING_ID = "logging_id";
5840
5841 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005842 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005843 */
Christopher Tate06efb532012-08-24 15:29:27 -07005844 @Deprecated
5845 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005846
5847 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08005848 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005849 */
5850 public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005851
5852 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08005853 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005854 */
5855 public static final String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005856
5857 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08005858 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005859 */
5860 public static final String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005861
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005862 /**
5863 * Settings classname to launch when Settings is clicked from All
5864 * Applications. Needed because of user testing between the old
5865 * and new Settings apps.
5866 */
5867 // TODO: 881807
5868 public static final String SETTINGS_CLASSNAME = "settings_classname";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005869
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005870 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005871 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005872 */
Christopher Tate06efb532012-08-24 15:29:27 -07005873 @Deprecated
5874 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005875
Michal Karpinski5db1e432018-01-18 20:10:24 +00005876 private static final Validator USB_MASS_STORAGE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
5877
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005878 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005879 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005880 */
Christopher Tate06efb532012-08-24 15:29:27 -07005881 @Deprecated
5882 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005883
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005884 /**
svetoslavganov75986cf2009-05-14 22:28:01 -07005885 * If accessibility is enabled.
5886 */
5887 public static final String ACCESSIBILITY_ENABLED = "accessibility_enabled";
5888
Michal Karpinski964943a2018-01-19 16:28:26 +00005889 private static final Validator ACCESSIBILITY_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
5890
svetoslavganov75986cf2009-05-14 22:28:01 -07005891 /**
Phil Weaverce687c52017-03-15 08:51:52 -07005892 * Setting specifying if the accessibility shortcut is enabled.
5893 * @hide
5894 */
5895 public static final String ACCESSIBILITY_SHORTCUT_ENABLED =
5896 "accessibility_shortcut_enabled";
5897
Michal Karpinski964943a2018-01-19 16:28:26 +00005898 private static final Validator ACCESSIBILITY_SHORTCUT_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
5899
Phil Weaverce687c52017-03-15 08:51:52 -07005900 /**
5901 * Setting specifying if the accessibility shortcut is enabled.
5902 * @hide
5903 */
5904 public static final String ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN =
5905 "accessibility_shortcut_on_lock_screen";
5906
Michal Karpinski964943a2018-01-19 16:28:26 +00005907 private static final Validator ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN_VALIDATOR =
5908 BOOLEAN_VALIDATOR;
5909
Phil Weaverce687c52017-03-15 08:51:52 -07005910 /**
Phil Weaver106fe732016-11-22 18:18:39 -08005911 * Setting specifying if the accessibility shortcut dialog has been shown to this user.
5912 * @hide
5913 */
5914 public static final String ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN =
5915 "accessibility_shortcut_dialog_shown";
5916
Michal Karpinski964943a2018-01-19 16:28:26 +00005917 private static final Validator ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN_VALIDATOR =
5918 BOOLEAN_VALIDATOR;
5919
Phil Weaver106fe732016-11-22 18:18:39 -08005920 /**
Phil Weaverce687c52017-03-15 08:51:52 -07005921 * Setting specifying the accessibility service to be toggled via the accessibility
Phil Weaver106fe732016-11-22 18:18:39 -08005922 * shortcut. Must be its flattened {@link ComponentName}.
5923 * @hide
5924 */
5925 public static final String ACCESSIBILITY_SHORTCUT_TARGET_SERVICE =
5926 "accessibility_shortcut_target_service";
5927
Michal Karpinski964943a2018-01-19 16:28:26 +00005928 private static final Validator ACCESSIBILITY_SHORTCUT_TARGET_SERVICE_VALIDATOR =
5929 COMPONENT_NAME_VALIDATOR;
5930
Phil Weaver106fe732016-11-22 18:18:39 -08005931 /**
Casey Burkhardt5e8b9802017-03-24 10:07:20 -07005932 * Setting specifying the accessibility service or feature to be toggled via the
5933 * accessibility button in the navigation bar. This is either a flattened
5934 * {@link ComponentName} or the class name of a system class implementing a supported
5935 * accessibility feature.
5936 * @hide
5937 */
5938 public static final String ACCESSIBILITY_BUTTON_TARGET_COMPONENT =
5939 "accessibility_button_target_component";
5940
Michal Karpinski964943a2018-01-19 16:28:26 +00005941 private static final Validator ACCESSIBILITY_BUTTON_TARGET_COMPONENT_VALIDATOR =
5942 new Validator() {
5943 @Override
5944 public boolean validate(String value) {
5945 // technically either ComponentName or class name, but there's proper value
5946 // validation at callsites, so allow any non-null string
5947 return value != null;
5948 }
5949 };
5950
Casey Burkhardt5e8b9802017-03-24 10:07:20 -07005951 /**
Svetoslav Ganov00aabf72011-07-21 11:35:03 -07005952 * If touch exploration is enabled.
Svetoslav Ganov35bfede2011-07-14 17:57:06 -07005953 */
Svetoslav Ganov00aabf72011-07-21 11:35:03 -07005954 public static final String TOUCH_EXPLORATION_ENABLED = "touch_exploration_enabled";
Svetoslav Ganov35bfede2011-07-14 17:57:06 -07005955
Michal Karpinski964943a2018-01-19 16:28:26 +00005956 private static final Validator TOUCH_EXPLORATION_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
5957
Svetoslav Ganov35bfede2011-07-14 17:57:06 -07005958 /**
svetoslavganov75986cf2009-05-14 22:28:01 -07005959 * List of the enabled accessibility providers.
5960 */
5961 public static final String ENABLED_ACCESSIBILITY_SERVICES =
5962 "enabled_accessibility_services";
5963
Michal Karpinski964943a2018-01-19 16:28:26 +00005964 private static final Validator ENABLED_ACCESSIBILITY_SERVICES_VALIDATOR =
5965 new SettingsValidators.ComponentNameListValidator(":");
5966
svetoslavganov75986cf2009-05-14 22:28:01 -07005967 /**
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07005968 * List of the accessibility services to which the user has granted
Svetoslav Ganov9a4c5cd2012-05-30 14:06:32 -07005969 * permission to put the device into touch exploration mode.
5970 *
5971 * @hide
5972 */
5973 public static final String TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES =
5974 "touch_exploration_granted_accessibility_services";
5975
Michal Karpinski964943a2018-01-19 16:28:26 +00005976 private static final Validator TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES_VALIDATOR =
5977 new SettingsValidators.ComponentNameListValidator(":");
5978
Svetoslav Ganov9a4c5cd2012-05-30 14:06:32 -07005979 /**
Lucas Dupin6bd86012017-12-05 17:58:57 -08005980 * Uri of the slice that's presented on the keyguard.
5981 * Defaults to a slice with the date and next alarm.
5982 *
5983 * @hide
5984 */
5985 public static final String KEYGUARD_SLICE_URI = "keyguard_slice_uri";
5986
5987 /**
Svetoslav Ganov55f937a2011-12-05 11:42:07 -08005988 * Whether to speak passwords while in accessibility mode.
Phil Weaver385912e2017-02-10 10:06:56 -08005989 *
5990 * @deprecated The speaking of passwords is controlled by individual accessibility services.
5991 * Apps should ignore this setting and provide complete information to accessibility
5992 * at all times, which was the behavior when this value was {@code true}.
Svetoslav Ganov55f937a2011-12-05 11:42:07 -08005993 */
Phil Weaver385912e2017-02-10 10:06:56 -08005994 @Deprecated
Svetoslav Ganov55f937a2011-12-05 11:42:07 -08005995 public static final String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password";
5996
Michal Karpinski964943a2018-01-19 16:28:26 +00005997 private static final Validator ACCESSIBILITY_SPEAK_PASSWORD_VALIDATOR = BOOLEAN_VALIDATOR;
5998
Svetoslav Ganov55f937a2011-12-05 11:42:07 -08005999 /**
Chris Craikcce47eb2014-07-16 15:12:15 -07006000 * Whether to draw text with high contrast while in accessibility mode.
6001 *
6002 * @hide
6003 */
6004 public static final String ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED =
6005 "high_text_contrast_enabled";
6006
Michal Karpinski964943a2018-01-19 16:28:26 +00006007 private static final Validator ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED_VALIDATOR =
6008 BOOLEAN_VALIDATOR;
6009
Chris Craikcce47eb2014-07-16 15:12:15 -07006010 /**
Casey Burkhardt74922c62017-02-13 12:43:16 -08006011 * Setting that specifies whether the display magnification is enabled via a system-wide
6012 * triple tap gesture. Display magnifications allows the user to zoom in the display content
6013 * and is targeted to low vision users. The current magnification scale is controlled by
6014 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}.
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07006015 *
6016 * @hide
6017 */
Eugene Suslaa55f74e2017-09-21 13:48:50 -07006018 @TestApi
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07006019 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED =
6020 "accessibility_display_magnification_enabled";
6021
Michal Karpinski964943a2018-01-19 16:28:26 +00006022 private static final Validator ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED_VALIDATOR =
6023 BOOLEAN_VALIDATOR;
6024
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07006025 /**
Casey Burkhardt74922c62017-02-13 12:43:16 -08006026 * Setting that specifies whether the display magnification is enabled via a shortcut
6027 * affordance within the system's navigation area. Display magnifications allows the user to
6028 * zoom in the display content and is targeted to low vision users. The current
6029 * magnification scale is controlled by {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}.
6030 *
6031 * @hide
6032 */
6033 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED =
6034 "accessibility_display_magnification_navbar_enabled";
6035
Michal Karpinski964943a2018-01-19 16:28:26 +00006036 private static final Validator ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED_VALIDATOR
6037 = BOOLEAN_VALIDATOR;
6038
Casey Burkhardt74922c62017-02-13 12:43:16 -08006039 /**
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07006040 * Setting that specifies what the display magnification scale is.
6041 * Display magnifications allows the user to zoom in the display
6042 * content and is targeted to low vision users. Whether a display
6043 * magnification is performed is controlled by
Casey Burkhardt74922c62017-02-13 12:43:16 -08006044 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED} and
6045 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED}
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07006046 *
6047 * @hide
6048 */
6049 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE =
6050 "accessibility_display_magnification_scale";
6051
Michal Karpinski964943a2018-01-19 16:28:26 +00006052 private static final Validator ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE_VALIDATOR =
6053 new SettingsValidators.InclusiveFloatRangeValidator(1.0f, Float.MAX_VALUE);
6054
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07006055 /**
Phil Weaver89e3ffc2016-09-19 13:51:10 -07006056 * Unused mangnification setting
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07006057 *
6058 * @hide
Phil Weaver89e3ffc2016-09-19 13:51:10 -07006059 * @deprecated
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07006060 */
Steve McKayea93fe72016-12-02 11:35:35 -08006061 @Deprecated
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07006062 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE =
6063 "accessibility_display_magnification_auto_update";
6064
6065 /**
Anna Galusza9b278112016-01-04 11:37:37 -08006066 * Setting that specifies what mode the soft keyboard is in (default or hidden). Can be
6067 * modified from an AccessibilityService using the SoftKeyboardController.
6068 *
6069 * @hide
6070 */
6071 public static final String ACCESSIBILITY_SOFT_KEYBOARD_MODE =
6072 "accessibility_soft_keyboard_mode";
6073
6074 /**
6075 * Default soft keyboard behavior.
6076 *
6077 * @hide
6078 */
6079 public static final int SHOW_MODE_AUTO = 0;
6080
6081 /**
6082 * Soft keyboard is never shown.
6083 *
6084 * @hide
6085 */
6086 public static final int SHOW_MODE_HIDDEN = 1;
6087
6088 /**
Alan Viveretteef793802013-07-23 14:15:28 -07006089 * Setting that specifies whether timed text (captions) should be
6090 * displayed in video content. Text display properties are controlled by
6091 * the following settings:
6092 * <ul>
6093 * <li>{@link #ACCESSIBILITY_CAPTIONING_LOCALE}
6094 * <li>{@link #ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR}
6095 * <li>{@link #ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR}
6096 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_COLOR}
6097 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_TYPE}
6098 * <li>{@link #ACCESSIBILITY_CAPTIONING_TYPEFACE}
Alan Viverette69ce69b2013-08-29 12:23:48 -07006099 * <li>{@link #ACCESSIBILITY_CAPTIONING_FONT_SCALE}
Alan Viveretteef793802013-07-23 14:15:28 -07006100 * </ul>
6101 *
6102 * @hide
6103 */
6104 public static final String ACCESSIBILITY_CAPTIONING_ENABLED =
6105 "accessibility_captioning_enabled";
6106
Michal Karpinski964943a2018-01-19 16:28:26 +00006107 private static final Validator ACCESSIBILITY_CAPTIONING_ENABLED_VALIDATOR =
6108 BOOLEAN_VALIDATOR;
6109
Alan Viveretteef793802013-07-23 14:15:28 -07006110 /**
6111 * Setting that specifies the language for captions as a locale string,
6112 * e.g. en_US.
6113 *
6114 * @see java.util.Locale#toString
6115 * @hide
6116 */
6117 public static final String ACCESSIBILITY_CAPTIONING_LOCALE =
6118 "accessibility_captioning_locale";
6119
Michal Karpinski964943a2018-01-19 16:28:26 +00006120 private static final Validator ACCESSIBILITY_CAPTIONING_LOCALE_VALIDATOR = LOCALE_VALIDATOR;
6121
Alan Viveretteef793802013-07-23 14:15:28 -07006122 /**
Alan Viverette43a1e3d2013-08-02 16:45:03 -07006123 * Integer property that specifies the preset style for captions, one
6124 * of:
6125 * <ul>
Alan Viverette69ce69b2013-08-29 12:23:48 -07006126 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESET_CUSTOM}
6127 * <li>a valid index of {@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESETS}
Alan Viverette43a1e3d2013-08-02 16:45:03 -07006128 * </ul>
6129 *
6130 * @see java.util.Locale#toString
6131 * @hide
6132 */
6133 public static final String ACCESSIBILITY_CAPTIONING_PRESET =
6134 "accessibility_captioning_preset";
6135
Michal Karpinski964943a2018-01-19 16:28:26 +00006136 private static final Validator ACCESSIBILITY_CAPTIONING_PRESET_VALIDATOR =
6137 new SettingsValidators.DiscreteValueValidator(new String[]{"-1", "0", "1", "2",
6138 "3", "4"});
6139
Alan Viverette43a1e3d2013-08-02 16:45:03 -07006140 /**
Alan Viveretteef793802013-07-23 14:15:28 -07006141 * Integer property that specifes the background color for captions as a
6142 * packed 32-bit color.
6143 *
6144 * @see android.graphics.Color#argb
6145 * @hide
6146 */
6147 public static final String ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR =
6148 "accessibility_captioning_background_color";
6149
Michal Karpinski964943a2018-01-19 16:28:26 +00006150 private static final Validator ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR_VALIDATOR =
6151 ANY_INTEGER_VALIDATOR;
6152
Alan Viveretteef793802013-07-23 14:15:28 -07006153 /**
6154 * Integer property that specifes the foreground color for captions as a
6155 * packed 32-bit color.
6156 *
6157 * @see android.graphics.Color#argb
6158 * @hide
6159 */
6160 public static final String ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR =
6161 "accessibility_captioning_foreground_color";
6162
Michal Karpinski964943a2018-01-19 16:28:26 +00006163 private static final Validator ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR_VALIDATOR =
6164 ANY_INTEGER_VALIDATOR;
6165
Alan Viveretteef793802013-07-23 14:15:28 -07006166 /**
6167 * Integer property that specifes the edge type for captions, one of:
6168 * <ul>
Alan Viverette69ce69b2013-08-29 12:23:48 -07006169 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_NONE}
6170 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_OUTLINE}
6171 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_DROP_SHADOW}
Alan Viveretteef793802013-07-23 14:15:28 -07006172 * </ul>
6173 *
6174 * @see #ACCESSIBILITY_CAPTIONING_EDGE_COLOR
6175 * @hide
6176 */
6177 public static final String ACCESSIBILITY_CAPTIONING_EDGE_TYPE =
6178 "accessibility_captioning_edge_type";
6179
Michal Karpinski964943a2018-01-19 16:28:26 +00006180 private static final Validator ACCESSIBILITY_CAPTIONING_EDGE_TYPE_VALIDATOR =
6181 new SettingsValidators.DiscreteValueValidator(new String[]{"0", "1", "2"});
6182
Alan Viveretteef793802013-07-23 14:15:28 -07006183 /**
6184 * Integer property that specifes the edge color for captions as a
6185 * packed 32-bit color.
6186 *
6187 * @see #ACCESSIBILITY_CAPTIONING_EDGE_TYPE
6188 * @see android.graphics.Color#argb
6189 * @hide
6190 */
6191 public static final String ACCESSIBILITY_CAPTIONING_EDGE_COLOR =
6192 "accessibility_captioning_edge_color";
6193
Michal Karpinski964943a2018-01-19 16:28:26 +00006194 private static final Validator ACCESSIBILITY_CAPTIONING_EDGE_COLOR_VALIDATOR =
6195 ANY_INTEGER_VALIDATOR;
6196
Alan Viveretteef793802013-07-23 14:15:28 -07006197 /**
Alan Viverette55d70622013-12-11 15:22:14 -08006198 * Integer property that specifes the window color for captions as a
6199 * packed 32-bit color.
6200 *
6201 * @see android.graphics.Color#argb
6202 * @hide
6203 */
6204 public static final String ACCESSIBILITY_CAPTIONING_WINDOW_COLOR =
6205 "accessibility_captioning_window_color";
6206
Michal Karpinski964943a2018-01-19 16:28:26 +00006207 private static final Validator ACCESSIBILITY_CAPTIONING_WINDOW_COLOR_VALIDATOR =
6208 ANY_INTEGER_VALIDATOR;
6209
Alan Viverette55d70622013-12-11 15:22:14 -08006210 /**
Alan Viveretteef793802013-07-23 14:15:28 -07006211 * String property that specifies the typeface for captions, one of:
6212 * <ul>
6213 * <li>DEFAULT
6214 * <li>MONOSPACE
6215 * <li>SANS_SERIF
6216 * <li>SERIF
6217 * </ul>
6218 *
6219 * @see android.graphics.Typeface
6220 * @hide
6221 */
6222 public static final String ACCESSIBILITY_CAPTIONING_TYPEFACE =
6223 "accessibility_captioning_typeface";
6224
Michal Karpinski964943a2018-01-19 16:28:26 +00006225 private static final Validator ACCESSIBILITY_CAPTIONING_TYPEFACE_VALIDATOR =
6226 new SettingsValidators.DiscreteValueValidator(new String[]{"DEFAULT",
6227 "MONOSPACE", "SANS_SERIF", "SERIF"});
6228
Alan Viveretteef793802013-07-23 14:15:28 -07006229 /**
Alan Viverette69ce69b2013-08-29 12:23:48 -07006230 * Floating point property that specifies font scaling for captions.
Alan Viveretteef793802013-07-23 14:15:28 -07006231 *
6232 * @hide
6233 */
Alan Viverette69ce69b2013-08-29 12:23:48 -07006234 public static final String ACCESSIBILITY_CAPTIONING_FONT_SCALE =
6235 "accessibility_captioning_font_scale";
Alan Viveretteef793802013-07-23 14:15:28 -07006236
Michal Karpinski964943a2018-01-19 16:28:26 +00006237 private static final Validator ACCESSIBILITY_CAPTIONING_FONT_SCALE_VALIDATOR =
6238 new SettingsValidators.InclusiveFloatRangeValidator(0.5f, 2.0f);
6239
Alan Viveretteef793802013-07-23 14:15:28 -07006240 /**
Alan Viverette410d4e32013-09-30 15:37:38 -07006241 * Setting that specifies whether display color inversion is enabled.
Alan Viverette410d4e32013-09-30 15:37:38 -07006242 */
6243 public static final String ACCESSIBILITY_DISPLAY_INVERSION_ENABLED =
6244 "accessibility_display_inversion_enabled";
6245
Michal Karpinski964943a2018-01-19 16:28:26 +00006246 private static final Validator ACCESSIBILITY_DISPLAY_INVERSION_ENABLED_VALIDATOR =
6247 BOOLEAN_VALIDATOR;
6248
Alan Viverette410d4e32013-09-30 15:37:38 -07006249 /**
Alan Viverette410d4e32013-09-30 15:37:38 -07006250 * Setting that specifies whether display color space adjustment is
6251 * enabled.
6252 *
6253 * @hide
6254 */
6255 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED =
6256 "accessibility_display_daltonizer_enabled";
6257
Michal Karpinski964943a2018-01-19 16:28:26 +00006258 private static final Validator ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED_VALIDATOR =
6259 BOOLEAN_VALIDATOR;
6260
Alan Viverette410d4e32013-09-30 15:37:38 -07006261 /**
6262 * Integer property that specifies the type of color space adjustment to
Phil Weaver7b8c8e22018-03-09 09:58:09 -08006263 * perform. Valid values are defined in AccessibilityManager and Settings arrays.xml:
Michal Karpinski964943a2018-01-19 16:28:26 +00006264 * - AccessibilityManager.DALTONIZER_DISABLED = -1
6265 * - AccessibilityManager.DALTONIZER_SIMULATE_MONOCHROMACY = 0
Phil Weaver7b8c8e22018-03-09 09:58:09 -08006266 * - <item>@string/daltonizer_mode_protanomaly</item> = 11
6267 * - AccessibilityManager.DALTONIZER_CORRECT_DEUTERANOMALY and
6268 * <item>@string/daltonizer_mode_deuteranomaly</item> = 12
6269 * - <item>@string/daltonizer_mode_tritanomaly</item> = 13
Alan Viverette410d4e32013-09-30 15:37:38 -07006270 *
6271 * @hide
6272 */
6273 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER =
6274 "accessibility_display_daltonizer";
6275
Michal Karpinski964943a2018-01-19 16:28:26 +00006276 private static final Validator ACCESSIBILITY_DISPLAY_DALTONIZER_VALIDATOR =
Phil Weaver7b8c8e22018-03-09 09:58:09 -08006277 new SettingsValidators.DiscreteValueValidator(
6278 new String[] {"-1", "0", "11", "12", "13"});
Michal Karpinski964943a2018-01-19 16:28:26 +00006279
Alan Viverette410d4e32013-09-30 15:37:38 -07006280 /**
Toni Barzic386f8342015-09-09 12:30:41 -07006281 * Setting that specifies whether automatic click when the mouse pointer stops moving is
6282 * enabled.
6283 *
6284 * @hide
6285 */
6286 public static final String ACCESSIBILITY_AUTOCLICK_ENABLED =
6287 "accessibility_autoclick_enabled";
6288
Michal Karpinski964943a2018-01-19 16:28:26 +00006289 private static final Validator ACCESSIBILITY_AUTOCLICK_ENABLED_VALIDATOR =
6290 BOOLEAN_VALIDATOR;
6291
Toni Barzic386f8342015-09-09 12:30:41 -07006292 /**
6293 * Integer setting specifying amount of time in ms the mouse pointer has to stay still
6294 * before performing click when {@link #ACCESSIBILITY_AUTOCLICK_ENABLED} is set.
6295 *
6296 * @see #ACCESSIBILITY_AUTOCLICK_ENABLED
6297 * @hide
6298 */
6299 public static final String ACCESSIBILITY_AUTOCLICK_DELAY =
6300 "accessibility_autoclick_delay";
6301
Michal Karpinski964943a2018-01-19 16:28:26 +00006302 private static final Validator ACCESSIBILITY_AUTOCLICK_DELAY_VALIDATOR =
6303 NON_NEGATIVE_INTEGER_VALIDATOR;
6304
Toni Barzic386f8342015-09-09 12:30:41 -07006305 /**
Jun Mukai19a56012015-11-24 11:25:52 -08006306 * Whether or not larger size icons are used for the pointer of mouse/trackpad for
6307 * accessibility.
6308 * (0 = false, 1 = true)
6309 * @hide
6310 */
6311 public static final String ACCESSIBILITY_LARGE_POINTER_ICON =
6312 "accessibility_large_pointer_icon";
6313
Michal Karpinski964943a2018-01-19 16:28:26 +00006314 private static final Validator ACCESSIBILITY_LARGE_POINTER_ICON_VALIDATOR =
6315 BOOLEAN_VALIDATOR;
6316
Jun Mukai19a56012015-11-24 11:25:52 -08006317 /**
Toni Barzic386f8342015-09-09 12:30:41 -07006318 * The timeout for considering a press to be a long press in milliseconds.
Svetoslav Ganov54d068e2011-03-02 12:58:40 -08006319 * @hide
6320 */
6321 public static final String LONG_PRESS_TIMEOUT = "long_press_timeout";
6322
Michal Karpinski964943a2018-01-19 16:28:26 +00006323 private static final Validator LONG_PRESS_TIMEOUT_VALIDATOR =
6324 NON_NEGATIVE_INTEGER_VALIDATOR;
6325
Svetoslav Ganov54d068e2011-03-02 12:58:40 -08006326 /**
Anthony Hugh96e9cc52016-07-12 15:17:24 -07006327 * The duration in milliseconds between the first tap's up event and the second tap's
6328 * down event for an interaction to be considered part of the same multi-press.
6329 * @hide
6330 */
6331 public static final String MULTI_PRESS_TIMEOUT = "multi_press_timeout";
6332
6333 /**
Svetoslav Ganov6bd20bc2013-09-02 15:24:45 -07006334 * List of the enabled print services.
Philip P. Moltmann8141bdf2015-12-21 17:03:05 -08006335 *
6336 * N and beyond uses {@link #DISABLED_PRINT_SERVICES}. But this might be used in an upgrade
6337 * from pre-N.
6338 *
Svetoslav Ganov4b9a4d12013-06-11 15:20:06 -07006339 * @hide
6340 */
6341 public static final String ENABLED_PRINT_SERVICES =
6342 "enabled_print_services";
6343
6344 /**
Philip P. Moltmann8141bdf2015-12-21 17:03:05 -08006345 * List of the disabled print services.
6346 *
Svetoslav Ganov6bd20bc2013-09-02 15:24:45 -07006347 * @hide
6348 */
Svetoslav Ganov2dcedc122017-06-07 18:50:02 -07006349 @TestApi
Philip P. Moltmann8141bdf2015-12-21 17:03:05 -08006350 public static final String DISABLED_PRINT_SERVICES =
6351 "disabled_print_services";
Svetoslav Ganov6bd20bc2013-09-02 15:24:45 -07006352
6353 /**
Alan Viverette5e8d8372016-02-03 15:38:59 -05006354 * The saved value for WindowManagerService.setForcedDisplayDensity()
6355 * formatted as a single integer representing DPI. If unset, then use
6356 * the real display density.
6357 *
6358 * @hide
6359 */
6360 public static final String DISPLAY_DENSITY_FORCED = "display_density_forced";
6361
6362 /**
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07006363 * Setting to always use the default text-to-speech settings regardless
6364 * of the application settings.
6365 * 1 = override application settings,
6366 * 0 = use application settings (if specified).
Narayan Kamath6d632962011-08-24 11:51:37 +01006367 *
6368 * @deprecated The value of this setting is no longer respected by
6369 * the framework text to speech APIs as of the Ice Cream Sandwich release.
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07006370 */
Narayan Kamath6d632962011-08-24 11:51:37 +01006371 @Deprecated
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07006372 public static final String TTS_USE_DEFAULTS = "tts_use_defaults";
6373
6374 /**
6375 * Default text-to-speech engine speech rate. 100 = 1x
6376 */
6377 public static final String TTS_DEFAULT_RATE = "tts_default_rate";
6378
Michal Karpinski964943a2018-01-19 16:28:26 +00006379 private static final Validator TTS_DEFAULT_RATE_VALIDATOR = NON_NEGATIVE_INTEGER_VALIDATOR;
6380
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07006381 /**
6382 * Default text-to-speech engine pitch. 100 = 1x
6383 */
6384 public static final String TTS_DEFAULT_PITCH = "tts_default_pitch";
6385
Michal Karpinski964943a2018-01-19 16:28:26 +00006386 private static final Validator TTS_DEFAULT_PITCH_VALIDATOR = NON_NEGATIVE_INTEGER_VALIDATOR;
6387
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07006388 /**
6389 * Default text-to-speech engine.
6390 */
6391 public static final String TTS_DEFAULT_SYNTH = "tts_default_synth";
6392
Michal Karpinski964943a2018-01-19 16:28:26 +00006393 private static final Validator TTS_DEFAULT_SYNTH_VALIDATOR = PACKAGE_NAME_VALIDATOR;
6394
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07006395 /**
Jean-Michel Trivif4782672009-06-09 16:22:48 -07006396 * Default text-to-speech language.
Narayan Kamath6d632962011-08-24 11:51:37 +01006397 *
6398 * @deprecated this setting is no longer in use, as of the Ice Cream
6399 * Sandwich release. Apps should never need to read this setting directly,
6400 * instead can query the TextToSpeech framework classes for the default
6401 * locale. {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivif4782672009-06-09 16:22:48 -07006402 */
Narayan Kamath6d632962011-08-24 11:51:37 +01006403 @Deprecated
Jean-Michel Trivif4782672009-06-09 16:22:48 -07006404 public static final String TTS_DEFAULT_LANG = "tts_default_lang";
6405
6406 /**
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07006407 * Default text-to-speech country.
Narayan Kamath6d632962011-08-24 11:51:37 +01006408 *
6409 * @deprecated this setting is no longer in use, as of the Ice Cream
6410 * Sandwich release. Apps should never need to read this setting directly,
6411 * instead can query the TextToSpeech framework classes for the default
6412 * locale. {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07006413 */
Narayan Kamath6d632962011-08-24 11:51:37 +01006414 @Deprecated
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07006415 public static final String TTS_DEFAULT_COUNTRY = "tts_default_country";
6416
6417 /**
6418 * Default text-to-speech locale variant.
Narayan Kamath6d632962011-08-24 11:51:37 +01006419 *
6420 * @deprecated this setting is no longer in use, as of the Ice Cream
6421 * Sandwich release. Apps should never need to read this setting directly,
6422 * instead can query the TextToSpeech framework classes for the
6423 * locale that is in use {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07006424 */
Narayan Kamath6d632962011-08-24 11:51:37 +01006425 @Deprecated
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07006426 public static final String TTS_DEFAULT_VARIANT = "tts_default_variant";
6427
6428 /**
Narayan Kamathe5b8c4d2011-08-22 15:37:47 +01006429 * Stores the default tts locales on a per engine basis. Stored as
6430 * a comma seperated list of values, each value being of the form
6431 * {@code engine_name:locale} for example,
Narayan Kamath6d632962011-08-24 11:51:37 +01006432 * {@code com.foo.ttsengine:eng-USA,com.bar.ttsengine:esp-ESP}. This
6433 * supersedes {@link #TTS_DEFAULT_LANG}, {@link #TTS_DEFAULT_COUNTRY} and
6434 * {@link #TTS_DEFAULT_VARIANT}. Apps should never need to read this
6435 * setting directly, and can query the TextToSpeech framework classes
6436 * for the locale that is in use.
Narayan Kamathe5b8c4d2011-08-22 15:37:47 +01006437 *
6438 * @hide
6439 */
6440 public static final String TTS_DEFAULT_LOCALE = "tts_default_locale";
6441
Michal Karpinski964943a2018-01-19 16:28:26 +00006442 private static final Validator TTS_DEFAULT_LOCALE_VALIDATOR = new Validator() {
6443 @Override
6444 public boolean validate(String value) {
6445 if (value == null || value.length() == 0) {
6446 return false;
6447 }
6448 String[] ttsLocales = value.split(",");
6449 boolean valid = true;
6450 for (String ttsLocale : ttsLocales) {
6451 String[] parts = ttsLocale.split(":");
6452 valid |= ((parts.length == 2)
6453 && (parts[0].length() > 0)
6454 && ANY_STRING_VALIDATOR.validate(parts[0])
6455 && LOCALE_VALIDATOR.validate(parts[1]));
6456 }
6457 return valid;
6458 }
6459 };
6460
Narayan Kamathe5b8c4d2011-08-22 15:37:47 +01006461 /**
Charles Chenceffa152010-03-16 21:18:10 -07006462 * Space delimited list of plugin packages that are enabled.
6463 */
6464 public static final String TTS_ENABLED_PLUGINS = "tts_enabled_plugins";
6465
Michal Karpinski964943a2018-01-19 16:28:26 +00006466 private static final Validator TTS_ENABLED_PLUGINS_VALIDATOR =
6467 new SettingsValidators.PackageNameListValidator(" ");
6468
Charles Chenceffa152010-03-16 21:18:10 -07006469 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07006470 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON}
6471 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006472 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07006473 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006474 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
Christopher Tate6f5a9a92012-09-14 17:24:28 -07006475 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006476
Michal Karpinski964943a2018-01-19 16:28:26 +00006477 private static final Validator WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR =
6478 BOOLEAN_VALIDATOR;
Michal Karpinski5db1e432018-01-18 20:10:24 +00006479
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006480 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07006481 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY}
6482 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006483 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07006484 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006485 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
Christopher Tate6f5a9a92012-09-14 17:24:28 -07006486 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006487
Michal Karpinski964943a2018-01-19 16:28:26 +00006488 private static final Validator WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_VALIDATOR =
6489 NON_NEGATIVE_INTEGER_VALIDATOR;
6490
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006491 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07006492 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
6493 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006494 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07006495 @Deprecated
6496 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT =
6497 Global.WIFI_NUM_OPEN_NETWORKS_KEPT;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006498
Michal Karpinski964943a2018-01-19 16:28:26 +00006499 private static final Validator WIFI_NUM_OPEN_NETWORKS_KEPT_VALIDATOR =
6500 NON_NEGATIVE_INTEGER_VALIDATOR;
6501
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006502 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07006503 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON}
6504 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006505 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07006506 @Deprecated
6507 public static final String WIFI_ON = Global.WIFI_ON;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006508
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006509 /**
6510 * The acceptable packet loss percentage (range 0 - 100) before trying
6511 * another AP on the same network.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006512 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006513 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07006514 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006515 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
6516 "wifi_watchdog_acceptable_packet_loss_percentage";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006517
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006518 /**
6519 * The number of access points required for a network in order for the
6520 * watchdog to monitor it.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006521 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006522 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07006523 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006524 public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006525
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006526 /**
6527 * The delay between background checks.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006528 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006529 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07006530 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006531 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
6532 "wifi_watchdog_background_check_delay_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006533
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006534 /**
6535 * Whether the Wi-Fi watchdog is enabled for background checking even
6536 * after it thinks the user has connected to a good access point.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006537 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006538 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07006539 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006540 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
6541 "wifi_watchdog_background_check_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006542
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006543 /**
6544 * The timeout for a background ping
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006545 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006546 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07006547 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006548 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
6549 "wifi_watchdog_background_check_timeout_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006550
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006551 /**
6552 * The number of initial pings to perform that *may* be ignored if they
6553 * fail. Again, if these fail, they will *not* be used in packet loss
6554 * calculation. For example, one network always seemed to time out for
6555 * the first couple pings, so this is set to 3 by default.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006556 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006557 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07006558 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006559 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
6560 "wifi_watchdog_initial_ignored_ping_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006561
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006562 /**
6563 * The maximum number of access points (per network) to attempt to test.
6564 * If this number is reached, the watchdog will no longer monitor the
6565 * initial connection state for the network. This is a safeguard for
6566 * networks containing multiple APs whose DNS does not respond to pings.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006567 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006568 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07006569 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006570 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = "wifi_watchdog_max_ap_checks";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006571
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006572 /**
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07006573 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006574 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07006575 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006576 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
6577
6578 /**
6579 * A comma-separated list of SSIDs for which the Wi-Fi watchdog should be enabled.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006580 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006581 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07006582 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006583 public static final String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list";
6584
6585 /**
6586 * The number of pings to test if an access point is a good connection.
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_PING_COUNT = "wifi_watchdog_ping_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006591
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006592 /**
6593 * The delay between pings.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006594 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006595 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07006596 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006597 public static final String WIFI_WATCHDOG_PING_DELAY_MS = "wifi_watchdog_ping_delay_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006598
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006599 /**
6600 * The timeout per ping.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006601 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006602 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07006603 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006604 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006605
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006606 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006607 * @deprecated Use
6608 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006609 */
Christopher Tate06efb532012-08-24 15:29:27 -07006610 @Deprecated
6611 public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006612
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006613 /**
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006614 * @deprecated Use
6615 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006616 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07006617 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006618 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006619 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006620
6621 /**
Jeremy Joslin79294842014-12-03 17:15:28 -08006622 * The number of milliseconds to hold on to a PendingIntent based request. This delay gives
6623 * the receivers of the PendingIntent an opportunity to make a new network request before
6624 * the Network satisfying the request is potentially removed.
6625 *
6626 * @hide
6627 */
6628 public static final String CONNECTIVITY_RELEASE_PENDING_INTENT_DELAY_MS =
6629 "connectivity_release_pending_intent_delay_ms";
6630
6631 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07006632 * Whether background data usage is allowed.
6633 *
6634 * @deprecated As of {@link VERSION_CODES#ICE_CREAM_SANDWICH},
6635 * availability of background data depends on several
6636 * combined factors. When background data is unavailable,
6637 * {@link ConnectivityManager#getActiveNetworkInfo()} will
6638 * now appear disconnected.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006639 */
Jeff Sharkey3a844fc2011-08-16 14:37:57 -07006640 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006641 public static final String BACKGROUND_DATA = "background_data";
Wink Saville04e71b32009-04-02 11:00:54 -07006642
6643 /**
Bjorn Bringert98bfa392010-03-24 10:59:48 +00006644 * Origins for which browsers should allow geolocation by default.
6645 * The value is a space-separated list of origins.
6646 */
6647 public static final String ALLOWED_GEOLOCATION_ORIGINS
6648 = "allowed_geolocation_origins";
6649
6650 /**
Wink Savillee9b06d72009-05-18 21:47:50 -07006651 * The preferred TTY mode 0 = TTy Off, CDMA default
6652 * 1 = TTY Full
6653 * 2 = TTY HCO
6654 * 3 = TTY VCO
6655 * @hide
6656 */
6657 public static final String PREFERRED_TTY_MODE =
6658 "preferred_tty_mode";
6659
Michal Karpinski964943a2018-01-19 16:28:26 +00006660 private static final Validator PREFERRED_TTY_MODE_VALIDATOR =
6661 new SettingsValidators.DiscreteValueValidator(new String[]{"0", "1", "2", "3"});
6662
Wink Saville04e71b32009-04-02 11:00:54 -07006663 /**
Wink Saville04e71b32009-04-02 11:00:54 -07006664 * Whether the enhanced voice privacy mode is enabled.
6665 * 0 = normal voice privacy
6666 * 1 = enhanced voice privacy
6667 * @hide
6668 */
6669 public static final String ENHANCED_VOICE_PRIVACY_ENABLED = "enhanced_voice_privacy_enabled";
6670
Michal Karpinski964943a2018-01-19 16:28:26 +00006671 private static final Validator ENHANCED_VOICE_PRIVACY_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
6672
Wink Saville04e71b32009-04-02 11:00:54 -07006673 /**
6674 * Whether the TTY mode mode is enabled.
6675 * 0 = disabled
6676 * 1 = enabled
6677 * @hide
6678 */
6679 public static final String TTY_MODE_ENABLED = "tty_mode_enabled";
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07006680
Michal Karpinski964943a2018-01-19 16:28:26 +00006681 private static final Validator TTY_MODE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
6682
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07006683 /**
Hall Liu44e41012018-04-02 15:41:07 -07006684 * User-selected RTT mode. When on, outgoing and incoming calls will be answered as RTT
6685 * calls when supported by the device and carrier. Boolean value.
6686 * 0 = OFF
6687 * 1 = ON
6688 */
6689 public static final String RTT_CALLING_MODE = "rtt_calling_mode";
6690
6691 private static final Validator RTT_CALLING_MODE_VALIDATOR = BOOLEAN_VALIDATOR;
6692
6693 /**
6694 /**
Christopher Tate8031a3d2009-07-06 16:36:05 -07006695 * Controls whether settings backup is enabled.
Dianne Hackborncf098292009-07-01 19:55:20 -07006696 * Type: int ( 0 = disabled, 1 = enabled )
6697 * @hide
6698 */
6699 public static final String BACKUP_ENABLED = "backup_enabled";
6700
6701 /**
Christopher Tatecce9da52010-02-03 15:11:15 -08006702 * Controls whether application data is automatically restored from backup
6703 * at install time.
6704 * Type: int ( 0 = disabled, 1 = enabled )
6705 * @hide
6706 */
6707 public static final String BACKUP_AUTO_RESTORE = "backup_auto_restore";
6708
6709 /**
Christopher Tate8031a3d2009-07-06 16:36:05 -07006710 * Indicates whether settings backup has been fully provisioned.
6711 * Type: int ( 0 = unprovisioned, 1 = fully provisioned )
6712 * @hide
6713 */
6714 public static final String BACKUP_PROVISIONED = "backup_provisioned";
6715
6716 /**
Dianne Hackborncf098292009-07-01 19:55:20 -07006717 * Component of the transport to use for backup/restore.
6718 * @hide
6719 */
6720 public static final String BACKUP_TRANSPORT = "backup_transport";
Sanjay Jeyakumar21bf2412009-07-09 13:31:48 -07006721
Dianne Hackbornd7cd29d2009-07-01 11:22:45 -07006722 /**
6723 * Version for which the setup wizard was last shown. Bumped for
6724 * each release when there is new setup information to show.
6725 * @hide
6726 */
6727 public static final String LAST_SETUP_SHOWN = "last_setup_shown";
Dianne Hackborncf098292009-07-01 19:55:20 -07006728
6729 /**
Doug Zongker43866e02010-01-07 12:09:54 -08006730 * The interval in milliseconds after which Wi-Fi is considered idle.
6731 * When idle, it is possible for the device to be switched from Wi-Fi to
6732 * the mobile data network.
6733 * @hide
Jeff Brownbf6f6f92012-09-25 15:03:20 -07006734 * @deprecated Use {@link android.provider.Settings.Global#WIFI_IDLE_MS}
6735 * instead.
Doug Zongker43866e02010-01-07 12:09:54 -08006736 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07006737 @Deprecated
6738 public static final String WIFI_IDLE_MS = Global.WIFI_IDLE_MS;
Doug Zongker43866e02010-01-07 12:09:54 -08006739
6740 /**
Narayan Kamathee69ff42011-06-28 12:07:18 +01006741 * The global search provider chosen by the user (if multiple global
6742 * search providers are installed). This will be the provider returned
6743 * by {@link SearchManager#getGlobalSearchActivity()} if it's still
6744 * installed. This setting is stored as a flattened component name as
6745 * per {@link ComponentName#flattenToString()}.
6746 *
6747 * @hide
6748 */
6749 public static final String SEARCH_GLOBAL_SEARCH_ACTIVITY =
6750 "search_global_search_activity";
6751
6752 /**
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08006753 * The number of promoted sources in GlobalSearch.
6754 * @hide
6755 */
6756 public static final String SEARCH_NUM_PROMOTED_SOURCES = "search_num_promoted_sources";
6757 /**
6758 * The maximum number of suggestions returned by GlobalSearch.
6759 * @hide
6760 */
6761 public static final String SEARCH_MAX_RESULTS_TO_DISPLAY = "search_max_results_to_display";
6762 /**
6763 * The number of suggestions GlobalSearch will ask each non-web search source for.
6764 * @hide
6765 */
6766 public static final String SEARCH_MAX_RESULTS_PER_SOURCE = "search_max_results_per_source";
6767 /**
6768 * The number of suggestions the GlobalSearch will ask the web search source for.
6769 * @hide
6770 */
6771 public static final String SEARCH_WEB_RESULTS_OVERRIDE_LIMIT =
6772 "search_web_results_override_limit";
6773 /**
6774 * The number of milliseconds that GlobalSearch will wait for suggestions from
6775 * promoted sources before continuing with all other sources.
6776 * @hide
6777 */
6778 public static final String SEARCH_PROMOTED_SOURCE_DEADLINE_MILLIS =
6779 "search_promoted_source_deadline_millis";
6780 /**
6781 * The number of milliseconds before GlobalSearch aborts search suggesiton queries.
6782 * @hide
6783 */
6784 public static final String SEARCH_SOURCE_TIMEOUT_MILLIS = "search_source_timeout_millis";
6785 /**
6786 * The maximum number of milliseconds that GlobalSearch shows the previous results
6787 * after receiving a new query.
6788 * @hide
6789 */
6790 public static final String SEARCH_PREFILL_MILLIS = "search_prefill_millis";
6791 /**
6792 * The maximum age of log data used for shortcuts in GlobalSearch.
6793 * @hide
6794 */
6795 public static final String SEARCH_MAX_STAT_AGE_MILLIS = "search_max_stat_age_millis";
6796 /**
6797 * The maximum age of log data used for source ranking in GlobalSearch.
6798 * @hide
6799 */
6800 public static final String SEARCH_MAX_SOURCE_EVENT_AGE_MILLIS =
6801 "search_max_source_event_age_millis";
6802 /**
6803 * The minimum number of impressions needed to rank a source in GlobalSearch.
6804 * @hide
6805 */
6806 public static final String SEARCH_MIN_IMPRESSIONS_FOR_SOURCE_RANKING =
6807 "search_min_impressions_for_source_ranking";
6808 /**
6809 * The minimum number of clicks needed to rank a source in GlobalSearch.
6810 * @hide
6811 */
6812 public static final String SEARCH_MIN_CLICKS_FOR_SOURCE_RANKING =
6813 "search_min_clicks_for_source_ranking";
6814 /**
6815 * The maximum number of shortcuts shown by GlobalSearch.
6816 * @hide
6817 */
6818 public static final String SEARCH_MAX_SHORTCUTS_RETURNED = "search_max_shortcuts_returned";
6819 /**
6820 * The size of the core thread pool for suggestion queries in GlobalSearch.
6821 * @hide
6822 */
6823 public static final String SEARCH_QUERY_THREAD_CORE_POOL_SIZE =
6824 "search_query_thread_core_pool_size";
6825 /**
6826 * The maximum size of the thread pool for suggestion queries in GlobalSearch.
6827 * @hide
6828 */
6829 public static final String SEARCH_QUERY_THREAD_MAX_POOL_SIZE =
6830 "search_query_thread_max_pool_size";
6831 /**
6832 * The size of the core thread pool for shortcut refreshing in GlobalSearch.
6833 * @hide
6834 */
6835 public static final String SEARCH_SHORTCUT_REFRESH_CORE_POOL_SIZE =
6836 "search_shortcut_refresh_core_pool_size";
6837 /**
6838 * The maximum size of the thread pool for shortcut refreshing in GlobalSearch.
6839 * @hide
6840 */
6841 public static final String SEARCH_SHORTCUT_REFRESH_MAX_POOL_SIZE =
6842 "search_shortcut_refresh_max_pool_size";
6843 /**
6844 * The maximun time that excess threads in the GlobalSeach thread pools will
6845 * wait before terminating.
6846 * @hide
6847 */
6848 public static final String SEARCH_THREAD_KEEPALIVE_SECONDS =
6849 "search_thread_keepalive_seconds";
6850 /**
6851 * The maximum number of concurrent suggestion queries to each source.
6852 * @hide
6853 */
6854 public static final String SEARCH_PER_SOURCE_CONCURRENT_QUERY_LIMIT =
6855 "search_per_source_concurrent_query_limit";
6856
San Mehat87734d32010-01-08 12:53:06 -08006857 /**
Sudheer Shanka2250d562016-11-07 15:41:02 -08006858 * Whether or not alert sounds are played on StorageManagerService events.
6859 * (0 = false, 1 = true)
San Mehat87734d32010-01-08 12:53:06 -08006860 * @hide
6861 */
6862 public static final String MOUNT_PLAY_NOTIFICATION_SND = "mount_play_not_snd";
6863
Michal Karpinski964943a2018-01-19 16:28:26 +00006864 private static final Validator MOUNT_PLAY_NOTIFICATION_SND_VALIDATOR = BOOLEAN_VALIDATOR;
6865
San Mehat87734d32010-01-08 12:53:06 -08006866 /**
6867 * Whether or not UMS auto-starts on UMS host detection. (0 = false, 1 = true)
6868 * @hide
6869 */
6870 public static final String MOUNT_UMS_AUTOSTART = "mount_ums_autostart";
6871
Michal Karpinski964943a2018-01-19 16:28:26 +00006872 private static final Validator MOUNT_UMS_AUTOSTART_VALIDATOR = BOOLEAN_VALIDATOR;
6873
San Mehat87734d32010-01-08 12:53:06 -08006874 /**
6875 * Whether or not a notification is displayed on UMS host detection. (0 = false, 1 = true)
6876 * @hide
6877 */
6878 public static final String MOUNT_UMS_PROMPT = "mount_ums_prompt";
6879
Michal Karpinski964943a2018-01-19 16:28:26 +00006880 private static final Validator MOUNT_UMS_PROMPT_VALIDATOR = BOOLEAN_VALIDATOR;
6881
San Mehat87734d32010-01-08 12:53:06 -08006882 /**
6883 * Whether or not a notification is displayed while UMS is enabled. (0 = false, 1 = true)
6884 * @hide
6885 */
6886 public static final String MOUNT_UMS_NOTIFY_ENABLED = "mount_ums_notify_enabled";
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08006887
Michal Karpinski964943a2018-01-19 16:28:26 +00006888 private static final Validator MOUNT_UMS_NOTIFY_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
6889
Dan Egnor42471dd2010-01-07 17:25:22 -08006890 /**
6891 * If nonzero, ANRs in invisible background processes bring up a dialog.
6892 * Otherwise, the process will be silently killed.
Adrian Roos6a7e0892016-08-23 14:26:39 +02006893 *
6894 * Also prevents ANRs and crash dialogs from being suppressed.
Dan Egnor42471dd2010-01-07 17:25:22 -08006895 * @hide
6896 */
6897 public static final String ANR_SHOW_BACKGROUND = "anr_show_background";
Erikeebc8e22010-02-18 13:27:19 -08006898
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08006899 /**
Andrew Sapperstein43643ae2017-12-20 15:17:33 -08006900 * If nonzero, crashes in foreground processes will bring up a dialog.
6901 * Otherwise, the process will be silently killed.
6902 * @hide
6903 */
6904 public static final String SHOW_FIRST_CRASH_DIALOG_DEV_OPTION =
6905 "show_first_crash_dialog_dev_option";
6906
Michal Karpinski964943a2018-01-19 16:28:26 +00006907 private static final Validator SHOW_FIRST_CRASH_DIALOG_DEV_OPTION_VALIDATOR =
6908 BOOLEAN_VALIDATOR;
6909
Andrew Sapperstein43643ae2017-12-20 15:17:33 -08006910 /**
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08006911 * The {@link ComponentName} string of the service to be used as the voice recognition
6912 * service.
Erikeebc8e22010-02-18 13:27:19 -08006913 *
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08006914 * @hide
6915 */
6916 public static final String VOICE_RECOGNITION_SERVICE = "voice_recognition_service";
Dan Egnor42471dd2010-01-07 17:25:22 -08006917
William Luh623a4282013-06-24 12:14:18 -07006918 /**
6919 * Stores whether an user has consented to have apps verified through PAM.
6920 * The value is boolean (1 or 0).
6921 *
6922 * @hide
6923 */
6924 public static final String PACKAGE_VERIFIER_USER_CONSENT =
6925 "package_verifier_user_consent";
satok988323c2011-06-22 16:38:13 +09006926
6927 /**
satokada8c4e2011-08-23 14:56:56 +09006928 * The {@link ComponentName} string of the selected spell checker service which is
6929 * one of the services managed by the text service manager.
6930 *
6931 * @hide
6932 */
6933 public static final String SELECTED_SPELL_CHECKER = "selected_spell_checker";
6934
Michal Karpinski964943a2018-01-19 16:28:26 +00006935 private static final Validator SELECTED_SPELL_CHECKER_VALIDATOR = COMPONENT_NAME_VALIDATOR;
6936
satokada8c4e2011-08-23 14:56:56 +09006937 /**
6938 * The {@link ComponentName} string of the selected subtype of the selected spell checker
satok988323c2011-06-22 16:38:13 +09006939 * service which is one of the services managed by the text service manager.
6940 *
6941 * @hide
6942 */
satokada8c4e2011-08-23 14:56:56 +09006943 public static final String SELECTED_SPELL_CHECKER_SUBTYPE =
6944 "selected_spell_checker_subtype";
satok988323c2011-06-22 16:38:13 +09006945
Michal Karpinski964943a2018-01-19 16:28:26 +00006946 private static final Validator SELECTED_SPELL_CHECKER_SUBTYPE_VALIDATOR =
6947 COMPONENT_NAME_VALIDATOR;
6948
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08006949 /**
Michal Karpinski964943a2018-01-19 16:28:26 +00006950 * Whether spell checker is enabled or not.
satoka33c4fc2011-08-25 16:50:11 +09006951 *
6952 * @hide
6953 */
6954 public static final String SPELL_CHECKER_ENABLED = "spell_checker_enabled";
6955
Michal Karpinski964943a2018-01-19 16:28:26 +00006956 private static final Validator SPELL_CHECKER_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
6957
satoka33c4fc2011-08-25 16:50:11 +09006958 /**
David Brown458e8062010-03-08 21:52:11 -08006959 * What happens when the user presses the Power button while in-call
6960 * and the screen is on.<br/>
6961 * <b>Values:</b><br/>
6962 * 1 - The Power button turns off the screen and locks the device. (Default behavior)<br/>
6963 * 2 - The Power button hangs up the current call.<br/>
6964 *
6965 * @hide
6966 */
6967 public static final String INCALL_POWER_BUTTON_BEHAVIOR = "incall_power_button_behavior";
6968
Michal Karpinski964943a2018-01-19 16:28:26 +00006969 private static final Validator INCALL_POWER_BUTTON_BEHAVIOR_VALIDATOR =
6970 new SettingsValidators.DiscreteValueValidator(new String[]{"1", "2"});
6971
David Brown458e8062010-03-08 21:52:11 -08006972 /**
6973 * INCALL_POWER_BUTTON_BEHAVIOR value for "turn off screen".
6974 * @hide
6975 */
6976 public static final int INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF = 0x1;
6977
6978 /**
6979 * INCALL_POWER_BUTTON_BEHAVIOR value for "hang up".
6980 * @hide
6981 */
6982 public static final int INCALL_POWER_BUTTON_BEHAVIOR_HANGUP = 0x2;
6983
6984 /**
6985 * INCALL_POWER_BUTTON_BEHAVIOR default value.
6986 * @hide
6987 */
6988 public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT =
6989 INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF;
6990
6991 /**
Bryce Leedb776ce2016-09-03 15:02:00 -07006992 * What happens when the user presses the Back button while in-call
6993 * and the screen is on.<br/>
6994 * <b>Values:</b><br/>
6995 * 0 - The Back buttons does nothing different.<br/>
6996 * 1 - The Back button hangs up the current call.<br/>
6997 *
6998 * @hide
6999 */
7000 public static final String INCALL_BACK_BUTTON_BEHAVIOR = "incall_back_button_behavior";
7001
7002 /**
7003 * INCALL_BACK_BUTTON_BEHAVIOR value for no action.
7004 * @hide
7005 */
7006 public static final int INCALL_BACK_BUTTON_BEHAVIOR_NONE = 0x0;
7007
7008 /**
7009 * INCALL_BACK_BUTTON_BEHAVIOR value for "hang up".
7010 * @hide
7011 */
7012 public static final int INCALL_BACK_BUTTON_BEHAVIOR_HANGUP = 0x1;
7013
7014 /**
7015 * INCALL_POWER_BUTTON_BEHAVIOR default value.
7016 * @hide
7017 */
7018 public static final int INCALL_BACK_BUTTON_BEHAVIOR_DEFAULT =
7019 INCALL_BACK_BUTTON_BEHAVIOR_NONE;
7020
7021 /**
Jeff Browna20dda42014-05-27 20:57:24 -07007022 * Whether the device should wake when the wake gesture sensor detects motion.
7023 * @hide
7024 */
7025 public static final String WAKE_GESTURE_ENABLED = "wake_gesture_enabled";
7026
Michal Karpinski964943a2018-01-19 16:28:26 +00007027 private static final Validator WAKE_GESTURE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
7028
Jeff Browna20dda42014-05-27 20:57:24 -07007029 /**
John Spurlocka4215ce2014-08-04 14:50:38 -04007030 * Whether the device should doze if configured.
7031 * @hide
7032 */
7033 public static final String DOZE_ENABLED = "doze_enabled";
7034
Michal Karpinski964943a2018-01-19 16:28:26 +00007035 private static final Validator DOZE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
7036
John Spurlocka4215ce2014-08-04 14:50:38 -04007037 /**
Adrian Roosebea7a72016-10-26 12:51:26 -07007038 * Whether doze should be always on.
7039 * @hide
7040 */
7041 public static final String DOZE_ALWAYS_ON = "doze_always_on";
7042
7043 /**
Doris Ling6403b402016-09-09 14:29:19 -07007044 * Whether the device should pulse on pick up gesture.
7045 * @hide
7046 */
7047 public static final String DOZE_PULSE_ON_PICK_UP = "doze_pulse_on_pick_up";
7048
Michal Karpinski964943a2018-01-19 16:28:26 +00007049 private static final Validator DOZE_PULSE_ON_PICK_UP_VALIDATOR = BOOLEAN_VALIDATOR;
7050
Doris Ling6403b402016-09-09 14:29:19 -07007051 /**
Adrian Roosd0963a02017-05-15 14:33:37 -07007052 * Whether the device should pulse on long press gesture.
7053 * @hide
7054 */
7055 public static final String DOZE_PULSE_ON_LONG_PRESS = "doze_pulse_on_long_press";
7056
7057 /**
Doris Ling6403b402016-09-09 14:29:19 -07007058 * Whether the device should pulse on double tap gesture.
7059 * @hide
7060 */
7061 public static final String DOZE_PULSE_ON_DOUBLE_TAP = "doze_pulse_on_double_tap";
7062
Michal Karpinski964943a2018-01-19 16:28:26 +00007063 private static final Validator DOZE_PULSE_ON_DOUBLE_TAP_VALIDATOR = BOOLEAN_VALIDATOR;
7064
Doris Ling6403b402016-09-09 14:29:19 -07007065 /**
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07007066 * The current night mode that has been selected by the user. Owned
7067 * and controlled by UiModeManagerService. Constants are as per
7068 * UiModeManager.
7069 * @hide
7070 */
7071 public static final String UI_NIGHT_MODE = "ui_night_mode";
Suchi Amalapurapu40e47252010-04-07 16:15:50 -07007072
7073 /**
John Spurlock1a868b72012-08-22 09:56:51 -04007074 * Whether screensavers are enabled.
Daniel Sandler0601eb72011-04-13 01:01:32 -04007075 * @hide
7076 */
Daniel Sandler2d545362011-11-17 10:38:37 -08007077 public static final String SCREENSAVER_ENABLED = "screensaver_enabled";
Daniel Sandler0601eb72011-04-13 01:01:32 -04007078
Michal Karpinski964943a2018-01-19 16:28:26 +00007079 private static final Validator SCREENSAVER_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
7080
Daniel Sandler0601eb72011-04-13 01:01:32 -04007081 /**
John Spurlock1a868b72012-08-22 09:56:51 -04007082 * The user's chosen screensaver components.
Daniel Sandler2d545362011-11-17 10:38:37 -08007083 *
John Spurlock1a868b72012-08-22 09:56:51 -04007084 * These will be launched by the PhoneWindowManager after a timeout when not on
Daniel Sandler2d545362011-11-17 10:38:37 -08007085 * battery, or upon dock insertion (if SCREENSAVER_ACTIVATE_ON_DOCK is set to 1).
Daniel Sandler0601eb72011-04-13 01:01:32 -04007086 * @hide
7087 */
John Spurlock1a868b72012-08-22 09:56:51 -04007088 public static final String SCREENSAVER_COMPONENTS = "screensaver_components";
Daniel Sandler2d545362011-11-17 10:38:37 -08007089
Michal Karpinski964943a2018-01-19 16:28:26 +00007090 private static final Validator SCREENSAVER_COMPONENTS_VALIDATOR =
7091 new SettingsValidators.ComponentNameListValidator(",");
7092
Daniel Sandler2d545362011-11-17 10:38:37 -08007093 /**
John Spurlock1a868b72012-08-22 09:56:51 -04007094 * If screensavers are enabled, whether the screensaver should be automatically launched
7095 * when the device is inserted into a (desk) dock.
Daniel Sandler2d545362011-11-17 10:38:37 -08007096 * @hide
7097 */
7098 public static final String SCREENSAVER_ACTIVATE_ON_DOCK = "screensaver_activate_on_dock";
Daniel Sandler0601eb72011-04-13 01:01:32 -04007099
Michal Karpinski964943a2018-01-19 16:28:26 +00007100 private static final Validator SCREENSAVER_ACTIVATE_ON_DOCK_VALIDATOR = BOOLEAN_VALIDATOR;
7101
John Spurlock1a868b72012-08-22 09:56:51 -04007102 /**
7103 * If screensavers are enabled, whether the screensaver should be automatically launched
7104 * when the screen times out when not on battery.
7105 * @hide
7106 */
7107 public static final String SCREENSAVER_ACTIVATE_ON_SLEEP = "screensaver_activate_on_sleep";
7108
Michal Karpinski964943a2018-01-19 16:28:26 +00007109 private static final Validator SCREENSAVER_ACTIVATE_ON_SLEEP_VALIDATOR = BOOLEAN_VALIDATOR;
7110
John Spurlock1a868b72012-08-22 09:56:51 -04007111 /**
7112 * If screensavers are enabled, the default screensaver component.
7113 * @hide
7114 */
7115 public static final String SCREENSAVER_DEFAULT_COMPONENT = "screensaver_default_component";
7116
Daniel Sandler0601eb72011-04-13 01:01:32 -04007117 /**
Martijn Coenena7397882013-07-30 20:07:47 -07007118 * The default NFC payment component
7119 * @hide
7120 */
7121 public static final String NFC_PAYMENT_DEFAULT_COMPONENT = "nfc_payment_default_component";
7122
Michal Karpinski964943a2018-01-19 16:28:26 +00007123 private static final Validator NFC_PAYMENT_DEFAULT_COMPONENT_VALIDATOR =
7124 COMPONENT_NAME_VALIDATOR;
7125
Martijn Coenena7397882013-07-30 20:07:47 -07007126 /**
Martijn Coenen2f6f3a012014-04-25 17:00:21 -07007127 * Whether NFC payment is handled by the foreground application or a default.
7128 * @hide
7129 */
7130 public static final String NFC_PAYMENT_FOREGROUND = "nfc_payment_foreground";
7131
7132 /**
David Braunf5d83192013-09-16 13:43:51 -07007133 * Specifies the package name currently configured to be the primary sms application
7134 * @hide
7135 */
7136 public static final String SMS_DEFAULT_APPLICATION = "sms_default_application";
7137
7138 /**
Yorke Lee014de022015-04-21 17:15:47 -07007139 * Specifies the package name currently configured to be the default dialer application
7140 * @hide
7141 */
7142 public static final String DIALER_DEFAULT_APPLICATION = "dialer_default_application";
7143
7144 /**
Adrian Roos943eb862015-03-26 12:31:16 -07007145 * Specifies the package name currently configured to be the emergency assistance application
7146 *
7147 * @see android.telephony.TelephonyManager#ACTION_EMERGENCY_ASSISTANCE
7148 *
7149 * @hide
7150 */
7151 public static final String EMERGENCY_ASSISTANCE_APPLICATION = "emergency_assistance_application";
7152
7153 /**
Jorim Jaggi9d910832015-05-18 17:35:26 -07007154 * Specifies whether the current app context on scren (assist data) will be sent to the
7155 * assist application (active voice interaction service).
7156 *
7157 * @hide
7158 */
7159 public static final String ASSIST_STRUCTURE_ENABLED = "assist_structure_enabled";
7160
7161 /**
Jorim Jaggia133f0b2015-06-26 16:40:00 -07007162 * Specifies whether a screenshot of the screen contents will be sent to the assist
7163 * application (active voice interaction service).
7164 *
7165 * @hide
7166 */
7167 public static final String ASSIST_SCREENSHOT_ENABLED = "assist_screenshot_enabled";
7168
7169 /**
Adrian Roos2335bd62016-08-11 15:42:40 -07007170 * Specifies whether the screen will show an animation if screen contents are sent to the
7171 * assist application (active voice interaction service).
7172 *
7173 * Note that the disclosure will be forced for third-party assistants or if the device
7174 * does not support disabling it.
7175 *
7176 * @hide
7177 */
7178 public static final String ASSIST_DISCLOSURE_ENABLED = "assist_disclosure_enabled";
7179
7180 /**
Mike Digmane14e6632018-01-11 10:43:08 -08007181 * Control if rotation suggestions are sent to System UI when in rotation locked mode.
7182 * Done to enable screen rotation while the the screen rotation is locked. Enabling will
7183 * poll the accelerometer in rotation locked mode.
7184 *
7185 * If 0, then rotation suggestions are not sent to System UI. If 1, suggestions are sent.
7186 *
7187 * @hide
7188 */
7189
7190 public static final String SHOW_ROTATION_SUGGESTIONS = "show_rotation_suggestions";
7191
7192 /**
7193 * The disabled state of SHOW_ROTATION_SUGGESTIONS.
7194 * @hide
7195 */
7196 public static final int SHOW_ROTATION_SUGGESTIONS_DISABLED = 0x0;
7197
7198 /**
7199 * The enabled state of SHOW_ROTATION_SUGGESTIONS.
7200 * @hide
7201 */
7202 public static final int SHOW_ROTATION_SUGGESTIONS_ENABLED = 0x1;
7203
7204 /**
7205 * The default state of SHOW_ROTATION_SUGGESTIONS.
7206 * @hide
7207 */
7208 public static final int SHOW_ROTATION_SUGGESTIONS_DEFAULT =
Mike Digman02856ba2018-01-16 11:21:23 -08007209 SHOW_ROTATION_SUGGESTIONS_ENABLED;
Mike Digmane14e6632018-01-11 10:43:08 -08007210
7211 /**
Mike Digman50752642018-02-15 13:36:09 -08007212 * The number of accepted rotation suggestions. Used to determine if the user has been
7213 * introduced to rotation suggestions.
7214 * @hide
7215 */
7216 public static final String NUM_ROTATION_SUGGESTIONS_ACCEPTED =
7217 "num_rotation_suggestions_accepted";
7218
7219 /**
Julia Reynoldsb852e562017-06-06 16:14:18 -04007220 * Read only list of the service components that the current user has explicitly allowed to
Julia Reynolds77b2cc92016-11-08 14:41:09 -05007221 * see and assist with all of the user's notifications.
7222 *
Julia Reynoldsb852e562017-06-06 16:14:18 -04007223 * @deprecated Use
7224 * {@link NotificationManager#isNotificationListenerAccessGranted(ComponentName)}.
Julia Reynolds77b2cc92016-11-08 14:41:09 -05007225 * @hide
7226 */
Julia Reynoldsb852e562017-06-06 16:14:18 -04007227 @Deprecated
Julia Reynolds77b2cc92016-11-08 14:41:09 -05007228 public static final String ENABLED_NOTIFICATION_ASSISTANT =
7229 "enabled_notification_assistant";
7230
Michal Karpinski964943a2018-01-19 16:28:26 +00007231 private static final Validator ENABLED_NOTIFICATION_ASSISTANT_VALIDATOR =
7232 new SettingsValidators.ComponentNameListValidator(":");
7233
Julia Reynolds77b2cc92016-11-08 14:41:09 -05007234 /**
Julia Reynoldsb852e562017-06-06 16:14:18 -04007235 * Read only list of the service components that the current user has explicitly allowed to
Chris Wren8326a8a2014-10-22 14:13:32 -04007236 * see all of the user's notifications, separated by ':'.
Daniel Sandler4b749ef2013-03-18 21:53:04 -04007237 *
7238 * @hide
Julia Reynoldsb852e562017-06-06 16:14:18 -04007239 * @deprecated Use
7240 * {@link NotificationManager#isNotificationAssistantAccessGranted(ComponentName)}.
Daniel Sandler4b749ef2013-03-18 21:53:04 -04007241 */
Julia Reynoldsb852e562017-06-06 16:14:18 -04007242 @Deprecated
Daniel Sandler4b749ef2013-03-18 21:53:04 -04007243 public static final String ENABLED_NOTIFICATION_LISTENERS = "enabled_notification_listeners";
7244
Michal Karpinski964943a2018-01-19 16:28:26 +00007245 private static final Validator ENABLED_NOTIFICATION_LISTENERS_VALIDATOR =
7246 new SettingsValidators.ComponentNameListValidator(":");
7247
John Spurlock7340fc82014-04-24 18:50:12 -04007248 /**
Julia Reynoldsb852e562017-06-06 16:14:18 -04007249 * Read only list of the packages that the current user has explicitly allowed to
7250 * manage do not disturb, separated by ':'.
Julia Reynolds0aa7d612016-04-25 14:57:33 -04007251 *
Julia Reynoldsb852e562017-06-06 16:14:18 -04007252 * @deprecated Use {@link NotificationManager#isNotificationPolicyAccessGranted()}.
Julia Reynolds0aa7d612016-04-25 14:57:33 -04007253 * @hide
John Spurlock7c74f782015-06-04 13:01:42 -04007254 */
Julia Reynoldsb852e562017-06-06 16:14:18 -04007255 @Deprecated
Julia Reynolds0aa7d612016-04-25 14:57:33 -04007256 @TestApi
John Spurlock7c74f782015-06-04 13:01:42 -04007257 public static final String ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES =
7258 "enabled_notification_policy_access_packages";
7259
Michal Karpinski964943a2018-01-19 16:28:26 +00007260 private static final Validator ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES_VALIDATOR =
7261 new SettingsValidators.PackageNameListValidator(":");
7262
Andre Lagoea35e072016-08-04 13:41:13 +01007263 /**
7264 * Defines whether managed profile ringtones should be synced from it's parent profile
7265 * <p>
7266 * 0 = ringtones are not synced
7267 * 1 = ringtones are synced from the profile's parent (default)
7268 * <p>
7269 * This value is only used for managed profiles.
7270 * @hide
7271 */
Robin Leec74d85f2017-03-16 17:19:42 +00007272 @TestApi
7273 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
Andre Lagoea35e072016-08-04 13:41:13 +01007274 public static final String SYNC_PARENT_SOUNDS = "sync_parent_sounds";
7275
Michal Karpinski964943a2018-01-19 16:28:26 +00007276 private static final Validator SYNC_PARENT_SOUNDS_VALIDATOR = BOOLEAN_VALIDATOR;
7277
John Spurlockcdb57ae2015-02-11 19:04:11 -05007278 /** @hide */
John Spurlockf1a36642013-10-12 17:50:42 -04007279 public static final String IMMERSIVE_MODE_CONFIRMATIONS = "immersive_mode_confirmations";
John Spurlockd67ec252013-09-05 11:31:54 -04007280
Yorke Lee647f8f32013-05-07 10:49:44 -07007281 /**
Svetoslavf43e8512013-09-30 17:33:05 -07007282 * This is the query URI for finding a print service to install.
7283 *
7284 * @hide
7285 */
7286 public static final String PRINT_SERVICE_SEARCH_URI = "print_service_search_uri";
7287
7288 /**
7289 * This is the query URI for finding a NFC payment service to install.
7290 *
7291 * @hide
7292 */
7293 public static final String PAYMENT_SERVICE_SEARCH_URI = "payment_service_search_uri";
7294
7295 /**
Philip P. Moltmanna30d6e02017-04-27 15:40:02 -07007296 * This is the query URI for finding a auto fill service to install.
7297 *
7298 * @hide
7299 */
7300 public static final String AUTOFILL_SERVICE_SEARCH_URI = "autofill_service_search_uri";
7301
7302 /**
Amith Yamasani1e9c2182014-06-11 17:25:51 -07007303 * If enabled, apps should try to skip any introductory hints on first launch. This might
Amith Yamasani0c416392014-06-13 15:54:39 -07007304 * apply to users that are already familiar with the environment or temporary users.
Amith Yamasani1e9c2182014-06-11 17:25:51 -07007305 * <p>
7306 * Type : int (0 to show hints, 1 to skip showing hints)
Amith Yamasani1e9c2182014-06-11 17:25:51 -07007307 */
7308 public static final String SKIP_FIRST_USE_HINTS = "skip_first_use_hints";
7309
7310 /**
John Spurlockaa5ee4d2014-07-25 13:05:12 -04007311 * Persisted playback time after a user confirmation of an unsafe volume level.
7312 *
7313 * @hide
7314 */
7315 public static final String UNSAFE_VOLUME_MUSIC_ACTIVE_MS = "unsafe_volume_music_active_ms";
7316
7317 /**
Dan Sandler52e5701e2014-07-22 23:14:54 -04007318 * This preference enables notification display on the lockscreen.
7319 * @hide
7320 */
7321 public static final String LOCK_SCREEN_SHOW_NOTIFICATIONS =
7322 "lock_screen_show_notifications";
7323
7324 /**
Dongwon Kang4d933a02014-08-07 22:51:47 -07007325 * List of TV inputs that are currently hidden. This is a string
Jaewan Kimf0e530e2014-08-22 00:43:31 +09007326 * containing the IDs of all hidden TV inputs. Each ID is encoded by
7327 * {@link android.net.Uri#encode(String)} and separated by ':'.
Dongwon Kang4d933a02014-08-07 22:51:47 -07007328 * @hide
7329 */
7330 public static final String TV_INPUT_HIDDEN_INPUTS = "tv_input_hidden_inputs";
7331
7332 /**
7333 * List of custom TV input labels. This is a string containing <TV input id, custom name>
Jaewan Kimf0e530e2014-08-22 00:43:31 +09007334 * pairs. TV input id and custom name are encoded by {@link android.net.Uri#encode(String)}
7335 * and separated by ','. Each pair is separated by ':'.
Dongwon Kang4d933a02014-08-07 22:51:47 -07007336 * @hide
7337 */
7338 public static final String TV_INPUT_CUSTOM_LABELS = "tv_input_custom_labels";
7339
7340 /**
Glenn Kasten34cc4db2014-08-13 10:56:38 -07007341 * Whether automatic routing of system audio to USB audio peripheral is disabled.
7342 * The value is boolean (1 or 0), where 1 means automatic routing is disabled,
7343 * and 0 means automatic routing is enabled.
7344 *
7345 * @hide
7346 */
7347 public static final String USB_AUDIO_AUTOMATIC_ROUTING_DISABLED =
7348 "usb_audio_automatic_routing_disabled";
7349
7350 /**
Jeff Brown05af6ad2014-09-30 20:54:30 -07007351 * The timeout in milliseconds before the device fully goes to sleep after
7352 * a period of inactivity. This value sets an upper bound on how long the device
7353 * will stay awake or dreaming without user activity. It should generally
Dianne Hackbornad6a99b2014-11-18 10:11:10 -08007354 * be longer than {@link Settings.System#SCREEN_OFF_TIMEOUT} as otherwise the device
Jeff Brown05af6ad2014-09-30 20:54:30 -07007355 * will sleep before it ever has a chance to dream.
7356 * <p>
7357 * Use -1 to disable this timeout.
7358 * </p>
7359 *
7360 * @hide
7361 */
7362 public static final String SLEEP_TIMEOUT = "sleep_timeout";
7363
Michal Karpinski964943a2018-01-19 16:28:26 +00007364 private static final Validator SLEEP_TIMEOUT_VALIDATOR =
7365 new SettingsValidators.InclusiveIntegerRangeValidator(-1, Integer.MAX_VALUE);
7366
Jeff Brown05af6ad2014-09-30 20:54:30 -07007367 /**
Jason Monk27bbb2d2015-03-31 16:46:39 -04007368 * Controls whether double tap to wake is enabled.
7369 * @hide
7370 */
7371 public static final String DOUBLE_TAP_TO_WAKE = "double_tap_to_wake";
7372
Michal Karpinski964943a2018-01-19 16:28:26 +00007373 private static final Validator DOUBLE_TAP_TO_WAKE_VALIDATOR = BOOLEAN_VALIDATOR;
7374
Jason Monk27bbb2d2015-03-31 16:46:39 -04007375 /**
Xiyuan Xiae6de8b92015-06-06 22:18:05 -07007376 * The current assistant component. It could be a voice interaction service,
7377 * or an activity that handles ACTION_ASSIST, or empty which means using the default
7378 * handling.
7379 *
7380 * @hide
7381 */
7382 public static final String ASSISTANT = "assistant";
7383
7384 /**
Jason Monk5a5e7d62015-08-04 11:20:25 -04007385 * Whether the camera launch gesture should be disabled.
7386 *
7387 * @hide
7388 */
7389 public static final String CAMERA_GESTURE_DISABLED = "camera_gesture_disabled";
7390
Michal Karpinski964943a2018-01-19 16:28:26 +00007391 private static final Validator CAMERA_GESTURE_DISABLED_VALIDATOR = BOOLEAN_VALIDATOR;
7392
Jason Monk5a5e7d62015-08-04 11:20:25 -04007393 /**
Adrian Roos5941c982015-09-03 15:59:49 -07007394 * Whether the camera launch gesture to double tap the power button when the screen is off
7395 * should be disabled.
7396 *
7397 * @hide
7398 */
7399 public static final String CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED =
7400 "camera_double_tap_power_gesture_disabled";
7401
Michal Karpinski964943a2018-01-19 16:28:26 +00007402 private static final Validator CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED_VALIDATOR =
7403 BOOLEAN_VALIDATOR;
7404
Adrian Roos5941c982015-09-03 15:59:49 -07007405 /**
Doris Linga60d31d2016-07-06 13:39:05 -07007406 * Whether the camera double twist gesture to flip between front and back mode should be
7407 * enabled.
7408 *
7409 * @hide
7410 */
7411 public static final String CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED =
7412 "camera_double_twist_to_flip_enabled";
7413
Michal Karpinski964943a2018-01-19 16:28:26 +00007414 private static final Validator CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED_VALIDATOR =
7415 BOOLEAN_VALIDATOR;
7416
Doris Linga60d31d2016-07-06 13:39:05 -07007417 /**
Mehdi Alizadeh1264d882018-04-03 18:38:34 -07007418 * Whether the swipe up gesture to switch apps should be enabled.
7419 *
7420 * @hide
7421 */
7422 public static final String SWIPE_UP_TO_SWITCH_APPS_ENABLED =
7423 "swipe_up_to_switch_apps_enabled";
7424
7425 private static final Validator SWIPE_UP_TO_SWITCH_APPS_ENABLED_VALIDATOR =
7426 BOOLEAN_VALIDATOR;
7427
7428 /**
Daniel Sheng45e0d342017-04-17 17:27:22 -07007429 * Whether or not the smart camera lift trigger that launches the camera when the user moves
7430 * the phone into a position for taking photos should be enabled.
7431 *
7432 * @hide
7433 */
7434 public static final String CAMERA_LIFT_TRIGGER_ENABLED = "camera_lift_trigger_enabled";
7435
7436 /**
Daniel Sheng834e5722017-05-30 09:28:52 -07007437 * The default enable state of the camera lift trigger.
7438 *
7439 * @hide
7440 */
7441 public static final int CAMERA_LIFT_TRIGGER_ENABLED_DEFAULT = 1;
7442
7443 /**
Philip Quinnc4cc3082017-02-13 20:18:16 -08007444 * Whether the assist gesture should be enabled.
7445 *
7446 * @hide
7447 */
7448 public static final String ASSIST_GESTURE_ENABLED = "assist_gesture_enabled";
7449
Michal Karpinski964943a2018-01-19 16:28:26 +00007450 private static final Validator ASSIST_GESTURE_ENABLED_VALIDATOR =
7451 BOOLEAN_VALIDATOR;
7452
Philip Quinnc4cc3082017-02-13 20:18:16 -08007453 /**
Philip Quinn80274ca2017-03-03 10:38:38 -08007454 * Sensitivity control for the assist gesture.
7455 *
7456 * @hide
7457 */
7458 public static final String ASSIST_GESTURE_SENSITIVITY = "assist_gesture_sensitivity";
7459
Michal Karpinski964943a2018-01-19 16:28:26 +00007460 private static final Validator ASSIST_GESTURE_SENSITIVITY_VALIDATOR =
7461 new SettingsValidators.InclusiveFloatRangeValidator(0.0f, 1.0f);
7462
Philip Quinn80274ca2017-03-03 10:38:38 -08007463 /**
Kevin Chyn80939372017-06-09 15:40:18 -07007464 * Whether the assist gesture should silence alerts.
7465 *
7466 * @hide
7467 */
7468 public static final String ASSIST_GESTURE_SILENCE_ALERTS_ENABLED =
7469 "assist_gesture_silence_alerts_enabled";
7470
Michal Karpinski964943a2018-01-19 16:28:26 +00007471 private static final Validator ASSIST_GESTURE_SILENCE_ALERTS_ENABLED_VALIDATOR =
7472 BOOLEAN_VALIDATOR;
7473
Kevin Chyn80939372017-06-09 15:40:18 -07007474 /**
7475 * Whether the assist gesture should wake the phone.
7476 *
7477 * @hide
7478 */
7479 public static final String ASSIST_GESTURE_WAKE_ENABLED =
7480 "assist_gesture_wake_enabled";
7481
Michal Karpinski964943a2018-01-19 16:28:26 +00007482 private static final Validator ASSIST_GESTURE_WAKE_ENABLED_VALIDATOR =
7483 BOOLEAN_VALIDATOR;
7484
Kevin Chyn80939372017-06-09 15:40:18 -07007485 /**
Kevin Chyncfd641e2017-06-05 11:28:09 -07007486 * Whether Assist Gesture Deferred Setup has been completed
7487 *
7488 * @hide
7489 */
7490 public static final String ASSIST_GESTURE_SETUP_COMPLETE = "assist_gesture_setup_complete";
7491
Michal Karpinski964943a2018-01-19 16:28:26 +00007492 private static final Validator ASSIST_GESTURE_SETUP_COMPLETE_VALIDATOR = BOOLEAN_VALIDATOR;
7493
Kevin Chyncfd641e2017-06-05 11:28:09 -07007494 /**
Justin Klaassen911e8892016-06-21 18:24:24 -07007495 * Control whether Night display is currently activated.
7496 * @hide
7497 */
7498 public static final String NIGHT_DISPLAY_ACTIVATED = "night_display_activated";
7499
7500 /**
7501 * Control whether Night display will automatically activate/deactivate.
7502 * @hide
7503 */
7504 public static final String NIGHT_DISPLAY_AUTO_MODE = "night_display_auto_mode";
7505
Christine Frankseafb5412018-02-06 11:09:39 -08007506 private static final Validator NIGHT_DISPLAY_AUTO_MODE_VALIDATOR =
7507 new SettingsValidators.InclusiveIntegerRangeValidator(0, 2);
Michal Karpinski964943a2018-01-19 16:28:26 +00007508
Justin Klaassen911e8892016-06-21 18:24:24 -07007509 /**
Christine Franks6418d0b2017-02-13 09:48:00 -08007510 * Control the color temperature of Night Display, represented in Kelvin.
7511 * @hide
7512 */
7513 public static final String NIGHT_DISPLAY_COLOR_TEMPERATURE =
7514 "night_display_color_temperature";
7515
Michal Karpinski964943a2018-01-19 16:28:26 +00007516 private static final Validator NIGHT_DISPLAY_COLOR_TEMPERATURE_VALIDATOR =
7517 NON_NEGATIVE_INTEGER_VALIDATOR;
7518
Christine Franks6418d0b2017-02-13 09:48:00 -08007519 /**
Justin Klaassen911e8892016-06-21 18:24:24 -07007520 * Custom time when Night display is scheduled to activate.
7521 * Represented as milliseconds from midnight (e.g. 79200000 == 10pm).
7522 * @hide
7523 */
Christine Frankse5bb03e2017-02-10 17:36:10 -08007524 public static final String NIGHT_DISPLAY_CUSTOM_START_TIME =
7525 "night_display_custom_start_time";
Justin Klaassen911e8892016-06-21 18:24:24 -07007526
Michal Karpinski964943a2018-01-19 16:28:26 +00007527 private static final Validator NIGHT_DISPLAY_CUSTOM_START_TIME_VALIDATOR =
7528 NON_NEGATIVE_INTEGER_VALIDATOR;
7529
Justin Klaassen911e8892016-06-21 18:24:24 -07007530 /**
7531 * Custom time when Night display is scheduled to deactivate.
7532 * Represented as milliseconds from midnight (e.g. 21600000 == 6am).
7533 * @hide
7534 */
7535 public static final String NIGHT_DISPLAY_CUSTOM_END_TIME = "night_display_custom_end_time";
Jason Monk5dbd4aa2016-02-07 13:13:39 -05007536
Michal Karpinski964943a2018-01-19 16:28:26 +00007537 private static final Validator NIGHT_DISPLAY_CUSTOM_END_TIME_VALIDATOR =
7538 NON_NEGATIVE_INTEGER_VALIDATOR;
7539
Jason Monk5dbd4aa2016-02-07 13:13:39 -05007540 /**
Christine Franks03213462017-08-25 13:57:26 -07007541 * A String representing the LocalDateTime when Night display was last activated. Use to
7542 * decide whether to apply the current activated state after a reboot or user change. In
7543 * legacy cases, this is represented by the time in milliseconds (since epoch).
Christine Frankse5bb03e2017-02-10 17:36:10 -08007544 * @hide
7545 */
7546 public static final String NIGHT_DISPLAY_LAST_ACTIVATED_TIME =
7547 "night_display_last_activated_time";
7548
7549 /**
Ruben Brunke24b9a62016-02-16 21:38:24 -08007550 * Names of the service components that the current user has explicitly allowed to
7551 * be a VR mode listener, separated by ':'.
7552 *
7553 * @hide
7554 */
7555 public static final String ENABLED_VR_LISTENERS = "enabled_vr_listeners";
7556
Michal Karpinski964943a2018-01-19 16:28:26 +00007557 private static final Validator ENABLED_VR_LISTENERS_VALIDATOR =
7558 new SettingsValidators.ComponentNameListValidator(":");
7559
Ruben Brunke24b9a62016-02-16 21:38:24 -08007560 /**
Ruben Brunk49506e02016-04-18 18:10:47 -07007561 * Behavior of the display while in VR mode.
7562 *
7563 * One of {@link #VR_DISPLAY_MODE_LOW_PERSISTENCE} or {@link #VR_DISPLAY_MODE_OFF}.
7564 *
7565 * @hide
7566 */
7567 public static final String VR_DISPLAY_MODE = "vr_display_mode";
7568
Michal Karpinski964943a2018-01-19 16:28:26 +00007569 private static final Validator VR_DISPLAY_MODE_VALIDATOR =
7570 new SettingsValidators.DiscreteValueValidator(new String[]{"0", "1"});
7571
Ruben Brunk49506e02016-04-18 18:10:47 -07007572 /**
7573 * Lower the display persistence while the system is in VR mode.
7574 *
7575 * @see PackageManager#FEATURE_VR_MODE_HIGH_PERFORMANCE
7576 *
7577 * @hide.
7578 */
7579 public static final int VR_DISPLAY_MODE_LOW_PERSISTENCE = 0;
7580
7581 /**
7582 * Do not alter the display persistence while the system is in VR mode.
7583 *
7584 * @see PackageManager#FEATURE_VR_MODE_HIGH_PERFORMANCE
7585 *
7586 * @hide.
7587 */
7588 public static final int VR_DISPLAY_MODE_OFF = 1;
7589
7590 /**
Jeff Davidson24b9d962016-07-21 12:35:10 -07007591 * Whether CarrierAppUtils#disableCarrierAppsUntilPrivileged has been executed at least
7592 * once.
7593 *
7594 * <p>This is used to ensure that we only take one pass which will disable apps that are not
7595 * privileged (if any). From then on, we only want to enable apps (when a matching SIM is
7596 * inserted), to avoid disabling an app that the user might actively be using.
7597 *
7598 * <p>Will be set to 1 once executed.
7599 *
7600 * @hide
7601 */
7602 public static final String CARRIER_APPS_HANDLED = "carrier_apps_handled";
7603
7604 /**
Tony Makc820cc52016-05-03 18:58:28 +01007605 * Whether parent user can access remote contact in managed profile.
7606 *
7607 * @hide
7608 */
7609 public static final String MANAGED_PROFILE_CONTACT_REMOTE_SEARCH =
7610 "managed_profile_contact_remote_search";
7611
7612 /**
Daniel Nishi395d3872016-05-23 13:25:21 -07007613 * Whether or not the automatic storage manager is enabled and should run on the device.
7614 *
7615 * @hide
7616 */
7617 public static final String AUTOMATIC_STORAGE_MANAGER_ENABLED =
7618 "automatic_storage_manager_enabled";
7619
7620 /**
Daniel Nishic535be12016-06-10 13:51:36 -07007621 * How many days of information for the automatic storage manager to retain on the device.
7622 *
7623 * @hide
7624 */
7625 public static final String AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN =
7626 "automatic_storage_manager_days_to_retain";
7627
Michal Karpinski964943a2018-01-19 16:28:26 +00007628 private static final Validator AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN_VALIDATOR =
7629 NON_NEGATIVE_INTEGER_VALIDATOR;
7630
Daniel Nishic535be12016-06-10 13:51:36 -07007631 /**
7632 * Default number of days of information for the automatic storage manager to retain.
7633 *
7634 * @hide
7635 */
7636 public static final int AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN_DEFAULT = 90;
7637
7638 /**
Daniel Nishif678cc92016-06-24 15:49:25 -07007639 * How many bytes the automatic storage manager has cleared out.
7640 *
7641 * @hide
7642 */
7643 public static final String AUTOMATIC_STORAGE_MANAGER_BYTES_CLEARED =
7644 "automatic_storage_manager_bytes_cleared";
7645
7646
7647 /**
7648 * Last run time for the automatic storage manager.
7649 *
7650 * @hide
7651 */
7652 public static final String AUTOMATIC_STORAGE_MANAGER_LAST_RUN =
7653 "automatic_storage_manager_last_run";
7654
Jorge Gil6825a772016-06-30 11:07:18 -07007655 /**
Daniel Nishida7332c2017-06-12 10:17:33 -07007656 * If the automatic storage manager has been disabled by policy. Note that this doesn't
7657 * mean that the automatic storage manager is prevented from being re-enabled -- this only
7658 * means that it was turned off by policy at least once.
7659 *
7660 * @hide
7661 */
7662 public static final String AUTOMATIC_STORAGE_MANAGER_TURNED_OFF_BY_POLICY =
7663 "automatic_storage_manager_turned_off_by_policy";
7664
7665 /**
Doris Linga60d31d2016-07-06 13:39:05 -07007666 * Whether SystemUI navigation keys is enabled.
7667 * @hide
7668 */
7669 public static final String SYSTEM_NAVIGATION_KEYS_ENABLED =
7670 "system_navigation_keys_enabled";
7671
Michal Karpinski964943a2018-01-19 16:28:26 +00007672 private static final Validator SYSTEM_NAVIGATION_KEYS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
7673
Allison Babickf0bc8662016-07-11 15:39:16 -07007674 /**
Jason Monkbaade752016-08-25 15:57:14 -04007675 * Holds comma separated list of ordering of QS tiles.
7676 * @hide
7677 */
7678 public static final String QS_TILES = "sysui_qs_tiles";
7679
Michal Karpinski964943a2018-01-19 16:28:26 +00007680 private static final Validator QS_TILES_VALIDATOR = new Validator() {
7681 @Override
7682 public boolean validate(String value) {
7683 if (value == null) {
7684 return false;
7685 }
7686 String[] tiles = value.split(",");
7687 boolean valid = true;
7688 for (String tile : tiles) {
7689 // tile can be any non-empty string as specified by OEM
7690 valid |= ((tile.length() > 0) && ANY_STRING_VALIDATOR.validate(tile));
7691 }
7692 return valid;
7693 }
7694 };
7695
Jason Monkbaade752016-08-25 15:57:14 -04007696 /**
Todd Kennedyefc1c4d2016-07-21 07:44:33 -07007697 * Specifies whether the web action API is enabled.
7698 *
7699 * @hide
7700 */
Jesse Evansfc1bfc42017-04-07 16:11:26 -07007701 @SystemApi
7702 public static final String INSTANT_APPS_ENABLED = "instant_apps_enabled";
Todd Kennedyefc1c4d2016-07-21 07:44:33 -07007703
7704 /**
Greg Plesur35144042016-10-10 16:23:49 -04007705 * Has this pairable device been paired or upgraded from a previously paired system.
7706 * @hide
7707 */
7708 public static final String DEVICE_PAIRED = "device_paired";
7709
7710 /**
Shahriyar Amini9343f572017-01-12 12:03:24 -08007711 * Integer state indicating whether package verifier is enabled.
7712 * TODO(b/34259924): Remove this setting.
7713 *
7714 * @hide
7715 */
7716 public static final String PACKAGE_VERIFIER_STATE = "package_verifier_state";
7717
7718 /**
Jack Yu39028572017-02-23 09:49:25 -08007719 * Specifies additional package name for broadcasting the CMAS messages.
7720 * @hide
7721 */
7722 public static final String CMAS_ADDITIONAL_BROADCAST_PKG = "cmas_additional_broadcast_pkg";
7723
7724 /**
Chris Wren89aa2262017-05-05 18:05:56 -04007725 * Whether the launcher should show any notification badges.
7726 * The value is boolean (1 or 0).
7727 * @hide
7728 */
7729 public static final String NOTIFICATION_BADGING = "notification_badging";
7730
Michal Karpinski964943a2018-01-19 16:28:26 +00007731 private static final Validator NOTIFICATION_BADGING_VALIDATOR = BOOLEAN_VALIDATOR;
7732
Chris Wren89aa2262017-05-05 18:05:56 -04007733 /**
Jason Monkcb5296a2017-06-30 10:28:18 -04007734 * Comma separated list of QS tiles that have been auto-added already.
7735 * @hide
7736 */
7737 public static final String QS_AUTO_ADDED_TILES = "qs_auto_tiles";
7738
Michal Karpinski964943a2018-01-19 16:28:26 +00007739 private static final Validator QS_AUTO_ADDED_TILES_VALIDATOR = new Validator() {
7740 @Override
7741 public boolean validate(String value) {
7742 if (value == null) {
7743 return false;
7744 }
7745 String[] tiles = value.split(",");
7746 boolean valid = true;
7747 for (String tile : tiles) {
7748 // tile can be any non-empty string as specified by OEM
7749 valid |= ((tile.length() > 0) && ANY_STRING_VALIDATOR.validate(tile));
7750 }
7751 return valid;
7752 }
7753 };
7754
Jason Monkcb5296a2017-06-30 10:28:18 -04007755 /**
Chad Brubaker4f28f0d2017-09-07 14:28:13 -07007756 * Whether the Lockdown button should be shown in the power menu.
7757 * @hide
7758 */
7759 public static final String LOCKDOWN_IN_POWER_MENU = "lockdown_in_power_menu";
Tim Zhengcc1e76a2017-08-30 17:46:19 -07007760
Michal Karpinski964943a2018-01-19 16:28:26 +00007761 private static final Validator LOCKDOWN_IN_POWER_MENU_VALIDATOR = BOOLEAN_VALIDATOR;
7762
Tim Zhengcc1e76a2017-08-30 17:46:19 -07007763 /**
7764 * Backup manager behavioral parameters.
7765 * This is encoded as a key=value list, separated by commas. Ex:
7766 *
7767 * "key_value_backup_interval_milliseconds=14400000,key_value_backup_require_charging=true"
7768 *
7769 * The following keys are supported:
7770 *
7771 * <pre>
7772 * key_value_backup_interval_milliseconds (long)
7773 * key_value_backup_fuzz_milliseconds (long)
7774 * key_value_backup_require_charging (boolean)
7775 * key_value_backup_required_network_type (int)
7776 * full_backup_interval_milliseconds (long)
7777 * full_backup_require_charging (boolean)
7778 * full_backup_required_network_type (int)
Denis Kuznetsov02a1c082017-12-27 16:21:22 +01007779 * backup_finished_notification_receivers (String[])
Tim Zhengcc1e76a2017-08-30 17:46:19 -07007780 * </pre>
7781 *
Denis Kuznetsov02a1c082017-12-27 16:21:22 +01007782 * backup_finished_notification_receivers uses ":" as delimeter for values.
7783 *
Tim Zhengcc1e76a2017-08-30 17:46:19 -07007784 * <p>
7785 * Type: string
7786 * @hide
7787 */
7788 public static final String BACKUP_MANAGER_CONSTANTS = "backup_manager_constants";
7789
Bernardo Rufinoeaa78b92018-01-26 11:25:37 +00007790
7791 /**
7792 * Local transport parameters so we can configure it for tests.
7793 * This is encoded as a key=value list, separated by commas.
7794 *
7795 * The following keys are supported:
7796 *
7797 * <pre>
7798 * fake_encryption_flag (boolean)
7799 * </pre>
7800 *
7801 * <p>
7802 * Type: string
7803 * @hide
7804 */
7805 public static final String BACKUP_LOCAL_TRANSPORT_PARAMETERS =
7806 "backup_local_transport_parameters";
7807
Chad Brubaker4f28f0d2017-09-07 14:28:13 -07007808 /**
Daniel Nishi797641272018-01-02 16:48:33 -08007809 * Flag to set if the system should predictively attempt to re-enable Bluetooth while
7810 * the user is driving.
7811 * @hide
7812 */
7813 public static final String BLUETOOTH_ON_WHILE_DRIVING = "bluetooth_on_while_driving";
7814
7815 /**
Mike Digman55272862018-02-20 14:35:17 -08007816 * What behavior should be invoked when the volume hush gesture is triggered
7817 * One of VOLUME_HUSH_OFF, VOLUME_HUSH_VIBRATE, VOLUME_HUSH_MUTE.
7818 *
7819 * @hide
7820 */
7821 public static final String VOLUME_HUSH_GESTURE = "volume_hush_gesture";
7822
7823 /** @hide */ public static final int VOLUME_HUSH_OFF = 0;
7824 /** @hide */ public static final int VOLUME_HUSH_VIBRATE = 1;
7825 /** @hide */ public static final int VOLUME_HUSH_MUTE = 2;
7826
7827 private static final Validator VOLUME_HUSH_GESTURE_VALIDATOR =
7828 NON_NEGATIVE_INTEGER_VALIDATOR;
7829
7830 /**
Makoto Onuki16a0dd22018-03-20 10:40:37 -07007831 * The number of times (integer) the user has manually enabled battery saver.
7832 * @hide
7833 */
7834 public static final String LOW_POWER_MANUAL_ACTIVATION_COUNT =
7835 "low_power_manual_activation_count";
7836
7837 /**
7838 * Whether the "first time battery saver warning" dialog needs to be shown (0: default)
7839 * or not (1).
7840 *
7841 * @hide
7842 */
7843 public static final String LOW_POWER_WARNING_ACKNOWLEDGED =
7844 "low_power_warning_acknowledged";
7845
7846 /**
Makoto Onuki52c62952018-03-22 10:43:03 -07007847 * 0 (default) Auto battery saver suggestion has not been suppressed. 1) it has been
7848 * suppressed.
7849 * @hide
7850 */
7851 public static final String SUPPRESS_AUTO_BATTERY_SAVER_SUGGESTION =
7852 "suppress_auto_battery_saver_suggestion";
7853
7854 /**
Artem Iglikov5b538752018-03-27 15:12:18 +01007855 * List of packages, which data need to be unconditionally cleared before full restore.
7856 * Type: string
7857 * @hide
7858 */
7859 public static final String PACKAGES_TO_CLEAR_DATA_BEFORE_FULL_RESTORE =
7860 "packages_to_clear_data_before_full_restore";
7861
7862 /**
Svetoslav Ganova571a582011-09-20 18:32:20 -07007863 * This are the settings to be backed up.
7864 *
7865 * NOTE: Settings are backed up and restored in the order they appear
7866 * in this array. If you have one setting depending on another,
7867 * make sure that they are ordered appropriately.
7868 *
-b master501eec92009-07-06 13:53:11 -07007869 * @hide
7870 */
7871 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate58f41ec2013-01-11 15:40:36 -08007872 BUGREPORT_IN_POWER_MENU, // moved to global
Amith Yamasani8823c0a82009-07-07 14:30:17 -07007873 ALLOW_MOCK_LOCATION,
Christopher Tate66488d62012-10-02 11:58:01 -07007874 USB_MASS_STORAGE_ENABLED, // moved to global
Anna Galuszafa7786c2015-12-22 10:53:44 -08007875 ACCESSIBILITY_DISPLAY_INVERSION_ENABLED,
7876 ACCESSIBILITY_DISPLAY_DALTONIZER,
Anna Galuszafa7786c2015-12-22 10:53:44 -08007877 ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED,
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07007878 ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED,
Casey Burkhardt74922c62017-02-13 12:43:16 -08007879 ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED,
Svetoslav Ganovd8561a22017-04-25 15:26:03 -07007880 AUTOFILL_SERVICE,
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07007881 ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE,
-b master501eec92009-07-06 13:53:11 -07007882 ENABLED_ACCESSIBILITY_SERVICES,
Ruben Brunke24b9a62016-02-16 21:38:24 -08007883 ENABLED_VR_LISTENERS,
Svetoslav Ganov9a4c5cd2012-05-30 14:06:32 -07007884 TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES,
Svetoslav Ganova28a16d2011-07-28 11:24:21 -07007885 TOUCH_EXPLORATION_ENABLED,
Svetoslav Ganova571a582011-09-20 18:32:20 -07007886 ACCESSIBILITY_ENABLED,
Phil Weaver106fe732016-11-22 18:18:39 -08007887 ACCESSIBILITY_SHORTCUT_TARGET_SERVICE,
Casey Burkhardt5e8b9802017-03-24 10:07:20 -07007888 ACCESSIBILITY_BUTTON_TARGET_COMPONENT,
Phil Weaver106fe732016-11-22 18:18:39 -08007889 ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN,
Phil Weaverce687c52017-03-15 08:51:52 -07007890 ACCESSIBILITY_SHORTCUT_ENABLED,
7891 ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN,
Svetoslav Ganov55f937a2011-12-05 11:42:07 -08007892 ACCESSIBILITY_SPEAK_PASSWORD,
Chris Craikcce47eb2014-07-16 15:12:15 -07007893 ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED,
Anna Galuszafa7786c2015-12-22 10:53:44 -08007894 ACCESSIBILITY_CAPTIONING_PRESET,
Alan Viveretteef793802013-07-23 14:15:28 -07007895 ACCESSIBILITY_CAPTIONING_ENABLED,
7896 ACCESSIBILITY_CAPTIONING_LOCALE,
7897 ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR,
7898 ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR,
7899 ACCESSIBILITY_CAPTIONING_EDGE_TYPE,
7900 ACCESSIBILITY_CAPTIONING_EDGE_COLOR,
7901 ACCESSIBILITY_CAPTIONING_TYPEFACE,
Alan Viverette69ce69b2013-08-29 12:23:48 -07007902 ACCESSIBILITY_CAPTIONING_FONT_SCALE,
Anna Galuszafa7786c2015-12-22 10:53:44 -08007903 ACCESSIBILITY_CAPTIONING_WINDOW_COLOR,
-b master501eec92009-07-06 13:53:11 -07007904 TTS_DEFAULT_RATE,
7905 TTS_DEFAULT_PITCH,
7906 TTS_DEFAULT_SYNTH,
Charles Chenceffa152010-03-16 21:18:10 -07007907 TTS_ENABLED_PLUGINS,
Narayan Kamath6d632962011-08-24 11:51:37 +01007908 TTS_DEFAULT_LOCALE,
Anna Galuszafa7786c2015-12-22 10:53:44 -08007909 SHOW_IME_WITH_HARD_KEYBOARD,
Christopher Tate66488d62012-10-02 11:58:01 -07007910 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, // moved to global
7911 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, // moved to global
7912 WIFI_NUM_OPEN_NETWORKS_KEPT, // moved to global
Christopher Tate06cbadd2015-03-16 18:29:42 -07007913 SELECTED_SPELL_CHECKER,
7914 SELECTED_SPELL_CHECKER_SUBTYPE,
7915 SPELL_CHECKER_ENABLED,
San Mehat87734d32010-01-08 12:53:06 -08007916 MOUNT_PLAY_NOTIFICATION_SND,
7917 MOUNT_UMS_AUTOSTART,
7918 MOUNT_UMS_PROMPT,
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07007919 MOUNT_UMS_NOTIFY_ENABLED,
Jason Monk27bbb2d2015-03-31 16:46:39 -04007920 SLEEP_TIMEOUT,
7921 DOUBLE_TAP_TO_WAKE,
Anna Galuszafa7786c2015-12-22 10:53:44 -08007922 WAKE_GESTURE_ENABLED,
7923 LONG_PRESS_TIMEOUT,
Jason Monk5a5e7d62015-08-04 11:20:25 -04007924 CAMERA_GESTURE_DISABLED,
Toni Barzic386f8342015-09-09 12:30:41 -07007925 ACCESSIBILITY_AUTOCLICK_ENABLED,
Anna Galuszafa7786c2015-12-22 10:53:44 -08007926 ACCESSIBILITY_AUTOCLICK_DELAY,
7927 ACCESSIBILITY_LARGE_POINTER_ICON,
7928 PREFERRED_TTY_MODE,
7929 ENHANCED_VOICE_PRIVACY_ENABLED,
7930 TTY_MODE_ENABLED,
Hall Liu44e41012018-04-02 15:41:07 -07007931 RTT_CALLING_MODE,
Mike Tsaofc47ba72016-07-15 09:54:07 -07007932 INCALL_POWER_BUTTON_BEHAVIOR,
7933 NIGHT_DISPLAY_CUSTOM_START_TIME,
7934 NIGHT_DISPLAY_CUSTOM_END_TIME,
Christine Franks6418d0b2017-02-13 09:48:00 -08007935 NIGHT_DISPLAY_COLOR_TEMPERATURE,
Mike Tsaofc47ba72016-07-15 09:54:07 -07007936 NIGHT_DISPLAY_AUTO_MODE,
Doris Ling5fafa3c2016-08-26 15:00:49 -07007937 SYNC_PARENT_SOUNDS,
Doris Ling8a332732016-08-24 15:05:43 -07007938 CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED,
Mehdi Alizadeh1264d882018-04-03 18:38:34 -07007939 SWIPE_UP_TO_SWITCH_APPS_ENABLED,
Doris Ling8a332732016-08-24 15:05:43 -07007940 CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED,
Jason Monkbaade752016-08-25 15:57:14 -04007941 SYSTEM_NAVIGATION_KEYS_ENABLED,
7942 QS_TILES,
Doris Ling6403b402016-09-09 14:29:19 -07007943 DOZE_ENABLED,
7944 DOZE_PULSE_ON_PICK_UP,
Ruchi Kandoi104e0b42016-12-29 13:31:43 -08007945 DOZE_PULSE_ON_DOUBLE_TAP,
Daniel Nishieb70ad42017-01-27 10:51:35 -08007946 NFC_PAYMENT_DEFAULT_COMPONENT,
Philip Quinnc4cc3082017-02-13 20:18:16 -08007947 AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN,
Santos Cordon5bce4942017-02-27 11:50:18 -08007948 ASSIST_GESTURE_ENABLED,
Philip Quinn80274ca2017-03-03 10:38:38 -08007949 ASSIST_GESTURE_SENSITIVITY,
Kevin Chyn80939372017-06-09 15:40:18 -07007950 ASSIST_GESTURE_SETUP_COMPLETE,
7951 ASSIST_GESTURE_SILENCE_ALERTS_ENABLED,
7952 ASSIST_GESTURE_WAKE_ENABLED,
Chris Wren89aa2262017-05-05 18:05:56 -04007953 VR_DISPLAY_MODE,
Jason Monkcb5296a2017-06-30 10:28:18 -04007954 NOTIFICATION_BADGING,
7955 QS_AUTO_ADDED_TILES,
Jason Monkdf31eff2017-07-10 11:14:19 -04007956 SCREENSAVER_ENABLED,
7957 SCREENSAVER_COMPONENTS,
7958 SCREENSAVER_ACTIVATE_ON_DOCK,
7959 SCREENSAVER_ACTIVATE_ON_SLEEP,
Chad Brubaker4f28f0d2017-09-07 14:28:13 -07007960 LOCKDOWN_IN_POWER_MENU,
Andrew Sapperstein43643ae2017-12-20 15:17:33 -08007961 SHOW_FIRST_CRASH_DIALOG_DEV_OPTION,
Mike Digman55272862018-02-20 14:35:17 -08007962 VOLUME_HUSH_GESTURE
-b master501eec92009-07-06 13:53:11 -07007963 };
7964
Michal Karpinski964943a2018-01-19 16:28:26 +00007965 /**
7966 * All settings in {@link SETTINGS_TO_BACKUP} array *must* have a non-null validator,
7967 * otherwise they won't be restored.
7968 *
7969 * @hide
7970 */
7971 public static final Map<String, Validator> VALIDATORS = new ArrayMap<>();
7972 static {
7973 VALIDATORS.put(BUGREPORT_IN_POWER_MENU, BUGREPORT_IN_POWER_MENU_VALIDATOR);
7974 VALIDATORS.put(ALLOW_MOCK_LOCATION, ALLOW_MOCK_LOCATION_VALIDATOR);
7975 VALIDATORS.put(USB_MASS_STORAGE_ENABLED, USB_MASS_STORAGE_ENABLED_VALIDATOR);
7976 VALIDATORS.put(ACCESSIBILITY_DISPLAY_INVERSION_ENABLED,
7977 ACCESSIBILITY_DISPLAY_INVERSION_ENABLED_VALIDATOR);
7978 VALIDATORS.put(ACCESSIBILITY_DISPLAY_DALTONIZER,
7979 ACCESSIBILITY_DISPLAY_DALTONIZER_VALIDATOR);
7980 VALIDATORS.put(ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED,
7981 ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED_VALIDATOR);
7982 VALIDATORS.put(ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED,
7983 ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED_VALIDATOR);
7984 VALIDATORS.put(ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED,
7985 ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED_VALIDATOR);
7986 VALIDATORS.put(AUTOFILL_SERVICE, AUTOFILL_SERVICE_VALIDATOR);
7987 VALIDATORS.put(ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE,
7988 ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE_VALIDATOR);
7989 VALIDATORS.put(ENABLED_ACCESSIBILITY_SERVICES,
7990 ENABLED_ACCESSIBILITY_SERVICES_VALIDATOR);
7991 VALIDATORS.put(ENABLED_VR_LISTENERS, ENABLED_VR_LISTENERS_VALIDATOR);
Michal Karpinski964943a2018-01-19 16:28:26 +00007992 VALIDATORS.put(TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES,
7993 TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES_VALIDATOR);
7994 VALIDATORS.put(TOUCH_EXPLORATION_ENABLED, TOUCH_EXPLORATION_ENABLED_VALIDATOR);
7995 VALIDATORS.put(ACCESSIBILITY_ENABLED, ACCESSIBILITY_ENABLED_VALIDATOR);
7996 VALIDATORS.put(ACCESSIBILITY_SHORTCUT_TARGET_SERVICE,
7997 ACCESSIBILITY_SHORTCUT_TARGET_SERVICE_VALIDATOR);
7998 VALIDATORS.put(ACCESSIBILITY_BUTTON_TARGET_COMPONENT,
7999 ACCESSIBILITY_BUTTON_TARGET_COMPONENT_VALIDATOR);
8000 VALIDATORS.put(ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN,
8001 ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN_VALIDATOR);
8002 VALIDATORS.put(ACCESSIBILITY_SHORTCUT_ENABLED,
8003 ACCESSIBILITY_SHORTCUT_ENABLED_VALIDATOR);
8004 VALIDATORS.put(ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN,
8005 ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN_VALIDATOR);
8006 VALIDATORS.put(ACCESSIBILITY_SPEAK_PASSWORD, ACCESSIBILITY_SPEAK_PASSWORD_VALIDATOR);
8007 VALIDATORS.put(ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED,
8008 ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED_VALIDATOR);
8009 VALIDATORS.put(ACCESSIBILITY_CAPTIONING_PRESET,
8010 ACCESSIBILITY_CAPTIONING_PRESET_VALIDATOR);
8011 VALIDATORS.put(ACCESSIBILITY_CAPTIONING_ENABLED,
8012 ACCESSIBILITY_CAPTIONING_ENABLED_VALIDATOR);
8013 VALIDATORS.put(ACCESSIBILITY_CAPTIONING_LOCALE,
8014 ACCESSIBILITY_CAPTIONING_LOCALE_VALIDATOR);
8015 VALIDATORS.put(ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR,
8016 ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR_VALIDATOR);
8017 VALIDATORS.put(ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR,
8018 ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR_VALIDATOR);
8019 VALIDATORS.put(ACCESSIBILITY_CAPTIONING_EDGE_TYPE,
8020 ACCESSIBILITY_CAPTIONING_EDGE_TYPE_VALIDATOR);
8021 VALIDATORS.put(ACCESSIBILITY_CAPTIONING_EDGE_COLOR,
8022 ACCESSIBILITY_CAPTIONING_EDGE_COLOR_VALIDATOR);
8023 VALIDATORS.put(ACCESSIBILITY_CAPTIONING_TYPEFACE,
8024 ACCESSIBILITY_CAPTIONING_TYPEFACE_VALIDATOR);
8025 VALIDATORS.put(ACCESSIBILITY_CAPTIONING_FONT_SCALE,
8026 ACCESSIBILITY_CAPTIONING_FONT_SCALE_VALIDATOR);
8027 VALIDATORS.put(ACCESSIBILITY_CAPTIONING_WINDOW_COLOR,
8028 ACCESSIBILITY_CAPTIONING_WINDOW_COLOR_VALIDATOR);
8029 VALIDATORS.put(TTS_DEFAULT_RATE, TTS_DEFAULT_RATE_VALIDATOR);
8030 VALIDATORS.put(TTS_DEFAULT_PITCH, TTS_DEFAULT_PITCH_VALIDATOR);
8031 VALIDATORS.put(TTS_DEFAULT_SYNTH, TTS_DEFAULT_SYNTH_VALIDATOR);
8032 VALIDATORS.put(TTS_ENABLED_PLUGINS, TTS_ENABLED_PLUGINS_VALIDATOR);
8033 VALIDATORS.put(TTS_DEFAULT_LOCALE, TTS_DEFAULT_LOCALE_VALIDATOR);
8034 VALIDATORS.put(SHOW_IME_WITH_HARD_KEYBOARD, SHOW_IME_WITH_HARD_KEYBOARD_VALIDATOR);
8035 VALIDATORS.put(WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
8036 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR);
8037 VALIDATORS.put(WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY,
8038 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_VALIDATOR);
8039 VALIDATORS.put(WIFI_NUM_OPEN_NETWORKS_KEPT, WIFI_NUM_OPEN_NETWORKS_KEPT_VALIDATOR);
8040 VALIDATORS.put(SELECTED_SPELL_CHECKER, SELECTED_SPELL_CHECKER_VALIDATOR);
8041 VALIDATORS.put(SELECTED_SPELL_CHECKER_SUBTYPE,
8042 SELECTED_SPELL_CHECKER_SUBTYPE_VALIDATOR);
8043 VALIDATORS.put(SPELL_CHECKER_ENABLED, SPELL_CHECKER_ENABLED_VALIDATOR);
8044 VALIDATORS.put(MOUNT_PLAY_NOTIFICATION_SND, MOUNT_PLAY_NOTIFICATION_SND_VALIDATOR);
8045 VALIDATORS.put(MOUNT_UMS_AUTOSTART, MOUNT_UMS_AUTOSTART_VALIDATOR);
8046 VALIDATORS.put(MOUNT_UMS_PROMPT, MOUNT_UMS_PROMPT_VALIDATOR);
8047 VALIDATORS.put(MOUNT_UMS_NOTIFY_ENABLED, MOUNT_UMS_NOTIFY_ENABLED_VALIDATOR);
8048 VALIDATORS.put(SLEEP_TIMEOUT, SLEEP_TIMEOUT_VALIDATOR);
8049 VALIDATORS.put(DOUBLE_TAP_TO_WAKE, DOUBLE_TAP_TO_WAKE_VALIDATOR);
8050 VALIDATORS.put(WAKE_GESTURE_ENABLED, WAKE_GESTURE_ENABLED_VALIDATOR);
8051 VALIDATORS.put(LONG_PRESS_TIMEOUT, LONG_PRESS_TIMEOUT_VALIDATOR);
8052 VALIDATORS.put(CAMERA_GESTURE_DISABLED, CAMERA_GESTURE_DISABLED_VALIDATOR);
8053 VALIDATORS.put(ACCESSIBILITY_AUTOCLICK_ENABLED,
8054 ACCESSIBILITY_AUTOCLICK_ENABLED_VALIDATOR);
8055 VALIDATORS.put(ACCESSIBILITY_AUTOCLICK_DELAY, ACCESSIBILITY_AUTOCLICK_DELAY_VALIDATOR);
8056 VALIDATORS.put(ACCESSIBILITY_LARGE_POINTER_ICON,
8057 ACCESSIBILITY_LARGE_POINTER_ICON_VALIDATOR);
8058 VALIDATORS.put(PREFERRED_TTY_MODE, PREFERRED_TTY_MODE_VALIDATOR);
8059 VALIDATORS.put(ENHANCED_VOICE_PRIVACY_ENABLED,
8060 ENHANCED_VOICE_PRIVACY_ENABLED_VALIDATOR);
8061 VALIDATORS.put(TTY_MODE_ENABLED, TTY_MODE_ENABLED_VALIDATOR);
Hall Liu44e41012018-04-02 15:41:07 -07008062 VALIDATORS.put(RTT_CALLING_MODE, RTT_CALLING_MODE_VALIDATOR);
Michal Karpinski964943a2018-01-19 16:28:26 +00008063 VALIDATORS.put(INCALL_POWER_BUTTON_BEHAVIOR, INCALL_POWER_BUTTON_BEHAVIOR_VALIDATOR);
8064 VALIDATORS.put(NIGHT_DISPLAY_CUSTOM_START_TIME,
8065 NIGHT_DISPLAY_CUSTOM_START_TIME_VALIDATOR);
8066 VALIDATORS.put(NIGHT_DISPLAY_CUSTOM_END_TIME, NIGHT_DISPLAY_CUSTOM_END_TIME_VALIDATOR);
8067 VALIDATORS.put(NIGHT_DISPLAY_COLOR_TEMPERATURE,
8068 NIGHT_DISPLAY_COLOR_TEMPERATURE_VALIDATOR);
8069 VALIDATORS.put(NIGHT_DISPLAY_AUTO_MODE, NIGHT_DISPLAY_AUTO_MODE_VALIDATOR);
8070 VALIDATORS.put(SYNC_PARENT_SOUNDS, SYNC_PARENT_SOUNDS_VALIDATOR);
8071 VALIDATORS.put(CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED,
8072 CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED_VALIDATOR);
Mehdi Alizadeh1264d882018-04-03 18:38:34 -07008073 VALIDATORS.put(SWIPE_UP_TO_SWITCH_APPS_ENABLED,
8074 SWIPE_UP_TO_SWITCH_APPS_ENABLED_VALIDATOR);
Michal Karpinski964943a2018-01-19 16:28:26 +00008075 VALIDATORS.put(CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED,
8076 CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED_VALIDATOR);
8077 VALIDATORS.put(SYSTEM_NAVIGATION_KEYS_ENABLED,
8078 SYSTEM_NAVIGATION_KEYS_ENABLED_VALIDATOR);
8079 VALIDATORS.put(QS_TILES, QS_TILES_VALIDATOR);
8080 VALIDATORS.put(DOZE_ENABLED, DOZE_ENABLED_VALIDATOR);
8081 VALIDATORS.put(DOZE_PULSE_ON_PICK_UP, DOZE_PULSE_ON_PICK_UP_VALIDATOR);
8082 VALIDATORS.put(DOZE_PULSE_ON_DOUBLE_TAP, DOZE_PULSE_ON_DOUBLE_TAP_VALIDATOR);
8083 VALIDATORS.put(NFC_PAYMENT_DEFAULT_COMPONENT, NFC_PAYMENT_DEFAULT_COMPONENT_VALIDATOR);
8084 VALIDATORS.put(AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN,
8085 AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN_VALIDATOR);
8086 VALIDATORS.put(ASSIST_GESTURE_ENABLED, ASSIST_GESTURE_ENABLED_VALIDATOR);
8087 VALIDATORS.put(ASSIST_GESTURE_SENSITIVITY, ASSIST_GESTURE_SENSITIVITY_VALIDATOR);
8088 VALIDATORS.put(ASSIST_GESTURE_SETUP_COMPLETE, ASSIST_GESTURE_SETUP_COMPLETE_VALIDATOR);
8089 VALIDATORS.put(ASSIST_GESTURE_SILENCE_ALERTS_ENABLED,
8090 ASSIST_GESTURE_SILENCE_ALERTS_ENABLED_VALIDATOR);
8091 VALIDATORS.put(ASSIST_GESTURE_WAKE_ENABLED, ASSIST_GESTURE_WAKE_ENABLED_VALIDATOR);
8092 VALIDATORS.put(VR_DISPLAY_MODE, VR_DISPLAY_MODE_VALIDATOR);
8093 VALIDATORS.put(NOTIFICATION_BADGING, NOTIFICATION_BADGING_VALIDATOR);
8094 VALIDATORS.put(QS_AUTO_ADDED_TILES, QS_AUTO_ADDED_TILES_VALIDATOR);
8095 VALIDATORS.put(SCREENSAVER_ENABLED, SCREENSAVER_ENABLED_VALIDATOR);
8096 VALIDATORS.put(SCREENSAVER_COMPONENTS, SCREENSAVER_COMPONENTS_VALIDATOR);
8097 VALIDATORS.put(SCREENSAVER_ACTIVATE_ON_DOCK, SCREENSAVER_ACTIVATE_ON_DOCK_VALIDATOR);
8098 VALIDATORS.put(SCREENSAVER_ACTIVATE_ON_SLEEP, SCREENSAVER_ACTIVATE_ON_SLEEP_VALIDATOR);
8099 VALIDATORS.put(LOCKDOWN_IN_POWER_MENU, LOCKDOWN_IN_POWER_MENU_VALIDATOR);
8100 VALIDATORS.put(SHOW_FIRST_CRASH_DIALOG_DEV_OPTION,
8101 SHOW_FIRST_CRASH_DIALOG_DEV_OPTION_VALIDATOR);
Mike Digman55272862018-02-20 14:35:17 -08008102 VALIDATORS.put(VOLUME_HUSH_GESTURE, VOLUME_HUSH_GESTURE_VALIDATOR);
Michal Karpinski964943a2018-01-19 16:28:26 +00008103 VALIDATORS.put(ENABLED_NOTIFICATION_LISTENERS,
8104 ENABLED_NOTIFICATION_LISTENERS_VALIDATOR); //legacy restore setting
8105 VALIDATORS.put(ENABLED_NOTIFICATION_ASSISTANT,
8106 ENABLED_NOTIFICATION_ASSISTANT_VALIDATOR); //legacy restore setting
8107 VALIDATORS.put(ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES,
8108 ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES_VALIDATOR); //legacy restore setting
8109 }
8110
8111 /**
8112 * Keys we no longer back up under the current schema, but want to continue to
8113 * process when restoring historical backup datasets.
8114 *
8115 * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator,
8116 * otherwise they won't be restored.
8117 *
8118 * @hide
8119 */
Christopher Tate1d0fca32017-06-06 13:30:00 -07008120 public static final String[] LEGACY_RESTORE_SETTINGS = {
Julia Reynoldsb852e562017-06-06 16:14:18 -04008121 ENABLED_NOTIFICATION_LISTENERS,
8122 ENABLED_NOTIFICATION_ASSISTANT,
8123 ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES
Christopher Tate1d0fca32017-06-06 13:30:00 -07008124 };
8125
-b master501eec92009-07-06 13:53:11 -07008126 /**
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07008127 * These entries are considered common between the personal and the managed profile,
8128 * since the managed profile doesn't get to change them.
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07008129 */
Svetoslav683914b2015-01-15 14:22:26 -08008130 private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>();
Amith Yamasanib0ff3222015-03-04 09:56:14 -08008131
Svetoslav683914b2015-01-15 14:22:26 -08008132 static {
8133 CLONE_TO_MANAGED_PROFILE.add(ACCESSIBILITY_ENABLED);
8134 CLONE_TO_MANAGED_PROFILE.add(ALLOW_MOCK_LOCATION);
8135 CLONE_TO_MANAGED_PROFILE.add(ALLOWED_GEOLOCATION_ORIGINS);
Felipe Lemeaa008962017-04-18 14:54:33 -07008136 CLONE_TO_MANAGED_PROFILE.add(AUTOFILL_SERVICE);
Svetoslav683914b2015-01-15 14:22:26 -08008137 CLONE_TO_MANAGED_PROFILE.add(DEFAULT_INPUT_METHOD);
8138 CLONE_TO_MANAGED_PROFILE.add(ENABLED_ACCESSIBILITY_SERVICES);
8139 CLONE_TO_MANAGED_PROFILE.add(ENABLED_INPUT_METHODS);
Lifu Tang0cba58f2018-01-23 21:14:15 -08008140 CLONE_TO_MANAGED_PROFILE.add(LOCATION_CHANGER);
Svetoslav683914b2015-01-15 14:22:26 -08008141 CLONE_TO_MANAGED_PROFILE.add(LOCATION_MODE);
8142 CLONE_TO_MANAGED_PROFILE.add(LOCATION_PROVIDERS_ALLOWED);
Svetoslav683914b2015-01-15 14:22:26 -08008143 CLONE_TO_MANAGED_PROFILE.add(SELECTED_INPUT_METHOD_SUBTYPE);
Yohei Yukawa3f8c5682018-03-01 13:10:23 -08008144 if (TextServicesManager.DISABLE_PER_PROFILE_SPELL_CHECKER) {
8145 CLONE_TO_MANAGED_PROFILE.add(SELECTED_SPELL_CHECKER);
8146 CLONE_TO_MANAGED_PROFILE.add(SELECTED_SPELL_CHECKER_SUBTYPE);
8147 }
Svetoslav683914b2015-01-15 14:22:26 -08008148 }
8149
8150 /** @hide */
8151 public static void getCloneToManagedProfileSettings(Set<String> outKeySet) {
8152 outKeySet.addAll(CLONE_TO_MANAGED_PROFILE);
8153 }
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07008154
8155 /**
Todd Kennedybe0b8892017-02-15 14:13:52 -08008156 * Secure settings which can be accessed by instant apps.
Chad Brubaker97bccee2017-01-05 15:51:41 -08008157 * @hide
8158 */
Todd Kennedybe0b8892017-02-15 14:13:52 -08008159 public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>();
Chad Brubaker97bccee2017-01-05 15:51:41 -08008160 static {
Todd Kennedybe0b8892017-02-15 14:13:52 -08008161 INSTANT_APP_SETTINGS.add(ENABLED_ACCESSIBILITY_SERVICES);
8162 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_SPEAK_PASSWORD);
8163 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_INVERSION_ENABLED);
Chad Brubaker9408d512017-03-28 16:11:38 -07008164 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_ENABLED);
8165 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_PRESET);
8166 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_EDGE_TYPE);
8167 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_EDGE_COLOR);
8168 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_LOCALE);
8169 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR);
8170 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR);
8171 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_TYPEFACE);
8172 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_FONT_SCALE);
Chad Brubakerd9285b52017-04-27 15:28:57 -07008173 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_WINDOW_COLOR);
8174 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED);
8175 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_DALTONIZER);
8176 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_AUTOCLICK_DELAY);
8177 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_AUTOCLICK_ENABLED);
8178 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_LARGE_POINTER_ICON);
Chad Brubaker97bccee2017-01-05 15:51:41 -08008179
Todd Kennedybe0b8892017-02-15 14:13:52 -08008180 INSTANT_APP_SETTINGS.add(DEFAULT_INPUT_METHOD);
8181 INSTANT_APP_SETTINGS.add(ENABLED_INPUT_METHODS);
Chad Brubaker1bed9372017-03-20 10:52:52 -07008182
8183 INSTANT_APP_SETTINGS.add(ANDROID_ID);
Chad Brubaker8d7b36f2017-04-06 22:57:18 -07008184
8185 INSTANT_APP_SETTINGS.add(PACKAGE_VERIFIER_USER_CONSENT);
Chad Brubaker562afaf2017-04-10 13:32:37 -07008186 INSTANT_APP_SETTINGS.add(ALLOW_MOCK_LOCATION);
Chad Brubaker97bccee2017-01-05 15:51:41 -08008187 }
8188
8189 /**
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07008190 * Helper method for determining if a location provider is enabled.
Tom O'Neilld5759432013-09-11 11:03:03 -07008191 *
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07008192 * @param cr the content resolver to use
8193 * @param provider the location provider to query
8194 * @return true if the provider is enabled
Tom O'Neilld5759432013-09-11 11:03:03 -07008195 *
Maggieaa080f92018-01-04 15:35:11 -08008196 * @deprecated use {@link LocationManager#isProviderEnabled(String)}
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07008197 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07008198 @Deprecated
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07008199 public static final boolean isLocationProviderEnabled(ContentResolver cr, String provider) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07008200 return isLocationProviderEnabledForUser(cr, provider, cr.getUserId());
Victoria Leaseb711d572012-10-02 13:14:11 -07008201 }
8202
8203 /**
8204 * Helper method for determining if a location provider is enabled.
8205 * @param cr the content resolver to use
8206 * @param provider the location provider to query
8207 * @param userId the userId to query
8208 * @return true if the provider is enabled
Maggieaa080f92018-01-04 15:35:11 -08008209 *
8210 * @deprecated use {@link LocationManager#isProviderEnabled(String)}
Victoria Leaseb711d572012-10-02 13:14:11 -07008211 * @hide
8212 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07008213 @Deprecated
Maggieaa080f92018-01-04 15:35:11 -08008214 public static final boolean isLocationProviderEnabledForUser(
8215 ContentResolver cr, String provider, int userId) {
Victoria Leaseb711d572012-10-02 13:14:11 -07008216 String allowedProviders = Settings.Secure.getStringForUser(cr,
8217 LOCATION_PROVIDERS_ALLOWED, userId);
Brad Fitzpatrick11fe1812010-09-10 16:07:52 -07008218 return TextUtils.delimitedStringContains(allowedProviders, ',', provider);
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07008219 }
8220
8221 /**
8222 * Thread-safe method for enabling or disabling a single location provider.
8223 * @param cr the content resolver to use
8224 * @param provider the location provider to enable or disable
8225 * @param enabled true if the provider should be enabled
Maggieaa080f92018-01-04 15:35:11 -08008226 * @deprecated This API is deprecated. It requires WRITE_SECURE_SETTINGS permission to
8227 * change location settings.
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07008228 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07008229 @Deprecated
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07008230 public static final void setLocationProviderEnabled(ContentResolver cr,
8231 String provider, boolean enabled) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -07008232 setLocationProviderEnabledForUser(cr, provider, enabled, cr.getUserId());
Victoria Leaseb711d572012-10-02 13:14:11 -07008233 }
8234
8235 /**
8236 * Thread-safe method for enabling or disabling a single location provider.
Tom O'Neilla324ac72013-08-26 14:40:23 -07008237 *
Victoria Leaseb711d572012-10-02 13:14:11 -07008238 * @param cr the content resolver to use
8239 * @param provider the location provider to enable or disable
8240 * @param enabled true if the provider should be enabled
8241 * @param userId the userId for which to enable/disable providers
Tom O'Neilla324ac72013-08-26 14:40:23 -07008242 * @return true if the value was set, false on database errors
Maggieaa080f92018-01-04 15:35:11 -08008243 *
8244 * @deprecated use {@link LocationManager#setProviderEnabledForUser(String, boolean, int)}
Victoria Leaseb711d572012-10-02 13:14:11 -07008245 * @hide
8246 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07008247 @Deprecated
Tom O'Neilla324ac72013-08-26 14:40:23 -07008248 public static final boolean setLocationProviderEnabledForUser(ContentResolver cr,
Victoria Leaseb711d572012-10-02 13:14:11 -07008249 String provider, boolean enabled, int userId) {
David Christie3f7b6522013-08-06 19:19:08 -07008250 synchronized (mLocationSettingsLock) {
8251 // to ensure thread safety, we write the provider name with a '+' or '-'
8252 // and let the SettingsProvider handle it rather than reading and modifying
8253 // the list of enabled providers.
8254 if (enabled) {
8255 provider = "+" + provider;
8256 } else {
8257 provider = "-" + provider;
8258 }
Tom O'Neilla324ac72013-08-26 14:40:23 -07008259 return putStringForUser(cr, Settings.Secure.LOCATION_PROVIDERS_ALLOWED, provider,
David Christie3f7b6522013-08-06 19:19:08 -07008260 userId);
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07008261 }
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07008262 }
Tom O'Neill1f48b782013-08-19 18:14:56 -07008263
8264 /**
8265 * Thread-safe method for setting the location mode to one of
8266 * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY},
8267 * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}.
Tom O'Neill87c7fad2016-08-04 08:16:12 -07008268 * Necessary because the mode is a composite of the underlying location provider
8269 * settings.
Tom O'Neill1f48b782013-08-19 18:14:56 -07008270 *
Tom O'Neill1f48b782013-08-19 18:14:56 -07008271 * @param cr the content resolver to use
8272 * @param mode such as {@link #LOCATION_MODE_HIGH_ACCURACY}
8273 * @param userId the userId for which to change mode
Tom O'Neilla324ac72013-08-26 14:40:23 -07008274 * @return true if the value was set, false on database errors
Tom O'Neill1f48b782013-08-19 18:14:56 -07008275 *
8276 * @throws IllegalArgumentException if mode is not one of the supported values
Maggieaa080f92018-01-04 15:35:11 -08008277 *
8278 * @deprecated To enable/disable location, use
8279 * {@link LocationManager#setLocationEnabledForUser(boolean, int)}.
8280 * To enable/disable a specific location provider, use
8281 * {@link LocationManager#setProviderEnabledForUser(String, boolean, int)}.
Tom O'Neill1f48b782013-08-19 18:14:56 -07008282 */
Maggieaa080f92018-01-04 15:35:11 -08008283 @Deprecated
8284 private static boolean setLocationModeForUser(
8285 ContentResolver cr, int mode, int userId) {
Tom O'Neill1f48b782013-08-19 18:14:56 -07008286 synchronized (mLocationSettingsLock) {
8287 boolean gps = false;
8288 boolean network = false;
8289 switch (mode) {
8290 case LOCATION_MODE_OFF:
8291 break;
8292 case LOCATION_MODE_SENSORS_ONLY:
8293 gps = true;
8294 break;
8295 case LOCATION_MODE_BATTERY_SAVING:
8296 network = true;
8297 break;
8298 case LOCATION_MODE_HIGH_ACCURACY:
8299 gps = true;
8300 network = true;
8301 break;
8302 default:
8303 throw new IllegalArgumentException("Invalid location mode: " + mode);
8304 }
Maggieaa080f92018-01-04 15:35:11 -08008305
Tom O'Neilla324ac72013-08-26 14:40:23 -07008306 boolean nlpSuccess = Settings.Secure.setLocationProviderEnabledForUser(
Tom O'Neill1f48b782013-08-19 18:14:56 -07008307 cr, LocationManager.NETWORK_PROVIDER, network, userId);
Tom O'Neill7731a992014-10-09 11:30:49 -07008308 boolean gpsSuccess = Settings.Secure.setLocationProviderEnabledForUser(
8309 cr, LocationManager.GPS_PROVIDER, gps, userId);
Tom O'Neilla324ac72013-08-26 14:40:23 -07008310 return gpsSuccess && nlpSuccess;
Tom O'Neill1f48b782013-08-19 18:14:56 -07008311 }
8312 }
8313
8314 /**
Tom O'Neill1f48b782013-08-19 18:14:56 -07008315 * Thread-safe method for reading the location mode, returns one of
8316 * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY},
Tom O'Neill87c7fad2016-08-04 08:16:12 -07008317 * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}. Necessary
8318 * because the mode is a composite of the underlying location provider settings.
Tom O'Neill1f48b782013-08-19 18:14:56 -07008319 *
8320 * @param cr the content resolver to use
8321 * @param userId the userId for which to read the mode
8322 * @return the location mode
8323 */
Tom O'Neill7f6f4572013-08-27 10:53:15 -07008324 private static final int getLocationModeForUser(ContentResolver cr, int userId) {
Tom O'Neill1f48b782013-08-19 18:14:56 -07008325 synchronized (mLocationSettingsLock) {
8326 boolean gpsEnabled = Settings.Secure.isLocationProviderEnabledForUser(
8327 cr, LocationManager.GPS_PROVIDER, userId);
8328 boolean networkEnabled = Settings.Secure.isLocationProviderEnabledForUser(
8329 cr, LocationManager.NETWORK_PROVIDER, userId);
8330 if (gpsEnabled && networkEnabled) {
8331 return LOCATION_MODE_HIGH_ACCURACY;
8332 } else if (gpsEnabled) {
8333 return LOCATION_MODE_SENSORS_ONLY;
8334 } else if (networkEnabled) {
8335 return LOCATION_MODE_BATTERY_SAVING;
8336 } else {
8337 return LOCATION_MODE_OFF;
8338 }
8339 }
8340 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008341 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07008342
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008343 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008344 * Global system settings, containing preferences that always apply identically
8345 * to all defined users. Applications can read these but are not allowed to write;
8346 * like the "Secure" settings, these are for preferences that the user must
8347 * explicitly modify through the system UI or specialized APIs for those values.
8348 */
8349 public static final class Global extends NameValueTable {
Kweku Adamsb0886f32017-10-31 15:32:09 -07008350 // NOTE: If you add new settings here, be sure to add them to
8351 // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoGlobalSettingsLocked.
8352
Christopher Tate06efb532012-08-24 15:29:27 -07008353 /**
8354 * The content:// style URL for global secure settings items. Not public.
8355 */
8356 public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/global");
8357
8358 /**
Amith Yamasani23a0f052014-07-25 12:26:53 -07008359 * Whether users are allowed to add more users or guest from lockscreen.
8360 * <p>
8361 * Type: int
8362 * @hide
8363 */
8364 public static final String ADD_USERS_WHEN_LOCKED = "add_users_when_locked";
8365
8366 /**
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07008367 * Setting whether the global gesture for enabling accessibility is enabled.
8368 * If this gesture is enabled the user will be able to perfrom it to enable
8369 * the accessibility state without visiting the settings app.
Phil Weaver106fe732016-11-22 18:18:39 -08008370 *
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07008371 * @hide
Phil Weaver106fe732016-11-22 18:18:39 -08008372 * No longer used. Should be removed once all dependencies have been updated.
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07008373 */
8374 public static final String ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED =
8375 "enable_accessibility_global_gesture_enabled";
8376
8377 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008378 * Whether Airplane Mode is on.
8379 */
8380 public static final String AIRPLANE_MODE_ON = "airplane_mode_on";
8381
8382 /**
Bryce Lee584a4452014-10-21 15:55:55 -07008383 * Whether Theater Mode is on.
8384 * {@hide}
8385 */
Bryce Leecdfebd62015-02-02 08:19:11 -08008386 @SystemApi
Bryce Lee584a4452014-10-21 15:55:55 -07008387 public static final String THEATER_MODE_ON = "theater_mode_on";
8388
8389 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008390 * Constant for use in AIRPLANE_MODE_RADIOS to specify Bluetooth radio.
8391 */
8392 public static final String RADIO_BLUETOOTH = "bluetooth";
8393
8394 /**
8395 * Constant for use in AIRPLANE_MODE_RADIOS to specify Wi-Fi radio.
8396 */
8397 public static final String RADIO_WIFI = "wifi";
8398
8399 /**
8400 * {@hide}
8401 */
8402 public static final String RADIO_WIMAX = "wimax";
8403 /**
8404 * Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio.
8405 */
8406 public static final String RADIO_CELL = "cell";
8407
8408 /**
8409 * Constant for use in AIRPLANE_MODE_RADIOS to specify NFC radio.
8410 */
8411 public static final String RADIO_NFC = "nfc";
8412
8413 /**
8414 * A comma separated list of radios that need to be disabled when airplane mode
8415 * is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are
8416 * included in the comma separated list.
8417 */
8418 public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios";
8419
8420 /**
8421 * A comma separated list of radios that should to be disabled when airplane mode
8422 * is on, but can be manually reenabled by the user. For example, if RADIO_WIFI is
8423 * added to both AIRPLANE_MODE_RADIOS and AIRPLANE_MODE_TOGGLEABLE_RADIOS, then Wifi
8424 * will be turned off when entering airplane mode, but the user will be able to reenable
8425 * Wifi in the Settings app.
8426 *
8427 * {@hide}
8428 */
8429 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios";
8430
8431 /**
Pulkit Bhuwalka547853d2017-09-25 17:55:12 -07008432 * An integer representing the Bluetooth Class of Device (CoD).
8433 *
8434 * @hide
8435 */
8436 public static final String BLUETOOTH_CLASS_OF_DEVICE = "bluetooth_class_of_device";
8437
8438 /**
Bryce Leeec85f342015-12-16 13:32:28 -08008439 * A Long representing a bitmap of profiles that should be disabled when bluetooth starts.
8440 * See {@link android.bluetooth.BluetoothProfile}.
8441 * {@hide}
8442 */
8443 public static final String BLUETOOTH_DISABLED_PROFILES = "bluetooth_disabled_profiles";
8444
8445 /**
Andre Eisenbach82a94d92016-01-14 14:20:34 -08008446 * A semi-colon separated list of Bluetooth interoperability workarounds.
8447 * Each entry is a partial Bluetooth device address string and an integer representing
8448 * the feature to be disabled, separated by a comma. The integer must correspond
8449 * to a interoperability feature as defined in "interop.h" in /system/bt.
8450 * <p>
8451 * Example: <br/>
8452 * "00:11:22,0;01:02:03:04,2"
8453 * @hide
8454 */
8455 public static final String BLUETOOTH_INTEROPERABILITY_LIST = "bluetooth_interoperability_list";
8456
8457 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008458 * The policy for deciding when Wi-Fi should go to sleep (which will in
8459 * turn switch to using the mobile data as an Internet connection).
8460 * <p>
8461 * Set to one of {@link #WIFI_SLEEP_POLICY_DEFAULT},
8462 * {@link #WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED}, or
8463 * {@link #WIFI_SLEEP_POLICY_NEVER}.
8464 */
8465 public static final String WIFI_SLEEP_POLICY = "wifi_sleep_policy";
8466
8467 /**
8468 * Value for {@link #WIFI_SLEEP_POLICY} to use the default Wi-Fi sleep
8469 * policy, which is to sleep shortly after the turning off
8470 * according to the {@link #STAY_ON_WHILE_PLUGGED_IN} setting.
8471 */
8472 public static final int WIFI_SLEEP_POLICY_DEFAULT = 0;
8473
8474 /**
8475 * Value for {@link #WIFI_SLEEP_POLICY} to use the default policy when
8476 * the device is on battery, and never go to sleep when the device is
8477 * plugged in.
8478 */
8479 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1;
8480
8481 /**
8482 * Value for {@link #WIFI_SLEEP_POLICY} to never go to sleep.
8483 */
8484 public static final int WIFI_SLEEP_POLICY_NEVER = 2;
8485
8486 /**
8487 * Value to specify if the user prefers the date, time and time zone
8488 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
8489 */
8490 public static final String AUTO_TIME = "auto_time";
8491
Michal Karpinski2c37b082018-01-18 16:14:27 +00008492 private static final Validator AUTO_TIME_VALIDATOR = BOOLEAN_VALIDATOR;
8493
Christopher Tate06efb532012-08-24 15:29:27 -07008494 /**
8495 * Value to specify if the user prefers the time zone
8496 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
8497 */
8498 public static final String AUTO_TIME_ZONE = "auto_time_zone";
8499
Michal Karpinski2c37b082018-01-18 16:14:27 +00008500 private static final Validator AUTO_TIME_ZONE_VALIDATOR = BOOLEAN_VALIDATOR;
8501
Christopher Tate06efb532012-08-24 15:29:27 -07008502 /**
8503 * URI for the car dock "in" event sound.
8504 * @hide
8505 */
8506 public static final String CAR_DOCK_SOUND = "car_dock_sound";
8507
8508 /**
8509 * URI for the car dock "out" event sound.
8510 * @hide
8511 */
8512 public static final String CAR_UNDOCK_SOUND = "car_undock_sound";
8513
8514 /**
8515 * URI for the desk dock "in" event sound.
8516 * @hide
8517 */
8518 public static final String DESK_DOCK_SOUND = "desk_dock_sound";
8519
8520 /**
8521 * URI for the desk dock "out" event sound.
8522 * @hide
8523 */
8524 public static final String DESK_UNDOCK_SOUND = "desk_undock_sound";
8525
8526 /**
8527 * Whether to play a sound for dock events.
8528 * @hide
8529 */
8530 public static final String DOCK_SOUNDS_ENABLED = "dock_sounds_enabled";
8531
Michal Karpinski2c37b082018-01-18 16:14:27 +00008532 private static final Validator DOCK_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
8533
Christopher Tate06efb532012-08-24 15:29:27 -07008534 /**
Vinod Krishnancf11cea2016-10-20 22:57:02 -07008535 * Whether to play a sound for dock events, only when an accessibility service is on.
8536 * @hide
8537 */
8538 public static final String DOCK_SOUNDS_ENABLED_WHEN_ACCESSIBILITY = "dock_sounds_enabled_when_accessbility";
8539
8540 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008541 * URI for the "device locked" (keyguard shown) sound.
8542 * @hide
8543 */
8544 public static final String LOCK_SOUND = "lock_sound";
8545
8546 /**
8547 * URI for the "device unlocked" sound.
8548 * @hide
8549 */
8550 public static final String UNLOCK_SOUND = "unlock_sound";
8551
8552 /**
Adrian Roos49e057d2014-08-13 17:14:51 +02008553 * URI for the "device is trusted" sound, which is played when the device enters the trusted
8554 * state without unlocking.
8555 * @hide
8556 */
8557 public static final String TRUSTED_SOUND = "trusted_sound";
8558
8559 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008560 * URI for the low battery sound file.
8561 * @hide
8562 */
8563 public static final String LOW_BATTERY_SOUND = "low_battery_sound";
8564
8565 /**
8566 * Whether to play a sound for low-battery alerts.
8567 * @hide
8568 */
8569 public static final String POWER_SOUNDS_ENABLED = "power_sounds_enabled";
8570
Michal Karpinski2c37b082018-01-18 16:14:27 +00008571 private static final Validator POWER_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
8572
Christopher Tate06efb532012-08-24 15:29:27 -07008573 /**
Beverlyc1313eb2018-01-31 18:07:21 -05008574 * URI for the "wireless charging started" and "wired charging started" sound.
Jeff Brown84e27562012-12-07 13:56:34 -08008575 * @hide
8576 */
Beverlyc1313eb2018-01-31 18:07:21 -05008577 public static final String CHARGING_STARTED_SOUND =
Jeff Brown84e27562012-12-07 13:56:34 -08008578 "wireless_charging_started_sound";
8579
8580 /**
John Spurlock51a871d2015-05-06 17:41:30 -04008581 * Whether to play a sound for charging events.
8582 * @hide
8583 */
8584 public static final String CHARGING_SOUNDS_ENABLED = "charging_sounds_enabled";
8585
Michal Karpinski5db1e432018-01-18 20:10:24 +00008586 private static final Validator CHARGING_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
8587
John Spurlock51a871d2015-05-06 17:41:30 -04008588 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008589 * Whether we keep the device on while the device is plugged in.
8590 * Supported values are:
8591 * <ul>
8592 * <li>{@code 0} to never stay on while plugged in</li>
8593 * <li>{@link BatteryManager#BATTERY_PLUGGED_AC} to stay on for AC charger</li>
8594 * <li>{@link BatteryManager#BATTERY_PLUGGED_USB} to stay on for USB charger</li>
8595 * <li>{@link BatteryManager#BATTERY_PLUGGED_WIRELESS} to stay on for wireless charger</li>
8596 * </ul>
8597 * These values can be OR-ed together.
8598 */
8599 public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in";
8600
Michal Karpinski2c37b082018-01-18 16:14:27 +00008601 private static final Validator STAY_ON_WHILE_PLUGGED_IN_VALIDATOR = new Validator() {
8602 @Override
8603 public boolean validate(String value) {
8604 try {
8605 int val = Integer.parseInt(value);
8606 return (val == 0)
8607 || (val == BatteryManager.BATTERY_PLUGGED_AC)
8608 || (val == BatteryManager.BATTERY_PLUGGED_USB)
8609 || (val == BatteryManager.BATTERY_PLUGGED_WIRELESS)
8610 || (val == (BatteryManager.BATTERY_PLUGGED_AC
8611 | BatteryManager.BATTERY_PLUGGED_USB))
8612 || (val == (BatteryManager.BATTERY_PLUGGED_AC
8613 | BatteryManager.BATTERY_PLUGGED_WIRELESS))
8614 || (val == (BatteryManager.BATTERY_PLUGGED_USB
8615 | BatteryManager.BATTERY_PLUGGED_WIRELESS))
8616 || (val == (BatteryManager.BATTERY_PLUGGED_AC
8617 | BatteryManager.BATTERY_PLUGGED_USB
8618 | BatteryManager.BATTERY_PLUGGED_WIRELESS));
8619 } catch (NumberFormatException e) {
8620 return false;
8621 }
8622 }
8623 };
8624
Christopher Tate06efb532012-08-24 15:29:27 -07008625 /**
Christopher Tate58f41ec2013-01-11 15:40:36 -08008626 * When the user has enable the option to have a "bug report" command
8627 * in the power menu.
8628 * @hide
8629 */
8630 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
8631
Michal Karpinski5db1e432018-01-18 20:10:24 +00008632 private static final Validator BUGREPORT_IN_POWER_MENU_VALIDATOR = BOOLEAN_VALIDATOR;
8633
Christopher Tate58f41ec2013-01-11 15:40:36 -08008634 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008635 * Whether ADB is enabled.
8636 */
8637 public static final String ADB_ENABLED = "adb_enabled";
8638
8639 /**
Jon Miranda836c0a82014-08-11 12:32:26 -07008640 * Whether Views are allowed to save their attribute data.
8641 * @hide
8642 */
8643 public static final String DEBUG_VIEW_ATTRIBUTES = "debug_view_attributes";
8644
8645 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008646 * Whether assisted GPS should be enabled or not.
8647 * @hide
8648 */
8649 public static final String ASSISTED_GPS_ENABLED = "assisted_gps_enabled";
8650
8651 /**
8652 * Whether bluetooth is enabled/disabled
8653 * 0=disabled. 1=enabled.
8654 */
8655 public static final String BLUETOOTH_ON = "bluetooth_on";
8656
Michal Karpinski5db1e432018-01-18 20:10:24 +00008657 private static final Validator BLUETOOTH_ON_VALIDATOR = BOOLEAN_VALIDATOR;
8658
Christopher Tate06efb532012-08-24 15:29:27 -07008659 /**
8660 * CDMA Cell Broadcast SMS
8661 * 0 = CDMA Cell Broadcast SMS disabled
8662 * 1 = CDMA Cell Broadcast SMS enabled
8663 * @hide
8664 */
8665 public static final String CDMA_CELL_BROADCAST_SMS =
8666 "cdma_cell_broadcast_sms";
8667
8668 /**
8669 * The CDMA roaming mode 0 = Home Networks, CDMA default
8670 * 1 = Roaming on Affiliated networks
8671 * 2 = Roaming on any networks
8672 * @hide
8673 */
8674 public static final String CDMA_ROAMING_MODE = "roaming_settings";
8675
8676 /**
8677 * The CDMA subscription mode 0 = RUIM/SIM (default)
8678 * 1 = NV
8679 * @hide
8680 */
8681 public static final String CDMA_SUBSCRIPTION_MODE = "subscription_mode";
8682
Narayan Kamath94bcdbc2017-07-17 15:32:53 +01008683 /**
8684 * The default value for whether background data is enabled or not.
8685 *
8686 * Used by {@code NetworkPolicyManagerService}.
8687 *
8688 * @hide
8689 */
8690 public static final String DEFAULT_RESTRICT_BACKGROUND_DATA =
8691 "default_restrict_background_data";
8692
Christopher Tate06efb532012-08-24 15:29:27 -07008693 /** Inactivity timeout to track mobile data activity.
8694 *
8695 * If set to a positive integer, it indicates the inactivity timeout value in seconds to
8696 * infer the data activity of mobile network. After a period of no activity on mobile
8697 * networks with length specified by the timeout, an {@code ACTION_DATA_ACTIVITY_CHANGE}
8698 * intent is fired to indicate a transition of network status from "active" to "idle". Any
8699 * subsequent activity on mobile networks triggers the firing of {@code
8700 * ACTION_DATA_ACTIVITY_CHANGE} intent indicating transition from "idle" to "active".
8701 *
8702 * Network activity refers to transmitting or receiving data on the network interfaces.
8703 *
8704 * Tracking is disabled if set to zero or negative value.
8705 *
8706 * @hide
8707 */
8708 public static final String DATA_ACTIVITY_TIMEOUT_MOBILE = "data_activity_timeout_mobile";
8709
8710 /** Timeout to tracking Wifi data activity. Same as {@code DATA_ACTIVITY_TIMEOUT_MOBILE}
8711 * but for Wifi network.
8712 * @hide
8713 */
8714 public static final String DATA_ACTIVITY_TIMEOUT_WIFI = "data_activity_timeout_wifi";
8715
8716 /**
8717 * Whether or not data roaming is enabled. (0 = false, 1 = true)
8718 */
8719 public static final String DATA_ROAMING = "data_roaming";
8720
8721 /**
Wink Saville75c1e692013-03-20 17:06:50 -07008722 * The value passed to a Mobile DataConnection via bringUp which defines the
8723 * number of retries to preform when setting up the initial connection. The default
8724 * value defined in DataConnectionTrackerBase#DEFAULT_MDC_INITIAL_RETRY is currently 1.
8725 * @hide
8726 */
8727 public static final String MDC_INITIAL_MAX_RETRY = "mdc_initial_max_retry";
8728
8729 /**
Todd Kennedyf39ca8f2015-08-07 14:15:07 -07008730 * Whether any package can be on external storage. When this is true, any
8731 * package, regardless of manifest values, is a candidate for installing
8732 * or moving onto external storage. (0 = false, 1 = true)
8733 * @hide
8734 */
8735 public static final String FORCE_ALLOW_ON_EXTERNAL = "force_allow_on_external";
8736
Jorim Jaggi8ccdf3a2015-10-22 12:50:31 +02008737 /**
Jeff Davidson91c3d072017-04-12 12:17:11 -07008738 * The default SM-DP+ configured for this device.
8739 *
8740 * <p>An SM-DP+ is used by an LPA (see {@link android.service.euicc.EuiccService}) to
8741 * download profiles. If this value is set, the LPA will query this server for any profiles
8742 * available to this device. If any are available, they may be downloaded during device
8743 * provisioning or in settings without needing the user to enter an activation code.
8744 *
8745 * @see android.service.euicc.EuiccService
8746 * @hide
Jeff Davidson91c3d072017-04-12 12:17:11 -07008747 */
Holly Jiuyu Sun4f73b9c2017-12-12 20:17:09 -08008748 @SystemApi
Jeff Davidson91c3d072017-04-12 12:17:11 -07008749 public static final String DEFAULT_SM_DP_PLUS = "default_sm_dp_plus";
8750
8751 /**
Jeff Davidsondff39332017-05-19 17:07:48 -07008752 * Whether any profile has ever been downloaded onto a eUICC on the device.
8753 *
8754 * <p>Used to hide eUICC UI from users who have never made use of it and would only be
8755 * confused by seeing references to it in settings.
8756 * (0 = false, 1 = true)
8757 * @hide
8758 */
Holly Jiuyu Sunb85013a2018-02-21 20:34:22 -08008759 @SystemApi
Jeff Davidsondff39332017-05-19 17:07:48 -07008760 public static final String EUICC_PROVISIONED = "euicc_provisioned";
8761
8762 /**
Qingxi Liead12712018-04-11 15:14:56 -07008763 * List of ISO country codes in which eUICC UI is shown. Country codes should be separated
8764 * by comma.
8765 *
8766 * <p>Used to hide eUICC UI from users who are currently in countries no carriers support
8767 * eUICC.
8768 * @hide
8769 */
8770 //TODO(b/77914569) Changes this to System Api.
8771 public static final String EUICC_SUPPORTED_COUNTRIES = "euicc_supported_countries";
8772
8773 /**
Jorim Jaggi8ccdf3a2015-10-22 12:50:31 +02008774 * Whether any activity can be resized. When this is true, any
8775 * activity, regardless of manifest values, can be resized for multi-window.
8776 * (0 = false, 1 = true)
8777 * @hide
8778 */
8779 public static final String DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES
8780 = "force_resizable_activities";
8781
Jorim Jaggi6f2efd32015-12-23 12:04:39 +01008782 /**
8783 * Whether to enable experimental freeform support for windows.
8784 * @hide
8785 */
8786 public static final String DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT
8787 = "enable_freeform_support";
8788
Todd Kennedyf39ca8f2015-08-07 14:15:07 -07008789 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008790 * Whether user has enabled development settings.
8791 */
8792 public static final String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled";
8793
8794 /**
Amith Yamasanicb15d662015-11-10 11:11:15 -08008795 * Whether the device has been provisioned (0 = false, 1 = true).
8796 * <p>On a multiuser device with a separate system user, the screen may be locked
8797 * as soon as this is set to true and further activities cannot be launched on the
8798 * system user unless they are marked to show over keyguard.
Christopher Tate06efb532012-08-24 15:29:27 -07008799 */
8800 public static final String DEVICE_PROVISIONED = "device_provisioned";
8801
8802 /**
Robert Greenwaltbeb482c2016-03-28 15:40:56 -07008803 * Whether mobile data should be allowed while the device is being provisioned.
8804 * This allows the provisioning process to turn off mobile data before the user
8805 * has an opportunity to set things up, preventing other processes from burning
8806 * precious bytes before wifi is setup.
8807 * (0 = false, 1 = true)
8808 * @hide
8809 */
8810 public static final String DEVICE_PROVISIONING_MOBILE_DATA_ENABLED =
8811 "device_provisioning_mobile_data";
8812
8813 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008814 * The saved value for WindowManagerService.setForcedDisplaySize().
8815 * Two integers separated by a comma. If unset, then use the real display size.
8816 * @hide
8817 */
8818 public static final String DISPLAY_SIZE_FORCED = "display_size_forced";
8819
8820 /**
Jeff Brownd46747a2015-04-15 19:02:36 -07008821 * The saved value for WindowManagerService.setForcedDisplayScalingMode().
8822 * 0 or unset if scaling is automatic, 1 if scaling is disabled.
8823 * @hide
8824 */
8825 public static final String DISPLAY_SCALING_FORCE = "display_scaling_force";
8826
8827 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008828 * The maximum size, in bytes, of a download that the download manager will transfer over
8829 * a non-wifi connection.
8830 * @hide
8831 */
8832 public static final String DOWNLOAD_MAX_BYTES_OVER_MOBILE =
8833 "download_manager_max_bytes_over_mobile";
8834
8835 /**
8836 * The recommended maximum size, in bytes, of a download that the download manager should
8837 * transfer over a non-wifi connection. Over this size, the use will be warned, but will
8838 * have the option to start the download over the mobile connection anyway.
8839 * @hide
8840 */
8841 public static final String DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE =
8842 "download_manager_recommended_max_bytes_over_mobile";
8843
8844 /**
Christopher Tateaa036a22014-05-19 16:33:27 -07008845 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
Christopher Tate06efb532012-08-24 15:29:27 -07008846 */
Christopher Tateaa036a22014-05-19 16:33:27 -07008847 @Deprecated
8848 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
Christopher Tate06efb532012-08-24 15:29:27 -07008849
8850 /**
Jinsuk Kimb3d91772014-07-10 12:48:54 +09008851 * Whether HDMI control shall be enabled. If disabled, no CEC/MHL command will be
8852 * sent or processed. (0 = false, 1 = true)
8853 * @hide
8854 */
8855 public static final String HDMI_CONTROL_ENABLED = "hdmi_control_enabled";
8856
8857 /**
Donghyun Choc1fa9af2016-12-27 18:31:09 +09008858 * Whether HDMI System Audio Control feature is enabled. If enabled, TV will try to turn on
8859 * system audio mode if there's a connected CEC-enabled AV Receiver. Then audio stream will
8860 * be played on AVR instead of TV spaeker. If disabled, the system audio mode will never be
8861 * activated.
Jinsuk Kimb3d91772014-07-10 12:48:54 +09008862 * @hide
8863 */
Donghyun Choc1fa9af2016-12-27 18:31:09 +09008864 public static final String HDMI_SYSTEM_AUDIO_CONTROL_ENABLED =
8865 "hdmi_system_audio_control_enabled";
Jinsuk Kimb3d91772014-07-10 12:48:54 +09008866
Alex Salo8994a1f2017-11-01 14:52:59 -07008867 /**
8868 * Whether TV will automatically turn on upon reception of the CEC command
8869 * &lt;Text View On&gt; or &lt;Image View On&gt;. (0 = false, 1 = true)
8870 *
8871 * @hide
8872 */
8873 public static final String HDMI_CONTROL_AUTO_WAKEUP_ENABLED =
8874 "hdmi_control_auto_wakeup_enabled";
Jinsuk Kimb3d91772014-07-10 12:48:54 +09008875
Alex Salo8994a1f2017-11-01 14:52:59 -07008876 /**
8877 * Whether TV will also turn off other CEC devices when it goes to standby mode.
8878 * (0 = false, 1 = true)
8879 *
8880 * @hide
8881 */
8882 public static final String HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED =
8883 "hdmi_control_auto_device_off_enabled";
Jinsuk Kimb3d91772014-07-10 12:48:54 +09008884
Alex Salo8994a1f2017-11-01 14:52:59 -07008885 /**
8886 * If <b>true</b>, enables out-of-the-box execution for priv apps.
8887 * Default: false
8888 * Values: 0 = false, 1 = true
8889 *
8890 * @hide
8891 */
8892 public static final String PRIV_APP_OOB_ENABLED = "priv_app_oob_enabled";
8893
8894 /**
8895 * The interval in milliseconds at which location requests will be throttled when they are
8896 * coming from the background.
8897 *
8898 * @hide
8899 */
8900 public static final String LOCATION_BACKGROUND_THROTTLE_INTERVAL_MS =
Soonil Nagarkar7decfb62017-01-18 12:18:49 -08008901 "location_background_throttle_interval_ms";
8902
Soonil Nagarkar2f1f7e82017-01-24 12:52:10 -08008903 /**
Lifu Tangc94ef4d2017-03-23 23:48:00 -07008904 * Most frequent location update interval in milliseconds that proximity alert is allowed
8905 * to request.
8906 * @hide
8907 */
8908 public static final String LOCATION_BACKGROUND_THROTTLE_PROXIMITY_ALERT_INTERVAL_MS =
8909 "location_background_throttle_proximity_alert_interval_ms";
8910
8911 /**
Soonil Nagarkar2f1f7e82017-01-24 12:52:10 -08008912 * Packages that are whitelisted for background throttling (throttling will not be applied).
8913 * @hide
8914 */
8915 public static final String LOCATION_BACKGROUND_THROTTLE_PACKAGE_WHITELIST =
8916 "location_background_throttle_package_whitelist";
8917
Wei Wangcdbffa92017-04-17 19:49:29 -07008918 /**
Jinsuk Kimb3d91772014-07-10 12:48:54 +09008919 * Whether TV will switch to MHL port when a mobile device is plugged in.
8920 * (0 = false, 1 = true)
8921 * @hide
8922 */
8923 public static final String MHL_INPUT_SWITCHING_ENABLED = "mhl_input_switching_enabled";
8924
8925 /**
8926 * Whether TV will charge the mobile device connected at MHL port. (0 = false, 1 = true)
8927 * @hide
8928 */
8929 public static final String MHL_POWER_CHARGE_ENABLED = "mhl_power_charge_enabled";
8930
8931 /**
Christopher Tate06efb532012-08-24 15:29:27 -07008932 * Whether mobile data connections are allowed by the user. See
8933 * ConnectivityManager for more info.
8934 * @hide
8935 */
8936 public static final String MOBILE_DATA = "mobile_data";
8937
Erik Klineda4bfa82015-04-30 12:58:40 +09008938 /**
8939 * Whether the mobile data connection should remain active even when higher
8940 * priority networks like WiFi are active, to help make network switching faster.
8941 *
8942 * See ConnectivityService for more info.
8943 *
8944 * (0 = disabled, 1 = enabled)
8945 * @hide
8946 */
8947 public static final String MOBILE_DATA_ALWAYS_ON = "mobile_data_always_on";
8948
Hugo Benichi05686db2016-10-19 11:17:28 +09008949 /**
8950 * Size of the event buffer for IP connectivity metrics.
8951 * @hide
8952 */
8953 public static final String CONNECTIVITY_METRICS_BUFFER_SIZE =
8954 "connectivity_metrics_buffer_size";
8955
Christopher Tate06efb532012-08-24 15:29:27 -07008956 /** {@hide} */
8957 public static final String NETSTATS_ENABLED = "netstats_enabled";
8958 /** {@hide} */
8959 public static final String NETSTATS_POLL_INTERVAL = "netstats_poll_interval";
8960 /** {@hide} */
Jeff Sharkey9911a282018-02-14 22:29:11 -07008961 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07008962 public static final String NETSTATS_TIME_CACHE_MAX_AGE = "netstats_time_cache_max_age";
8963 /** {@hide} */
8964 public static final String NETSTATS_GLOBAL_ALERT_BYTES = "netstats_global_alert_bytes";
8965 /** {@hide} */
8966 public static final String NETSTATS_SAMPLE_ENABLED = "netstats_sample_enabled";
Jeff Sharkeyf4de2942017-08-29 15:32:13 -06008967 /** {@hide} */
8968 public static final String NETSTATS_AUGMENT_ENABLED = "netstats_augment_enabled";
Christopher Tate06efb532012-08-24 15:29:27 -07008969
8970 /** {@hide} */
8971 public static final String NETSTATS_DEV_BUCKET_DURATION = "netstats_dev_bucket_duration";
8972 /** {@hide} */
8973 public static final String NETSTATS_DEV_PERSIST_BYTES = "netstats_dev_persist_bytes";
8974 /** {@hide} */
8975 public static final String NETSTATS_DEV_ROTATE_AGE = "netstats_dev_rotate_age";
8976 /** {@hide} */
8977 public static final String NETSTATS_DEV_DELETE_AGE = "netstats_dev_delete_age";
8978
8979 /** {@hide} */
8980 public static final String NETSTATS_UID_BUCKET_DURATION = "netstats_uid_bucket_duration";
8981 /** {@hide} */
8982 public static final String NETSTATS_UID_PERSIST_BYTES = "netstats_uid_persist_bytes";
8983 /** {@hide} */
8984 public static final String NETSTATS_UID_ROTATE_AGE = "netstats_uid_rotate_age";
8985 /** {@hide} */
8986 public static final String NETSTATS_UID_DELETE_AGE = "netstats_uid_delete_age";
8987
8988 /** {@hide} */
8989 public static final String NETSTATS_UID_TAG_BUCKET_DURATION = "netstats_uid_tag_bucket_duration";
8990 /** {@hide} */
8991 public static final String NETSTATS_UID_TAG_PERSIST_BYTES = "netstats_uid_tag_persist_bytes";
8992 /** {@hide} */
8993 public static final String NETSTATS_UID_TAG_ROTATE_AGE = "netstats_uid_tag_rotate_age";
8994 /** {@hide} */
8995 public static final String NETSTATS_UID_TAG_DELETE_AGE = "netstats_uid_tag_delete_age";
8996
Jeff Sharkey36b414b2018-03-30 11:00:03 -06008997 /** {@hide} */
8998 public static final String NETPOLICY_QUOTA_ENABLED = "netpolicy_quota_enabled";
8999 /** {@hide} */
9000 public static final String NETPOLICY_QUOTA_UNLIMITED = "netpolicy_quota_unlimited";
9001 /** {@hide} */
9002 public static final String NETPOLICY_QUOTA_LIMITED = "netpolicy_quota_limited";
9003 /** {@hide} */
9004 public static final String NETPOLICY_QUOTA_FRAC_JOBS = "netpolicy_quota_frac_jobs";
9005 /** {@hide} */
9006 public static final String NETPOLICY_QUOTA_FRAC_MULTIPATH = "netpolicy_quota_frac_multipath";
9007
9008 /** {@hide} */
9009 public static final String NETPOLICY_OVERRIDE_ENABLED = "netpolicy_override_enabled";
9010
Christopher Tate06efb532012-08-24 15:29:27 -07009011 /**
9012 * User preference for which network(s) should be used. Only the
9013 * connectivity service should touch this.
9014 */
9015 public static final String NETWORK_PREFERENCE = "network_preference";
9016
9017 /**
Jeff Davidsondd6fd1e2014-04-14 15:14:30 -07009018 * Which package name to use for network scoring. If null, or if the package is not a valid
9019 * scorer app, external network scores will neither be requested nor accepted.
9020 * @hide
9021 */
9022 public static final String NETWORK_SCORER_APP = "network_scorer_app";
9023
Christine Franks8ad6f6d2017-12-13 18:40:43 -08009024 /**
9025 * Whether night display forced auto mode is available.
9026 * 0 = unavailable, 1 = available.
9027 * @hide
9028 */
9029 public static final String NIGHT_DISPLAY_FORCED_AUTO_MODE_AVAILABLE =
9030 "night_display_forced_auto_mode_available";
9031
Jeff Davidsondd6fd1e2014-04-14 15:14:30 -07009032 /**
Christopher Tate06efb532012-08-24 15:29:27 -07009033 * If the NITZ_UPDATE_DIFF time is exceeded then an automatic adjustment
9034 * to SystemClock will be allowed even if NITZ_UPDATE_SPACING has not been
9035 * exceeded.
9036 * @hide
9037 */
9038 public static final String NITZ_UPDATE_DIFF = "nitz_update_diff";
9039
9040 /**
9041 * The length of time in milli-seconds that automatic small adjustments to
9042 * SystemClock are ignored if NITZ_UPDATE_DIFF is not exceeded.
9043 * @hide
9044 */
9045 public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing";
9046
9047 /** Preferred NTP server. {@hide} */
9048 public static final String NTP_SERVER = "ntp_server";
9049 /** Timeout in milliseconds to wait for NTP server. {@hide} */
9050 public static final String NTP_TIMEOUT = "ntp_timeout";
9051
Jeff Sharkeye8a4b662015-06-27 15:43:45 -07009052 /** {@hide} */
9053 public static final String STORAGE_BENCHMARK_INTERVAL = "storage_benchmark_interval";
9054
Christopher Tate06efb532012-08-24 15:29:27 -07009055 /**
Pierre Imai8e48e672016-04-21 13:30:43 +09009056 * Sample validity in seconds to configure for the system DNS resolver.
9057 * {@hide}
9058 */
9059 public static final String DNS_RESOLVER_SAMPLE_VALIDITY_SECONDS =
9060 "dns_resolver_sample_validity_seconds";
9061
9062 /**
9063 * Success threshold in percent for use with the system DNS resolver.
9064 * {@hide}
9065 */
9066 public static final String DNS_RESOLVER_SUCCESS_THRESHOLD_PERCENT =
9067 "dns_resolver_success_threshold_percent";
9068
9069 /**
9070 * Minimum number of samples needed for statistics to be considered meaningful in the
9071 * system DNS resolver.
9072 * {@hide}
9073 */
9074 public static final String DNS_RESOLVER_MIN_SAMPLES = "dns_resolver_min_samples";
9075
9076 /**
9077 * Maximum number taken into account for statistics purposes in the system DNS resolver.
9078 * {@hide}
9079 */
9080 public static final String DNS_RESOLVER_MAX_SAMPLES = "dns_resolver_max_samples";
9081
9082 /**
Tao Baofdf7c5d2016-02-15 20:59:15 -08009083 * Whether to disable the automatic scheduling of system updates.
9084 * 1 = system updates won't be automatically scheduled (will always
9085 * present notification instead).
9086 * 0 = system updates will be automatically scheduled. (default)
9087 * @hide
9088 */
9089 @SystemApi
9090 public static final String OTA_DISABLE_AUTOMATIC_UPDATE = "ota_disable_automatic_update";
9091
9092 /**
rich cannings4d8fc792012-09-07 14:43:43 -07009093 * Whether the package manager should send package verification broadcasts for verifiers to
9094 * review apps prior to installation.
9095 * 1 = request apps to be verified prior to installation, if a verifier exists.
9096 * 0 = do not verify apps before installation
rich cannings4e5753f2012-09-19 16:03:56 -07009097 * @hide
rich cannings4d8fc792012-09-07 14:43:43 -07009098 */
9099 public static final String PACKAGE_VERIFIER_ENABLE = "package_verifier_enable";
9100
9101 /** Timeout for package verification.
rich cannings4e5753f2012-09-19 16:03:56 -07009102 * @hide */
rich cannings4d8fc792012-09-07 14:43:43 -07009103 public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout";
9104
9105 /** Default response code for package verification.
rich cannings4e5753f2012-09-19 16:03:56 -07009106 * @hide */
rich cannings4d8fc792012-09-07 14:43:43 -07009107 public static final String PACKAGE_VERIFIER_DEFAULT_RESPONSE = "verifier_default_response";
9108
rich cannings4e5753f2012-09-19 16:03:56 -07009109 /**
9110 * Show package verification setting in the Settings app.
rich canningse6686b32012-09-16 14:02:20 -07009111 * 1 = show (default)
9112 * 0 = hide
rich cannings4e5753f2012-09-19 16:03:56 -07009113 * @hide
rich canningse6686b32012-09-16 14:02:20 -07009114 */
9115 public static final String PACKAGE_VERIFIER_SETTING_VISIBLE = "verifier_setting_visible";
9116
rich cannings4d8fc792012-09-07 14:43:43 -07009117 /**
Fabrice Di Meglio1c1b4712014-11-19 17:12:32 -08009118 * Run package verification on apps installed through ADB/ADT/USB
rich cannings4e5753f2012-09-19 16:03:56 -07009119 * 1 = perform package verification on ADB installs (default)
9120 * 0 = bypass package verification on ADB installs
9121 * @hide
9122 */
9123 public static final String PACKAGE_VERIFIER_INCLUDE_ADB = "verifier_verify_adb_installs";
9124
9125 /**
Christopher Tate7265abe2014-11-21 13:54:45 -08009126 * Time since last fstrim (milliseconds) after which we force one to happen
9127 * during device startup. If unset, the default is 3 days.
9128 * @hide
9129 */
9130 public static final String FSTRIM_MANDATORY_INTERVAL = "fstrim_mandatory_interval";
9131
9132 /**
Christopher Tate06efb532012-08-24 15:29:27 -07009133 * The interval in milliseconds at which to check packet counts on the
9134 * mobile data interface when screen is on, to detect possible data
9135 * connection problems.
9136 * @hide
9137 */
9138 public static final String PDP_WATCHDOG_POLL_INTERVAL_MS =
9139 "pdp_watchdog_poll_interval_ms";
9140
9141 /**
9142 * The interval in milliseconds at which to check packet counts on the
9143 * mobile data interface when screen is off, to detect possible data
9144 * connection problems.
9145 * @hide
9146 */
9147 public static final String PDP_WATCHDOG_LONG_POLL_INTERVAL_MS =
9148 "pdp_watchdog_long_poll_interval_ms";
9149
9150 /**
9151 * The interval in milliseconds at which to check packet counts on the
9152 * mobile data interface after {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT}
9153 * outgoing packets has been reached without incoming packets.
9154 * @hide
9155 */
9156 public static final String PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS =
9157 "pdp_watchdog_error_poll_interval_ms";
9158
9159 /**
9160 * The number of outgoing packets sent without seeing an incoming packet
9161 * that triggers a countdown (of {@link #PDP_WATCHDOG_ERROR_POLL_COUNT}
9162 * device is logged to the event log
9163 * @hide
9164 */
9165 public static final String PDP_WATCHDOG_TRIGGER_PACKET_COUNT =
9166 "pdp_watchdog_trigger_packet_count";
9167
9168 /**
9169 * The number of polls to perform (at {@link #PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS})
9170 * after hitting {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} before
9171 * attempting data connection recovery.
9172 * @hide
9173 */
9174 public static final String PDP_WATCHDOG_ERROR_POLL_COUNT =
9175 "pdp_watchdog_error_poll_count";
9176
9177 /**
9178 * The number of failed PDP reset attempts before moving to something more
9179 * drastic: re-registering to the network.
9180 * @hide
9181 */
9182 public static final String PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT =
9183 "pdp_watchdog_max_pdp_reset_fail_count";
9184
9185 /**
Christopher Tate06efb532012-08-24 15:29:27 -07009186 * URL to open browser on to allow user to manage a prepay account
9187 * @hide
9188 */
9189 public static final String SETUP_PREPAID_DATA_SERVICE_URL =
9190 "setup_prepaid_data_service_url";
9191
9192 /**
9193 * URL to attempt a GET on to see if this is a prepay device
9194 * @hide
9195 */
9196 public static final String SETUP_PREPAID_DETECTION_TARGET_URL =
9197 "setup_prepaid_detection_target_url";
9198
9199 /**
9200 * Host to check for a redirect to after an attempt to GET
9201 * SETUP_PREPAID_DETECTION_TARGET_URL. (If we redirected there,
9202 * this is a prepaid device with zero balance.)
9203 * @hide
9204 */
9205 public static final String SETUP_PREPAID_DETECTION_REDIR_HOST =
9206 "setup_prepaid_detection_redir_host";
9207
9208 /**
Jake Hamby76a61422012-09-06 17:40:21 -07009209 * The interval in milliseconds at which to check the number of SMS sent out without asking
9210 * for use permit, to limit the un-authorized SMS usage.
9211 *
9212 * @hide
9213 */
9214 public static final String SMS_OUTGOING_CHECK_INTERVAL_MS =
9215 "sms_outgoing_check_interval_ms";
9216
9217 /**
9218 * The number of outgoing SMS sent without asking for user permit (of {@link
9219 * #SMS_OUTGOING_CHECK_INTERVAL_MS}
9220 *
9221 * @hide
9222 */
9223 public static final String SMS_OUTGOING_CHECK_MAX_COUNT =
9224 "sms_outgoing_check_max_count";
9225
9226 /**
9227 * Used to disable SMS short code confirmation - defaults to true.
Robert Greenwalt026efcc2012-09-24 10:03:21 -07009228 * True indcates we will do the check, etc. Set to false to disable.
Jake Hamby76a61422012-09-06 17:40:21 -07009229 * @see com.android.internal.telephony.SmsUsageMonitor
9230 * @hide
9231 */
9232 public static final String SMS_SHORT_CODE_CONFIRMATION = "sms_short_code_confirmation";
9233
Robert Greenwalt026efcc2012-09-24 10:03:21 -07009234 /**
9235 * Used to select which country we use to determine premium sms codes.
9236 * One of com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_SIM,
9237 * com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_NETWORK,
9238 * or com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_BOTH.
9239 * @hide
9240 */
9241 public static final String SMS_SHORT_CODE_RULE = "sms_short_code_rule";
9242
Jake Hamby76a61422012-09-06 17:40:21 -07009243 /**
JP Abgrall32d1ac4d2014-02-21 12:05:20 -08009244 * Used to select TCP's default initial receiver window size in segments - defaults to a build config value
9245 * @hide
9246 */
9247 public static final String TCP_DEFAULT_INIT_RWND = "tcp_default_init_rwnd";
9248
9249 /**
Christopher Tate06efb532012-08-24 15:29:27 -07009250 * Used to disable Tethering on a device - defaults to true
9251 * @hide
9252 */
9253 public static final String TETHER_SUPPORTED = "tether_supported";
9254
9255 /**
9256 * Used to require DUN APN on the device or not - defaults to a build config value
9257 * which defaults to false
9258 * @hide
9259 */
9260 public static final String TETHER_DUN_REQUIRED = "tether_dun_required";
9261
9262 /**
9263 * Used to hold a gservices-provisioned apn value for DUN. If set, or the
9264 * corresponding build config values are set it will override the APN DB
9265 * values.
9266 * Consists of a comma seperated list of strings:
9267 * "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type"
9268 * note that empty fields can be ommitted: "name,apn,,,,,,,,,310,260,,DUN"
9269 * @hide
9270 */
9271 public static final String TETHER_DUN_APN = "tether_dun_apn";
9272
Erik Kline92c4db02017-05-31 10:21:32 +09009273 /**
9274 * Used to disable trying to talk to any available tethering offload HAL.
9275 *
9276 * Integer values are interpreted as boolean, and the absence of an explicit setting
9277 * is interpreted as |false|.
9278 * @hide
9279 */
9280 public static final String TETHER_OFFLOAD_DISABLED = "tether_offload_disabled";
9281
goneil6db18a9b2018-01-10 16:23:11 -08009282 /**
9283 * List of certificate (hex string representation of the application's certificate - SHA-1
9284 * or SHA-256) and carrier app package pairs which are whitelisted to prompt the user for
9285 * install when a sim card with matching UICC carrier privilege rules is inserted. The
9286 * certificate is used as a key, so the certificate encoding here must be the same as the
9287 * certificate encoding used on the SIM.
9288 *
9289 * The value is "cert1:package1;cert2:package2;..."
9290 * @hide
9291 */
9292 @SystemApi
9293 public static final String CARRIER_APP_WHITELIST = "carrier_app_whitelist";
Junda Liu0c35fbc2016-01-19 23:20:15 -08009294
goneil15f5a7e2018-02-16 17:33:56 -08009295 /**
goneil986fae22018-03-29 17:30:58 -07009296 * Map of package name to application names. The application names cannot and will not be
9297 * localized. App names may not contain colons or semicolons.
goneil15f5a7e2018-02-16 17:33:56 -08009298 *
9299 * The value is "packageName1:appName1;packageName2:appName2;..."
9300 * @hide
9301 */
9302 @SystemApi
9303 public static final String CARRIER_APP_NAMES = "carrier_app_names";
9304
Junda Liu0c35fbc2016-01-19 23:20:15 -08009305 /**
Christopher Tate06efb532012-08-24 15:29:27 -07009306 * USB Mass Storage Enabled
9307 */
9308 public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled";
9309
Michal Karpinski5db1e432018-01-18 20:10:24 +00009310 private static final Validator USB_MASS_STORAGE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
9311
Christopher Tate06efb532012-08-24 15:29:27 -07009312 /**
9313 * If this setting is set (to anything), then all references
9314 * to Gmail on the device must change to Google Mail.
9315 */
9316 public static final String USE_GOOGLE_MAIL = "use_google_mail";
9317
Hui Shu22671772014-10-01 21:41:07 +00009318 /**
9319 * Webview Data reduction proxy key.
9320 * @hide
9321 */
9322 public static final String WEBVIEW_DATA_REDUCTION_PROXY_KEY =
9323 "webview_data_reduction_proxy_key";
9324
Lorenzo Colitti84e6f1232016-08-29 14:03:11 +09009325 /**
9326 * Whether or not the WebView fallback mechanism should be enabled.
9327 * 0=disabled, 1=enabled.
9328 * @hide
9329 */
9330 public static final String WEBVIEW_FALLBACK_LOGIC_ENABLED =
9331 "webview_fallback_logic_enabled";
Gustav Senntonc83e3fa2016-02-18 12:19:13 +00009332
Lorenzo Colitti84e6f1232016-08-29 14:03:11 +09009333 /**
9334 * Name of the package used as WebView provider (if unset the provider is instead determined
9335 * by the system).
9336 * @hide
9337 */
9338 public static final String WEBVIEW_PROVIDER = "webview_provider";
Gustav Sennton14c033c2016-02-11 12:51:27 +00009339
Lorenzo Colitti84e6f1232016-08-29 14:03:11 +09009340 /**
9341 * Developer setting to enable WebView multiprocess rendering.
9342 * @hide
9343 */
9344 @SystemApi
9345 public static final String WEBVIEW_MULTIPROCESS = "webview_multiprocess";
9346
9347 /**
9348 * The maximum number of notifications shown in 24 hours when switching networks.
9349 * @hide
9350 */
9351 public static final String NETWORK_SWITCH_NOTIFICATION_DAILY_LIMIT =
9352 "network_switch_notification_daily_limit";
9353
9354 /**
9355 * The minimum time in milliseconds between notifications when switching networks.
9356 * @hide
9357 */
9358 public static final String NETWORK_SWITCH_NOTIFICATION_RATE_LIMIT_MILLIS =
9359 "network_switch_notification_rate_limit_millis";
Tobias Sargeantda857102016-02-11 14:52:28 +00009360
Christopher Tate06efb532012-08-24 15:29:27 -07009361 /**
Hugo Benichic8e9e122016-09-14 23:23:08 +00009362 * Whether to automatically switch away from wifi networks that lose Internet access.
Lorenzo Colitti165c51c2016-09-19 01:00:19 +09009363 * Only meaningful if config_networkAvoidBadWifi is set to 0, otherwise the system always
9364 * avoids such networks. Valid values are:
9365 *
9366 * 0: Don't avoid bad wifi, don't prompt the user. Get stuck on bad wifi like it's 2013.
9367 * null: Ask the user whether to switch away from bad wifi.
9368 * 1: Avoid bad wifi.
9369 *
Hugo Benichic8e9e122016-09-14 23:23:08 +00009370 * @hide
9371 */
9372 public static final String NETWORK_AVOID_BAD_WIFI = "network_avoid_bad_wifi";
9373
9374 /**
Lorenzo Colitti2de49252017-01-24 18:08:41 +09009375 * User setting for ConnectivityManager.getMeteredMultipathPreference(). This value may be
9376 * overridden by the system based on device or application state. If null, the value
9377 * specified by config_networkMeteredMultipathPreference is used.
9378 *
9379 * @hide
9380 */
9381 public static final String NETWORK_METERED_MULTIPATH_PREFERENCE =
9382 "network_metered_multipath_preference";
9383
Ricky Wai1a6e6672017-10-27 14:46:01 +01009384 /**
Remi NGUYEN VANe0ec9922018-03-29 16:17:19 +09009385 * Default daily multipath budget used by ConnectivityManager.getMultipathPreference()
9386 * on metered networks. This default quota is only used if quota could not be determined
9387 * from data plan or data limit/warning set by the user.
9388 * @hide
9389 */
9390 public static final String NETWORK_DEFAULT_DAILY_MULTIPATH_QUOTA_BYTES =
9391 "network_default_daily_multipath_quota_bytes";
9392
9393 /**
Ricky Wai1a6e6672017-10-27 14:46:01 +01009394 * Network watchlist last report time.
9395 * @hide
9396 */
9397 public static final String NETWORK_WATCHLIST_LAST_REPORT_TIME =
9398 "network_watchlist_last_report_time";
9399
Lorenzo Colitti2de49252017-01-24 18:08:41 +09009400 /**
William Meecd62f3a2017-01-24 18:01:38 -08009401 * The thresholds of the wifi throughput badging (SD, HD etc.) as a comma-delimited list of
9402 * colon-delimited key-value pairs. The key is the badging enum value defined in
9403 * android.net.ScoredNetwork and the value is the minimum sustained network throughput in
9404 * kbps required for the badge. For example: "10:3000,20:5000,30:25000"
9405 *
9406 * @hide
9407 */
9408 @SystemApi
9409 public static final String WIFI_BADGING_THRESHOLDS = "wifi_badging_thresholds";
9410
9411 /**
Jeff Brown89d55462012-09-19 11:33:42 -07009412 * Whether Wifi display is enabled/disabled
9413 * 0=disabled. 1=enabled.
9414 * @hide
9415 */
9416 public static final String WIFI_DISPLAY_ON = "wifi_display_on";
9417
9418 /**
Chong Zhang1f3ecaa2013-05-03 15:55:36 -07009419 * Whether Wifi display certification mode is enabled/disabled
9420 * 0=disabled. 1=enabled.
9421 * @hide
9422 */
9423 public static final String WIFI_DISPLAY_CERTIFICATION_ON =
9424 "wifi_display_certification_on";
9425
9426 /**
Chong Zhange38af812013-08-29 17:25:17 -07009427 * WPS Configuration method used by Wifi display, this setting only
9428 * takes effect when WIFI_DISPLAY_CERTIFICATION_ON is 1 (enabled).
9429 *
9430 * Possible values are:
9431 *
9432 * WpsInfo.INVALID: use default WPS method chosen by framework
9433 * WpsInfo.PBC : use Push button
9434 * WpsInfo.KEYPAD : use Keypad
9435 * WpsInfo.DISPLAY: use Display
9436 * @hide
9437 */
9438 public static final String WIFI_DISPLAY_WPS_CONFIG =
9439 "wifi_display_wps_config";
9440
9441 /**
Christopher Tate06efb532012-08-24 15:29:27 -07009442 * Whether to notify the user of open networks.
9443 * <p>
9444 * If not connected and the scan results have an open network, we will
9445 * put this notification up. If we attempt to connect to a network or
9446 * the open network(s) disappear, we remove the notification. When we
9447 * show the notification, we will not show it again for
9448 * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time.
Amin Shaikh3087e322017-03-24 17:34:24 -07009449 *
9450 * @deprecated This feature is no longer controlled by this setting in
9451 * {@link android.os.Build.VERSION_CODES#O}.
Christopher Tate06efb532012-08-24 15:29:27 -07009452 */
Amin Shaikh3087e322017-03-24 17:34:24 -07009453 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07009454 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
9455 "wifi_networks_available_notification_on";
Amin Shaikh3087e322017-03-24 17:34:24 -07009456
Michal Karpinski5db1e432018-01-18 20:10:24 +00009457 private static final Validator WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR =
9458 BOOLEAN_VALIDATOR;
9459
Christopher Tate06efb532012-08-24 15:29:27 -07009460 /**
Glen Kuhne22ae9d52017-11-28 14:06:25 -08009461 * Whether to notify the user of carrier networks.
9462 * <p>
9463 * If not connected and the scan results have a carrier network, we will
9464 * put this notification up. If we attempt to connect to a network or
9465 * the carrier network(s) disappear, we remove the notification. When we
9466 * show the notification, we will not show it again for
9467 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time.
9468 * @hide
9469 */
9470 public static final String WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON =
9471 "wifi_carrier_networks_available_notification_on";
9472
9473 private static final Validator WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR =
9474 BOOLEAN_VALIDATOR;
9475
9476 /**
Christopher Tate06efb532012-08-24 15:29:27 -07009477 * {@hide}
9478 */
9479 public static final String WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON =
9480 "wimax_networks_available_notification_on";
9481
9482 /**
9483 * Delay (in seconds) before repeating the Wi-Fi networks available notification.
9484 * Connecting to a network will reset the timer.
9485 */
9486 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
9487 "wifi_networks_available_repeat_delay";
9488
Michal Karpinski964943a2018-01-19 16:28:26 +00009489 private static final Validator WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_VALIDATOR =
9490 NON_NEGATIVE_INTEGER_VALIDATOR;
9491
Christopher Tate06efb532012-08-24 15:29:27 -07009492 /**
Robert Greenwalt3ea0c992013-10-03 21:13:49 +00009493 * 802.11 country code in ISO 3166 format
9494 * @hide
9495 */
9496 public static final String WIFI_COUNTRY_CODE = "wifi_country_code";
9497
9498 /**
Christopher Tate06efb532012-08-24 15:29:27 -07009499 * The interval in milliseconds to issue wake up scans when wifi needs
9500 * to connect. This is necessary to connect to an access point when
9501 * device is on the move and the screen is off.
9502 * @hide
9503 */
9504 public static final String WIFI_FRAMEWORK_SCAN_INTERVAL_MS =
9505 "wifi_framework_scan_interval_ms";
9506
9507 /**
9508 * The interval in milliseconds after which Wi-Fi is considered idle.
9509 * When idle, it is possible for the device to be switched from Wi-Fi to
9510 * the mobile data network.
9511 * @hide
9512 */
9513 public static final String WIFI_IDLE_MS = "wifi_idle_ms";
9514
9515 /**
9516 * When the number of open networks exceeds this number, the
9517 * least-recently-used excess networks will be removed.
9518 */
9519 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept";
9520
Michal Karpinski964943a2018-01-19 16:28:26 +00009521 private static final Validator WIFI_NUM_OPEN_NETWORKS_KEPT_VALIDATOR =
9522 NON_NEGATIVE_INTEGER_VALIDATOR;
9523
Christopher Tate06efb532012-08-24 15:29:27 -07009524 /**
9525 * Whether the Wi-Fi should be on. Only the Wi-Fi service should touch this.
9526 */
9527 public static final String WIFI_ON = "wifi_on";
9528
9529 /**
Irfan Sheriff11aefad2013-03-06 07:57:41 -08009530 * Setting to allow scans to be enabled even wifi is turned off for connectivity.
9531 * @hide
9532 */
9533 public static final String WIFI_SCAN_ALWAYS_AVAILABLE =
9534 "wifi_scan_always_enabled";
9535
Stephen Chen8ca96c12016-11-16 15:46:51 -08009536 /**
Mehdi Alizadehdcc0da22017-11-10 15:37:13 -08009537 * Whether soft AP will shut down after a timeout period when no devices are connected.
Mehdi Alizadeh57ae55c2018-01-08 16:41:19 -08009538 *
9539 * Type: int (0 for false, 1 for true)
Mehdi Alizadehdcc0da22017-11-10 15:37:13 -08009540 * @hide
9541 */
9542 public static final String SOFT_AP_TIMEOUT_ENABLED = "soft_ap_timeout_enabled";
9543
Michal Karpinski5db1e432018-01-18 20:10:24 +00009544 private static final Validator SOFT_AP_TIMEOUT_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
9545
Mehdi Alizadehdcc0da22017-11-10 15:37:13 -08009546 /**
Stephen Chen8ca96c12016-11-16 15:46:51 -08009547 * Value to specify if Wi-Fi Wakeup feature is enabled.
Stephen Chenf1b75642016-12-06 16:08:52 -08009548 *
9549 * Type: int (0 for false, 1 for true)
Stephen Chen8ca96c12016-11-16 15:46:51 -08009550 * @hide
9551 */
9552 @SystemApi
9553 public static final String WIFI_WAKEUP_ENABLED = "wifi_wakeup_enabled";
9554
Michal Karpinski5db1e432018-01-18 20:10:24 +00009555 private static final Validator WIFI_WAKEUP_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
9556
Stephen Chen6a0c8792016-11-16 15:46:51 -08009557 /**
Sundeep Ghumane869d832017-01-25 16:23:43 -08009558 * Value to specify whether network quality scores and badging should be shown in the UI.
9559 *
9560 * Type: int (0 for false, 1 for true)
9561 * @hide
9562 */
9563 public static final String NETWORK_SCORING_UI_ENABLED = "network_scoring_ui_enabled";
9564
9565 /**
Sundeep Ghuman9bb85d32017-08-28 17:04:16 -07009566 * Value to specify how long in milliseconds to retain seen score cache curves to be used
9567 * when generating SSID only bases score curves.
9568 *
9569 * Type: long
9570 * @hide
9571 */
9572 public static final String SPEED_LABEL_CACHE_EVICTION_AGE_MILLIS =
9573 "speed_label_cache_eviction_age_millis";
9574
9575 /**
Stephen Chen6a0c8792016-11-16 15:46:51 -08009576 * Value to specify if network recommendations from
9577 * {@link com.android.server.NetworkScoreService} are enabled.
Stephen Chenf1b75642016-12-06 16:08:52 -08009578 *
Jeremy Joslin9925c6a2017-03-06 10:39:35 -08009579 * Type: int
9580 * Valid values:
9581 * -1 = Forced off
9582 * 0 = Disabled
9583 * 1 = Enabled
9584 *
9585 * Most readers of this setting should simply check if value == 1 to determined the
9586 * enabled state.
Stephen Chen6a0c8792016-11-16 15:46:51 -08009587 * @hide
9588 */
Stephen Chen6a0c8792016-11-16 15:46:51 -08009589 public static final String NETWORK_RECOMMENDATIONS_ENABLED =
9590 "network_recommendations_enabled";
9591
Michal Karpinski5db1e432018-01-18 20:10:24 +00009592 private static final Validator NETWORK_RECOMMENDATIONS_ENABLED_VALIDATOR =
9593 new SettingsValidators.DiscreteValueValidator(new String[] {"-1", "0", "1"});
9594
Jeremy Joslincb594f32017-01-03 17:31:23 -08009595 /**
Jeremy Joslinc9eb3c42017-02-08 10:45:30 -08009596 * Which package name to use for network recommendations. If null, network recommendations
9597 * will neither be requested nor accepted.
9598 *
9599 * Use {@link NetworkScoreManager#getActiveScorerPackage()} to read this value and
9600 * {@link NetworkScoreManager#setActiveScorer(String)} to write it.
9601 *
9602 * Type: string - package name
9603 * @hide
9604 */
9605 public static final String NETWORK_RECOMMENDATIONS_PACKAGE =
9606 "network_recommendations_package";
9607
9608 /**
Amin Shaikhbc9a8e62017-02-02 15:39:12 -08009609 * The package name of the application that connect and secures high quality open wifi
9610 * networks automatically.
9611 *
9612 * Type: string package name or null if the feature is either not provided or disabled.
9613 * @hide
9614 */
Eric Enslen1e423b92017-12-18 11:30:21 -08009615 @TestApi
Amin Shaikhbc9a8e62017-02-02 15:39:12 -08009616 public static final String USE_OPEN_WIFI_PACKAGE = "use_open_wifi_package";
9617
Michal Karpinski5db1e432018-01-18 20:10:24 +00009618 private static final Validator USE_OPEN_WIFI_PACKAGE_VALIDATOR = new Validator() {
9619 @Override
9620 public boolean validate(String value) {
9621 return (value == null) || PACKAGE_NAME_VALIDATOR.validate(value);
9622 }
9623 };
9624
Amin Shaikhbc9a8e62017-02-02 15:39:12 -08009625 /**
Jeremy Joslincb594f32017-01-03 17:31:23 -08009626 * The number of milliseconds the {@link com.android.server.NetworkScoreService}
9627 * will give a recommendation request to complete before returning a default response.
9628 *
9629 * Type: long
9630 * @hide
Jeremy Joslinb1a01392017-04-14 13:35:48 -07009631 * @deprecated to be removed
Jeremy Joslincb594f32017-01-03 17:31:23 -08009632 */
9633 public static final String NETWORK_RECOMMENDATION_REQUEST_TIMEOUT_MS =
9634 "network_recommendation_request_timeout_ms";
9635
Amin Shaikhd3c81932017-02-06 16:22:42 -08009636 /**
9637 * The expiration time in milliseconds for the {@link android.net.WifiKey} request cache in
9638 * {@link com.android.server.wifi.RecommendedNetworkEvaluator}.
9639 *
9640 * Type: long
9641 * @hide
9642 */
9643 public static final String RECOMMENDED_NETWORK_EVALUATOR_CACHE_EXPIRY_MS =
9644 "recommended_network_evaluator_cache_expiry_ms";
9645
Jeremy Klein45a9b5d2018-01-10 18:01:46 -08009646 /**
Wei Wangd91f1932015-03-19 15:09:56 -07009647 * Settings to allow BLE scans to be enabled even when Bluetooth is turned off for
9648 * connectivity.
9649 * @hide
9650 */
Jeremy Klein45a9b5d2018-01-10 18:01:46 -08009651 public static final String BLE_SCAN_ALWAYS_AVAILABLE = "ble_scan_always_enabled";
9652
9653 /**
9654 * The length in milliseconds of a BLE scan window in a low-power scan mode.
9655 * @hide
9656 */
9657 public static final String BLE_SCAN_LOW_POWER_WINDOW_MS = "ble_scan_low_power_window_ms";
9658
9659 /**
9660 * The length in milliseconds of a BLE scan window in a balanced scan mode.
9661 * @hide
9662 */
9663 public static final String BLE_SCAN_BALANCED_WINDOW_MS = "ble_scan_balanced_window_ms";
9664
9665 /**
9666 * The length in milliseconds of a BLE scan window in a low-latency scan mode.
9667 * @hide
9668 */
9669 public static final String BLE_SCAN_LOW_LATENCY_WINDOW_MS =
9670 "ble_scan_low_latency_window_ms";
9671
9672 /**
9673 * The length in milliseconds of a BLE scan interval in a low-power scan mode.
9674 * @hide
9675 */
9676 public static final String BLE_SCAN_LOW_POWER_INTERVAL_MS =
9677 "ble_scan_low_power_interval_ms";
9678
9679 /**
9680 * The length in milliseconds of a BLE scan interval in a balanced scan mode.
9681 * @hide
9682 */
9683 public static final String BLE_SCAN_BALANCED_INTERVAL_MS =
9684 "ble_scan_balanced_interval_ms";
9685
9686 /**
9687 * The length in milliseconds of a BLE scan interval in a low-latency scan mode.
9688 * @hide
9689 */
9690 public static final String BLE_SCAN_LOW_LATENCY_INTERVAL_MS =
9691 "ble_scan_low_latency_interval_ms";
Wei Wangd91f1932015-03-19 15:09:56 -07009692
Anthony Stangec97870a2018-03-14 01:09:45 +00009693 /**
9694 * The mode that BLE scanning clients will be moved to when in the background.
9695 * @hide
9696 */
9697 public static final String BLE_SCAN_BACKGROUND_MODE = "ble_scan_background_mode";
9698
Wei Wangd91f1932015-03-19 15:09:56 -07009699 /**
Christopher Tate06efb532012-08-24 15:29:27 -07009700 * Used to save the Wifi_ON state prior to tethering.
9701 * This state will be checked to restore Wifi after
9702 * the user turns off tethering.
9703 *
9704 * @hide
9705 */
9706 public static final String WIFI_SAVED_STATE = "wifi_saved_state";
9707
9708 /**
9709 * The interval in milliseconds to scan as used by the wifi supplicant
9710 * @hide
9711 */
9712 public static final String WIFI_SUPPLICANT_SCAN_INTERVAL_MS =
9713 "wifi_supplicant_scan_interval_ms";
9714
vandwalle7c3606c2014-03-31 19:12:07 -07009715 /**
9716 * whether frameworks handles wifi auto-join
9717 * @hide
9718 */
9719 public static final String WIFI_ENHANCED_AUTO_JOIN =
9720 "wifi_enhanced_auto_join";
9721
9722 /**
9723 * whether settings show RSSI
9724 * @hide
9725 */
9726 public static final String WIFI_NETWORK_SHOW_RSSI =
9727 "wifi_network_show_rssi";
9728
9729 /**
Irfan Sheriff3809f502012-09-17 16:04:57 -07009730 * The interval in milliseconds to scan at supplicant when p2p is connected
9731 * @hide
9732 */
9733 public static final String WIFI_SCAN_INTERVAL_WHEN_P2P_CONNECTED_MS =
9734 "wifi_scan_interval_p2p_connected_ms";
9735
9736 /**
Christopher Tate06efb532012-08-24 15:29:27 -07009737 * Whether the Wi-Fi watchdog is enabled.
9738 */
9739 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
9740
9741 /**
Christopher Tate06efb532012-08-24 15:29:27 -07009742 * Setting to turn off poor network avoidance on Wi-Fi. Feature is enabled by default and
9743 * the setting needs to be set to 0 to disable it.
9744 * @hide
9745 */
9746 public static final String WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED =
9747 "wifi_watchdog_poor_network_test_enabled";
9748
Michal Karpinski5db1e432018-01-18 20:10:24 +00009749 private static final Validator WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED_VALIDATOR =
9750 ANY_STRING_VALIDATOR;
9751
Christopher Tate06efb532012-08-24 15:29:27 -07009752 /**
9753 * Setting to turn on suspend optimizations at screen off on Wi-Fi. Enabled by default and
9754 * needs to be set to 0 to disable it.
9755 * @hide
9756 */
9757 public static final String WIFI_SUSPEND_OPTIMIZATIONS_ENABLED =
9758 "wifi_suspend_optimizations_enabled";
9759
9760 /**
Nathan Harold29589fc2016-03-30 21:53:48 -07009761 * Setting to enable verbose logging in Wi-Fi; disabled by default, and setting to 1
9762 * will enable it. In the future, additional values may be supported.
9763 * @hide
9764 */
9765 public static final String WIFI_VERBOSE_LOGGING_ENABLED =
9766 "wifi_verbose_logging_enabled";
9767
Jong Wook Kim0a20eda2018-01-05 18:40:25 -08009768 /**
9769 * Setting to enable connected MAC randomization in Wi-Fi; disabled by default, and
9770 * setting to 1 will enable it. In the future, additional values may be supported.
9771 * @hide
9772 */
9773 public static final String WIFI_CONNECTED_MAC_RANDOMIZATION_ENABLED =
9774 "wifi_connected_mac_randomization_enabled";
9775
Michael Plassf1510fb2018-02-28 16:08:47 -08009776 /**
9777 * Parameters to adjust the performance of framework wifi scoring methods.
9778 * <p>
9779 * Encoded as a comma-separated key=value list, for example:
9780 * "rssi5=-80:-77:-70:-57,rssi2=-83:-80:-73:-60,horizon=15"
9781 * This is intended for experimenting with new parameter values,
9782 * and is normally unset or empty. The example does not include all
9783 * parameters that may be honored.
9784 * Default values are provided by code or device configurations.
9785 * Errors in the parameters will cause the entire setting to be ignored.
9786 * @hide
9787 */
9788 public static final String WIFI_SCORE_PARAMS =
9789 "wifi_score_params";
9790
Nathan Harold29589fc2016-03-30 21:53:48 -07009791 /**
Christopher Tate06efb532012-08-24 15:29:27 -07009792 * The maximum number of times we will retry a connection to an access
9793 * point for which we have failed in acquiring an IP address from DHCP.
9794 * A value of N means that we will make N+1 connection attempts in all.
9795 */
9796 public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count";
9797
9798 /**
9799 * Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile
9800 * data connectivity to be established after a disconnect from Wi-Fi.
9801 */
9802 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
9803 "wifi_mobile_data_transition_wakelock_timeout_ms";
9804
9805 /**
Zoltan Szatmary-Ban4045d242015-05-27 12:42:39 +01009806 * This setting controls whether WiFi configurations created by a Device Owner app
9807 * should be locked down (that is, be editable or removable only by the Device Owner App,
9808 * not even by Settings app).
9809 * This setting takes integer values. Non-zero values mean DO created configurations
9810 * are locked down. Value of zero means they are not. Default value in the absence of
9811 * actual value to this setting is 0.
9812 */
9813 public static final String WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN =
9814 "wifi_device_owner_configs_lockdown";
9815
9816 /**
Christopher Tate06efb532012-08-24 15:29:27 -07009817 * The operational wifi frequency band
9818 * Set to one of {@link WifiManager#WIFI_FREQUENCY_BAND_AUTO},
9819 * {@link WifiManager#WIFI_FREQUENCY_BAND_5GHZ} or
9820 * {@link WifiManager#WIFI_FREQUENCY_BAND_2GHZ}
9821 *
9822 * @hide
9823 */
9824 public static final String WIFI_FREQUENCY_BAND = "wifi_frequency_band";
9825
9826 /**
9827 * The Wi-Fi peer-to-peer device name
9828 * @hide
9829 */
9830 public static final String WIFI_P2P_DEVICE_NAME = "wifi_p2p_device_name";
9831
9832 /**
Robert Greenwaltc12783a2013-05-16 12:48:20 -07009833 * The min time between wifi disable and wifi enable
9834 * @hide
9835 */
9836 public static final String WIFI_REENABLE_DELAY_MS = "wifi_reenable_delay";
9837
9838 /**
Jeff Davidsona20ca67d2014-12-16 11:48:54 -08009839 * Timeout for ephemeral networks when all known BSSIDs go out of range. We will disconnect
9840 * from an ephemeral network if there is no BSSID for that network with a non-null score that
9841 * has been seen in this time period.
9842 *
9843 * If this is less than or equal to zero, we use a more conservative behavior and only check
9844 * for a non-null score from the currently connected or target BSSID.
9845 * @hide
9846 */
9847 public static final String WIFI_EPHEMERAL_OUT_OF_RANGE_TIMEOUT_MS =
9848 "wifi_ephemeral_out_of_range_timeout_ms";
9849
9850 /**
Christopher Tatec868b642012-09-12 17:41:04 -07009851 * The number of milliseconds to delay when checking for data stalls during
9852 * non-aggressive detection. (screen is turned off.)
9853 * @hide
9854 */
9855 public static final String DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS =
9856 "data_stall_alarm_non_aggressive_delay_in_ms";
9857
9858 /**
9859 * The number of milliseconds to delay when checking for data stalls during
9860 * aggressive detection. (screen on or suspected data stall)
9861 * @hide
9862 */
9863 public static final String DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS =
9864 "data_stall_alarm_aggressive_delay_in_ms";
9865
9866 /**
Wink Savillece1e3792013-09-03 16:41:44 -07009867 * The number of milliseconds to allow the provisioning apn to remain active
9868 * @hide
9869 */
9870 public static final String PROVISIONING_APN_ALARM_DELAY_IN_MS =
9871 "provisioning_apn_alarm_delay_in_ms";
9872
9873 /**
Christopher Tatec868b642012-09-12 17:41:04 -07009874 * The interval in milliseconds at which to check gprs registration
9875 * after the first registration mismatch of gprs and voice service,
9876 * to detect possible data network registration problems.
9877 *
9878 * @hide
9879 */
9880 public static final String GPRS_REGISTER_CHECK_PERIOD_MS =
9881 "gprs_register_check_period_ms";
9882
9883 /**
Christopher Tate06efb532012-08-24 15:29:27 -07009884 * Nonzero causes Log.wtf() to crash.
9885 * @hide
9886 */
9887 public static final String WTF_IS_FATAL = "wtf_is_fatal";
9888
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07009889 /**
9890 * Ringer mode. This is used internally, changing this value will not
9891 * change the ringer mode. See AudioManager.
9892 */
9893 public static final String MODE_RINGER = "mode_ringer";
Christopher Tate06efb532012-08-24 15:29:27 -07009894
Jeff Brownd4935962012-09-25 13:27:20 -07009895 /**
9896 * Overlay display devices setting.
9897 * The associated value is a specially formatted string that describes the
9898 * size and density of simulated secondary display devices.
9899 * <p>
9900 * Format: {width}x{height}/{dpi};...
9901 * </p><p>
9902 * Example:
9903 * <ul>
9904 * <li><code>1280x720/213</code>: make one overlay that is 1280x720 at 213dpi.</li>
9905 * <li><code>1920x1080/320;1280x720/213</code>: make two overlays, the first
9906 * at 1080p and the second at 720p.</li>
9907 * <li>If the value is empty, then no overlay display devices are created.</li>
9908 * </ul></p>
9909 *
9910 * @hide
9911 */
9912 public static final String OVERLAY_DISPLAY_DEVICES = "overlay_display_devices";
Christopher Tate06efb532012-08-24 15:29:27 -07009913
Jeff Sharkey625239a2012-09-26 22:03:49 -07009914 /**
9915 * Threshold values for the duration and level of a discharge cycle,
9916 * under which we log discharge cycle info.
9917 *
9918 * @hide
9919 */
9920 public static final String
9921 BATTERY_DISCHARGE_DURATION_THRESHOLD = "battery_discharge_duration_threshold";
9922
9923 /** @hide */
9924 public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold";
9925
9926 /**
9927 * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR
9928 * intents on application crashes and ANRs. If this is disabled, the
9929 * crash/ANR dialog will never display the "Report" button.
9930 * <p>
9931 * Type: int (0 = disallow, 1 = allow)
9932 *
9933 * @hide
9934 */
9935 public static final String SEND_ACTION_APP_ERROR = "send_action_app_error";
9936
9937 /**
9938 * Maximum age of entries kept by {@link DropBoxManager}.
9939 *
9940 * @hide
9941 */
9942 public static final String DROPBOX_AGE_SECONDS = "dropbox_age_seconds";
9943
9944 /**
9945 * Maximum number of entry files which {@link DropBoxManager} will keep
9946 * around.
9947 *
9948 * @hide
9949 */
9950 public static final String DROPBOX_MAX_FILES = "dropbox_max_files";
9951
9952 /**
9953 * Maximum amount of disk space used by {@link DropBoxManager} no matter
9954 * what.
9955 *
9956 * @hide
9957 */
9958 public static final String DROPBOX_QUOTA_KB = "dropbox_quota_kb";
9959
9960 /**
9961 * Percent of free disk (excluding reserve) which {@link DropBoxManager}
9962 * will use.
9963 *
9964 * @hide
9965 */
9966 public static final String DROPBOX_QUOTA_PERCENT = "dropbox_quota_percent";
9967
9968 /**
9969 * Percent of total disk which {@link DropBoxManager} will never dip
9970 * into.
9971 *
9972 * @hide
9973 */
9974 public static final String DROPBOX_RESERVE_PERCENT = "dropbox_reserve_percent";
9975
9976 /**
9977 * Prefix for per-tag dropbox disable/enable settings.
9978 *
9979 * @hide
9980 */
9981 public static final String DROPBOX_TAG_PREFIX = "dropbox:";
9982
9983 /**
9984 * Lines of logcat to include with system crash/ANR/etc. reports, as a
9985 * prefix of the dropbox tag of the report type. For example,
9986 * "logcat_for_system_server_anr" controls the lines of logcat captured
9987 * with system server ANR reports. 0 to disable.
9988 *
9989 * @hide
9990 */
9991 public static final String ERROR_LOGCAT_PREFIX = "logcat_for_";
9992
9993 /**
9994 * The interval in minutes after which the amount of free storage left
9995 * on the device is logged to the event log
9996 *
9997 * @hide
9998 */
9999 public static final String SYS_FREE_STORAGE_LOG_INTERVAL = "sys_free_storage_log_interval";
10000
10001 /**
10002 * Threshold for the amount of change in disk free space required to
10003 * report the amount of free space. Used to prevent spamming the logs
10004 * when the disk free space isn't changing frequently.
10005 *
10006 * @hide
10007 */
10008 public static final String
10009 DISK_FREE_CHANGE_REPORTING_THRESHOLD = "disk_free_change_reporting_threshold";
10010
10011 /**
10012 * Minimum percentage of free storage on the device that is used to
10013 * determine if the device is running low on storage. The default is 10.
10014 * <p>
10015 * Say this value is set to 10, the device is considered running low on
10016 * storage if 90% or more of the device storage is filled up.
10017 *
10018 * @hide
10019 */
10020 public static final String
10021 SYS_STORAGE_THRESHOLD_PERCENTAGE = "sys_storage_threshold_percentage";
10022
10023 /**
10024 * Maximum byte size of the low storage threshold. This is to ensure
10025 * that {@link #SYS_STORAGE_THRESHOLD_PERCENTAGE} does not result in an
10026 * overly large threshold for large storage devices. Currently this must
10027 * be less than 2GB. This default is 500MB.
10028 *
10029 * @hide
10030 */
10031 public static final String
10032 SYS_STORAGE_THRESHOLD_MAX_BYTES = "sys_storage_threshold_max_bytes";
10033
10034 /**
10035 * Minimum bytes of free storage on the device before the data partition
10036 * is considered full. By default, 1 MB is reserved to avoid system-wide
10037 * SQLite disk full exceptions.
10038 *
10039 * @hide
10040 */
10041 public static final String
10042 SYS_STORAGE_FULL_THRESHOLD_BYTES = "sys_storage_full_threshold_bytes";
10043
10044 /**
Jeff Sharkeyd5d5e922017-02-21 10:51:23 -070010045 * Minimum percentage of storage on the device that is reserved for
10046 * cached data.
10047 *
10048 * @hide
10049 */
10050 public static final String
10051 SYS_STORAGE_CACHE_PERCENTAGE = "sys_storage_cache_percentage";
10052
10053 /**
10054 * Maximum bytes of storage on the device that is reserved for cached
10055 * data.
10056 *
10057 * @hide
10058 */
10059 public static final String
10060 SYS_STORAGE_CACHE_MAX_BYTES = "sys_storage_cache_max_bytes";
10061
10062 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -070010063 * The maximum reconnect delay for short network outages or when the
10064 * network is suspended due to phone use.
10065 *
10066 * @hide
10067 */
10068 public static final String
10069 SYNC_MAX_RETRY_DELAY_IN_SECONDS = "sync_max_retry_delay_in_seconds";
10070
10071 /**
10072 * The number of milliseconds to delay before sending out
Erik Kline8f29dcf2014-12-08 16:25:20 +090010073 * {@link ConnectivityManager#CONNECTIVITY_ACTION} broadcasts. Ignored.
Jeff Sharkey625239a2012-09-26 22:03:49 -070010074 *
10075 * @hide
10076 */
10077 public static final String CONNECTIVITY_CHANGE_DELAY = "connectivity_change_delay";
10078
Vinit Deshapnde1f12cb52013-08-21 13:09:01 -070010079
10080 /**
10081 * Network sampling interval, in seconds. We'll generate link information
10082 * about bytes/packets sent and error rates based on data sampled in this interval
10083 *
10084 * @hide
10085 */
10086
10087 public static final String CONNECTIVITY_SAMPLING_INTERVAL_IN_SECONDS =
10088 "connectivity_sampling_interval_in_seconds";
10089
Jeff Sharkey625239a2012-09-26 22:03:49 -070010090 /**
Jason Monk602b2322013-07-03 17:04:33 -040010091 * The series of successively longer delays used in retrying to download PAC file.
10092 * Last delay is used between successful PAC downloads.
10093 *
10094 * @hide
10095 */
10096 public static final String PAC_CHANGE_DELAY = "pac_change_delay";
10097
10098 /**
Calvin Onbe96da12016-10-11 15:10:46 -070010099 * Don't attempt to detect captive portals.
Jeff Sharkey625239a2012-09-26 22:03:49 -070010100 *
10101 * @hide
10102 */
Calvin Onbe96da12016-10-11 15:10:46 -070010103 public static final int CAPTIVE_PORTAL_MODE_IGNORE = 0;
10104
10105 /**
10106 * When detecting a captive portal, display a notification that
10107 * prompts the user to sign in.
10108 *
10109 * @hide
10110 */
10111 public static final int CAPTIVE_PORTAL_MODE_PROMPT = 1;
10112
10113 /**
10114 * When detecting a captive portal, immediately disconnect from the
10115 * network and do not reconnect to that network in the future.
10116 *
10117 * @hide
10118 */
10119 public static final int CAPTIVE_PORTAL_MODE_AVOID = 2;
10120
10121 /**
10122 * What to do when connecting a network that presents a captive portal.
10123 * Must be one of the CAPTIVE_PORTAL_MODE_* constants above.
10124 *
10125 * The default for this setting is CAPTIVE_PORTAL_MODE_PROMPT.
10126 * @hide
10127 */
10128 public static final String CAPTIVE_PORTAL_MODE = "captive_portal_mode";
10129
10130 /**
10131 * Setting to turn off captive portal detection. Feature is enabled by
10132 * default and the setting needs to be set to 0 to disable it.
10133 *
10134 * @deprecated use CAPTIVE_PORTAL_MODE_IGNORE to disable captive portal detection
10135 * @hide
10136 */
10137 @Deprecated
Jeff Sharkey625239a2012-09-26 22:03:49 -070010138 public static final String
10139 CAPTIVE_PORTAL_DETECTION_ENABLED = "captive_portal_detection_enabled";
10140
10141 /**
10142 * The server used for captive portal detection upon a new conection. A
10143 * 204 response code from the server is used for validation.
Hugo Benichi92eb22fd2016-09-27 13:01:41 +090010144 * TODO: remove this deprecated symbol.
Jeff Sharkey625239a2012-09-26 22:03:49 -070010145 *
10146 * @hide
10147 */
10148 public static final String CAPTIVE_PORTAL_SERVER = "captive_portal_server";
10149
10150 /**
Hugo Benichi92eb22fd2016-09-27 13:01:41 +090010151 * The URL used for HTTPS captive portal detection upon a new connection.
10152 * A 204 response code from the server is used for validation.
10153 *
10154 * @hide
10155 */
10156 public static final String CAPTIVE_PORTAL_HTTPS_URL = "captive_portal_https_url";
10157
10158 /**
10159 * The URL used for HTTP captive portal detection upon a new connection.
10160 * A 204 response code from the server is used for validation.
10161 *
10162 * @hide
10163 */
10164 public static final String CAPTIVE_PORTAL_HTTP_URL = "captive_portal_http_url";
10165
10166 /**
10167 * The URL used for fallback HTTP captive portal detection when previous HTTP
10168 * and HTTPS captive portal detection attemps did not return a conclusive answer.
10169 *
10170 * @hide
10171 */
10172 public static final String CAPTIVE_PORTAL_FALLBACK_URL = "captive_portal_fallback_url";
10173
10174 /**
Hugo Benichieef918a2017-04-10 17:43:08 +090010175 * A comma separated list of URLs used for captive portal detection in addition to the
10176 * fallback HTTP url associated with the CAPTIVE_PORTAL_FALLBACK_URL settings.
10177 *
10178 * @hide
10179 */
10180 public static final String CAPTIVE_PORTAL_OTHER_FALLBACK_URLS =
10181 "captive_portal_other_fallback_urls";
10182
10183 /**
Lorenzo Colittic5be12e2016-04-19 21:57:31 +090010184 * Whether to use HTTPS for network validation. This is enabled by default and the setting
10185 * needs to be set to 0 to disable it. This setting is a misnomer because captive portals
10186 * don't actually use HTTPS, but it's consistent with the other settings.
10187 *
10188 * @hide
10189 */
10190 public static final String CAPTIVE_PORTAL_USE_HTTPS = "captive_portal_use_https";
10191
10192 /**
Hugo Benichi92eb22fd2016-09-27 13:01:41 +090010193 * Which User-Agent string to use in the header of the captive portal detection probes.
10194 * The User-Agent field is unset when this setting has no value (HttpUrlConnection default).
10195 *
10196 * @hide
10197 */
10198 public static final String CAPTIVE_PORTAL_USER_AGENT = "captive_portal_user_agent";
10199
10200 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -070010201 * Whether network service discovery is enabled.
10202 *
10203 * @hide
10204 */
10205 public static final String NSD_ON = "nsd_on";
10206
10207 /**
10208 * Let user pick default install location.
10209 *
10210 * @hide
10211 */
10212 public static final String SET_INSTALL_LOCATION = "set_install_location";
10213
10214 /**
10215 * Default install location value.
10216 * 0 = auto, let system decide
10217 * 1 = internal
10218 * 2 = sdcard
10219 * @hide
10220 */
10221 public static final String DEFAULT_INSTALL_LOCATION = "default_install_location";
10222
10223 /**
10224 * ms during which to consume extra events related to Inet connection
10225 * condition after a transtion to fully-connected
10226 *
10227 * @hide
10228 */
10229 public static final String
10230 INET_CONDITION_DEBOUNCE_UP_DELAY = "inet_condition_debounce_up_delay";
10231
10232 /**
10233 * ms during which to consume extra events related to Inet connection
10234 * condtion after a transtion to partly-connected
10235 *
10236 * @hide
10237 */
10238 public static final String
10239 INET_CONDITION_DEBOUNCE_DOWN_DELAY = "inet_condition_debounce_down_delay";
10240
10241 /** {@hide} */
10242 public static final String
10243 READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT = "read_external_storage_enforced_default";
10244
10245 /**
10246 * Host name and port for global http proxy. Uses ':' seperator for
10247 * between host and port.
10248 */
10249 public static final String HTTP_PROXY = "http_proxy";
10250
10251 /**
10252 * Host name for global http proxy. Set via ConnectivityManager.
10253 *
10254 * @hide
10255 */
10256 public static final String GLOBAL_HTTP_PROXY_HOST = "global_http_proxy_host";
10257
10258 /**
10259 * Integer host port for global http proxy. Set via ConnectivityManager.
10260 *
10261 * @hide
10262 */
10263 public static final String GLOBAL_HTTP_PROXY_PORT = "global_http_proxy_port";
10264
10265 /**
10266 * Exclusion list for global proxy. This string contains a list of
10267 * comma-separated domains where the global proxy does not apply.
10268 * Domains should be listed in a comma- separated list. Example of
10269 * acceptable formats: ".domain1.com,my.domain2.com" Use
10270 * ConnectivityManager to set/get.
10271 *
10272 * @hide
10273 */
10274 public static final String
10275 GLOBAL_HTTP_PROXY_EXCLUSION_LIST = "global_http_proxy_exclusion_list";
10276
10277 /**
Jason Monk602b2322013-07-03 17:04:33 -040010278 * The location PAC File for the proxy.
10279 * @hide
10280 */
10281 public static final String
10282 GLOBAL_HTTP_PROXY_PAC = "global_proxy_pac_url";
10283
10284 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -070010285 * Enables the UI setting to allow the user to specify the global HTTP
10286 * proxy and associated exclusion list.
10287 *
10288 * @hide
10289 */
10290 public static final String SET_GLOBAL_HTTP_PROXY = "set_global_http_proxy";
10291
10292 /**
10293 * Setting for default DNS in case nobody suggests one
10294 *
10295 * @hide
10296 */
10297 public static final String DEFAULT_DNS_SERVER = "default_dns_server";
10298
Ben Schwartzbccbd002017-10-02 13:27:13 -040010299 /**
Erik Kline4d092232017-10-30 15:29:44 +090010300 * The requested Private DNS mode (string), and an accompanying specifier (string).
10301 *
10302 * Currently, the specifier holds the chosen provider name when the mode requests
10303 * a specific provider. It may be used to store the provider name even when the
10304 * mode changes so that temporarily disabling and re-enabling the specific
10305 * provider mode does not necessitate retyping the provider hostname.
Ben Schwartzbccbd002017-10-02 13:27:13 -040010306 *
10307 * @hide
10308 */
Erik Kline4d092232017-10-30 15:29:44 +090010309 public static final String PRIVATE_DNS_MODE = "private_dns_mode";
Michal Karpinski5db1e432018-01-18 20:10:24 +000010310
10311 private static final Validator PRIVATE_DNS_MODE_VALIDATOR = ANY_STRING_VALIDATOR;
10312
Erik Kline4d092232017-10-30 15:29:44 +090010313 /**
10314 * @hide
10315 */
10316 public static final String PRIVATE_DNS_SPECIFIER = "private_dns_specifier";
Ben Schwartzbccbd002017-10-02 13:27:13 -040010317
Michal Karpinski5db1e432018-01-18 20:10:24 +000010318 private static final Validator PRIVATE_DNS_SPECIFIER_VALIDATOR = ANY_STRING_VALIDATOR;
10319
Jeff Sharkey0ac10282012-10-01 12:50:22 -070010320 /** {@hide} */
10321 public static final String
10322 BLUETOOTH_HEADSET_PRIORITY_PREFIX = "bluetooth_headset_priority_";
10323 /** {@hide} */
10324 public static final String
10325 BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX = "bluetooth_a2dp_sink_priority_";
10326 /** {@hide} */
10327 public static final String
Sanket Agarwal1bec6a52015-10-21 18:23:27 -070010328 BLUETOOTH_A2DP_SRC_PRIORITY_PREFIX = "bluetooth_a2dp_src_priority_";
10329 /** {@hide} */
Antony Sargentf5772c62017-04-26 16:37:53 -070010330 public static final String BLUETOOTH_A2DP_SUPPORTS_OPTIONAL_CODECS_PREFIX =
10331 "bluetooth_a2dp_supports_optional_codecs_";
10332 /** {@hide} */
10333 public static final String BLUETOOTH_A2DP_OPTIONAL_CODECS_ENABLED_PREFIX =
10334 "bluetooth_a2dp_optional_codecs_enabled_";
10335 /** {@hide} */
Sanket Agarwal1bec6a52015-10-21 18:23:27 -070010336 public static final String
Jeff Sharkey0ac10282012-10-01 12:50:22 -070010337 BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX = "bluetooth_input_device_priority_";
Kim Schulz0d376052013-08-22 11:18:02 +020010338 /** {@hide} */
10339 public static final String
10340 BLUETOOTH_MAP_PRIORITY_PREFIX = "bluetooth_map_priority_";
Casper Bonde2a5f6082015-03-19 10:36:45 +010010341 /** {@hide} */
10342 public static final String
Joseph Pirozzo631768d2016-09-01 14:19:28 -070010343 BLUETOOTH_MAP_CLIENT_PRIORITY_PREFIX = "bluetooth_map_client_priority_";
10344 /** {@hide} */
10345 public static final String
Joseph Pirozzo563c7002016-03-21 15:49:48 -070010346 BLUETOOTH_PBAP_CLIENT_PRIORITY_PREFIX = "bluetooth_pbap_client_priority_";
10347 /** {@hide} */
10348 public static final String
Casper Bonde2a5f6082015-03-19 10:36:45 +010010349 BLUETOOTH_SAP_PRIORITY_PREFIX = "bluetooth_sap_priority_";
Sanket Agarwal773297a2016-08-04 16:16:20 -070010350 /** {@hide} */
10351 public static final String
10352 BLUETOOTH_PAN_PRIORITY_PREFIX = "bluetooth_pan_priority_";
Jakub Pawlowskic2d7be62017-11-22 10:57:42 -080010353 /** {@hide} */
10354 public static final String
10355 BLUETOOTH_HEARING_AID_PRIORITY_PREFIX = "bluetooth_hearing_aid_priority_";
Jeff Sharkey0ac10282012-10-01 12:50:22 -070010356
10357 /**
Dianne Hackborn0ef403e2017-01-24 18:22:15 -080010358 * Activity manager specific settings.
10359 * This is encoded as a key=value list, separated by commas. Ex:
10360 *
Dianne Hackborn83b40f62017-04-26 13:59:47 -070010361 * "gc_timeout=5000,max_cached_processes=24"
Dianne Hackborn0ef403e2017-01-24 18:22:15 -080010362 *
10363 * The following keys are supported:
10364 *
10365 * <pre>
Dianne Hackborn0ef403e2017-01-24 18:22:15 -080010366 * max_cached_processes (int)
Dianne Hackborn83b40f62017-04-26 13:59:47 -070010367 * background_settle_time (long)
Dianne Hackborncb015632017-06-14 17:30:15 -070010368 * fgservice_min_shown_time (long)
10369 * fgservice_min_report_time (long)
10370 * fgservice_screen_on_before_time (long)
10371 * fgservice_screen_on_after_time (long)
Dianne Hackborn83b40f62017-04-26 13:59:47 -070010372 * content_provider_retain_time (long)
10373 * gc_timeout (long)
10374 * gc_min_interval (long)
10375 * full_pss_min_interval (long)
10376 * full_pss_lowered_interval (long)
Dianne Hackbornffca58b2017-05-24 16:15:45 -070010377 * power_check_interval (long)
10378 * power_check_max_cpu_1 (int)
10379 * power_check_max_cpu_2 (int)
10380 * power_check_max_cpu_3 (int)
10381 * power_check_max_cpu_4 (int)
Dianne Hackborn83b40f62017-04-26 13:59:47 -070010382 * service_usage_interaction_time (long)
10383 * usage_stats_interaction_interval (long)
10384 * service_restart_duration (long)
10385 * service_reset_run_duration (long)
10386 * service_restart_duration_factor (int)
10387 * service_min_restart_time_between (long)
10388 * service_max_inactivity (long)
10389 * service_bg_start_timeout (long)
Sudheer Shankaf6690102017-10-16 10:20:32 -070010390 * process_start_async (boolean)
Dianne Hackborn0ef403e2017-01-24 18:22:15 -080010391 * </pre>
10392 *
10393 * <p>
10394 * Type: string
10395 * @hide
10396 * @see com.android.server.am.ActivityManagerConstants
10397 */
10398 public static final String ACTIVITY_MANAGER_CONSTANTS = "activity_manager_constants";
10399
10400 /**
Adam Lesinski31c05d12015-06-09 17:34:04 -070010401 * Device Idle (Doze) specific settings.
10402 * This is encoded as a key=value list, separated by commas. Ex:
10403 *
Henrik Baardeac10ab2016-04-19 07:50:24 +020010404 * "inactive_to=60000,sensing_to=400000"
Adam Lesinski31c05d12015-06-09 17:34:04 -070010405 *
10406 * The following keys are supported:
10407 *
10408 * <pre>
10409 * inactive_to (long)
10410 * sensing_to (long)
10411 * motion_inactive_to (long)
10412 * idle_after_inactive_to (long)
10413 * idle_pending_to (long)
10414 * max_idle_pending_to (long)
10415 * idle_pending_factor (float)
10416 * idle_to (long)
10417 * max_idle_to (long)
10418 * idle_factor (float)
10419 * min_time_to_alarm (long)
10420 * max_temp_app_whitelist_duration (long)
Felipe Lemea1b79bf2016-05-24 13:06:54 -070010421 * notification_whitelist_duration (long)
Adam Lesinski31c05d12015-06-09 17:34:04 -070010422 * </pre>
10423 *
10424 * <p>
10425 * Type: string
10426 * @hide
10427 * @see com.android.server.DeviceIdleController.Constants
10428 */
10429 public static final String DEVICE_IDLE_CONSTANTS = "device_idle_constants";
10430
10431 /**
jackqdyulei455e90a2017-02-09 15:29:16 -080010432 * Battery Saver specific settings
10433 * This is encoded as a key=value list, separated by commas. Ex:
10434 *
10435 * "vibration_disabled=true,adjust_brightness_factor=0.5"
10436 *
10437 * The following keys are supported:
10438 *
10439 * <pre>
10440 * vibration_disabled (boolean)
10441 * animation_disabled (boolean)
10442 * soundtrigger_disabled (boolean)
10443 * fullbackup_deferred (boolean)
10444 * keyvaluebackup_deferred (boolean)
10445 * firewall_disabled (boolean)
10446 * gps_mode (int)
10447 * adjust_brightness_disabled (boolean)
10448 * adjust_brightness_factor (float)
10449 * </pre>
10450 * @hide
10451 * @see com.android.server.power.BatterySaverPolicy
10452 */
10453 public static final String BATTERY_SAVER_CONSTANTS = "battery_saver_constants";
10454
10455 /**
Makoto Onuki66a78122017-11-14 15:03:21 -080010456 * Battery Saver device specific settings
10457 * This is encoded as a key=value list, separated by commas.
10458 * See {@link com.android.server.power.BatterySaverPolicy} for the details.
10459 *
10460 * @hide
10461 */
10462 public static final String BATTERY_SAVER_DEVICE_SPECIFIC_CONSTANTS =
10463 "battery_saver_device_specific_constants";
10464
10465 /**
jackqdyulei29f91ea2017-12-13 15:01:43 -080010466 * Battery tip specific settings
10467 * This is encoded as a key=value list, separated by commas. Ex:
10468 *
10469 * "battery_tip_enabled=true,summary_enabled=true,high_usage_enabled=true,"
jackqdyulei87321192018-01-19 14:24:54 -080010470 * "high_usage_app_count=3,reduced_battery_enabled=false,reduced_battery_percent=50,"
10471 * "high_usage_battery_draining=25,high_usage_period_ms=3000"
jackqdyulei29f91ea2017-12-13 15:01:43 -080010472 *
10473 * The following keys are supported:
10474 *
10475 * <pre>
10476 * battery_tip_enabled (boolean)
10477 * summary_enabled (boolean)
10478 * battery_saver_tip_enabled (boolean)
10479 * high_usage_enabled (boolean)
10480 * high_usage_app_count (int)
jackqdyulei87321192018-01-19 14:24:54 -080010481 * high_usage_period_ms (long)
10482 * high_usage_battery_draining (int)
jackqdyulei29f91ea2017-12-13 15:01:43 -080010483 * app_restriction_enabled (boolean)
10484 * reduced_battery_enabled (boolean)
10485 * reduced_battery_percent (int)
10486 * low_battery_enabled (boolean)
10487 * low_battery_hour (int)
10488 * </pre>
10489 * @hide
10490 */
10491 public static final String BATTERY_TIP_CONSTANTS = "battery_tip_constants";
10492
10493 /**
Kweku Adams3699c362018-03-13 13:32:34 -070010494 * Battery anomaly detection specific settings
10495 * This is encoded as a key=value list, separated by commas.
10496 * wakeup_blacklisted_tags is a string, encoded as a set of tags, encoded via
10497 * {@link Uri#encode(String)}, separated by colons. Ex:
10498 *
10499 * "anomaly_detection_enabled=true,wakelock_threshold=2000,wakeup_alarm_enabled=true,"
10500 * "wakeup_alarm_threshold=10,wakeup_blacklisted_tags=tag1:tag2:with%2Ccomma:with%3Acolon"
10501 *
10502 * The following keys are supported:
10503 *
10504 * <pre>
10505 * anomaly_detection_enabled (boolean)
10506 * wakelock_enabled (boolean)
10507 * wakelock_threshold (long)
10508 * wakeup_alarm_enabled (boolean)
10509 * wakeup_alarm_threshold (long)
10510 * wakeup_blacklisted_tags (string)
10511 * bluetooth_scan_enabled (boolean)
10512 * bluetooth_scan_threshold (long)
10513 * </pre>
10514 * @hide
10515 */
10516 public static final String ANOMALY_DETECTION_CONSTANTS = "anomaly_detection_constants";
10517
10518 /**
jackqdyuleifa81bee2018-02-01 11:16:23 -080010519 * An integer to show the version of the anomaly config. Ex: 1, which means
10520 * current version is 1.
10521 * @hide
10522 */
10523 public static final String ANOMALY_CONFIG_VERSION = "anomaly_config_version";
10524
10525 /**
10526 * A base64-encoded string represents anomaly stats config, used for
10527 * {@link android.app.StatsManager}.
10528 * @hide
10529 */
10530 public static final String ANOMALY_CONFIG = "anomaly_config";
10531
10532 /**
jackqdyulei8443dd02017-08-24 16:14:34 -070010533 * Always on display(AOD) specific settings
10534 * This is encoded as a key=value list, separated by commas. Ex:
10535 *
10536 * "prox_screen_off_delay=10000,screen_brightness_array=0:1:2:3:4"
10537 *
10538 * The following keys are supported:
10539 *
10540 * <pre>
Chris Wren41707512017-12-06 00:12:17 -050010541 * screen_brightness_array (int[])
10542 * dimming_scrim_array (int[])
jackqdyulei8443dd02017-08-24 16:14:34 -070010543 * prox_screen_off_delay (long)
10544 * prox_cooldown_trigger (long)
10545 * prox_cooldown_period (long)
10546 * </pre>
10547 * @hide
10548 */
10549 public static final String ALWAYS_ON_DISPLAY_CONSTANTS = "always_on_display_constants";
10550
10551 /**
Shikhar Srivastav9a896a6c2018-01-09 16:58:36 -080010552 * System VDSO global setting. This links to the "sys.vdso" system property.
10553 * The following values are supported:
10554 * false -> both 32 and 64 bit vdso disabled
10555 * 32 -> 32 bit vdso enabled
10556 * 64 -> 64 bit vdso enabled
10557 * Any other value defaults to both 32 bit and 64 bit true.
10558 * @hide
10559 */
10560 public static final String SYS_VDSO = "sys_vdso";
10561
10562 /**
Marissa Wall04e7a9b2018-02-02 09:35:58 -080010563 * UidCpuPower global setting. This links the sys.uidcpupower system property.
10564 * The following values are supported:
10565 * 0 -> /proc/uid_cpupower/* are disabled
10566 * 1 -> /proc/uid_cpupower/* are enabled
10567 * Any other value defaults to enabled.
10568 * @hide
10569 */
10570 public static final String SYS_UIDCPUPOWER = "sys_uidcpupower";
10571
10572 /**
Hector Dearmancf92ca12018-03-07 11:12:35 +000010573 * traced global setting. This controls weather the deamons: traced and
10574 * traced_probes run. This links the sys.traced system property.
10575 * The following values are supported:
10576 * 0 -> traced and traced_probes are disabled
10577 * 1 -> traced and traced_probes are enabled
10578 * Any other value defaults to disabled.
10579 * @hide
10580 */
10581 public static final String SYS_TRACED = "sys_traced";
10582
10583 /**
Makoto Onuki3c9c9982018-01-17 10:46:48 -080010584 * An integer to reduce the FPS by this factor. Only for experiments. Need to reboot the
10585 * device for this setting to take full effect.
10586 *
10587 * @hide
10588 */
10589 public static final String FPS_DEVISOR = "fps_divisor";
10590
10591 /**
Ajay Dudanibcfcd6c2018-02-05 10:44:27 -080010592 * Flag to enable or disable display panel low power mode (lpm)
10593 * false -> Display panel power saving mode is disabled.
10594 * true -> Display panel power saving mode is enabled.
10595 *
10596 * @hide
10597 */
10598 public static final String DISPLAY_PANEL_LPM = "display_panel_lpm";
10599
10600 /**
Adam Lesinskia6232df2015-06-11 18:16:41 -070010601 * App standby (app idle) specific settings.
10602 * This is encoded as a key=value list, separated by commas. Ex:
Amith Yamasani172612c2017-12-15 10:51:53 -080010603 * <p>
Adam Lesinskia6232df2015-06-11 18:16:41 -070010604 * "idle_duration=5000,parole_interval=4500"
Amith Yamasani172612c2017-12-15 10:51:53 -080010605 * <p>
10606 * All durations are in millis.
Adam Lesinskia6232df2015-06-11 18:16:41 -070010607 * The following keys are supported:
10608 *
10609 * <pre>
Adam Lesinskif0ef3c12016-01-13 12:26:07 -080010610 * idle_duration2 (long)
Adam Lesinskia6232df2015-06-11 18:16:41 -070010611 * wallclock_threshold (long)
10612 * parole_interval (long)
10613 * parole_duration (long)
Adam Lesinskif0ef3c12016-01-13 12:26:07 -080010614 *
10615 * idle_duration (long) // This is deprecated and used to circumvent b/26355386.
Adam Lesinskia6232df2015-06-11 18:16:41 -070010616 * </pre>
10617 *
10618 * <p>
10619 * Type: string
10620 * @hide
10621 * @see com.android.server.usage.UsageStatsService.SettingsObserver
10622 */
10623 public static final String APP_IDLE_CONSTANTS = "app_idle_constants";
10624
10625 /**
Dianne Hackborn0ef403e2017-01-24 18:22:15 -080010626 * Power manager specific settings.
10627 * This is encoded as a key=value list, separated by commas. Ex:
10628 *
10629 * "no_cached_wake_locks=1"
10630 *
10631 * The following keys are supported:
10632 *
10633 * <pre>
10634 * no_cached_wake_locks (boolean)
10635 * </pre>
10636 *
10637 * <p>
10638 * Type: string
10639 * @hide
10640 * @see com.android.server.power.PowerManagerConstants
10641 */
10642 public static final String POWER_MANAGER_CONSTANTS = "power_manager_constants";
10643
10644 /**
Dianne Hackborna750a632015-06-16 17:18:23 -070010645 * Alarm manager specific settings.
10646 * This is encoded as a key=value list, separated by commas. Ex:
10647 *
10648 * "min_futurity=5000,allow_while_idle_short_time=4500"
10649 *
10650 * The following keys are supported:
10651 *
10652 * <pre>
10653 * min_futurity (long)
10654 * min_interval (long)
10655 * allow_while_idle_short_time (long)
10656 * allow_while_idle_long_time (long)
10657 * allow_while_idle_whitelist_duration (long)
10658 * </pre>
10659 *
10660 * <p>
10661 * Type: string
10662 * @hide
10663 * @see com.android.server.AlarmManagerService.Constants
10664 */
10665 public static final String ALARM_MANAGER_CONSTANTS = "alarm_manager_constants";
10666
10667 /**
Dianne Hackborne9a988c2016-05-27 17:59:40 -070010668 * Job scheduler specific settings.
10669 * This is encoded as a key=value list, separated by commas. Ex:
10670 *
10671 * "min_ready_jobs_count=2,moderate_use_factor=.5"
10672 *
10673 * The following keys are supported:
10674 *
10675 * <pre>
10676 * min_idle_count (int)
10677 * min_charging_count (int)
10678 * min_connectivity_count (int)
10679 * min_content_count (int)
10680 * min_ready_jobs_count (int)
10681 * heavy_use_factor (float)
10682 * moderate_use_factor (float)
10683 * fg_job_count (int)
10684 * bg_normal_job_count (int)
10685 * bg_moderate_job_count (int)
10686 * bg_low_job_count (int)
10687 * bg_critical_job_count (int)
10688 * </pre>
10689 *
10690 * <p>
10691 * Type: string
10692 * @hide
10693 * @see com.android.server.job.JobSchedulerService.Constants
10694 */
10695 public static final String JOB_SCHEDULER_CONSTANTS = "job_scheduler_constants";
10696
10697 /**
Makoto Onuki4362a662016-03-08 18:59:09 -080010698 * ShortcutManager specific settings.
10699 * This is encoded as a key=value list, separated by commas. Ex:
10700 *
Makoto Onukib6d35232016-04-04 15:57:17 -070010701 * "reset_interval_sec=86400,max_updates_per_interval=1"
Makoto Onuki4362a662016-03-08 18:59:09 -080010702 *
10703 * The following keys are supported:
10704 *
10705 * <pre>
10706 * reset_interval_sec (long)
Makoto Onukib6d35232016-04-04 15:57:17 -070010707 * max_updates_per_interval (int)
Makoto Onuki4362a662016-03-08 18:59:09 -080010708 * max_icon_dimension_dp (int, DP)
10709 * max_icon_dimension_dp_lowram (int, DP)
10710 * max_shortcuts (int)
10711 * icon_quality (int, 0-100)
10712 * icon_format (String)
10713 * </pre>
10714 *
10715 * <p>
10716 * Type: string
10717 * @hide
10718 * @see com.android.server.pm.ShortcutService.ConfigConstants
10719 */
10720 public static final String SHORTCUT_MANAGER_CONSTANTS = "shortcut_manager_constants";
10721
10722 /**
Makoto Onuki09c529a2017-05-01 10:05:28 -070010723 * DevicePolicyManager specific settings.
10724 * This is encoded as a key=value list, separated by commas. Ex:
10725 *
10726 * <pre>
10727 * das_died_service_reconnect_backoff_sec (long)
10728 * das_died_service_reconnect_backoff_increase (float)
10729 * das_died_service_reconnect_max_backoff_sec (long)
10730 * </pre>
10731 *
10732 * <p>
10733 * Type: string
10734 * @hide
10735 * see also com.android.server.devicepolicy.DevicePolicyConstants
10736 */
10737 public static final String DEVICE_POLICY_CONSTANTS = "device_policy_constants";
10738
10739 /**
Abodunrinwa Toki0e6b43e2017-09-19 23:18:40 +010010740 * TextClassifier specific settings.
Jan Althaus0aacdb62018-02-19 11:44:37 +010010741 * This is encoded as a key=value list, separated by commas. String[] types like
10742 * entity_list_default use ":" as delimiter for values. Ex:
Abodunrinwa Toki0e6b43e2017-09-19 23:18:40 +010010743 *
10744 * <pre>
Abodunrinwa Tokic7073a42018-02-28 23:02:13 +000010745 * smart_linkify_enabled (boolean)
10746 * system_textclassifier_enabled (boolean)
Abodunrinwa Tokidb8fc312018-02-26 21:37:51 +000010747 * model_dark_launch_enabled (boolean)
10748 * smart_selection_enabled (boolean)
10749 * smart_text_share_enabled (boolean)
10750 * smart_linkify_enabled (boolean)
10751 * smart_select_animation_enabled (boolean)
Jan Althaus108aad32018-01-30 15:26:55 +010010752 * suggest_selection_max_range_length (int)
10753 * classify_text_max_range_length (int)
10754 * generate_links_max_text_length (int)
Jan Althaus31efdc32018-02-19 22:23:13 +010010755 * generate_links_log_sample_rate (int)
Jan Althaus0aacdb62018-02-19 11:44:37 +010010756 * entity_list_default (String[])
10757 * entity_list_not_editable (String[])
10758 * entity_list_editable (String[])
Abodunrinwa Toki0e6b43e2017-09-19 23:18:40 +010010759 * </pre>
10760 *
10761 * <p>
10762 * Type: string
10763 * @hide
Abodunrinwa Tokidb8fc312018-02-26 21:37:51 +000010764 * see also android.view.textclassifier.TextClassificationConstants
Abodunrinwa Toki0e6b43e2017-09-19 23:18:40 +010010765 */
10766 public static final String TEXT_CLASSIFIER_CONSTANTS = "text_classifier_constants";
10767
10768 /**
Sudheer Shanka5c19b892018-01-05 17:25:46 -080010769 * BatteryStats specific settings.
10770 * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true"
10771 *
10772 * The following keys are supported:
10773 * <pre>
10774 * track_cpu_times_by_proc_state (boolean)
Mike Mafae87da2018-01-19 20:07:20 -080010775 * track_cpu_active_cluster_time (boolean)
10776 * read_binary_cpu_time (boolean)
Sudheer Shankac20379e2018-02-15 00:06:21 -080010777 * proc_state_cpu_times_read_delay_ms (long)
Sudheer Shankae56013a2018-04-23 11:22:15 -070010778 * external_stats_collection_rate_limit_ms (long)
Sudheer Shanka0719c6a2018-04-24 11:12:11 -070010779 * battery_level_collection_delay_ms (long)
Sudheer Shanka5c19b892018-01-05 17:25:46 -080010780 * </pre>
10781 *
10782 * <p>
10783 * Type: string
10784 * @hide
10785 * see also com.android.internal.os.BatteryStatsImpl.Constants
10786 */
10787 public static final String BATTERY_STATS_CONSTANTS = "battery_stats_constants";
10788
10789 /**
Makoto Onukiaad2b512018-02-07 09:31:46 -080010790 * SyncManager specific settings.
10791 *
10792 * <p>
10793 * Type: string
10794 * @hide
10795 * @see com.android.server.content.SyncManagerConstants
10796 */
10797 public static final String SYNC_MANAGER_CONSTANTS = "sync_manager_constants";
10798
10799 /**
Lei Yu4b976ad2018-04-19 10:38:58 -070010800 * Whether or not App Standby feature is enabled by system. This controls throttling of apps
10801 * based on usage patterns and predictions. Platform will turn on this feature if both this
10802 * flag and {@link #ADAPTIVE_BATTERY_MANAGEMENT_ENABLED} is on.
Amith Yamasani172612c2017-12-15 10:51:53 -080010803 * Type: int (0 for false, 1 for true)
10804 * Default: 1
10805 * @hide
Lei Yu4b976ad2018-04-19 10:38:58 -070010806 * @see #ADAPTIVE_BATTERY_MANAGEMENT_ENABLED
Amith Yamasani172612c2017-12-15 10:51:53 -080010807 */
Kweku Adams3699c362018-03-13 13:32:34 -070010808 public static final String APP_STANDBY_ENABLED = "app_standby_enabled";
Amith Yamasani172612c2017-12-15 10:51:53 -080010809
10810 /**
Lei Yu4b976ad2018-04-19 10:38:58 -070010811 * Whether or not adaptive battery feature is enabled by user. Platform will turn on this
10812 * feature if both this flag and {@link #APP_STANDBY_ENABLED} is on.
10813 * Type: int (0 for false, 1 for true)
10814 * Default: 1
10815 * @hide
10816 * @see #APP_STANDBY_ENABLED
10817 */
10818 public static final String ADAPTIVE_BATTERY_MANAGEMENT_ENABLED =
10819 "adaptive_battery_management_enabled";
10820
10821 /**
jackqdyulei3cd42a02018-02-27 11:18:00 -080010822 * Whether or not app auto restriction is enabled. When it is enabled, settings app will
10823 * auto restrict the app if it has bad behavior(e.g. hold wakelock for long time).
10824 *
10825 * Type: boolean (0 for false, 1 for true)
10826 * Default: 1
10827 *
10828 * @hide
10829 */
Kweku Adams3699c362018-03-13 13:32:34 -070010830 public static final String APP_AUTO_RESTRICTION_ENABLED =
jackqdyulei3cd42a02018-02-27 11:18:00 -080010831 "app_auto_restriction_enabled";
10832
10833 private static final Validator APP_AUTO_RESTRICTION_ENABLED_VALIDATOR =
10834 BOOLEAN_VALIDATOR;
10835
10836 /**
Suprabh Shukla4deb8522018-01-08 16:27:10 -080010837 * Feature flag to enable or disable the Forced App Standby feature.
10838 * Type: int (0 for false, 1 for true)
10839 * Default: 1
10840 * @hide
10841 */
10842 public static final String FORCED_APP_STANDBY_ENABLED = "forced_app_standby_enabled";
10843
10844 /**
Nancy Zheng525aaa12018-01-12 11:45:37 -080010845 * Whether or not to enable Forced App Standby on small battery devices.
10846 * Type: int (0 for false, 1 for true)
10847 * Default: 0
10848 * @hide
10849 */
10850 public static final String FORCED_APP_STANDBY_FOR_SMALL_BATTERY_ENABLED
10851 = "forced_app_standby_for_small_battery_enabled";
10852
10853 /**
Damien Bargiacchi50b61102018-02-15 16:45:37 -080010854 * Whether or not to enable the Off Body, Radios Off feature on small battery devices.
10855 * Type: int (0 for false, 1 for true)
10856 * Default: 0
10857 * @hide
10858 */
10859 public static final String OFF_BODY_RADIOS_OFF_FOR_SMALL_BATTERY_ENABLED
10860 = "off_body_radios_off_for_small_battery_enabled";
10861
10862 /**
10863 * How long after the device goes off body to disable radios, in milliseconds.
10864 * Type: long
10865 * Default: 10 minutes
10866 * @hide
10867 */
10868 public static final String OFF_BODY_RADIOS_OFF_DELAY_MS = "off_body_radios_off_delay_ms";
10869
10870 /**
yuanlub6b04952018-02-20 14:28:13 -080010871 * Whether or not to turn on Wifi when proxy is disconnected.
10872 * Type: int (0 for false, 1 for true)
10873 * Default: 1
10874 * @hide
10875 */
10876 public static final String WIFI_ON_WHEN_PROXY_DISCONNECTED
10877 = "wifi_on_when_proxy_disconnected";
10878
10879 /**
Michael Kwan5f5a0bf2018-03-16 12:25:50 -070010880 * Time Only Mode specific settings.
10881 * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true"
10882 *
10883 * The following keys are supported:
10884 *
10885 * <pre>
10886 * enabled (boolean)
10887 * disable_tilt_to_wake (boolean)
10888 * disable_touch_to_wake (boolean)
10889 * </pre>
10890 * Type: string
Michael Kwan47abf8c2018-01-23 13:57:18 -080010891 * @hide
10892 */
Michael Kwan5f5a0bf2018-03-16 12:25:50 -070010893 public static final String TIME_ONLY_MODE_CONSTANTS
10894 = "time_only_mode_constants";
Michael Kwan47abf8c2018-01-23 13:57:18 -080010895
10896 /**
Robin Bennett1193a352018-03-28 14:49:58 +010010897 * Whether of not to send keycode sleep for ungaze when Home is the foreground activity on
10898 * watch type devices.
10899 * Type: int (0 for false, 1 for true)
10900 * Default: 0
10901 * @hide
10902 */
10903 public static final String UNGAZE_SLEEP_ENABLED = "ungaze_sleep_enabled";
10904
10905 /**
Ricky Waieef50652017-12-21 16:27:40 +000010906 * Whether or not Network Watchlist feature is enabled.
10907 * Type: int (0 for false, 1 for true)
10908 * Default: 0
10909 * @hide
10910 */
10911 public static final String NETWORK_WATCHLIST_ENABLED = "network_watchlist_enabled";
10912
10913 /**
Robin Lee81ad9722018-01-19 16:34:31 +010010914 * Flag to keep background restricted profiles running after exiting. If disabled,
10915 * the restricted profile can be put into stopped state as soon as the user leaves it.
10916 * Type: int (0 for false, 1 for true)
10917 *
10918 * Overridden by the system based on device information. If null, the value specified
10919 * by {@code config_keepRestrictedProfilesInBackground} is used.
10920 *
10921 * @hide
10922 */
10923 public static final String KEEP_PROFILE_IN_BACKGROUND = "keep_profile_in_background";
10924
10925 /**
Jeff Sharkey0ac10282012-10-01 12:50:22 -070010926 * Get the key that retrieves a bluetooth headset's priority.
10927 * @hide
10928 */
10929 public static final String getBluetoothHeadsetPriorityKey(String address) {
Elliott Hughescb64d432013-08-02 10:00:44 -070010930 return BLUETOOTH_HEADSET_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
Jeff Sharkey0ac10282012-10-01 12:50:22 -070010931 }
10932
10933 /**
10934 * Get the key that retrieves a bluetooth a2dp sink's priority.
10935 * @hide
10936 */
10937 public static final String getBluetoothA2dpSinkPriorityKey(String address) {
Elliott Hughescb64d432013-08-02 10:00:44 -070010938 return BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
Jeff Sharkey0ac10282012-10-01 12:50:22 -070010939 }
10940
10941 /**
Sanket Agarwal1bec6a52015-10-21 18:23:27 -070010942 * Get the key that retrieves a bluetooth a2dp src's priority.
10943 * @hide
10944 */
10945 public static final String getBluetoothA2dpSrcPriorityKey(String address) {
10946 return BLUETOOTH_A2DP_SRC_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
10947 }
10948
10949 /**
Antony Sargentf5772c62017-04-26 16:37:53 -070010950 * Get the key that retrieves a bluetooth a2dp device's ability to support optional codecs.
10951 * @hide
10952 */
10953 public static final String getBluetoothA2dpSupportsOptionalCodecsKey(String address) {
10954 return BLUETOOTH_A2DP_SUPPORTS_OPTIONAL_CODECS_PREFIX +
10955 address.toUpperCase(Locale.ROOT);
10956 }
10957
10958 /**
10959 * Get the key that retrieves whether a bluetooth a2dp device should have optional codecs
10960 * enabled.
10961 * @hide
10962 */
10963 public static final String getBluetoothA2dpOptionalCodecsEnabledKey(String address) {
10964 return BLUETOOTH_A2DP_OPTIONAL_CODECS_ENABLED_PREFIX +
10965 address.toUpperCase(Locale.ROOT);
10966 }
10967
10968 /**
Jeff Sharkey0ac10282012-10-01 12:50:22 -070010969 * Get the key that retrieves a bluetooth Input Device's priority.
10970 * @hide
10971 */
Hansong Zhangc26c76c2017-10-20 15:55:59 -070010972 public static final String getBluetoothHidHostPriorityKey(String address) {
Elliott Hughescb64d432013-08-02 10:00:44 -070010973 return BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
Jeff Sharkey0ac10282012-10-01 12:50:22 -070010974 }
10975
Jeff Sharkey6e2bee72012-10-01 13:39:08 -070010976 /**
Sanket Agarwal773297a2016-08-04 16:16:20 -070010977 * Get the key that retrieves a bluetooth pan client priority.
10978 * @hide
10979 */
10980 public static final String getBluetoothPanPriorityKey(String address) {
10981 return BLUETOOTH_PAN_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
10982 }
10983
10984 /**
Jakub Pawlowskic2d7be62017-11-22 10:57:42 -080010985 * Get the key that retrieves a bluetooth hearing aid priority.
10986 * @hide
10987 */
10988 public static final String getBluetoothHearingAidPriorityKey(String address) {
10989 return BLUETOOTH_HEARING_AID_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
10990 }
10991
10992 /**
Kim Schulz0d376052013-08-22 11:18:02 +020010993 * Get the key that retrieves a bluetooth map priority.
10994 * @hide
10995 */
10996 public static final String getBluetoothMapPriorityKey(String address) {
10997 return BLUETOOTH_MAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
10998 }
Casper Bonde2a5f6082015-03-19 10:36:45 +010010999
11000 /**
Joseph Pirozzo631768d2016-09-01 14:19:28 -070011001 * Get the key that retrieves a bluetooth map client priority.
11002 * @hide
11003 */
11004 public static final String getBluetoothMapClientPriorityKey(String address) {
11005 return BLUETOOTH_MAP_CLIENT_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
11006 }
11007
11008 /**
Joseph Pirozzo563c7002016-03-21 15:49:48 -070011009 * Get the key that retrieves a bluetooth pbap client priority.
11010 * @hide
11011 */
11012 public static final String getBluetoothPbapClientPriorityKey(String address) {
11013 return BLUETOOTH_PBAP_CLIENT_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
11014 }
11015
11016 /**
Joseph Pirozzo631768d2016-09-01 14:19:28 -070011017 * Get the key that retrieves a bluetooth sap priority.
Casper Bonde2a5f6082015-03-19 10:36:45 +010011018 * @hide
11019 */
11020 public static final String getBluetoothSapPriorityKey(String address) {
11021 return BLUETOOTH_SAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
11022 }
11023
Kim Schulz0d376052013-08-22 11:18:02 +020011024 /**
Jeff Sharkey6e2bee72012-10-01 13:39:08 -070011025 * Scaling factor for normal window animations. Setting to 0 will
11026 * disable window animations.
11027 */
11028 public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale";
11029
11030 /**
11031 * Scaling factor for activity transition animations. Setting to 0 will
11032 * disable window animations.
11033 */
11034 public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale";
11035
11036 /**
11037 * Scaling factor for Animator-based animations. This affects both the
11038 * start delay and duration of all such animations. Setting to 0 will
11039 * cause animations to end immediately. The default value is 1.
11040 */
11041 public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale";
11042
11043 /**
11044 * Scaling factor for normal window animations. Setting to 0 will
11045 * disable window animations.
11046 *
11047 * @hide
11048 */
11049 public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations";
11050
11051 /**
11052 * If 0, the compatibility mode is off for all applications.
11053 * If 1, older applications run under compatibility mode.
11054 * TODO: remove this settings before code freeze (bug/1907571)
11055 * @hide
11056 */
11057 public static final String COMPATIBILITY_MODE = "compatibility_mode";
11058
11059 /**
11060 * CDMA only settings
11061 * Emergency Tone 0 = Off
11062 * 1 = Alert
11063 * 2 = Vibrate
11064 * @hide
11065 */
11066 public static final String EMERGENCY_TONE = "emergency_tone";
11067
Michal Karpinski5db1e432018-01-18 20:10:24 +000011068 private static final Validator EMERGENCY_TONE_VALIDATOR =
11069 new SettingsValidators.DiscreteValueValidator(new String[] {"0", "1", "2"});
11070
Jeff Sharkey6e2bee72012-10-01 13:39:08 -070011071 /**
11072 * CDMA only settings
11073 * Whether the auto retry is enabled. The value is
11074 * boolean (1 or 0).
11075 * @hide
11076 */
11077 public static final String CALL_AUTO_RETRY = "call_auto_retry";
11078
Michal Karpinski5db1e432018-01-18 20:10:24 +000011079 private static final Validator CALL_AUTO_RETRY_VALIDATOR = BOOLEAN_VALIDATOR;
11080
Jeff Sharkey6e2bee72012-10-01 13:39:08 -070011081 /**
Selim Cinek705442f2016-09-13 16:02:33 -070011082 * A setting that can be read whether the emergency affordance is currently needed.
11083 * The value is a boolean (1 or 0).
11084 * @hide
11085 */
11086 public static final String EMERGENCY_AFFORDANCE_NEEDED = "emergency_affordance_needed";
11087
11088 /**
Sungmin Choie099ab12014-06-09 14:45:51 +090011089 * See RIL_PreferredNetworkType in ril.h
Jeff Sharkey6e2bee72012-10-01 13:39:08 -070011090 * @hide
11091 */
11092 public static final String PREFERRED_NETWORK_MODE =
11093 "preferred_network_mode";
11094
11095 /**
Jeff Sharkey6e2bee72012-10-01 13:39:08 -070011096 * Name of an application package to be debugged.
11097 */
11098 public static final String DEBUG_APP = "debug_app";
11099
11100 /**
11101 * If 1, when launching DEBUG_APP it will wait for the debugger before
11102 * starting user code. If 0, it will run normally.
11103 */
11104 public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger";
11105
11106 /**
Cody Northrop86cedcb2017-10-20 09:03:13 -060011107 * Allow GPU debug layers?
11108 * 0 = no
11109 * 1 = yes
11110 * @hide
11111 */
11112 public static final String ENABLE_GPU_DEBUG_LAYERS = "enable_gpu_debug_layers";
11113
11114 /**
11115 * App allowed to load GPU debug layers
11116 * @hide
11117 */
11118 public static final String GPU_DEBUG_APP = "gpu_debug_app";
11119
11120 /**
11121 * Ordered GPU debug layer list
11122 * i.e. <layer1>:<layer2>:...:<layerN>
11123 * @hide
11124 */
11125 public static final String GPU_DEBUG_LAYERS = "gpu_debug_layers";
11126
11127 /**
Jeff Sharkey6e2bee72012-10-01 13:39:08 -070011128 * Control whether the process CPU usage meter should be shown.
Nick Kralevichfc4a5c22016-10-11 09:01:38 -070011129 *
11130 * @deprecated This functionality is no longer available as of
11131 * {@link android.os.Build.VERSION_CODES#N_MR1}.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -070011132 */
Nick Kralevichfc4a5c22016-10-11 09:01:38 -070011133 @Deprecated
Jeff Sharkey6e2bee72012-10-01 13:39:08 -070011134 public static final String SHOW_PROCESSES = "show_processes";
11135
11136 /**
Makoto Onukia3cd7b92018-03-19 14:47:05 -070011137 * If 1 low power mode (aka battery saver) is enabled.
Ruchi Kandoi62b8a492014-04-17 18:01:40 -070011138 * @hide
11139 */
Makoto Onukif9046a22018-01-12 10:32:32 -080011140 @TestApi
Ruchi Kandoi62b8a492014-04-17 18:01:40 -070011141 public static final String LOW_POWER_MODE = "low_power";
11142
John Spurlockf8f524c2014-06-10 14:47:29 -040011143 /**
Makoto Onukia3cd7b92018-03-19 14:47:05 -070011144 * If 1, battery saver ({@link #LOW_POWER_MODE}) will be re-activated after the device
11145 * is unplugged from a charger or rebooted.
11146 * @hide
11147 */
11148 @TestApi
11149 public static final String LOW_POWER_MODE_STICKY = "low_power_sticky";
11150
11151 /**
Makoto Onuki45a772e2018-02-01 15:27:53 -080011152 * Battery level [1-100] at which low power mode automatically turns on.
Dianne Hackborn14272302014-06-10 23:13:02 -070011153 * If 0, it will not automatically turn on.
John Spurlockf8f524c2014-06-10 14:47:29 -040011154 * @hide
11155 */
11156 public static final String LOW_POWER_MODE_TRIGGER_LEVEL = "low_power_trigger_level";
11157
Michal Karpinski5db1e432018-01-18 20:10:24 +000011158 private static final Validator LOW_POWER_MODE_TRIGGER_LEVEL_VALIDATOR =
Makoto Onuki45a772e2018-02-01 15:27:53 -080011159 new SettingsValidators.InclusiveIntegerRangeValidator(0, 100);
Michal Karpinski5db1e432018-01-18 20:10:24 +000011160
Makoto Onuki524b4dfe2018-03-06 17:34:15 -080011161
11162 /**
11163 * The max value for {@link #LOW_POWER_MODE_TRIGGER_LEVEL}. If this setting is not set
11164 * or the value is 0, the default max will be used.
11165 *
11166 * @hide
11167 */
11168 public static final String LOW_POWER_MODE_TRIGGER_LEVEL_MAX = "low_power_trigger_level_max";
11169
Makoto Onukibc064d4b2018-03-27 14:48:42 -070011170 /**
11171 * See com.android.settingslib.fuelgauge.BatterySaverUtils.
11172 * @hide
11173 */
11174 public static final String LOW_POWER_MODE_SUGGESTION_PARAMS =
11175 "low_power_mode_suggestion_params";
11176
11177 /**
Dianne Hackbornb2117d12016-02-16 18:26:35 -080011178 * If not 0, the activity manager will aggressively finish activities and
Jeff Sharkey6e2bee72012-10-01 13:39:08 -070011179 * processes as soon as they are no longer needed. If 0, the normal
11180 * extended lifetime is used.
11181 */
Dianne Hackborn89ad4562014-08-24 16:45:38 -070011182 public static final String ALWAYS_FINISH_ACTIVITIES = "always_finish_activities";
Jeff Sharkey6e2bee72012-10-01 13:39:08 -070011183
Christopher Tate66488d62012-10-02 11:58:01 -070011184 /**
Dianne Hackborn82b17ca2018-04-06 16:00:08 -070011185 * If nonzero, all system error dialogs will be hidden. For example, the
11186 * crash and ANR dialogs will not be shown, and the system will just proceed
11187 * as if they had been accepted by the user.
11188 * @hide
11189 */
11190 public static final String HIDE_ERROR_DIALOGS = "hide_error_dialogs";
11191
11192 /**
Eric Laurent7ee1e4f2012-10-26 18:11:21 -070011193 * Use Dock audio output for media:
11194 * 0 = disabled
11195 * 1 = enabled
11196 * @hide
11197 */
11198 public static final String DOCK_AUDIO_MEDIA_ENABLED = "dock_audio_media_enabled";
11199
Michal Karpinski5db1e432018-01-18 20:10:24 +000011200 private static final Validator DOCK_AUDIO_MEDIA_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
11201
Eric Laurent7ee1e4f2012-10-26 18:11:21 -070011202 /**
Phil Burkdeaa8d92016-02-23 17:12:04 -080011203 * The surround sound formats AC3, DTS or IEC61937 are
11204 * available for use if they are detected.
11205 * This is the default mode.
11206 *
11207 * Note that AUTO is equivalent to ALWAYS for Android TVs and other
11208 * devices that have an S/PDIF output. This is because S/PDIF
11209 * is unidirectional and the TV cannot know if a decoder is
11210 * connected. So it assumes they are always available.
11211 * @hide
11212 */
11213 public static final int ENCODED_SURROUND_OUTPUT_AUTO = 0;
11214
11215 /**
11216 * AC3, DTS or IEC61937 are NEVER available, even if they
11217 * are detected by the hardware. Those formats will not be
11218 * reported.
11219 *
11220 * An example use case would be an AVR reports that it is capable of
11221 * surround sound decoding but is broken. If NEVER is chosen
11222 * then apps must use PCM output instead of encoded output.
11223 * @hide
11224 */
11225 public static final int ENCODED_SURROUND_OUTPUT_NEVER = 1;
11226
11227 /**
11228 * AC3, DTS or IEC61937 are ALWAYS available, even if they
11229 * are not detected by the hardware. Those formats will be
11230 * reported as part of the HDMI output capability. Applications
11231 * are then free to use either PCM or encoded output.
11232 *
11233 * An example use case would be a when TV was connected over
11234 * TOS-link to an AVR. But the TV could not see it because TOS-link
11235 * is unidirectional.
11236 * @hide
11237 */
11238 public static final int ENCODED_SURROUND_OUTPUT_ALWAYS = 2;
11239
11240 /**
11241 * Set to ENCODED_SURROUND_OUTPUT_AUTO,
11242 * ENCODED_SURROUND_OUTPUT_NEVER or
11243 * ENCODED_SURROUND_OUTPUT_ALWAYS
11244 * @hide
11245 */
11246 public static final String ENCODED_SURROUND_OUTPUT = "encoded_surround_output";
11247
Michal Karpinski5db1e432018-01-18 20:10:24 +000011248 private static final Validator ENCODED_SURROUND_OUTPUT_VALIDATOR =
11249 new SettingsValidators.DiscreteValueValidator(new String[] {"0", "1", "2"});
11250
Phil Burkdeaa8d92016-02-23 17:12:04 -080011251 /**
Eric Laurent05274f32012-11-29 12:48:18 -080011252 * Persisted safe headphone volume management state by AudioService
11253 * @hide
11254 */
11255 public static final String AUDIO_SAFE_VOLUME_STATE = "audio_safe_volume_state";
11256
11257 /**
Geremy Condraa0735112013-03-26 21:49:26 -070011258 * URL for tzinfo (time zone) updates
11259 * @hide
11260 */
11261 public static final String TZINFO_UPDATE_CONTENT_URL = "tzinfo_content_url";
11262
11263 /**
11264 * URL for tzinfo (time zone) update metadata
11265 * @hide
11266 */
11267 public static final String TZINFO_UPDATE_METADATA_URL = "tzinfo_metadata_url";
11268
11269 /**
11270 * URL for selinux (mandatory access control) updates
11271 * @hide
11272 */
11273 public static final String SELINUX_UPDATE_CONTENT_URL = "selinux_content_url";
11274
11275 /**
11276 * URL for selinux (mandatory access control) update metadata
11277 * @hide
11278 */
11279 public static final String SELINUX_UPDATE_METADATA_URL = "selinux_metadata_url";
11280
11281 /**
11282 * URL for sms short code updates
11283 * @hide
11284 */
11285 public static final String SMS_SHORT_CODES_UPDATE_CONTENT_URL =
11286 "sms_short_codes_content_url";
11287
11288 /**
11289 * URL for sms short code update metadata
11290 * @hide
11291 */
11292 public static final String SMS_SHORT_CODES_UPDATE_METADATA_URL =
11293 "sms_short_codes_metadata_url";
11294
11295 /**
Amit Mahajan9069fab2015-05-01 11:05:47 -070011296 * URL for apn_db updates
11297 * @hide
11298 */
11299 public static final String APN_DB_UPDATE_CONTENT_URL = "apn_db_content_url";
11300
11301 /**
11302 * URL for apn_db update metadata
11303 * @hide
11304 */
11305 public static final String APN_DB_UPDATE_METADATA_URL = "apn_db_metadata_url";
11306
11307 /**
Geremy Condraa0735112013-03-26 21:49:26 -070011308 * URL for cert pinlist updates
11309 * @hide
11310 */
11311 public static final String CERT_PIN_UPDATE_CONTENT_URL = "cert_pin_content_url";
11312
11313 /**
11314 * URL for cert pinlist updates
11315 * @hide
11316 */
11317 public static final String CERT_PIN_UPDATE_METADATA_URL = "cert_pin_metadata_url";
11318
Geremy Condra757ee522013-03-29 16:39:45 -070011319 /**
Ben Gruver633dc9b2013-04-04 12:05:49 -070011320 * URL for intent firewall updates
11321 * @hide
11322 */
11323 public static final String INTENT_FIREWALL_UPDATE_CONTENT_URL =
11324 "intent_firewall_content_url";
11325
11326 /**
11327 * URL for intent firewall update metadata
11328 * @hide
11329 */
11330 public static final String INTENT_FIREWALL_UPDATE_METADATA_URL =
11331 "intent_firewall_metadata_url";
11332
11333 /**
Abodunrinwa Toki51c42032017-04-02 19:16:01 +010011334 * URL for lang id model updates
11335 * @hide
11336 */
11337 public static final String LANG_ID_UPDATE_CONTENT_URL = "lang_id_content_url";
11338
11339 /**
11340 * URL for lang id model update metadata
11341 * @hide
11342 */
11343 public static final String LANG_ID_UPDATE_METADATA_URL = "lang_id_metadata_url";
11344
11345 /**
Abodunrinwa Tokibb957d12017-04-12 14:40:46 +010011346 * URL for smart selection model updates
11347 * @hide
11348 */
11349 public static final String SMART_SELECTION_UPDATE_CONTENT_URL =
11350 "smart_selection_content_url";
11351
11352 /**
11353 * URL for smart selection model update metadata
11354 * @hide
11355 */
11356 public static final String SMART_SELECTION_UPDATE_METADATA_URL =
11357 "smart_selection_metadata_url";
11358
11359 /**
Geremy Condra4e7f7e82013-03-26 21:09:01 -070011360 * SELinux enforcement status. If 0, permissive; if 1, enforcing.
11361 * @hide
11362 */
11363 public static final String SELINUX_STATUS = "selinux_status";
11364
Geremy Condraa0735112013-03-26 21:49:26 -070011365 /**
Amith Yamasanid8415f42013-08-07 20:15:10 -070011366 * Developer setting to force RTL layout.
11367 * @hide
11368 */
11369 public static final String DEVELOPMENT_FORCE_RTL = "debug.force_rtl";
11370
11371 /**
Daniel Sandlerdea64622013-09-23 16:05:57 -040011372 * Milliseconds after screen-off after which low battery sounds will be silenced.
11373 *
11374 * If zero, battery sounds will always play.
11375 * Defaults to @integer/def_low_battery_sound_timeout in SettingsProvider.
11376 *
11377 * @hide
11378 */
11379 public static final String LOW_BATTERY_SOUND_TIMEOUT = "low_battery_sound_timeout";
11380
11381 /**
Evan Charltoncc7b0432014-01-14 14:47:11 -080011382 * Milliseconds to wait before bouncing Wi-Fi after settings is restored. Note that after
Dianne Hackborna3fb40d2014-08-12 15:06:50 -070011383 * the caller is done with this, they should call {@link ContentResolver#delete} to
Evan Charltoncc7b0432014-01-14 14:47:11 -080011384 * clean up any value that they may have written.
11385 *
11386 * @hide
11387 */
11388 public static final String WIFI_BOUNCE_DELAY_OVERRIDE_MS = "wifi_bounce_delay_override_ms";
11389
John Spurlockc6d1c602014-01-17 15:22:06 -050011390 /**
11391 * Defines global runtime overrides to window policy.
11392 *
Jorim Jaggib10e33f2015-02-04 21:57:40 +010011393 * See {@link com.android.server.policy.PolicyControl} for value format.
John Spurlockc6d1c602014-01-17 15:22:06 -050011394 *
11395 * @hide
11396 */
11397 public static final String POLICY_CONTROL = "policy_control";
Evan Charltoncc7b0432014-01-14 14:47:11 -080011398
11399 /**
Adrian Roos000cf5e2017-11-10 15:55:18 +010011400 * {@link android.view.DisplayCutout DisplayCutout} emulation mode.
11401 *
11402 * @hide
11403 */
11404 public static final String EMULATE_DISPLAY_CUTOUT = "emulate_display_cutout";
11405
11406 /** @hide */ public static final int EMULATE_DISPLAY_CUTOUT_OFF = 0;
11407 /** @hide */ public static final int EMULATE_DISPLAY_CUTOUT_ON = 1;
11408
11409 /**
John Spurlockae641c92014-06-30 18:11:40 -040011410 * Defines global zen mode. ZEN_MODE_OFF, ZEN_MODE_IMPORTANT_INTERRUPTIONS,
11411 * or ZEN_MODE_NO_INTERRUPTIONS.
John Spurlocke677d712014-02-13 12:52:19 -050011412 *
11413 * @hide
11414 */
11415 public static final String ZEN_MODE = "zen_mode";
11416
11417 /** @hide */ public static final int ZEN_MODE_OFF = 0;
John Spurlockae641c92014-06-30 18:11:40 -040011418 /** @hide */ public static final int ZEN_MODE_IMPORTANT_INTERRUPTIONS = 1;
11419 /** @hide */ public static final int ZEN_MODE_NO_INTERRUPTIONS = 2;
John Spurlock4f1163c2015-04-02 17:41:21 -040011420 /** @hide */ public static final int ZEN_MODE_ALARMS = 3;
John Spurlocke677d712014-02-13 12:52:19 -050011421
11422 /** @hide */ public static String zenModeToString(int mode) {
John Spurlockae641c92014-06-30 18:11:40 -040011423 if (mode == ZEN_MODE_IMPORTANT_INTERRUPTIONS) return "ZEN_MODE_IMPORTANT_INTERRUPTIONS";
John Spurlock4f1163c2015-04-02 17:41:21 -040011424 if (mode == ZEN_MODE_ALARMS) return "ZEN_MODE_ALARMS";
John Spurlockae641c92014-06-30 18:11:40 -040011425 if (mode == ZEN_MODE_NO_INTERRUPTIONS) return "ZEN_MODE_NO_INTERRUPTIONS";
11426 return "ZEN_MODE_OFF";
John Spurlocke677d712014-02-13 12:52:19 -050011427 }
11428
John Spurlockb2278d62015-04-07 12:47:12 -040011429 /** @hide */ public static boolean isValidZenMode(int value) {
11430 switch (value) {
11431 case Global.ZEN_MODE_OFF:
11432 case Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS:
11433 case Global.ZEN_MODE_ALARMS:
11434 case Global.ZEN_MODE_NO_INTERRUPTIONS:
11435 return true;
11436 default:
11437 return false;
11438 }
11439 }
11440
John Spurlocke677d712014-02-13 12:52:19 -050011441 /**
Julia Reynolds9b11fdb2015-07-31 09:49:55 -040011442 * Value of the ringer before entering zen mode.
11443 *
11444 * @hide
11445 */
11446 public static final String ZEN_MODE_RINGER_LEVEL = "zen_mode_ringer_level";
11447
11448 /**
John Spurlock056c5192014-04-20 21:52:01 -040011449 * Opaque value, changes when persisted zen mode configuration changes.
11450 *
11451 * @hide
11452 */
11453 public static final String ZEN_MODE_CONFIG_ETAG = "zen_mode_config_etag";
11454
11455 /**
Beverly09da25f2018-02-26 09:17:07 -050011456 * If 0, turning on dnd manually will last indefinitely.
11457 * Else if non-negative, turning on dnd manually will last for this many minutes.
11458 * Else (if negative), turning on dnd manually will surface a dialog that prompts
11459 * user to specify a duration.
11460 * @hide
11461 */
11462 public static final String ZEN_DURATION = "zen_duration";
11463
11464 private static final Validator ZEN_DURATION_VALIDATOR = ANY_INTEGER_VALIDATOR;
11465
11466 /** @hide */ public static final int ZEN_DURATION_PROMPT = -1;
11467 /** @hide */ public static final int ZEN_DURATION_FOREVER = 0;
11468
11469 /**
Chris Wren7bd241232014-02-28 16:25:05 -050011470 * Defines global heads up toggle. One of HEADS_UP_OFF, HEADS_UP_ON.
11471 *
11472 * @hide
11473 */
Chris Wren10d82df2014-03-01 10:34:51 -050011474 public static final String HEADS_UP_NOTIFICATIONS_ENABLED =
11475 "heads_up_notifications_enabled";
Chris Wren7bd241232014-02-28 16:25:05 -050011476
11477 /** @hide */ public static final int HEADS_UP_OFF = 0;
11478 /** @hide */ public static final int HEADS_UP_ON = 1;
11479
11480 /**
Jerome Poichet147b4d72014-05-12 18:13:27 -070011481 * The name of the device
Jerome Poichet147b4d72014-05-12 18:13:27 -070011482 */
11483 public static final String DEVICE_NAME = "device_name";
11484
11485 /**
Jeff Davidson56f9f732014-08-14 16:47:23 -070011486 * Whether the NetworkScoringService has been first initialized.
11487 * <p>
11488 * Type: int (0 for false, 1 for true)
11489 * @hide
11490 */
11491 public static final String NETWORK_SCORING_PROVISIONED = "network_scoring_provisioned";
11492
11493 /**
Jim Miller6848dc82014-10-13 18:51:53 -070011494 * Whether the user wants to be prompted for password to decrypt the device on boot.
11495 * This only matters if the storage is encrypted.
11496 * <p>
11497 * Type: int (0 for false, 1 for true)
11498 * @hide
11499 */
11500 public static final String REQUIRE_PASSWORD_TO_DECRYPT = "require_password_to_decrypt";
11501
11502 /**
manabu, shimoda14723e32017-10-06 14:39:01 +090011503 * Whether the Volte is enabled. If this setting is not set then we use the Carrier Config
11504 * value {@link CarrierConfigManager#KEY_ENHANCED_4G_LTE_ON_BY_DEFAULT_BOOL}.
Libin.Tang@motorola.com0499bb52014-10-10 14:55:57 -050011505 * <p>
11506 * Type: int (0 for false, 1 for true)
11507 * @hide
Malcolm Chenc66dee92017-09-26 14:45:40 -070011508 * @deprecated Use {@link android.telephony.SubscriptionManager#ENHANCED_4G_MODE_ENABLED}
11509 * instead.
Libin.Tang@motorola.com0499bb52014-10-10 14:55:57 -050011510 */
Malcolm Chenc66dee92017-09-26 14:45:40 -070011511 @Deprecated
11512 public static final String ENHANCED_4G_MODE_ENABLED =
11513 SubscriptionManager.ENHANCED_4G_MODE_ENABLED;
Libin.Tang@motorola.com0499bb52014-10-10 14:55:57 -050011514
11515 /**
Etan Cohen93bbf272015-05-04 18:01:47 -070011516 * Whether VT (Video Telephony over IMS) is enabled
11517 * <p>
11518 * Type: int (0 for false, 1 for true)
11519 *
11520 * @hide
Malcolm Chenc66dee92017-09-26 14:45:40 -070011521 * @deprecated Use {@link android.telephony.SubscriptionManager#VT_IMS_ENABLED} instead.
Etan Cohen93bbf272015-05-04 18:01:47 -070011522 */
Malcolm Chenc66dee92017-09-26 14:45:40 -070011523 @Deprecated
11524 public static final String VT_IMS_ENABLED = SubscriptionManager.VT_IMS_ENABLED;
Etan Cohen93bbf272015-05-04 18:01:47 -070011525
11526 /**
Etan Cohen9c8f21b2014-12-23 15:02:19 -080011527 * Whether WFC is enabled
11528 * <p>
11529 * Type: int (0 for false, 1 for true)
11530 *
11531 * @hide
Malcolm Chenc66dee92017-09-26 14:45:40 -070011532 * @deprecated Use {@link android.telephony.SubscriptionManager#WFC_IMS_ENABLED} instead.
Etan Cohen9c8f21b2014-12-23 15:02:19 -080011533 */
Malcolm Chenc66dee92017-09-26 14:45:40 -070011534 @Deprecated
11535 public static final String WFC_IMS_ENABLED = SubscriptionManager.WFC_IMS_ENABLED;
Etan Cohen9c8f21b2014-12-23 15:02:19 -080011536
11537 /**
Meng Wang2c25e4a2016-09-19 14:18:05 -070011538 * WFC mode on home/non-roaming network.
Etan Cohen9c8f21b2014-12-23 15:02:19 -080011539 * <p>
11540 * Type: int - 2=Wi-Fi preferred, 1=Cellular preferred, 0=Wi-Fi only
11541 *
11542 * @hide
Malcolm Chenc66dee92017-09-26 14:45:40 -070011543 * @deprecated Use {@link android.telephony.SubscriptionManager#WFC_IMS_MODE} instead.
Etan Cohen9c8f21b2014-12-23 15:02:19 -080011544 */
Malcolm Chenc66dee92017-09-26 14:45:40 -070011545 @Deprecated
11546 public static final String WFC_IMS_MODE = SubscriptionManager.WFC_IMS_MODE;
Etan Cohen9c8f21b2014-12-23 15:02:19 -080011547
11548 /**
Meng Wang2c25e4a2016-09-19 14:18:05 -070011549 * WFC mode on roaming network.
11550 * <p>
Dianne Hackborn0ef403e2017-01-24 18:22:15 -080011551 * Type: int - see {@link #WFC_IMS_MODE} for values
Meng Wang2c25e4a2016-09-19 14:18:05 -070011552 *
11553 * @hide
Malcolm Chenc66dee92017-09-26 14:45:40 -070011554 * @deprecated Use {@link android.telephony.SubscriptionManager#WFC_IMS_ROAMING_MODE}
11555 * instead.
Meng Wang2c25e4a2016-09-19 14:18:05 -070011556 */
Malcolm Chenc66dee92017-09-26 14:45:40 -070011557 @Deprecated
11558 public static final String WFC_IMS_ROAMING_MODE = SubscriptionManager.WFC_IMS_ROAMING_MODE;
Meng Wang2c25e4a2016-09-19 14:18:05 -070011559
11560 /**
Etan Cohen9c8f21b2014-12-23 15:02:19 -080011561 * Whether WFC roaming is enabled
11562 * <p>
11563 * Type: int (0 for false, 1 for true)
11564 *
11565 * @hide
Malcolm Chenc66dee92017-09-26 14:45:40 -070011566 * @deprecated Use {@link android.telephony.SubscriptionManager#WFC_IMS_ROAMING_ENABLED}
11567 * instead
Etan Cohen9c8f21b2014-12-23 15:02:19 -080011568 */
Malcolm Chenc66dee92017-09-26 14:45:40 -070011569 @Deprecated
11570 public static final String WFC_IMS_ROAMING_ENABLED =
11571 SubscriptionManager.WFC_IMS_ROAMING_ENABLED;
Etan Cohen9c8f21b2014-12-23 15:02:19 -080011572
11573 /**
Amit Mahajan4fea0922014-11-18 12:56:28 -080011574 * Whether user can enable/disable LTE as a preferred network. A carrier might control
11575 * this via gservices, OMA-DM, carrier app, etc.
11576 * <p>
11577 * Type: int (0 for false, 1 for true)
11578 * @hide
11579 */
11580 public static final String LTE_SERVICE_FORCED = "lte_service_forced";
11581
11582 /**
Svet Ganov2acf0632015-11-24 19:10:59 -080011583 * Ephemeral app cookie max size in bytes.
11584 * <p>
11585 * Type: int
11586 * @hide
11587 */
11588 public static final String EPHEMERAL_COOKIE_MAX_SIZE_BYTES =
11589 "ephemeral_cookie_max_size_bytes";
11590
11591 /**
Todd Kennedyd15bb752016-09-13 16:38:31 -070011592 * Toggle to enable/disable the entire ephemeral feature. By default, ephemeral is
11593 * enabled. Set to zero to disable.
11594 * <p>
11595 * Type: int (0 for false, 1 for true)
11596 *
11597 * @hide
11598 */
11599 public static final String ENABLE_EPHEMERAL_FEATURE = "enable_ephemeral_feature";
11600
11601 /**
Todd Kennedy133c5da2017-06-15 09:44:34 -070011602 * Toggle to enable/disable dexopt for instant applications. The default is for dexopt
11603 * to be disabled.
11604 * <p>
11605 * Type: int (0 to disable, 1 to enable)
11606 *
11607 * @hide
11608 */
11609 public static final String INSTANT_APP_DEXOPT_ENABLED = "instant_app_dexopt_enabled";
11610
11611 /**
Svet Ganovf36d53c2017-05-24 00:27:21 -070011612 * The min period for caching installed instant apps in milliseconds.
Svet Ganov2acf0632015-11-24 19:10:59 -080011613 * <p>
11614 * Type: long
11615 * @hide
11616 */
Svet Ganovf36d53c2017-05-24 00:27:21 -070011617 public static final String INSTALLED_INSTANT_APP_MIN_CACHE_PERIOD =
11618 "installed_instant_app_min_cache_period";
11619
11620 /**
11621 * The max period for caching installed instant apps in milliseconds.
11622 * <p>
11623 * Type: long
11624 * @hide
11625 */
11626 public static final String INSTALLED_INSTANT_APP_MAX_CACHE_PERIOD =
11627 "installed_instant_app_max_cache_period";
11628
11629 /**
11630 * The min period for caching uninstalled instant apps in milliseconds.
11631 * <p>
11632 * Type: long
11633 * @hide
11634 */
11635 public static final String UNINSTALLED_INSTANT_APP_MIN_CACHE_PERIOD =
11636 "uninstalled_instant_app_min_cache_period";
11637
11638 /**
11639 * The max period for caching uninstalled instant apps in milliseconds.
11640 * <p>
11641 * Type: long
11642 * @hide
11643 */
11644 public static final String UNINSTALLED_INSTANT_APP_MAX_CACHE_PERIOD =
11645 "uninstalled_instant_app_max_cache_period";
11646
11647 /**
11648 * The min period for caching unused static shared libs in milliseconds.
11649 * <p>
11650 * Type: long
11651 * @hide
11652 */
11653 public static final String UNUSED_STATIC_SHARED_LIB_MIN_CACHE_PERIOD =
11654 "unused_static_shared_lib_min_cache_period";
Svet Ganov2acf0632015-11-24 19:10:59 -080011655
11656 /**
Fyodor Kupolov07140f72016-02-17 10:46:11 -080011657 * Allows switching users when system user is locked.
11658 * <p>
11659 * Type: int
11660 * @hide
11661 */
11662 public static final String ALLOW_USER_SWITCHING_WHEN_SYSTEM_USER_LOCKED =
11663 "allow_user_switching_when_system_user_locked";
11664
11665 /**
Kenny Guyc4db5ca2017-09-21 11:40:44 +010011666 * Boot count since the device starts running API level 24.
Daichi Hirono82ab9802016-03-02 13:23:29 +090011667 * <p>
11668 * Type: int
11669 */
11670 public static final String BOOT_COUNT = "boot_count";
11671
11672 /**
Lenka Trochtova6474f0e2016-03-24 16:43:10 +010011673 * Whether the safe boot is disallowed.
11674 *
11675 * <p>This setting should have the identical value as the corresponding user restriction.
11676 * The purpose of the setting is to make the restriction available in early boot stages
11677 * before the user restrictions are loaded.
11678 * @hide
11679 */
11680 public static final String SAFE_BOOT_DISALLOWED = "safe_boot_disallowed";
11681
11682 /**
Amith Yamasanieb437d42016-04-29 09:31:25 -070011683 * Whether this device is currently in retail demo mode. If true, device
11684 * usage is severely limited.
11685 * <p>
11686 * Type: int (0 for false, 1 for true)
11687 * @hide
11688 */
11689 public static final String DEVICE_DEMO_MODE = "device_demo_mode";
11690
11691 /**
Sudheer Shanka5918c672017-03-21 19:31:37 -070011692 * Indicates the maximum time that an app is blocked for the network rules to get updated.
11693 *
11694 * Type: long
11695 *
11696 * @hide
11697 */
11698 public static final String NETWORK_ACCESS_TIMEOUT_MS = "network_access_timeout_ms";
11699
11700 /**
Svetoslav Ganov264c7a92016-08-24 17:31:14 -070011701 * The reason for the settings database being downgraded. This is only for
11702 * troubleshooting purposes and its value should not be interpreted in any way.
11703 *
11704 * Type: string
11705 *
11706 * @hide
11707 */
11708 public static final String DATABASE_DOWNGRADE_REASON = "database_downgrade_reason";
11709
11710 /**
Amith Yamasani39452022017-03-21 15:23:47 -070011711 * The build id of when the settings database was first created (or re-created due it
11712 * being missing).
11713 *
11714 * Type: string
11715 *
11716 * @hide
11717 */
11718 public static final String DATABASE_CREATION_BUILDID = "database_creation_buildid";
11719
11720 /**
Suprabh Shukla502fd882016-09-30 15:06:00 -070011721 * Flag to toggle journal mode WAL on or off for the contacts database. WAL is enabled by
11722 * default. Set to 0 to disable.
11723 *
11724 * @hide
11725 */
11726 public static final String CONTACTS_DATABASE_WAL_ENABLED = "contacts_database_wal_enabled";
11727
11728 /**
songchenxi825f69a2017-01-19 14:18:41 -080011729 * Flag to enable the link to location permissions in location setting. Set to 0 to disable.
11730 *
11731 * @hide
11732 */
11733 public static final String LOCATION_SETTINGS_LINK_TO_PERMISSIONS_ENABLED =
11734 "location_settings_link_to_permissions_enabled";
11735
11736 /**
qingxi0ca328f2017-05-19 15:20:03 -070011737 * Flag to set the waiting time for euicc factory reset inside System > Settings
11738 * Type: long
11739 *
11740 * @hide
11741 */
qingxi2f231512017-06-23 15:32:53 -070011742 public static final String EUICC_FACTORY_RESET_TIMEOUT_MILLIS =
11743 "euicc_factory_reset_timeout_millis";
qingxi0ca328f2017-05-19 15:20:03 -070011744
11745 /**
Daniel Nishi5782b5c2017-08-24 10:28:52 -070011746 * Flag to set the timeout for when to refresh the storage settings cached data.
11747 * Type: long
11748 *
11749 * @hide
11750 */
11751 public static final String STORAGE_SETTINGS_CLOBBER_THRESHOLD =
11752 "storage_settings_clobber_threshold";
11753
11754 /**
Makoto Onuki0000d322017-11-28 16:31:47 -080011755 * If set to 1, {@link Secure#LOCATION_MODE} will be set to {@link Secure#LOCATION_MODE_OFF}
11756 * temporarily for all users.
11757 *
11758 * @hide
11759 */
Makoto Onuki8e498252018-01-22 17:00:00 -080011760 @TestApi
Makoto Onuki0000d322017-11-28 16:31:47 -080011761 public static final String LOCATION_GLOBAL_KILL_SWITCH =
11762 "location_global_kill_switch";
11763
11764 /**
Michal Karpinskib52575c2018-01-19 17:38:45 +000011765 * If set to 1, SettingsProvider's restoreAnyVersion="true" attribute will be ignored
11766 * and restoring to lower version of platform API will be skipped.
11767 *
11768 * @hide
11769 */
11770 public static final String OVERRIDE_SETTINGS_PROVIDER_RESTORE_ANY_VERSION =
11771 "override_settings_provider_restore_any_version";
Narayan Kamath8d828252018-01-11 15:22:37 +000011772 /**
11773 * Flag to toggle whether system services report attribution chains when they attribute
11774 * battery use via a {@code WorkSource}.
11775 *
11776 * Type: int (0 to disable, 1 to enable)
11777 *
11778 * @hide
11779 */
11780 public static final String CHAINED_BATTERY_ATTRIBUTION_ENABLED =
11781 "chained_battery_attribution_enabled";
Michal Karpinskib52575c2018-01-19 17:38:45 +000011782
11783 /**
Svetoslav Ganova6ebff0f02018-02-14 14:07:02 -080011784 * The packages whitelisted to be run in autofill compatibility mode. The list
Felipe Leme1c7eb0c2018-03-09 14:13:18 -080011785 * of packages is {@code ":"} colon delimited, and each entry has the name of the
11786 * package and an optional list of url bar resource ids (the list is delimited by
11787 * brackets&mdash{@code [} and {@code ]}&mdash and is also comma delimited).
11788 *
11789 * <p>For example, a list with 3 packages {@code p1}, {@code p2}, and {@code p3}, where
11790 * package {@code p1} have one id ({@code url_bar}, {@code p2} has none, and {@code p3 }
11791 * have 2 ids {@code url_foo} and {@code url_bas}) would be
11792 * {@code p1[url_bar]:p2:p3[url_foo,url_bas]}
Svetoslav Ganov24c90452017-12-27 15:17:14 -080011793 *
11794 * @hide
11795 */
11796 @SystemApi
Svet Ganov47b37aa2018-02-16 00:11:39 -080011797 @TestApi
Felipe Lemefd4003b2018-03-20 17:12:17 -070011798 public static final String AUTOFILL_COMPAT_MODE_ALLOWED_PACKAGES =
11799 "autofill_compat_mode_allowed_packages";
Svetoslav Ganov24c90452017-12-27 15:17:14 -080011800
11801 /**
Mathew Inwood169cb3b2018-02-08 12:23:59 +000011802 * Exemptions to the hidden API blacklist.
11803 *
11804 * @hide
11805 */
Mathew Inwood5518c752018-02-27 16:36:11 +000011806 @TestApi
Mathew Inwood169cb3b2018-02-08 12:23:59 +000011807 public static final String HIDDEN_API_BLACKLIST_EXEMPTIONS =
11808 "hidden_api_blacklist_exemptions";
11809
11810 /**
Mathew Inwood04194fe2018-04-04 14:48:03 +010011811 * Sampling rate for hidden API access event logs, as an integer in the range 0 to 0x10000
11812 * inclusive.
11813 *
11814 * @hide
11815 */
11816 public static final String HIDDEN_API_ACCESS_LOG_SAMPLING_RATE =
11817 "hidden_api_access_log_sampling_rate";
11818
11819 /**
Mathew Inwood1ab30252018-04-03 14:47:26 +010011820 * Hidden API enforcement policy for apps targeting SDK versions prior to the latest
11821 * version.
11822 *
11823 * Values correspond to @{@link
11824 * android.content.pm.ApplicationInfo.HiddenApiEnforcementPolicy}
11825 *
11826 * @hide
11827 */
11828 public static final String HIDDEN_API_POLICY_PRE_P_APPS =
11829 "hidden_api_policy_pre_p_apps";
11830
11831 /**
11832 * Hidden API enforcement policy for apps targeting the current SDK version.
11833 *
11834 * Values correspond to @{@link
11835 * android.content.pm.ApplicationInfo.HiddenApiEnforcementPolicy}
11836 *
11837 * @hide
11838 */
11839 public static final String HIDDEN_API_POLICY_P_APPS =
11840 "hidden_api_policy_p_apps";
11841
11842 /**
Philip P. Moltmann18e3eb82018-03-09 16:55:55 -080011843 * Timeout for a single {@link android.media.soundtrigger.SoundTriggerDetectionService}
11844 * operation (in ms).
11845 *
11846 * @hide
11847 */
11848 public static final String SOUND_TRIGGER_DETECTION_SERVICE_OP_TIMEOUT =
11849 "sound_trigger_detection_service_op_timeout";
11850
11851 /**
11852 * Maximum number of {@link android.media.soundtrigger.SoundTriggerDetectionService}
11853 * operations per day.
11854 *
11855 * @hide
11856 */
11857 public static final String MAX_SOUND_TRIGGER_DETECTION_SERVICE_OPS_PER_DAY =
11858 "max_sound_trigger_detection_service_ops_per_day";
11859
11860 /**
Christopher Tate66488d62012-10-02 11:58:01 -070011861 * Settings to backup. This is here so that it's in the same place as the settings
11862 * keys and easy to update.
11863 *
11864 * These keys may be mentioned in the SETTINGS_TO_BACKUP arrays in System
11865 * and Secure as well. This is because those tables drive both backup and
11866 * restore, and restore needs to properly whitelist keys that used to live
11867 * in those namespaces. The keys will only actually be backed up / restored
11868 * if they are also mentioned in this table (Global.SETTINGS_TO_BACKUP).
11869 *
11870 * NOTE: Settings are backed up and restored in the order they appear
11871 * in this array. If you have one setting depending on another,
11872 * make sure that they are ordered appropriately.
11873 *
11874 * @hide
11875 */
11876 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate58f41ec2013-01-11 15:40:36 -080011877 BUGREPORT_IN_POWER_MENU,
Christopher Tate66488d62012-10-02 11:58:01 -070011878 STAY_ON_WHILE_PLUGGED_IN,
jackqdyulei3cd42a02018-02-27 11:18:00 -080011879 APP_AUTO_RESTRICTION_ENABLED,
Christopher Tate66488d62012-10-02 11:58:01 -070011880 AUTO_TIME,
11881 AUTO_TIME_ZONE,
11882 POWER_SOUNDS_ENABLED,
11883 DOCK_SOUNDS_ENABLED,
Ritesh Reddyf8f12132015-11-20 16:43:28 +000011884 CHARGING_SOUNDS_ENABLED,
Christopher Tate66488d62012-10-02 11:58:01 -070011885 USB_MASS_STORAGE_ENABLED,
Stephen Chen42f5f292017-01-20 11:24:08 -080011886 NETWORK_RECOMMENDATIONS_ENABLED,
Stephen Chen42f5f292017-01-20 11:24:08 -080011887 WIFI_WAKEUP_ENABLED,
Christopher Tate66488d62012-10-02 11:58:01 -070011888 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
Glen Kuhne22ae9d52017-11-28 14:06:25 -080011889 WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON,
Amin Shaikhbc9a8e62017-02-02 15:39:12 -080011890 USE_OPEN_WIFI_PACKAGE,
Christopher Tate16eb7cd2012-10-09 15:26:30 -070011891 WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED,
Christopher Tate66488d62012-10-02 11:58:01 -070011892 EMERGENCY_TONE,
11893 CALL_AUTO_RETRY,
Amith Yamasani94005242014-10-31 11:35:13 -070011894 DOCK_AUDIO_MEDIA_ENABLED,
Phil Burkdeaa8d92016-02-23 17:12:04 -080011895 ENCODED_SURROUND_OUTPUT,
Stanley Tng767f05f2017-05-01 21:27:31 -070011896 LOW_POWER_MODE_TRIGGER_LEVEL,
Erik Kline4d092232017-10-30 15:29:44 +090011897 BLUETOOTH_ON,
11898 PRIVATE_DNS_MODE,
Mehdi Alizadehdcc0da22017-11-10 15:37:13 -080011899 PRIVATE_DNS_SPECIFIER,
Beverly09da25f2018-02-26 09:17:07 -050011900 SOFT_AP_TIMEOUT_ENABLED,
11901 ZEN_DURATION,
Christopher Tate66488d62012-10-02 11:58:01 -070011902 };
11903
Makoto Onuki53f0e022017-11-29 13:51:01 -080011904 /**
Michal Karpinski5db1e432018-01-18 20:10:24 +000011905 * All settings in {@link SETTINGS_TO_BACKUP} array *must* have a non-null validator,
11906 * otherwise they won't be restored.
11907 *
11908 * @hide
11909 */
11910 public static final Map<String, Validator> VALIDATORS = new ArrayMap<>();
11911 static {
11912 VALIDATORS.put(BUGREPORT_IN_POWER_MENU, BUGREPORT_IN_POWER_MENU_VALIDATOR);
11913 VALIDATORS.put(STAY_ON_WHILE_PLUGGED_IN, STAY_ON_WHILE_PLUGGED_IN_VALIDATOR);
11914 VALIDATORS.put(AUTO_TIME, AUTO_TIME_VALIDATOR);
11915 VALIDATORS.put(AUTO_TIME_ZONE, AUTO_TIME_ZONE_VALIDATOR);
11916 VALIDATORS.put(POWER_SOUNDS_ENABLED, POWER_SOUNDS_ENABLED_VALIDATOR);
11917 VALIDATORS.put(DOCK_SOUNDS_ENABLED, DOCK_SOUNDS_ENABLED_VALIDATOR);
11918 VALIDATORS.put(CHARGING_SOUNDS_ENABLED, CHARGING_SOUNDS_ENABLED_VALIDATOR);
11919 VALIDATORS.put(USB_MASS_STORAGE_ENABLED, USB_MASS_STORAGE_ENABLED_VALIDATOR);
11920 VALIDATORS.put(NETWORK_RECOMMENDATIONS_ENABLED,
11921 NETWORK_RECOMMENDATIONS_ENABLED_VALIDATOR);
11922 VALIDATORS.put(WIFI_WAKEUP_ENABLED, WIFI_WAKEUP_ENABLED_VALIDATOR);
11923 VALIDATORS.put(WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
11924 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR);
11925 VALIDATORS.put(USE_OPEN_WIFI_PACKAGE, USE_OPEN_WIFI_PACKAGE_VALIDATOR);
11926 VALIDATORS.put(WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED,
11927 WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED_VALIDATOR);
11928 VALIDATORS.put(EMERGENCY_TONE, EMERGENCY_TONE_VALIDATOR);
11929 VALIDATORS.put(CALL_AUTO_RETRY, CALL_AUTO_RETRY_VALIDATOR);
11930 VALIDATORS.put(DOCK_AUDIO_MEDIA_ENABLED, DOCK_AUDIO_MEDIA_ENABLED_VALIDATOR);
11931 VALIDATORS.put(ENCODED_SURROUND_OUTPUT, ENCODED_SURROUND_OUTPUT_VALIDATOR);
11932 VALIDATORS.put(LOW_POWER_MODE_TRIGGER_LEVEL, LOW_POWER_MODE_TRIGGER_LEVEL_VALIDATOR);
Makoto Onuki524b4dfe2018-03-06 17:34:15 -080011933 VALIDATORS.put(LOW_POWER_MODE_TRIGGER_LEVEL_MAX,
11934 LOW_POWER_MODE_TRIGGER_LEVEL_VALIDATOR);
Michal Karpinski5db1e432018-01-18 20:10:24 +000011935 VALIDATORS.put(BLUETOOTH_ON, BLUETOOTH_ON_VALIDATOR);
11936 VALIDATORS.put(PRIVATE_DNS_MODE, PRIVATE_DNS_MODE_VALIDATOR);
11937 VALIDATORS.put(PRIVATE_DNS_SPECIFIER, PRIVATE_DNS_SPECIFIER_VALIDATOR);
11938 VALIDATORS.put(SOFT_AP_TIMEOUT_ENABLED, SOFT_AP_TIMEOUT_ENABLED_VALIDATOR);
Glen Kuhne22ae9d52017-11-28 14:06:25 -080011939 VALIDATORS.put(WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON,
11940 WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR);
jackqdyulei3cd42a02018-02-27 11:18:00 -080011941 VALIDATORS.put(APP_AUTO_RESTRICTION_ENABLED, APP_AUTO_RESTRICTION_ENABLED_VALIDATOR);
Beverly09da25f2018-02-26 09:17:07 -050011942 VALIDATORS.put(ZEN_DURATION, ZEN_DURATION_VALIDATOR);
Michal Karpinski5db1e432018-01-18 20:10:24 +000011943 }
11944
11945 /**
Makoto Onuki53f0e022017-11-29 13:51:01 -080011946 * Global settings that shouldn't be persisted.
11947 *
11948 * @hide
11949 */
11950 public static final String[] TRANSIENT_SETTINGS = {
11951 LOCATION_GLOBAL_KILL_SWITCH,
11952 };
11953
Michal Karpinski964943a2018-01-19 16:28:26 +000011954 /**
11955 * Keys we no longer back up under the current schema, but want to continue to
11956 * process when restoring historical backup datasets.
11957 *
11958 * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator,
11959 * otherwise they won't be restored.
11960 *
11961 * @hide
11962 */
Christopher Tate1d0fca32017-06-06 13:30:00 -070011963 public static final String[] LEGACY_RESTORE_SETTINGS = {
11964 };
11965
Svetoslav Ganove080da92016-12-21 17:10:35 -080011966 private static final ContentProviderHolder sProviderHolder =
11967 new ContentProviderHolder(CONTENT_URI);
11968
Christopher Tate06efb532012-08-24 15:29:27 -070011969 // Populated lazily, guarded by class object:
Svetoslav Ganove080da92016-12-21 17:10:35 -080011970 private static final NameValueCache sNameValueCache = new NameValueCache(
Dianne Hackborn139748f2012-09-24 11:36:57 -070011971 CONTENT_URI,
11972 CALL_METHOD_GET_GLOBAL,
Svetoslav Ganove080da92016-12-21 17:10:35 -080011973 CALL_METHOD_PUT_GLOBAL,
11974 sProviderHolder);
Christopher Tate06efb532012-08-24 15:29:27 -070011975
Christopher Tateaa036a22014-05-19 16:33:27 -070011976 // Certain settings have been moved from global to the per-user secure namespace
11977 private static final HashSet<String> MOVED_TO_SECURE;
11978 static {
Steve McKayea93fe72016-12-02 11:35:35 -080011979 MOVED_TO_SECURE = new HashSet<>(1);
Christopher Tateaa036a22014-05-19 16:33:27 -070011980 MOVED_TO_SECURE.add(Settings.Global.INSTALL_NON_MARKET_APPS);
11981 }
11982
Svetoslav683914b2015-01-15 14:22:26 -080011983 /** @hide */
11984 public static void getMovedToSecureSettings(Set<String> outKeySet) {
11985 outKeySet.addAll(MOVED_TO_SECURE);
11986 }
11987
Sudheer Shankaaa3c30d2017-05-23 15:19:10 -070011988 /** @hide */
11989 public static void clearProviderForTest() {
11990 sProviderHolder.clearProviderForTest();
11991 sNameValueCache.clearGenerationTrackerForTest();
11992 }
11993
Christopher Tate06efb532012-08-24 15:29:27 -070011994 /**
11995 * Look up a name in the database.
11996 * @param resolver to access the database with
11997 * @param name to look up in the table
11998 * @return the corresponding value, or null if not present
11999 */
Dianne Hackborn139748f2012-09-24 11:36:57 -070012000 public static String getString(ContentResolver resolver, String name) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -070012001 return getStringForUser(resolver, name, resolver.getUserId());
Christopher Tate06efb532012-08-24 15:29:27 -070012002 }
12003
12004 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -070012005 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -070012006 int userHandle) {
Christopher Tateaa036a22014-05-19 16:33:27 -070012007 if (MOVED_TO_SECURE.contains(name)) {
12008 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
12009 + " to android.provider.Settings.Secure, returning read-only value.");
12010 return Secure.getStringForUser(resolver, name, userHandle);
12011 }
Christopher Tate06efb532012-08-24 15:29:27 -070012012 return sNameValueCache.getStringForUser(resolver, name, userHandle);
12013 }
12014
12015 /**
12016 * Store a name/value pair into the database.
12017 * @param resolver to access the database with
12018 * @param name to store
12019 * @param value to associate with the name
12020 * @return true if the value was set, false on database errors
12021 */
12022 public static boolean putString(ContentResolver resolver,
12023 String name, String value) {
Jeff Sharkeyad357d12018-02-02 13:25:31 -070012024 return putStringForUser(resolver, name, value, null, false, resolver.getUserId());
Svetoslav Ganove080da92016-12-21 17:10:35 -080012025 }
12026
12027 /**
12028 * Store a name/value pair into the database.
12029 * <p>
12030 * The method takes an optional tag to associate with the setting
12031 * which can be used to clear only settings made by your package and
12032 * associated with this tag by passing the tag to {@link
12033 * #resetToDefaults(ContentResolver, String)}. Anyone can override
12034 * the current tag. Also if another package changes the setting
12035 * then the tag will be set to the one specified in the set call
12036 * which can be null. Also any of the settings setters that do not
12037 * take a tag as an argument effectively clears the tag.
12038 * </p><p>
12039 * For example, if you set settings A and B with tags T1 and T2 and
12040 * another app changes setting A (potentially to the same value), it
12041 * can assign to it a tag T3 (note that now the package that changed
12042 * the setting is not yours). Now if you reset your changes for T1 and
12043 * T2 only setting B will be reset and A not (as it was changed by
12044 * another package) but since A did not change you are in the desired
12045 * initial state. Now if the other app changes the value of A (assuming
12046 * you registered an observer in the beginning) you would detect that
12047 * the setting was changed by another app and handle this appropriately
12048 * (ignore, set back to some value, etc).
12049 * </p><p>
12050 * Also the method takes an argument whether to make the value the
12051 * default for this setting. If the system already specified a default
12052 * value, then the one passed in here will <strong>not</strong>
12053 * be set as the default.
12054 * </p>
12055 *
12056 * @param resolver to access the database with.
12057 * @param name to store.
12058 * @param value to associate with the name.
12059 * @param tag to associated with the setting.
12060 * @param makeDefault whether to make the value the default one.
12061 * @return true if the value was set, false on database errors.
12062 *
12063 * @see #resetToDefaults(ContentResolver, String)
12064 *
12065 * @hide
12066 */
12067 @SystemApi
12068 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
12069 public static boolean putString(@NonNull ContentResolver resolver,
12070 @NonNull String name, @Nullable String value, @Nullable String tag,
12071 boolean makeDefault) {
12072 return putStringForUser(resolver, name, value, tag, makeDefault,
Jeff Sharkeyad357d12018-02-02 13:25:31 -070012073 resolver.getUserId());
Svetoslav Ganove080da92016-12-21 17:10:35 -080012074 }
12075
12076 /**
12077 * Reset the settings to their defaults. This would reset <strong>only</strong>
12078 * settings set by the caller's package. Think of it of a way to undo your own
12079 * changes to the secure settings. Passing in the optional tag will reset only
12080 * settings changed by your package and associated with this tag.
12081 *
12082 * @param resolver Handle to the content resolver.
12083 * @param tag Optional tag which should be associated with the settings to reset.
12084 *
12085 * @see #putString(ContentResolver, String, String, String, boolean)
12086 *
12087 * @hide
12088 */
12089 @SystemApi
12090 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
12091 public static void resetToDefaults(@NonNull ContentResolver resolver,
12092 @Nullable String tag) {
12093 resetToDefaultsAsUser(resolver, tag, RESET_MODE_PACKAGE_DEFAULTS,
Jeff Sharkeyad357d12018-02-02 13:25:31 -070012094 resolver.getUserId());
Svetoslav Ganove080da92016-12-21 17:10:35 -080012095 }
12096
12097 /**
12098 * Reset the settings to their defaults for a given user with a specific mode. The
12099 * optional tag argument is valid only for {@link #RESET_MODE_PACKAGE_DEFAULTS}
12100 * allowing resetting the settings made by a package and associated with the tag.
12101 *
12102 * @param resolver Handle to the content resolver.
12103 * @param tag Optional tag which should be associated with the settings to reset.
12104 * @param mode The reset mode.
12105 * @param userHandle The user for which to reset to defaults.
12106 *
12107 * @see #RESET_MODE_PACKAGE_DEFAULTS
12108 * @see #RESET_MODE_UNTRUSTED_DEFAULTS
12109 * @see #RESET_MODE_UNTRUSTED_CHANGES
12110 * @see #RESET_MODE_TRUSTED_DEFAULTS
12111 *
12112 * @hide
12113 */
12114 public static void resetToDefaultsAsUser(@NonNull ContentResolver resolver,
12115 @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle) {
12116 try {
12117 Bundle arg = new Bundle();
12118 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
12119 if (tag != null) {
12120 arg.putString(CALL_METHOD_TAG_KEY, tag);
12121 }
12122 arg.putInt(CALL_METHOD_RESET_MODE_KEY, mode);
12123 IContentProvider cp = sProviderHolder.getProvider(resolver);
12124 cp.call(resolver.getPackageName(), CALL_METHOD_RESET_GLOBAL, null, arg);
12125 } catch (RemoteException e) {
12126 Log.w(TAG, "Can't reset do defaults for " + CONTENT_URI, e);
12127 }
Christopher Tate06efb532012-08-24 15:29:27 -070012128 }
12129
12130 /** @hide */
12131 public static boolean putStringForUser(ContentResolver resolver,
12132 String name, String value, int userHandle) {
Svetoslav Ganove080da92016-12-21 17:10:35 -080012133 return putStringForUser(resolver, name, value, null, false, userHandle);
12134 }
12135
12136 /** @hide */
12137 public static boolean putStringForUser(@NonNull ContentResolver resolver,
12138 @NonNull String name, @Nullable String value, @Nullable String tag,
12139 boolean makeDefault, @UserIdInt int userHandle) {
Christopher Tate06efb532012-08-24 15:29:27 -070012140 if (LOCAL_LOGV) {
12141 Log.v(TAG, "Global.putString(name=" + name + ", value=" + value
12142 + " for " + userHandle);
12143 }
Christopher Tateaa036a22014-05-19 16:33:27 -070012144 // Global and Secure have the same access policy so we can forward writes
12145 if (MOVED_TO_SECURE.contains(name)) {
12146 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
12147 + " to android.provider.Settings.Secure, value is unchanged.");
Svetoslav Ganove080da92016-12-21 17:10:35 -080012148 return Secure.putStringForUser(resolver, name, value, tag,
12149 makeDefault, userHandle);
Christopher Tateaa036a22014-05-19 16:33:27 -070012150 }
Svetoslav Ganove080da92016-12-21 17:10:35 -080012151 return sNameValueCache.putStringForUser(resolver, name, value, tag,
12152 makeDefault, userHandle);
Christopher Tate06efb532012-08-24 15:29:27 -070012153 }
12154
12155 /**
12156 * Construct the content URI for a particular name/value pair,
12157 * useful for monitoring changes with a ContentObserver.
12158 * @param name to look up in the table
12159 * @return the corresponding content URI, or null if not present
12160 */
12161 public static Uri getUriFor(String name) {
12162 return getUriFor(CONTENT_URI, name);
12163 }
12164
12165 /**
12166 * Convenience function for retrieving a single secure settings value
12167 * as an integer. Note that internally setting values are always
12168 * stored as strings; this function converts the string to an integer
12169 * for you. The default value will be returned if the setting is
12170 * not defined or not an integer.
12171 *
12172 * @param cr The ContentResolver to access.
12173 * @param name The name of the setting to retrieve.
12174 * @param def Value to return if the setting is not defined.
12175 *
12176 * @return The setting's current value, or 'def' if it is not defined
12177 * or not a valid integer.
12178 */
12179 public static int getInt(ContentResolver cr, String name, int def) {
12180 String v = getString(cr, name);
12181 try {
12182 return v != null ? Integer.parseInt(v) : def;
12183 } catch (NumberFormatException e) {
12184 return def;
12185 }
12186 }
12187
12188 /**
12189 * Convenience function for retrieving a single secure settings value
12190 * as an integer. Note that internally setting values are always
12191 * stored as strings; this function converts the string to an integer
12192 * for you.
12193 * <p>
12194 * This version does not take a default value. If the setting has not
12195 * been set, or the string value is not a number,
12196 * it throws {@link SettingNotFoundException}.
12197 *
12198 * @param cr The ContentResolver to access.
12199 * @param name The name of the setting to retrieve.
12200 *
12201 * @throws SettingNotFoundException Thrown if a setting by the given
12202 * name can't be found or the setting value is not an integer.
12203 *
12204 * @return The setting's current value.
12205 */
12206 public static int getInt(ContentResolver cr, String name)
12207 throws SettingNotFoundException {
12208 String v = getString(cr, name);
12209 try {
12210 return Integer.parseInt(v);
12211 } catch (NumberFormatException e) {
12212 throw new SettingNotFoundException(name);
12213 }
12214 }
12215
12216 /**
12217 * Convenience function for updating a single settings value as an
12218 * integer. This will either create a new entry in the table if the
12219 * given name does not exist, or modify the value of the existing row
12220 * with that name. Note that internally setting values are always
12221 * stored as strings, so this function converts the given value to a
12222 * string before storing it.
12223 *
12224 * @param cr The ContentResolver to access.
12225 * @param name The name of the setting to modify.
12226 * @param value The new value for the setting.
12227 * @return true if the value was set, false on database errors
12228 */
12229 public static boolean putInt(ContentResolver cr, String name, int value) {
12230 return putString(cr, name, Integer.toString(value));
12231 }
12232
12233 /**
12234 * Convenience function for retrieving a single secure settings value
12235 * as a {@code long}. Note that internally setting values are always
12236 * stored as strings; this function converts the string to a {@code long}
12237 * for you. The default value will be returned if the setting is
12238 * not defined or not a {@code long}.
12239 *
12240 * @param cr The ContentResolver to access.
12241 * @param name The name of the setting to retrieve.
12242 * @param def Value to return if the setting is not defined.
12243 *
12244 * @return The setting's current value, or 'def' if it is not defined
12245 * or not a valid {@code long}.
12246 */
12247 public static long getLong(ContentResolver cr, String name, long def) {
12248 String valString = getString(cr, name);
12249 long value;
12250 try {
12251 value = valString != null ? Long.parseLong(valString) : def;
12252 } catch (NumberFormatException e) {
12253 value = def;
12254 }
12255 return value;
12256 }
12257
12258 /**
12259 * Convenience function for retrieving a single secure settings value
12260 * as a {@code long}. Note that internally setting values are always
12261 * stored as strings; this function converts the string to a {@code long}
12262 * for you.
12263 * <p>
12264 * This version does not take a default value. If the setting has not
12265 * been set, or the string value is not a number,
12266 * it throws {@link SettingNotFoundException}.
12267 *
12268 * @param cr The ContentResolver to access.
12269 * @param name The name of the setting to retrieve.
12270 *
12271 * @return The setting's current value.
12272 * @throws SettingNotFoundException Thrown if a setting by the given
12273 * name can't be found or the setting value is not an integer.
12274 */
12275 public static long getLong(ContentResolver cr, String name)
12276 throws SettingNotFoundException {
12277 String valString = getString(cr, name);
12278 try {
12279 return Long.parseLong(valString);
12280 } catch (NumberFormatException e) {
12281 throw new SettingNotFoundException(name);
12282 }
12283 }
12284
12285 /**
12286 * Convenience function for updating a secure settings value as a long
12287 * integer. This will either create a new entry in the table if the
12288 * given name does not exist, or modify the value of the existing row
12289 * with that name. Note that internally setting values are always
12290 * stored as strings, so this function converts the given value to a
12291 * string before storing it.
12292 *
12293 * @param cr The ContentResolver to access.
12294 * @param name The name of the setting to modify.
12295 * @param value The new value for the setting.
12296 * @return true if the value was set, false on database errors
12297 */
12298 public static boolean putLong(ContentResolver cr, String name, long value) {
12299 return putString(cr, name, Long.toString(value));
12300 }
12301
12302 /**
12303 * Convenience function for retrieving a single secure settings value
12304 * as a floating point number. Note that internally setting values are
12305 * always stored as strings; this function converts the string to an
12306 * float for you. The default value will be returned if the setting
12307 * is not defined or not a valid float.
12308 *
12309 * @param cr The ContentResolver to access.
12310 * @param name The name of the setting to retrieve.
12311 * @param def Value to return if the setting is not defined.
12312 *
12313 * @return The setting's current value, or 'def' if it is not defined
12314 * or not a valid float.
12315 */
12316 public static float getFloat(ContentResolver cr, String name, float def) {
12317 String v = getString(cr, name);
12318 try {
12319 return v != null ? Float.parseFloat(v) : def;
12320 } catch (NumberFormatException e) {
12321 return def;
12322 }
12323 }
12324
12325 /**
12326 * Convenience function for retrieving a single secure settings value
12327 * as a float. Note that internally setting values are always
12328 * stored as strings; this function converts the string to a float
12329 * for you.
12330 * <p>
12331 * This version does not take a default value. If the setting has not
12332 * been set, or the string value is not a number,
12333 * it throws {@link SettingNotFoundException}.
12334 *
12335 * @param cr The ContentResolver to access.
12336 * @param name The name of the setting to retrieve.
12337 *
12338 * @throws SettingNotFoundException Thrown if a setting by the given
12339 * name can't be found or the setting value is not a float.
12340 *
12341 * @return The setting's current value.
12342 */
12343 public static float getFloat(ContentResolver cr, String name)
12344 throws SettingNotFoundException {
12345 String v = getString(cr, name);
12346 if (v == null) {
12347 throw new SettingNotFoundException(name);
12348 }
12349 try {
12350 return Float.parseFloat(v);
12351 } catch (NumberFormatException e) {
12352 throw new SettingNotFoundException(name);
12353 }
12354 }
12355
12356 /**
12357 * Convenience function for updating a single settings value as a
12358 * floating point number. This will either create a new entry in the
12359 * table if the given name does not exist, or modify the value of the
12360 * existing row with that name. Note that internally setting values
12361 * are always stored as strings, so this function converts the given
12362 * value to a string before storing it.
12363 *
12364 * @param cr The ContentResolver to access.
12365 * @param name The name of the setting to modify.
12366 * @param value The new value for the setting.
12367 * @return true if the value was set, false on database errors
12368 */
12369 public static boolean putFloat(ContentResolver cr, String name, float value) {
12370 return putString(cr, name, Float.toString(value));
12371 }
Wink Savillefb40dd42014-06-12 17:02:31 -070012372
Wink Savillefb40dd42014-06-12 17:02:31 -070012373 /**
12374 * Subscription to be used for voice call on a multi sim device. The supported values
12375 * are 0 = SUB1, 1 = SUB2 and etc.
12376 * @hide
12377 */
12378 public static final String MULTI_SIM_VOICE_CALL_SUBSCRIPTION = "multi_sim_voice_call";
12379
12380 /**
12381 * Used to provide option to user to select subscription during dial.
12382 * The supported values are 0 = disable or 1 = enable prompt.
12383 * @hide
12384 */
12385 public static final String MULTI_SIM_VOICE_PROMPT = "multi_sim_voice_prompt";
12386
12387 /**
12388 * Subscription to be used for data call on a multi sim device. The supported values
12389 * are 0 = SUB1, 1 = SUB2 and etc.
12390 * @hide
12391 */
12392 public static final String MULTI_SIM_DATA_CALL_SUBSCRIPTION = "multi_sim_data_call";
12393
12394 /**
12395 * Subscription to be used for SMS on a multi sim device. The supported values
12396 * are 0 = SUB1, 1 = SUB2 and etc.
12397 * @hide
12398 */
12399 public static final String MULTI_SIM_SMS_SUBSCRIPTION = "multi_sim_sms";
12400
12401 /**
12402 * Used to provide option to user to select subscription during send SMS.
12403 * The value 1 - enable, 0 - disable
12404 * @hide
12405 */
12406 public static final String MULTI_SIM_SMS_PROMPT = "multi_sim_sms_prompt";
12407
Wink Savillefb40dd42014-06-12 17:02:31 -070012408 /** User preferred subscriptions setting.
12409 * This holds the details of the user selected subscription from the card and
Kweku Adamsb0886f32017-10-31 15:32:09 -070012410 * the activation status. Each settings string have the comma separated values
Wink Savillefb40dd42014-06-12 17:02:31 -070012411 * iccId,appType,appId,activationStatus,3gppIndex,3gpp2Index
12412 * @hide
12413 */
12414 public static final String[] MULTI_SIM_USER_PREFERRED_SUBS = {"user_preferred_sub1",
12415 "user_preferred_sub2","user_preferred_sub3"};
Zheng Fub218ff42015-04-13 16:31:16 -070012416
12417 /**
12418 * Whether to enable new contacts aggregator or not.
12419 * The value 1 - enable, 0 - disable
12420 * @hide
12421 */
12422 public static final String NEW_CONTACT_AGGREGATOR = "new_contact_aggregator";
Zheng Fu31ce78c2015-04-15 16:57:53 -070012423
12424 /**
12425 * Whether to enable contacts metadata syncing or not
12426 * The value 1 - enable, 0 - disable
Tingting Wange0cbda42016-05-10 15:39:37 -070012427 *
12428 * @removed
Zheng Fu31ce78c2015-04-15 16:57:53 -070012429 */
Tingting Wange0cbda42016-05-10 15:39:37 -070012430 @Deprecated
Zheng Fu31ce78c2015-04-15 16:57:53 -070012431 public static final String CONTACT_METADATA_SYNC = "contact_metadata_sync";
Wei Liua1817702015-08-11 21:21:12 -070012432
12433 /**
Tingting Wange0cbda42016-05-10 15:39:37 -070012434 * Whether to enable contacts metadata syncing or not
12435 * The value 1 - enable, 0 - disable
12436 */
12437 public static final String CONTACT_METADATA_SYNC_ENABLED = "contact_metadata_sync_enabled";
12438
12439 /**
Wei Liua1817702015-08-11 21:21:12 -070012440 * Whether to enable cellular on boot.
12441 * The value 1 - enable, 0 - disable
12442 * @hide
12443 */
12444 public static final String ENABLE_CELLULAR_ON_BOOT = "enable_cellular_on_boot";
Steven Ngdc20ba62016-04-26 18:19:04 +010012445
12446 /**
Chris Wren763a9bb2016-05-31 17:14:12 -040012447 * The maximum allowed notification enqueue rate in Hertz.
12448 *
Julia Reynolds76c096d2017-06-19 08:16:04 -040012449 * Should be a float, and includes updates only.
Chris Wren763a9bb2016-05-31 17:14:12 -040012450 * @hide
12451 */
12452 public static final String MAX_NOTIFICATION_ENQUEUE_RATE = "max_notification_enqueue_rate";
Doris Ling628cea42016-06-09 10:35:02 -070012453
12454 /**
Geoffrey Pitsch4c6eef22017-04-19 10:26:45 -040012455 * Displays toasts when an app posts a notification that does not specify a valid channel.
12456 *
12457 * The value 1 - enable, 0 - disable
12458 * @hide
12459 */
12460 public static final String SHOW_NOTIFICATION_CHANNEL_WARNINGS =
12461 "show_notification_channel_warnings";
12462
12463 /**
Chris Manton95a6c892016-03-15 13:26:11 -070012464 * Whether cell is enabled/disabled
12465 * @hide
12466 */
12467 public static final String CELL_ON = "cell_on";
Chad Brubaker97bccee2017-01-05 15:51:41 -080012468
12469 /**
Todd Kennedybe0b8892017-02-15 14:13:52 -080012470 * Global settings which can be accessed by instant apps.
Chad Brubaker97bccee2017-01-05 15:51:41 -080012471 * @hide
12472 */
Todd Kennedybe0b8892017-02-15 14:13:52 -080012473 public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>();
Chad Brubaker97bccee2017-01-05 15:51:41 -080012474 static {
Todd Kennedybe0b8892017-02-15 14:13:52 -080012475 INSTANT_APP_SETTINGS.add(WAIT_FOR_DEBUGGER);
12476 INSTANT_APP_SETTINGS.add(DEVICE_PROVISIONED);
12477 INSTANT_APP_SETTINGS.add(DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES);
12478 INSTANT_APP_SETTINGS.add(DEVELOPMENT_FORCE_RTL);
12479 INSTANT_APP_SETTINGS.add(EPHEMERAL_COOKIE_MAX_SIZE_BYTES);
Chad Brubaker1f6a2662017-03-20 11:11:30 -070012480 INSTANT_APP_SETTINGS.add(AIRPLANE_MODE_ON);
Chad Brubaker91d2e282017-04-03 14:34:50 -070012481 INSTANT_APP_SETTINGS.add(WINDOW_ANIMATION_SCALE);
12482 INSTANT_APP_SETTINGS.add(TRANSITION_ANIMATION_SCALE);
12483 INSTANT_APP_SETTINGS.add(ANIMATOR_DURATION_SCALE);
12484 INSTANT_APP_SETTINGS.add(DEBUG_VIEW_ATTRIBUTES);
Chad Brubaker562afaf2017-04-10 13:32:37 -070012485 INSTANT_APP_SETTINGS.add(WTF_IS_FATAL);
Chad Brubakera6170b82017-09-01 14:48:46 -070012486 INSTANT_APP_SETTINGS.add(SEND_ACTION_APP_ERROR);
Svet Ganov8f90bcc2017-12-22 23:29:24 -080012487 INSTANT_APP_SETTINGS.add(ZEN_MODE);
Chad Brubaker97bccee2017-01-05 15:51:41 -080012488 }
12489
Andrew Sappersteine3352562017-01-20 15:41:03 -080012490 /**
12491 * Whether to show the high temperature warning notification.
12492 * @hide
12493 */
12494 public static final String SHOW_TEMPERATURE_WARNING = "show_temperature_warning";
12495
12496 /**
12497 * Temperature at which the high temperature warning notification should be shown.
12498 * @hide
12499 */
12500 public static final String WARNING_TEMPERATURE = "warning_temperature";
Daniel Nishi88e45dc2017-01-25 11:43:55 -080012501
12502 /**
12503 * Whether the diskstats logging task is enabled/disabled.
12504 * @hide
12505 */
12506 public static final String ENABLE_DISKSTATS_LOGGING = "enable_diskstats_logging";
Daniel Nishi0f703e62017-02-21 15:19:27 -080012507
12508 /**
12509 * Whether the cache quota calculation task is enabled/disabled.
12510 * @hide
12511 */
12512 public static final String ENABLE_CACHE_QUOTA_CALCULATION =
12513 "enable_cache_quota_calculation";
Daniel Nishi4f5320e2017-06-13 17:51:21 -070012514
12515 /**
12516 * Whether the Deletion Helper no threshold toggle is available.
12517 * @hide
12518 */
12519 public static final String ENABLE_DELETION_HELPER_NO_THRESHOLD_TOGGLE =
12520 "enable_deletion_helper_no_threshold_toggle";
Chris Wrene901a7e2017-10-02 17:29:46 -040012521
12522 /**
12523 * The list of snooze options for notifications
12524 * This is encoded as a key=value list, separated by commas. Ex:
12525 *
12526 * "default=60,options_array=15:30:60:120"
12527 *
12528 * The following keys are supported:
12529 *
12530 * <pre>
12531 * default (int)
Chris Wren41707512017-12-06 00:12:17 -050012532 * options_array (int[])
Chris Wrene901a7e2017-10-02 17:29:46 -040012533 * </pre>
12534 *
12535 * All delays in integer minutes. Array order is respected.
12536 * Options will be used in order up to the maximum allowed by the UI.
12537 * @hide
12538 */
12539 public static final String NOTIFICATION_SNOOZE_OPTIONS =
12540 "notification_snooze_options";
gomo48f1a642017-11-10 20:35:46 -080012541
12542 /**
Fyodor Kupolovee90c032017-12-12 11:52:57 -080012543 * Configuration flags for SQLite Compatibility WAL. Encoded as a key-value list, separated
12544 * by commas. E.g.: compatibility_wal_supported=true, wal_syncmode=OFF
12545 *
12546 * Supported keys:
12547 * compatibility_wal_supported (boolean)
12548 * wal_syncmode (String)
12549 *
12550 * @hide
12551 */
12552 public static final String SQLITE_COMPATIBILITY_WAL_FLAGS =
12553 "sqlite_compatibility_wal_flags";
12554
12555 /**
gomo48f1a642017-11-10 20:35:46 -080012556 * Enable GNSS Raw Measurements Full Tracking?
12557 * 0 = no
12558 * 1 = yes
12559 * @hide
12560 */
12561 public static final String ENABLE_GNSS_RAW_MEAS_FULL_TRACKING =
12562 "enable_gnss_raw_meas_full_tracking";
Daniel Colascione766b6322018-01-08 19:10:36 -080012563
12564 /**
goneil42919602018-01-23 17:37:26 -080012565 * Whether the notification should be ongoing (persistent) when a carrier app install is
12566 * required.
12567 *
12568 * The value is a boolean (1 or 0).
12569 * @hide
12570 */
12571 @SystemApi
12572 public static final String INSTALL_CARRIER_APP_NOTIFICATION_PERSISTENT =
12573 "install_carrier_app_notification_persistent";
12574
12575 /**
12576 * The amount of time (ms) to hide the install carrier app notification after the user has
12577 * ignored it. After this time passes, the notification will be shown again
12578 *
12579 * The value is a long
12580 * @hide
12581 */
12582 @SystemApi
12583 public static final String INSTALL_CARRIER_APP_NOTIFICATION_SLEEP_MILLIS =
12584 "install_carrier_app_notification_sleep_millis";
12585
12586 /**
Daniel Colascione766b6322018-01-08 19:10:36 -080012587 * Whether we've enabled zram on this device. Takes effect on
12588 * reboot. The value "1" enables zram; "0" disables it, and
12589 * everything else is unspecified.
12590 * @hide
12591 */
12592 public static final String ZRAM_ENABLED =
12593 "zram_enabled";
Petr Cermak9669e902018-01-16 16:37:22 +000012594
12595 /**
Alice Sheng59a94882018-03-19 23:46:56 +000012596 * Whether we have enable CPU frequency scaling for this device.
12597 * For Wear, default is disable.
12598 *
12599 * The value is "1" for enable, "0" for disable.
12600 * @hide
12601 */
12602 public static final String CPU_SCALING_ENABLED =
12603 "cpu_frequency_scaling_enabled";
12604
12605 /**
Petr Cermak10011fa2018-02-05 19:00:54 +000012606 * Configuration flags for smart replies in notifications.
12607 * This is encoded as a key=value list, separated by commas. Ex:
12608 *
12609 * "enabled=1,max_squeeze_remeasure_count=3"
12610 *
12611 * The following keys are supported:
12612 *
12613 * <pre>
12614 * enabled (boolean)
Richard Ledley4069f7a2018-02-26 10:36:00 +000012615 * requires_targeting_p (boolean)
Petr Cermak10011fa2018-02-05 19:00:54 +000012616 * max_squeeze_remeasure_attempts (int)
12617 * </pre>
12618 * @see com.android.systemui.statusbar.policy.SmartReplyConstants
Petr Cermak9669e902018-01-16 16:37:22 +000012619 * @hide
12620 */
Petr Cermak10011fa2018-02-05 19:00:54 +000012621 public static final String SMART_REPLIES_IN_NOTIFICATIONS_FLAGS =
12622 "smart_replies_in_notifications_flags";
Andrew Sapperstein43643ae2017-12-20 15:17:33 -080012623
12624 /**
12625 * If nonzero, crashes in foreground processes will bring up a dialog.
12626 * Otherwise, the process will be silently killed.
12627 * @hide
12628 */
12629 public static final String SHOW_FIRST_CRASH_DIALOG = "show_first_crash_dialog";
Andrew Sapperstein5b679c42018-01-16 11:13:40 -080012630
12631 /**
12632 * If nonzero, crash dialogs will show an option to restart the app.
12633 * @hide
12634 */
12635 public static final String SHOW_RESTART_IN_CRASH_DIALOG = "show_restart_in_crash_dialog";
12636
12637 /**
12638 * If nonzero, crash dialogs will show an option to mute all future crash dialogs for
12639 * this app.
12640 * @hide
12641 */
12642 public static final String SHOW_MUTE_IN_CRASH_DIALOG = "show_mute_in_crash_dialog";
Beverly3bae4e52018-02-07 12:32:02 -050012643
12644 /**
12645 * If nonzero, will show the zen upgrade notification when the user toggles DND on/off.
12646 * @hide
12647 */
12648 public static final String SHOW_ZEN_UPGRADE_NOTIFICATION = "show_zen_upgrade_notification";
Annie Mengd069a882018-03-13 15:31:40 +000012649
12650 /**
12651 * Backup and restore agent timeout parameters.
12652 * These parameters are represented by a comma-delimited key-value list.
12653 *
12654 * The following strings are supported as keys:
12655 * <pre>
12656 * kv_backup_agent_timeout_millis (long)
12657 * full_backup_agent_timeout_millis (long)
12658 * shared_backup_agent_timeout_millis (long)
12659 * restore_agent_timeout_millis (long)
12660 * restore_agent_finished_timeout_millis (long)
12661 * </pre>
12662 *
12663 * They map to milliseconds represented as longs.
12664 *
12665 * Ex: "kv_backup_agent_timeout_millis=30000,full_backup_agent_timeout_millis=300000"
12666 *
12667 * @hide
12668 */
12669 public static final String BACKUP_AGENT_TIMEOUT_PARAMETERS =
12670 "backup_agent_timeout_parameters";
Alice Shengb32b1ad2018-03-14 12:00:44 -070012671
12672 /**
12673 * Whether we have enabled swapping on this device. For Wear, default is
12674 * enabled.
12675 *
12676 * The value is "1" for enable, "0" for disable.
12677 * @hide
12678 */
12679 public static final String SWAP_ENABLED = "swap_enabled";
12680
Yu-Han Yang66c7ea92018-03-11 17:17:15 -070012681 /**
12682 * Blacklist of GNSS satellites.
12683 *
12684 * This is a list of integers separated by commas to represent pairs of (constellation,
12685 * svid). Thus, the number of integers should be even.
12686 *
12687 * E.g.: "3,0,5,24" denotes (constellation=3, svid=0) and (constellation=5, svid=24) are
12688 * blacklisted. Note that svid=0 denotes all svids in the
12689 * constellation are blacklisted.
12690 *
12691 * @hide
12692 */
12693 public static final String GNSS_SATELLITE_BLACKLIST = "gnss_satellite_blacklist";
Yu-Han Yangab3e7bd2018-04-06 10:23:28 -070012694
12695 /**
12696 * Duration of updates in millisecond for GNSS location request from HAL to framework.
12697 *
12698 * If zero, the GNSS location request feature is disabled.
12699 *
12700 * The value is a non-negative long.
12701 *
12702 * @hide
12703 */
12704 public static final String GNSS_HAL_LOCATION_REQUEST_DURATION_MILLIS =
12705 "gnss_hal_location_request_duration_millis";
Christopher Tate06efb532012-08-24 15:29:27 -070012706 }
12707
12708 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080012709 * User-defined bookmarks and shortcuts. The target of each bookmark is an
12710 * Intent URL, allowing it to be either a web page or a particular
12711 * application activity.
12712 *
12713 * @hide
12714 */
12715 public static final class Bookmarks implements BaseColumns
12716 {
12717 private static final String TAG = "Bookmarks";
12718
12719 /**
12720 * The content:// style URL for this table
12721 */
12722 public static final Uri CONTENT_URI =
12723 Uri.parse("content://" + AUTHORITY + "/bookmarks");
12724
12725 /**
12726 * The row ID.
12727 * <p>Type: INTEGER</p>
12728 */
12729 public static final String ID = "_id";
12730
12731 /**
12732 * Descriptive name of the bookmark that can be displayed to the user.
12733 * If this is empty, the title should be resolved at display time (use
12734 * {@link #getTitle(Context, Cursor)} any time you want to display the
12735 * title of a bookmark.)
12736 * <P>
12737 * Type: TEXT
12738 * </P>
12739 */
12740 public static final String TITLE = "title";
12741
12742 /**
12743 * Arbitrary string (displayed to the user) that allows bookmarks to be
12744 * organized into categories. There are some special names for
12745 * standard folders, which all start with '@'. The label displayed for
12746 * the folder changes with the locale (via {@link #getLabelForFolder}) but
12747 * the folder name does not change so you can consistently query for
12748 * the folder regardless of the current locale.
12749 *
12750 * <P>Type: TEXT</P>
12751 *
12752 */
12753 public static final String FOLDER = "folder";
12754
12755 /**
12756 * The Intent URL of the bookmark, describing what it points to. This
12757 * value is given to {@link android.content.Intent#getIntent} to create
12758 * an Intent that can be launched.
12759 * <P>Type: TEXT</P>
12760 */
12761 public static final String INTENT = "intent";
12762
12763 /**
12764 * Optional shortcut character associated with this bookmark.
12765 * <P>Type: INTEGER</P>
12766 */
12767 public static final String SHORTCUT = "shortcut";
12768
12769 /**
12770 * The order in which the bookmark should be displayed
12771 * <P>Type: INTEGER</P>
12772 */
12773 public static final String ORDERING = "ordering";
12774
12775 private static final String[] sIntentProjection = { INTENT };
12776 private static final String[] sShortcutProjection = { ID, SHORTCUT };
12777 private static final String sShortcutSelection = SHORTCUT + "=?";
12778
12779 /**
12780 * Convenience function to retrieve the bookmarked Intent for a
12781 * particular shortcut key.
12782 *
12783 * @param cr The ContentResolver to query.
12784 * @param shortcut The shortcut key.
12785 *
12786 * @return Intent The bookmarked URL, or null if there is no bookmark
12787 * matching the given shortcut.
12788 */
12789 public static Intent getIntentForShortcut(ContentResolver cr, char shortcut)
12790 {
12791 Intent intent = null;
12792
12793 Cursor c = cr.query(CONTENT_URI,
12794 sIntentProjection, sShortcutSelection,
12795 new String[] { String.valueOf((int) shortcut) }, ORDERING);
12796 // Keep trying until we find a valid shortcut
12797 try {
12798 while (intent == null && c.moveToNext()) {
12799 try {
12800 String intentURI = c.getString(c.getColumnIndexOrThrow(INTENT));
Christian Mehlmauera34d2c92010-05-25 19:04:20 +020012801 intent = Intent.parseUri(intentURI, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080012802 } catch (java.net.URISyntaxException e) {
12803 // The stored URL is bad... ignore it.
12804 } catch (IllegalArgumentException e) {
12805 // Column not found
Dianne Hackborna33e3f72009-09-29 17:28:24 -070012806 Log.w(TAG, "Intent column not found", e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080012807 }
12808 }
12809 } finally {
12810 if (c != null) c.close();
12811 }
12812
12813 return intent;
12814 }
12815
12816 /**
12817 * Add a new bookmark to the system.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -070012818 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080012819 * @param cr The ContentResolver to query.
12820 * @param intent The desired target of the bookmark.
12821 * @param title Bookmark title that is shown to the user; null if none
12822 * or it should be resolved to the intent's title.
12823 * @param folder Folder in which to place the bookmark; null if none.
12824 * @param shortcut Shortcut that will invoke the bookmark; 0 if none. If
12825 * this is non-zero and there is an existing bookmark entry
12826 * with this same shortcut, then that existing shortcut is
12827 * cleared (the bookmark is not removed).
12828 * @return The unique content URL for the new bookmark entry.
12829 */
12830 public static Uri add(ContentResolver cr,
12831 Intent intent,
12832 String title,
12833 String folder,
12834 char shortcut,
12835 int ordering)
12836 {
12837 // If a shortcut is supplied, and it is already defined for
12838 // another bookmark, then remove the old definition.
12839 if (shortcut != 0) {
Jeff Hamilton7cd51ef2010-05-12 17:30:27 -050012840 cr.delete(CONTENT_URI, sShortcutSelection,
12841 new String[] { String.valueOf((int) shortcut) });
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080012842 }
12843
12844 ContentValues values = new ContentValues();
12845 if (title != null) values.put(TITLE, title);
12846 if (folder != null) values.put(FOLDER, folder);
Jean-Baptiste Queru3b9f0a32010-06-21 13:46:59 -070012847 values.put(INTENT, intent.toUri(0));
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080012848 if (shortcut != 0) values.put(SHORTCUT, (int) shortcut);
12849 values.put(ORDERING, ordering);
12850 return cr.insert(CONTENT_URI, values);
12851 }
12852
12853 /**
12854 * Return the folder name as it should be displayed to the user. This
12855 * takes care of localizing special folders.
12856 *
12857 * @param r Resources object for current locale; only need access to
12858 * system resources.
12859 * @param folder The value found in the {@link #FOLDER} column.
12860 *
12861 * @return CharSequence The label for this folder that should be shown
12862 * to the user.
12863 */
12864 public static CharSequence getLabelForFolder(Resources r, String folder) {
12865 return folder;
12866 }
12867
12868 /**
12869 * Return the title as it should be displayed to the user. This takes
12870 * care of localizing bookmarks that point to activities.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -070012871 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080012872 * @param context A context.
12873 * @param cursor A cursor pointing to the row whose title should be
12874 * returned. The cursor must contain at least the {@link #TITLE}
12875 * and {@link #INTENT} columns.
12876 * @return A title that is localized and can be displayed to the user,
12877 * or the empty string if one could not be found.
12878 */
12879 public static CharSequence getTitle(Context context, Cursor cursor) {
12880 int titleColumn = cursor.getColumnIndex(TITLE);
12881 int intentColumn = cursor.getColumnIndex(INTENT);
12882 if (titleColumn == -1 || intentColumn == -1) {
12883 throw new IllegalArgumentException(
12884 "The cursor must contain the TITLE and INTENT columns.");
12885 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -070012886
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080012887 String title = cursor.getString(titleColumn);
12888 if (!TextUtils.isEmpty(title)) {
12889 return title;
12890 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -070012891
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080012892 String intentUri = cursor.getString(intentColumn);
12893 if (TextUtils.isEmpty(intentUri)) {
12894 return "";
12895 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -070012896
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080012897 Intent intent;
12898 try {
Christian Mehlmauera34d2c92010-05-25 19:04:20 +020012899 intent = Intent.parseUri(intentUri, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080012900 } catch (URISyntaxException e) {
12901 return "";
12902 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -070012903
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080012904 PackageManager packageManager = context.getPackageManager();
12905 ResolveInfo info = packageManager.resolveActivity(intent, 0);
12906 return info != null ? info.loadLabel(packageManager) : "";
12907 }
12908 }
12909
12910 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080012911 * Returns the device ID that we should use when connecting to the mobile gtalk server.
12912 * This is a string like "android-0x1242", where the hex string is the Android ID obtained
12913 * from the GoogleLoginService.
12914 *
12915 * @param androidId The Android ID for this device.
12916 * @return The device ID that should be used when connecting to the mobile gtalk server.
12917 * @hide
12918 */
12919 public static String getGTalkDeviceId(long androidId) {
12920 return "android-" + Long.toHexString(androidId);
12921 }
Billy Lau6ad2d662015-07-18 00:26:58 +010012922
Billy Laua7238a32015-08-01 12:45:02 +010012923 private static final String[] PM_WRITE_SETTINGS = {
12924 android.Manifest.permission.WRITE_SETTINGS
12925 };
12926 private static final String[] PM_CHANGE_NETWORK_STATE = {
12927 android.Manifest.permission.CHANGE_NETWORK_STATE,
12928 android.Manifest.permission.WRITE_SETTINGS
12929 };
12930 private static final String[] PM_SYSTEM_ALERT_WINDOW = {
12931 android.Manifest.permission.SYSTEM_ALERT_WINDOW
12932 };
12933
Billy Lau6ad2d662015-07-18 00:26:58 +010012934 /**
12935 * Performs a strict and comprehensive check of whether a calling package is allowed to
12936 * write/modify system settings, as the condition differs for pre-M, M+, and
12937 * privileged/preinstalled apps. If the provided uid does not match the
12938 * callingPackage, a negative result will be returned.
12939 * @hide
12940 */
12941 public static boolean isCallingPackageAllowedToWriteSettings(Context context, int uid,
12942 String callingPackage, boolean throwException) {
12943 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
12944 callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS,
Billy Laua7238a32015-08-01 12:45:02 +010012945 PM_WRITE_SETTINGS, false);
Billy Lau6ad2d662015-07-18 00:26:58 +010012946 }
12947
12948 /**
12949 * Performs a strict and comprehensive check of whether a calling package is allowed to
12950 * write/modify system settings, as the condition differs for pre-M, M+, and
12951 * privileged/preinstalled apps. If the provided uid does not match the
Billy Laua7238a32015-08-01 12:45:02 +010012952 * callingPackage, a negative result will be returned. The caller is expected to have
Lorenzo Colittid5427052015-10-15 16:29:00 +090012953 * the WRITE_SETTINGS permission declared.
Billy Lau6ad2d662015-07-18 00:26:58 +010012954 *
12955 * Note: if the check is successful, the operation of this app will be updated to the
12956 * current time.
12957 * @hide
12958 */
12959 public static boolean checkAndNoteWriteSettingsOperation(Context context, int uid,
12960 String callingPackage, boolean throwException) {
12961 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
12962 callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS,
Billy Laua7238a32015-08-01 12:45:02 +010012963 PM_WRITE_SETTINGS, true);
12964 }
12965
12966 /**
12967 * Performs a strict and comprehensive check of whether a calling package is allowed to
12968 * change the state of network, as the condition differs for pre-M, M+, and
Lorenzo Colittid5427052015-10-15 16:29:00 +090012969 * privileged/preinstalled apps. The caller is expected to have either the
12970 * CHANGE_NETWORK_STATE or the WRITE_SETTINGS permission declared. Either of these
12971 * permissions allow changing network state; WRITE_SETTINGS is a runtime permission and
12972 * can be revoked, but (except in M, excluding M MRs), CHANGE_NETWORK_STATE is a normal
12973 * permission and cannot be revoked. See http://b/23597341
Billy Laua7238a32015-08-01 12:45:02 +010012974 *
Lorenzo Colittid5427052015-10-15 16:29:00 +090012975 * Note: if the check succeeds because the application holds WRITE_SETTINGS, the operation
12976 * of this app will be updated to the current time.
Billy Laua7238a32015-08-01 12:45:02 +010012977 * @hide
12978 */
12979 public static boolean checkAndNoteChangeNetworkStateOperation(Context context, int uid,
12980 String callingPackage, boolean throwException) {
Lorenzo Colittid5427052015-10-15 16:29:00 +090012981 if (context.checkCallingOrSelfPermission(android.Manifest.permission.CHANGE_NETWORK_STATE)
12982 == PackageManager.PERMISSION_GRANTED) {
12983 return true;
12984 }
Billy Laua7238a32015-08-01 12:45:02 +010012985 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
12986 callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS,
12987 PM_CHANGE_NETWORK_STATE, true);
Billy Lau6ad2d662015-07-18 00:26:58 +010012988 }
12989
12990 /**
12991 * Performs a strict and comprehensive check of whether a calling package is allowed to
12992 * draw on top of other apps, as the conditions differs for pre-M, M+, and
12993 * privileged/preinstalled apps. If the provided uid does not match the callingPackage,
12994 * a negative result will be returned.
12995 * @hide
12996 */
12997 public static boolean isCallingPackageAllowedToDrawOverlays(Context context, int uid,
12998 String callingPackage, boolean throwException) {
12999 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
13000 callingPackage, throwException, AppOpsManager.OP_SYSTEM_ALERT_WINDOW,
Billy Laua7238a32015-08-01 12:45:02 +010013001 PM_SYSTEM_ALERT_WINDOW, false);
Billy Lau6ad2d662015-07-18 00:26:58 +010013002 }
13003
13004 /**
13005 * Performs a strict and comprehensive check of whether a calling package is allowed to
13006 * draw on top of other apps, as the conditions differs for pre-M, M+, and
13007 * privileged/preinstalled apps. If the provided uid does not match the callingPackage,
13008 * a negative result will be returned.
13009 *
13010 * Note: if the check is successful, the operation of this app will be updated to the
13011 * current time.
13012 * @hide
13013 */
13014 public static boolean checkAndNoteDrawOverlaysOperation(Context context, int uid, String
13015 callingPackage, boolean throwException) {
13016 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
13017 callingPackage, throwException, AppOpsManager.OP_SYSTEM_ALERT_WINDOW,
Billy Laua7238a32015-08-01 12:45:02 +010013018 PM_SYSTEM_ALERT_WINDOW, true);
Billy Lau6ad2d662015-07-18 00:26:58 +010013019 }
13020
13021 /**
13022 * Helper method to perform a general and comprehensive check of whether an operation that is
13023 * protected by appops can be performed by a caller or not. e.g. OP_SYSTEM_ALERT_WINDOW and
13024 * OP_WRITE_SETTINGS
13025 * @hide
13026 */
13027 public static boolean isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context context,
Billy Laua7238a32015-08-01 12:45:02 +010013028 int uid, String callingPackage, boolean throwException, int appOpsOpCode, String[]
13029 permissions, boolean makeNote) {
Billy Lau6ad2d662015-07-18 00:26:58 +010013030 if (callingPackage == null) {
13031 return false;
13032 }
13033
13034 AppOpsManager appOpsMgr = (AppOpsManager)context.getSystemService(Context.APP_OPS_SERVICE);
13035 int mode = AppOpsManager.MODE_DEFAULT;
13036 if (makeNote) {
13037 mode = appOpsMgr.noteOpNoThrow(appOpsOpCode, uid, callingPackage);
13038 } else {
13039 mode = appOpsMgr.checkOpNoThrow(appOpsOpCode, uid, callingPackage);
13040 }
13041
13042 switch (mode) {
13043 case AppOpsManager.MODE_ALLOWED:
13044 return true;
Billy Laua7238a32015-08-01 12:45:02 +010013045
Billy Lau6ad2d662015-07-18 00:26:58 +010013046 case AppOpsManager.MODE_DEFAULT:
13047 // this is the default operating mode after an app's installation
Billy Laua7238a32015-08-01 12:45:02 +010013048 // In this case we will check all associated static permission to see
13049 // if it is granted during install time.
13050 for (String permission : permissions) {
13051 if (context.checkCallingOrSelfPermission(permission) == PackageManager
13052 .PERMISSION_GRANTED) {
13053 // if either of the permissions are granted, we will allow it
13054 return true;
13055 }
Billy Lau6ad2d662015-07-18 00:26:58 +010013056 }
Billy Laua7238a32015-08-01 12:45:02 +010013057
Billy Lau6ad2d662015-07-18 00:26:58 +010013058 default:
13059 // this is for all other cases trickled down here...
13060 if (!throwException) {
13061 return false;
13062 }
13063 }
Billy Laua7238a32015-08-01 12:45:02 +010013064
13065 // prepare string to throw SecurityException
13066 StringBuilder exceptionMessage = new StringBuilder();
13067 exceptionMessage.append(callingPackage);
13068 exceptionMessage.append(" was not granted ");
13069 if (permissions.length > 1) {
13070 exceptionMessage.append(" either of these permissions: ");
13071 } else {
13072 exceptionMessage.append(" this permission: ");
13073 }
13074 for (int i = 0; i < permissions.length; i++) {
13075 exceptionMessage.append(permissions[i]);
13076 exceptionMessage.append((i == permissions.length - 1) ? "." : ", ");
13077 }
13078
13079 throw new SecurityException(exceptionMessage.toString());
Billy Lau6ad2d662015-07-18 00:26:58 +010013080 }
13081
13082 /**
13083 * Retrieves a correponding package name for a given uid. It will query all
13084 * packages that are associated with the given uid, but it will return only
13085 * the zeroth result.
13086 * Note: If package could not be found, a null is returned.
13087 * @hide
13088 */
13089 public static String getPackageNameForUid(Context context, int uid) {
13090 String[] packages = context.getPackageManager().getPackagesForUid(uid);
13091 if (packages == null) {
13092 return null;
13093 }
13094 return packages[0];
13095 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080013096}