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