blob: 3c36fcfb1fc13c066ab30e007a7c8e108babd157 [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
Tao Bao99f0d9e2016-10-13 12:46:38 -070027 void SetBackground(Icon /* icon */) override {}
28 void SetSystemUpdateText(bool /* security_update */) override {}
Sen Jiangd5304492016-12-09 16:20:49 -080029
30 // progress indicator
Tao Bao99f0d9e2016-10-13 12:46:38 -070031 void SetProgressType(ProgressType /* type */) override {}
32 void ShowProgress(float /* portion */, float /* seconds */) override {}
33 void SetProgress(float /* fraction */) override {}
Sen Jiangd5304492016-12-09 16:20:49 -080034
Tao Bao99f0d9e2016-10-13 12:46:38 -070035 void SetStage(int /* current */, int /* max */) override {}
Sen Jiangd5304492016-12-09 16:20:49 -080036
37 // text log
Tao Bao99f0d9e2016-10-13 12:46:38 -070038 void ShowText(bool /* visible */) override {}
Sen Jiangd5304492016-12-09 16:20:49 -080039 bool IsTextVisible() override {
40 return false;
41 }
42 bool WasTextEverVisible() override {
43 return false;
44 }
45
46 // printing messages
47 void Print(const char* fmt, ...) override {
48 va_list ap;
49 va_start(ap, fmt);
50 vprintf(fmt, ap);
51 va_end(ap);
52 }
Tao Bao99f0d9e2016-10-13 12:46:38 -070053 void PrintOnScreenOnly(const char* /* fmt */, ...) override {}
54 void ShowFile(const char* /* filename */) override {}
Sen Jiangd5304492016-12-09 16:20:49 -080055
56 // menu display
Tao Bao3aec6962018-04-20 09:24:58 -070057 int ShowMenu(const char* const* /* headers */, const char* const* /* items */,
58 int initial_selection, bool /* menu_only */,
59 const std::function<int(int, bool)>& /* key_handler */) override {
60 return initial_selection;
Sen Jiangd5304492016-12-09 16:20:49 -080061 }
Sen Jiangd5304492016-12-09 16:20:49 -080062};
63
64#endif // RECOVERY_STUB_UI_H