The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package android.provider; |
| 18 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 19 | import android.annotation.SdkConstant; |
| 20 | import android.annotation.SdkConstant.SdkConstantType; |
Narayan Kamath | ee69ff4 | 2011-06-28 12:07:18 +0100 | [diff] [blame] | 21 | import android.app.SearchManager; |
Mike LeBeau | 5d34e9b | 2010-02-10 19:34:56 -0800 | [diff] [blame] | 22 | import android.content.ComponentName; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 23 | import android.content.ContentResolver; |
| 24 | import android.content.ContentValues; |
| 25 | import android.content.Context; |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 26 | import android.content.IContentProvider; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 27 | import android.content.Intent; |
Dianne Hackborn | b8b11a0 | 2010-03-10 15:53:11 -0800 | [diff] [blame] | 28 | import android.content.pm.ActivityInfo; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 29 | import android.content.pm.PackageManager; |
| 30 | import android.content.pm.ResolveInfo; |
| 31 | import android.content.res.Configuration; |
| 32 | import android.content.res.Resources; |
| 33 | import android.database.Cursor; |
| 34 | import android.database.SQLException; |
| 35 | import android.net.Uri; |
Irfan Sheriff | 36f7413 | 2010-11-04 16:57:37 -0700 | [diff] [blame] | 36 | import android.net.wifi.WifiManager; |
Svetoslav Ganov | 585f13f8d | 2010-08-10 07:59:15 -0700 | [diff] [blame] | 37 | import android.os.BatteryManager; |
| 38 | import android.os.Bundle; |
Amith Yamasani | 52c489c | 2012-03-28 11:42:42 -0700 | [diff] [blame] | 39 | import android.os.IBinder; |
Amith Yamasani | 7ab8c4a | 2012-04-06 09:27:12 -0700 | [diff] [blame] | 40 | import android.os.Process; |
Svetoslav Ganov | 585f13f8d | 2010-08-10 07:59:15 -0700 | [diff] [blame] | 41 | import android.os.RemoteException; |
Amith Yamasani | 52c489c | 2012-03-28 11:42:42 -0700 | [diff] [blame] | 42 | import android.os.ServiceManager; |
Svetoslav Ganov | 585f13f8d | 2010-08-10 07:59:15 -0700 | [diff] [blame] | 43 | import android.os.SystemProperties; |
Amith Yamasani | 52c489c | 2012-03-28 11:42:42 -0700 | [diff] [blame] | 44 | import android.os.UserId; |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 45 | import android.speech.tts.TextToSpeech; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 46 | import android.text.TextUtils; |
| 47 | import android.util.AndroidException; |
| 48 | import android.util.Log; |
Gilles Debunne | e90bed1 | 2011-08-30 14:28:27 -0700 | [diff] [blame] | 49 | import android.view.WindowOrientationListener; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 50 | |
Amith Yamasani | 52c489c | 2012-03-28 11:42:42 -0700 | [diff] [blame] | 51 | import com.android.internal.widget.ILockSettings; |
| 52 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 53 | import java.net.URISyntaxException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 54 | import java.util.HashMap; |
| 55 | import java.util.HashSet; |
| 56 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 57 | /** |
| 58 | * The Settings provider contains global system-level device preferences. |
| 59 | */ |
| 60 | public final class Settings { |
| 61 | |
| 62 | // Intent actions for Settings |
| 63 | |
| 64 | /** |
| 65 | * Activity Action: Show system settings. |
| 66 | * <p> |
| 67 | * Input: Nothing. |
| 68 | * <p> |
Gilles Debunne | e90bed1 | 2011-08-30 14:28:27 -0700 | [diff] [blame] | 69 | * Output: Nothing. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 70 | */ |
| 71 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 72 | public static final String ACTION_SETTINGS = "android.settings.SETTINGS"; |
| 73 | |
| 74 | /** |
| 75 | * Activity Action: Show settings to allow configuration of APNs. |
| 76 | * <p> |
| 77 | * Input: Nothing. |
| 78 | * <p> |
Gilles Debunne | e90bed1 | 2011-08-30 14:28:27 -0700 | [diff] [blame] | 79 | * Output: Nothing. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 80 | */ |
| 81 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 82 | public static final String ACTION_APN_SETTINGS = "android.settings.APN_SETTINGS"; |
| 83 | |
| 84 | /** |
| 85 | * Activity Action: Show settings to allow configuration of current location |
| 86 | * sources. |
| 87 | * <p> |
| 88 | * In some cases, a matching Activity may not exist, so ensure you |
| 89 | * safeguard against this. |
| 90 | * <p> |
| 91 | * Input: Nothing. |
| 92 | * <p> |
| 93 | * Output: Nothing. |
| 94 | */ |
| 95 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 96 | public static final String ACTION_LOCATION_SOURCE_SETTINGS = |
| 97 | "android.settings.LOCATION_SOURCE_SETTINGS"; |
| 98 | |
| 99 | /** |
| 100 | * Activity Action: Show settings to allow configuration of wireless controls |
| 101 | * such as Wi-Fi, Bluetooth and Mobile networks. |
| 102 | * <p> |
| 103 | * In some cases, a matching Activity may not exist, so ensure you |
| 104 | * safeguard against this. |
| 105 | * <p> |
| 106 | * Input: Nothing. |
| 107 | * <p> |
| 108 | * Output: Nothing. |
| 109 | */ |
| 110 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 111 | public static final String ACTION_WIRELESS_SETTINGS = |
| 112 | "android.settings.WIRELESS_SETTINGS"; |
| 113 | |
| 114 | /** |
| 115 | * Activity Action: Show settings to allow entering/exiting airplane mode. |
| 116 | * <p> |
| 117 | * In some cases, a matching Activity may not exist, so ensure you |
| 118 | * safeguard against this. |
| 119 | * <p> |
| 120 | * Input: Nothing. |
| 121 | * <p> |
| 122 | * Output: Nothing. |
| 123 | */ |
| 124 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 125 | public static final String ACTION_AIRPLANE_MODE_SETTINGS = |
| 126 | "android.settings.AIRPLANE_MODE_SETTINGS"; |
| 127 | |
| 128 | /** |
Dianne Hackborn | dd9b82c | 2009-09-03 00:18:47 -0700 | [diff] [blame] | 129 | * Activity Action: Show settings for accessibility modules. |
| 130 | * <p> |
| 131 | * In some cases, a matching Activity may not exist, so ensure you |
| 132 | * safeguard against this. |
| 133 | * <p> |
| 134 | * Input: Nothing. |
| 135 | * <p> |
| 136 | * Output: Nothing. |
| 137 | */ |
| 138 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 139 | public static final String ACTION_ACCESSIBILITY_SETTINGS = |
| 140 | "android.settings.ACCESSIBILITY_SETTINGS"; |
| 141 | |
| 142 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 143 | * Activity Action: Show settings to allow configuration of security and |
| 144 | * location privacy. |
| 145 | * <p> |
| 146 | * In some cases, a matching Activity may not exist, so ensure you |
| 147 | * safeguard against this. |
| 148 | * <p> |
| 149 | * Input: Nothing. |
| 150 | * <p> |
| 151 | * Output: Nothing. |
| 152 | */ |
| 153 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 154 | public static final String ACTION_SECURITY_SETTINGS = |
| 155 | "android.settings.SECURITY_SETTINGS"; |
| 156 | |
| 157 | /** |
Amith Yamasani | c15255a | 2009-09-23 15:33:19 -0700 | [diff] [blame] | 158 | * Activity Action: Show settings to allow configuration of privacy options. |
| 159 | * <p> |
| 160 | * In some cases, a matching Activity may not exist, so ensure you |
| 161 | * safeguard against this. |
| 162 | * <p> |
| 163 | * Input: Nothing. |
| 164 | * <p> |
| 165 | * Output: Nothing. |
| 166 | */ |
| 167 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 168 | public static final String ACTION_PRIVACY_SETTINGS = |
| 169 | "android.settings.PRIVACY_SETTINGS"; |
| 170 | |
| 171 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 172 | * Activity Action: Show settings to allow configuration of Wi-Fi. |
| 173 | |
| 174 | * <p> |
| 175 | * In some cases, a matching Activity may not exist, so ensure you |
| 176 | * safeguard against this. |
| 177 | * <p> |
| 178 | * Input: Nothing. |
| 179 | * <p> |
| 180 | * Output: Nothing. |
| 181 | |
| 182 | */ |
| 183 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 184 | public static final String ACTION_WIFI_SETTINGS = |
| 185 | "android.settings.WIFI_SETTINGS"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 186 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 187 | /** |
| 188 | * Activity Action: Show settings to allow configuration of a static IP |
| 189 | * address for Wi-Fi. |
| 190 | * <p> |
| 191 | * In some cases, a matching Activity may not exist, so ensure you safeguard |
| 192 | * against this. |
| 193 | * <p> |
| 194 | * Input: Nothing. |
| 195 | * <p> |
| 196 | * Output: Nothing. |
| 197 | */ |
| 198 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 199 | public static final String ACTION_WIFI_IP_SETTINGS = |
| 200 | "android.settings.WIFI_IP_SETTINGS"; |
| 201 | |
| 202 | /** |
| 203 | * Activity Action: Show settings to allow configuration of Bluetooth. |
| 204 | * <p> |
| 205 | * In some cases, a matching Activity may not exist, so ensure you |
| 206 | * safeguard against this. |
| 207 | * <p> |
| 208 | * Input: Nothing. |
| 209 | * <p> |
| 210 | * Output: Nothing. |
| 211 | */ |
| 212 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 213 | public static final String ACTION_BLUETOOTH_SETTINGS = |
| 214 | "android.settings.BLUETOOTH_SETTINGS"; |
| 215 | |
| 216 | /** |
| 217 | * Activity Action: Show settings to allow configuration of date and time. |
| 218 | * <p> |
| 219 | * In some cases, a matching Activity may not exist, so ensure you |
| 220 | * safeguard against this. |
| 221 | * <p> |
| 222 | * Input: Nothing. |
| 223 | * <p> |
| 224 | * Output: Nothing. |
| 225 | */ |
| 226 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 227 | public static final String ACTION_DATE_SETTINGS = |
| 228 | "android.settings.DATE_SETTINGS"; |
| 229 | |
| 230 | /** |
| 231 | * Activity Action: Show settings to allow configuration of sound and volume. |
| 232 | * <p> |
| 233 | * In some cases, a matching Activity may not exist, so ensure you |
| 234 | * safeguard against this. |
| 235 | * <p> |
| 236 | * Input: Nothing. |
| 237 | * <p> |
| 238 | * Output: Nothing. |
| 239 | */ |
| 240 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 241 | public static final String ACTION_SOUND_SETTINGS = |
| 242 | "android.settings.SOUND_SETTINGS"; |
| 243 | |
| 244 | /** |
| 245 | * Activity Action: Show settings to allow configuration of display. |
| 246 | * <p> |
| 247 | * In some cases, a matching Activity may not exist, so ensure you |
| 248 | * safeguard against this. |
| 249 | * <p> |
| 250 | * Input: Nothing. |
| 251 | * <p> |
| 252 | * Output: Nothing. |
| 253 | */ |
| 254 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 255 | public static final String ACTION_DISPLAY_SETTINGS = |
| 256 | "android.settings.DISPLAY_SETTINGS"; |
| 257 | |
| 258 | /** |
| 259 | * Activity Action: Show settings to allow configuration of locale. |
| 260 | * <p> |
| 261 | * In some cases, a matching Activity may not exist, so ensure you |
| 262 | * safeguard against this. |
| 263 | * <p> |
| 264 | * Input: Nothing. |
| 265 | * <p> |
| 266 | * Output: Nothing. |
| 267 | */ |
| 268 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 269 | public static final String ACTION_LOCALE_SETTINGS = |
| 270 | "android.settings.LOCALE_SETTINGS"; |
| 271 | |
| 272 | /** |
| 273 | * Activity Action: Show settings to configure input methods, in particular |
| 274 | * allowing the user to enable input methods. |
| 275 | * <p> |
| 276 | * In some cases, a matching Activity may not exist, so ensure you |
| 277 | * safeguard against this. |
| 278 | * <p> |
| 279 | * Input: Nothing. |
| 280 | * <p> |
| 281 | * Output: Nothing. |
| 282 | */ |
| 283 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 284 | public static final String ACTION_INPUT_METHOD_SETTINGS = |
| 285 | "android.settings.INPUT_METHOD_SETTINGS"; |
| 286 | |
| 287 | /** |
Tadashi G. Takaoka | f49688f | 2011-01-20 17:56:13 +0900 | [diff] [blame] | 288 | * Activity Action: Show settings to enable/disable input method subtypes. |
satok | 86417ea | 2010-10-27 14:11:03 +0900 | [diff] [blame] | 289 | * <p> |
| 290 | * In some cases, a matching Activity may not exist, so ensure you |
| 291 | * safeguard against this. |
| 292 | * <p> |
Tadashi G. Takaoka | 2548020 | 2011-01-20 23:13:02 +0900 | [diff] [blame] | 293 | * To tell which input method's subtypes are displayed in the settings, add |
| 294 | * {@link #EXTRA_INPUT_METHOD_ID} extra to this Intent with the input method id. |
| 295 | * If there is no extra in this Intent, subtypes from all installed input methods |
| 296 | * will be displayed in the settings. |
| 297 | * |
| 298 | * @see android.view.inputmethod.InputMethodInfo#getId |
| 299 | * <p> |
satok | 86417ea | 2010-10-27 14:11:03 +0900 | [diff] [blame] | 300 | * Input: Nothing. |
| 301 | * <p> |
| 302 | * Output: Nothing. |
| 303 | */ |
| 304 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
Tadashi G. Takaoka | f49688f | 2011-01-20 17:56:13 +0900 | [diff] [blame] | 305 | public static final String ACTION_INPUT_METHOD_SUBTYPE_SETTINGS = |
| 306 | "android.settings.INPUT_METHOD_SUBTYPE_SETTINGS"; |
satok | 86417ea | 2010-10-27 14:11:03 +0900 | [diff] [blame] | 307 | |
| 308 | /** |
satok | 7cfc0ed | 2011-06-20 21:29:36 +0900 | [diff] [blame] | 309 | * Activity Action: Show a dialog to select input method. |
| 310 | * <p> |
| 311 | * In some cases, a matching Activity may not exist, so ensure you |
| 312 | * safeguard against this. |
| 313 | * <p> |
| 314 | * Input: Nothing. |
| 315 | * <p> |
| 316 | * Output: Nothing. |
| 317 | * @hide |
| 318 | */ |
| 319 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 320 | public static final String ACTION_SHOW_INPUT_METHOD_PICKER = |
| 321 | "android.settings.SHOW_INPUT_METHOD_PICKER"; |
| 322 | |
| 323 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 324 | * Activity Action: Show settings to manage the user input dictionary. |
| 325 | * <p> |
| 326 | * In some cases, a matching Activity may not exist, so ensure you |
| 327 | * safeguard against this. |
| 328 | * <p> |
| 329 | * Input: Nothing. |
| 330 | * <p> |
| 331 | * Output: Nothing. |
| 332 | */ |
| 333 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 334 | public static final String ACTION_USER_DICTIONARY_SETTINGS = |
| 335 | "android.settings.USER_DICTIONARY_SETTINGS"; |
| 336 | |
| 337 | /** |
Gilles Debunne | e90bed1 | 2011-08-30 14:28:27 -0700 | [diff] [blame] | 338 | * Activity Action: Adds a word to the user dictionary. |
| 339 | * <p> |
| 340 | * In some cases, a matching Activity may not exist, so ensure you |
| 341 | * safeguard against this. |
| 342 | * <p> |
| 343 | * Input: An extra with key <code>word</code> that contains the word |
| 344 | * that should be added to the dictionary. |
| 345 | * <p> |
| 346 | * Output: Nothing. |
| 347 | * |
| 348 | * @hide |
| 349 | */ |
| 350 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 351 | public static final String ACTION_USER_DICTIONARY_INSERT = |
| 352 | "com.android.settings.USER_DICTIONARY_INSERT"; |
| 353 | |
| 354 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 355 | * Activity Action: Show settings to allow configuration of application-related settings. |
| 356 | * <p> |
| 357 | * In some cases, a matching Activity may not exist, so ensure you |
| 358 | * safeguard against this. |
| 359 | * <p> |
| 360 | * Input: Nothing. |
| 361 | * <p> |
| 362 | * Output: Nothing. |
| 363 | */ |
| 364 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 365 | public static final String ACTION_APPLICATION_SETTINGS = |
| 366 | "android.settings.APPLICATION_SETTINGS"; |
| 367 | |
| 368 | /** |
| 369 | * Activity Action: Show settings to allow configuration of application |
| 370 | * development-related settings. |
| 371 | * <p> |
| 372 | * In some cases, a matching Activity may not exist, so ensure you safeguard |
| 373 | * against this. |
| 374 | * <p> |
| 375 | * Input: Nothing. |
| 376 | * <p> |
| 377 | * Output: Nothing. |
| 378 | */ |
| 379 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 380 | public static final String ACTION_APPLICATION_DEVELOPMENT_SETTINGS = |
| 381 | "android.settings.APPLICATION_DEVELOPMENT_SETTINGS"; |
| 382 | |
| 383 | /** |
| 384 | * Activity Action: Show settings to allow configuration of quick launch shortcuts. |
| 385 | * <p> |
| 386 | * In some cases, a matching Activity may not exist, so ensure you |
| 387 | * safeguard against this. |
| 388 | * <p> |
| 389 | * Input: Nothing. |
| 390 | * <p> |
| 391 | * Output: Nothing. |
| 392 | */ |
| 393 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 394 | public static final String ACTION_QUICK_LAUNCH_SETTINGS = |
| 395 | "android.settings.QUICK_LAUNCH_SETTINGS"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 396 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 397 | /** |
| 398 | * Activity Action: Show settings to manage installed applications. |
| 399 | * <p> |
| 400 | * In some cases, a matching Activity may not exist, so ensure you |
| 401 | * safeguard against this. |
| 402 | * <p> |
| 403 | * Input: Nothing. |
| 404 | * <p> |
| 405 | * Output: Nothing. |
| 406 | */ |
| 407 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 408 | public static final String ACTION_MANAGE_APPLICATIONS_SETTINGS = |
| 409 | "android.settings.MANAGE_APPLICATIONS_SETTINGS"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 410 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 411 | /** |
Winson Chung | 44e8ff9 | 2010-09-27 14:36:52 -0700 | [diff] [blame] | 412 | * Activity Action: Show settings to manage all applications. |
| 413 | * <p> |
| 414 | * In some cases, a matching Activity may not exist, so ensure you |
| 415 | * safeguard against this. |
| 416 | * <p> |
| 417 | * Input: Nothing. |
| 418 | * <p> |
| 419 | * Output: Nothing. |
| 420 | */ |
| 421 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 422 | public static final String ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS = |
| 423 | "android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS"; |
| 424 | |
| 425 | /** |
Dianne Hackborn | b7bb3b3 | 2010-06-06 22:47:50 -0700 | [diff] [blame] | 426 | * Activity Action: Show screen of details about a particular application. |
| 427 | * <p> |
| 428 | * In some cases, a matching Activity may not exist, so ensure you |
| 429 | * safeguard against this. |
| 430 | * <p> |
| 431 | * Input: The Intent's data URI specifies the application package name |
| 432 | * to be shown, with the "package" scheme. That is "package:com.my.app". |
| 433 | * <p> |
| 434 | * Output: Nothing. |
| 435 | */ |
| 436 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 437 | public static final String ACTION_APPLICATION_DETAILS_SETTINGS = |
| 438 | "android.settings.APPLICATION_DETAILS_SETTINGS"; |
| 439 | |
| 440 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 441 | * Activity Action: Show settings for system update functionality. |
| 442 | * <p> |
| 443 | * In some cases, a matching Activity may not exist, so ensure you |
| 444 | * safeguard against this. |
| 445 | * <p> |
| 446 | * Input: Nothing. |
| 447 | * <p> |
| 448 | * Output: Nothing. |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 449 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 450 | * @hide |
| 451 | */ |
| 452 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 453 | public static final String ACTION_SYSTEM_UPDATE_SETTINGS = |
| 454 | "android.settings.SYSTEM_UPDATE_SETTINGS"; |
| 455 | |
| 456 | /** |
| 457 | * Activity Action: Show settings to allow configuration of sync settings. |
| 458 | * <p> |
| 459 | * In some cases, a matching Activity may not exist, so ensure you |
| 460 | * safeguard against this. |
| 461 | * <p> |
Erik | eebc8e2 | 2010-02-18 13:27:19 -0800 | [diff] [blame] | 462 | * The account types available to add via the add account button may be restricted by adding an |
| 463 | * {@link #EXTRA_AUTHORITIES} extra to this Intent with one or more syncable content provider's |
| 464 | * authorities. Only account types which can sync with that content provider will be offered to |
| 465 | * the user. |
| 466 | * <p> |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 467 | * Input: Nothing. |
| 468 | * <p> |
| 469 | * Output: Nothing. |
| 470 | */ |
| 471 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 472 | public static final String ACTION_SYNC_SETTINGS = |
| 473 | "android.settings.SYNC_SETTINGS"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 474 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 475 | /** |
Erik | eebc8e2 | 2010-02-18 13:27:19 -0800 | [diff] [blame] | 476 | * Activity Action: Show add account screen for creating a new account. |
| 477 | * <p> |
| 478 | * In some cases, a matching Activity may not exist, so ensure you |
| 479 | * safeguard against this. |
| 480 | * <p> |
| 481 | * The account types available to add may be restricted by adding an {@link #EXTRA_AUTHORITIES} |
| 482 | * extra to the Intent with one or more syncable content provider's authorities. Only account |
| 483 | * types which can sync with that content provider will be offered to the user. |
| 484 | * <p> |
| 485 | * Input: Nothing. |
| 486 | * <p> |
| 487 | * Output: Nothing. |
| 488 | */ |
| 489 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 490 | public static final String ACTION_ADD_ACCOUNT = |
| 491 | "android.settings.ADD_ACCOUNT_SETTINGS"; |
| 492 | |
| 493 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 494 | * Activity Action: Show settings for selecting the network operator. |
| 495 | * <p> |
| 496 | * In some cases, a matching Activity may not exist, so ensure you |
| 497 | * safeguard against this. |
| 498 | * <p> |
| 499 | * Input: Nothing. |
| 500 | * <p> |
| 501 | * Output: Nothing. |
| 502 | */ |
| 503 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 504 | public static final String ACTION_NETWORK_OPERATOR_SETTINGS = |
| 505 | "android.settings.NETWORK_OPERATOR_SETTINGS"; |
| 506 | |
| 507 | /** |
| 508 | * Activity Action: Show settings for selection of 2G/3G. |
| 509 | * <p> |
| 510 | * In some cases, a matching Activity may not exist, so ensure you |
| 511 | * safeguard against this. |
| 512 | * <p> |
| 513 | * Input: Nothing. |
| 514 | * <p> |
| 515 | * Output: Nothing. |
| 516 | */ |
| 517 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 518 | public static final String ACTION_DATA_ROAMING_SETTINGS = |
| 519 | "android.settings.DATA_ROAMING_SETTINGS"; |
| 520 | |
| 521 | /** |
| 522 | * Activity Action: Show settings for internal storage. |
| 523 | * <p> |
| 524 | * In some cases, a matching Activity may not exist, so ensure you |
| 525 | * safeguard against this. |
| 526 | * <p> |
| 527 | * Input: Nothing. |
| 528 | * <p> |
| 529 | * Output: Nothing. |
| 530 | */ |
| 531 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 532 | public static final String ACTION_INTERNAL_STORAGE_SETTINGS = |
| 533 | "android.settings.INTERNAL_STORAGE_SETTINGS"; |
| 534 | /** |
| 535 | * Activity Action: Show settings for memory card storage. |
| 536 | * <p> |
| 537 | * In some cases, a matching Activity may not exist, so ensure you |
| 538 | * safeguard against this. |
| 539 | * <p> |
| 540 | * Input: Nothing. |
| 541 | * <p> |
| 542 | * Output: Nothing. |
| 543 | */ |
| 544 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 545 | public static final String ACTION_MEMORY_CARD_SETTINGS = |
| 546 | "android.settings.MEMORY_CARD_SETTINGS"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 547 | |
Justin Mattson | ef34035 | 2010-01-13 21:05:46 -0800 | [diff] [blame] | 548 | /** |
| 549 | * Activity Action: Show settings for global search. |
| 550 | * <p> |
| 551 | * In some cases, a matching Activity may not exist, so ensure you |
| 552 | * safeguard against this. |
| 553 | * <p> |
| 554 | * Input: Nothing. |
| 555 | * <p> |
| 556 | * Output: Nothing |
| 557 | */ |
| 558 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 559 | public static final String ACTION_SEARCH_SETTINGS = |
| 560 | "android.search.action.SEARCH_SETTINGS"; |
| 561 | |
Daniel Sandler | 9d8b876 | 2010-01-22 20:50:15 -0500 | [diff] [blame] | 562 | /** |
| 563 | * Activity Action: Show general device information settings (serial |
| 564 | * number, software version, phone number, etc.). |
| 565 | * <p> |
| 566 | * In some cases, a matching Activity may not exist, so ensure you |
| 567 | * safeguard against this. |
| 568 | * <p> |
| 569 | * Input: Nothing. |
| 570 | * <p> |
| 571 | * Output: Nothing |
| 572 | */ |
| 573 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 574 | public static final String ACTION_DEVICE_INFO_SETTINGS = |
| 575 | "android.settings.DEVICE_INFO_SETTINGS"; |
| 576 | |
Martijn Coenen | 9b3c83f | 2011-07-28 11:21:39 -0500 | [diff] [blame] | 577 | /** |
Nick Pelly | cccf01d | 2011-10-31 14:49:40 -0700 | [diff] [blame] | 578 | * Activity Action: Show NFC settings. |
| 579 | * <p> |
| 580 | * This shows UI that allows NFC to be turned on or off. |
Martijn Coenen | 9b3c83f | 2011-07-28 11:21:39 -0500 | [diff] [blame] | 581 | * <p> |
| 582 | * In some cases, a matching Activity may not exist, so ensure you |
| 583 | * safeguard against this. |
| 584 | * <p> |
| 585 | * Input: Nothing. |
| 586 | * <p> |
| 587 | * Output: Nothing |
Nick Pelly | cccf01d | 2011-10-31 14:49:40 -0700 | [diff] [blame] | 588 | * @see android.nfc.NfcAdapter#isEnabled() |
| 589 | */ |
| 590 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 591 | public static final String ACTION_NFC_SETTINGS = "android.settings.NFC_SETTINGS"; |
| 592 | |
| 593 | /** |
| 594 | * Activity Action: Show NFC Sharing settings. |
| 595 | * <p> |
| 596 | * This shows UI that allows NDEF Push (Android Beam) to be turned on or |
| 597 | * off. |
| 598 | * <p> |
| 599 | * In some cases, a matching Activity may not exist, so ensure you |
| 600 | * safeguard against this. |
| 601 | * <p> |
| 602 | * Input: Nothing. |
| 603 | * <p> |
| 604 | * Output: Nothing |
| 605 | * @see android.nfc.NfcAdapter#isNdefPushEnabled() |
Martijn Coenen | 9b3c83f | 2011-07-28 11:21:39 -0500 | [diff] [blame] | 606 | */ |
| 607 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 608 | public static final String ACTION_NFCSHARING_SETTINGS = |
| 609 | "android.settings.NFCSHARING_SETTINGS"; |
| 610 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 611 | // End of Intent actions for Settings |
| 612 | |
Erik | eebc8e2 | 2010-02-18 13:27:19 -0800 | [diff] [blame] | 613 | /** |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 614 | * @hide - Private call() method on SettingsProvider to read from 'system' table. |
| 615 | */ |
| 616 | public static final String CALL_METHOD_GET_SYSTEM = "GET_system"; |
| 617 | |
| 618 | /** |
| 619 | * @hide - Private call() method on SettingsProvider to read from 'secure' table. |
| 620 | */ |
| 621 | public static final String CALL_METHOD_GET_SECURE = "GET_secure"; |
| 622 | |
| 623 | /** |
Erik | eebc8e2 | 2010-02-18 13:27:19 -0800 | [diff] [blame] | 624 | * Activity Extra: Limit available options in launched activity based on the given authority. |
| 625 | * <p> |
| 626 | * This can be passed as an extra field in an Activity Intent with one or more syncable content |
| 627 | * provider's authorities as a String[]. This field is used by some intents to alter the |
| 628 | * behavior of the called activity. |
| 629 | * <p> |
| 630 | * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types available based |
| 631 | * on the authority given. |
| 632 | */ |
| 633 | public static final String EXTRA_AUTHORITIES = |
| 634 | "authorities"; |
| 635 | |
Tadashi G. Takaoka | 2548020 | 2011-01-20 23:13:02 +0900 | [diff] [blame] | 636 | public static final String EXTRA_INPUT_METHOD_ID = "input_method_id"; |
| 637 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 638 | private static final String JID_RESOURCE_PREFIX = "android"; |
| 639 | |
| 640 | public static final String AUTHORITY = "settings"; |
| 641 | |
| 642 | private static final String TAG = "Settings"; |
Joe Onorato | 43a1765 | 2011-04-06 19:22:23 -0700 | [diff] [blame] | 643 | private static final boolean LOCAL_LOGV = false || false; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 644 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 645 | public static class SettingNotFoundException extends AndroidException { |
| 646 | public SettingNotFoundException(String msg) { |
| 647 | super(msg); |
| 648 | } |
| 649 | } |
| 650 | |
| 651 | /** |
| 652 | * Common base for tables of name/value settings. |
| 653 | */ |
| 654 | public static class NameValueTable implements BaseColumns { |
| 655 | public static final String NAME = "name"; |
| 656 | public static final String VALUE = "value"; |
| 657 | |
| 658 | protected static boolean putString(ContentResolver resolver, Uri uri, |
| 659 | String name, String value) { |
| 660 | // The database will take care of replacing duplicates. |
| 661 | try { |
| 662 | ContentValues values = new ContentValues(); |
| 663 | values.put(NAME, name); |
| 664 | values.put(VALUE, value); |
| 665 | resolver.insert(uri, values); |
| 666 | return true; |
| 667 | } catch (SQLException e) { |
Dianne Hackborn | a33e3f7 | 2009-09-29 17:28:24 -0700 | [diff] [blame] | 668 | Log.w(TAG, "Can't set key " + name + " in " + uri, e); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 669 | return false; |
| 670 | } |
| 671 | } |
| 672 | |
| 673 | public static Uri getUriFor(Uri uri, String name) { |
| 674 | return Uri.withAppendedPath(uri, name); |
| 675 | } |
| 676 | } |
| 677 | |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 678 | // Thread-safe. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 679 | private static class NameValueCache { |
| 680 | private final String mVersionSystemProperty; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 681 | private final Uri mUri; |
| 682 | |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 683 | private static final String[] SELECT_VALUE = |
| 684 | new String[] { Settings.NameValueTable.VALUE }; |
| 685 | private static final String NAME_EQ_PLACEHOLDER = "name=?"; |
| 686 | |
| 687 | // Must synchronize on 'this' to access mValues and mValuesVersion. |
Dan Egnor | 799f721 | 2009-11-24 16:24:44 -0800 | [diff] [blame] | 688 | private final HashMap<String, String> mValues = new HashMap<String, String>(); |
| 689 | private long mValuesVersion = 0; |
| 690 | |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 691 | // Initially null; set lazily and held forever. Synchronized on 'this'. |
| 692 | private IContentProvider mContentProvider = null; |
| 693 | |
| 694 | // The method we'll call (or null, to not use) on the provider |
| 695 | // for the fast path of retrieving settings. |
| 696 | private final String mCallCommand; |
| 697 | |
| 698 | public NameValueCache(String versionSystemProperty, Uri uri, String callCommand) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 699 | mVersionSystemProperty = versionSystemProperty; |
| 700 | mUri = uri; |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 701 | mCallCommand = callCommand; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 702 | } |
| 703 | |
Dan Egnor | 799f721 | 2009-11-24 16:24:44 -0800 | [diff] [blame] | 704 | public String getString(ContentResolver cr, String name) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 705 | long newValuesVersion = SystemProperties.getLong(mVersionSystemProperty, 0); |
Dan Egnor | 799f721 | 2009-11-24 16:24:44 -0800 | [diff] [blame] | 706 | |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 707 | synchronized (this) { |
Dan Egnor | 799f721 | 2009-11-24 16:24:44 -0800 | [diff] [blame] | 708 | if (mValuesVersion != newValuesVersion) { |
| 709 | if (LOCAL_LOGV) { |
| 710 | Log.v(TAG, "invalidate [" + mUri.getLastPathSegment() + "]: current " + |
| 711 | newValuesVersion + " != cached " + mValuesVersion); |
| 712 | } |
| 713 | |
| 714 | mValues.clear(); |
| 715 | mValuesVersion = newValuesVersion; |
| 716 | } |
| 717 | |
| 718 | if (mValues.containsKey(name)) { |
| 719 | return mValues.get(name); // Could be null, that's OK -- negative caching |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 720 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 721 | } |
Dan Egnor | 799f721 | 2009-11-24 16:24:44 -0800 | [diff] [blame] | 722 | |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 723 | IContentProvider cp = null; |
| 724 | synchronized (this) { |
| 725 | cp = mContentProvider; |
| 726 | if (cp == null) { |
| 727 | cp = mContentProvider = cr.acquireProvider(mUri.getAuthority()); |
| 728 | } |
| 729 | } |
| 730 | |
| 731 | // Try the fast path first, not using query(). If this |
| 732 | // fails (alternate Settings provider that doesn't support |
| 733 | // this interface?) then we fall back to the query/table |
| 734 | // interface. |
| 735 | if (mCallCommand != null) { |
| 736 | try { |
| 737 | Bundle b = cp.call(mCallCommand, name, null); |
| 738 | if (b != null) { |
| 739 | String value = b.getPairValue(); |
| 740 | synchronized (this) { |
| 741 | mValues.put(name, value); |
| 742 | } |
| 743 | return value; |
| 744 | } |
| 745 | // If the response Bundle is null, we fall through |
| 746 | // to the query interface below. |
| 747 | } catch (RemoteException e) { |
| 748 | // Not supported by the remote side? Fall through |
| 749 | // to query(). |
| 750 | } |
| 751 | } |
| 752 | |
Dan Egnor | 799f721 | 2009-11-24 16:24:44 -0800 | [diff] [blame] | 753 | Cursor c = null; |
| 754 | try { |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 755 | c = cp.query(mUri, SELECT_VALUE, NAME_EQ_PLACEHOLDER, |
Jeff Brown | 75ea64f | 2012-01-25 19:37:13 -0800 | [diff] [blame] | 756 | new String[]{name}, null, null); |
Dan Egnor | 799f721 | 2009-11-24 16:24:44 -0800 | [diff] [blame] | 757 | if (c == null) { |
| 758 | Log.w(TAG, "Can't get key " + name + " from " + mUri); |
| 759 | return null; |
| 760 | } |
| 761 | |
| 762 | String value = c.moveToNext() ? c.getString(0) : null; |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 763 | synchronized (this) { |
Dan Egnor | 799f721 | 2009-11-24 16:24:44 -0800 | [diff] [blame] | 764 | mValues.put(name, value); |
| 765 | } |
| 766 | if (LOCAL_LOGV) { |
| 767 | Log.v(TAG, "cache miss [" + mUri.getLastPathSegment() + "]: " + |
| 768 | name + " = " + (value == null ? "(null)" : value)); |
| 769 | } |
| 770 | return value; |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 771 | } catch (RemoteException e) { |
Dan Egnor | 799f721 | 2009-11-24 16:24:44 -0800 | [diff] [blame] | 772 | Log.w(TAG, "Can't get key " + name + " from " + mUri, e); |
| 773 | return null; // Return null, but don't cache it. |
| 774 | } finally { |
| 775 | if (c != null) c.close(); |
| 776 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 777 | } |
| 778 | } |
| 779 | |
| 780 | /** |
| 781 | * System settings, containing miscellaneous system preferences. This |
| 782 | * table holds simple name/value pairs. There are convenience |
| 783 | * functions for accessing individual settings entries. |
| 784 | */ |
| 785 | public static final class System extends NameValueTable { |
| 786 | public static final String SYS_PROP_SETTING_VERSION = "sys.settings_system_version"; |
| 787 | |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 788 | // Populated lazily, guarded by class object: |
| 789 | private static NameValueCache sNameValueCache = null; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 790 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 791 | private static final HashSet<String> MOVED_TO_SECURE; |
| 792 | static { |
| 793 | MOVED_TO_SECURE = new HashSet<String>(30); |
| 794 | MOVED_TO_SECURE.add(Secure.ADB_ENABLED); |
| 795 | MOVED_TO_SECURE.add(Secure.ANDROID_ID); |
| 796 | MOVED_TO_SECURE.add(Secure.BLUETOOTH_ON); |
| 797 | MOVED_TO_SECURE.add(Secure.DATA_ROAMING); |
| 798 | MOVED_TO_SECURE.add(Secure.DEVICE_PROVISIONED); |
| 799 | MOVED_TO_SECURE.add(Secure.HTTP_PROXY); |
| 800 | MOVED_TO_SECURE.add(Secure.INSTALL_NON_MARKET_APPS); |
| 801 | MOVED_TO_SECURE.add(Secure.LOCATION_PROVIDERS_ALLOWED); |
Danielle Millett | 925a7d8 | 2012-03-19 18:02:20 -0400 | [diff] [blame] | 802 | MOVED_TO_SECURE.add(Secure.LOCK_BIOMETRIC_WEAK_FLAGS); |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 803 | MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_ENABLED); |
| 804 | MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_VISIBLE); |
| 805 | MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 806 | MOVED_TO_SECURE.add(Secure.LOGGING_ID); |
| 807 | MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_ENABLED); |
| 808 | MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_LAST_UPDATE); |
| 809 | MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_REDIRECT_URL); |
| 810 | MOVED_TO_SECURE.add(Secure.SETTINGS_CLASSNAME); |
| 811 | MOVED_TO_SECURE.add(Secure.USB_MASS_STORAGE_ENABLED); |
| 812 | MOVED_TO_SECURE.add(Secure.USE_GOOGLE_MAIL); |
| 813 | MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON); |
| 814 | MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY); |
| 815 | MOVED_TO_SECURE.add(Secure.WIFI_NUM_OPEN_NETWORKS_KEPT); |
| 816 | MOVED_TO_SECURE.add(Secure.WIFI_ON); |
| 817 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE); |
| 818 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_AP_COUNT); |
| 819 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS); |
| 820 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED); |
| 821 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS); |
| 822 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT); |
| 823 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_MAX_AP_CHECKS); |
| 824 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ON); |
| 825 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_COUNT); |
| 826 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_DELAY_MS); |
| 827 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS); |
| 828 | } |
| 829 | |
| 830 | /** |
| 831 | * Look up a name in the database. |
| 832 | * @param resolver to access the database with |
| 833 | * @param name to look up in the table |
| 834 | * @return the corresponding value, or null if not present |
| 835 | */ |
| 836 | public synchronized static String getString(ContentResolver resolver, String name) { |
| 837 | if (MOVED_TO_SECURE.contains(name)) { |
| 838 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" |
| 839 | + " to android.provider.Settings.Secure, returning read-only value."); |
| 840 | return Secure.getString(resolver, name); |
| 841 | } |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 842 | if (sNameValueCache == null) { |
| 843 | sNameValueCache = new NameValueCache(SYS_PROP_SETTING_VERSION, CONTENT_URI, |
| 844 | CALL_METHOD_GET_SYSTEM); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 845 | } |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 846 | return sNameValueCache.getString(resolver, name); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 847 | } |
| 848 | |
| 849 | /** |
| 850 | * Store a name/value pair into the database. |
| 851 | * @param resolver to access the database with |
| 852 | * @param name to store |
| 853 | * @param value to associate with the name |
| 854 | * @return true if the value was set, false on database errors |
| 855 | */ |
| 856 | public static boolean putString(ContentResolver resolver, String name, String value) { |
| 857 | if (MOVED_TO_SECURE.contains(name)) { |
| 858 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" |
| 859 | + " to android.provider.Settings.Secure, value is unchanged."); |
| 860 | return false; |
| 861 | } |
| 862 | return putString(resolver, CONTENT_URI, name, value); |
| 863 | } |
| 864 | |
| 865 | /** |
| 866 | * Construct the content URI for a particular name/value pair, |
| 867 | * useful for monitoring changes with a ContentObserver. |
| 868 | * @param name to look up in the table |
| 869 | * @return the corresponding content URI, or null if not present |
| 870 | */ |
| 871 | public static Uri getUriFor(String name) { |
| 872 | if (MOVED_TO_SECURE.contains(name)) { |
| 873 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" |
| 874 | + " to android.provider.Settings.Secure, returning Secure URI."); |
| 875 | return Secure.getUriFor(Secure.CONTENT_URI, name); |
| 876 | } |
| 877 | return getUriFor(CONTENT_URI, name); |
| 878 | } |
| 879 | |
| 880 | /** |
| 881 | * Convenience function for retrieving a single system settings value |
| 882 | * as an integer. Note that internally setting values are always |
| 883 | * stored as strings; this function converts the string to an integer |
| 884 | * for you. The default value will be returned if the setting is |
| 885 | * not defined or not an integer. |
| 886 | * |
| 887 | * @param cr The ContentResolver to access. |
| 888 | * @param name The name of the setting to retrieve. |
| 889 | * @param def Value to return if the setting is not defined. |
| 890 | * |
| 891 | * @return The setting's current value, or 'def' if it is not defined |
| 892 | * or not a valid integer. |
| 893 | */ |
| 894 | public static int getInt(ContentResolver cr, String name, int def) { |
| 895 | String v = getString(cr, name); |
| 896 | try { |
| 897 | return v != null ? Integer.parseInt(v) : def; |
| 898 | } catch (NumberFormatException e) { |
| 899 | return def; |
| 900 | } |
| 901 | } |
| 902 | |
| 903 | /** |
| 904 | * Convenience function for retrieving a single system settings value |
| 905 | * as an integer. Note that internally setting values are always |
| 906 | * stored as strings; this function converts the string to an integer |
| 907 | * for you. |
| 908 | * <p> |
| 909 | * This version does not take a default value. If the setting has not |
| 910 | * been set, or the string value is not a number, |
| 911 | * it throws {@link SettingNotFoundException}. |
| 912 | * |
| 913 | * @param cr The ContentResolver to access. |
| 914 | * @param name The name of the setting to retrieve. |
| 915 | * |
| 916 | * @throws SettingNotFoundException Thrown if a setting by the given |
| 917 | * name can't be found or the setting value is not an integer. |
| 918 | * |
| 919 | * @return The setting's current value. |
| 920 | */ |
| 921 | public static int getInt(ContentResolver cr, String name) |
| 922 | throws SettingNotFoundException { |
| 923 | String v = getString(cr, name); |
| 924 | try { |
| 925 | return Integer.parseInt(v); |
| 926 | } catch (NumberFormatException e) { |
| 927 | throw new SettingNotFoundException(name); |
| 928 | } |
| 929 | } |
| 930 | |
| 931 | /** |
| 932 | * Convenience function for updating a single settings value as an |
| 933 | * integer. This will either create a new entry in the table if the |
| 934 | * given name does not exist, or modify the value of the existing row |
| 935 | * with that name. Note that internally setting values are always |
| 936 | * stored as strings, so this function converts the given value to a |
| 937 | * string before storing it. |
| 938 | * |
| 939 | * @param cr The ContentResolver to access. |
| 940 | * @param name The name of the setting to modify. |
| 941 | * @param value The new value for the setting. |
| 942 | * @return true if the value was set, false on database errors |
| 943 | */ |
| 944 | public static boolean putInt(ContentResolver cr, String name, int value) { |
| 945 | return putString(cr, name, Integer.toString(value)); |
| 946 | } |
| 947 | |
| 948 | /** |
| 949 | * Convenience function for retrieving a single system settings value |
| 950 | * as a {@code long}. Note that internally setting values are always |
| 951 | * stored as strings; this function converts the string to a {@code long} |
| 952 | * for you. The default value will be returned if the setting is |
| 953 | * not defined or not a {@code long}. |
| 954 | * |
| 955 | * @param cr The ContentResolver to access. |
| 956 | * @param name The name of the setting to retrieve. |
| 957 | * @param def Value to return if the setting is not defined. |
| 958 | * |
| 959 | * @return The setting's current value, or 'def' if it is not defined |
| 960 | * or not a valid {@code long}. |
| 961 | */ |
| 962 | public static long getLong(ContentResolver cr, String name, long def) { |
| 963 | String valString = getString(cr, name); |
| 964 | long value; |
| 965 | try { |
| 966 | value = valString != null ? Long.parseLong(valString) : def; |
| 967 | } catch (NumberFormatException e) { |
| 968 | value = def; |
| 969 | } |
| 970 | return value; |
| 971 | } |
| 972 | |
| 973 | /** |
| 974 | * Convenience function for retrieving a single system settings value |
| 975 | * as a {@code long}. Note that internally setting values are always |
| 976 | * stored as strings; this function converts the string to a {@code long} |
| 977 | * for you. |
| 978 | * <p> |
| 979 | * This version does not take a default value. If the setting has not |
| 980 | * been set, or the string value is not a number, |
| 981 | * it throws {@link SettingNotFoundException}. |
| 982 | * |
| 983 | * @param cr The ContentResolver to access. |
| 984 | * @param name The name of the setting to retrieve. |
| 985 | * |
| 986 | * @return The setting's current value. |
| 987 | * @throws SettingNotFoundException Thrown if a setting by the given |
| 988 | * name can't be found or the setting value is not an integer. |
| 989 | */ |
| 990 | public static long getLong(ContentResolver cr, String name) |
| 991 | throws SettingNotFoundException { |
| 992 | String valString = getString(cr, name); |
| 993 | try { |
| 994 | return Long.parseLong(valString); |
| 995 | } catch (NumberFormatException e) { |
| 996 | throw new SettingNotFoundException(name); |
| 997 | } |
| 998 | } |
| 999 | |
| 1000 | /** |
| 1001 | * Convenience function for updating a single settings value as a long |
| 1002 | * integer. This will either create a new entry in the table if the |
| 1003 | * given name does not exist, or modify the value of the existing row |
| 1004 | * with that name. Note that internally setting values are always |
| 1005 | * stored as strings, so this function converts the given value to a |
| 1006 | * string before storing it. |
| 1007 | * |
| 1008 | * @param cr The ContentResolver to access. |
| 1009 | * @param name The name of the setting to modify. |
| 1010 | * @param value The new value for the setting. |
| 1011 | * @return true if the value was set, false on database errors |
| 1012 | */ |
| 1013 | public static boolean putLong(ContentResolver cr, String name, long value) { |
| 1014 | return putString(cr, name, Long.toString(value)); |
| 1015 | } |
| 1016 | |
| 1017 | /** |
| 1018 | * Convenience function for retrieving a single system settings value |
| 1019 | * as a floating point number. Note that internally setting values are |
| 1020 | * always stored as strings; this function converts the string to an |
| 1021 | * float for you. The default value will be returned if the setting |
| 1022 | * is not defined or not a valid float. |
| 1023 | * |
| 1024 | * @param cr The ContentResolver to access. |
| 1025 | * @param name The name of the setting to retrieve. |
| 1026 | * @param def Value to return if the setting is not defined. |
| 1027 | * |
| 1028 | * @return The setting's current value, or 'def' if it is not defined |
| 1029 | * or not a valid float. |
| 1030 | */ |
| 1031 | public static float getFloat(ContentResolver cr, String name, float def) { |
| 1032 | String v = getString(cr, name); |
| 1033 | try { |
| 1034 | return v != null ? Float.parseFloat(v) : def; |
| 1035 | } catch (NumberFormatException e) { |
| 1036 | return def; |
| 1037 | } |
| 1038 | } |
| 1039 | |
| 1040 | /** |
| 1041 | * Convenience function for retrieving a single system settings value |
| 1042 | * as a float. Note that internally setting values are always |
| 1043 | * stored as strings; this function converts the string to a float |
| 1044 | * for you. |
| 1045 | * <p> |
| 1046 | * This version does not take a default value. If the setting has not |
| 1047 | * been set, or the string value is not a number, |
| 1048 | * it throws {@link SettingNotFoundException}. |
| 1049 | * |
| 1050 | * @param cr The ContentResolver to access. |
| 1051 | * @param name The name of the setting to retrieve. |
| 1052 | * |
| 1053 | * @throws SettingNotFoundException Thrown if a setting by the given |
| 1054 | * name can't be found or the setting value is not a float. |
| 1055 | * |
| 1056 | * @return The setting's current value. |
| 1057 | */ |
| 1058 | public static float getFloat(ContentResolver cr, String name) |
| 1059 | throws SettingNotFoundException { |
| 1060 | String v = getString(cr, name); |
Brian Muramatsu | e1d4698 | 2010-12-06 17:34:20 -0800 | [diff] [blame] | 1061 | if (v == null) { |
| 1062 | throw new SettingNotFoundException(name); |
| 1063 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1064 | try { |
| 1065 | return Float.parseFloat(v); |
| 1066 | } catch (NumberFormatException e) { |
| 1067 | throw new SettingNotFoundException(name); |
| 1068 | } |
| 1069 | } |
| 1070 | |
| 1071 | /** |
| 1072 | * Convenience function for updating a single settings value as a |
| 1073 | * floating point number. This will either create a new entry in the |
| 1074 | * table if the given name does not exist, or modify the value of the |
| 1075 | * existing row with that name. Note that internally setting values |
| 1076 | * are always stored as strings, so this function converts the given |
| 1077 | * value to a string before storing it. |
| 1078 | * |
| 1079 | * @param cr The ContentResolver to access. |
| 1080 | * @param name The name of the setting to modify. |
| 1081 | * @param value The new value for the setting. |
| 1082 | * @return true if the value was set, false on database errors |
| 1083 | */ |
| 1084 | public static boolean putFloat(ContentResolver cr, String name, float value) { |
| 1085 | return putString(cr, name, Float.toString(value)); |
| 1086 | } |
| 1087 | |
| 1088 | /** |
| 1089 | * Convenience function to read all of the current |
| 1090 | * configuration-related settings into a |
| 1091 | * {@link Configuration} object. |
| 1092 | * |
| 1093 | * @param cr The ContentResolver to access. |
| 1094 | * @param outConfig Where to place the configuration settings. |
| 1095 | */ |
| 1096 | public static void getConfiguration(ContentResolver cr, Configuration outConfig) { |
| 1097 | outConfig.fontScale = Settings.System.getFloat( |
| 1098 | cr, FONT_SCALE, outConfig.fontScale); |
| 1099 | if (outConfig.fontScale < 0) { |
| 1100 | outConfig.fontScale = 1; |
| 1101 | } |
| 1102 | } |
| 1103 | |
| 1104 | /** |
Dianne Hackborn | 31ca854 | 2011-07-19 14:58:28 -0700 | [diff] [blame] | 1105 | * @hide Erase the fields in the Configuration that should be applied |
| 1106 | * by the settings. |
| 1107 | */ |
| 1108 | public static void clearConfiguration(Configuration inoutConfig) { |
| 1109 | inoutConfig.fontScale = 0; |
| 1110 | } |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 1111 | |
Dianne Hackborn | 31ca854 | 2011-07-19 14:58:28 -0700 | [diff] [blame] | 1112 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1113 | * Convenience function to write a batch of configuration-related |
| 1114 | * settings from a {@link Configuration} object. |
| 1115 | * |
| 1116 | * @param cr The ContentResolver to access. |
| 1117 | * @param config The settings to write. |
| 1118 | * @return true if the values were set, false on database errors |
| 1119 | */ |
| 1120 | public static boolean putConfiguration(ContentResolver cr, Configuration config) { |
| 1121 | return Settings.System.putFloat(cr, FONT_SCALE, config.fontScale); |
| 1122 | } |
| 1123 | |
Dianne Hackborn | b8b11a0 | 2010-03-10 15:53:11 -0800 | [diff] [blame] | 1124 | /** @hide */ |
| 1125 | public static boolean hasInterestingConfigurationChanges(int changes) { |
| 1126 | return (changes&ActivityInfo.CONFIG_FONT_SCALE) != 0; |
| 1127 | } |
Jaikumar Ganesh | 545e670 | 2010-06-04 10:23:03 -0700 | [diff] [blame] | 1128 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1129 | public static boolean getShowGTalkServiceStatus(ContentResolver cr) { |
| 1130 | return getInt(cr, SHOW_GTALK_SERVICE_STATUS, 0) != 0; |
| 1131 | } |
| 1132 | |
| 1133 | public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag) { |
| 1134 | putInt(cr, SHOW_GTALK_SERVICE_STATUS, flag ? 1 : 0); |
| 1135 | } |
| 1136 | |
| 1137 | /** |
| 1138 | * The content:// style URL for this table |
| 1139 | */ |
| 1140 | public static final Uri CONTENT_URI = |
| 1141 | Uri.parse("content://" + AUTHORITY + "/system"); |
| 1142 | |
| 1143 | /** |
| 1144 | * Whether we keep the device on while the device is plugged in. |
| 1145 | * Supported values are: |
| 1146 | * <ul> |
| 1147 | * <li>{@code 0} to never stay on while plugged in</li> |
| 1148 | * <li>{@link BatteryManager#BATTERY_PLUGGED_AC} to stay on for AC charger</li> |
| 1149 | * <li>{@link BatteryManager#BATTERY_PLUGGED_USB} to stay on for USB charger</li> |
| 1150 | * </ul> |
| 1151 | * These values can be OR-ed together. |
| 1152 | */ |
| 1153 | public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in"; |
| 1154 | |
| 1155 | /** |
| 1156 | * What happens when the user presses the end call button if they're not |
| 1157 | * on a call.<br/> |
| 1158 | * <b>Values:</b><br/> |
| 1159 | * 0 - The end button does nothing.<br/> |
| 1160 | * 1 - The end button goes to the home screen.<br/> |
| 1161 | * 2 - The end button puts the device to sleep and locks the keyguard.<br/> |
| 1162 | * 3 - The end button goes to the home screen. If the user is already on the |
| 1163 | * home screen, it puts the device to sleep. |
| 1164 | */ |
| 1165 | public static final String END_BUTTON_BEHAVIOR = "end_button_behavior"; |
| 1166 | |
| 1167 | /** |
David Brown | 458e806 | 2010-03-08 21:52:11 -0800 | [diff] [blame] | 1168 | * END_BUTTON_BEHAVIOR value for "go home". |
| 1169 | * @hide |
| 1170 | */ |
| 1171 | public static final int END_BUTTON_BEHAVIOR_HOME = 0x1; |
| 1172 | |
| 1173 | /** |
| 1174 | * END_BUTTON_BEHAVIOR value for "go to sleep". |
| 1175 | * @hide |
| 1176 | */ |
| 1177 | public static final int END_BUTTON_BEHAVIOR_SLEEP = 0x2; |
| 1178 | |
| 1179 | /** |
| 1180 | * END_BUTTON_BEHAVIOR default value. |
| 1181 | * @hide |
| 1182 | */ |
| 1183 | public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_SLEEP; |
| 1184 | |
| 1185 | /** |
Joe Onorato | 9cdffa1 | 2011-04-06 18:27:27 -0700 | [diff] [blame] | 1186 | * Is advanced settings mode turned on. 0 == no, 1 == yes |
| 1187 | * @hide |
| 1188 | */ |
| 1189 | public static final String ADVANCED_SETTINGS = "advanced_settings"; |
| 1190 | |
| 1191 | /** |
| 1192 | * ADVANCED_SETTINGS default value. |
| 1193 | * @hide |
| 1194 | */ |
| 1195 | public static final int ADVANCED_SETTINGS_DEFAULT = 0; |
| 1196 | |
| 1197 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1198 | * Whether Airplane Mode is on. |
| 1199 | */ |
| 1200 | public static final String AIRPLANE_MODE_ON = "airplane_mode_on"; |
| 1201 | |
| 1202 | /** |
| 1203 | * Constant for use in AIRPLANE_MODE_RADIOS to specify Bluetooth radio. |
| 1204 | */ |
| 1205 | public static final String RADIO_BLUETOOTH = "bluetooth"; |
| 1206 | |
| 1207 | /** |
| 1208 | * Constant for use in AIRPLANE_MODE_RADIOS to specify Wi-Fi radio. |
| 1209 | */ |
| 1210 | public static final String RADIO_WIFI = "wifi"; |
| 1211 | |
Robert Greenwalt | 8588e47 | 2011-11-08 10:12:25 -0800 | [diff] [blame] | 1212 | /** |
| 1213 | * {@hide} |
| 1214 | */ |
tk.mun | 148c7d0 | 2011-10-13 22:51:57 +0900 | [diff] [blame] | 1215 | public static final String RADIO_WIMAX = "wimax"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1216 | /** |
| 1217 | * Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio. |
| 1218 | */ |
| 1219 | public static final String RADIO_CELL = "cell"; |
| 1220 | |
| 1221 | /** |
Nick Pelly | 8d32a01 | 2011-08-09 07:03:49 -0700 | [diff] [blame] | 1222 | * Constant for use in AIRPLANE_MODE_RADIOS to specify NFC radio. |
| 1223 | */ |
| 1224 | public static final String RADIO_NFC = "nfc"; |
| 1225 | |
| 1226 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1227 | * A comma separated list of radios that need to be disabled when airplane mode |
| 1228 | * is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are |
| 1229 | * included in the comma separated list. |
| 1230 | */ |
| 1231 | public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios"; |
| 1232 | |
| 1233 | /** |
Mike Lockwood | bd5ddf0 | 2009-07-29 21:37:14 -0700 | [diff] [blame] | 1234 | * A comma separated list of radios that should to be disabled when airplane mode |
| 1235 | * is on, but can be manually reenabled by the user. For example, if RADIO_WIFI is |
| 1236 | * added to both AIRPLANE_MODE_RADIOS and AIRPLANE_MODE_TOGGLEABLE_RADIOS, then Wifi |
| 1237 | * will be turned off when entering airplane mode, but the user will be able to reenable |
| 1238 | * Wifi in the Settings app. |
| 1239 | * |
| 1240 | * {@hide} |
| 1241 | */ |
| 1242 | public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios"; |
| 1243 | |
| 1244 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1245 | * The policy for deciding when Wi-Fi should go to sleep (which will in |
| 1246 | * turn switch to using the mobile data as an Internet connection). |
| 1247 | * <p> |
| 1248 | * Set to one of {@link #WIFI_SLEEP_POLICY_DEFAULT}, |
| 1249 | * {@link #WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED}, or |
| 1250 | * {@link #WIFI_SLEEP_POLICY_NEVER}. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1251 | */ |
| 1252 | public static final String WIFI_SLEEP_POLICY = "wifi_sleep_policy"; |
| 1253 | |
| 1254 | /** |
| 1255 | * Value for {@link #WIFI_SLEEP_POLICY} to use the default Wi-Fi sleep |
| 1256 | * policy, which is to sleep shortly after the turning off |
| 1257 | * according to the {@link #STAY_ON_WHILE_PLUGGED_IN} setting. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1258 | */ |
| 1259 | public static final int WIFI_SLEEP_POLICY_DEFAULT = 0; |
| 1260 | |
| 1261 | /** |
| 1262 | * Value for {@link #WIFI_SLEEP_POLICY} to use the default policy when |
| 1263 | * the device is on battery, and never go to sleep when the device is |
| 1264 | * plugged in. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1265 | */ |
| 1266 | public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 1267 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1268 | /** |
| 1269 | * Value for {@link #WIFI_SLEEP_POLICY} to never go to sleep. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1270 | */ |
| 1271 | public static final int WIFI_SLEEP_POLICY_NEVER = 2; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 1272 | |
Irfan Sheriff | 31b6232 | 2010-08-30 12:26:00 -0700 | [diff] [blame] | 1273 | //TODO: deprecate static IP constants |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1274 | /** |
| 1275 | * Whether to use static IP and other static network attributes. |
| 1276 | * <p> |
| 1277 | * Set to 1 for true and 0 for false. |
| 1278 | */ |
| 1279 | public static final String WIFI_USE_STATIC_IP = "wifi_use_static_ip"; |
| 1280 | |
| 1281 | /** |
| 1282 | * The static IP address. |
| 1283 | * <p> |
| 1284 | * Example: "192.168.1.51" |
| 1285 | */ |
| 1286 | public static final String WIFI_STATIC_IP = "wifi_static_ip"; |
| 1287 | |
| 1288 | /** |
| 1289 | * If using static IP, the gateway's IP address. |
| 1290 | * <p> |
| 1291 | * Example: "192.168.1.1" |
| 1292 | */ |
| 1293 | public static final String WIFI_STATIC_GATEWAY = "wifi_static_gateway"; |
| 1294 | |
| 1295 | /** |
| 1296 | * If using static IP, the net mask. |
| 1297 | * <p> |
| 1298 | * Example: "255.255.255.0" |
| 1299 | */ |
| 1300 | public static final String WIFI_STATIC_NETMASK = "wifi_static_netmask"; |
| 1301 | |
| 1302 | /** |
| 1303 | * If using static IP, the primary DNS's IP address. |
| 1304 | * <p> |
| 1305 | * Example: "192.168.1.1" |
| 1306 | */ |
| 1307 | public static final String WIFI_STATIC_DNS1 = "wifi_static_dns1"; |
| 1308 | |
| 1309 | /** |
| 1310 | * If using static IP, the secondary DNS's IP address. |
| 1311 | * <p> |
| 1312 | * Example: "192.168.1.2" |
| 1313 | */ |
| 1314 | public static final String WIFI_STATIC_DNS2 = "wifi_static_dns2"; |
| 1315 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1316 | |
| 1317 | /** |
| 1318 | * Determines whether remote devices may discover and/or connect to |
| 1319 | * this device. |
| 1320 | * <P>Type: INT</P> |
| 1321 | * 2 -- discoverable and connectable |
| 1322 | * 1 -- connectable but not discoverable |
| 1323 | * 0 -- neither connectable nor discoverable |
| 1324 | */ |
| 1325 | public static final String BLUETOOTH_DISCOVERABILITY = |
| 1326 | "bluetooth_discoverability"; |
| 1327 | |
| 1328 | /** |
| 1329 | * Bluetooth discoverability timeout. If this value is nonzero, then |
| 1330 | * Bluetooth becomes discoverable for a certain number of seconds, |
| 1331 | * after which is becomes simply connectable. The value is in seconds. |
| 1332 | */ |
| 1333 | public static final String BLUETOOTH_DISCOVERABILITY_TIMEOUT = |
| 1334 | "bluetooth_discoverability_timeout"; |
| 1335 | |
| 1336 | /** |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 1337 | * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_ENABLED} |
| 1338 | * instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1339 | */ |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 1340 | @Deprecated |
| 1341 | public static final String LOCK_PATTERN_ENABLED = Secure.LOCK_PATTERN_ENABLED; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1342 | |
| 1343 | /** |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 1344 | * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_VISIBLE} |
| 1345 | * instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1346 | */ |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 1347 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1348 | public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern"; |
| 1349 | |
| 1350 | /** |
Jaikumar Ganesh | 545e670 | 2010-06-04 10:23:03 -0700 | [diff] [blame] | 1351 | * @deprecated Use |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 1352 | * {@link android.provider.Settings.Secure#LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED} |
| 1353 | * instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1354 | */ |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 1355 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1356 | public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = |
| 1357 | "lock_pattern_tactile_feedback_enabled"; |
| 1358 | |
| 1359 | |
| 1360 | /** |
| 1361 | * A formatted string of the next alarm that is set, or the empty string |
| 1362 | * if there is no alarm set. |
| 1363 | */ |
| 1364 | public static final String NEXT_ALARM_FORMATTED = "next_alarm_formatted"; |
| 1365 | |
| 1366 | /** |
| 1367 | * Scaling factor for fonts, float. |
| 1368 | */ |
| 1369 | public static final String FONT_SCALE = "font_scale"; |
| 1370 | |
| 1371 | /** |
| 1372 | * Name of an application package to be debugged. |
| 1373 | */ |
| 1374 | public static final String DEBUG_APP = "debug_app"; |
| 1375 | |
| 1376 | /** |
| 1377 | * If 1, when launching DEBUG_APP it will wait for the debugger before |
| 1378 | * starting user code. If 0, it will run normally. |
| 1379 | */ |
| 1380 | public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger"; |
| 1381 | |
| 1382 | /** |
| 1383 | * Whether or not to dim the screen. 0=no 1=yes |
| 1384 | */ |
| 1385 | public static final String DIM_SCREEN = "dim_screen"; |
| 1386 | |
| 1387 | /** |
| 1388 | * The timeout before the screen turns off. |
| 1389 | */ |
| 1390 | public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout"; |
| 1391 | |
| 1392 | /** |
Mitsuru Oshima | e5fb328 | 2009-06-09 21:16:08 -0700 | [diff] [blame] | 1393 | * If 0, the compatibility mode is off for all applications. |
| 1394 | * If 1, older applications run under compatibility mode. |
| 1395 | * TODO: remove this settings before code freeze (bug/1907571) |
| 1396 | * @hide |
| 1397 | */ |
| 1398 | public static final String COMPATIBILITY_MODE = "compatibility_mode"; |
| 1399 | |
| 1400 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1401 | * The screen backlight brightness between 0 and 255. |
| 1402 | */ |
| 1403 | public static final String SCREEN_BRIGHTNESS = "screen_brightness"; |
| 1404 | |
| 1405 | /** |
Dan Murphy | 951764b | 2009-08-27 14:59:03 -0500 | [diff] [blame] | 1406 | * Control whether to enable automatic brightness mode. |
Dan Murphy | 951764b | 2009-08-27 14:59:03 -0500 | [diff] [blame] | 1407 | */ |
| 1408 | public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode"; |
| 1409 | |
| 1410 | /** |
Dianne Hackborn | d9ea468 | 2012-01-20 18:36:40 -0800 | [diff] [blame] | 1411 | * Adjustment to auto-brightness to make it generally more (>0.0 <1.0) |
| 1412 | * or less (<0.0 >-1.0) bright. |
| 1413 | */ |
| 1414 | public static final String SCREEN_AUTO_BRIGHTNESS_ADJ = "screen_auto_brightness_adj"; |
| 1415 | |
| 1416 | /** |
Mike Lockwood | dc3494e | 2009-10-14 21:17:09 -0700 | [diff] [blame] | 1417 | * SCREEN_BRIGHTNESS_MODE value for manual mode. |
Mike Lockwood | dc3494e | 2009-10-14 21:17:09 -0700 | [diff] [blame] | 1418 | */ |
| 1419 | public static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0; |
| 1420 | |
| 1421 | /** |
Scott Main | 52bfc24 | 2012-02-09 10:09:14 -0800 | [diff] [blame] | 1422 | * SCREEN_BRIGHTNESS_MODE value for automatic mode. |
Mike Lockwood | dc3494e | 2009-10-14 21:17:09 -0700 | [diff] [blame] | 1423 | */ |
| 1424 | public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1; |
| 1425 | |
| 1426 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1427 | * Control whether the process CPU usage meter should be shown. |
| 1428 | */ |
| 1429 | public static final String SHOW_PROCESSES = "show_processes"; |
| 1430 | |
| 1431 | /** |
| 1432 | * If 1, the activity manager will aggressively finish activities and |
| 1433 | * processes as soon as they are no longer needed. If 0, the normal |
| 1434 | * extended lifetime is used. |
| 1435 | */ |
| 1436 | public static final String ALWAYS_FINISH_ACTIVITIES = |
| 1437 | "always_finish_activities"; |
| 1438 | |
| 1439 | |
| 1440 | /** |
| 1441 | * Ringer mode. This is used internally, changing this value will not |
| 1442 | * change the ringer mode. See AudioManager. |
| 1443 | */ |
| 1444 | public static final String MODE_RINGER = "mode_ringer"; |
| 1445 | |
| 1446 | /** |
| 1447 | * Determines which streams are affected by ringer mode changes. The |
| 1448 | * stream type's bit should be set to 1 if it should be muted when going |
| 1449 | * into an inaudible ringer mode. |
| 1450 | */ |
| 1451 | public static final String MODE_RINGER_STREAMS_AFFECTED = "mode_ringer_streams_affected"; |
| 1452 | |
| 1453 | /** |
| 1454 | * Determines which streams are affected by mute. The |
| 1455 | * stream type's bit should be set to 1 if it should be muted when a mute request |
| 1456 | * is received. |
| 1457 | */ |
| 1458 | public static final String MUTE_STREAMS_AFFECTED = "mute_streams_affected"; |
| 1459 | |
| 1460 | /** |
| 1461 | * Whether vibrate is on for different events. This is used internally, |
| 1462 | * changing this value will not change the vibrate. See AudioManager. |
| 1463 | */ |
| 1464 | public static final String VIBRATE_ON = "vibrate_on"; |
| 1465 | |
| 1466 | /** |
Jeff Brown | 7f6c231 | 2012-04-13 20:38:38 -0700 | [diff] [blame] | 1467 | * If 1, redirects the system vibrator to all currently attached input devices |
| 1468 | * that support vibration. If there are no such input devices, then the system |
| 1469 | * vibrator is used instead. |
| 1470 | * If 0, does not register the system vibrator. |
| 1471 | * |
| 1472 | * This setting is mainly intended to provide a compatibility mechanism for |
| 1473 | * applications that only know about the system vibrator and do not use the |
| 1474 | * input device vibrator API. |
| 1475 | * |
| 1476 | * @hide |
| 1477 | */ |
| 1478 | public static final String VIBRATE_INPUT_DEVICES = "vibrate_input_devices"; |
| 1479 | |
| 1480 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1481 | * Ringer volume. This is used internally, changing this value will not |
| 1482 | * change the volume. See AudioManager. |
| 1483 | */ |
| 1484 | public static final String VOLUME_RING = "volume_ring"; |
| 1485 | |
| 1486 | /** |
| 1487 | * System/notifications volume. This is used internally, changing this |
| 1488 | * value will not change the volume. See AudioManager. |
| 1489 | */ |
| 1490 | public static final String VOLUME_SYSTEM = "volume_system"; |
| 1491 | |
| 1492 | /** |
| 1493 | * Voice call volume. This is used internally, changing this value will |
| 1494 | * not change the volume. See AudioManager. |
| 1495 | */ |
| 1496 | public static final String VOLUME_VOICE = "volume_voice"; |
| 1497 | |
| 1498 | /** |
| 1499 | * Music/media/gaming volume. This is used internally, changing this |
| 1500 | * value will not change the volume. See AudioManager. |
| 1501 | */ |
| 1502 | public static final String VOLUME_MUSIC = "volume_music"; |
| 1503 | |
| 1504 | /** |
| 1505 | * Alarm volume. This is used internally, changing this |
| 1506 | * value will not change the volume. See AudioManager. |
| 1507 | */ |
| 1508 | public static final String VOLUME_ALARM = "volume_alarm"; |
| 1509 | |
| 1510 | /** |
| 1511 | * Notification volume. This is used internally, changing this |
| 1512 | * value will not change the volume. See AudioManager. |
| 1513 | */ |
| 1514 | public static final String VOLUME_NOTIFICATION = "volume_notification"; |
| 1515 | |
| 1516 | /** |
Eric Laurent | 484d288 | 2009-12-08 09:05:45 -0800 | [diff] [blame] | 1517 | * Bluetooth Headset volume. This is used internally, changing this value will |
| 1518 | * not change the volume. See AudioManager. |
| 1519 | */ |
| 1520 | public static final String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco"; |
| 1521 | |
| 1522 | /** |
Mike Lockwood | 8517e46 | 2011-10-25 14:47:19 -0400 | [diff] [blame] | 1523 | * Master volume (float in the range 0.0f to 1.0f). |
| 1524 | * @hide |
| 1525 | */ |
| 1526 | public static final String VOLUME_MASTER = "volume_master"; |
| 1527 | |
| 1528 | /** |
Justin Koh | 57978ed | 2012-04-03 17:37:58 -0700 | [diff] [blame] | 1529 | * Master volume mute (int 1 = mute, 0 = not muted). |
| 1530 | * |
| 1531 | * @hide |
| 1532 | */ |
| 1533 | public static final String VOLUME_MASTER_MUTE = "volume_master_mute"; |
| 1534 | |
| 1535 | /** |
| 1536 | * Whether the notifications should use the ring volume (value of 1) or |
| 1537 | * a separate notification volume (value of 0). In most cases, users |
| 1538 | * will have this enabled so the notification and ringer volumes will be |
| 1539 | * the same. However, power users can disable this and use the separate |
| 1540 | * notification volume control. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1541 | * <p> |
Justin Koh | 57978ed | 2012-04-03 17:37:58 -0700 | [diff] [blame] | 1542 | * Note: This is a one-off setting that will be removed in the future |
| 1543 | * when there is profile support. For this reason, it is kept hidden |
| 1544 | * from the public APIs. |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 1545 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1546 | * @hide |
Amith Yamasani | 42722bf | 2011-07-22 10:34:27 -0700 | [diff] [blame] | 1547 | * @deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1548 | */ |
Gilles Debunne | e90bed1 | 2011-08-30 14:28:27 -0700 | [diff] [blame] | 1549 | @Deprecated |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 1550 | public static final String NOTIFICATIONS_USE_RING_VOLUME = |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1551 | "notifications_use_ring_volume"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 1552 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1553 | /** |
Daniel Sandler | 6329bf7 | 2010-02-26 15:17:44 -0500 | [diff] [blame] | 1554 | * Whether silent mode should allow vibration feedback. This is used |
| 1555 | * internally in AudioService and the Sound settings activity to |
| 1556 | * coordinate decoupling of vibrate and silent modes. This setting |
| 1557 | * will likely be removed in a future release with support for |
| 1558 | * audio/vibe feedback profiles. |
| 1559 | * |
| 1560 | * @hide |
| 1561 | */ |
| 1562 | public static final String VIBRATE_IN_SILENT = "vibrate_in_silent"; |
| 1563 | |
| 1564 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1565 | * The mapping of stream type (integer) to its setting. |
| 1566 | */ |
| 1567 | public static final String[] VOLUME_SETTINGS = { |
| 1568 | VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC, |
Eric Laurent | 484d288 | 2009-12-08 09:05:45 -0800 | [diff] [blame] | 1569 | VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1570 | }; |
| 1571 | |
| 1572 | /** |
| 1573 | * Appended to various volume related settings to record the previous |
| 1574 | * values before they the settings were affected by a silent/vibrate |
| 1575 | * ringer mode change. |
| 1576 | */ |
| 1577 | public static final String APPEND_FOR_LAST_AUDIBLE = "_last_audible"; |
| 1578 | |
| 1579 | /** |
| 1580 | * Persistent store for the system-wide default ringtone URI. |
| 1581 | * <p> |
| 1582 | * If you need to play the default ringtone at any given time, it is recommended |
| 1583 | * you give {@link #DEFAULT_RINGTONE_URI} to the media player. It will resolve |
| 1584 | * to the set default ringtone at the time of playing. |
| 1585 | * |
| 1586 | * @see #DEFAULT_RINGTONE_URI |
| 1587 | */ |
| 1588 | public static final String RINGTONE = "ringtone"; |
| 1589 | |
| 1590 | /** |
| 1591 | * A {@link Uri} that will point to the current default ringtone at any |
| 1592 | * given time. |
| 1593 | * <p> |
| 1594 | * If the current default ringtone is in the DRM provider and the caller |
| 1595 | * does not have permission, the exception will be a |
| 1596 | * FileNotFoundException. |
| 1597 | */ |
| 1598 | public static final Uri DEFAULT_RINGTONE_URI = getUriFor(RINGTONE); |
| 1599 | |
| 1600 | /** |
| 1601 | * Persistent store for the system-wide default notification sound. |
| 1602 | * |
| 1603 | * @see #RINGTONE |
| 1604 | * @see #DEFAULT_NOTIFICATION_URI |
| 1605 | */ |
| 1606 | public static final String NOTIFICATION_SOUND = "notification_sound"; |
| 1607 | |
| 1608 | /** |
| 1609 | * A {@link Uri} that will point to the current default notification |
| 1610 | * sound at any given time. |
| 1611 | * |
| 1612 | * @see #DEFAULT_RINGTONE_URI |
| 1613 | */ |
| 1614 | public static final Uri DEFAULT_NOTIFICATION_URI = getUriFor(NOTIFICATION_SOUND); |
| 1615 | |
| 1616 | /** |
Patrick Scott | 3156bb00 | 2009-04-13 09:57:38 -0700 | [diff] [blame] | 1617 | * Persistent store for the system-wide default alarm alert. |
| 1618 | * |
| 1619 | * @see #RINGTONE |
| 1620 | * @see #DEFAULT_ALARM_ALERT_URI |
| 1621 | */ |
| 1622 | public static final String ALARM_ALERT = "alarm_alert"; |
| 1623 | |
| 1624 | /** |
| 1625 | * A {@link Uri} that will point to the current default alarm alert at |
| 1626 | * any given time. |
| 1627 | * |
| 1628 | * @see #DEFAULT_ALARM_ALERT_URI |
| 1629 | */ |
| 1630 | public static final Uri DEFAULT_ALARM_ALERT_URI = getUriFor(ALARM_ALERT); |
| 1631 | |
| 1632 | /** |
Jean-Michel Trivi | d589fea | 2011-04-15 11:28:10 -0700 | [diff] [blame] | 1633 | * Persistent store for the system default media button event receiver. |
| 1634 | * |
| 1635 | * @hide |
| 1636 | */ |
| 1637 | public static final String MEDIA_BUTTON_RECEIVER = "media_button_receiver"; |
| 1638 | |
| 1639 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1640 | * Setting to enable Auto Replace (AutoText) in text editors. 1 = On, 0 = Off |
| 1641 | */ |
| 1642 | public static final String TEXT_AUTO_REPLACE = "auto_replace"; |
| 1643 | |
| 1644 | /** |
| 1645 | * Setting to enable Auto Caps in text editors. 1 = On, 0 = Off |
| 1646 | */ |
| 1647 | public static final String TEXT_AUTO_CAPS = "auto_caps"; |
| 1648 | |
| 1649 | /** |
| 1650 | * Setting to enable Auto Punctuate in text editors. 1 = On, 0 = Off. This |
| 1651 | * feature converts two spaces to a "." and space. |
| 1652 | */ |
| 1653 | public static final String TEXT_AUTO_PUNCTUATE = "auto_punctuate"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 1654 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1655 | /** |
| 1656 | * Setting to showing password characters in text editors. 1 = On, 0 = Off |
| 1657 | */ |
| 1658 | public static final String TEXT_SHOW_PASSWORD = "show_password"; |
| 1659 | |
| 1660 | public static final String SHOW_GTALK_SERVICE_STATUS = |
| 1661 | "SHOW_GTALK_SERVICE_STATUS"; |
| 1662 | |
| 1663 | /** |
| 1664 | * Name of activity to use for wallpaper on the home screen. |
| 1665 | */ |
| 1666 | public static final String WALLPAPER_ACTIVITY = "wallpaper_activity"; |
| 1667 | |
| 1668 | /** |
| 1669 | * Value to specify if the user prefers the date, time and time zone |
| 1670 | * to be automatically fetched from the network (NITZ). 1=yes, 0=no |
| 1671 | */ |
| 1672 | public static final String AUTO_TIME = "auto_time"; |
| 1673 | |
| 1674 | /** |
Amith Yamasani | ad450be | 2010-09-16 16:47:00 -0700 | [diff] [blame] | 1675 | * Value to specify if the user prefers the time zone |
| 1676 | * to be automatically fetched from the network (NITZ). 1=yes, 0=no |
| 1677 | */ |
| 1678 | public static final String AUTO_TIME_ZONE = "auto_time_zone"; |
| 1679 | |
| 1680 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1681 | * Display times as 12 or 24 hours |
| 1682 | * 12 |
| 1683 | * 24 |
| 1684 | */ |
| 1685 | public static final String TIME_12_24 = "time_12_24"; |
| 1686 | |
| 1687 | /** |
| 1688 | * Date format string |
| 1689 | * mm/dd/yyyy |
| 1690 | * dd/mm/yyyy |
| 1691 | * yyyy/mm/dd |
| 1692 | */ |
| 1693 | public static final String DATE_FORMAT = "date_format"; |
| 1694 | |
| 1695 | /** |
| 1696 | * Whether the setup wizard has been run before (on first boot), or if |
| 1697 | * it still needs to be run. |
| 1698 | * |
| 1699 | * nonzero = it has been run in the past |
| 1700 | * 0 = it has not been run in the past |
| 1701 | */ |
| 1702 | public static final String SETUP_WIZARD_HAS_RUN = "setup_wizard_has_run"; |
| 1703 | |
| 1704 | /** |
| 1705 | * Scaling factor for normal window animations. Setting to 0 will disable window |
| 1706 | * animations. |
| 1707 | */ |
| 1708 | public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale"; |
| 1709 | |
| 1710 | /** |
| 1711 | * Scaling factor for activity transition animations. Setting to 0 will disable window |
| 1712 | * animations. |
| 1713 | */ |
| 1714 | public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale"; |
| 1715 | |
| 1716 | /** |
Chet Haase | c38fa1f | 2012-02-01 16:37:46 -0800 | [diff] [blame] | 1717 | * Scaling factor for Animator-based animations. This affects both the start delay and |
| 1718 | * duration of all such animations. Setting to 0 will cause animations to end immediately. |
| 1719 | * The default value is 1. |
| 1720 | */ |
| 1721 | public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale"; |
| 1722 | |
| 1723 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1724 | * Scaling factor for normal window animations. Setting to 0 will disable window |
| 1725 | * animations. |
| 1726 | * @hide |
| 1727 | */ |
| 1728 | public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations"; |
| 1729 | |
| 1730 | /** |
| 1731 | * Control whether the accelerometer will be used to change screen |
| 1732 | * orientation. If 0, it will not be used unless explicitly requested |
| 1733 | * by the application; if 1, it will be used by default unless explicitly |
| 1734 | * disabled by the application. |
| 1735 | */ |
| 1736 | public static final String ACCELEROMETER_ROTATION = "accelerometer_rotation"; |
| 1737 | |
| 1738 | /** |
Daniel Sandler | b73617d | 2010-08-17 00:41:00 -0400 | [diff] [blame] | 1739 | * Default screen rotation when no other policy applies. |
| 1740 | * When {@link #ACCELEROMETER_ROTATION} is zero and no on-screen Activity expresses a |
| 1741 | * preference, this rotation value will be used. Must be one of the |
Brian Muramatsu | e1d4698 | 2010-12-06 17:34:20 -0800 | [diff] [blame] | 1742 | * {@link android.view.Surface#ROTATION_0 Surface rotation constants}. |
Daniel Sandler | b73617d | 2010-08-17 00:41:00 -0400 | [diff] [blame] | 1743 | * |
| 1744 | * @see Display#getRotation |
| 1745 | */ |
| 1746 | public static final String USER_ROTATION = "user_rotation"; |
| 1747 | |
| 1748 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1749 | * Whether the audible DTMF tones are played by the dialer when dialing. The value is |
| 1750 | * boolean (1 or 0). |
| 1751 | */ |
| 1752 | public static final String DTMF_TONE_WHEN_DIALING = "dtmf_tone"; |
| 1753 | |
| 1754 | /** |
David Krause | d0f6715 | 2009-06-13 18:01:13 -0500 | [diff] [blame] | 1755 | * CDMA only settings |
| 1756 | * DTMF tone type played by the dialer when dialing. |
| 1757 | * 0 = Normal |
| 1758 | * 1 = Long |
| 1759 | * @hide |
| 1760 | */ |
| 1761 | public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type"; |
| 1762 | |
| 1763 | /** |
| 1764 | * CDMA only settings |
| 1765 | * Emergency Tone 0 = Off |
| 1766 | * 1 = Alert |
| 1767 | * 2 = Vibrate |
| 1768 | * @hide |
| 1769 | */ |
| 1770 | public static final String EMERGENCY_TONE = "emergency_tone"; |
| 1771 | |
| 1772 | /** |
| 1773 | * CDMA only settings |
| 1774 | * Whether the auto retry is enabled. The value is |
| 1775 | * boolean (1 or 0). |
| 1776 | * @hide |
| 1777 | */ |
| 1778 | public static final String CALL_AUTO_RETRY = "call_auto_retry"; |
| 1779 | |
| 1780 | /** |
| 1781 | * Whether the hearing aid is enabled. The value is |
| 1782 | * boolean (1 or 0). |
| 1783 | * @hide |
| 1784 | */ |
| 1785 | public static final String HEARING_AID = "hearing_aid"; |
| 1786 | |
| 1787 | /** |
| 1788 | * CDMA only settings |
| 1789 | * TTY Mode |
| 1790 | * 0 = OFF |
| 1791 | * 1 = FULL |
| 1792 | * 2 = VCO |
| 1793 | * 3 = HCO |
| 1794 | * @hide |
| 1795 | */ |
| 1796 | public static final String TTY_MODE = "tty_mode"; |
| 1797 | |
| 1798 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1799 | * Whether the sounds effects (key clicks, lid open ...) are enabled. The value is |
| 1800 | * boolean (1 or 0). |
| 1801 | */ |
| 1802 | public static final String SOUND_EFFECTS_ENABLED = "sound_effects_enabled"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 1803 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1804 | /** |
| 1805 | * Whether the haptic feedback (long presses, ...) are enabled. The value is |
| 1806 | * boolean (1 or 0). |
| 1807 | */ |
| 1808 | public static final String HAPTIC_FEEDBACK_ENABLED = "haptic_feedback_enabled"; |
Sanjay Jeyakumar | 21bf241 | 2009-07-09 13:31:48 -0700 | [diff] [blame] | 1809 | |
Mike LeBeau | 48603e7 | 2009-06-05 00:27:00 +0100 | [diff] [blame] | 1810 | /** |
Bjorn Bringert | 24abb66 | 2010-09-21 12:21:18 +0100 | [diff] [blame] | 1811 | * @deprecated Each application that shows web suggestions should have its own |
| 1812 | * setting for this. |
Mike LeBeau | 48603e7 | 2009-06-05 00:27:00 +0100 | [diff] [blame] | 1813 | */ |
Bjorn Bringert | 24abb66 | 2010-09-21 12:21:18 +0100 | [diff] [blame] | 1814 | @Deprecated |
Mike LeBeau | 48603e7 | 2009-06-05 00:27:00 +0100 | [diff] [blame] | 1815 | public static final String SHOW_WEB_SUGGESTIONS = "show_web_suggestions"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 1816 | |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 1817 | /** |
Amith Yamasani | ae3ed70 | 2009-12-01 19:02:05 -0800 | [diff] [blame] | 1818 | * Whether the notification LED should repeatedly flash when a notification is |
| 1819 | * pending. The value is boolean (1 or 0). |
| 1820 | * @hide |
| 1821 | */ |
| 1822 | public static final String NOTIFICATION_LIGHT_PULSE = "notification_light_pulse"; |
| 1823 | |
| 1824 | /** |
Dianne Hackborn | 90d2db3 | 2010-02-11 22:19:06 -0800 | [diff] [blame] | 1825 | * Show pointer location on screen? |
| 1826 | * 0 = no |
| 1827 | * 1 = yes |
| 1828 | * @hide |
| 1829 | */ |
| 1830 | public static final String POINTER_LOCATION = "pointer_location"; |
| 1831 | |
| 1832 | /** |
Jeff Brown | daf4a12 | 2011-08-26 17:14:14 -0700 | [diff] [blame] | 1833 | * Show touch positions on screen? |
| 1834 | * 0 = no |
| 1835 | * 1 = yes |
| 1836 | * @hide |
| 1837 | */ |
| 1838 | public static final String SHOW_TOUCHES = "show_touches"; |
| 1839 | |
| 1840 | /** |
Jeff Brown | 4519f07 | 2011-01-23 13:16:01 -0800 | [diff] [blame] | 1841 | * Log raw orientation data from {@link WindowOrientationListener} for use with the |
| 1842 | * orientationplot.py tool. |
| 1843 | * 0 = no |
| 1844 | * 1 = yes |
| 1845 | * @hide |
| 1846 | */ |
| 1847 | public static final String WINDOW_ORIENTATION_LISTENER_LOG = |
| 1848 | "window_orientation_listener_log"; |
| 1849 | |
| 1850 | /** |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 1851 | * Whether to play a sound for low-battery alerts. |
| 1852 | * @hide |
| 1853 | */ |
| 1854 | public static final String POWER_SOUNDS_ENABLED = "power_sounds_enabled"; |
| 1855 | |
| 1856 | /** |
| 1857 | * Whether to play a sound for dock events. |
| 1858 | * @hide |
| 1859 | */ |
| 1860 | public static final String DOCK_SOUNDS_ENABLED = "dock_sounds_enabled"; |
| 1861 | |
| 1862 | /** |
| 1863 | * Whether to play sounds when the keyguard is shown and dismissed. |
| 1864 | * @hide |
| 1865 | */ |
| 1866 | public static final String LOCKSCREEN_SOUNDS_ENABLED = "lockscreen_sounds_enabled"; |
| 1867 | |
| 1868 | /** |
Mike Lockwood | 7bef739 | 2011-10-20 16:51:53 -0400 | [diff] [blame] | 1869 | * Whether the lockscreen should be completely disabled. |
| 1870 | * @hide |
| 1871 | */ |
| 1872 | public static final String LOCKSCREEN_DISABLED = "lockscreen.disabled"; |
| 1873 | |
| 1874 | /** |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 1875 | * URI for the low battery sound file. |
| 1876 | * @hide |
| 1877 | */ |
| 1878 | public static final String LOW_BATTERY_SOUND = "low_battery_sound"; |
| 1879 | |
| 1880 | /** |
| 1881 | * URI for the desk dock "in" event sound. |
| 1882 | * @hide |
| 1883 | */ |
| 1884 | public static final String DESK_DOCK_SOUND = "desk_dock_sound"; |
| 1885 | |
| 1886 | /** |
| 1887 | * URI for the desk dock "out" event sound. |
| 1888 | * @hide |
| 1889 | */ |
| 1890 | public static final String DESK_UNDOCK_SOUND = "desk_undock_sound"; |
| 1891 | |
| 1892 | /** |
| 1893 | * URI for the car dock "in" event sound. |
| 1894 | * @hide |
| 1895 | */ |
| 1896 | public static final String CAR_DOCK_SOUND = "car_dock_sound"; |
| 1897 | |
| 1898 | /** |
| 1899 | * URI for the car dock "out" event sound. |
| 1900 | * @hide |
| 1901 | */ |
| 1902 | public static final String CAR_UNDOCK_SOUND = "car_undock_sound"; |
| 1903 | |
| 1904 | /** |
| 1905 | * URI for the "device locked" (keyguard shown) sound. |
| 1906 | * @hide |
| 1907 | */ |
| 1908 | public static final String LOCK_SOUND = "lock_sound"; |
| 1909 | |
| 1910 | /** |
| 1911 | * URI for the "device unlocked" (keyguard dismissed) sound. |
| 1912 | * @hide |
| 1913 | */ |
| 1914 | public static final String UNLOCK_SOUND = "unlock_sound"; |
| 1915 | |
| 1916 | /** |
Chung-yih Wang | 042e9bd | 2010-08-31 17:43:39 +0800 | [diff] [blame] | 1917 | * Receive incoming SIP calls? |
| 1918 | * 0 = no |
| 1919 | * 1 = yes |
| 1920 | * @hide |
| 1921 | */ |
| 1922 | public static final String SIP_RECEIVE_CALLS = "sip_receive_calls"; |
| 1923 | |
| 1924 | /** |
| 1925 | * Call Preference String. |
| 1926 | * "SIP_ALWAYS" : Always use SIP with network access |
| 1927 | * "SIP_ADDRESS_ONLY" : Only if destination is a SIP address |
| 1928 | * "SIP_ASK_ME_EACH_TIME" : Always ask me each time |
| 1929 | * @hide |
| 1930 | */ |
| 1931 | public static final String SIP_CALL_OPTIONS = "sip_call_options"; |
| 1932 | |
| 1933 | /** |
| 1934 | * One of the sip call options: Always use SIP with network access. |
| 1935 | * @hide |
| 1936 | */ |
| 1937 | public static final String SIP_ALWAYS = "SIP_ALWAYS"; |
| 1938 | |
| 1939 | /** |
| 1940 | * One of the sip call options: Only if destination is a SIP address. |
| 1941 | * @hide |
| 1942 | */ |
| 1943 | public static final String SIP_ADDRESS_ONLY = "SIP_ADDRESS_ONLY"; |
| 1944 | |
| 1945 | /** |
| 1946 | * One of the sip call options: Always ask me each time. |
| 1947 | * @hide |
| 1948 | */ |
| 1949 | public static final String SIP_ASK_ME_EACH_TIME = "SIP_ASK_ME_EACH_TIME"; |
| 1950 | |
| 1951 | /** |
Jeff Brown | 1a84fd1 | 2011-06-02 01:26:32 -0700 | [diff] [blame] | 1952 | * Pointer speed setting. |
| 1953 | * This is an integer value in a range between -7 and +7, so there are 15 possible values. |
| 1954 | * -7 = slowest |
| 1955 | * 0 = default speed |
| 1956 | * +7 = fastest |
| 1957 | * @hide |
| 1958 | */ |
| 1959 | public static final String POINTER_SPEED = "pointer_speed"; |
| 1960 | |
| 1961 | /** |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 1962 | * Settings to backup. This is here so that it's in the same place as the settings |
| 1963 | * keys and easy to update. |
Svetoslav Ganov | a571a58 | 2011-09-20 18:32:20 -0700 | [diff] [blame] | 1964 | * |
| 1965 | * NOTE: Settings are backed up and restored in the order they appear |
| 1966 | * in this array. If you have one setting depending on another, |
| 1967 | * make sure that they are ordered appropriately. |
| 1968 | * |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 1969 | * @hide |
| 1970 | */ |
| 1971 | public static final String[] SETTINGS_TO_BACKUP = { |
| 1972 | STAY_ON_WHILE_PLUGGED_IN, |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 1973 | WIFI_USE_STATIC_IP, |
| 1974 | WIFI_STATIC_IP, |
| 1975 | WIFI_STATIC_GATEWAY, |
| 1976 | WIFI_STATIC_NETMASK, |
| 1977 | WIFI_STATIC_DNS1, |
| 1978 | WIFI_STATIC_DNS2, |
| 1979 | BLUETOOTH_DISCOVERABILITY, |
| 1980 | BLUETOOTH_DISCOVERABILITY_TIMEOUT, |
| 1981 | DIM_SCREEN, |
| 1982 | SCREEN_OFF_TIMEOUT, |
| 1983 | SCREEN_BRIGHTNESS, |
Christopher Tate | 362aca6 | 2009-09-25 15:58:03 -0700 | [diff] [blame] | 1984 | SCREEN_BRIGHTNESS_MODE, |
Dianne Hackborn | d9ea468 | 2012-01-20 18:36:40 -0800 | [diff] [blame] | 1985 | SCREEN_AUTO_BRIGHTNESS_ADJ, |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 1986 | VIBRATE_ON, |
Jeff Brown | 7f6c231 | 2012-04-13 20:38:38 -0700 | [diff] [blame] | 1987 | VIBRATE_INPUT_DEVICES, |
Amith Yamasani | 8823c0a8 | 2009-07-07 14:30:17 -0700 | [diff] [blame] | 1988 | MODE_RINGER, |
| 1989 | MODE_RINGER_STREAMS_AFFECTED, |
| 1990 | MUTE_STREAMS_AFFECTED, |
| 1991 | VOLUME_VOICE, |
| 1992 | VOLUME_SYSTEM, |
| 1993 | VOLUME_RING, |
| 1994 | VOLUME_MUSIC, |
| 1995 | VOLUME_ALARM, |
| 1996 | VOLUME_NOTIFICATION, |
Eric Laurent | 484d288 | 2009-12-08 09:05:45 -0800 | [diff] [blame] | 1997 | VOLUME_BLUETOOTH_SCO, |
Amith Yamasani | 8823c0a8 | 2009-07-07 14:30:17 -0700 | [diff] [blame] | 1998 | VOLUME_VOICE + APPEND_FOR_LAST_AUDIBLE, |
| 1999 | VOLUME_SYSTEM + APPEND_FOR_LAST_AUDIBLE, |
| 2000 | VOLUME_RING + APPEND_FOR_LAST_AUDIBLE, |
| 2001 | VOLUME_MUSIC + APPEND_FOR_LAST_AUDIBLE, |
| 2002 | VOLUME_ALARM + APPEND_FOR_LAST_AUDIBLE, |
| 2003 | VOLUME_NOTIFICATION + APPEND_FOR_LAST_AUDIBLE, |
Eric Laurent | 484d288 | 2009-12-08 09:05:45 -0800 | [diff] [blame] | 2004 | VOLUME_BLUETOOTH_SCO + APPEND_FOR_LAST_AUDIBLE, |
Daniel Sandler | 1c7fa48 | 2010-03-10 09:45:01 -0500 | [diff] [blame] | 2005 | VIBRATE_IN_SILENT, |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 2006 | TEXT_AUTO_REPLACE, |
| 2007 | TEXT_AUTO_CAPS, |
| 2008 | TEXT_AUTO_PUNCTUATE, |
| 2009 | TEXT_SHOW_PASSWORD, |
| 2010 | AUTO_TIME, |
Amith Yamasani | ad450be | 2010-09-16 16:47:00 -0700 | [diff] [blame] | 2011 | AUTO_TIME_ZONE, |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 2012 | TIME_12_24, |
| 2013 | DATE_FORMAT, |
| 2014 | ACCELEROMETER_ROTATION, |
Daniel Sandler | b73617d | 2010-08-17 00:41:00 -0400 | [diff] [blame] | 2015 | USER_ROTATION, |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 2016 | DTMF_TONE_WHEN_DIALING, |
| 2017 | DTMF_TONE_TYPE_WHEN_DIALING, |
| 2018 | EMERGENCY_TONE, |
| 2019 | CALL_AUTO_RETRY, |
| 2020 | HEARING_AID, |
| 2021 | TTY_MODE, |
| 2022 | SOUND_EFFECTS_ENABLED, |
| 2023 | HAPTIC_FEEDBACK_ENABLED, |
Christopher Tate | 14c2d79 | 2010-02-25 16:49:44 -0800 | [diff] [blame] | 2024 | POWER_SOUNDS_ENABLED, |
| 2025 | DOCK_SOUNDS_ENABLED, |
| 2026 | LOCKSCREEN_SOUNDS_ENABLED, |
Amith Yamasani | ae3ed70 | 2009-12-01 19:02:05 -0800 | [diff] [blame] | 2027 | SHOW_WEB_SUGGESTIONS, |
Mike Lockwood | eabe8bf | 2010-08-31 14:35:23 -0400 | [diff] [blame] | 2028 | NOTIFICATION_LIGHT_PULSE, |
Chung-yih Wang | 042e9bd | 2010-08-31 17:43:39 +0800 | [diff] [blame] | 2029 | SIP_CALL_OPTIONS, |
Nick Pelly | 038cabe | 2010-09-23 16:12:11 -0700 | [diff] [blame] | 2030 | SIP_RECEIVE_CALLS, |
Jeff Brown | 1a84fd1 | 2011-06-02 01:26:32 -0700 | [diff] [blame] | 2031 | POINTER_SPEED, |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 2032 | }; |
| 2033 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2034 | // Settings moved to Settings.Secure |
| 2035 | |
| 2036 | /** |
Mike Lockwood | 460ae0c | 2009-04-02 22:33:27 -0700 | [diff] [blame] | 2037 | * @deprecated Use {@link android.provider.Settings.Secure#ADB_ENABLED} |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2038 | * instead |
| 2039 | */ |
| 2040 | @Deprecated |
| 2041 | public static final String ADB_ENABLED = Secure.ADB_ENABLED; |
| 2042 | |
| 2043 | /** |
| 2044 | * @deprecated Use {@link android.provider.Settings.Secure#ANDROID_ID} instead |
| 2045 | */ |
| 2046 | @Deprecated |
| 2047 | public static final String ANDROID_ID = Secure.ANDROID_ID; |
| 2048 | |
| 2049 | /** |
| 2050 | * @deprecated Use {@link android.provider.Settings.Secure#BLUETOOTH_ON} instead |
| 2051 | */ |
| 2052 | @Deprecated |
| 2053 | public static final String BLUETOOTH_ON = Secure.BLUETOOTH_ON; |
| 2054 | |
| 2055 | /** |
| 2056 | * @deprecated Use {@link android.provider.Settings.Secure#DATA_ROAMING} instead |
| 2057 | */ |
| 2058 | @Deprecated |
| 2059 | public static final String DATA_ROAMING = Secure.DATA_ROAMING; |
| 2060 | |
| 2061 | /** |
| 2062 | * @deprecated Use {@link android.provider.Settings.Secure#DEVICE_PROVISIONED} instead |
| 2063 | */ |
| 2064 | @Deprecated |
| 2065 | public static final String DEVICE_PROVISIONED = Secure.DEVICE_PROVISIONED; |
| 2066 | |
| 2067 | /** |
| 2068 | * @deprecated Use {@link android.provider.Settings.Secure#HTTP_PROXY} instead |
| 2069 | */ |
| 2070 | @Deprecated |
| 2071 | public static final String HTTP_PROXY = Secure.HTTP_PROXY; |
| 2072 | |
| 2073 | /** |
| 2074 | * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead |
| 2075 | */ |
| 2076 | @Deprecated |
| 2077 | public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 2078 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2079 | /** |
| 2080 | * @deprecated Use {@link android.provider.Settings.Secure#LOCATION_PROVIDERS_ALLOWED} |
| 2081 | * instead |
| 2082 | */ |
| 2083 | @Deprecated |
| 2084 | public static final String LOCATION_PROVIDERS_ALLOWED = Secure.LOCATION_PROVIDERS_ALLOWED; |
| 2085 | |
| 2086 | /** |
| 2087 | * @deprecated Use {@link android.provider.Settings.Secure#LOGGING_ID} instead |
| 2088 | */ |
| 2089 | @Deprecated |
| 2090 | public static final String LOGGING_ID = Secure.LOGGING_ID; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 2091 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2092 | /** |
| 2093 | * @deprecated Use {@link android.provider.Settings.Secure#NETWORK_PREFERENCE} instead |
| 2094 | */ |
| 2095 | @Deprecated |
| 2096 | public static final String NETWORK_PREFERENCE = Secure.NETWORK_PREFERENCE; |
| 2097 | |
| 2098 | /** |
| 2099 | * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_ENABLED} |
| 2100 | * instead |
| 2101 | */ |
| 2102 | @Deprecated |
| 2103 | public static final String PARENTAL_CONTROL_ENABLED = Secure.PARENTAL_CONTROL_ENABLED; |
| 2104 | |
| 2105 | /** |
| 2106 | * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_LAST_UPDATE} |
| 2107 | * instead |
| 2108 | */ |
| 2109 | @Deprecated |
| 2110 | public static final String PARENTAL_CONTROL_LAST_UPDATE = Secure.PARENTAL_CONTROL_LAST_UPDATE; |
| 2111 | |
| 2112 | /** |
| 2113 | * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_REDIRECT_URL} |
| 2114 | * instead |
| 2115 | */ |
| 2116 | @Deprecated |
| 2117 | public static final String PARENTAL_CONTROL_REDIRECT_URL = |
| 2118 | Secure.PARENTAL_CONTROL_REDIRECT_URL; |
| 2119 | |
| 2120 | /** |
| 2121 | * @deprecated Use {@link android.provider.Settings.Secure#SETTINGS_CLASSNAME} instead |
| 2122 | */ |
| 2123 | @Deprecated |
| 2124 | public static final String SETTINGS_CLASSNAME = Secure.SETTINGS_CLASSNAME; |
| 2125 | |
| 2126 | /** |
| 2127 | * @deprecated Use {@link android.provider.Settings.Secure#USB_MASS_STORAGE_ENABLED} instead |
| 2128 | */ |
| 2129 | @Deprecated |
| 2130 | public static final String USB_MASS_STORAGE_ENABLED = Secure.USB_MASS_STORAGE_ENABLED; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 2131 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2132 | /** |
| 2133 | * @deprecated Use {@link android.provider.Settings.Secure#USE_GOOGLE_MAIL} instead |
| 2134 | */ |
| 2135 | @Deprecated |
| 2136 | public static final String USE_GOOGLE_MAIL = Secure.USE_GOOGLE_MAIL; |
| 2137 | |
Dianne Hackborn | 4a51c20 | 2009-08-21 15:14:02 -0700 | [diff] [blame] | 2138 | /** |
| 2139 | * @deprecated Use |
| 2140 | * {@link android.provider.Settings.Secure#WIFI_MAX_DHCP_RETRY_COUNT} instead |
| 2141 | */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2142 | @Deprecated |
| 2143 | public static final String WIFI_MAX_DHCP_RETRY_COUNT = Secure.WIFI_MAX_DHCP_RETRY_COUNT; |
| 2144 | |
Dianne Hackborn | 4a51c20 | 2009-08-21 15:14:02 -0700 | [diff] [blame] | 2145 | /** |
| 2146 | * @deprecated Use |
| 2147 | * {@link android.provider.Settings.Secure#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead |
| 2148 | */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2149 | @Deprecated |
| 2150 | public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS = |
| 2151 | Secure.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS; |
| 2152 | |
| 2153 | /** |
| 2154 | * @deprecated Use |
| 2155 | * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} instead |
| 2156 | */ |
| 2157 | @Deprecated |
| 2158 | public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON = |
| 2159 | Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON; |
| 2160 | |
| 2161 | /** |
| 2162 | * @deprecated Use |
| 2163 | * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} instead |
| 2164 | */ |
| 2165 | @Deprecated |
| 2166 | public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY = |
| 2167 | Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 2168 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2169 | /** |
| 2170 | * @deprecated Use {@link android.provider.Settings.Secure#WIFI_NUM_OPEN_NETWORKS_KEPT} |
| 2171 | * instead |
| 2172 | */ |
| 2173 | @Deprecated |
| 2174 | public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = Secure.WIFI_NUM_OPEN_NETWORKS_KEPT; |
| 2175 | |
| 2176 | /** |
| 2177 | * @deprecated Use {@link android.provider.Settings.Secure#WIFI_ON} instead |
| 2178 | */ |
| 2179 | @Deprecated |
| 2180 | public static final String WIFI_ON = Secure.WIFI_ON; |
| 2181 | |
| 2182 | /** |
| 2183 | * @deprecated Use |
| 2184 | * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE} |
| 2185 | * instead |
| 2186 | */ |
| 2187 | @Deprecated |
| 2188 | public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE = |
| 2189 | Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE; |
| 2190 | |
| 2191 | /** |
| 2192 | * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_AP_COUNT} instead |
| 2193 | */ |
| 2194 | @Deprecated |
| 2195 | public static final String WIFI_WATCHDOG_AP_COUNT = Secure.WIFI_WATCHDOG_AP_COUNT; |
| 2196 | |
| 2197 | /** |
| 2198 | * @deprecated Use |
| 2199 | * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS} instead |
| 2200 | */ |
| 2201 | @Deprecated |
| 2202 | public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS = |
| 2203 | Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 2204 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2205 | /** |
| 2206 | * @deprecated Use |
| 2207 | * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED} instead |
| 2208 | */ |
| 2209 | @Deprecated |
| 2210 | public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED = |
| 2211 | Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED; |
| 2212 | |
| 2213 | /** |
| 2214 | * @deprecated Use |
| 2215 | * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS} |
| 2216 | * instead |
| 2217 | */ |
| 2218 | @Deprecated |
| 2219 | public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS = |
| 2220 | Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS; |
| 2221 | |
| 2222 | /** |
| 2223 | * @deprecated Use |
| 2224 | * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT} instead |
| 2225 | */ |
| 2226 | @Deprecated |
| 2227 | public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT = |
| 2228 | Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT; |
| 2229 | |
| 2230 | /** |
| 2231 | * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_MAX_AP_CHECKS} |
| 2232 | * instead |
| 2233 | */ |
| 2234 | @Deprecated |
| 2235 | public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = Secure.WIFI_WATCHDOG_MAX_AP_CHECKS; |
| 2236 | |
| 2237 | /** |
| 2238 | * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ON} instead |
| 2239 | */ |
| 2240 | @Deprecated |
| 2241 | public static final String WIFI_WATCHDOG_ON = Secure.WIFI_WATCHDOG_ON; |
| 2242 | |
| 2243 | /** |
| 2244 | * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_COUNT} instead |
| 2245 | */ |
| 2246 | @Deprecated |
| 2247 | public static final String WIFI_WATCHDOG_PING_COUNT = Secure.WIFI_WATCHDOG_PING_COUNT; |
| 2248 | |
| 2249 | /** |
| 2250 | * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_DELAY_MS} |
| 2251 | * instead |
| 2252 | */ |
| 2253 | @Deprecated |
| 2254 | public static final String WIFI_WATCHDOG_PING_DELAY_MS = Secure.WIFI_WATCHDOG_PING_DELAY_MS; |
| 2255 | |
| 2256 | /** |
| 2257 | * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_TIMEOUT_MS} |
| 2258 | * instead |
| 2259 | */ |
| 2260 | @Deprecated |
| 2261 | public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = |
| 2262 | Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS; |
| 2263 | } |
| 2264 | |
| 2265 | /** |
| 2266 | * Secure system settings, containing system preferences that applications |
| 2267 | * can read but are not allowed to write. These are for preferences that |
| 2268 | * the user must explicitly modify through the system UI or specialized |
| 2269 | * APIs for those values, not modified directly by applications. |
| 2270 | */ |
| 2271 | public static final class Secure extends NameValueTable { |
| 2272 | public static final String SYS_PROP_SETTING_VERSION = "sys.settings_secure_version"; |
| 2273 | |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 2274 | // Populated lazily, guarded by class object: |
| 2275 | private static NameValueCache sNameValueCache = null; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2276 | |
Amith Yamasani | 52c489c | 2012-03-28 11:42:42 -0700 | [diff] [blame] | 2277 | private static ILockSettings sLockSettings = null; |
| 2278 | |
Amith Yamasani | 7ab8c4a | 2012-04-06 09:27:12 -0700 | [diff] [blame] | 2279 | private static boolean sIsSystemProcess; |
Amith Yamasani | 52c489c | 2012-03-28 11:42:42 -0700 | [diff] [blame] | 2280 | private static final HashSet<String> MOVED_TO_LOCK_SETTINGS; |
| 2281 | static { |
| 2282 | MOVED_TO_LOCK_SETTINGS = new HashSet<String>(3); |
| 2283 | MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_ENABLED); |
| 2284 | MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_VISIBLE); |
| 2285 | MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED); |
| 2286 | } |
| 2287 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2288 | /** |
| 2289 | * Look up a name in the database. |
| 2290 | * @param resolver to access the database with |
| 2291 | * @param name to look up in the table |
| 2292 | * @return the corresponding value, or null if not present |
| 2293 | */ |
| 2294 | public synchronized static String getString(ContentResolver resolver, String name) { |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 2295 | if (sNameValueCache == null) { |
| 2296 | sNameValueCache = new NameValueCache(SYS_PROP_SETTING_VERSION, CONTENT_URI, |
| 2297 | CALL_METHOD_GET_SECURE); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2298 | } |
Amith Yamasani | 52c489c | 2012-03-28 11:42:42 -0700 | [diff] [blame] | 2299 | |
| 2300 | if (sLockSettings == null) { |
| 2301 | sLockSettings = ILockSettings.Stub.asInterface( |
| 2302 | (IBinder) ServiceManager.getService("lock_settings")); |
Amith Yamasani | 7ab8c4a | 2012-04-06 09:27:12 -0700 | [diff] [blame] | 2303 | sIsSystemProcess = Process.myUid() == Process.SYSTEM_UID; |
Amith Yamasani | 52c489c | 2012-03-28 11:42:42 -0700 | [diff] [blame] | 2304 | } |
Amith Yamasani | 7ab8c4a | 2012-04-06 09:27:12 -0700 | [diff] [blame] | 2305 | if (sLockSettings != null && !sIsSystemProcess |
| 2306 | && MOVED_TO_LOCK_SETTINGS.contains(name)) { |
Amith Yamasani | 52c489c | 2012-03-28 11:42:42 -0700 | [diff] [blame] | 2307 | try { |
| 2308 | return sLockSettings.getString(name, "0", UserId.getCallingUserId()); |
| 2309 | } catch (RemoteException re) { |
| 2310 | // Fall through |
| 2311 | } |
| 2312 | } |
| 2313 | |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 2314 | return sNameValueCache.getString(resolver, name); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2315 | } |
| 2316 | |
| 2317 | /** |
| 2318 | * Store a name/value pair into the database. |
| 2319 | * @param resolver to access the database with |
| 2320 | * @param name to store |
| 2321 | * @param value to associate with the name |
| 2322 | * @return true if the value was set, false on database errors |
| 2323 | */ |
| 2324 | public static boolean putString(ContentResolver resolver, |
| 2325 | String name, String value) { |
| 2326 | return putString(resolver, CONTENT_URI, name, value); |
| 2327 | } |
| 2328 | |
| 2329 | /** |
| 2330 | * Construct the content URI for a particular name/value pair, |
| 2331 | * useful for monitoring changes with a ContentObserver. |
| 2332 | * @param name to look up in the table |
| 2333 | * @return the corresponding content URI, or null if not present |
| 2334 | */ |
| 2335 | public static Uri getUriFor(String name) { |
| 2336 | return getUriFor(CONTENT_URI, name); |
| 2337 | } |
| 2338 | |
| 2339 | /** |
| 2340 | * Convenience function for retrieving a single secure settings value |
| 2341 | * as an integer. Note that internally setting values are always |
| 2342 | * stored as strings; this function converts the string to an integer |
| 2343 | * for you. The default value will be returned if the setting is |
| 2344 | * not defined or not an integer. |
| 2345 | * |
| 2346 | * @param cr The ContentResolver to access. |
| 2347 | * @param name The name of the setting to retrieve. |
| 2348 | * @param def Value to return if the setting is not defined. |
| 2349 | * |
| 2350 | * @return The setting's current value, or 'def' if it is not defined |
| 2351 | * or not a valid integer. |
| 2352 | */ |
| 2353 | public static int getInt(ContentResolver cr, String name, int def) { |
| 2354 | String v = getString(cr, name); |
| 2355 | try { |
| 2356 | return v != null ? Integer.parseInt(v) : def; |
| 2357 | } catch (NumberFormatException e) { |
| 2358 | return def; |
| 2359 | } |
| 2360 | } |
| 2361 | |
| 2362 | /** |
| 2363 | * Convenience function for retrieving a single secure settings value |
| 2364 | * as an integer. Note that internally setting values are always |
| 2365 | * stored as strings; this function converts the string to an integer |
| 2366 | * for you. |
| 2367 | * <p> |
| 2368 | * This version does not take a default value. If the setting has not |
| 2369 | * been set, or the string value is not a number, |
| 2370 | * it throws {@link SettingNotFoundException}. |
| 2371 | * |
| 2372 | * @param cr The ContentResolver to access. |
| 2373 | * @param name The name of the setting to retrieve. |
| 2374 | * |
| 2375 | * @throws SettingNotFoundException Thrown if a setting by the given |
| 2376 | * name can't be found or the setting value is not an integer. |
| 2377 | * |
| 2378 | * @return The setting's current value. |
| 2379 | */ |
| 2380 | public static int getInt(ContentResolver cr, String name) |
| 2381 | throws SettingNotFoundException { |
| 2382 | String v = getString(cr, name); |
| 2383 | try { |
| 2384 | return Integer.parseInt(v); |
| 2385 | } catch (NumberFormatException e) { |
| 2386 | throw new SettingNotFoundException(name); |
| 2387 | } |
| 2388 | } |
| 2389 | |
| 2390 | /** |
| 2391 | * Convenience function for updating a single settings value as an |
| 2392 | * integer. This will either create a new entry in the table if the |
| 2393 | * given name does not exist, or modify the value of the existing row |
| 2394 | * with that name. Note that internally setting values are always |
| 2395 | * stored as strings, so this function converts the given value to a |
| 2396 | * string before storing it. |
| 2397 | * |
| 2398 | * @param cr The ContentResolver to access. |
| 2399 | * @param name The name of the setting to modify. |
| 2400 | * @param value The new value for the setting. |
| 2401 | * @return true if the value was set, false on database errors |
| 2402 | */ |
| 2403 | public static boolean putInt(ContentResolver cr, String name, int value) { |
| 2404 | return putString(cr, name, Integer.toString(value)); |
| 2405 | } |
| 2406 | |
| 2407 | /** |
| 2408 | * Convenience function for retrieving a single secure settings value |
| 2409 | * as a {@code long}. Note that internally setting values are always |
| 2410 | * stored as strings; this function converts the string to a {@code long} |
| 2411 | * for you. The default value will be returned if the setting is |
| 2412 | * not defined or not a {@code long}. |
| 2413 | * |
| 2414 | * @param cr The ContentResolver to access. |
| 2415 | * @param name The name of the setting to retrieve. |
| 2416 | * @param def Value to return if the setting is not defined. |
| 2417 | * |
| 2418 | * @return The setting's current value, or 'def' if it is not defined |
| 2419 | * or not a valid {@code long}. |
| 2420 | */ |
| 2421 | public static long getLong(ContentResolver cr, String name, long def) { |
| 2422 | String valString = getString(cr, name); |
| 2423 | long value; |
| 2424 | try { |
| 2425 | value = valString != null ? Long.parseLong(valString) : def; |
| 2426 | } catch (NumberFormatException e) { |
| 2427 | value = def; |
| 2428 | } |
| 2429 | return value; |
| 2430 | } |
| 2431 | |
| 2432 | /** |
| 2433 | * Convenience function for retrieving a single secure settings value |
| 2434 | * as a {@code long}. Note that internally setting values are always |
| 2435 | * stored as strings; this function converts the string to a {@code long} |
| 2436 | * for you. |
| 2437 | * <p> |
| 2438 | * This version does not take a default value. If the setting has not |
| 2439 | * been set, or the string value is not a number, |
| 2440 | * it throws {@link SettingNotFoundException}. |
| 2441 | * |
| 2442 | * @param cr The ContentResolver to access. |
| 2443 | * @param name The name of the setting to retrieve. |
| 2444 | * |
| 2445 | * @return The setting's current value. |
| 2446 | * @throws SettingNotFoundException Thrown if a setting by the given |
| 2447 | * name can't be found or the setting value is not an integer. |
| 2448 | */ |
| 2449 | public static long getLong(ContentResolver cr, String name) |
| 2450 | throws SettingNotFoundException { |
| 2451 | String valString = getString(cr, name); |
| 2452 | try { |
| 2453 | return Long.parseLong(valString); |
| 2454 | } catch (NumberFormatException e) { |
| 2455 | throw new SettingNotFoundException(name); |
| 2456 | } |
| 2457 | } |
| 2458 | |
| 2459 | /** |
| 2460 | * Convenience function for updating a secure settings value as a long |
| 2461 | * integer. This will either create a new entry in the table if the |
| 2462 | * given name does not exist, or modify the value of the existing row |
| 2463 | * with that name. Note that internally setting values are always |
| 2464 | * stored as strings, so this function converts the given value to a |
| 2465 | * string before storing it. |
| 2466 | * |
| 2467 | * @param cr The ContentResolver to access. |
| 2468 | * @param name The name of the setting to modify. |
| 2469 | * @param value The new value for the setting. |
| 2470 | * @return true if the value was set, false on database errors |
| 2471 | */ |
| 2472 | public static boolean putLong(ContentResolver cr, String name, long value) { |
| 2473 | return putString(cr, name, Long.toString(value)); |
| 2474 | } |
| 2475 | |
| 2476 | /** |
| 2477 | * Convenience function for retrieving a single secure settings value |
| 2478 | * as a floating point number. Note that internally setting values are |
| 2479 | * always stored as strings; this function converts the string to an |
| 2480 | * float for you. The default value will be returned if the setting |
| 2481 | * is not defined or not a valid float. |
| 2482 | * |
| 2483 | * @param cr The ContentResolver to access. |
| 2484 | * @param name The name of the setting to retrieve. |
| 2485 | * @param def Value to return if the setting is not defined. |
| 2486 | * |
| 2487 | * @return The setting's current value, or 'def' if it is not defined |
| 2488 | * or not a valid float. |
| 2489 | */ |
| 2490 | public static float getFloat(ContentResolver cr, String name, float def) { |
| 2491 | String v = getString(cr, name); |
| 2492 | try { |
| 2493 | return v != null ? Float.parseFloat(v) : def; |
| 2494 | } catch (NumberFormatException e) { |
| 2495 | return def; |
| 2496 | } |
| 2497 | } |
| 2498 | |
| 2499 | /** |
| 2500 | * Convenience function for retrieving a single secure settings value |
| 2501 | * as a float. Note that internally setting values are always |
| 2502 | * stored as strings; this function converts the string to a float |
| 2503 | * for you. |
| 2504 | * <p> |
| 2505 | * This version does not take a default value. If the setting has not |
| 2506 | * been set, or the string value is not a number, |
| 2507 | * it throws {@link SettingNotFoundException}. |
| 2508 | * |
| 2509 | * @param cr The ContentResolver to access. |
| 2510 | * @param name The name of the setting to retrieve. |
| 2511 | * |
| 2512 | * @throws SettingNotFoundException Thrown if a setting by the given |
| 2513 | * name can't be found or the setting value is not a float. |
| 2514 | * |
| 2515 | * @return The setting's current value. |
| 2516 | */ |
| 2517 | public static float getFloat(ContentResolver cr, String name) |
| 2518 | throws SettingNotFoundException { |
| 2519 | String v = getString(cr, name); |
Brian Muramatsu | e1d4698 | 2010-12-06 17:34:20 -0800 | [diff] [blame] | 2520 | if (v == null) { |
| 2521 | throw new SettingNotFoundException(name); |
| 2522 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2523 | try { |
| 2524 | return Float.parseFloat(v); |
| 2525 | } catch (NumberFormatException e) { |
| 2526 | throw new SettingNotFoundException(name); |
| 2527 | } |
| 2528 | } |
| 2529 | |
| 2530 | /** |
| 2531 | * Convenience function for updating a single settings value as a |
| 2532 | * floating point number. This will either create a new entry in the |
| 2533 | * table if the given name does not exist, or modify the value of the |
| 2534 | * existing row with that name. Note that internally setting values |
| 2535 | * are always stored as strings, so this function converts the given |
| 2536 | * value to a string before storing it. |
| 2537 | * |
| 2538 | * @param cr The ContentResolver to access. |
| 2539 | * @param name The name of the setting to modify. |
| 2540 | * @param value The new value for the setting. |
| 2541 | * @return true if the value was set, false on database errors |
| 2542 | */ |
| 2543 | public static boolean putFloat(ContentResolver cr, String name, float value) { |
| 2544 | return putString(cr, name, Float.toString(value)); |
| 2545 | } |
| 2546 | |
| 2547 | /** |
| 2548 | * The content:// style URL for this table |
| 2549 | */ |
| 2550 | public static final Uri CONTENT_URI = |
| 2551 | Uri.parse("content://" + AUTHORITY + "/secure"); |
| 2552 | |
| 2553 | /** |
Dianne Hackborn | 895f99e | 2012-02-02 11:49:12 -0800 | [diff] [blame] | 2554 | * Whether user has enabled development settings. |
| 2555 | */ |
| 2556 | public static final String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled"; |
| 2557 | |
| 2558 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2559 | * Whether ADB is enabled. |
| 2560 | */ |
| 2561 | public static final String ADB_ENABLED = "adb_enabled"; |
| 2562 | |
| 2563 | /** |
| 2564 | * Setting to allow mock locations and location provider status to be injected into the |
| 2565 | * LocationManager service for testing purposes during application development. These |
| 2566 | * locations and status values override actual location and status information generated |
| 2567 | * by network, gps, or other location providers. |
| 2568 | */ |
| 2569 | public static final String ALLOW_MOCK_LOCATION = "mock_location"; |
| 2570 | |
| 2571 | /** |
Doug Zongker | d8893db | 2010-01-26 12:29:44 -0800 | [diff] [blame] | 2572 | * A 64-bit number (as a hex string) that is randomly |
| 2573 | * generated on the device's first boot and should remain |
| 2574 | * constant for the lifetime of the device. (The value may |
| 2575 | * change if a factory reset is performed on the device.) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2576 | */ |
| 2577 | public static final String ANDROID_ID = "android_id"; |
| 2578 | |
| 2579 | /** |
| 2580 | * Whether bluetooth is enabled/disabled |
| 2581 | * 0=disabled. 1=enabled. |
| 2582 | */ |
| 2583 | public static final String BLUETOOTH_ON = "bluetooth_on"; |
| 2584 | |
| 2585 | /** |
| 2586 | * Get the key that retrieves a bluetooth headset's priority. |
| 2587 | * @hide |
| 2588 | */ |
| 2589 | public static final String getBluetoothHeadsetPriorityKey(String address) { |
| 2590 | return ("bluetooth_headset_priority_" + address.toUpperCase()); |
| 2591 | } |
| 2592 | |
| 2593 | /** |
| 2594 | * Get the key that retrieves a bluetooth a2dp sink's priority. |
| 2595 | * @hide |
| 2596 | */ |
| 2597 | public static final String getBluetoothA2dpSinkPriorityKey(String address) { |
| 2598 | return ("bluetooth_a2dp_sink_priority_" + address.toUpperCase()); |
| 2599 | } |
| 2600 | |
| 2601 | /** |
Jaikumar Ganesh | 545e670 | 2010-06-04 10:23:03 -0700 | [diff] [blame] | 2602 | * Get the key that retrieves a bluetooth Input Device's priority. |
| 2603 | * @hide |
| 2604 | */ |
| 2605 | public static final String getBluetoothInputDevicePriorityKey(String address) { |
| 2606 | return ("bluetooth_input_device_priority_" + address.toUpperCase()); |
| 2607 | } |
| 2608 | |
| 2609 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2610 | * Whether or not data roaming is enabled. (0 = false, 1 = true) |
| 2611 | */ |
| 2612 | public static final String DATA_ROAMING = "data_roaming"; |
| 2613 | |
| 2614 | /** |
| 2615 | * Setting to record the input method used by default, holding the ID |
| 2616 | * of the desired method. |
| 2617 | */ |
| 2618 | public static final String DEFAULT_INPUT_METHOD = "default_input_method"; |
| 2619 | |
| 2620 | /** |
satok | ab751aa | 2010-09-14 19:17:36 +0900 | [diff] [blame] | 2621 | * Setting to record the input method subtype used by default, holding the ID |
| 2622 | * of the desired method. |
| 2623 | */ |
| 2624 | public static final String SELECTED_INPUT_METHOD_SUBTYPE = |
| 2625 | "selected_input_method_subtype"; |
| 2626 | |
| 2627 | /** |
satok | 723a27e | 2010-11-11 14:58:11 +0900 | [diff] [blame] | 2628 | * Setting to record the history of input method subtype, holding the pair of ID of IME |
| 2629 | * and its last used subtype. |
| 2630 | * @hide |
| 2631 | */ |
| 2632 | public static final String INPUT_METHODS_SUBTYPE_HISTORY = |
| 2633 | "input_methods_subtype_history"; |
| 2634 | |
| 2635 | /** |
satok | 5c58dfc | 2010-12-14 21:54:47 +0900 | [diff] [blame] | 2636 | * Setting to record the visibility of input method selector |
| 2637 | */ |
| 2638 | public static final String INPUT_METHOD_SELECTOR_VISIBILITY = |
| 2639 | "input_method_selector_visibility"; |
| 2640 | |
| 2641 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2642 | * Whether the device has been provisioned (0 = false, 1 = true) |
| 2643 | */ |
| 2644 | public static final String DEVICE_PROVISIONED = "device_provisioned"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 2645 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2646 | /** |
| 2647 | * List of input methods that are currently enabled. This is a string |
| 2648 | * containing the IDs of all enabled input methods, each ID separated |
| 2649 | * by ':'. |
| 2650 | */ |
| 2651 | public static final String ENABLED_INPUT_METHODS = "enabled_input_methods"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 2652 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2653 | /** |
Amith Yamasani | e861ec1 | 2010-03-24 21:39:27 -0700 | [diff] [blame] | 2654 | * List of system input methods that are currently disabled. This is a string |
| 2655 | * containing the IDs of all disabled input methods, each ID separated |
| 2656 | * by ':'. |
| 2657 | * @hide |
| 2658 | */ |
| 2659 | public static final String DISABLED_SYSTEM_INPUT_METHODS = "disabled_system_input_methods"; |
| 2660 | |
| 2661 | /** |
Robert Greenwalt | 434203a | 2010-10-11 16:00:27 -0700 | [diff] [blame] | 2662 | * Host name and port for global http proxy. Uses ':' seperator for between host and port |
| 2663 | * TODO - deprecate in favor of global_http_proxy_host, etc |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2664 | */ |
| 2665 | public static final String HTTP_PROXY = "http_proxy"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 2666 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2667 | /** |
Robert Greenwalt | 434203a | 2010-10-11 16:00:27 -0700 | [diff] [blame] | 2668 | * Host name for global http proxy. Set via ConnectivityManager. |
| 2669 | * @hide |
| 2670 | */ |
| 2671 | public static final String GLOBAL_HTTP_PROXY_HOST = "global_http_proxy_host"; |
| 2672 | |
| 2673 | /** |
| 2674 | * Integer host port for global http proxy. Set via ConnectivityManager. |
| 2675 | * @hide |
| 2676 | */ |
| 2677 | public static final String GLOBAL_HTTP_PROXY_PORT = "global_http_proxy_port"; |
| 2678 | |
| 2679 | /** |
Oscar Montemayor | 16fb791 | 2010-08-02 09:38:48 -0700 | [diff] [blame] | 2680 | * Exclusion list for global proxy. This string contains a list of comma-separated |
| 2681 | * domains where the global proxy does not apply. Domains should be listed in a comma- |
| 2682 | * separated list. Example of acceptable formats: ".domain1.com,my.domain2.com" |
Robert Greenwalt | 434203a | 2010-10-11 16:00:27 -0700 | [diff] [blame] | 2683 | * Use ConnectivityManager to set/get. |
Oscar Montemayor | 16fb791 | 2010-08-02 09:38:48 -0700 | [diff] [blame] | 2684 | * @hide |
| 2685 | */ |
Robert Greenwalt | 434203a | 2010-10-11 16:00:27 -0700 | [diff] [blame] | 2686 | public static final String GLOBAL_HTTP_PROXY_EXCLUSION_LIST = |
| 2687 | "global_http_proxy_exclusion_list"; |
Oscar Montemayor | 16fb791 | 2010-08-02 09:38:48 -0700 | [diff] [blame] | 2688 | |
| 2689 | /** |
| 2690 | * Enables the UI setting to allow the user to specify the global HTTP proxy |
| 2691 | * and associated exclusion list. |
| 2692 | * @hide |
| 2693 | */ |
| 2694 | public static final String SET_GLOBAL_HTTP_PROXY = "set_global_http_proxy"; |
| 2695 | |
| 2696 | /** |
Robert Greenwalt | e90aa5e | 2010-09-01 11:34:05 -0700 | [diff] [blame] | 2697 | * Setting for default DNS in case nobody suggests one |
| 2698 | * @hide |
| 2699 | */ |
| 2700 | public static final String DEFAULT_DNS_SERVER = "default_dns_server"; |
| 2701 | |
| 2702 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2703 | * Whether the package installer should allow installation of apps downloaded from |
Dirk Dougherty | 4d7bc655 | 2012-01-27 17:56:49 -0800 | [diff] [blame] | 2704 | * sources other than Google Play. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2705 | * |
| 2706 | * 1 = allow installing from other sources |
Dirk Dougherty | 4d7bc655 | 2012-01-27 17:56:49 -0800 | [diff] [blame] | 2707 | * 0 = only allow installing from Google Play |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2708 | */ |
| 2709 | public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 2710 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2711 | /** |
| 2712 | * Comma-separated list of location providers that activities may access. |
| 2713 | */ |
| 2714 | public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 2715 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2716 | /** |
Danielle Millett | 925a7d8 | 2012-03-19 18:02:20 -0400 | [diff] [blame] | 2717 | * A flag containing settings used for biometric weak |
| 2718 | * @hide |
| 2719 | */ |
| 2720 | public static final String LOCK_BIOMETRIC_WEAK_FLAGS = |
| 2721 | "lock_biometric_weak_flags"; |
| 2722 | |
| 2723 | /** |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 2724 | * Whether autolock is enabled (0 = false, 1 = true) |
| 2725 | */ |
| 2726 | public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock"; |
| 2727 | |
| 2728 | /** |
| 2729 | * Whether lock pattern is visible as user enters (0 = false, 1 = true) |
| 2730 | */ |
| 2731 | public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern"; |
| 2732 | |
| 2733 | /** |
| 2734 | * Whether lock pattern will vibrate as user enters (0 = false, 1 = true) |
| 2735 | */ |
| 2736 | public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = |
| 2737 | "lock_pattern_tactile_feedback_enabled"; |
| 2738 | |
| 2739 | /** |
Jim Miller | bc4603b | 2010-08-30 21:21:34 -0700 | [diff] [blame] | 2740 | * This preference allows the device to be locked given time after screen goes off, |
| 2741 | * subject to current DeviceAdmin policy limits. |
| 2742 | * @hide |
| 2743 | */ |
| 2744 | public static final String LOCK_SCREEN_LOCK_AFTER_TIMEOUT = "lock_screen_lock_after_timeout"; |
| 2745 | |
| 2746 | |
| 2747 | /** |
Jim Miller | 253a5ef | 2010-10-13 20:57:29 -0700 | [diff] [blame] | 2748 | * This preference contains the string that shows for owner info on LockScren. |
| 2749 | * @hide |
| 2750 | */ |
| 2751 | public static final String LOCK_SCREEN_OWNER_INFO = "lock_screen_owner_info"; |
| 2752 | |
| 2753 | /** |
| 2754 | * This preference enables showing the owner info on LockScren. |
| 2755 | * @hide |
| 2756 | */ |
| 2757 | public static final String LOCK_SCREEN_OWNER_INFO_ENABLED = |
| 2758 | "lock_screen_owner_info_enabled"; |
| 2759 | |
| 2760 | /** |
Joe Onorato | 571ae90 | 2011-05-24 13:48:43 -0700 | [diff] [blame] | 2761 | * The saved value for WindowManagerService.setForcedDisplaySize(). |
| 2762 | * Two integers separated by a comma. If unset, then use the real display size. |
| 2763 | * @hide |
| 2764 | */ |
| 2765 | public static final String DISPLAY_SIZE_FORCED = "display_size_forced"; |
| 2766 | |
| 2767 | /** |
Mike Lockwood | bcab8df | 2009-06-25 16:39:09 -0400 | [diff] [blame] | 2768 | * Whether assisted GPS should be enabled or not. |
| 2769 | * @hide |
| 2770 | */ |
| 2771 | public static final String ASSISTED_GPS_ENABLED = "assisted_gps_enabled"; |
| 2772 | |
| 2773 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2774 | * The Logging ID (a unique 64-bit value) as a hex string. |
| 2775 | * Used as a pseudonymous identifier for logging. |
| 2776 | * @deprecated This identifier is poorly initialized and has |
| 2777 | * many collisions. It should not be used. |
| 2778 | */ |
| 2779 | @Deprecated |
| 2780 | public static final String LOGGING_ID = "logging_id"; |
| 2781 | |
| 2782 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2783 | * User preference for which network(s) should be used. Only the |
| 2784 | * connectivity service should touch this. |
| 2785 | */ |
| 2786 | public static final String NETWORK_PREFERENCE = "network_preference"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 2787 | |
| 2788 | /** |
Robert Greenwalt | 2a091d7 | 2010-02-11 18:18:40 -0800 | [diff] [blame] | 2789 | * Used to disable Tethering on a device - defaults to true |
| 2790 | * @hide |
| 2791 | */ |
| 2792 | public static final String TETHER_SUPPORTED = "tether_supported"; |
| 2793 | |
| 2794 | /** |
Robert Greenwalt | 77b32dd | 2010-06-03 18:57:26 -0700 | [diff] [blame] | 2795 | * Used to require DUN APN on the device or not - defaults to a build config value |
| 2796 | * which defaults to false |
| 2797 | * @hide |
| 2798 | */ |
| 2799 | public static final String TETHER_DUN_REQUIRED = "tether_dun_required"; |
| 2800 | |
| 2801 | /** |
| 2802 | * Used to hold a gservices-provisioned apn value for DUN. If set, or the |
| 2803 | * corresponding build config values are set it will override the APN DB |
| 2804 | * values. |
| 2805 | * Consists of a comma seperated list of strings: |
| 2806 | * "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type" |
| 2807 | * note that empty fields can be ommitted: "name,apn,,,,,,,,,310,260,,DUN" |
| 2808 | * @hide |
| 2809 | */ |
| 2810 | public static final String TETHER_DUN_APN = "tether_dun_apn"; |
| 2811 | |
| 2812 | /** |
Dan Egnor | 1c9131c | 2010-02-13 10:38:55 -0800 | [diff] [blame] | 2813 | * No longer supported. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2814 | */ |
| 2815 | public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 2816 | |
| 2817 | /** |
Dan Egnor | 1c9131c | 2010-02-13 10:38:55 -0800 | [diff] [blame] | 2818 | * No longer supported. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2819 | */ |
| 2820 | public static final String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 2821 | |
| 2822 | /** |
Dan Egnor | 1c9131c | 2010-02-13 10:38:55 -0800 | [diff] [blame] | 2823 | * No longer supported. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2824 | */ |
| 2825 | public static final String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 2826 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2827 | /** |
Brad Fitzpatrick | d7ad0d2 | 2010-12-02 15:30:23 -0800 | [diff] [blame] | 2828 | * A positive value indicates how often the SamplingProfiler |
| 2829 | * should take snapshots. Zero value means SamplingProfiler |
| 2830 | * is disabled. |
Sen Hu | bde7570 | 2010-05-28 01:54:03 -0700 | [diff] [blame] | 2831 | * |
| 2832 | * @hide |
| 2833 | */ |
Brad Fitzpatrick | d7ad0d2 | 2010-12-02 15:30:23 -0800 | [diff] [blame] | 2834 | public static final String SAMPLING_PROFILER_MS = "sampling_profiler_ms"; |
Sen Hu | bde7570 | 2010-05-28 01:54:03 -0700 | [diff] [blame] | 2835 | |
| 2836 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2837 | * Settings classname to launch when Settings is clicked from All |
| 2838 | * Applications. Needed because of user testing between the old |
| 2839 | * and new Settings apps. |
| 2840 | */ |
| 2841 | // TODO: 881807 |
| 2842 | public static final String SETTINGS_CLASSNAME = "settings_classname"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 2843 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2844 | /** |
| 2845 | * USB Mass Storage Enabled |
| 2846 | */ |
| 2847 | public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 2848 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2849 | /** |
| 2850 | * If this setting is set (to anything), then all references |
| 2851 | * to Gmail on the device must change to Google Mail. |
| 2852 | */ |
| 2853 | public static final String USE_GOOGLE_MAIL = "use_google_mail"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 2854 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2855 | /** |
svetoslavganov | 75986cf | 2009-05-14 22:28:01 -0700 | [diff] [blame] | 2856 | * If accessibility is enabled. |
| 2857 | */ |
| 2858 | public static final String ACCESSIBILITY_ENABLED = "accessibility_enabled"; |
| 2859 | |
| 2860 | /** |
Svetoslav Ganov | 00aabf7 | 2011-07-21 11:35:03 -0700 | [diff] [blame] | 2861 | * If touch exploration is enabled. |
Svetoslav Ganov | 35bfede | 2011-07-14 17:57:06 -0700 | [diff] [blame] | 2862 | */ |
Svetoslav Ganov | 00aabf7 | 2011-07-21 11:35:03 -0700 | [diff] [blame] | 2863 | public static final String TOUCH_EXPLORATION_ENABLED = "touch_exploration_enabled"; |
Svetoslav Ganov | 35bfede | 2011-07-14 17:57:06 -0700 | [diff] [blame] | 2864 | |
| 2865 | /** |
svetoslavganov | 75986cf | 2009-05-14 22:28:01 -0700 | [diff] [blame] | 2866 | * List of the enabled accessibility providers. |
| 2867 | */ |
| 2868 | public static final String ENABLED_ACCESSIBILITY_SERVICES = |
| 2869 | "enabled_accessibility_services"; |
| 2870 | |
| 2871 | /** |
Svetoslav Ganov | 55f937a | 2011-12-05 11:42:07 -0800 | [diff] [blame] | 2872 | * Whether to speak passwords while in accessibility mode. |
| 2873 | */ |
| 2874 | public static final String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password"; |
| 2875 | |
| 2876 | /** |
Svetoslav Ganov | 3ca5a74 | 2011-12-06 15:24:37 -0800 | [diff] [blame] | 2877 | * If injection of accessibility enhancing JavaScript screen-reader |
Svetoslav Ganov | 585f13f8d | 2010-08-10 07:59:15 -0700 | [diff] [blame] | 2878 | * is enabled. |
| 2879 | * <p> |
Svetoslav Ganov | 3ca5a74 | 2011-12-06 15:24:37 -0800 | [diff] [blame] | 2880 | * Note: The JavaScript based screen-reader is served by the |
Svetoslav Ganov | 585f13f8d | 2010-08-10 07:59:15 -0700 | [diff] [blame] | 2881 | * Google infrastructure and enable users with disabilities to |
| 2882 | * efficiantly navigate in and explore web content. |
| 2883 | * </p> |
| 2884 | * <p> |
| 2885 | * This property represents a boolean value. |
| 2886 | * </p> |
| 2887 | * @hide |
| 2888 | */ |
| 2889 | public static final String ACCESSIBILITY_SCRIPT_INJECTION = |
| 2890 | "accessibility_script_injection"; |
| 2891 | |
| 2892 | /** |
Svetoslav Ganov | 3ca5a74 | 2011-12-06 15:24:37 -0800 | [diff] [blame] | 2893 | * The URL for the injected JavaScript based screen-reader used |
| 2894 | * for providing accessiblity of content in WebView. |
| 2895 | * <p> |
| 2896 | * Note: The JavaScript based screen-reader is served by the |
| 2897 | * Google infrastructure and enable users with disabilities to |
| 2898 | * efficiently navigate in and explore web content. |
| 2899 | * </p> |
| 2900 | * <p> |
| 2901 | * This property represents a string value. |
| 2902 | * </p> |
| 2903 | * @hide |
| 2904 | */ |
| 2905 | public static final String ACCESSIBILITY_SCREEN_READER_URL = |
| 2906 | "accessibility_script_injection_url"; |
| 2907 | |
| 2908 | /** |
Svetoslav Ganov | 585f13f8d | 2010-08-10 07:59:15 -0700 | [diff] [blame] | 2909 | * Key bindings for navigation in built-in accessibility support for web content. |
| 2910 | * <p> |
| 2911 | * Note: These key bindings are for the built-in accessibility navigation for |
| 2912 | * web content which is used as a fall back solution if JavaScript in a WebView |
| 2913 | * is not enabled or the user has not opted-in script injection from Google. |
| 2914 | * </p> |
| 2915 | * <p> |
| 2916 | * The bindings are separated by semi-colon. A binding is a mapping from |
| 2917 | * a key to a sequence of actions (for more details look at |
| 2918 | * android.webkit.AccessibilityInjector). A key is represented as the hexademical |
| 2919 | * string representation of an integer obtained from a meta state (optional) shifted |
| 2920 | * sixteen times left and bitwise ored with a key code. An action is represented |
| 2921 | * as a hexademical string representation of an integer where the first two digits |
| 2922 | * are navigation action index, the second, the third, and the fourth digit pairs |
| 2923 | * represent the action arguments. The separate actions in a binding are colon |
| 2924 | * separated. The key and the action sequence it maps to are separated by equals. |
| 2925 | * </p> |
| 2926 | * <p> |
| 2927 | * For example, the binding below maps the DPAD right button to traverse the |
| 2928 | * current navigation axis once without firing an accessibility event and to |
| 2929 | * perform the same traversal again but to fire an event: |
| 2930 | * <code> |
| 2931 | * 0x16=0x01000100:0x01000101; |
| 2932 | * </code> |
| 2933 | * </p> |
| 2934 | * <p> |
| 2935 | * The goal of this binding is to enable dynamic rebinding of keys to |
| 2936 | * navigation actions for web content without requiring a framework change. |
| 2937 | * </p> |
| 2938 | * <p> |
| 2939 | * This property represents a string value. |
| 2940 | * </p> |
| 2941 | * @hide |
| 2942 | */ |
| 2943 | public static final String ACCESSIBILITY_WEB_CONTENT_KEY_BINDINGS = |
| 2944 | "accessibility_web_content_key_bindings"; |
| 2945 | |
| 2946 | /** |
Svetoslav Ganov | 54d068e | 2011-03-02 12:58:40 -0800 | [diff] [blame] | 2947 | * The timout for considering a press to be a long press in milliseconds. |
| 2948 | * @hide |
| 2949 | */ |
| 2950 | public static final String LONG_PRESS_TIMEOUT = "long_press_timeout"; |
| 2951 | |
| 2952 | /** |
Jean-Michel Trivi | f62ba45 | 2009-06-04 14:55:24 -0700 | [diff] [blame] | 2953 | * Setting to always use the default text-to-speech settings regardless |
| 2954 | * of the application settings. |
| 2955 | * 1 = override application settings, |
| 2956 | * 0 = use application settings (if specified). |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 2957 | * |
| 2958 | * @deprecated The value of this setting is no longer respected by |
| 2959 | * the framework text to speech APIs as of the Ice Cream Sandwich release. |
Jean-Michel Trivi | f62ba45 | 2009-06-04 14:55:24 -0700 | [diff] [blame] | 2960 | */ |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 2961 | @Deprecated |
Jean-Michel Trivi | f62ba45 | 2009-06-04 14:55:24 -0700 | [diff] [blame] | 2962 | public static final String TTS_USE_DEFAULTS = "tts_use_defaults"; |
| 2963 | |
| 2964 | /** |
| 2965 | * Default text-to-speech engine speech rate. 100 = 1x |
| 2966 | */ |
| 2967 | public static final String TTS_DEFAULT_RATE = "tts_default_rate"; |
| 2968 | |
| 2969 | /** |
| 2970 | * Default text-to-speech engine pitch. 100 = 1x |
| 2971 | */ |
| 2972 | public static final String TTS_DEFAULT_PITCH = "tts_default_pitch"; |
| 2973 | |
| 2974 | /** |
| 2975 | * Default text-to-speech engine. |
| 2976 | */ |
| 2977 | public static final String TTS_DEFAULT_SYNTH = "tts_default_synth"; |
| 2978 | |
| 2979 | /** |
Jean-Michel Trivi | f478267 | 2009-06-09 16:22:48 -0700 | [diff] [blame] | 2980 | * Default text-to-speech language. |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 2981 | * |
| 2982 | * @deprecated this setting is no longer in use, as of the Ice Cream |
| 2983 | * Sandwich release. Apps should never need to read this setting directly, |
| 2984 | * instead can query the TextToSpeech framework classes for the default |
| 2985 | * locale. {@link TextToSpeech#getLanguage()}. |
Jean-Michel Trivi | f478267 | 2009-06-09 16:22:48 -0700 | [diff] [blame] | 2986 | */ |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 2987 | @Deprecated |
Jean-Michel Trivi | f478267 | 2009-06-09 16:22:48 -0700 | [diff] [blame] | 2988 | public static final String TTS_DEFAULT_LANG = "tts_default_lang"; |
| 2989 | |
| 2990 | /** |
Jean-Michel Trivi | a6fcc95 | 2009-06-19 14:06:01 -0700 | [diff] [blame] | 2991 | * Default text-to-speech country. |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 2992 | * |
| 2993 | * @deprecated this setting is no longer in use, as of the Ice Cream |
| 2994 | * Sandwich release. Apps should never need to read this setting directly, |
| 2995 | * instead can query the TextToSpeech framework classes for the default |
| 2996 | * locale. {@link TextToSpeech#getLanguage()}. |
Jean-Michel Trivi | a6fcc95 | 2009-06-19 14:06:01 -0700 | [diff] [blame] | 2997 | */ |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 2998 | @Deprecated |
Jean-Michel Trivi | a6fcc95 | 2009-06-19 14:06:01 -0700 | [diff] [blame] | 2999 | public static final String TTS_DEFAULT_COUNTRY = "tts_default_country"; |
| 3000 | |
| 3001 | /** |
| 3002 | * Default text-to-speech locale variant. |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 3003 | * |
| 3004 | * @deprecated this setting is no longer in use, as of the Ice Cream |
| 3005 | * Sandwich release. Apps should never need to read this setting directly, |
| 3006 | * instead can query the TextToSpeech framework classes for the |
| 3007 | * locale that is in use {@link TextToSpeech#getLanguage()}. |
Jean-Michel Trivi | a6fcc95 | 2009-06-19 14:06:01 -0700 | [diff] [blame] | 3008 | */ |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 3009 | @Deprecated |
Jean-Michel Trivi | a6fcc95 | 2009-06-19 14:06:01 -0700 | [diff] [blame] | 3010 | public static final String TTS_DEFAULT_VARIANT = "tts_default_variant"; |
| 3011 | |
| 3012 | /** |
Narayan Kamath | e5b8c4d | 2011-08-22 15:37:47 +0100 | [diff] [blame] | 3013 | * Stores the default tts locales on a per engine basis. Stored as |
| 3014 | * a comma seperated list of values, each value being of the form |
| 3015 | * {@code engine_name:locale} for example, |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 3016 | * {@code com.foo.ttsengine:eng-USA,com.bar.ttsengine:esp-ESP}. This |
| 3017 | * supersedes {@link #TTS_DEFAULT_LANG}, {@link #TTS_DEFAULT_COUNTRY} and |
| 3018 | * {@link #TTS_DEFAULT_VARIANT}. Apps should never need to read this |
| 3019 | * setting directly, and can query the TextToSpeech framework classes |
| 3020 | * for the locale that is in use. |
Narayan Kamath | e5b8c4d | 2011-08-22 15:37:47 +0100 | [diff] [blame] | 3021 | * |
| 3022 | * @hide |
| 3023 | */ |
| 3024 | public static final String TTS_DEFAULT_LOCALE = "tts_default_locale"; |
| 3025 | |
| 3026 | /** |
Charles Chen | ceffa15 | 2010-03-16 21:18:10 -0700 | [diff] [blame] | 3027 | * Space delimited list of plugin packages that are enabled. |
| 3028 | */ |
| 3029 | public static final String TTS_ENABLED_PLUGINS = "tts_enabled_plugins"; |
| 3030 | |
| 3031 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3032 | * Whether to notify the user of open networks. |
| 3033 | * <p> |
| 3034 | * If not connected and the scan results have an open network, we will |
| 3035 | * put this notification up. If we attempt to connect to a network or |
| 3036 | * the open network(s) disappear, we remove the notification. When we |
| 3037 | * show the notification, we will not show it again for |
| 3038 | * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time. |
| 3039 | */ |
| 3040 | public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON = |
| 3041 | "wifi_networks_available_notification_on"; |
Robert Greenwalt | 8588e47 | 2011-11-08 10:12:25 -0800 | [diff] [blame] | 3042 | /** |
| 3043 | * {@hide} |
| 3044 | */ |
tk.mun | 148c7d0 | 2011-10-13 22:51:57 +0900 | [diff] [blame] | 3045 | public static final String WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON = |
| 3046 | "wimax_networks_available_notification_on"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 3047 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3048 | /** |
| 3049 | * Delay (in seconds) before repeating the Wi-Fi networks available notification. |
| 3050 | * Connecting to a network will reset the timer. |
| 3051 | */ |
| 3052 | public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY = |
| 3053 | "wifi_networks_available_repeat_delay"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 3054 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3055 | /** |
Irfan Sheriff | ed4f28b | 2010-10-29 15:32:10 -0700 | [diff] [blame] | 3056 | * 802.11 country code in ISO 3166 format |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3057 | * @hide |
| 3058 | */ |
Irfan Sheriff | ed4f28b | 2010-10-29 15:32:10 -0700 | [diff] [blame] | 3059 | public static final String WIFI_COUNTRY_CODE = "wifi_country_code"; |
| 3060 | |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 3061 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3062 | /** |
| 3063 | * When the number of open networks exceeds this number, the |
| 3064 | * least-recently-used excess networks will be removed. |
| 3065 | */ |
| 3066 | public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 3067 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3068 | /** |
| 3069 | * Whether the Wi-Fi should be on. Only the Wi-Fi service should touch this. |
| 3070 | */ |
| 3071 | public static final String WIFI_ON = "wifi_on"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 3072 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3073 | /** |
Irfan Sheriff | a3bd409 | 2010-03-24 17:58:59 -0700 | [diff] [blame] | 3074 | * Used to save the Wifi_ON state prior to tethering. |
| 3075 | * This state will be checked to restore Wifi after |
| 3076 | * the user turns off tethering. |
Irfan Sheriff | 5321aef | 2010-02-12 12:35:59 -0800 | [diff] [blame] | 3077 | * |
| 3078 | * @hide |
| 3079 | */ |
Irfan Sheriff | a3bd409 | 2010-03-24 17:58:59 -0700 | [diff] [blame] | 3080 | public static final String WIFI_SAVED_STATE = "wifi_saved_state"; |
Irfan Sheriff | 5321aef | 2010-02-12 12:35:59 -0800 | [diff] [blame] | 3081 | |
| 3082 | /** |
Irfan Sheriff | 9ab518ad | 2010-03-12 15:48:17 -0800 | [diff] [blame] | 3083 | * AP SSID |
| 3084 | * |
| 3085 | * @hide |
| 3086 | */ |
| 3087 | public static final String WIFI_AP_SSID = "wifi_ap_ssid"; |
| 3088 | |
| 3089 | /** |
| 3090 | * AP security |
| 3091 | * |
| 3092 | * @hide |
| 3093 | */ |
| 3094 | public static final String WIFI_AP_SECURITY = "wifi_ap_security"; |
| 3095 | |
| 3096 | /** |
| 3097 | * AP passphrase |
| 3098 | * |
| 3099 | * @hide |
| 3100 | */ |
| 3101 | public static final String WIFI_AP_PASSWD = "wifi_ap_passwd"; |
| 3102 | |
| 3103 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3104 | * The acceptable packet loss percentage (range 0 - 100) before trying |
| 3105 | * another AP on the same network. |
| 3106 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 3107 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3108 | public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE = |
| 3109 | "wifi_watchdog_acceptable_packet_loss_percentage"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 3110 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3111 | /** |
| 3112 | * The number of access points required for a network in order for the |
| 3113 | * watchdog to monitor it. |
| 3114 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 3115 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3116 | public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 3117 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3118 | /** |
| 3119 | * The delay between background checks. |
| 3120 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 3121 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3122 | public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS = |
| 3123 | "wifi_watchdog_background_check_delay_ms"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 3124 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3125 | /** |
| 3126 | * Whether the Wi-Fi watchdog is enabled for background checking even |
| 3127 | * after it thinks the user has connected to a good access point. |
| 3128 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 3129 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3130 | public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED = |
| 3131 | "wifi_watchdog_background_check_enabled"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 3132 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3133 | /** |
| 3134 | * The timeout for a background ping |
| 3135 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 3136 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3137 | public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS = |
| 3138 | "wifi_watchdog_background_check_timeout_ms"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 3139 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3140 | /** |
| 3141 | * The number of initial pings to perform that *may* be ignored if they |
| 3142 | * fail. Again, if these fail, they will *not* be used in packet loss |
| 3143 | * calculation. For example, one network always seemed to time out for |
| 3144 | * the first couple pings, so this is set to 3 by default. |
| 3145 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 3146 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3147 | public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT = |
| 3148 | "wifi_watchdog_initial_ignored_ping_count"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 3149 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3150 | /** |
| 3151 | * The maximum number of access points (per network) to attempt to test. |
| 3152 | * If this number is reached, the watchdog will no longer monitor the |
| 3153 | * initial connection state for the network. This is a safeguard for |
| 3154 | * networks containing multiple APs whose DNS does not respond to pings. |
| 3155 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 3156 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3157 | public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = "wifi_watchdog_max_ap_checks"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 3158 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3159 | /** |
| 3160 | * Whether the Wi-Fi watchdog is enabled. |
| 3161 | */ |
| 3162 | public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on"; |
| 3163 | |
| 3164 | /** |
| 3165 | * A comma-separated list of SSIDs for which the Wi-Fi watchdog should be enabled. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3166 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 3167 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3168 | public static final String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list"; |
| 3169 | |
| 3170 | /** |
| 3171 | * The number of pings to test if an access point is a good connection. |
| 3172 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 3173 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3174 | public static final String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 3175 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3176 | /** |
| 3177 | * The delay between pings. |
| 3178 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 3179 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3180 | public static final String WIFI_WATCHDOG_PING_DELAY_MS = "wifi_watchdog_ping_delay_ms"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 3181 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3182 | /** |
| 3183 | * The timeout per ping. |
| 3184 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 3185 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3186 | public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 3187 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3188 | /** |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 3189 | * ms delay before rechecking an 'online' wifi connection when it is thought to be unstable. |
| 3190 | * @hide |
| 3191 | */ |
Irfan Sheriff | 07573b3 | 2012-01-27 21:00:19 -0800 | [diff] [blame] | 3192 | public static final String WIFI_WATCHDOG_ARP_CHECK_INTERVAL_MS = |
| 3193 | "wifi_watchdog_arp_interval_ms"; |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 3194 | |
| 3195 | /** |
Irfan Sheriff | 4c8982a | 2012-03-08 16:11:02 -0800 | [diff] [blame] | 3196 | * ms delay interval between rssi polling when the signal is known to be weak |
| 3197 | * @hide |
| 3198 | */ |
| 3199 | public static final String WIFI_WATCHDOG_RSSI_FETCH_INTERVAL_MS = |
| 3200 | "wifi_watchdog_rssi_fetch_interval_ms"; |
| 3201 | |
| 3202 | |
| 3203 | /** |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 3204 | * ms delay before rechecking a connect SSID for walled garden with a http download. |
| 3205 | * @hide |
| 3206 | */ |
| 3207 | public static final String WIFI_WATCHDOG_WALLED_GARDEN_INTERVAL_MS = |
| 3208 | "wifi_watchdog_walled_garden_interval_ms"; |
| 3209 | |
| 3210 | /** |
Irfan Sheriff | 07573b3 | 2012-01-27 21:00:19 -0800 | [diff] [blame] | 3211 | * Number of ARP pings per check. |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 3212 | * @hide |
| 3213 | */ |
Irfan Sheriff | 07573b3 | 2012-01-27 21:00:19 -0800 | [diff] [blame] | 3214 | public static final String WIFI_WATCHDOG_NUM_ARP_PINGS = "wifi_watchdog_num_arp_pings"; |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 3215 | |
| 3216 | /** |
Irfan Sheriff | 07573b3 | 2012-01-27 21:00:19 -0800 | [diff] [blame] | 3217 | * Minimum number of responses to the arp pings to consider the test 'successful'. |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 3218 | * @hide |
| 3219 | */ |
Irfan Sheriff | 07573b3 | 2012-01-27 21:00:19 -0800 | [diff] [blame] | 3220 | public static final String WIFI_WATCHDOG_MIN_ARP_RESPONSES = |
| 3221 | "wifi_watchdog_min_arp_responses"; |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 3222 | |
| 3223 | /** |
Irfan Sheriff | 07573b3 | 2012-01-27 21:00:19 -0800 | [diff] [blame] | 3224 | * Timeout on ARP pings |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 3225 | * @hide |
| 3226 | */ |
Irfan Sheriff | 07573b3 | 2012-01-27 21:00:19 -0800 | [diff] [blame] | 3227 | public static final String WIFI_WATCHDOG_ARP_PING_TIMEOUT_MS = |
| 3228 | "wifi_watchdog_arp_ping_timeout_ms"; |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 3229 | |
| 3230 | /** |
Irfan Sheriff | 07573b3 | 2012-01-27 21:00:19 -0800 | [diff] [blame] | 3231 | * Setting to turn off poor network avoidance on Wi-Fi. Feature is enabled by default and |
| 3232 | * the setting needs to be set to 0 to disable it. |
Irfan Sheriff | 19380da | 2011-12-06 14:41:14 -0800 | [diff] [blame] | 3233 | * @hide |
| 3234 | */ |
| 3235 | public static final String WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED = |
| 3236 | "wifi_watchdog_poor_network_test_enabled"; |
| 3237 | |
| 3238 | /** |
Irfan Sheriff | 5ea65d6 | 2011-06-05 21:29:56 -0700 | [diff] [blame] | 3239 | * Setting to turn off walled garden test on Wi-Fi. Feature is enabled by default and |
| 3240 | * the setting needs to be set to 0 to disable it. |
| 3241 | * @hide |
| 3242 | */ |
| 3243 | public static final String WIFI_WATCHDOG_WALLED_GARDEN_TEST_ENABLED = |
| 3244 | "wifi_watchdog_walled_garden_test_enabled"; |
| 3245 | |
| 3246 | /** |
| 3247 | * The URL used for walled garden check upon a new conection. WifiWatchdogService |
| 3248 | * fetches the URL and checks to see if {@link #WIFI_WATCHDOG_WALLED_GARDEN_PATTERN} |
| 3249 | * is not part of the title string to notify the user on the presence of a walled garden. |
| 3250 | * @hide |
| 3251 | */ |
| 3252 | public static final String WIFI_WATCHDOG_WALLED_GARDEN_URL = |
| 3253 | "wifi_watchdog_walled_garden_url"; |
| 3254 | |
| 3255 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3256 | * The maximum number of times we will retry a connection to an access |
| 3257 | * point for which we have failed in acquiring an IP address from DHCP. |
| 3258 | * A value of N means that we will make N+1 connection attempts in all. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3259 | */ |
| 3260 | public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 3261 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3262 | /** |
Irfan Sheriff | 36f7413 | 2010-11-04 16:57:37 -0700 | [diff] [blame] | 3263 | * The operational wifi frequency band |
| 3264 | * Set to one of {@link WifiManager#WIFI_FREQUENCY_BAND_AUTO}, |
| 3265 | * {@link WifiManager#WIFI_FREQUENCY_BAND_5GHZ} or |
| 3266 | * {@link WifiManager#WIFI_FREQUENCY_BAND_2GHZ} |
| 3267 | * |
| 3268 | * @hide |
| 3269 | */ |
| 3270 | public static final String WIFI_FREQUENCY_BAND = "wifi_frequency_band"; |
| 3271 | |
| 3272 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3273 | * Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile |
| 3274 | * data connectivity to be established after a disconnect from Wi-Fi. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3275 | */ |
| 3276 | public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS = |
| 3277 | "wifi_mobile_data_transition_wakelock_timeout_ms"; |
| 3278 | |
| 3279 | /** |
| 3280 | * Whether background data usage is allowed by the user. See |
| 3281 | * ConnectivityManager for more info. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3282 | */ |
Jeff Sharkey | 3a844fc | 2011-08-16 14:37:57 -0700 | [diff] [blame] | 3283 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3284 | public static final String BACKGROUND_DATA = "background_data"; |
Wink Saville | 04e71b3 | 2009-04-02 11:00:54 -0700 | [diff] [blame] | 3285 | |
| 3286 | /** |
Bjorn Bringert | 98bfa39 | 2010-03-24 10:59:48 +0000 | [diff] [blame] | 3287 | * Origins for which browsers should allow geolocation by default. |
| 3288 | * The value is a space-separated list of origins. |
| 3289 | */ |
| 3290 | public static final String ALLOWED_GEOLOCATION_ORIGINS |
| 3291 | = "allowed_geolocation_origins"; |
| 3292 | |
| 3293 | /** |
Robert Greenwalt | c03fa50 | 2010-02-23 18:58:05 -0800 | [diff] [blame] | 3294 | * Whether mobile data connections are allowed by the user. See |
| 3295 | * ConnectivityManager for more info. |
| 3296 | * @hide |
| 3297 | */ |
| 3298 | public static final String MOBILE_DATA = "mobile_data"; |
| 3299 | |
| 3300 | /** |
Wink Saville | 04e71b3 | 2009-04-02 11:00:54 -0700 | [diff] [blame] | 3301 | * The CDMA roaming mode 0 = Home Networks, CDMA default |
| 3302 | * 1 = Roaming on Affiliated networks |
| 3303 | * 2 = Roaming on any networks |
| 3304 | * @hide |
| 3305 | */ |
| 3306 | public static final String CDMA_ROAMING_MODE = "roaming_settings"; |
| 3307 | |
| 3308 | /** |
| 3309 | * The CDMA subscription mode 0 = RUIM/SIM (default) |
| 3310 | * 1 = NV |
| 3311 | * @hide |
| 3312 | */ |
| 3313 | public static final String CDMA_SUBSCRIPTION_MODE = "subscription_mode"; |
| 3314 | |
| 3315 | /** |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 3316 | * The preferred network mode 7 = Global |
| 3317 | * 6 = EvDo only |
| 3318 | * 5 = CDMA w/o EvDo |
| 3319 | * 4 = CDMA / EvDo auto |
| 3320 | * 3 = GSM / WCDMA auto |
| 3321 | * 2 = WCDMA only |
| 3322 | * 1 = GSM only |
| 3323 | * 0 = GSM / WCDMA preferred |
Wink Saville | 04e71b3 | 2009-04-02 11:00:54 -0700 | [diff] [blame] | 3324 | * @hide |
| 3325 | */ |
| 3326 | public static final String PREFERRED_NETWORK_MODE = |
| 3327 | "preferred_network_mode"; |
| 3328 | |
| 3329 | /** |
Wink Saville | e9b06d7 | 2009-05-18 21:47:50 -0700 | [diff] [blame] | 3330 | * The preferred TTY mode 0 = TTy Off, CDMA default |
| 3331 | * 1 = TTY Full |
| 3332 | * 2 = TTY HCO |
| 3333 | * 3 = TTY VCO |
| 3334 | * @hide |
| 3335 | */ |
| 3336 | public static final String PREFERRED_TTY_MODE = |
| 3337 | "preferred_tty_mode"; |
| 3338 | |
| 3339 | |
| 3340 | /** |
Wink Saville | 04e71b3 | 2009-04-02 11:00:54 -0700 | [diff] [blame] | 3341 | * CDMA Cell Broadcast SMS |
| 3342 | * 0 = CDMA Cell Broadcast SMS disabled |
| 3343 | * 1 = CDMA Cell Broadcast SMS enabled |
| 3344 | * @hide |
| 3345 | */ |
| 3346 | public static final String CDMA_CELL_BROADCAST_SMS = |
| 3347 | "cdma_cell_broadcast_sms"; |
| 3348 | |
| 3349 | /** |
| 3350 | * The cdma subscription 0 = Subscription from RUIM, when available |
| 3351 | * 1 = Subscription from NV |
| 3352 | * @hide |
| 3353 | */ |
| 3354 | public static final String PREFERRED_CDMA_SUBSCRIPTION = |
| 3355 | "preferred_cdma_subscription"; |
| 3356 | |
| 3357 | /** |
| 3358 | * Whether the enhanced voice privacy mode is enabled. |
| 3359 | * 0 = normal voice privacy |
| 3360 | * 1 = enhanced voice privacy |
| 3361 | * @hide |
| 3362 | */ |
| 3363 | public static final String ENHANCED_VOICE_PRIVACY_ENABLED = "enhanced_voice_privacy_enabled"; |
| 3364 | |
| 3365 | /** |
| 3366 | * Whether the TTY mode mode is enabled. |
| 3367 | * 0 = disabled |
| 3368 | * 1 = enabled |
| 3369 | * @hide |
| 3370 | */ |
| 3371 | public static final String TTY_MODE_ENABLED = "tty_mode_enabled"; |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 3372 | |
| 3373 | /** |
Wink Saville | 628b085 | 2011-08-04 15:01:58 -0700 | [diff] [blame] | 3374 | * The number of milliseconds to delay before sending out Connectivyt Change broadcasts |
| 3375 | * @hide |
| 3376 | */ |
| 3377 | public static final String CONNECTIVITY_CHANGE_DELAY = "connectivity_change_delay"; |
| 3378 | |
| 3379 | /** |
| 3380 | * Default value for CONNECTIVITY_CHANGE_DELAY in milliseconds. |
| 3381 | * @hide |
| 3382 | */ |
| 3383 | public static final int CONNECTIVITY_CHANGE_DELAY_DEFAULT = 3000; |
| 3384 | |
| 3385 | /** |
Christopher Tate | 8031a3d | 2009-07-06 16:36:05 -0700 | [diff] [blame] | 3386 | * Controls whether settings backup is enabled. |
Dianne Hackborn | cf09829 | 2009-07-01 19:55:20 -0700 | [diff] [blame] | 3387 | * Type: int ( 0 = disabled, 1 = enabled ) |
| 3388 | * @hide |
| 3389 | */ |
| 3390 | public static final String BACKUP_ENABLED = "backup_enabled"; |
| 3391 | |
| 3392 | /** |
Christopher Tate | cce9da5 | 2010-02-03 15:11:15 -0800 | [diff] [blame] | 3393 | * Controls whether application data is automatically restored from backup |
| 3394 | * at install time. |
| 3395 | * Type: int ( 0 = disabled, 1 = enabled ) |
| 3396 | * @hide |
| 3397 | */ |
| 3398 | public static final String BACKUP_AUTO_RESTORE = "backup_auto_restore"; |
| 3399 | |
| 3400 | /** |
Christopher Tate | 8031a3d | 2009-07-06 16:36:05 -0700 | [diff] [blame] | 3401 | * Indicates whether settings backup has been fully provisioned. |
| 3402 | * Type: int ( 0 = unprovisioned, 1 = fully provisioned ) |
| 3403 | * @hide |
| 3404 | */ |
| 3405 | public static final String BACKUP_PROVISIONED = "backup_provisioned"; |
| 3406 | |
| 3407 | /** |
Dianne Hackborn | cf09829 | 2009-07-01 19:55:20 -0700 | [diff] [blame] | 3408 | * Component of the transport to use for backup/restore. |
| 3409 | * @hide |
| 3410 | */ |
| 3411 | public static final String BACKUP_TRANSPORT = "backup_transport"; |
Sanjay Jeyakumar | 21bf241 | 2009-07-09 13:31:48 -0700 | [diff] [blame] | 3412 | |
Dianne Hackborn | d7cd29d | 2009-07-01 11:22:45 -0700 | [diff] [blame] | 3413 | /** |
| 3414 | * Version for which the setup wizard was last shown. Bumped for |
| 3415 | * each release when there is new setup information to show. |
| 3416 | * @hide |
| 3417 | */ |
| 3418 | public static final String LAST_SETUP_SHOWN = "last_setup_shown"; |
Dianne Hackborn | cf09829 | 2009-07-01 19:55:20 -0700 | [diff] [blame] | 3419 | |
| 3420 | /** |
Doug Zongker | f688889 | 2010-01-06 16:38:14 -0800 | [diff] [blame] | 3421 | * How frequently (in seconds) to check the memory status of the |
| 3422 | * device. |
| 3423 | * @hide |
| 3424 | */ |
| 3425 | public static final String MEMCHECK_INTERVAL = "memcheck_interval"; |
| 3426 | |
| 3427 | /** |
| 3428 | * Max frequency (in seconds) to log memory check stats, in realtime |
| 3429 | * seconds. This allows for throttling of logs when the device is |
| 3430 | * running for large amounts of time. |
| 3431 | * @hide |
| 3432 | */ |
| 3433 | public static final String MEMCHECK_LOG_REALTIME_INTERVAL = |
| 3434 | "memcheck_log_realtime_interval"; |
| 3435 | |
| 3436 | /** |
| 3437 | * Boolean indicating whether rebooting due to system memory checks |
| 3438 | * is enabled. |
| 3439 | * @hide |
| 3440 | */ |
| 3441 | public static final String MEMCHECK_SYSTEM_ENABLED = "memcheck_system_enabled"; |
| 3442 | |
| 3443 | /** |
| 3444 | * How many bytes the system process must be below to avoid scheduling |
| 3445 | * a soft reboot. This reboot will happen when it is next determined |
| 3446 | * to be a good time. |
| 3447 | * @hide |
| 3448 | */ |
| 3449 | public static final String MEMCHECK_SYSTEM_SOFT_THRESHOLD = "memcheck_system_soft"; |
| 3450 | |
| 3451 | /** |
| 3452 | * How many bytes the system process must be below to avoid scheduling |
| 3453 | * a hard reboot. This reboot will happen immediately. |
| 3454 | * @hide |
| 3455 | */ |
| 3456 | public static final String MEMCHECK_SYSTEM_HARD_THRESHOLD = "memcheck_system_hard"; |
| 3457 | |
| 3458 | /** |
| 3459 | * How many bytes the phone process must be below to avoid scheduling |
| 3460 | * a soft restart. This restart will happen when it is next determined |
| 3461 | * to be a good time. |
| 3462 | * @hide |
| 3463 | */ |
| 3464 | public static final String MEMCHECK_PHONE_SOFT_THRESHOLD = "memcheck_phone_soft"; |
| 3465 | |
| 3466 | /** |
| 3467 | * How many bytes the phone process must be below to avoid scheduling |
| 3468 | * a hard restart. This restart will happen immediately. |
| 3469 | * @hide |
| 3470 | */ |
| 3471 | public static final String MEMCHECK_PHONE_HARD_THRESHOLD = "memcheck_phone_hard"; |
| 3472 | |
| 3473 | /** |
| 3474 | * Boolean indicating whether restarting the phone process due to |
| 3475 | * memory checks is enabled. |
| 3476 | * @hide |
| 3477 | */ |
| 3478 | public static final String MEMCHECK_PHONE_ENABLED = "memcheck_phone_enabled"; |
| 3479 | |
| 3480 | /** |
| 3481 | * First time during the day it is okay to kill processes |
| 3482 | * or reboot the device due to low memory situations. This number is |
| 3483 | * in seconds since midnight. |
| 3484 | * @hide |
| 3485 | */ |
| 3486 | public static final String MEMCHECK_EXEC_START_TIME = "memcheck_exec_start_time"; |
| 3487 | |
| 3488 | /** |
| 3489 | * Last time during the day it is okay to kill processes |
| 3490 | * or reboot the device due to low memory situations. This number is |
| 3491 | * in seconds since midnight. |
| 3492 | * @hide |
| 3493 | */ |
| 3494 | public static final String MEMCHECK_EXEC_END_TIME = "memcheck_exec_end_time"; |
| 3495 | |
| 3496 | /** |
| 3497 | * How long the screen must have been off in order to kill processes |
| 3498 | * or reboot. This number is in seconds. A value of -1 means to |
| 3499 | * entirely disregard whether the screen is on. |
| 3500 | * @hide |
| 3501 | */ |
| 3502 | public static final String MEMCHECK_MIN_SCREEN_OFF = "memcheck_min_screen_off"; |
| 3503 | |
| 3504 | /** |
| 3505 | * How much time there must be until the next alarm in order to kill processes |
| 3506 | * or reboot. This number is in seconds. Note: this value must be |
| 3507 | * smaller than {@link #MEMCHECK_RECHECK_INTERVAL} or else it will |
| 3508 | * always see an alarm scheduled within its time. |
| 3509 | * @hide |
| 3510 | */ |
| 3511 | public static final String MEMCHECK_MIN_ALARM = "memcheck_min_alarm"; |
| 3512 | |
| 3513 | /** |
| 3514 | * How frequently to check whether it is a good time to restart things, |
| 3515 | * if the device is in a bad state. This number is in seconds. Note: |
| 3516 | * this value must be larger than {@link #MEMCHECK_MIN_ALARM} or else |
| 3517 | * the alarm to schedule the recheck will always appear within the |
| 3518 | * minimum "do not execute now" time. |
| 3519 | * @hide |
| 3520 | */ |
| 3521 | public static final String MEMCHECK_RECHECK_INTERVAL = "memcheck_recheck_interval"; |
| 3522 | |
| 3523 | /** |
| 3524 | * How frequently (in DAYS) to reboot the device. If 0, no reboots |
| 3525 | * will occur. |
| 3526 | * @hide |
| 3527 | */ |
| 3528 | public static final String REBOOT_INTERVAL = "reboot_interval"; |
| 3529 | |
| 3530 | /** |
| 3531 | * First time during the day it is okay to force a reboot of the |
| 3532 | * device (if REBOOT_INTERVAL is set). This number is |
| 3533 | * in seconds since midnight. |
| 3534 | * @hide |
| 3535 | */ |
| 3536 | public static final String REBOOT_START_TIME = "reboot_start_time"; |
| 3537 | |
| 3538 | /** |
| 3539 | * The window of time (in seconds) after each REBOOT_INTERVAL in which |
| 3540 | * a reboot can be executed. If 0, a reboot will always be executed at |
| 3541 | * exactly the given time. Otherwise, it will only be executed if |
| 3542 | * the device is idle within the window. |
| 3543 | * @hide |
| 3544 | */ |
| 3545 | public static final String REBOOT_WINDOW = "reboot_window"; |
| 3546 | |
| 3547 | /** |
Doug Zongker | 43866e0 | 2010-01-07 12:09:54 -0800 | [diff] [blame] | 3548 | * Threshold values for the duration and level of a discharge cycle, under |
| 3549 | * which we log discharge cycle info. |
| 3550 | * @hide |
| 3551 | */ |
| 3552 | public static final String BATTERY_DISCHARGE_DURATION_THRESHOLD = |
| 3553 | "battery_discharge_duration_threshold"; |
| 3554 | /** @hide */ |
| 3555 | public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold"; |
| 3556 | |
| 3557 | /** |
| 3558 | * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR intents |
| 3559 | * on application crashes and ANRs. If this is disabled, the crash/ANR dialog |
| 3560 | * will never display the "Report" button. |
| 3561 | * Type: int ( 0 = disallow, 1 = allow ) |
| 3562 | * @hide |
| 3563 | */ |
| 3564 | public static final String SEND_ACTION_APP_ERROR = "send_action_app_error"; |
| 3565 | |
| 3566 | /** |
| 3567 | * Nonzero causes Log.wtf() to crash. |
| 3568 | * @hide |
| 3569 | */ |
| 3570 | public static final String WTF_IS_FATAL = "wtf_is_fatal"; |
| 3571 | |
| 3572 | /** |
Jake Hamby | bb37163 | 2010-08-23 18:16:48 -0700 | [diff] [blame] | 3573 | * Maximum age of entries kept by {@link com.android.internal.os.IDropBoxManagerService}. |
Doug Zongker | 43866e0 | 2010-01-07 12:09:54 -0800 | [diff] [blame] | 3574 | * @hide |
| 3575 | */ |
| 3576 | public static final String DROPBOX_AGE_SECONDS = |
| 3577 | "dropbox_age_seconds"; |
| 3578 | /** |
Jake Hamby | bb37163 | 2010-08-23 18:16:48 -0700 | [diff] [blame] | 3579 | * Maximum number of entry files which {@link com.android.internal.os.IDropBoxManagerService} will keep around. |
Dan Egnor | 3a8b0c1 | 2010-03-24 17:48:20 -0700 | [diff] [blame] | 3580 | * @hide |
| 3581 | */ |
| 3582 | public static final String DROPBOX_MAX_FILES = |
| 3583 | "dropbox_max_files"; |
| 3584 | /** |
Jake Hamby | bb37163 | 2010-08-23 18:16:48 -0700 | [diff] [blame] | 3585 | * Maximum amount of disk space used by {@link com.android.internal.os.IDropBoxManagerService} no matter what. |
Doug Zongker | 43866e0 | 2010-01-07 12:09:54 -0800 | [diff] [blame] | 3586 | * @hide |
| 3587 | */ |
| 3588 | public static final String DROPBOX_QUOTA_KB = |
| 3589 | "dropbox_quota_kb"; |
| 3590 | /** |
Jake Hamby | bb37163 | 2010-08-23 18:16:48 -0700 | [diff] [blame] | 3591 | * Percent of free disk (excluding reserve) which {@link com.android.internal.os.IDropBoxManagerService} will use. |
Doug Zongker | 43866e0 | 2010-01-07 12:09:54 -0800 | [diff] [blame] | 3592 | * @hide |
| 3593 | */ |
| 3594 | public static final String DROPBOX_QUOTA_PERCENT = |
| 3595 | "dropbox_quota_percent"; |
| 3596 | /** |
Jake Hamby | bb37163 | 2010-08-23 18:16:48 -0700 | [diff] [blame] | 3597 | * Percent of total disk which {@link com.android.internal.os.IDropBoxManagerService} will never dip into. |
Doug Zongker | 43866e0 | 2010-01-07 12:09:54 -0800 | [diff] [blame] | 3598 | * @hide |
| 3599 | */ |
| 3600 | public static final String DROPBOX_RESERVE_PERCENT = |
| 3601 | "dropbox_reserve_percent"; |
| 3602 | /** |
| 3603 | * Prefix for per-tag dropbox disable/enable settings. |
| 3604 | * @hide |
| 3605 | */ |
| 3606 | public static final String DROPBOX_TAG_PREFIX = |
| 3607 | "dropbox:"; |
Dan Egnor | a455d19 | 2010-03-12 08:52:28 -0800 | [diff] [blame] | 3608 | /** |
| 3609 | * Lines of logcat to include with system crash/ANR/etc. reports, |
| 3610 | * as a prefix of the dropbox tag of the report type. |
| 3611 | * For example, "logcat_for_system_server_anr" controls the lines |
| 3612 | * of logcat captured with system server ANR reports. 0 to disable. |
| 3613 | * @hide |
| 3614 | */ |
| 3615 | public static final String ERROR_LOGCAT_PREFIX = |
| 3616 | "logcat_for_"; |
Doug Zongker | 43866e0 | 2010-01-07 12:09:54 -0800 | [diff] [blame] | 3617 | |
| 3618 | |
| 3619 | /** |
| 3620 | * Screen timeout in milliseconds corresponding to the |
| 3621 | * PowerManager's POKE_LOCK_SHORT_TIMEOUT flag (i.e. the fastest |
| 3622 | * possible screen timeout behavior.) |
| 3623 | * @hide |
| 3624 | */ |
| 3625 | public static final String SHORT_KEYLIGHT_DELAY_MS = |
| 3626 | "short_keylight_delay_ms"; |
| 3627 | |
| 3628 | /** |
| 3629 | * The interval in minutes after which the amount of free storage left on the |
| 3630 | * device is logged to the event log |
| 3631 | * @hide |
| 3632 | */ |
| 3633 | public static final String SYS_FREE_STORAGE_LOG_INTERVAL = |
| 3634 | "sys_free_storage_log_interval"; |
| 3635 | |
| 3636 | /** |
| 3637 | * Threshold for the amount of change in disk free space required to report the amount of |
| 3638 | * free space. Used to prevent spamming the logs when the disk free space isn't changing |
| 3639 | * frequently. |
| 3640 | * @hide |
| 3641 | */ |
| 3642 | public static final String DISK_FREE_CHANGE_REPORTING_THRESHOLD = |
| 3643 | "disk_free_change_reporting_threshold"; |
| 3644 | |
| 3645 | |
| 3646 | /** |
| 3647 | * Minimum percentage of free storage on the device that is used to determine if |
Dianne Hackborn | 247fe74 | 2011-01-08 17:25:57 -0800 | [diff] [blame] | 3648 | * the device is running low on storage. The default is 10. |
| 3649 | * <p>Say this value is set to 10, the device is considered running low on storage |
Doug Zongker | 43866e0 | 2010-01-07 12:09:54 -0800 | [diff] [blame] | 3650 | * if 90% or more of the device storage is filled up. |
| 3651 | * @hide |
| 3652 | */ |
| 3653 | public static final String SYS_STORAGE_THRESHOLD_PERCENTAGE = |
| 3654 | "sys_storage_threshold_percentage"; |
| 3655 | |
| 3656 | /** |
Dianne Hackborn | 247fe74 | 2011-01-08 17:25:57 -0800 | [diff] [blame] | 3657 | * Maximum byte size of the low storage threshold. This is to ensure |
| 3658 | * that {@link #SYS_STORAGE_THRESHOLD_PERCENTAGE} does not result in |
| 3659 | * an overly large threshold for large storage devices. Currently this |
| 3660 | * must be less than 2GB. This default is 500MB. |
| 3661 | * @hide |
| 3662 | */ |
| 3663 | public static final String SYS_STORAGE_THRESHOLD_MAX_BYTES = |
| 3664 | "sys_storage_threshold_max_bytes"; |
| 3665 | |
| 3666 | /** |
Jake Hamby | bb37163 | 2010-08-23 18:16:48 -0700 | [diff] [blame] | 3667 | * Minimum bytes of free storage on the device before the data |
| 3668 | * partition is considered full. By default, 1 MB is reserved |
| 3669 | * to avoid system-wide SQLite disk full exceptions. |
| 3670 | * @hide |
| 3671 | */ |
| 3672 | public static final String SYS_STORAGE_FULL_THRESHOLD_BYTES = |
| 3673 | "sys_storage_full_threshold_bytes"; |
| 3674 | |
| 3675 | /** |
Doug Zongker | 43866e0 | 2010-01-07 12:09:54 -0800 | [diff] [blame] | 3676 | * The interval in milliseconds after which Wi-Fi is considered idle. |
| 3677 | * When idle, it is possible for the device to be switched from Wi-Fi to |
| 3678 | * the mobile data network. |
| 3679 | * @hide |
| 3680 | */ |
| 3681 | public static final String WIFI_IDLE_MS = "wifi_idle_ms"; |
| 3682 | |
| 3683 | /** |
Irfan Sheriff | 2b7f638 | 2011-03-25 14:29:19 -0700 | [diff] [blame] | 3684 | * The interval in milliseconds to issue wake up scans when wifi needs |
| 3685 | * to connect. This is necessary to connect to an access point when |
| 3686 | * device is on the move and the screen is off. |
Irfan Sheriff | 4f5f7c9 | 2010-10-14 17:01:27 -0700 | [diff] [blame] | 3687 | * @hide |
| 3688 | */ |
Irfan Sheriff | 2b7f638 | 2011-03-25 14:29:19 -0700 | [diff] [blame] | 3689 | public static final String WIFI_FRAMEWORK_SCAN_INTERVAL_MS = |
| 3690 | "wifi_framework_scan_interval_ms"; |
| 3691 | |
| 3692 | /** |
| 3693 | * The interval in milliseconds to scan as used by the wifi supplicant |
| 3694 | * @hide |
| 3695 | */ |
| 3696 | public static final String WIFI_SUPPLICANT_SCAN_INTERVAL_MS = |
| 3697 | "wifi_supplicant_scan_interval_ms"; |
Irfan Sheriff | 4f5f7c9 | 2010-10-14 17:01:27 -0700 | [diff] [blame] | 3698 | |
| 3699 | /** |
Doug Zongker | edc5189 | 2010-01-07 13:51:16 -0800 | [diff] [blame] | 3700 | * The interval in milliseconds at which to check packet counts on the |
| 3701 | * mobile data interface when screen is on, to detect possible data |
| 3702 | * connection problems. |
| 3703 | * @hide |
| 3704 | */ |
| 3705 | public static final String PDP_WATCHDOG_POLL_INTERVAL_MS = |
| 3706 | "pdp_watchdog_poll_interval_ms"; |
| 3707 | |
| 3708 | /** |
| 3709 | * The interval in milliseconds at which to check packet counts on the |
| 3710 | * mobile data interface when screen is off, to detect possible data |
| 3711 | * connection problems. |
| 3712 | * @hide |
| 3713 | */ |
| 3714 | public static final String PDP_WATCHDOG_LONG_POLL_INTERVAL_MS = |
| 3715 | "pdp_watchdog_long_poll_interval_ms"; |
| 3716 | |
| 3717 | /** |
| 3718 | * The interval in milliseconds at which to check packet counts on the |
| 3719 | * mobile data interface after {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} |
| 3720 | * outgoing packets has been reached without incoming packets. |
| 3721 | * @hide |
| 3722 | */ |
| 3723 | public static final String PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS = |
| 3724 | "pdp_watchdog_error_poll_interval_ms"; |
| 3725 | |
| 3726 | /** |
| 3727 | * The number of outgoing packets sent without seeing an incoming packet |
| 3728 | * that triggers a countdown (of {@link #PDP_WATCHDOG_ERROR_POLL_COUNT} |
| 3729 | * device is logged to the event log |
| 3730 | * @hide |
| 3731 | */ |
| 3732 | public static final String PDP_WATCHDOG_TRIGGER_PACKET_COUNT = |
| 3733 | "pdp_watchdog_trigger_packet_count"; |
| 3734 | |
| 3735 | /** |
| 3736 | * The number of polls to perform (at {@link #PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS}) |
| 3737 | * after hitting {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} before |
| 3738 | * attempting data connection recovery. |
| 3739 | * @hide |
| 3740 | */ |
| 3741 | public static final String PDP_WATCHDOG_ERROR_POLL_COUNT = |
| 3742 | "pdp_watchdog_error_poll_count"; |
| 3743 | |
| 3744 | /** |
| 3745 | * The number of failed PDP reset attempts before moving to something more |
| 3746 | * drastic: re-registering to the network. |
| 3747 | * @hide |
| 3748 | */ |
| 3749 | public static final String PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT = |
| 3750 | "pdp_watchdog_max_pdp_reset_fail_count"; |
| 3751 | |
| 3752 | /** |
Kazuhiro Ondo | 7efb89b | 2011-12-21 20:54:03 -0600 | [diff] [blame] | 3753 | * The number of milliseconds to delay when checking for data stalls during |
| 3754 | * non-aggressive detection. (screen is turned off.) |
Wink Saville | 2861d23 | 2011-11-03 18:52:58 -0700 | [diff] [blame] | 3755 | * @hide |
| 3756 | */ |
Kazuhiro Ondo | 7efb89b | 2011-12-21 20:54:03 -0600 | [diff] [blame] | 3757 | public static final String DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS = |
| 3758 | "data_stall_alarm_non_aggressive_delay_in_ms"; |
| 3759 | |
| 3760 | /** |
| 3761 | * The number of milliseconds to delay when checking for data stalls during |
| 3762 | * aggressive detection. (screen on or suspected data stall) |
| 3763 | * @hide |
| 3764 | */ |
| 3765 | public static final String DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS = |
| 3766 | "data_stall_alarm_aggressive_delay_in_ms"; |
Wink Saville | 2861d23 | 2011-11-03 18:52:58 -0700 | [diff] [blame] | 3767 | |
| 3768 | /** |
Doug Zongker | edc5189 | 2010-01-07 13:51:16 -0800 | [diff] [blame] | 3769 | * The interval in milliseconds at which to check gprs registration |
| 3770 | * after the first registration mismatch of gprs and voice service, |
| 3771 | * to detect possible data network registration problems. |
| 3772 | * |
| 3773 | * @hide |
| 3774 | */ |
| 3775 | public static final String GPRS_REGISTER_CHECK_PERIOD_MS = |
| 3776 | "gprs_register_check_period_ms"; |
| 3777 | |
| 3778 | /** |
| 3779 | * The length of time in milli-seconds that automatic small adjustments to |
| 3780 | * SystemClock are ignored if NITZ_UPDATE_DIFF is not exceeded. |
| 3781 | * @hide |
| 3782 | */ |
| 3783 | public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing"; |
| 3784 | |
| 3785 | /** |
| 3786 | * If the NITZ_UPDATE_DIFF time is exceeded then an automatic adjustment |
| 3787 | * to SystemClock will be allowed even if NITZ_UPDATE_SPACING has not been |
| 3788 | * exceeded. |
| 3789 | * @hide |
| 3790 | */ |
| 3791 | public static final String NITZ_UPDATE_DIFF = "nitz_update_diff"; |
| 3792 | |
| 3793 | /** |
| 3794 | * The maximum reconnect delay for short network outages or when the network is suspended |
| 3795 | * due to phone use. |
| 3796 | * @hide |
| 3797 | */ |
| 3798 | public static final String SYNC_MAX_RETRY_DELAY_IN_SECONDS = |
| 3799 | "sync_max_retry_delay_in_seconds"; |
| 3800 | |
| 3801 | /** |
| 3802 | * The interval in milliseconds at which to check the number of SMS sent |
| 3803 | * out without asking for use permit, to limit the un-authorized SMS |
| 3804 | * usage. |
| 3805 | * @hide |
| 3806 | */ |
| 3807 | public static final String SMS_OUTGOING_CHECK_INTERVAL_MS = |
| 3808 | "sms_outgoing_check_interval_ms"; |
| 3809 | |
| 3810 | /** |
| 3811 | * The number of outgoing SMS sent without asking for user permit |
| 3812 | * (of {@link #SMS_OUTGOING_CHECK_INTERVAL_MS} |
| 3813 | * @hide |
| 3814 | */ |
| 3815 | public static final String SMS_OUTGOING_CHECK_MAX_COUNT = |
| 3816 | "sms_outgoing_check_max_count"; |
| 3817 | |
| 3818 | /** |
Narayan Kamath | ee69ff4 | 2011-06-28 12:07:18 +0100 | [diff] [blame] | 3819 | * The global search provider chosen by the user (if multiple global |
| 3820 | * search providers are installed). This will be the provider returned |
| 3821 | * by {@link SearchManager#getGlobalSearchActivity()} if it's still |
| 3822 | * installed. This setting is stored as a flattened component name as |
| 3823 | * per {@link ComponentName#flattenToString()}. |
| 3824 | * |
| 3825 | * @hide |
| 3826 | */ |
| 3827 | public static final String SEARCH_GLOBAL_SEARCH_ACTIVITY = |
| 3828 | "search_global_search_activity"; |
| 3829 | |
| 3830 | /** |
Doug Zongker | aed8f8e | 2010-01-07 18:07:50 -0800 | [diff] [blame] | 3831 | * The number of promoted sources in GlobalSearch. |
| 3832 | * @hide |
| 3833 | */ |
| 3834 | public static final String SEARCH_NUM_PROMOTED_SOURCES = "search_num_promoted_sources"; |
| 3835 | /** |
| 3836 | * The maximum number of suggestions returned by GlobalSearch. |
| 3837 | * @hide |
| 3838 | */ |
| 3839 | public static final String SEARCH_MAX_RESULTS_TO_DISPLAY = "search_max_results_to_display"; |
| 3840 | /** |
| 3841 | * The number of suggestions GlobalSearch will ask each non-web search source for. |
| 3842 | * @hide |
| 3843 | */ |
| 3844 | public static final String SEARCH_MAX_RESULTS_PER_SOURCE = "search_max_results_per_source"; |
| 3845 | /** |
| 3846 | * The number of suggestions the GlobalSearch will ask the web search source for. |
| 3847 | * @hide |
| 3848 | */ |
| 3849 | public static final String SEARCH_WEB_RESULTS_OVERRIDE_LIMIT = |
| 3850 | "search_web_results_override_limit"; |
| 3851 | /** |
| 3852 | * The number of milliseconds that GlobalSearch will wait for suggestions from |
| 3853 | * promoted sources before continuing with all other sources. |
| 3854 | * @hide |
| 3855 | */ |
| 3856 | public static final String SEARCH_PROMOTED_SOURCE_DEADLINE_MILLIS = |
| 3857 | "search_promoted_source_deadline_millis"; |
| 3858 | /** |
| 3859 | * The number of milliseconds before GlobalSearch aborts search suggesiton queries. |
| 3860 | * @hide |
| 3861 | */ |
| 3862 | public static final String SEARCH_SOURCE_TIMEOUT_MILLIS = "search_source_timeout_millis"; |
| 3863 | /** |
| 3864 | * The maximum number of milliseconds that GlobalSearch shows the previous results |
| 3865 | * after receiving a new query. |
| 3866 | * @hide |
| 3867 | */ |
| 3868 | public static final String SEARCH_PREFILL_MILLIS = "search_prefill_millis"; |
| 3869 | /** |
| 3870 | * The maximum age of log data used for shortcuts in GlobalSearch. |
| 3871 | * @hide |
| 3872 | */ |
| 3873 | public static final String SEARCH_MAX_STAT_AGE_MILLIS = "search_max_stat_age_millis"; |
| 3874 | /** |
| 3875 | * The maximum age of log data used for source ranking in GlobalSearch. |
| 3876 | * @hide |
| 3877 | */ |
| 3878 | public static final String SEARCH_MAX_SOURCE_EVENT_AGE_MILLIS = |
| 3879 | "search_max_source_event_age_millis"; |
| 3880 | /** |
| 3881 | * The minimum number of impressions needed to rank a source in GlobalSearch. |
| 3882 | * @hide |
| 3883 | */ |
| 3884 | public static final String SEARCH_MIN_IMPRESSIONS_FOR_SOURCE_RANKING = |
| 3885 | "search_min_impressions_for_source_ranking"; |
| 3886 | /** |
| 3887 | * The minimum number of clicks needed to rank a source in GlobalSearch. |
| 3888 | * @hide |
| 3889 | */ |
| 3890 | public static final String SEARCH_MIN_CLICKS_FOR_SOURCE_RANKING = |
| 3891 | "search_min_clicks_for_source_ranking"; |
| 3892 | /** |
| 3893 | * The maximum number of shortcuts shown by GlobalSearch. |
| 3894 | * @hide |
| 3895 | */ |
| 3896 | public static final String SEARCH_MAX_SHORTCUTS_RETURNED = "search_max_shortcuts_returned"; |
| 3897 | /** |
| 3898 | * The size of the core thread pool for suggestion queries in GlobalSearch. |
| 3899 | * @hide |
| 3900 | */ |
| 3901 | public static final String SEARCH_QUERY_THREAD_CORE_POOL_SIZE = |
| 3902 | "search_query_thread_core_pool_size"; |
| 3903 | /** |
| 3904 | * The maximum size of the thread pool for suggestion queries in GlobalSearch. |
| 3905 | * @hide |
| 3906 | */ |
| 3907 | public static final String SEARCH_QUERY_THREAD_MAX_POOL_SIZE = |
| 3908 | "search_query_thread_max_pool_size"; |
| 3909 | /** |
| 3910 | * The size of the core thread pool for shortcut refreshing in GlobalSearch. |
| 3911 | * @hide |
| 3912 | */ |
| 3913 | public static final String SEARCH_SHORTCUT_REFRESH_CORE_POOL_SIZE = |
| 3914 | "search_shortcut_refresh_core_pool_size"; |
| 3915 | /** |
| 3916 | * The maximum size of the thread pool for shortcut refreshing in GlobalSearch. |
| 3917 | * @hide |
| 3918 | */ |
| 3919 | public static final String SEARCH_SHORTCUT_REFRESH_MAX_POOL_SIZE = |
| 3920 | "search_shortcut_refresh_max_pool_size"; |
| 3921 | /** |
| 3922 | * The maximun time that excess threads in the GlobalSeach thread pools will |
| 3923 | * wait before terminating. |
| 3924 | * @hide |
| 3925 | */ |
| 3926 | public static final String SEARCH_THREAD_KEEPALIVE_SECONDS = |
| 3927 | "search_thread_keepalive_seconds"; |
| 3928 | /** |
| 3929 | * The maximum number of concurrent suggestion queries to each source. |
| 3930 | * @hide |
| 3931 | */ |
| 3932 | public static final String SEARCH_PER_SOURCE_CONCURRENT_QUERY_LIMIT = |
| 3933 | "search_per_source_concurrent_query_limit"; |
| 3934 | |
San Mehat | 87734d3 | 2010-01-08 12:53:06 -0800 | [diff] [blame] | 3935 | /** |
| 3936 | * Whether or not alert sounds are played on MountService events. (0 = false, 1 = true) |
| 3937 | * @hide |
| 3938 | */ |
| 3939 | public static final String MOUNT_PLAY_NOTIFICATION_SND = "mount_play_not_snd"; |
| 3940 | |
| 3941 | /** |
| 3942 | * Whether or not UMS auto-starts on UMS host detection. (0 = false, 1 = true) |
| 3943 | * @hide |
| 3944 | */ |
| 3945 | public static final String MOUNT_UMS_AUTOSTART = "mount_ums_autostart"; |
| 3946 | |
| 3947 | /** |
| 3948 | * Whether or not a notification is displayed on UMS host detection. (0 = false, 1 = true) |
| 3949 | * @hide |
| 3950 | */ |
| 3951 | public static final String MOUNT_UMS_PROMPT = "mount_ums_prompt"; |
| 3952 | |
| 3953 | /** |
| 3954 | * Whether or not a notification is displayed while UMS is enabled. (0 = false, 1 = true) |
| 3955 | * @hide |
| 3956 | */ |
| 3957 | public static final String MOUNT_UMS_NOTIFY_ENABLED = "mount_ums_notify_enabled"; |
Doug Zongker | aed8f8e | 2010-01-07 18:07:50 -0800 | [diff] [blame] | 3958 | |
Dan Egnor | 42471dd | 2010-01-07 17:25:22 -0800 | [diff] [blame] | 3959 | /** |
| 3960 | * If nonzero, ANRs in invisible background processes bring up a dialog. |
| 3961 | * Otherwise, the process will be silently killed. |
| 3962 | * @hide |
| 3963 | */ |
| 3964 | public static final String ANR_SHOW_BACKGROUND = "anr_show_background"; |
Erik | eebc8e2 | 2010-02-18 13:27:19 -0800 | [diff] [blame] | 3965 | |
Mike LeBeau | 5d34e9b | 2010-02-10 19:34:56 -0800 | [diff] [blame] | 3966 | /** |
| 3967 | * The {@link ComponentName} string of the service to be used as the voice recognition |
| 3968 | * service. |
Erik | eebc8e2 | 2010-02-18 13:27:19 -0800 | [diff] [blame] | 3969 | * |
Mike LeBeau | 5d34e9b | 2010-02-10 19:34:56 -0800 | [diff] [blame] | 3970 | * @hide |
| 3971 | */ |
| 3972 | public static final String VOICE_RECOGNITION_SERVICE = "voice_recognition_service"; |
Dan Egnor | 42471dd | 2010-01-07 17:25:22 -0800 | [diff] [blame] | 3973 | |
satok | 988323c | 2011-06-22 16:38:13 +0900 | [diff] [blame] | 3974 | |
| 3975 | /** |
satok | ada8c4e | 2011-08-23 14:56:56 +0900 | [diff] [blame] | 3976 | * The {@link ComponentName} string of the selected spell checker service which is |
| 3977 | * one of the services managed by the text service manager. |
| 3978 | * |
| 3979 | * @hide |
| 3980 | */ |
| 3981 | public static final String SELECTED_SPELL_CHECKER = "selected_spell_checker"; |
| 3982 | |
| 3983 | /** |
| 3984 | * The {@link ComponentName} string of the selected subtype of the selected spell checker |
satok | 988323c | 2011-06-22 16:38:13 +0900 | [diff] [blame] | 3985 | * service which is one of the services managed by the text service manager. |
| 3986 | * |
| 3987 | * @hide |
| 3988 | */ |
satok | ada8c4e | 2011-08-23 14:56:56 +0900 | [diff] [blame] | 3989 | public static final String SELECTED_SPELL_CHECKER_SUBTYPE = |
| 3990 | "selected_spell_checker_subtype"; |
satok | 988323c | 2011-06-22 16:38:13 +0900 | [diff] [blame] | 3991 | |
Doug Zongker | aed8f8e | 2010-01-07 18:07:50 -0800 | [diff] [blame] | 3992 | /** |
satok | a33c4fc | 2011-08-25 16:50:11 +0900 | [diff] [blame] | 3993 | * The {@link ComponentName} string whether spell checker is enabled or not. |
| 3994 | * |
| 3995 | * @hide |
| 3996 | */ |
| 3997 | public static final String SPELL_CHECKER_ENABLED = "spell_checker_enabled"; |
| 3998 | |
| 3999 | /** |
David Brown | 458e806 | 2010-03-08 21:52:11 -0800 | [diff] [blame] | 4000 | * What happens when the user presses the Power button while in-call |
| 4001 | * and the screen is on.<br/> |
| 4002 | * <b>Values:</b><br/> |
| 4003 | * 1 - The Power button turns off the screen and locks the device. (Default behavior)<br/> |
| 4004 | * 2 - The Power button hangs up the current call.<br/> |
| 4005 | * |
| 4006 | * @hide |
| 4007 | */ |
| 4008 | public static final String INCALL_POWER_BUTTON_BEHAVIOR = "incall_power_button_behavior"; |
| 4009 | |
| 4010 | /** |
| 4011 | * INCALL_POWER_BUTTON_BEHAVIOR value for "turn off screen". |
| 4012 | * @hide |
| 4013 | */ |
| 4014 | public static final int INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF = 0x1; |
| 4015 | |
| 4016 | /** |
| 4017 | * INCALL_POWER_BUTTON_BEHAVIOR value for "hang up". |
| 4018 | * @hide |
| 4019 | */ |
| 4020 | public static final int INCALL_POWER_BUTTON_BEHAVIOR_HANGUP = 0x2; |
| 4021 | |
| 4022 | /** |
| 4023 | * INCALL_POWER_BUTTON_BEHAVIOR default value. |
| 4024 | * @hide |
| 4025 | */ |
| 4026 | public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT = |
| 4027 | INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF; |
| 4028 | |
| 4029 | /** |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 4030 | * The current night mode that has been selected by the user. Owned |
| 4031 | * and controlled by UiModeManagerService. Constants are as per |
| 4032 | * UiModeManager. |
| 4033 | * @hide |
| 4034 | */ |
| 4035 | public static final String UI_NIGHT_MODE = "ui_night_mode"; |
Suchi Amalapurapu | 40e4725 | 2010-04-07 16:15:50 -0700 | [diff] [blame] | 4036 | |
| 4037 | /** |
| 4038 | * Let user pick default install location. |
| 4039 | * @hide |
| 4040 | */ |
| 4041 | public static final String SET_INSTALL_LOCATION = "set_install_location"; |
| 4042 | |
| 4043 | /** |
| 4044 | * Default install location value. |
| 4045 | * 0 = auto, let system decide |
| 4046 | * 1 = internal |
| 4047 | * 2 = sdcard |
| 4048 | * @hide |
| 4049 | */ |
| 4050 | public static final String DEFAULT_INSTALL_LOCATION = "default_install_location"; |
Robert Greenwalt | 9e696c2 | 2010-04-01 14:45:18 -0700 | [diff] [blame] | 4051 | |
| 4052 | /** |
| 4053 | * The bandwidth throttle polling freqency in seconds |
| 4054 | * @hide |
| 4055 | */ |
| 4056 | public static final String THROTTLE_POLLING_SEC = "throttle_polling_sec"; |
| 4057 | |
| 4058 | /** |
| 4059 | * The bandwidth throttle threshold (long) |
| 4060 | * @hide |
| 4061 | */ |
Robert Greenwalt | d3bb93f | 2010-04-12 19:20:55 -0700 | [diff] [blame] | 4062 | public static final String THROTTLE_THRESHOLD_BYTES = "throttle_threshold_bytes"; |
Robert Greenwalt | 9e696c2 | 2010-04-01 14:45:18 -0700 | [diff] [blame] | 4063 | |
| 4064 | /** |
| 4065 | * The bandwidth throttle value (kbps) |
| 4066 | * @hide |
| 4067 | */ |
Robert Greenwalt | d3bb93f | 2010-04-12 19:20:55 -0700 | [diff] [blame] | 4068 | public static final String THROTTLE_VALUE_KBITSPS = "throttle_value_kbitsps"; |
Robert Greenwalt | 9e696c2 | 2010-04-01 14:45:18 -0700 | [diff] [blame] | 4069 | |
| 4070 | /** |
| 4071 | * The bandwidth throttle reset calendar day (1-28) |
| 4072 | * @hide |
| 4073 | */ |
| 4074 | public static final String THROTTLE_RESET_DAY = "throttle_reset_day"; |
| 4075 | |
| 4076 | /** |
| 4077 | * The throttling notifications we should send |
| 4078 | * @hide |
| 4079 | */ |
| 4080 | public static final String THROTTLE_NOTIFICATION_TYPE = "throttle_notification_type"; |
| 4081 | |
| 4082 | /** |
Irfan Sheriff | c9b6851 | 2010-04-08 14:12:33 -0700 | [diff] [blame] | 4083 | * Help URI for data throttling policy |
| 4084 | * @hide |
| 4085 | */ |
| 4086 | public static final String THROTTLE_HELP_URI = "throttle_help_uri"; |
| 4087 | |
Robert Greenwalt | d1055a2 | 2010-05-25 15:54:52 -0700 | [diff] [blame] | 4088 | /** |
| 4089 | * The length of time in Sec that we allow our notion of NTP time |
| 4090 | * to be cached before we refresh it |
| 4091 | * @hide |
| 4092 | */ |
| 4093 | public static final String THROTTLE_MAX_NTP_CACHE_AGE_SEC = |
| 4094 | "throttle_max_ntp_cache_age_sec"; |
| 4095 | |
Steve Howard | 9c4e33e | 2010-07-28 15:59:29 -0700 | [diff] [blame] | 4096 | /** |
| 4097 | * The maximum size, in bytes, of a download that the download manager will transfer over |
| 4098 | * a non-wifi connection. |
| 4099 | * @hide |
| 4100 | */ |
| 4101 | public static final String DOWNLOAD_MAX_BYTES_OVER_MOBILE = |
| 4102 | "download_manager_max_bytes_over_mobile"; |
| 4103 | |
Robert Greenwalt | d7085fc | 2010-09-08 15:24:47 -0700 | [diff] [blame] | 4104 | /** |
Steve Howard | f176681 | 2010-09-17 16:46:19 -0700 | [diff] [blame] | 4105 | * The recommended maximum size, in bytes, of a download that the download manager should |
| 4106 | * transfer over a non-wifi connection. Over this size, the use will be warned, but will |
| 4107 | * have the option to start the download over the mobile connection anyway. |
| 4108 | * @hide |
| 4109 | */ |
| 4110 | public static final String DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE = |
| 4111 | "download_manager_recommended_max_bytes_over_mobile"; |
| 4112 | |
| 4113 | /** |
Robert Greenwalt | d7085fc | 2010-09-08 15:24:47 -0700 | [diff] [blame] | 4114 | * ms during which to consume extra events related to Inet connection condition |
| 4115 | * after a transtion to fully-connected |
| 4116 | * @hide |
| 4117 | */ |
| 4118 | public static final String INET_CONDITION_DEBOUNCE_UP_DELAY = |
| 4119 | "inet_condition_debounce_up_delay"; |
| 4120 | |
| 4121 | /** |
| 4122 | * ms during which to consume extra events related to Inet connection condtion |
| 4123 | * after a transtion to partly-connected |
| 4124 | * @hide |
| 4125 | */ |
| 4126 | public static final String INET_CONDITION_DEBOUNCE_DOWN_DELAY = |
| 4127 | "inet_condition_debounce_down_delay"; |
Irfan Sheriff | c9b6851 | 2010-04-08 14:12:33 -0700 | [diff] [blame] | 4128 | |
| 4129 | /** |
Freeman Ng | 96be4e0 | 2011-04-07 18:21:40 -0700 | [diff] [blame] | 4130 | * URL to open browser on to allow user to manage a prepay account |
| 4131 | * @hide |
| 4132 | */ |
| 4133 | public static final String SETUP_PREPAID_DATA_SERVICE_URL = |
| 4134 | "setup_prepaid_data_service_url"; |
| 4135 | |
| 4136 | /** |
Freeman Ng | 3b9089c | 2011-04-22 16:42:57 -0700 | [diff] [blame] | 4137 | * URL to attempt a GET on to see if this is a prepay device |
| 4138 | * @hide |
| 4139 | */ |
| 4140 | public static final String SETUP_PREPAID_DETECTION_TARGET_URL = |
| 4141 | "setup_prepaid_detection_target_url"; |
| 4142 | |
| 4143 | /** |
| 4144 | * Host to check for a redirect to after an attempt to GET |
| 4145 | * SETUP_PREPAID_DETECTION_TARGET_URL. (If we redirected there, |
| 4146 | * this is a prepaid device with zero balance.) |
| 4147 | * @hide |
| 4148 | */ |
| 4149 | public static final String SETUP_PREPAID_DETECTION_REDIR_HOST = |
| 4150 | "setup_prepaid_detection_redir_host"; |
| 4151 | |
| 4152 | /** |
Daniel Sandler | 2d54536 | 2011-11-17 10:38:37 -0800 | [diff] [blame] | 4153 | * Whether the screensaver is enabled. |
Daniel Sandler | 0601eb7 | 2011-04-13 01:01:32 -0400 | [diff] [blame] | 4154 | * @hide |
| 4155 | */ |
Daniel Sandler | 2d54536 | 2011-11-17 10:38:37 -0800 | [diff] [blame] | 4156 | public static final String SCREENSAVER_ENABLED = "screensaver_enabled"; |
Daniel Sandler | 0601eb7 | 2011-04-13 01:01:32 -0400 | [diff] [blame] | 4157 | |
| 4158 | /** |
Daniel Sandler | 2d54536 | 2011-11-17 10:38:37 -0800 | [diff] [blame] | 4159 | * The user's chosen screensaver component. |
| 4160 | * |
| 4161 | * This component will be launched by the PhoneWindowManager after a timeout when not on |
| 4162 | * battery, or upon dock insertion (if SCREENSAVER_ACTIVATE_ON_DOCK is set to 1). |
Daniel Sandler | 0601eb7 | 2011-04-13 01:01:32 -0400 | [diff] [blame] | 4163 | * @hide |
| 4164 | */ |
Daniel Sandler | 2d54536 | 2011-11-17 10:38:37 -0800 | [diff] [blame] | 4165 | public static final String SCREENSAVER_COMPONENT = "screensaver_component"; |
| 4166 | |
| 4167 | /** |
| 4168 | * Whether the screensaver should be automatically launched when the device is inserted |
| 4169 | * into a (desk) dock. |
| 4170 | * @hide |
| 4171 | */ |
| 4172 | public static final String SCREENSAVER_ACTIVATE_ON_DOCK = "screensaver_activate_on_dock"; |
Daniel Sandler | 0601eb7 | 2011-04-13 01:01:32 -0400 | [diff] [blame] | 4173 | |
Jeff Sharkey | 61ee0bb | 2011-05-29 22:50:42 -0700 | [diff] [blame] | 4174 | /** {@hide} */ |
Jeff Sharkey | 0a9ee12 | 2011-06-22 16:32:41 -0700 | [diff] [blame] | 4175 | public static final String NETSTATS_ENABLED = "netstats_enabled"; |
| 4176 | /** {@hide} */ |
Jeff Sharkey | 61ee0bb | 2011-05-29 22:50:42 -0700 | [diff] [blame] | 4177 | public static final String NETSTATS_POLL_INTERVAL = "netstats_poll_interval"; |
| 4178 | /** {@hide} */ |
Jeff Sharkey | 63abc37 | 2012-01-11 18:38:16 -0800 | [diff] [blame] | 4179 | public static final String NETSTATS_TIME_CACHE_MAX_AGE = "netstats_time_cache_max_age"; |
Jeff Sharkey | 61ee0bb | 2011-05-29 22:50:42 -0700 | [diff] [blame] | 4180 | /** {@hide} */ |
Jeff Sharkey | 63abc37 | 2012-01-11 18:38:16 -0800 | [diff] [blame] | 4181 | public static final String NETSTATS_GLOBAL_ALERT_BYTES = "netstats_global_alert_bytes"; |
Jeff Sharkey | 61ee0bb | 2011-05-29 22:50:42 -0700 | [diff] [blame] | 4182 | /** {@hide} */ |
Jeff Sharkey | 63abc37 | 2012-01-11 18:38:16 -0800 | [diff] [blame] | 4183 | public static final String NETSTATS_SAMPLE_ENABLED = "netstats_sample_enabled"; |
| 4184 | |
| 4185 | /** {@hide} */ |
| 4186 | public static final String NETSTATS_DEV_BUCKET_DURATION = "netstats_dev_bucket_duration"; |
| 4187 | /** {@hide} */ |
| 4188 | public static final String NETSTATS_DEV_PERSIST_BYTES = "netstats_dev_persist_bytes"; |
| 4189 | /** {@hide} */ |
| 4190 | public static final String NETSTATS_DEV_ROTATE_AGE = "netstats_dev_rotate_age"; |
| 4191 | /** {@hide} */ |
| 4192 | public static final String NETSTATS_DEV_DELETE_AGE = "netstats_dev_delete_age"; |
| 4193 | |
Jeff Sharkey | 61ee0bb | 2011-05-29 22:50:42 -0700 | [diff] [blame] | 4194 | /** {@hide} */ |
Jeff Sharkey | 39ebc21 | 2011-06-11 17:25:42 -0700 | [diff] [blame] | 4195 | public static final String NETSTATS_UID_BUCKET_DURATION = "netstats_uid_bucket_duration"; |
Jeff Sharkey | 61ee0bb | 2011-05-29 22:50:42 -0700 | [diff] [blame] | 4196 | /** {@hide} */ |
Jeff Sharkey | 63abc37 | 2012-01-11 18:38:16 -0800 | [diff] [blame] | 4197 | public static final String NETSTATS_UID_PERSIST_BYTES = "netstats_uid_persist_bytes"; |
Jeff Sharkey | d03fd3f | 2011-06-19 20:55:09 -0700 | [diff] [blame] | 4198 | /** {@hide} */ |
Jeff Sharkey | 63abc37 | 2012-01-11 18:38:16 -0800 | [diff] [blame] | 4199 | public static final String NETSTATS_UID_ROTATE_AGE = "netstats_uid_rotate_age"; |
| 4200 | /** {@hide} */ |
| 4201 | public static final String NETSTATS_UID_DELETE_AGE = "netstats_uid_delete_age"; |
| 4202 | |
| 4203 | /** {@hide} */ |
| 4204 | public static final String NETSTATS_UID_TAG_BUCKET_DURATION = "netstats_uid_tag_bucket_duration"; |
| 4205 | /** {@hide} */ |
| 4206 | public static final String NETSTATS_UID_TAG_PERSIST_BYTES = "netstats_uid_tag_persist_bytes"; |
| 4207 | /** {@hide} */ |
| 4208 | public static final String NETSTATS_UID_TAG_ROTATE_AGE = "netstats_uid_tag_rotate_age"; |
| 4209 | /** {@hide} */ |
| 4210 | public static final String NETSTATS_UID_TAG_DELETE_AGE = "netstats_uid_tag_delete_age"; |
Jeff Sharkey | 61ee0bb | 2011-05-29 22:50:42 -0700 | [diff] [blame] | 4211 | |
Jeff Sharkey | 104344e | 2011-07-10 14:20:41 -0700 | [diff] [blame] | 4212 | /** Preferred NTP server. {@hide} */ |
| 4213 | public static final String NTP_SERVER = "ntp_server"; |
| 4214 | /** Timeout in milliseconds to wait for NTP server. {@hide} */ |
| 4215 | public static final String NTP_TIMEOUT = "ntp_timeout"; |
| 4216 | |
Ben Murdoch | 9999c1d | 2011-07-19 16:51:24 +0100 | [diff] [blame] | 4217 | /** Autofill server address (Used in WebView/browser). {@hide} */ |
| 4218 | public static final String WEB_AUTOFILL_QUERY_URL = |
| 4219 | "web_autofill_query_url"; |
| 4220 | |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 4221 | /** Whether package verification is enabled. {@hide} */ |
| 4222 | public static final String PACKAGE_VERIFIER_ENABLE = "verifier_enable"; |
| 4223 | |
| 4224 | /** Timeout for package verification. {@hide} */ |
| 4225 | public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout"; |
| 4226 | |
Daniel Sandler | 0601eb7 | 2011-04-13 01:01:32 -0400 | [diff] [blame] | 4227 | /** |
Dave Santoro | e43185e | 2011-10-10 18:11:00 -0700 | [diff] [blame] | 4228 | * Duration in milliseconds before pre-authorized URIs for the contacts |
| 4229 | * provider should expire. |
| 4230 | * @hide |
| 4231 | */ |
| 4232 | public static final String CONTACTS_PREAUTH_URI_EXPIRATION = |
| 4233 | "contacts_preauth_uri_expiration"; |
| 4234 | |
| 4235 | /** |
Svetoslav Ganov | a571a58 | 2011-09-20 18:32:20 -0700 | [diff] [blame] | 4236 | * This are the settings to be backed up. |
| 4237 | * |
| 4238 | * NOTE: Settings are backed up and restored in the order they appear |
| 4239 | * in this array. If you have one setting depending on another, |
| 4240 | * make sure that they are ordered appropriately. |
| 4241 | * |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 4242 | * @hide |
| 4243 | */ |
| 4244 | public static final String[] SETTINGS_TO_BACKUP = { |
Amith Yamasani | 8823c0a8 | 2009-07-07 14:30:17 -0700 | [diff] [blame] | 4245 | ADB_ENABLED, |
| 4246 | ALLOW_MOCK_LOCATION, |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 4247 | PARENTAL_CONTROL_ENABLED, |
| 4248 | PARENTAL_CONTROL_REDIRECT_URL, |
| 4249 | USB_MASS_STORAGE_ENABLED, |
Svetoslav Ganov | 585f13f8d | 2010-08-10 07:59:15 -0700 | [diff] [blame] | 4250 | ACCESSIBILITY_SCRIPT_INJECTION, |
Christopher Tate | 14c2d79 | 2010-02-25 16:49:44 -0800 | [diff] [blame] | 4251 | BACKUP_AUTO_RESTORE, |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 4252 | ENABLED_ACCESSIBILITY_SERVICES, |
Svetoslav Ganov | a28a16d | 2011-07-28 11:24:21 -0700 | [diff] [blame] | 4253 | TOUCH_EXPLORATION_ENABLED, |
Svetoslav Ganov | a571a58 | 2011-09-20 18:32:20 -0700 | [diff] [blame] | 4254 | ACCESSIBILITY_ENABLED, |
Svetoslav Ganov | 55f937a | 2011-12-05 11:42:07 -0800 | [diff] [blame] | 4255 | ACCESSIBILITY_SPEAK_PASSWORD, |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 4256 | TTS_USE_DEFAULTS, |
| 4257 | TTS_DEFAULT_RATE, |
| 4258 | TTS_DEFAULT_PITCH, |
| 4259 | TTS_DEFAULT_SYNTH, |
| 4260 | TTS_DEFAULT_LANG, |
| 4261 | TTS_DEFAULT_COUNTRY, |
Charles Chen | ceffa15 | 2010-03-16 21:18:10 -0700 | [diff] [blame] | 4262 | TTS_ENABLED_PLUGINS, |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 4263 | TTS_DEFAULT_LOCALE, |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 4264 | WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, |
| 4265 | WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 4266 | WIFI_NUM_OPEN_NETWORKS_KEPT, |
San Mehat | 87734d3 | 2010-01-08 12:53:06 -0800 | [diff] [blame] | 4267 | MOUNT_PLAY_NOTIFICATION_SND, |
| 4268 | MOUNT_UMS_AUTOSTART, |
| 4269 | MOUNT_UMS_PROMPT, |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 4270 | MOUNT_UMS_NOTIFY_ENABLED, |
Amith Yamasani | aee2687 | 2011-10-11 13:53:30 -0700 | [diff] [blame] | 4271 | UI_NIGHT_MODE, |
| 4272 | LOCK_SCREEN_OWNER_INFO, |
Tom Taylor | 994da2a | 2011-11-10 11:17:38 -0800 | [diff] [blame] | 4273 | LOCK_SCREEN_OWNER_INFO_ENABLED |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 4274 | }; |
| 4275 | |
| 4276 | /** |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 4277 | * Helper method for determining if a location provider is enabled. |
| 4278 | * @param cr the content resolver to use |
| 4279 | * @param provider the location provider to query |
| 4280 | * @return true if the provider is enabled |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 4281 | */ |
| 4282 | public static final boolean isLocationProviderEnabled(ContentResolver cr, String provider) { |
| 4283 | String allowedProviders = Settings.Secure.getString(cr, LOCATION_PROVIDERS_ALLOWED); |
Brad Fitzpatrick | 11fe181 | 2010-09-10 16:07:52 -0700 | [diff] [blame] | 4284 | return TextUtils.delimitedStringContains(allowedProviders, ',', provider); |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 4285 | } |
| 4286 | |
| 4287 | /** |
| 4288 | * Thread-safe method for enabling or disabling a single location provider. |
| 4289 | * @param cr the content resolver to use |
| 4290 | * @param provider the location provider to enable or disable |
| 4291 | * @param enabled true if the provider should be enabled |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 4292 | */ |
| 4293 | public static final void setLocationProviderEnabled(ContentResolver cr, |
| 4294 | String provider, boolean enabled) { |
| 4295 | // to ensure thread safety, we write the provider name with a '+' or '-' |
| 4296 | // and let the SettingsProvider handle it rather than reading and modifying |
| 4297 | // the list of enabled providers. |
| 4298 | if (enabled) { |
| 4299 | provider = "+" + provider; |
| 4300 | } else { |
| 4301 | provider = "-" + provider; |
| 4302 | } |
| 4303 | putString(cr, Settings.Secure.LOCATION_PROVIDERS_ALLOWED, provider); |
| 4304 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4305 | } |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 4306 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4307 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4308 | * User-defined bookmarks and shortcuts. The target of each bookmark is an |
| 4309 | * Intent URL, allowing it to be either a web page or a particular |
| 4310 | * application activity. |
| 4311 | * |
| 4312 | * @hide |
| 4313 | */ |
| 4314 | public static final class Bookmarks implements BaseColumns |
| 4315 | { |
| 4316 | private static final String TAG = "Bookmarks"; |
| 4317 | |
| 4318 | /** |
| 4319 | * The content:// style URL for this table |
| 4320 | */ |
| 4321 | public static final Uri CONTENT_URI = |
| 4322 | Uri.parse("content://" + AUTHORITY + "/bookmarks"); |
| 4323 | |
| 4324 | /** |
| 4325 | * The row ID. |
| 4326 | * <p>Type: INTEGER</p> |
| 4327 | */ |
| 4328 | public static final String ID = "_id"; |
| 4329 | |
| 4330 | /** |
| 4331 | * Descriptive name of the bookmark that can be displayed to the user. |
| 4332 | * If this is empty, the title should be resolved at display time (use |
| 4333 | * {@link #getTitle(Context, Cursor)} any time you want to display the |
| 4334 | * title of a bookmark.) |
| 4335 | * <P> |
| 4336 | * Type: TEXT |
| 4337 | * </P> |
| 4338 | */ |
| 4339 | public static final String TITLE = "title"; |
| 4340 | |
| 4341 | /** |
| 4342 | * Arbitrary string (displayed to the user) that allows bookmarks to be |
| 4343 | * organized into categories. There are some special names for |
| 4344 | * standard folders, which all start with '@'. The label displayed for |
| 4345 | * the folder changes with the locale (via {@link #getLabelForFolder}) but |
| 4346 | * the folder name does not change so you can consistently query for |
| 4347 | * the folder regardless of the current locale. |
| 4348 | * |
| 4349 | * <P>Type: TEXT</P> |
| 4350 | * |
| 4351 | */ |
| 4352 | public static final String FOLDER = "folder"; |
| 4353 | |
| 4354 | /** |
| 4355 | * The Intent URL of the bookmark, describing what it points to. This |
| 4356 | * value is given to {@link android.content.Intent#getIntent} to create |
| 4357 | * an Intent that can be launched. |
| 4358 | * <P>Type: TEXT</P> |
| 4359 | */ |
| 4360 | public static final String INTENT = "intent"; |
| 4361 | |
| 4362 | /** |
| 4363 | * Optional shortcut character associated with this bookmark. |
| 4364 | * <P>Type: INTEGER</P> |
| 4365 | */ |
| 4366 | public static final String SHORTCUT = "shortcut"; |
| 4367 | |
| 4368 | /** |
| 4369 | * The order in which the bookmark should be displayed |
| 4370 | * <P>Type: INTEGER</P> |
| 4371 | */ |
| 4372 | public static final String ORDERING = "ordering"; |
| 4373 | |
| 4374 | private static final String[] sIntentProjection = { INTENT }; |
| 4375 | private static final String[] sShortcutProjection = { ID, SHORTCUT }; |
| 4376 | private static final String sShortcutSelection = SHORTCUT + "=?"; |
| 4377 | |
| 4378 | /** |
| 4379 | * Convenience function to retrieve the bookmarked Intent for a |
| 4380 | * particular shortcut key. |
| 4381 | * |
| 4382 | * @param cr The ContentResolver to query. |
| 4383 | * @param shortcut The shortcut key. |
| 4384 | * |
| 4385 | * @return Intent The bookmarked URL, or null if there is no bookmark |
| 4386 | * matching the given shortcut. |
| 4387 | */ |
| 4388 | public static Intent getIntentForShortcut(ContentResolver cr, char shortcut) |
| 4389 | { |
| 4390 | Intent intent = null; |
| 4391 | |
| 4392 | Cursor c = cr.query(CONTENT_URI, |
| 4393 | sIntentProjection, sShortcutSelection, |
| 4394 | new String[] { String.valueOf((int) shortcut) }, ORDERING); |
| 4395 | // Keep trying until we find a valid shortcut |
| 4396 | try { |
| 4397 | while (intent == null && c.moveToNext()) { |
| 4398 | try { |
| 4399 | String intentURI = c.getString(c.getColumnIndexOrThrow(INTENT)); |
Christian Mehlmauer | a34d2c9 | 2010-05-25 19:04:20 +0200 | [diff] [blame] | 4400 | intent = Intent.parseUri(intentURI, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4401 | } catch (java.net.URISyntaxException e) { |
| 4402 | // The stored URL is bad... ignore it. |
| 4403 | } catch (IllegalArgumentException e) { |
| 4404 | // Column not found |
Dianne Hackborn | a33e3f7 | 2009-09-29 17:28:24 -0700 | [diff] [blame] | 4405 | Log.w(TAG, "Intent column not found", e); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4406 | } |
| 4407 | } |
| 4408 | } finally { |
| 4409 | if (c != null) c.close(); |
| 4410 | } |
| 4411 | |
| 4412 | return intent; |
| 4413 | } |
| 4414 | |
| 4415 | /** |
| 4416 | * Add a new bookmark to the system. |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 4417 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4418 | * @param cr The ContentResolver to query. |
| 4419 | * @param intent The desired target of the bookmark. |
| 4420 | * @param title Bookmark title that is shown to the user; null if none |
| 4421 | * or it should be resolved to the intent's title. |
| 4422 | * @param folder Folder in which to place the bookmark; null if none. |
| 4423 | * @param shortcut Shortcut that will invoke the bookmark; 0 if none. If |
| 4424 | * this is non-zero and there is an existing bookmark entry |
| 4425 | * with this same shortcut, then that existing shortcut is |
| 4426 | * cleared (the bookmark is not removed). |
| 4427 | * @return The unique content URL for the new bookmark entry. |
| 4428 | */ |
| 4429 | public static Uri add(ContentResolver cr, |
| 4430 | Intent intent, |
| 4431 | String title, |
| 4432 | String folder, |
| 4433 | char shortcut, |
| 4434 | int ordering) |
| 4435 | { |
| 4436 | // If a shortcut is supplied, and it is already defined for |
| 4437 | // another bookmark, then remove the old definition. |
| 4438 | if (shortcut != 0) { |
Jeff Hamilton | 7cd51ef | 2010-05-12 17:30:27 -0500 | [diff] [blame] | 4439 | cr.delete(CONTENT_URI, sShortcutSelection, |
| 4440 | new String[] { String.valueOf((int) shortcut) }); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4441 | } |
| 4442 | |
| 4443 | ContentValues values = new ContentValues(); |
| 4444 | if (title != null) values.put(TITLE, title); |
| 4445 | if (folder != null) values.put(FOLDER, folder); |
Jean-Baptiste Queru | 3b9f0a3 | 2010-06-21 13:46:59 -0700 | [diff] [blame] | 4446 | values.put(INTENT, intent.toUri(0)); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4447 | if (shortcut != 0) values.put(SHORTCUT, (int) shortcut); |
| 4448 | values.put(ORDERING, ordering); |
| 4449 | return cr.insert(CONTENT_URI, values); |
| 4450 | } |
| 4451 | |
| 4452 | /** |
| 4453 | * Return the folder name as it should be displayed to the user. This |
| 4454 | * takes care of localizing special folders. |
| 4455 | * |
| 4456 | * @param r Resources object for current locale; only need access to |
| 4457 | * system resources. |
| 4458 | * @param folder The value found in the {@link #FOLDER} column. |
| 4459 | * |
| 4460 | * @return CharSequence The label for this folder that should be shown |
| 4461 | * to the user. |
| 4462 | */ |
| 4463 | public static CharSequence getLabelForFolder(Resources r, String folder) { |
| 4464 | return folder; |
| 4465 | } |
| 4466 | |
| 4467 | /** |
| 4468 | * Return the title as it should be displayed to the user. This takes |
| 4469 | * care of localizing bookmarks that point to activities. |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 4470 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4471 | * @param context A context. |
| 4472 | * @param cursor A cursor pointing to the row whose title should be |
| 4473 | * returned. The cursor must contain at least the {@link #TITLE} |
| 4474 | * and {@link #INTENT} columns. |
| 4475 | * @return A title that is localized and can be displayed to the user, |
| 4476 | * or the empty string if one could not be found. |
| 4477 | */ |
| 4478 | public static CharSequence getTitle(Context context, Cursor cursor) { |
| 4479 | int titleColumn = cursor.getColumnIndex(TITLE); |
| 4480 | int intentColumn = cursor.getColumnIndex(INTENT); |
| 4481 | if (titleColumn == -1 || intentColumn == -1) { |
| 4482 | throw new IllegalArgumentException( |
| 4483 | "The cursor must contain the TITLE and INTENT columns."); |
| 4484 | } |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 4485 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4486 | String title = cursor.getString(titleColumn); |
| 4487 | if (!TextUtils.isEmpty(title)) { |
| 4488 | return title; |
| 4489 | } |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 4490 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4491 | String intentUri = cursor.getString(intentColumn); |
| 4492 | if (TextUtils.isEmpty(intentUri)) { |
| 4493 | return ""; |
| 4494 | } |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 4495 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4496 | Intent intent; |
| 4497 | try { |
Christian Mehlmauer | a34d2c9 | 2010-05-25 19:04:20 +0200 | [diff] [blame] | 4498 | intent = Intent.parseUri(intentUri, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4499 | } catch (URISyntaxException e) { |
| 4500 | return ""; |
| 4501 | } |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 4502 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4503 | PackageManager packageManager = context.getPackageManager(); |
| 4504 | ResolveInfo info = packageManager.resolveActivity(intent, 0); |
| 4505 | return info != null ? info.loadLabel(packageManager) : ""; |
| 4506 | } |
| 4507 | } |
| 4508 | |
| 4509 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4510 | * Returns the device ID that we should use when connecting to the mobile gtalk server. |
| 4511 | * This is a string like "android-0x1242", where the hex string is the Android ID obtained |
| 4512 | * from the GoogleLoginService. |
| 4513 | * |
| 4514 | * @param androidId The Android ID for this device. |
| 4515 | * @return The device ID that should be used when connecting to the mobile gtalk server. |
| 4516 | * @hide |
| 4517 | */ |
| 4518 | public static String getGTalkDeviceId(long androidId) { |
| 4519 | return "android-" + Long.toHexString(androidId); |
| 4520 | } |
| 4521 | } |