android.os.Build common constants

Keywords: Android Google SDK MIUI

When doing a project, it is often necessary to collect some equipment information, but it is not often used, so sometimes it will query which interface the requirements meet, so it will be sorted out at the weekend

Build.ID; //Either a changelist number, or a label like "M4-rc20".
Build.DISPLAY; //A build ID string meant for displaying to the user(Set up-About cell phones-Version No)
Build.PRODUCT; //The name of the overall product.(Name of the entire product)
Build.DEVICE; //The name of the industrial design.(Name of industrial design--Equipment name)
Build.BOARD; //The name of the underlying board, like "goldfish".(Motherboard name)
Build.MANUFACTURER; //The manufacturer of the product/hardware.(Hardware manufacturer)
Build.BRAND; //The consumer-visible brand with which the product/hardware will be associated, if any.(Equipment brand)
Build.MODEL; //The end-user-visible name for the end product.(Device models visible to end users)
Build.BOOTLOADER; //The system bootloader version number.(Version number of system program)
Build.HARDWARE; // The name of the hardware (from the kernel command line or /proc).(Hardware name)
Build.SERIAL; // A hardware serial number, if available.Alphanumeric only, case-insensitive.(Hardware serial number)
Build.TYPE; //The type of build, like "user" or "eng".(Device version type)
Build.TAGS; //Comma-separated tags describing the build, like "unsigned,debug".(Device label, unsigned/Test)
/** A string that uniquely identifies this build.  Do not attempt to parse this value.
         * The unique mark of equipment is made up of multiple equipment information of build
         * getString("ro.product.brand") + '/' +//BRAND
         * getString("ro.product.name") + '/' +//PRODUCT
         * getString("ro.product.device") + ':' +//DEVICE
         * getString("ro.build.version.release") + '/' +//VERSION.RELEASE
         * getString("ro.build.id") + '/' +//ID
         * getString("ro.build.version.incremental") + ':' +//VERSION.INCREMENTAL
         * getString("ro.build.type") + '/' +//TYPE
         * getString("ro.build.tags")
         * */
Build.FINGERPRINT;

// The following properties only make sense for internal engineering builds.
//mainforEngineer debug version
Build.HOST;
Build.USER;
Build.TIME;

Build.VERSION.INCREMENTAL; //The internal value used by the underlying source control to represent this build.E.g., a perforce changelist number or a git hash.
Build.VERSION.SDK_INT; //The user-visible SDK version of the framework;
  * its possible  values are defined in {@link Build.VERSION_CODES}.
Build.VERSION.CODENAME //The current development codename, or the string "REL" if this is a release build.
Build.VERSION.RELEASE; //The user-visible version string.  E.g., "1.0" or "3.4b5". (Android SDK version)
Build.VERSION.BASE_OS; //The base OS build the product is based on.

In addition, the return result of Build.TYPE indicates:

User refers to user version, with limited access rights, suitable for product environment; adb is off by default
 User debug, similar to user, has root and debug permissions;
eng means engineer version, which can be debugged; adb is on by default

Looking at the English description sometimes does not determine whether the returned value meets your own needs. Therefore, a test case is written for this purpose, and the returned result is viewed. Looking at the result, the description will be clearer

Here is the test result returned on a google nexus5 jieguo

12-23 12:56:32.511 I/android.os.Build#ID: (29436): M4B30Z
12-23 12:56:32.511 I/android.os.Build#DISPLAY: (29436): M4B30Z
12-23 12:56:32.511 I/android.os.Build#PRODUCT: (29436): hammerhead
12-23 12:56:32.511 I/android.os.Build#DEVICE: (29436): hammerhead
12-23 12:56:32.511 I/android.os.Build#BOARD: (29436): hammerhead
12-23 12:56:32.511 I/android.os.Build#MANUFACTURER: (29436): LGE
12-23 12:56:32.511 I/android.os.Build#BRAND: (29436): google
12-23 12:56:32.511 I/android.os.Build#MODEL: (29436): Nexus 5
12-23 12:56:32.511 I/android.os.Build#BOOTLOADER: (29436): HHZ20h
12-23 12:56:32.511 I/android.os.Build#HARDWARE: (29436): hammerhead
12-23 12:56:32.511 I/android.os.Build#SERIAL: (29436): 037abc3e09318c78
12-23 12:56:32.511 I/android.os.Build#TYPE: (29436): user
12-23 12:56:32.511 I/android.os.Build#TAGS: (29436): release-keys
12-23 12:56:32.511 I/android.os.Build#FINGERPRINT: (29436): google/hammerhead/hammerhead:6.0.1/M4B30Z/3437181:user/release-keys
12-23 12:56:32.511 I/android.os.Build#HOST: (29436): wpdu6.hot.corp.google.com
12-23 12:56:32.511 I/android.os.Build#USER: (29436): android-build
12-23 12:56:32.512 I/android.os.Build#TIME: (29436): 1478203422000
12-23 12:56:32.512 I/android.os.Build#VERSION.INCREMENTAL: (29436): 3437181
12-23 12:56:32.512 I/android.os.Build#VERSION.SDK_INT: (29436): 23
12-23 12:56:32.512 I/android.os.Build#VERSION.CODENAME: (29436): REL
12-23 12:56:32.512 I/android.os.Build#VERSION.RELEASE: (29436): 6.0.1

