Merge "Add option to use ro.serialno for generating device id" into android-9.0
This commit is contained in:
@@ -315,6 +315,9 @@ WITH_CRYPTO_UTILS := \
|
||||
ifeq ($(TW_USE_MODEL_HARDWARE_ID_FOR_DEVICE_ID), true)
|
||||
LOCAL_CFLAGS += -DTW_USE_MODEL_HARDWARE_ID_FOR_DEVICE_ID
|
||||
endif
|
||||
ifeq ($(TW_USE_SERIALNO_PROPERTY_FOR_DEVICE_ID), true)
|
||||
LOCAL_CFLAGS += -DTW_USE_SERIALNO_PROPERTY_FOR_DEVICE_ID
|
||||
endif
|
||||
ifneq ($(TW_BRIGHTNESS_PATH),)
|
||||
LOCAL_CFLAGS += -DTW_BRIGHTNESS_PATH=$(TW_BRIGHTNESS_PATH)
|
||||
endif
|
||||
|
||||
@@ -146,6 +146,16 @@ void DataManager::get_device_id(void) {
|
||||
#endif
|
||||
|
||||
#ifndef TW_FORCE_CPUINFO_FOR_DEVICE_ID
|
||||
#ifdef TW_USE_SERIALNO_PROPERTY_FOR_DEVICE_ID
|
||||
// Check serial number system property
|
||||
if (property_get("ro.serialno", line, "")) {
|
||||
snprintf(device_id, DEVID_MAX, "%s", line);
|
||||
sanitize_device_id(device_id);
|
||||
mConst.SetValue("device_id", device_id);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Check the cmdline to see if the serial number was supplied
|
||||
fp = fopen("/proc/cmdline", "rt");
|
||||
if (fp != NULL) {
|
||||
|
||||
Reference in New Issue
Block a user