blob: 1219b284ceddd83e282e0c40502dc8354d6cf391 [file] [log] [blame]
Sen Jiangd5304492016-12-09 16:20:49 -08001/*
2 * Copyright (C) 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef RECOVERY_STUB_UI_H
18#define RECOVERY_STUB_UI_H
19
20#include "ui.h"
21
22// Stub implementation of RecoveryUI for devices without screen.
23class StubRecoveryUI : public RecoveryUI {
24 public:
25 StubRecoveryUI() = default;
26
27 void SetLocale(const char* locale) override {}
28
29 void SetBackground(Icon icon) override {}
30 void SetSystemUpdateText(bool security_update) override {}
31
32 // progress indicator
33 void SetProgressType(ProgressType type) override {}
34 void ShowProgress(float portion, float seconds) override {}
35 void SetProgress(float fraction) override {}
36
37 void SetStage(int current, int max) override {}
38
39 // text log
40 void ShowText(bool visible) override {}
41 bool IsTextVisible() override {
42 return false;
43 }
44 bool WasTextEverVisible() override {
45 return false;
46 }
47
48 // printing messages
49 void Print(const char* fmt, ...) override {
50 va_list ap;
51 va_start(ap, fmt);
52 vprintf(fmt, ap);
53 va_end(ap);
54 }
55 void PrintOnScreenOnly(const char* fmt, ...) override {}
56 void ShowFile(const char* filename) override {}
57
58 // menu display
59 void StartMenu(const char* const* headers, const char* const* items,
60 int initial_selection) override {}
61 int SelectMenu(int sel) override {
62 return sel;
63 }
64 void EndMenu() override {}
65};
66
67#endif // RECOVERY_STUB_UI_H