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