summaryrefslogtreecommitdiffstats
path: root/twrp.cpp
diff options
context:
space:
mode:
authorVojtech Bocek <vbocek@gmail.com>2014-07-04 01:09:50 +0200
committerGerrit Code Review <gerrit2@gerrit>2014-07-09 15:57:09 +0200
commit0fc157373073708a2eb1106001d4dc31b64dab6b (patch)
tree649912eb99b72a6f3349f460cde4784ace3a4930 /twrp.cpp
parentFix setting of brightness during startup (diff)
downloadandroid_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.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/twrp.cpp b/twrp.cpp
index dda84ddae..b67631ea8 100644
--- a/twrp.cpp
+++ b/twrp.cpp
@@ -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