summaryrefslogtreecommitdiffstats
path: root/data.cpp
diff options
context:
space:
mode:
authorlambdadroid <lambdadroid@gmail.com>2017-08-04 17:16:53 +0200
committerlambdadroid <lambdadroid@gmail.com>2018-09-26 23:53:28 +0200
commitfc0b16df8ba6a4d79e4cc8ad598e1d59a8ac4fda (patch)
tree85bda5c58d67531ab0c140a79bda753058df3a75 /data.cpp
parentFix header file for property_get (diff)
downloadandroid_bootable_recovery-fc0b16df8ba6a4d79e4cc8ad598e1d59a8ac4fda.tar
android_bootable_recovery-fc0b16df8ba6a4d79e4cc8ad598e1d59a8ac4fda.tar.gz
android_bootable_recovery-fc0b16df8ba6a4d79e4cc8ad598e1d59a8ac4fda.tar.bz2
android_bootable_recovery-fc0b16df8ba6a4d79e4cc8ad598e1d59a8ac4fda.tar.lz
android_bootable_recovery-fc0b16df8ba6a4d79e4cc8ad598e1d59a8ac4fda.tar.xz
android_bootable_recovery-fc0b16df8ba6a4d79e4cc8ad598e1d59a8ac4fda.tar.zst
android_bootable_recovery-fc0b16df8ba6a4d79e4cc8ad598e1d59a8ac4fda.zip
Diffstat (limited to 'data.cpp')
-rw-r--r--data.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/data.cpp b/data.cpp
index 4dfbde2d0..978cefea0 100644
--- a/data.cpp
+++ b/data.cpp
@@ -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) {