diff options
author | Elliott Hughes <enh@google.com> | 2015-02-11 00:55:44 +0100 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-02-11 00:55:45 +0100 |
commit | 35efcd275f90f5ffea371bb228a14b36c50e61d3 (patch) | |
tree | 5fc39fefa4022fa75857792dd517a9a14f60256c /recovery.cpp | |
parent | Merge "Remove dead/unused code and realign some of the comments to make it more cleaner and easier to read" (diff) | |
parent | recovery: Properly detect userdebug or eng builds (diff) | |
download | android_bootable_recovery-35efcd275f90f5ffea371bb228a14b36c50e61d3.tar android_bootable_recovery-35efcd275f90f5ffea371bb228a14b36c50e61d3.tar.gz android_bootable_recovery-35efcd275f90f5ffea371bb228a14b36c50e61d3.tar.bz2 android_bootable_recovery-35efcd275f90f5ffea371bb228a14b36c50e61d3.tar.lz android_bootable_recovery-35efcd275f90f5ffea371bb228a14b36c50e61d3.tar.xz android_bootable_recovery-35efcd275f90f5ffea371bb228a14b36c50e61d3.tar.zst android_bootable_recovery-35efcd275f90f5ffea371bb228a14b36c50e61d3.zip |
Diffstat (limited to 'recovery.cpp')
-rw-r--r-- | recovery.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/recovery.cpp b/recovery.cpp index 7f17b16ef..d8756d7ce 100644 --- a/recovery.cpp +++ b/recovery.cpp @@ -161,6 +161,11 @@ fopen_path(const char *path, const char *mode) { return fp; } +bool is_ro_debuggable() { + char value[PROPERTY_VALUE_MAX+1]; + return (property_get("ro.debuggable", value, NULL) == 1 && value[0] == '1'); +} + // close a file, log an error if the error indicator is set static void check_and_fclose(FILE *fp, const char *name) { @@ -954,9 +959,7 @@ main(int argc, char **argv) { // If this is an eng or userdebug build, then automatically // turn the text display on if the script fails so the error // message is visible. - char buffer[PROPERTY_VALUE_MAX+1]; - property_get("ro.build.fingerprint", buffer, ""); - if (strstr(buffer, ":userdebug/") || strstr(buffer, ":eng/")) { + if (is_ro_debuggable()) { ui->ShowText(true); } } |