summaryrefslogtreecommitdiffstats
path: root/recovery_ui
diff options
context:
space:
mode:
authorTianjie Xu <xunchang@google.com>2019-03-22 16:15:37 +0100
committerandroid-build-merger <android-build-merger@google.com>2019-03-22 16:15:37 +0100
commit45898d8bb496921efbe56d250380a26a7f449a56 (patch)
tree53c458f85d7ec6ea5243002786d340c8b57dbad6 /recovery_ui
parentMerge "Move apply_from_sdcard to fuse_sdcard_install" (diff)
parentMerge "Move librecovery_ui to a sub-directory" (diff)
downloadandroid_bootable_recovery-45898d8bb496921efbe56d250380a26a7f449a56.tar
android_bootable_recovery-45898d8bb496921efbe56d250380a26a7f449a56.tar.gz
android_bootable_recovery-45898d8bb496921efbe56d250380a26a7f449a56.tar.bz2
android_bootable_recovery-45898d8bb496921efbe56d250380a26a7f449a56.tar.lz
android_bootable_recovery-45898d8bb496921efbe56d250380a26a7f449a56.tar.xz
android_bootable_recovery-45898d8bb496921efbe56d250380a26a7f449a56.tar.zst
android_bootable_recovery-45898d8bb496921efbe56d250380a26a7f449a56.zip
Diffstat (limited to '')
-rw-r--r--recovery_ui/Android.bp91
-rw-r--r--recovery_ui/default_device.cpp (renamed from default_device.cpp)4
-rw-r--r--recovery_ui/device.cpp (renamed from device.cpp)4
-rw-r--r--recovery_ui/include/recovery_ui/device.h (renamed from device.h)2
-rw-r--r--recovery_ui/include/recovery_ui/screen_ui.h (renamed from screen_ui.h)0
-rw-r--r--recovery_ui/include/recovery_ui/stub_ui.h (renamed from stub_ui.h)0
-rw-r--r--recovery_ui/include/recovery_ui/ui.h (renamed from ui.h)12
-rw-r--r--recovery_ui/include/recovery_ui/vr_ui.h (renamed from vr_ui.h)0
-rw-r--r--recovery_ui/include/recovery_ui/wear_ui.h (renamed from wear_ui.h)0
-rw-r--r--recovery_ui/screen_ui.cpp (renamed from screen_ui.cpp)16
-rw-r--r--recovery_ui/ui.cpp (renamed from ui.cpp)6
-rw-r--r--recovery_ui/vr_device.cpp (renamed from vr_device.cpp)7
-rw-r--r--recovery_ui/vr_ui.cpp (renamed from vr_ui.cpp)2
-rw-r--r--recovery_ui/wear_device.cpp (renamed from wear_device.cpp)5
-rw-r--r--recovery_ui/wear_ui.cpp (renamed from wear_ui.cpp)2
15 files changed, 119 insertions, 32 deletions
diff --git a/recovery_ui/Android.bp b/recovery_ui/Android.bp
new file mode 100644
index 000000000..ee3149d5e
--- /dev/null
+++ b/recovery_ui/Android.bp
@@ -0,0 +1,91 @@
+// Copyright (C) 2019 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.
+
+cc_library {
+ name: "librecovery_ui",
+ recovery_available: true,
+
+ defaults: [
+ "recovery_defaults",
+ ],
+
+ srcs: [
+ "device.cpp",
+ "screen_ui.cpp",
+ "ui.cpp",
+ "vr_ui.cpp",
+ "wear_ui.cpp",
+ ],
+
+ export_include_dirs: ["include"],
+
+ static_libs: [
+ "libminui",
+ "libotautil",
+ ],
+
+ shared_libs: [
+ "libbase",
+ "libpng",
+ "libz",
+ ],
+}
+
+// Generic device that uses ScreenRecoveryUI.
+cc_library_static {
+ name: "librecovery_ui_default",
+ recovery_available: true,
+
+ defaults: [
+ "recovery_defaults",
+ ],
+
+ srcs: [
+ "default_device.cpp",
+ ],
+
+ export_include_dirs: ["include"],
+}
+
+// The default wear device that uses WearRecoveryUI.
+cc_library_static {
+ name: "librecovery_ui_wear",
+ recovery_available: true,
+
+ defaults: [
+ "recovery_defaults",
+ ],
+
+ srcs: [
+ "wear_device.cpp",
+ ],
+
+ export_include_dirs: ["include"],
+}
+
+// The default VR device that uses VrRecoveryUI.
+cc_library_static {
+ name: "librecovery_ui_vr",
+ recovery_available: true,
+
+ defaults: [
+ "recovery_defaults",
+ ],
+
+ srcs: [
+ "vr_device.cpp",
+ ],
+
+ export_include_dirs: ["include"],
+}
diff --git a/default_device.cpp b/recovery_ui/default_device.cpp
index a9718668d..4db461af6 100644
--- a/default_device.cpp
+++ b/recovery_ui/default_device.cpp
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#include "device.h"
-#include "screen_ui.h"
+#include "recovery_ui/device.h"
+#include "recovery_ui/screen_ui.h"
Device* make_device() {
return new Device(new ScreenRecoveryUI);
diff --git a/device.cpp b/recovery_ui/device.cpp
index eec1932c2..ddb0118db 100644
--- a/device.cpp
+++ b/recovery_ui/device.cpp
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "device.h"
+#include "recovery_ui/device.h"
#include <algorithm>
#include <string>
@@ -23,7 +23,7 @@
#include <android-base/logging.h>
-#include "ui.h"
+#include "recovery_ui/ui.h"
static std::vector<std::pair<std::string, Device::BuiltinAction>> g_menu_actions{
{ "Reboot system now", Device::REBOOT },
diff --git a/device.h b/recovery_ui/include/recovery_ui/device.h
index 6a8daf83e..cfa914e77 100644
--- a/device.h
+++ b/recovery_ui/include/recovery_ui/device.h
@@ -68,7 +68,7 @@ class Device {
// Called when recovery starts up (after the UI has been obtained and initialized and after the
// arguments have been parsed, but before anything else).
- virtual void StartRecovery() {};
+ virtual void StartRecovery() {}
// Called from the main thread when recovery is at the main menu and waiting for input, and a key
// is pressed. (Note that "at" the main menu does not necessarily mean the menu is visible;
diff --git a/screen_ui.h b/recovery_ui/include/recovery_ui/screen_ui.h
index 5cda2a2e5..5cda2a2e5 100644
--- a/screen_ui.h
+++ b/recovery_ui/include/recovery_ui/screen_ui.h
diff --git a/stub_ui.h b/recovery_ui/include/recovery_ui/stub_ui.h
index fb1d8c7a6..fb1d8c7a6 100644
--- a/stub_ui.h
+++ b/recovery_ui/include/recovery_ui/stub_ui.h
diff --git a/ui.h b/recovery_ui/include/recovery_ui/ui.h
index b387ae3c9..d55322cf0 100644
--- a/ui.h
+++ b/recovery_ui/include/recovery_ui/ui.h
@@ -35,20 +35,20 @@ class RecoveryUI {
INSTALLING_UPDATE,
ERASING,
NO_COMMAND,
- ERROR
+ ERROR,
};
enum ProgressType {
EMPTY,
INDETERMINATE,
- DETERMINATE
+ DETERMINATE,
};
enum KeyAction {
ENQUEUE,
TOGGLE,
REBOOT,
- IGNORE
+ IGNORE,
};
enum class KeyError : int {
@@ -60,8 +60,8 @@ class RecoveryUI {
virtual ~RecoveryUI();
- // Initializes the object; called before anything else. UI texts will be initialized according to
- // the given locale. Returns true on success.
+ // Initializes the object; called before anything else. UI texts will be initialized according
+ // to the given locale. Returns true on success.
virtual bool Init(const std::string& locale);
virtual std::string GetLocale() const = 0;
@@ -211,7 +211,7 @@ class RecoveryUI {
DISABLED,
NORMAL,
DIMMED,
- OFF
+ OFF,
};
// The sensitivity when detecting a swipe.
diff --git a/vr_ui.h b/recovery_ui/include/recovery_ui/vr_ui.h
index 2e8ac5921..2e8ac5921 100644
--- a/vr_ui.h
+++ b/recovery_ui/include/recovery_ui/vr_ui.h
diff --git a/wear_ui.h b/recovery_ui/include/recovery_ui/wear_ui.h
index 429af69d2..429af69d2 100644
--- a/wear_ui.h
+++ b/recovery_ui/include/recovery_ui/wear_ui.h
diff --git a/screen_ui.cpp b/recovery_ui/screen_ui.cpp
index 6f2b68b41..870db621c 100644
--- a/screen_ui.cpp
+++ b/recovery_ui/screen_ui.cpp
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "screen_ui.h"
+#include "recovery_ui/screen_ui.h"
#include <dirent.h>
#include <errno.h>
@@ -42,10 +42,10 @@
#include <android-base/stringprintf.h>
#include <android-base/strings.h>
-#include "device.h"
#include "minui/minui.h"
#include "otautil/paths.h"
-#include "ui.h"
+#include "recovery_ui/device.h"
+#include "recovery_ui/ui.h"
// Return the current time as a double (including fractions of a second).
static double now() {
@@ -388,10 +388,10 @@ int ScreenRecoveryUI::PixelsFromDp(int dp) const {
enum Layout { PORTRAIT = 0, PORTRAIT_LARGE = 1, LANDSCAPE = 2, LANDSCAPE_LARGE = 3, LAYOUT_MAX };
enum Dimension { TEXT = 0, ICON = 1, DIMENSION_MAX };
static constexpr int kLayouts[LAYOUT_MAX][DIMENSION_MAX] = {
- { 32, 68, }, // PORTRAIT
- { 32, 68, }, // PORTRAIT_LARGE
- { 26, 56, }, // LANDSCAPE
- { 52, 112, }, // LANDSCAPE_LARGE
+ { 32, 68 }, // PORTRAIT
+ { 32, 68 }, // PORTRAIT_LARGE
+ { 26, 56 }, // LANDSCAPE
+ { 52, 112 }, // LANDSCAPE_LARGE
};
int ScreenRecoveryUI::GetAnimationBaseline() const {
@@ -1042,7 +1042,7 @@ void ScreenRecoveryUI::Print(const char* fmt, ...) {
va_end(ap);
}
-void ScreenRecoveryUI::PrintOnScreenOnly(const char *fmt, ...) {
+void ScreenRecoveryUI::PrintOnScreenOnly(const char* fmt, ...) {
va_list ap;
va_start(ap, fmt);
PrintV(fmt, false, ap);
diff --git a/ui.cpp b/recovery_ui/ui.cpp
index c12a11b36..b7107ff21 100644
--- a/ui.cpp
+++ b/recovery_ui/ui.cpp
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "ui.h"
+#include "recovery_ui/ui.h"
#include <errno.h>
#include <fcntl.h>
@@ -39,7 +39,6 @@
#include "minui/minui.h"
#include "otautil/sysutil.h"
-#include "roots.h"
using namespace std::chrono_literals;
@@ -590,8 +589,7 @@ RecoveryUI::KeyAction RecoveryUI::CheckKey(int key, bool is_long_press) {
return (IsTextVisible() || screensaver_state_ == ScreensaverState::OFF) ? ENQUEUE : IGNORE;
}
-void RecoveryUI::KeyLongPress(int) {
-}
+void RecoveryUI::KeyLongPress(int) {}
void RecoveryUI::SetEnableReboot(bool enabled) {
std::lock_guard<std::mutex> lg(key_queue_mutex);
diff --git a/vr_device.cpp b/recovery_ui/vr_device.cpp
index 61e15cbb6..fd7613307 100644
--- a/vr_device.cpp
+++ b/recovery_ui/vr_device.cpp
@@ -14,10 +14,9 @@
* limitations under the License.
*/
-#include "device.h"
-#include "vr_ui.h"
+#include "recovery_ui/device.h"
+#include "recovery_ui/vr_ui.h"
Device* make_device() {
- return new Device(new VrRecoveryUI);
+ return new Device(new VrRecoveryUI);
}
-
diff --git a/vr_ui.cpp b/recovery_ui/vr_ui.cpp
index 1f0292c30..5b9b1b4e5 100644
--- a/vr_ui.cpp
+++ b/recovery_ui/vr_ui.cpp
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "vr_ui.h"
+#include "recovery_ui/vr_ui.h"
#include <android-base/properties.h>
diff --git a/wear_device.cpp b/recovery_ui/wear_device.cpp
index 3268130b0..bf21bc962 100644
--- a/wear_device.cpp
+++ b/recovery_ui/wear_device.cpp
@@ -14,10 +14,9 @@
* limitations under the License.
*/
-#include "device.h"
-#include "wear_ui.h"
+#include "recovery_ui/device.h"
+#include "recovery_ui/wear_ui.h"
Device* make_device() {
return new Device(new WearRecoveryUI);
}
-
diff --git a/wear_ui.cpp b/recovery_ui/wear_ui.cpp
index 6da84c924..8d8108f14 100644
--- a/wear_ui.cpp
+++ b/recovery_ui/wear_ui.cpp
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "wear_ui.h"
+#include "recovery_ui/wear_ui.h"
#include <string.h>