diff options
author | Tao Bao <tbao@google.com> | 2019-03-29 15:43:09 -0700 |
---|---|---|
committer | Tao Bao <tbao@google.com> | 2019-03-29 15:50:02 -0700 |
commit | bc982a4f8845e5fa0cd2630ddcc3d8f70066b083 (patch) | |
tree | d95e3fdd35b47bb80c6b06bd65344c1eb2582afb | |
parent | a232d9dccbf39856824ad783cc2d66812f581d95 (diff) | |
download | recovery-bc982a4f8845e5fa0cd2630ddcc3d8f70066b083.tar.gz |
Remove ui_print().
This used to be a helper function that allows printing message to UI.
We no longer have any active user in bootable/recovery. Device-specific
code can achieve the same functionality by calling GetUI()->Print()
instead.
Test: mmma -j bootable/recovery
Change-Id: If584fc8a51d1af466f1d94d8ea5faa262603a784
-rw-r--r-- | common.h | 9 | ||||
-rw-r--r-- | recovery.cpp | 15 | ||||
-rw-r--r-- | recovery_ui/include/recovery_ui/device.h | 4 |
3 files changed, 3 insertions, 25 deletions
@@ -14,11 +14,7 @@ * limitations under the License. */ -#ifndef RECOVERY_COMMON_H -#define RECOVERY_COMMON_H - -#include <stdarg.h> -#include <stdio.h> +#pragma once #include <string> @@ -39,9 +35,6 @@ extern std::string stage; // The reason argument provided in "--reason=". extern const char* reason; -void ui_print(const char* format, ...) __printflike(1, 2); - bool is_ro_debuggable(); bool SetUsbConfig(const std::string& state); -#endif // RECOVERY_COMMON_H diff --git a/recovery.cpp b/recovery.cpp index 421bc12f..02cc53c2 100644 --- a/recovery.cpp +++ b/recovery.cpp @@ -24,7 +24,6 @@ #include <limits.h> #include <linux/fs.h> #include <linux/input.h> -#include <stdarg.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -746,20 +745,6 @@ static void print_property(const char* key, const char* name, void* /* cookie */ printf("%s=%s\n", key, name); } -void ui_print(const char* format, ...) { - std::string buffer; - va_list ap; - va_start(ap, format); - android::base::StringAppendV(&buffer, format, ap); - va_end(ap); - - if (ui != nullptr) { - ui->Print("%s", buffer.c_str()); - } else { - fputs(buffer.c_str(), stdout); - } -} - static bool is_battery_ok(int* required_battery_level) { using android::hardware::health::V1_0::BatteryStatus; using android::hardware::health::V2_0::get_health_service; diff --git a/recovery_ui/include/recovery_ui/device.h b/recovery_ui/include/recovery_ui/device.h index cfa914e7..3c44510c 100644 --- a/recovery_ui/include/recovery_ui/device.h +++ b/recovery_ui/include/recovery_ui/device.h @@ -93,8 +93,8 @@ class Device { // Performs a recovery action selected from the menu. 'menu_position' will be the index of the // selected menu item, or a non-negative value returned from HandleMenuKey(). The menu will be - // hidden when this is called; implementations can call ui_print() to print information to the - // screen. If the menu position is one of the builtin actions, you can just return the + // hidden when this is called; implementations can call GetUI()->Print() to print information to + // the screen. If the menu position is one of the builtin actions, you can just return the // corresponding enum value. If it is an action specific to your device, you actually perform it // here and return NO_ACTION. virtual BuiltinAction InvokeMenuItem(size_t menu_position); |