Here is the result returned on a native system of M 6

12-23 05:18:00.959 I/android.os.Build#ID: (10108): OPR1.170623.027
12-23 05:18:00.959 I/android.os.Build#DISPLAY: (10108): sagit-eng 8.0.0 OPR1.170623.027 2017.12.20_aosp-debug test-keys
12-23 05:18:00.959 I/android.os.Build#PRODUCT: (10108): sagit
12-23 05:18:00.959 I/android.os.Build#DEVICE: (10108): sagit
12-23 05:18:00.960 I/android.os.Build#BOARD: (10108): msm8998
12-23 05:18:00.960 I/android.os.Build#MANUFACTURER: (10108): Xiaomi
12-23 05:18:00.960 I/android.os.Build#BRAND: (10108): Xiaomi
12-23 05:18:00.960 I/android.os.Build#MODEL: (10108): MI 6
12-23 05:18:00.960 I/android.os.Build#BOOTLOADER: (10108): unknown
12-23 05:18:00.960 I/android.os.Build#HARDWARE: (10108): qcom
12-23 05:18:00.960 I/android.os.Build#SERIAL: (10108): c3b4ba0d
12-23 05:18:00.960 I/android.os.Build#TYPE: (10108): eng
12-23 05:18:00.960 I/android.os.Build#TAGS: (10108): test-keys
12-23 05:18:00.960 I/android.os.Build#FINGERPRINT: (10108): Xiaomi/sagit/sagit:8.0.0/OPR1.170623.027/2017.12.20_aosp-debug:eng/test-keys
12-23 05:18:00.960 I/android.os.Build#HOST: (10108): c3-miui-sdk-fe01.bj
12-23 05:18:00.960 I/android.os.Build#USER: (10108): work
12-23 05:18:00.960 I/android.os.Build#TIME: (10108): 1513737970000
12-23 05:18:00.960 I/android.os.Build#VERSION.INCREMENTAL: (10108): 2017.12.20_aosp-debug
12-23 05:18:00.960 I/android.os.Build#VERSION.SDK_INT: (10108): 26
12-23 05:18:00.960 I/android.os.Build#VERSION.CODENAME: (10108): REL
12-23 05:18:00.960 I/android.os.Build#VERSION.RELEASE: (10108): 8.0.0
12-23 05:18:00.960 I/android.os.Build#VERSION.BASE_OS: (10108): 

Here is the result returned on a MIUI system

12-23 12:55:05.725 I/android.os.Build#ID: (16606): MMB29M
12-23 12:55:05.725 I/android.os.Build#DISPLAY: (16606): MMB29M test-keys
12-23 12:55:05.725 I/android.os.Build#PRODUCT: (16606): cancro
12-23 12:55:05.725 I/android.os.Build#DEVICE: (16606): cancro
12-23 12:55:05.725 I/android.os.Build#BOARD: (16606): MSM8974
12-23 12:55:05.725 I/android.os.Build#MANUFACTURER: (16606): Xiaomi
12-23 12:55:05.725 I/android.os.Build#BRAND: (16606): Xiaomi
12-23 12:55:05.725 I/android.os.Build#MODEL: (16606): MI 3W
12-23 12:55:05.725 I/android.os.Build#BOOTLOADER: (16606): unknown
12-23 12:55:05.725 I/android.os.Build#HARDWARE: (16606): qcom
12-23 12:55:05.725 I/android.os.Build#SERIAL: (16606): 584db4
12-23 12:55:05.725 I/android.os.Build#TYPE: (16606): user
12-23 12:55:05.725 I/android.os.Build#TAGS: (16606): test-keys
12-23 12:55:05.725 I/android.os.Build#FINGERPRINT: (16606): Xiaomi/cancro/cancro:6.0.1/MMB29M/7.12.16:user/test-keys
12-23 12:55:05.725 I/android.os.Build#HOST: (16606): c3-miui-ota-bd122.bj
12-23 12:55:05.725 I/android.os.Build#USER: (16606): builder
12-23 12:55:05.725 I/android.os.Build#TIME: (16606): 1513410304000
12-23 12:55:05.727 I/android.os.Build#VERSION.INCREMENTAL: (16606): 7.12.16
12-23 12:55:05.727 I/android.os.Build#VERSION.SDK_INT: (16606): 23
12-23 12:55:05.727 I/android.os.Build#VERSION.CODENAME: (16606): REL
12-23 12:55:05.727 I/android.os.Build#VERSION.RELEASE: (16606): 6.0.1

Posted by jkrettek on Mon, 04 May 2020 21:33:27 -0700