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