The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2007 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.os; |
| 18 | |
Jeff Sharkey | 5568772 | 2014-04-09 18:07:19 -0700 | [diff] [blame] | 19 | import android.text.TextUtils; |
Jeff Sharkey | bdd4491 | 2014-04-11 16:30:14 -0700 | [diff] [blame] | 20 | import android.util.Slog; |
Jeff Sharkey | 5568772 | 2014-04-09 18:07:19 -0700 | [diff] [blame] | 21 | |
Doug Zongker | ad2171a | 2011-06-14 11:07:24 -0700 | [diff] [blame] | 22 | import com.android.internal.telephony.TelephonyProperties; |
| 23 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 24 | /** |
| 25 | * Information about the current build, extracted from system properties. |
| 26 | */ |
| 27 | public class Build { |
Jeff Sharkey | bdd4491 | 2014-04-11 16:30:14 -0700 | [diff] [blame] | 28 | private static final String TAG = "Build"; |
| 29 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 30 | /** Value used for when a build property is unknown. */ |
Ficus Kirkpatrick | 71de785 | 2010-01-08 13:10:51 -0800 | [diff] [blame] | 31 | public static final String UNKNOWN = "unknown"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 32 | |
| 33 | /** Either a changelist number, or a label like "M4-rc20". */ |
| 34 | public static final String ID = getString("ro.build.id"); |
| 35 | |
| 36 | /** A build ID string meant for displaying to the user */ |
| 37 | public static final String DISPLAY = getString("ro.build.display.id"); |
| 38 | |
| 39 | /** The name of the overall product. */ |
| 40 | public static final String PRODUCT = getString("ro.product.name"); |
| 41 | |
| 42 | /** The name of the industrial design. */ |
| 43 | public static final String DEVICE = getString("ro.product.device"); |
| 44 | |
| 45 | /** The name of the underlying board, like "goldfish". */ |
| 46 | public static final String BOARD = getString("ro.product.board"); |
| 47 | |
Narayan Kamath | 1adf400 | 2014-07-12 11:46:37 +0100 | [diff] [blame] | 48 | /** |
| 49 | * The name of the instruction set (CPU type + ABI convention) of native code. |
| 50 | * |
| 51 | * @deprecated Use {@link #SUPPORTED_ABIS} instead. |
| 52 | */ |
| 53 | @Deprecated |
Dianne Hackborn | b181118 | 2009-05-21 15:45:42 -0700 | [diff] [blame] | 54 | public static final String CPU_ABI = getString("ro.product.cpu.abi"); |
| 55 | |
Narayan Kamath | 1adf400 | 2014-07-12 11:46:37 +0100 | [diff] [blame] | 56 | /** |
| 57 | * The name of the second instruction set (CPU type + ABI convention) of native code. |
| 58 | * |
| 59 | * @deprecated Use {@link #SUPPORTED_ABIS} instead. |
| 60 | */ |
| 61 | @Deprecated |
Ficus Kirkpatrick | fa9cafa | 2010-01-06 17:37:13 -0800 | [diff] [blame] | 62 | public static final String CPU_ABI2 = getString("ro.product.cpu.abi2"); |
| 63 | |
Dianne Hackborn | d62ad4f | 2009-05-19 19:06:25 -0700 | [diff] [blame] | 64 | /** The manufacturer of the product/hardware. */ |
| 65 | public static final String MANUFACTURER = getString("ro.product.manufacturer"); |
| 66 | |
Dirk Dougherty | 491b40d | 2013-10-29 18:33:29 -0700 | [diff] [blame] | 67 | /** The consumer-visible brand with which the product/hardware will be associated, if any. */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 68 | public static final String BRAND = getString("ro.product.brand"); |
| 69 | |
| 70 | /** The end-user-visible name for the end product. */ |
| 71 | public static final String MODEL = getString("ro.product.model"); |
| 72 | |
Doug Zongker | 74885ef | 2010-02-02 17:39:26 -0800 | [diff] [blame] | 73 | /** The system bootloader version number. */ |
Dan Egnor | 42471dd | 2010-01-07 17:25:22 -0800 | [diff] [blame] | 74 | public static final String BOOTLOADER = getString("ro.bootloader"); |
| 75 | |
Doug Zongker | ad2171a | 2011-06-14 11:07:24 -0700 | [diff] [blame] | 76 | /** |
| 77 | * The radio firmware version number. |
| 78 | * |
| 79 | * @deprecated The radio firmware version is frequently not |
| 80 | * available when this class is initialized, leading to a blank or |
| 81 | * "unknown" value for this string. Use |
| 82 | * {@link #getRadioVersion} instead. |
| 83 | */ |
| 84 | @Deprecated |
| 85 | public static final String RADIO = getString(TelephonyProperties.PROPERTY_BASEBAND_VERSION); |
Dan Egnor | 42471dd | 2010-01-07 17:25:22 -0800 | [diff] [blame] | 86 | |
Doug Zongker | 74885ef | 2010-02-02 17:39:26 -0800 | [diff] [blame] | 87 | /** The name of the hardware (from the kernel command line or /proc). */ |
| 88 | public static final String HARDWARE = getString("ro.hardware"); |
Dan Egnor | 42471dd | 2010-01-07 17:25:22 -0800 | [diff] [blame] | 89 | |
Doug Zongker | 7d2e3df | 2010-08-11 16:58:04 -0700 | [diff] [blame] | 90 | /** A hardware serial number, if available. Alphanumeric only, case-insensitive. */ |
| 91 | public static final String SERIAL = getString("ro.serialno"); |
Ramin Zaghi | 1378aba | 2014-02-28 15:03:19 +0000 | [diff] [blame] | 92 | |
| 93 | /** |
Narayan Kamath | 0f206a1 | 2014-04-12 11:41:13 +0100 | [diff] [blame] | 94 | * An ordered list of ABIs supported by this device. The most preferred ABI is the first |
| 95 | * element in the list. |
| 96 | * |
| 97 | * See {@link #SUPPORTED_32_BIT_ABIS} and {@link #SUPPORTED_64_BIT_ABIS}. |
Ramin Zaghi | 1378aba | 2014-02-28 15:03:19 +0000 | [diff] [blame] | 98 | */ |
Torne (Richard Coles) | ff701a6 | 2014-07-30 12:11:15 +0100 | [diff] [blame] | 99 | public static final String[] SUPPORTED_ABIS = getStringList("ro.product.cpu.abilist", ","); |
Ramin Zaghi | 1378aba | 2014-02-28 15:03:19 +0000 | [diff] [blame] | 100 | |
Narayan Kamath | 0f206a1 | 2014-04-12 11:41:13 +0100 | [diff] [blame] | 101 | /** |
| 102 | * An ordered list of <b>32 bit</b> ABIs supported by this device. The most preferred ABI |
| 103 | * is the first element in the list. |
| 104 | * |
| 105 | * See {@link #SUPPORTED_ABIS} and {@link #SUPPORTED_64_BIT_ABIS}. |
Narayan Kamath | 0f206a1 | 2014-04-12 11:41:13 +0100 | [diff] [blame] | 106 | */ |
Torne (Richard Coles) | da8c037 | 2014-05-14 16:17:26 +0100 | [diff] [blame] | 107 | public static final String[] SUPPORTED_32_BIT_ABIS = |
Torne (Richard Coles) | ff701a6 | 2014-07-30 12:11:15 +0100 | [diff] [blame] | 108 | getStringList("ro.product.cpu.abilist32", ","); |
Narayan Kamath | 0f206a1 | 2014-04-12 11:41:13 +0100 | [diff] [blame] | 109 | |
| 110 | /** |
| 111 | * An ordered list of <b>64 bit</b> ABIs supported by this device. The most preferred ABI |
| 112 | * is the first element in the list. |
| 113 | * |
| 114 | * See {@link #SUPPORTED_ABIS} and {@link #SUPPORTED_32_BIT_ABIS}. |
Narayan Kamath | 0f206a1 | 2014-04-12 11:41:13 +0100 | [diff] [blame] | 115 | */ |
Torne (Richard Coles) | da8c037 | 2014-05-14 16:17:26 +0100 | [diff] [blame] | 116 | public static final String[] SUPPORTED_64_BIT_ABIS = |
Torne (Richard Coles) | ff701a6 | 2014-07-30 12:11:15 +0100 | [diff] [blame] | 117 | getStringList("ro.product.cpu.abilist64", ","); |
Narayan Kamath | 0f206a1 | 2014-04-12 11:41:13 +0100 | [diff] [blame] | 118 | |
| 119 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 120 | /** Various version strings. */ |
| 121 | public static class VERSION { |
| 122 | /** |
| 123 | * The internal value used by the underlying source control to |
| 124 | * represent this build. E.g., a perforce changelist number |
| 125 | * or a git hash. |
| 126 | */ |
| 127 | public static final String INCREMENTAL = getString("ro.build.version.incremental"); |
| 128 | |
| 129 | /** |
| 130 | * The user-visible version string. E.g., "1.0" or "3.4b5". |
| 131 | */ |
| 132 | public static final String RELEASE = getString("ro.build.version.release"); |
| 133 | |
| 134 | /** |
Dianne Hackborn | 851a541 | 2009-05-08 12:06:44 -0700 | [diff] [blame] | 135 | * The user-visible SDK version of the framework in its raw String |
| 136 | * representation; use {@link #SDK_INT} instead. |
| 137 | * |
| 138 | * @deprecated Use {@link #SDK_INT} to easily get this as an integer. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 139 | */ |
Dianne Hackborn | 4a51c20 | 2009-08-21 15:14:02 -0700 | [diff] [blame] | 140 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 141 | public static final String SDK = getString("ro.build.version.sdk"); |
Dianne Hackborn | 851a541 | 2009-05-08 12:06:44 -0700 | [diff] [blame] | 142 | |
| 143 | /** |
| 144 | * The user-visible SDK version of the framework; its possible |
| 145 | * values are defined in {@link Build.VERSION_CODES}. |
| 146 | */ |
| 147 | public static final int SDK_INT = SystemProperties.getInt( |
| 148 | "ro.build.version.sdk", 0); |
| 149 | |
| 150 | /** |
| 151 | * The current development codename, or the string "REL" if this is |
| 152 | * a release build. |
| 153 | */ |
| 154 | public static final String CODENAME = getString("ro.build.version.codename"); |
Dianne Hackborn | 3b81bc1 | 2011-01-15 11:50:52 -0800 | [diff] [blame] | 155 | |
Dianne Hackborn | ffcda10 | 2014-04-24 13:06:27 -0700 | [diff] [blame] | 156 | private static final String[] ALL_CODENAMES |
Torne (Richard Coles) | ff701a6 | 2014-07-30 12:11:15 +0100 | [diff] [blame] | 157 | = getStringList("ro.build.version.all_codenames", ","); |
Dianne Hackborn | ffcda10 | 2014-04-24 13:06:27 -0700 | [diff] [blame] | 158 | |
Dianne Hackborn | 3b81bc1 | 2011-01-15 11:50:52 -0800 | [diff] [blame] | 159 | /** |
Dianne Hackborn | 3b81bc1 | 2011-01-15 11:50:52 -0800 | [diff] [blame] | 160 | * @hide |
| 161 | */ |
Dianne Hackborn | ffcda10 | 2014-04-24 13:06:27 -0700 | [diff] [blame] | 162 | public static final String[] ACTIVE_CODENAMES = "REL".equals(ALL_CODENAMES[0]) |
| 163 | ? new String[0] : ALL_CODENAMES; |
| 164 | |
| 165 | /** |
| 166 | * The SDK version to use when accessing resources. |
| 167 | * Use the current SDK version code. For every active development codename |
| 168 | * we are operating under, we bump the assumed resource platform version by 1. |
| 169 | * @hide |
| 170 | */ |
| 171 | public static final int RESOURCES_SDK_INT = SDK_INT + ACTIVE_CODENAMES.length; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 172 | } |
| 173 | |
Dianne Hackborn | 851a541 | 2009-05-08 12:06:44 -0700 | [diff] [blame] | 174 | /** |
| 175 | * Enumeration of the currently known SDK version codes. These are the |
| 176 | * values that can be found in {@link VERSION#SDK}. Version numbers |
| 177 | * increment monotonically with each official platform release. |
| 178 | */ |
| 179 | public static class VERSION_CODES { |
| 180 | /** |
Dianne Hackborn | a96cbb4 | 2009-05-13 15:06:13 -0700 | [diff] [blame] | 181 | * Magic version number for a current development build, which has |
| 182 | * not yet turned into an official release. |
| 183 | */ |
| 184 | public static final int CUR_DEVELOPMENT = 10000; |
| 185 | |
| 186 | /** |
Dianne Hackborn | 851a541 | 2009-05-08 12:06:44 -0700 | [diff] [blame] | 187 | * October 2008: The original, first, version of Android. Yay! |
| 188 | */ |
| 189 | public static final int BASE = 1; |
Dianne Hackborn | 0fa3591 | 2009-10-23 12:32:45 -0700 | [diff] [blame] | 190 | |
Dianne Hackborn | 851a541 | 2009-05-08 12:06:44 -0700 | [diff] [blame] | 191 | /** |
| 192 | * February 2009: First Android update, officially called 1.1. |
| 193 | */ |
| 194 | public static final int BASE_1_1 = 2; |
Dianne Hackborn | 0fa3591 | 2009-10-23 12:32:45 -0700 | [diff] [blame] | 195 | |
Dianne Hackborn | 851a541 | 2009-05-08 12:06:44 -0700 | [diff] [blame] | 196 | /** |
| 197 | * May 2009: Android 1.5. |
| 198 | */ |
| 199 | public static final int CUPCAKE = 3; |
Dianne Hackborn | 0fa3591 | 2009-10-23 12:32:45 -0700 | [diff] [blame] | 200 | |
Dianne Hackborn | a96cbb4 | 2009-05-13 15:06:13 -0700 | [diff] [blame] | 201 | /** |
Dianne Hackborn | 0fa3591 | 2009-10-23 12:32:45 -0700 | [diff] [blame] | 202 | * September 2009: Android 1.6. |
Dianne Hackborn | a96cbb4 | 2009-05-13 15:06:13 -0700 | [diff] [blame] | 203 | * |
| 204 | * <p>Applications targeting this or a later release will get these |
| 205 | * new changes in behavior:</p> |
| 206 | * <ul> |
| 207 | * <li> They must explicitly request the |
San Mehat | 5a3a77d | 2009-06-01 09:25:28 -0700 | [diff] [blame] | 208 | * {@link android.Manifest.permission#WRITE_EXTERNAL_STORAGE} permission to be |
Dianne Hackborn | a96cbb4 | 2009-05-13 15:06:13 -0700 | [diff] [blame] | 209 | * able to modify the contents of the SD card. (Apps targeting |
| 210 | * earlier versions will always request the permission.) |
Dianne Hackborn | fe77ec8 | 2009-08-12 16:53:56 -0700 | [diff] [blame] | 211 | * <li> They must explicitly request the |
| 212 | * {@link android.Manifest.permission#READ_PHONE_STATE} permission to be |
| 213 | * able to be able to retrieve phone state info. (Apps targeting |
| 214 | * earlier versions will always request the permission.) |
| 215 | * <li> They are assumed to support different screen densities and |
| 216 | * sizes. (Apps targeting earlier versions are assumed to only support |
| 217 | * medium density normal size screens unless otherwise indicated). |
| 218 | * They can still explicitly specify screen support either way with the |
| 219 | * supports-screens manifest tag. |
Dianne Hackborn | 81e9276 | 2011-10-09 16:00:21 -0700 | [diff] [blame] | 220 | * <li> {@link android.widget.TabHost} will use the new dark tab |
| 221 | * background design. |
Dianne Hackborn | a96cbb4 | 2009-05-13 15:06:13 -0700 | [diff] [blame] | 222 | * </ul> |
| 223 | */ |
Dianne Hackborn | fe77ec8 | 2009-08-12 16:53:56 -0700 | [diff] [blame] | 224 | public static final int DONUT = 4; |
Dianne Hackborn | 0fa3591 | 2009-10-23 12:32:45 -0700 | [diff] [blame] | 225 | |
Dianne Hackborn | f6f9f2d | 2009-08-21 16:26:03 -0700 | [diff] [blame] | 226 | /** |
Dianne Hackborn | 0fa3591 | 2009-10-23 12:32:45 -0700 | [diff] [blame] | 227 | * November 2009: Android 2.0 |
Dianne Hackborn | f6f9f2d | 2009-08-21 16:26:03 -0700 | [diff] [blame] | 228 | * |
| 229 | * <p>Applications targeting this or a later release will get these |
| 230 | * new changes in behavior:</p> |
| 231 | * <ul> |
| 232 | * <li> The {@link android.app.Service#onStartCommand |
| 233 | * Service.onStartCommand} function will return the new |
| 234 | * {@link android.app.Service#START_STICKY} behavior instead of the |
| 235 | * old compatibility {@link android.app.Service#START_STICKY_COMPATIBILITY}. |
Dianne Hackborn | 8d37426 | 2009-09-14 21:21:52 -0700 | [diff] [blame] | 236 | * <li> The {@link android.app.Activity} class will now execute back |
| 237 | * key presses on the key up instead of key down, to be able to detect |
| 238 | * canceled presses from virtual keys. |
Mike Cleron | 7609764 | 2009-09-25 17:53:56 -0700 | [diff] [blame] | 239 | * <li> The {@link android.widget.TabWidget} class will use a new color scheme |
| 240 | * for tabs. In the new scheme, the foreground tab has a medium gray background |
| 241 | * the background tabs have a dark gray background. |
Dianne Hackborn | f6f9f2d | 2009-08-21 16:26:03 -0700 | [diff] [blame] | 242 | * </ul> |
| 243 | */ |
Jeff Hamilton | 6dc3f4e | 2009-10-10 12:06:19 -0500 | [diff] [blame] | 244 | public static final int ECLAIR = 5; |
Dianne Hackborn | 0fa3591 | 2009-10-23 12:32:45 -0700 | [diff] [blame] | 245 | |
| 246 | /** |
Dianne Hackborn | 1778776 | 2009-11-12 16:11:36 -0800 | [diff] [blame] | 247 | * December 2009: Android 2.0.1 |
Dianne Hackborn | 0fa3591 | 2009-10-23 12:32:45 -0700 | [diff] [blame] | 248 | */ |
Dianne Hackborn | 1778776 | 2009-11-12 16:11:36 -0800 | [diff] [blame] | 249 | public static final int ECLAIR_0_1 = 6; |
Dianne Hackborn | 23ef7b4 | 2009-11-18 18:20:39 -0800 | [diff] [blame] | 250 | |
| 251 | /** |
| 252 | * January 2010: Android 2.1 |
| 253 | */ |
| 254 | public static final int ECLAIR_MR1 = 7; |
Adam Powell | 216bccf | 2010-02-01 15:03:17 -0800 | [diff] [blame] | 255 | |
Dianne Hackborn | 3e03cfa | 2010-06-13 12:07:00 -0700 | [diff] [blame] | 256 | /** |
| 257 | * June 2010: Android 2.2 |
| 258 | */ |
Adam Powell | 216bccf | 2010-02-01 15:03:17 -0800 | [diff] [blame] | 259 | public static final int FROYO = 8; |
Dianne Hackborn | 14cee9f | 2010-04-23 17:51:26 -0700 | [diff] [blame] | 260 | |
Dianne Hackborn | 3e03cfa | 2010-06-13 12:07:00 -0700 | [diff] [blame] | 261 | /** |
Dianne Hackborn | 9d97b63 | 2011-01-23 14:56:39 -0800 | [diff] [blame] | 262 | * November 2010: Android 2.3 |
Dianne Hackborn | 81e9276 | 2011-10-09 16:00:21 -0700 | [diff] [blame] | 263 | * |
| 264 | * <p>Applications targeting this or a later release will get these |
| 265 | * new changes in behavior:</p> |
| 266 | * <ul> |
| 267 | * <li> The application's notification icons will be shown on the new |
| 268 | * dark status bar background, so must be visible in this situation. |
| 269 | * </ul> |
Dianne Hackborn | 3e03cfa | 2010-06-13 12:07:00 -0700 | [diff] [blame] | 270 | */ |
Dianne Hackborn | 4fa1a22 | 2010-10-18 13:10:49 -0700 | [diff] [blame] | 271 | public static final int GINGERBREAD = 9; |
Dianne Hackborn | 9d97b63 | 2011-01-23 14:56:39 -0800 | [diff] [blame] | 272 | |
| 273 | /** |
Dianne Hackborn | edf1fc6 | 2011-03-17 18:34:48 -0700 | [diff] [blame] | 274 | * February 2011: Android 2.3.3. |
Dianne Hackborn | 9d97b63 | 2011-01-23 14:56:39 -0800 | [diff] [blame] | 275 | */ |
| 276 | public static final int GINGERBREAD_MR1 = 10; |
Dianne Hackborn | b1ad597 | 2010-08-02 17:30:33 -0700 | [diff] [blame] | 277 | |
| 278 | /** |
Dianne Hackborn | edf1fc6 | 2011-03-17 18:34:48 -0700 | [diff] [blame] | 279 | * February 2011: Android 3.0. |
Dianne Hackborn | b1ad597 | 2010-08-02 17:30:33 -0700 | [diff] [blame] | 280 | * |
| 281 | * <p>Applications targeting this or a later release will get these |
| 282 | * new changes in behavior:</p> |
| 283 | * <ul> |
Dianne Hackborn | 3e6d50c | 2010-08-23 18:30:44 -0700 | [diff] [blame] | 284 | * <li> The default theme for applications is now dark holographic: |
| 285 | * {@link android.R.style#Theme_Holo}. |
Dianne Hackborn | 81e9276 | 2011-10-09 16:00:21 -0700 | [diff] [blame] | 286 | * <li> On large screen devices that do not have a physical menu |
| 287 | * button, the soft (compatibility) menu is disabled. |
Dianne Hackborn | 0aae2d4 | 2010-12-07 23:51:29 -0800 | [diff] [blame] | 288 | * <li> The activity lifecycle has changed slightly as per |
| 289 | * {@link android.app.Activity}. |
Dianne Hackborn | 81e9276 | 2011-10-09 16:00:21 -0700 | [diff] [blame] | 290 | * <li> An application will crash if it does not call through |
| 291 | * to the super implementation of its |
| 292 | * {@link android.app.Activity#onPause Activity.onPause()} method. |
Dianne Hackborn | 9d97b63 | 2011-01-23 14:56:39 -0800 | [diff] [blame] | 293 | * <li> When an application requires a permission to access one of |
Dianne Hackborn | 6c2c5fc | 2011-01-18 17:02:33 -0800 | [diff] [blame] | 294 | * its components (activity, receiver, service, provider), this |
| 295 | * permission is no longer enforced when the application wants to |
| 296 | * access its own component. This means it can require a permission |
| 297 | * on a component that it does not itself hold and still access that |
| 298 | * component. |
Dianne Hackborn | 81e9276 | 2011-10-09 16:00:21 -0700 | [diff] [blame] | 299 | * <li> {@link android.content.Context#getSharedPreferences |
| 300 | * Context.getSharedPreferences()} will not automatically reload |
| 301 | * the preferences if they have changed on storage, unless |
| 302 | * {@link android.content.Context#MODE_MULTI_PROCESS} is used. |
| 303 | * <li> {@link android.view.ViewGroup#setMotionEventSplittingEnabled} |
| 304 | * will default to true. |
| 305 | * <li> {@link android.view.WindowManager.LayoutParams#FLAG_SPLIT_TOUCH} |
| 306 | * is enabled by default on windows. |
| 307 | * <li> {@link android.widget.PopupWindow#isSplitTouchEnabled() |
| 308 | * PopupWindow.isSplitTouchEnabled()} will return true by default. |
| 309 | * <li> {@link android.widget.GridView} and {@link android.widget.ListView} |
| 310 | * will use {@link android.view.View#setActivated View.setActivated} |
| 311 | * for selected items if they do not implement {@link android.widget.Checkable}. |
| 312 | * <li> {@link android.widget.Scroller} will be constructed with |
| 313 | * "flywheel" behavior enabled by default. |
Dianne Hackborn | b1ad597 | 2010-08-02 17:30:33 -0700 | [diff] [blame] | 314 | * </ul> |
| 315 | */ |
Dianne Hackborn | 9d97b63 | 2011-01-23 14:56:39 -0800 | [diff] [blame] | 316 | public static final int HONEYCOMB = 11; |
Dianne Hackborn | edf1fc6 | 2011-03-17 18:34:48 -0700 | [diff] [blame] | 317 | |
| 318 | /** |
Dianne Hackborn | a813873 | 2011-05-12 15:45:21 -0700 | [diff] [blame] | 319 | * May 2011: Android 3.1. |
Dianne Hackborn | edf1fc6 | 2011-03-17 18:34:48 -0700 | [diff] [blame] | 320 | */ |
| 321 | public static final int HONEYCOMB_MR1 = 12; |
Dianne Hackborn | a813873 | 2011-05-12 15:45:21 -0700 | [diff] [blame] | 322 | |
| 323 | /** |
Dianne Hackborn | 426431a | 2011-06-09 11:29:08 -0700 | [diff] [blame] | 324 | * June 2011: Android 3.2. |
Dianne Hackborn | e667635 | 2011-06-01 16:51:20 -0700 | [diff] [blame] | 325 | * |
| 326 | * <p>Update to Honeycomb MR1 to support 7 inch tablets, improve |
| 327 | * screen compatibility mode, etc.</p> |
| 328 | * |
| 329 | * <p>As of this version, applications that don't say whether they |
| 330 | * support XLARGE screens will be assumed to do so only if they target |
| 331 | * {@link #HONEYCOMB} or later; it had been {@link #GINGERBREAD} or |
| 332 | * later. Applications that don't support a screen size at least as |
| 333 | * large as the current screen will provide the user with a UI to |
| 334 | * switch them in to screen size compatibility mode.</p> |
Dianne Hackborn | e289bff | 2011-06-13 19:33:22 -0700 | [diff] [blame] | 335 | * |
| 336 | * <p>This version introduces new screen size resource qualifiers |
| 337 | * based on the screen size in dp: see |
| 338 | * {@link android.content.res.Configuration#screenWidthDp}, |
| 339 | * {@link android.content.res.Configuration#screenHeightDp}, and |
| 340 | * {@link android.content.res.Configuration#smallestScreenWidthDp}. |
| 341 | * Supplying these in <supports-screens> as per |
| 342 | * {@link android.content.pm.ApplicationInfo#requiresSmallestWidthDp}, |
| 343 | * {@link android.content.pm.ApplicationInfo#compatibleWidthLimitDp}, and |
| 344 | * {@link android.content.pm.ApplicationInfo#largestWidthLimitDp} is |
| 345 | * preferred over the older screen size buckets and for older devices |
| 346 | * the appropriate buckets will be inferred from them.</p> |
| 347 | * |
Dianne Hackborn | 81e9276 | 2011-10-09 16:00:21 -0700 | [diff] [blame] | 348 | * <p>Applications targeting this or a later release will get these |
| 349 | * new changes in behavior:</p> |
| 350 | * <ul> |
| 351 | * <li><p>New {@link android.content.pm.PackageManager#FEATURE_SCREEN_PORTRAIT} |
Dianne Hackborn | e289bff | 2011-06-13 19:33:22 -0700 | [diff] [blame] | 352 | * and {@link android.content.pm.PackageManager#FEATURE_SCREEN_LANDSCAPE} |
Dianne Hackborn | 81e9276 | 2011-10-09 16:00:21 -0700 | [diff] [blame] | 353 | * features were introduced in this release. Applications that target |
Dianne Hackborn | e289bff | 2011-06-13 19:33:22 -0700 | [diff] [blame] | 354 | * previous platform versions are assumed to require both portrait and |
| 355 | * landscape support in the device; when targeting Honeycomb MR1 or |
| 356 | * greater the application is responsible for specifying any specific |
| 357 | * orientation it requires.</p> |
Dianne Hackborn | 81e9276 | 2011-10-09 16:00:21 -0700 | [diff] [blame] | 358 | * <li><p>{@link android.os.AsyncTask} will use the serial executor |
| 359 | * by default when calling {@link android.os.AsyncTask#execute}.</p> |
| 360 | * <li><p>{@link android.content.pm.ActivityInfo#configChanges |
| 361 | * ActivityInfo.configChanges} will have the |
| 362 | * {@link android.content.pm.ActivityInfo#CONFIG_SCREEN_SIZE} and |
| 363 | * {@link android.content.pm.ActivityInfo#CONFIG_SMALLEST_SCREEN_SIZE} |
| 364 | * bits set; these need to be cleared for older applications because |
| 365 | * some developers have done absolute comparisons against this value |
| 366 | * instead of correctly masking the bits they are interested in. |
| 367 | * </ul> |
Dianne Hackborn | a813873 | 2011-05-12 15:45:21 -0700 | [diff] [blame] | 368 | */ |
Dianne Hackborn | 426431a | 2011-06-09 11:29:08 -0700 | [diff] [blame] | 369 | public static final int HONEYCOMB_MR2 = 13; |
Dianne Hackborn | 3fc982f | 2011-03-30 16:20:26 -0700 | [diff] [blame] | 370 | |
| 371 | /** |
Dianne Hackborn | f35fe23 | 2011-11-01 19:25:20 -0700 | [diff] [blame] | 372 | * October 2011: Android 4.0. |
Dianne Hackborn | 2d6833b | 2011-06-24 16:04:19 -0700 | [diff] [blame] | 373 | * |
| 374 | * <p>Applications targeting this or a later release will get these |
| 375 | * new changes in behavior:</p> |
| 376 | * <ul> |
Dianne Hackborn | 9d0e37e | 2011-09-22 12:58:54 -0700 | [diff] [blame] | 377 | * <li> For devices without a dedicated menu key, the software compatibility |
| 378 | * menu key will not be shown even on phones. By targeting Ice Cream Sandwich |
| 379 | * or later, your UI must always have its own menu UI affordance if needed, |
| 380 | * on both tablets and phones. The ActionBar will take care of this for you. |
Dianne Hackborn | 2d6833b | 2011-06-24 16:04:19 -0700 | [diff] [blame] | 381 | * <li> 2d drawing hardware acceleration is now turned on by default. |
| 382 | * You can use |
| 383 | * {@link android.R.attr#hardwareAccelerated android:hardwareAccelerated} |
| 384 | * to turn it off if needed, although this is strongly discouraged since |
| 385 | * it will result in poor performance on larger screen devices. |
Adam Powell | 6e90a36 | 2011-08-14 16:48:32 -0700 | [diff] [blame] | 386 | * <li> The default theme for applications is now the "device default" theme: |
| 387 | * {@link android.R.style#Theme_DeviceDefault}. This may be the |
| 388 | * holo dark theme or a different dark theme defined by the specific device. |
| 389 | * The {@link android.R.style#Theme_Holo} family must not be modified |
| 390 | * for a device to be considered compatible. Applications that explicitly |
| 391 | * request a theme from the Holo family will be guaranteed that these themes |
| 392 | * will not change character within the same platform version. Applications |
| 393 | * that wish to blend in with the device should use a theme from the |
| 394 | * {@link android.R.style#Theme_DeviceDefault} family. |
Dianne Hackborn | 9d0e37e | 2011-09-22 12:58:54 -0700 | [diff] [blame] | 395 | * <li> Managed cursors can now throw an exception if you directly close |
| 396 | * the cursor yourself without stopping the management of it; previously failures |
| 397 | * would be silently ignored. |
| 398 | * <li> The fadingEdge attribute on views will be ignored (fading edges is no |
| 399 | * longer a standard part of the UI). A new requiresFadingEdge attribute allows |
| 400 | * applications to still force fading edges on for special cases. |
Dianne Hackborn | 81e9276 | 2011-10-09 16:00:21 -0700 | [diff] [blame] | 401 | * <li> {@link android.content.Context#bindService Context.bindService()} |
| 402 | * will not automatically add in {@link android.content.Context#BIND_WAIVE_PRIORITY}. |
| 403 | * <li> App Widgets will have standard padding automatically added around |
| 404 | * them, rather than relying on the padding being baked into the widget itself. |
| 405 | * <li> An exception will be thrown if you try to change the type of a |
| 406 | * window after it has been added to the window manager. Previously this |
| 407 | * would result in random incorrect behavior. |
| 408 | * <li> {@link android.view.animation.AnimationSet} will parse out |
| 409 | * the duration, fillBefore, fillAfter, repeatMode, and startOffset |
| 410 | * XML attributes that are defined. |
| 411 | * <li> {@link android.app.ActionBar#setHomeButtonEnabled |
| 412 | * ActionBar.setHomeButtonEnabled()} is false by default. |
Dianne Hackborn | 2d6833b | 2011-06-24 16:04:19 -0700 | [diff] [blame] | 413 | * </ul> |
Dianne Hackborn | 3fc982f | 2011-03-30 16:20:26 -0700 | [diff] [blame] | 414 | */ |
Dianne Hackborn | 0784cfb | 2011-09-14 13:48:15 -0700 | [diff] [blame] | 415 | public static final int ICE_CREAM_SANDWICH = 14; |
Dianne Hackborn | f35fe23 | 2011-11-01 19:25:20 -0700 | [diff] [blame] | 416 | |
| 417 | /** |
Dianne Hackborn | 81e9276 | 2011-10-09 16:00:21 -0700 | [diff] [blame] | 418 | * December 2011: Android 4.0.3. |
Dianne Hackborn | f35fe23 | 2011-11-01 19:25:20 -0700 | [diff] [blame] | 419 | */ |
| 420 | public static final int ICE_CREAM_SANDWICH_MR1 = 15; |
Dianne Hackborn | 81e9276 | 2011-10-09 16:00:21 -0700 | [diff] [blame] | 421 | |
| 422 | /** |
Dianne Hackborn | 435cdb4 | 2012-07-30 17:36:43 -0700 | [diff] [blame] | 423 | * June 2012: Android 4.1. |
Dianne Hackborn | 6569625 | 2012-03-05 18:49:21 -0800 | [diff] [blame] | 424 | * |
| 425 | * <p>Applications targeting this or a later release will get these |
| 426 | * new changes in behavior:</p> |
| 427 | * <ul> |
Dianne Hackborn | 636fd52 | 2012-06-05 17:38:50 -0700 | [diff] [blame] | 428 | * <li> You must explicitly request the {@link android.Manifest.permission#READ_CALL_LOG} |
| 429 | * and/or {@link android.Manifest.permission#WRITE_CALL_LOG} permissions; |
| 430 | * access to the call log is no longer implicitly provided through |
| 431 | * {@link android.Manifest.permission#READ_CONTACTS} and |
| 432 | * {@link android.Manifest.permission#WRITE_CONTACTS}. |
| 433 | * <li> {@link android.widget.RemoteViews} will throw an exception if |
| 434 | * setting an onClick handler for views being generated by a |
| 435 | * {@link android.widget.RemoteViewsService} for a collection container; |
| 436 | * previously this just resulted in a warning log message. |
| 437 | * <li> New {@link android.app.ActionBar} policy for embedded tabs: |
| 438 | * embedded tabs are now always stacked in the action bar when in portrait |
| 439 | * mode, regardless of the size of the screen. |
| 440 | * <li> {@link android.webkit.WebSettings#setAllowFileAccessFromFileURLs(boolean) |
| 441 | * WebSettings.setAllowFileAccessFromFileURLs} and |
| 442 | * {@link android.webkit.WebSettings#setAllowUniversalAccessFromFileURLs(boolean) |
| 443 | * WebSettings.setAllowUniversalAccessFromFileURLs} default to false. |
Dianne Hackborn | 6569625 | 2012-03-05 18:49:21 -0800 | [diff] [blame] | 444 | * <li> Calls to {@link android.content.pm.PackageManager#setComponentEnabledSetting |
| 445 | * PackageManager.setComponentEnabledSetting} will now throw an |
| 446 | * IllegalArgumentException if the given component class name does not |
| 447 | * exist in the application's manifest. |
Dianne Hackborn | 636fd52 | 2012-06-05 17:38:50 -0700 | [diff] [blame] | 448 | * <li> {@link android.nfc.NfcAdapter#setNdefPushMessage |
| 449 | * NfcAdapter.setNdefPushMessage}, |
| 450 | * {@link android.nfc.NfcAdapter#setNdefPushMessageCallback |
| 451 | * NfcAdapter.setNdefPushMessageCallback} and |
| 452 | * {@link android.nfc.NfcAdapter#setOnNdefPushCompleteCallback |
| 453 | * NfcAdapter.setOnNdefPushCompleteCallback} will throw |
| 454 | * IllegalStateException if called after the Activity has been destroyed. |
| 455 | * <li> Accessibility services must require the new |
| 456 | * {@link android.Manifest.permission#BIND_ACCESSIBILITY_SERVICE} permission or |
| 457 | * they will not be available for use. |
| 458 | * <li> {@link android.accessibilityservice.AccessibilityServiceInfo#FLAG_INCLUDE_NOT_IMPORTANT_VIEWS |
| 459 | * AccessibilityServiceInfo.FLAG_INCLUDE_NOT_IMPORTANT_VIEWS} must be set |
| 460 | * for unimportant views to be included in queries. |
Dianne Hackborn | 6569625 | 2012-03-05 18:49:21 -0800 | [diff] [blame] | 461 | * </ul> |
Dianne Hackborn | 81e9276 | 2011-10-09 16:00:21 -0700 | [diff] [blame] | 462 | */ |
Dianne Hackborn | fa61f0b | 2012-05-09 21:49:38 -0700 | [diff] [blame] | 463 | public static final int JELLY_BEAN = 16; |
Dianne Hackborn | 435cdb4 | 2012-07-30 17:36:43 -0700 | [diff] [blame] | 464 | |
| 465 | /** |
Dianne Hackborn | fc49474 | 2012-09-27 16:15:42 -0700 | [diff] [blame] | 466 | * Android 4.2: Moar jelly beans! |
Nick Kralevich | f097b16 | 2012-07-28 12:43:48 -0700 | [diff] [blame] | 467 | * |
| 468 | * <p>Applications targeting this or a later release will get these |
| 469 | * new changes in behavior:</p> |
| 470 | * <ul> |
| 471 | * <li>Content Providers: The default value of {@code android:exported} is now |
| 472 | * {@code false}. See |
Nick Kralevich | 2caec6c | 2012-08-08 11:33:17 -0700 | [diff] [blame] | 473 | * <a href="{@docRoot}guide/topics/manifest/provider-element.html#exported"> |
Nick Kralevich | f097b16 | 2012-07-28 12:43:48 -0700 | [diff] [blame] | 474 | * the android:exported section</a> in the provider documentation for more details.</li> |
Dianne Hackborn | fc49474 | 2012-09-27 16:15:42 -0700 | [diff] [blame] | 475 | * <li>{@link android.view.View#getLayoutDirection() View.getLayoutDirection()} |
| 476 | * can return different values than {@link android.view.View#LAYOUT_DIRECTION_LTR} |
| 477 | * based on the locale etc. |
| 478 | * <li> {@link android.webkit.WebView#addJavascriptInterface(Object, String) |
| 479 | * WebView.addJavascriptInterface} requires explicit annotations on methods |
| 480 | * for them to be accessible from Javascript. |
Nick Kralevich | f097b16 | 2012-07-28 12:43:48 -0700 | [diff] [blame] | 481 | * </ul> |
Dianne Hackborn | 435cdb4 | 2012-07-30 17:36:43 -0700 | [diff] [blame] | 482 | */ |
| 483 | public static final int JELLY_BEAN_MR1 = 17; |
Nick Kralevich | a985c3b | 2013-01-09 16:03:14 -0800 | [diff] [blame] | 484 | |
| 485 | /** |
Dianne Hackborn | d2eeed6 | 2013-04-22 13:04:28 -0700 | [diff] [blame] | 486 | * Android 4.3: Jelly Bean MR2, the revenge of the beans. |
Nick Kralevich | a985c3b | 2013-01-09 16:03:14 -0800 | [diff] [blame] | 487 | */ |
Dianne Hackborn | d2eeed6 | 2013-04-22 13:04:28 -0700 | [diff] [blame] | 488 | public static final int JELLY_BEAN_MR2 = 18; |
Dianne Hackborn | 5d2bfa1 | 2013-03-05 10:28:34 -0800 | [diff] [blame] | 489 | |
| 490 | /** |
Dianne Hackborn | 6bc3789 | 2013-10-03 11:05:14 -0700 | [diff] [blame] | 491 | * Android 4.4: KitKat, another tasty treat. |
Dianne Hackborn | 221ea89 | 2013-08-04 16:50:16 -0700 | [diff] [blame] | 492 | * |
| 493 | * <p>Applications targeting this or a later release will get these |
| 494 | * new changes in behavior:</p> |
| 495 | * <ul> |
Dianne Hackborn | 6bc3789 | 2013-10-03 11:05:14 -0700 | [diff] [blame] | 496 | * <li> The default result of {android.preference.PreferenceActivity#isValidFragment |
| 497 | * PreferenceActivity.isValueFragment} becomes false instead of true.</li> |
| 498 | * <li> In {@link android.webkit.WebView}, apps targeting earlier versions will have |
| 499 | * JS URLs evaluated directly and any result of the evaluation will not replace |
| 500 | * the current page content. Apps targetting KITKAT or later that load a JS URL will |
| 501 | * have the result of that URL replace the content of the current page</li> |
| 502 | * <li> {@link android.app.AlarmManager#set AlarmManager.set} becomes interpreted as |
| 503 | * an inexact value, to give the system more flexibility in scheduling alarms.</li> |
| 504 | * <li> {@link android.content.Context#getSharedPreferences(String, int) |
| 505 | * Context.getSharedPreferences} no longer allows a null name.</li> |
| 506 | * <li> {@link android.widget.RelativeLayout} changes to compute wrapped content |
| 507 | * margins correctly.</li> |
| 508 | * <li> {@link android.app.ActionBar}'s window content overlay is allowed to be |
| 509 | * drawn.</li> |
Jeff Sharkey | 3ec2f60 | 2013-10-29 12:21:23 -0700 | [diff] [blame] | 510 | * <li>The {@link android.Manifest.permission#READ_EXTERNAL_STORAGE} |
| 511 | * permission is now always enforced.</li> |
| 512 | * <li>Access to package-specific external storage directories belonging |
| 513 | * to the calling app no longer requires the |
| 514 | * {@link android.Manifest.permission#READ_EXTERNAL_STORAGE} or |
| 515 | * {@link android.Manifest.permission#WRITE_EXTERNAL_STORAGE} |
| 516 | * permissions.</li> |
Dianne Hackborn | 221ea89 | 2013-08-04 16:50:16 -0700 | [diff] [blame] | 517 | * </ul> |
Dianne Hackborn | 5d2bfa1 | 2013-03-05 10:28:34 -0800 | [diff] [blame] | 518 | */ |
Dianne Hackborn | 6bc3789 | 2013-10-03 11:05:14 -0700 | [diff] [blame] | 519 | public static final int KITKAT = 19; |
Dianne Hackborn | 10ad982 | 2014-03-17 11:28:36 -0700 | [diff] [blame] | 520 | |
| 521 | /** |
Justin Koh | 78b94de | 2014-05-13 15:48:42 -0700 | [diff] [blame] | 522 | * Android 4.4W: KitKat for watches, snacks on the run. |
| 523 | * |
| 524 | * <p>Applications targeting this or a later release will get these |
| 525 | * new changes in behavior:</p> |
| 526 | * <ul> |
| 527 | * <li>{@link android.app.AlertDialog} might not have a default background if the theme does |
| 528 | * not specify one.</li> |
| 529 | * </ul> |
Jeff Brown | 1c3f332 | 2014-04-16 13:15:22 -0700 | [diff] [blame] | 530 | */ |
Justin Koh | 78b94de | 2014-05-13 15:48:42 -0700 | [diff] [blame] | 531 | public static final int KITKAT_WATCH = 20; |
Jeff Brown | 047f3c7 | 2014-04-16 14:18:49 -0700 | [diff] [blame] | 532 | |
| 533 | /** |
Dianne Hackborn | 10ad982 | 2014-03-17 11:28:36 -0700 | [diff] [blame] | 534 | * L! |
| 535 | * |
| 536 | * <p>Applications targeting this or a later release will get these |
| 537 | * new changes in behavior:</p> |
| 538 | * <ul> |
| 539 | * <li> {@link android.content.Context#bindService Context.bindService} now |
Michael Wright | 5b5def5 | 2014-04-11 13:37:50 -0700 | [diff] [blame] | 540 | * requires an explicit Intent, and will throw an exception if given an implicit |
Dianne Hackborn | 10ad982 | 2014-03-17 11:28:36 -0700 | [diff] [blame] | 541 | * Intent.</li> |
| 542 | * </ul> |
| 543 | */ |
| 544 | public static final int L = CUR_DEVELOPMENT; |
Dianne Hackborn | 851a541 | 2009-05-08 12:06:44 -0700 | [diff] [blame] | 545 | } |
| 546 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 547 | /** The type of build, like "user" or "eng". */ |
| 548 | public static final String TYPE = getString("ro.build.type"); |
| 549 | |
| 550 | /** Comma-separated tags describing the build, like "unsigned,debug". */ |
| 551 | public static final String TAGS = getString("ro.build.tags"); |
| 552 | |
| 553 | /** A string that uniquely identifies this build. Do not attempt to parse this value. */ |
Jeff Sharkey | 5568772 | 2014-04-09 18:07:19 -0700 | [diff] [blame] | 554 | public static final String FINGERPRINT = deriveFingerprint(); |
| 555 | |
| 556 | /** |
| 557 | * Some devices split the fingerprint components between multiple |
| 558 | * partitions, so we might derive the fingerprint at runtime. |
| 559 | */ |
| 560 | private static String deriveFingerprint() { |
| 561 | String finger = SystemProperties.get("ro.build.fingerprint"); |
| 562 | if (TextUtils.isEmpty(finger)) { |
| 563 | finger = getString("ro.product.brand") + '/' + |
| 564 | getString("ro.product.name") + '/' + |
| 565 | getString("ro.product.device") + ':' + |
| 566 | getString("ro.build.version.release") + '/' + |
| 567 | getString("ro.build.id") + '/' + |
| 568 | getString("ro.build.version.incremental") + ':' + |
| 569 | getString("ro.build.type") + '/' + |
| 570 | getString("ro.build.tags"); |
| 571 | } |
| 572 | return finger; |
| 573 | } |
| 574 | |
| 575 | /** |
| 576 | * Ensure that raw fingerprint system property is defined. If it was derived |
| 577 | * dynamically by {@link #deriveFingerprint()} this is where we push the |
| 578 | * derived value into the property service. |
| 579 | * |
| 580 | * @hide |
| 581 | */ |
| 582 | public static void ensureFingerprintProperty() { |
| 583 | if (TextUtils.isEmpty(SystemProperties.get("ro.build.fingerprint"))) { |
Jeff Sharkey | bdd4491 | 2014-04-11 16:30:14 -0700 | [diff] [blame] | 584 | try { |
| 585 | SystemProperties.set("ro.build.fingerprint", FINGERPRINT); |
| 586 | } catch (IllegalArgumentException e) { |
| 587 | Slog.e(TAG, "Failed to set fingerprint property", e); |
| 588 | } |
Jeff Sharkey | 5568772 | 2014-04-09 18:07:19 -0700 | [diff] [blame] | 589 | } |
| 590 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 591 | |
| 592 | // The following properties only make sense for internal engineering builds. |
| 593 | public static final long TIME = getLong("ro.build.date.utc") * 1000; |
| 594 | public static final String USER = getString("ro.build.user"); |
| 595 | public static final String HOST = getString("ro.build.host"); |
| 596 | |
Doug Zongker | ad2171a | 2011-06-14 11:07:24 -0700 | [diff] [blame] | 597 | /** |
Jeff Brown | 89101cd | 2011-10-27 21:24:54 -0700 | [diff] [blame] | 598 | * Returns true if we are running a debug build such as "user-debug" or "eng". |
| 599 | * @hide |
| 600 | */ |
| 601 | public static final boolean IS_DEBUGGABLE = |
| 602 | SystemProperties.getInt("ro.debuggable", 0) == 1; |
| 603 | |
| 604 | /** |
Doug Zongker | ad2171a | 2011-06-14 11:07:24 -0700 | [diff] [blame] | 605 | * Returns the version string for the radio firmware. May return |
| 606 | * null (if, for instance, the radio is not currently on). |
| 607 | */ |
| 608 | public static String getRadioVersion() { |
| 609 | return SystemProperties.get(TelephonyProperties.PROPERTY_BASEBAND_VERSION, null); |
| 610 | } |
| 611 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 612 | private static String getString(String property) { |
| 613 | return SystemProperties.get(property, UNKNOWN); |
| 614 | } |
| 615 | |
Torne (Richard Coles) | ff701a6 | 2014-07-30 12:11:15 +0100 | [diff] [blame] | 616 | private static String[] getStringList(String property, String separator) { |
| 617 | String value = SystemProperties.get(property); |
| 618 | if (value.isEmpty()) { |
| 619 | return new String[0]; |
| 620 | } else { |
| 621 | return value.split(separator); |
| 622 | } |
| 623 | } |
| 624 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 625 | private static long getLong(String property) { |
| 626 | try { |
| 627 | return Long.parseLong(SystemProperties.get(property)); |
| 628 | } catch (NumberFormatException e) { |
| 629 | return -1; |
| 630 | } |
| 631 | } |
| 632 | } |