aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--device.h3
-rw-r--r--recovery.cpp4
2 files changed, 6 insertions, 1 deletions
diff --git a/device.h b/device.h
index f74b6b0..393b507 100644
--- a/device.h
+++ b/device.h
@@ -102,6 +102,9 @@ class Device {
virtual bool PreWipeData() { return true; }
virtual bool PostWipeData() { return true; }
+ // Called before reboot
+ virtual char const* GetRebootReason() { return ""; }
+
private:
RecoveryUI* ui_;
};
diff --git a/recovery.cpp b/recovery.cpp
index b7a5458..5923c81 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -1110,8 +1110,10 @@ main(int argc, char **argv) {
break;
default:
+ char reason[PROPERTY_VALUE_MAX];
+ snprintf(reason, PROPERTY_VALUE_MAX, "reboot,%s", device->GetRebootReason());
ui->Print("Rebooting...\n");
- property_set(ANDROID_RB_PROPERTY, "reboot,");
+ property_set(ANDROID_RB_PROPERTY, reason);
break;
}
sleep(5); // should reboot before this finishes