diff options
author | Vojtech Bocek <vbocek@gmail.com> | 2014-07-04 01:09:50 +0200 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit> | 2014-07-09 15:57:09 +0200 |
commit | 0fc157373073708a2eb1106001d4dc31b64dab6b (patch) | |
tree | 649912eb99b72a6f3349f460cde4784ace3a4930 | |
parent | Fix setting of brightness during startup (diff) | |
download | android_bootable_recovery-0fc157373073708a2eb1106001d4dc31b64dab6b.tar android_bootable_recovery-0fc157373073708a2eb1106001d4dc31b64dab6b.tar.gz android_bootable_recovery-0fc157373073708a2eb1106001d4dc31b64dab6b.tar.bz2 android_bootable_recovery-0fc157373073708a2eb1106001d4dc31b64dab6b.tar.lz android_bootable_recovery-0fc157373073708a2eb1106001d4dc31b64dab6b.tar.xz android_bootable_recovery-0fc157373073708a2eb1106001d4dc31b64dab6b.tar.zst android_bootable_recovery-0fc157373073708a2eb1106001d4dc31b64dab6b.zip |
Diffstat (limited to '')
-rw-r--r-- | twrp.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -78,6 +78,13 @@ int main(int argc, char **argv) { return 0; } + char crash_prop_val[PROPERTY_VALUE_MAX]; + int crash_counter; + property_get("twrp.crash_counter", crash_prop_val, "-1"); + crash_counter = atoi(crash_prop_val) + 1; + snprintf(crash_prop_val, sizeof(crash_prop_val), "%d", crash_counter); + property_set("twrp.crash_counter", crash_prop_val); + time_t StartupTime = time(NULL); printf("Starting TWRP %s on %s", TW_VERSION_STR, ctime(&StartupTime)); @@ -204,14 +211,14 @@ int main(int argc, char **argv) { } } } + printf("\n"); } - char twrp_booted[PROPERTY_VALUE_MAX]; - property_get("ro.twrp.boot", twrp_booted, "0"); - if (strcmp(twrp_booted, "0") == 0) { + if(crash_counter == 0) { property_list(Print_Prop, NULL); printf("\n"); - property_set("ro.twrp.boot", "1"); + } else { + printf("twrp.crash_counter=%d\n", crash_counter); } // Check for and run startup script if script exists |