blob: d56164e7ef6eeb43056e4eb5489b97a2a7d878db [file] [log] [blame]
Doug Zongkerddd6a282009-06-09 12:22:33 -07001/*
2 * Copyright (C) 2009 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#include <linux/input.h>
18
19#include "recovery_ui.h"
20#include "common.h"
21
22char* MENU_HEADERS[] = { "Android system recovery utility",
23 "",
24 NULL };
25
26char* MENU_ITEMS[] = { "reboot system now",
Doug Zongkerdc9e87c2010-07-29 17:08:50 -070027 "apply update from external storage",
Doug Zongkerddd6a282009-06-09 12:22:33 -070028 "wipe data/factory reset",
29 "wipe cache partition",
Michael Ward9d2629c2011-06-23 22:14:24 -070030 "apply update from cache",
Doug Zongkerddd6a282009-06-09 12:22:33 -070031 NULL };
32
Doug Zongker6809c512011-03-01 14:04:34 -080033void device_ui_init(UIParameters* ui_parameters) {
34}
35
Doug Zongkerefa1bab2010-02-01 15:59:12 -080036int device_recovery_start() {
37 return 0;
38}
39
Doug Zongker23412e62009-07-23 10:16:07 -070040int device_toggle_display(volatile char* key_pressed, int key_code) {
Doug Zongkercbb91292009-06-11 14:54:41 -070041 return key_code == KEY_HOME;
Doug Zongkerddd6a282009-06-09 12:22:33 -070042}
43
Doug Zongker23412e62009-07-23 10:16:07 -070044int device_reboot_now(volatile char* key_pressed, int key_code) {
Doug Zongkercbb91292009-06-11 14:54:41 -070045 return 0;
Doug Zongkerddd6a282009-06-09 12:22:33 -070046}
47
48int device_handle_key(int key_code, int visible) {
Doug Zongkercbb91292009-06-11 14:54:41 -070049 if (visible) {
50 switch (key_code) {
51 case KEY_DOWN:
52 case KEY_VOLUMEDOWN:
53 return HIGHLIGHT_DOWN;
Doug Zongkerddd6a282009-06-09 12:22:33 -070054
Doug Zongkercbb91292009-06-11 14:54:41 -070055 case KEY_UP:
56 case KEY_VOLUMEUP:
57 return HIGHLIGHT_UP;
Doug Zongkerddd6a282009-06-09 12:22:33 -070058
Doug Zongkercbb91292009-06-11 14:54:41 -070059 case KEY_ENTER:
60 return SELECT_ITEM;
61 }
Doug Zongkerddd6a282009-06-09 12:22:33 -070062 }
Doug Zongkerddd6a282009-06-09 12:22:33 -070063
Doug Zongkercbb91292009-06-11 14:54:41 -070064 return NO_ACTION;
Doug Zongkerddd6a282009-06-09 12:22:33 -070065}
66
Doug Zongkercbb91292009-06-11 14:54:41 -070067int device_perform_action(int which) {
68 return which;
Doug Zongkerddd6a282009-06-09 12:22:33 -070069}
Doug Zongkerb128f542009-06-18 15:07:14 -070070
71int device_wipe_data() {
72 return 0;
73}