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