From 7b0ad9c638176dc364dabb65b363536055a0ea9c Mon Sep 17 00:00:00 2001 From: Tianjie Xu Date: Fri, 5 Aug 2016 18:00:04 -0700 Subject: Switch recovery to libbase logging Clean up the recovery image and switch to libbase logging. Bug: 28191554 Change-Id: Icd999c3cc832f0639f204b5c36cea8afe303ad35 Merged-In: Icd999c3cc832f0639f204b5c36cea8afe303ad35 --- common.h | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'common.h') diff --git a/common.h b/common.h index de8b409fd..a948fb1a0 100644 --- a/common.h +++ b/common.h @@ -21,18 +21,6 @@ #include #include -#define LOGE(...) ui_print("E:" __VA_ARGS__) -#define LOGW(...) fprintf(stdout, "W:" __VA_ARGS__) -#define LOGI(...) fprintf(stdout, "I:" __VA_ARGS__) - -#if 0 -#define LOGV(...) fprintf(stdout, "V:" __VA_ARGS__) -#define LOGD(...) fprintf(stdout, "D:" __VA_ARGS__) -#else -#define LOGV(...) do {} while (0) -#define LOGD(...) do {} while (0) -#endif - #define STRINGIFY(x) #x #define EXPAND(x) STRINGIFY(x) -- cgit v1.2.3 From c0319b60f56d445c2d1c74f551e01f069b028fe6 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Thu, 13 Oct 2016 15:17:04 -0700 Subject: Some cleanups to recovery. - Remove the duplicate gCurrentUI variable in recovery.cpp; - Refactor the load/save of locale functions; - Clean up ui_print() to get rid of 256-byte buffer limit; - Declare ui in common.h; - Move the typedef of Volume into roots.h. Test: Build and boot into recovery image. Change-Id: Ia28c116858ca754133127a5ff9c722af67ad55b7 --- common.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'common.h') diff --git a/common.h b/common.h index a948fb1a0..f10fe6735 100644 --- a/common.h +++ b/common.h @@ -17,15 +17,16 @@ #ifndef RECOVERY_COMMON_H #define RECOVERY_COMMON_H -#include #include #include #define STRINGIFY(x) #x #define EXPAND(x) STRINGIFY(x) +class RecoveryUI; + +extern RecoveryUI* ui; extern bool modified_flash; -typedef struct fstab_rec Volume; // fopen a file, mounting volumes and making parent dirs as necessary. FILE* fopen_path(const char *path, const char *mode); -- cgit v1.2.3 From 8584fcf677dd45b30121bd0490b06297e6be1871 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Thu, 27 Oct 2016 03:08:08 +0000 Subject: Revert "Some cleanups to recovery." This reverts commit c0319b60f56d445c2d1c74f551e01f069b028fe6. Reason for revert: Broke builds. Change-Id: I82aa880b83de5ae6c36fd7567cb001920559a972 --- common.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'common.h') diff --git a/common.h b/common.h index f10fe6735..a948fb1a0 100644 --- a/common.h +++ b/common.h @@ -17,16 +17,15 @@ #ifndef RECOVERY_COMMON_H #define RECOVERY_COMMON_H +#include #include #include #define STRINGIFY(x) #x #define EXPAND(x) STRINGIFY(x) -class RecoveryUI; - -extern RecoveryUI* ui; extern bool modified_flash; +typedef struct fstab_rec Volume; // fopen a file, mounting volumes and making parent dirs as necessary. FILE* fopen_path(const char *path, const char *mode); -- cgit v1.2.3 From ac9d94d19c5f0e8c769d2368790df679c665ea34 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Thu, 3 Nov 2016 11:37:15 -0700 Subject: Revert "Revert "Some cleanups to recovery."" This reverts commit 8584fcf677dd45b30121bd0490b06297e6be1871. This CL re-lands commit c0319b60f56d445c2d1c74f551e01f069b028fe6. The "stage" and "reason" variables are now declared as global by dropping the static qualifier, because they may be used by vendor recovery libraries. Test: lunch aosp_angler-userdebug; mmma bootable/recovery Test: lunch aosp_dragon-userdebug; mmma bootable/recovery Change-Id: I252c346f450079478cff22bbff01590b8ab2e2b3 --- common.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'common.h') diff --git a/common.h b/common.h index a948fb1a0..319af3d72 100644 --- a/common.h +++ b/common.h @@ -17,15 +17,22 @@ #ifndef RECOVERY_COMMON_H #define RECOVERY_COMMON_H -#include #include #include #define STRINGIFY(x) #x #define EXPAND(x) STRINGIFY(x) +class RecoveryUI; + +extern RecoveryUI* ui; extern bool modified_flash; -typedef struct fstab_rec Volume; + +// The current stage, e.g. "1/2". +extern const char* stage; + +// The reason argument provided in "--reason=". +extern const char* reason; // fopen a file, mounting volumes and making parent dirs as necessary. FILE* fopen_path(const char *path, const char *mode); -- cgit v1.2.3 From a8d72bc3b4087632e8cdad95e8355a2495e15690 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Sun, 25 Dec 2016 18:46:50 -0800 Subject: recovery: Drop the "--stages" / '-g' argument. This was introduced in commit c87bab101893e8322b49d7c8600e3367b20ab50a. But the stage info should be passed through BCB only (there's a dedicated field in struct bootloader_message). This CL removes it from recovery arguments, and also moves 'stage' variable to std::string. Test: 'stage' variable is not used by any device-specific recovery code. Test: Code search shows no hit of '--stages' use. Change-Id: Iccbde578a13255f2b55dd4a928e9ecf487f16b97 --- common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common.h') diff --git a/common.h b/common.h index 319af3d72..3e5f5476f 100644 --- a/common.h +++ b/common.h @@ -29,7 +29,7 @@ extern RecoveryUI* ui; extern bool modified_flash; // The current stage, e.g. "1/2". -extern const char* stage; +extern std::string stage; // The reason argument provided in "--reason=". extern const char* reason; -- cgit v1.2.3 From ed4a537bf0494f39ee76f4bf5c31cf9fd4c5eb03 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Tue, 7 Mar 2017 13:32:30 -0800 Subject: recovery: Add the missing #include. Although I checked there's no reference to 'stage' in device-specific recovery codes (for commit a8d72bc3b4087632e8cdad95e8355a2495e15690), it's insufficient to capture the missing #include issue. Test: lunch aosp_dragon-userdebug; mmma bootable/recovery Change-Id: I4c5dbe9acf38918491c3aa776ce358be03f9ecca --- common.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'common.h') diff --git a/common.h b/common.h index 3e5f5476f..bda793599 100644 --- a/common.h +++ b/common.h @@ -20,6 +20,8 @@ #include #include +#include + #define STRINGIFY(x) #x #define EXPAND(x) STRINGIFY(x) -- cgit v1.2.3 From ed9db0fd73f0368be354a65d7bdc3de5d01bdc88 Mon Sep 17 00:00:00 2001 From: Dmitri Plotnikov Date: Tue, 18 Apr 2017 08:28:26 -0700 Subject: Adding support for quiescent reboot to recovery Bug: 37401320 Test: build and push OTA and hit adb reboot recovery,quiescent. The screen should remain off throughout the upgrade process. (cherry picked from commit 8706a98aa635236a95795f0a0c122bb3e591a50d) Change-Id: I79789a151f6faafda8ecc6198c2182cc2a91da70 --- common.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'common.h') diff --git a/common.h b/common.h index bda793599..62fb1324b 100644 --- a/common.h +++ b/common.h @@ -43,4 +43,6 @@ void ui_print(const char* format, ...); bool is_ro_debuggable(); +bool reboot(const std::string& command); + #endif // RECOVERY_COMMON_H -- cgit v1.2.3