aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTianjie Xu2016-08-05 20:00:04 -0500
committerTianjie Xu2016-09-01 13:33:25 -0500
commit7b0ad9c638176dc364dabb65b363536055a0ea9c (patch)
tree73848b33067169c72788f517063c3d9659e783c0 /update_verifier
parent818394869d36b9db1bf4984585a062d4bb91310f (diff)
downloadplatform-bootable-recovery-7b0ad9c638176dc364dabb65b363536055a0ea9c.tar.gz
platform-bootable-recovery-7b0ad9c638176dc364dabb65b363536055a0ea9c.tar.xz
platform-bootable-recovery-7b0ad9c638176dc364dabb65b363536055a0ea9c.zip
Switch recovery to libbase logging
Clean up the recovery image and switch to libbase logging. Bug: 28191554 Change-Id: Icd999c3cc832f0639f204b5c36cea8afe303ad35 Merged-In: Icd999c3cc832f0639f204b5c36cea8afe303ad35
Diffstat (limited to 'update_verifier')
-rw-r--r--update_verifier/Android.mk2
-rw-r--r--update_verifier/update_verifier.cpp16
2 files changed, 8 insertions, 10 deletions
diff --git a/update_verifier/Android.mk b/update_verifier/Android.mk
index 7f28bced..ed61c7bc 100644
--- a/update_verifier/Android.mk
+++ b/update_verifier/Android.mk
@@ -19,6 +19,6 @@ include $(CLEAR_VARS)
19LOCAL_CLANG := true 19LOCAL_CLANG := true
20LOCAL_SRC_FILES := update_verifier.cpp 20LOCAL_SRC_FILES := update_verifier.cpp
21LOCAL_MODULE := update_verifier 21LOCAL_MODULE := update_verifier
22LOCAL_SHARED_LIBRARIES := libhardware liblog 22LOCAL_SHARED_LIBRARIES := libhardware libbase
23 23
24include $(BUILD_EXECUTABLE) 24include $(BUILD_EXECUTABLE)
diff --git a/update_verifier/update_verifier.cpp b/update_verifier/update_verifier.cpp
index be70cec7..0a040c56 100644
--- a/update_verifier/update_verifier.cpp
+++ b/update_verifier/update_verifier.cpp
@@ -35,19 +35,17 @@
35 35
36#include <string.h> 36#include <string.h>
37 37
38#include <android-base/logging.h>
38#include <hardware/boot_control.h> 39#include <hardware/boot_control.h>
39 40
40#define LOG_TAG "update_verifier"
41#include <log/log.h>
42
43int main(int argc, char** argv) { 41int main(int argc, char** argv) {
44 for (int i = 1; i < argc; i++) { 42 for (int i = 1; i < argc; i++) {
45 SLOGI("Started with arg %d: %s\n", i, argv[i]); 43 LOG(INFO) << "Started with arg " << i << ": " << argv[i];
46 } 44 }
47 45
48 const hw_module_t* hw_module; 46 const hw_module_t* hw_module;
49 if (hw_get_module("bootctrl", &hw_module) != 0) { 47 if (hw_get_module("bootctrl", &hw_module) != 0) {
50 SLOGE("Error getting bootctrl module.\n"); 48 LOG(ERROR) << "Error getting bootctrl module.";
51 return -1; 49 return -1;
52 } 50 }
53 51
@@ -57,7 +55,7 @@ int main(int argc, char** argv) {
57 55
58 unsigned current_slot = module->getCurrentSlot(module); 56 unsigned current_slot = module->getCurrentSlot(module);
59 int is_successful= module->isSlotMarkedSuccessful(module, current_slot); 57 int is_successful= module->isSlotMarkedSuccessful(module, current_slot);
60 SLOGI("Booting slot %u: isSlotMarkedSuccessful=%d\n", current_slot, is_successful); 58 LOG(INFO) << "Booting slot " << current_slot << ": isSlotMarkedSuccessful=" << is_successful;
61 59
62 if (is_successful == 0) { 60 if (is_successful == 0) {
63 // The current slot has not booted successfully. 61 // The current slot has not booted successfully.
@@ -70,12 +68,12 @@ int main(int argc, char** argv) {
70 68
71 int ret = module->markBootSuccessful(module); 69 int ret = module->markBootSuccessful(module);
72 if (ret != 0) { 70 if (ret != 0) {
73 SLOGE("Error marking booted successfully: %s\n", strerror(-ret)); 71 LOG(ERROR) << "Error marking booted successfully: " << strerror(-ret);
74 return -1; 72 return -1;
75 } 73 }
76 SLOGI("Marked slot %u as booted successfully.\n", current_slot); 74 LOG(INFO) << "Marked slot " << current_slot << " as booted successfully.";
77 } 75 }
78 76
79 SLOGI("Leaving update_verifier.\n"); 77 LOG(INFO) << "Leaving update_verifier.";
80 return 0; 78 return 0;
81} 79}