summaryrefslogtreecommitdiffstats
path: root/recovery_ui.h
diff options
context:
space:
mode:
authorDoug Zongker <dougz@android.com>2009-06-09 21:22:33 +0200
committerDoug Zongker <dougz@android.com>2009-06-11 23:50:33 +0200
commitddd6a2865db5c73a4bb9d486f71a8c2f1f96ec69 (patch)
treea991238ca9fd1299d295d6229df882585ca0c659 /recovery_ui.h
parentam 9b9c2114: Merge change 3514 into donut (diff)
downloadandroid_bootable_recovery-ddd6a2865db5c73a4bb9d486f71a8c2f1f96ec69.tar
android_bootable_recovery-ddd6a2865db5c73a4bb9d486f71a8c2f1f96ec69.tar.gz
android_bootable_recovery-ddd6a2865db5c73a4bb9d486f71a8c2f1f96ec69.tar.bz2
android_bootable_recovery-ddd6a2865db5c73a4bb9d486f71a8c2f1f96ec69.tar.lz
android_bootable_recovery-ddd6a2865db5c73a4bb9d486f71a8c2f1f96ec69.tar.xz
android_bootable_recovery-ddd6a2865db5c73a4bb9d486f71a8c2f1f96ec69.tar.zst
android_bootable_recovery-ddd6a2865db5c73a4bb9d486f71a8c2f1f96ec69.zip
Diffstat (limited to 'recovery_ui.h')
-rw-r--r--recovery_ui.h68
1 files changed, 68 insertions, 0 deletions
diff --git a/recovery_ui.h b/recovery_ui.h
new file mode 100644
index 000000000..86f540b6e
--- /dev/null
+++ b/recovery_ui.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2009 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_UI_H
+#define _RECOVERY_UI_H
+
+// Called in the input thread when a new key (key_code) is pressed.
+// *key_pressed is an array of KEY_MAX+1 bytes indicating which other
+// keys are already pressed. Return true if the text display should
+// be toggled.
+extern int device_toggle_display(char* key_pressed, int key_code);
+
+// Called in the input thread when a new key (key_code) is pressed.
+// *key_pressed is an array of KEY_MAX+1 bytes indicating which other
+// keys are already pressed. Return true if the device should reboot
+// immediately.
+extern int device_reboot_now(char* key_pressed, int key_code);
+
+// Called from the main thread when recovery is waiting for input and
+// a key is pressed. key is the code of the key pressed; visible is
+// true if the recovery menu is being shown. Implementations can call
+// ui_key_pressed() to discover if other keys are being held down.
+// Return one of the defined constants below in order to:
+//
+// - move the menu highlight (HIGHLIGHT_*)
+// - invoke the highlighted item (SELECT_ITEM)
+// - do nothing (NO_ACTION)
+// - invoke a specific action (a menu position: any non-negative number)
+extern int device_handle_key(int key, int visible);
+
+// Perform a recovery action selected from the menu. 'which' will be
+// the item number of the selected menu item, or a non-negative number
+// returned from device_handle_key(). The menu will be hidden when
+// this is called; implementations can call ui_print() to print
+// information to the screen.
+extern int device_perform_action(int which);
+
+#define NO_ACTION -1
+
+#define HIGHLIGHT_UP -2
+#define HIGHLIGHT_DOWN -3
+#define SELECT_ITEM -4
+
+#define ITEM_REBOOT 0
+#define ITEM_APPLY_SDCARD 1
+#define ITEM_WIPE_DATA 2
+#define ITEM_WIPE_CACHE 3
+
+// Header text to display above the main menu.
+extern char* MENU_HEADERS[];
+
+// Text of menu items.
+extern char* MENU_ITEMS[];
+
+#endif