Fields Summary |
---|
private static final String | TAG |
public static final String | UNKNOWNValue used for when a build property is unknown. |
public static final String | IDEither a changelist number, or a label like "M4-rc20". |
public static final String | DISPLAYA build ID string meant for displaying to the user |
public static final String | PRODUCTThe name of the overall product. |
public static final String | DEVICEThe name of the industrial design. |
public static final String | BOARDThe name of the underlying board, like "goldfish". |
public static final String | CPU_ABIThe name of the instruction set (CPU type + ABI convention) of native code. |
public static final String | CPU_ABI2The name of the second instruction set (CPU type + ABI convention) of native code. |
public static final String | MANUFACTURERThe manufacturer of the product/hardware. |
public static final String | BRANDThe consumer-visible brand with which the product/hardware will be associated, if any. |
public static final String | MODELThe end-user-visible name for the end product. |
public static final String | BOOTLOADERThe system bootloader version number. |
public static final String | RADIOThe radio firmware version number. |
public static final String | HARDWAREThe name of the hardware (from the kernel command line or /proc). |
public static final String | SERIALA hardware serial number, if available. Alphanumeric only, case-insensitive. |
public static final String[] | SUPPORTED_ABISAn ordered list of ABIs supported by this device. The most preferred ABI is the first
element in the list.
See {@link #SUPPORTED_32_BIT_ABIS} and {@link #SUPPORTED_64_BIT_ABIS}. |
public static final String[] | SUPPORTED_32_BIT_ABISAn ordered list of 32 bit ABIs supported by this device. The most preferred ABI
is the first element in the list.
See {@link #SUPPORTED_ABIS} and {@link #SUPPORTED_64_BIT_ABIS}. |
public static final String[] | SUPPORTED_64_BIT_ABISAn ordered list of 64 bit ABIs supported by this device. The most preferred ABI
is the first element in the list.
See {@link #SUPPORTED_ABIS} and {@link #SUPPORTED_32_BIT_ABIS}. |
public static final String | TYPEThe type of build, like "user" or "eng". |
public static final String | TAGSComma-separated tags describing the build, like "unsigned,debug". |
public static final String | FINGERPRINTA string that uniquely identifies this build. Do not attempt to parse this value. |
public static final long | TIME |
public static final String | USER |
public static final String | HOST |
public static final boolean | IS_DEBUGGABLEReturns true if we are running a debug build such as "user-debug" or "eng". |
Methods Summary |
---|
private static java.lang.String | deriveFingerprint()Some devices split the fingerprint components between multiple
partitions, so we might derive the fingerprint at runtime.
String finger = SystemProperties.get("ro.build.fingerprint");
if (TextUtils.isEmpty(finger)) {
finger = getString("ro.product.brand") + '/" +
getString("ro.product.name") + '/" +
getString("ro.product.device") + ':" +
getString("ro.build.version.release") + '/" +
getString("ro.build.id") + '/" +
getString("ro.build.version.incremental") + ':" +
getString("ro.build.type") + '/" +
getString("ro.build.tags");
}
return finger;
|
public static void | ensureFingerprintProperty()Ensure that raw fingerprint system property is defined. If it was derived
dynamically by {@link #deriveFingerprint()} this is where we push the
derived value into the property service.
if (TextUtils.isEmpty(SystemProperties.get("ro.build.fingerprint"))) {
try {
SystemProperties.set("ro.build.fingerprint", FINGERPRINT);
} catch (IllegalArgumentException e) {
Slog.e(TAG, "Failed to set fingerprint property", e);
}
}
|
private static long | getLong(java.lang.String property)
try {
return Long.parseLong(SystemProperties.get(property));
} catch (NumberFormatException e) {
return -1;
}
|
public static java.lang.String | getRadioVersion()Returns the version string for the radio firmware. May return
null (if, for instance, the radio is not currently on).
return SystemProperties.get(TelephonyProperties.PROPERTY_BASEBAND_VERSION, null);
|
private static java.lang.String | getString(java.lang.String property)
return SystemProperties.get(property, UNKNOWN);
|
private static java.lang.String[] | getStringList(java.lang.String property, java.lang.String separator)
String value = SystemProperties.get(property);
if (value.isEmpty()) {
return new String[0];
} else {
return value.split(separator);
}
|
public static boolean | isFingerprintConsistent()Check that device fingerprint is defined and that it matches across
various partitions.
final String system = SystemProperties.get("ro.build.fingerprint");
final String vendor = SystemProperties.get("ro.vendor.build.fingerprint");
if (TextUtils.isEmpty(system)) {
Slog.e(TAG, "Required ro.build.fingerprint is empty!");
return false;
}
if (!TextUtils.isEmpty(vendor)) {
if (!Objects.equals(system, vendor)) {
Slog.e(TAG, "Mismatched fingerprints; system reported " + system
+ " but vendor reported " + vendor);
return false;
}
}
return true;
|