From b5108c372c8b92671ea5ebb4eeff00757fcee187 Mon Sep 17 00:00:00 2001 From: Tianjie Xu Date: Mon, 20 Aug 2018 13:40:47 -0700 Subject: Move librecovery_ui to a sub-directory This helps to expose librecovery_ui for device specific RecoveryUi. Bug: 76436783 Test: mma, unit tests pass Change-Id: Ic6c3d301d5833e4a592e6ea9d9d059bc4e4919be --- stub_ui.h | 87 --------------------------------------------------------------- 1 file changed, 87 deletions(-) delete mode 100644 stub_ui.h (limited to 'stub_ui.h') diff --git a/stub_ui.h b/stub_ui.h deleted file mode 100644 index fb1d8c7a6..000000000 --- a/stub_ui.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (C) 2016 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef RECOVERY_STUB_UI_H -#define RECOVERY_STUB_UI_H - -#include -#include -#include - -#include "ui.h" - -// Stub implementation of RecoveryUI for devices without screen. -class StubRecoveryUI : public RecoveryUI { - public: - StubRecoveryUI() = default; - - std::string GetLocale() const override { - return ""; - } - void SetBackground(Icon /* icon */) override {} - void SetSystemUpdateText(bool /* security_update */) override {} - - // progress indicator - void SetProgressType(ProgressType /* type */) override {} - void ShowProgress(float /* portion */, float /* seconds */) override {} - void SetProgress(float /* fraction */) override {} - - void SetStage(int /* current */, int /* max */) override {} - - // text log - void ShowText(bool /* visible */) override {} - bool IsTextVisible() override { - return false; - } - bool WasTextEverVisible() override { - return false; - } - - // printing messages - void Print(const char* fmt, ...) override { - va_list ap; - va_start(ap, fmt); - vprintf(fmt, ap); - va_end(ap); - } - void PrintOnScreenOnly(const char* /* fmt */, ...) override {} - void ShowFile(const std::string& /* filename */) override {} - - // menu display - size_t ShowMenu(const std::vector& /* headers */, - const std::vector& /* items */, size_t initial_selection, - bool /* menu_only */, - const std::function& /* key_handler */) override { - return initial_selection; - } - - size_t ShowPromptWipeDataMenu(const std::vector& /* backup_headers */, - const std::vector& /* backup_items */, - const std::function& /* key_handle */) override { - return 0; - } - - size_t ShowPromptWipeDataConfirmationMenu( - const std::vector& /* backup_headers */, - const std::vector& /* backup_items */, - const std::function& /* key_handle */) override { - return 0; - } - - void SetTitle(const std::vector& /* lines */) override {} -}; - -#endif // RECOVERY_STUB_UI_H -- cgit v1.2.3