blob: 60bbb966968c1a572f9a263a6afa19d534d998ab [file] [log] [blame]
Sen Jiangd5304492016-12-09 16:20:49 -08001/*
2 * Copyright (C) 2016 The Android Open Source Project
Tom Marshall820517b2019-01-14 14:28:55 -08003 * Copyright (C) 2019 The LineageOS Project
Sen Jiangd5304492016-12-09 16:20:49 -08004 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#ifndef RECOVERY_STUB_UI_H
19#define RECOVERY_STUB_UI_H
20
21#include "ui.h"
22
23// Stub implementation of RecoveryUI for devices without screen.
24class StubRecoveryUI : public RecoveryUI {
25 public:
26 StubRecoveryUI() = default;
27
Tao Bao99f0d9e2016-10-13 12:46:38 -070028 void SetBackground(Icon /* icon */) override {}
29 void SetSystemUpdateText(bool /* security_update */) override {}
Sen Jiangd5304492016-12-09 16:20:49 -080030
31 // progress indicator
Tao Bao99f0d9e2016-10-13 12:46:38 -070032 void SetProgressType(ProgressType /* type */) override {}
33 void ShowProgress(float /* portion */, float /* seconds */) override {}
34 void SetProgress(float /* fraction */) override {}
Sen Jiangd5304492016-12-09 16:20:49 -080035
Tao Bao99f0d9e2016-10-13 12:46:38 -070036 void SetStage(int /* current */, int /* max */) override {}
Sen Jiangd5304492016-12-09 16:20:49 -080037
38 // text log
Tao Bao99f0d9e2016-10-13 12:46:38 -070039 void ShowText(bool /* visible */) override {}
Sen Jiangd5304492016-12-09 16:20:49 -080040 bool IsTextVisible() override {
41 return false;
42 }
43 bool WasTextEverVisible() override {
44 return false;
45 }
Alessandro Astone20c8d412019-04-01 11:11:33 +020046 void UpdateScreenOnPrint(bool /* update */) override{};
Sen Jiangd5304492016-12-09 16:20:49 -080047
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 }
Tao Bao99f0d9e2016-10-13 12:46:38 -070055 void PrintOnScreenOnly(const char* /* fmt */, ...) override {}
Tom Marshall820517b2019-01-14 14:28:55 -080056 int ShowFile(const char* /* filename */) override {
57 return -1;
58 }
Tom Marshallf780f1c2018-03-01 23:51:51 +010059 void Redraw() override {}
Sen Jiangd5304492016-12-09 16:20:49 -080060
61 // menu display
Tom Marshall820517b2019-01-14 14:28:55 -080062 void StartMenu(bool /* is_main */, menu_type_t /* type */, const char* const* /* headers */,
63 const MenuItemVector& /* items */, int /* initial_selection */) override {}
Sen Jiangd5304492016-12-09 16:20:49 -080064 int SelectMenu(int sel) override {
65 return sel;
66 }
Tom Marshall820517b2019-01-14 14:28:55 -080067 int SelectMenu(const Point& /* point */) override {
68 return 0;
69 }
Alessandro Astoned6eb74e2019-03-28 22:02:02 +010070 int ScrollMenu(int /* updown */) override {
71 return 0;
72 }
Sen Jiangd5304492016-12-09 16:20:49 -080073 void EndMenu() override {}
Tom Marshall820517b2019-01-14 14:28:55 -080074
75 bool MenuShowing() const {
76 return true;
77 }
78 bool MenuScrollable() const {
79 return true;
80 }
81 int MenuItemStart() const {
82 return 0;
83 }
84 int MenuItemHeight() const {
85 return 1;
86 }
Sen Jiangd5304492016-12-09 16:20:49 -080087};
88
89#endif // RECOVERY_STUB_UI_H