xref: /OK3568_Linux_fs/external/recovery/default_recovery_ui.c (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /*
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 
22 char* MENU_HEADERS[] = { "Linux system recovery utility",
23                          "",
24                          NULL
25                        };
26 
27 char* MENU_ITEMS[] = { "reboot system now",
28                        "apply update from sdcard",
29                        "apply update from local userdata",
30                        "apply update from udisk",
31                        "wipe data/factory reset",
32                        NULL
33                      };
34 
device_recovery_start()35 int device_recovery_start()
36 {
37     return 0;
38 }
39 
device_toggle_display(volatile char * key_pressed,int key_code)40 int device_toggle_display(volatile char* key_pressed, int key_code)
41 {
42     // return key_code == KEY_MENU;
43     return 0;
44 }
45 
device_reboot_now(volatile char * key_pressed,int key_code)46 int device_reboot_now(volatile char* key_pressed, int key_code)
47 {
48     return 0;
49 }
50 
device_handle_key(int key_code,int visible)51 int device_handle_key(int key_code, int visible)
52 {
53     if (visible) {
54         switch (key_code) {
55         case KEY_DOWN:
56         case KEY_VOLUMEDOWN:
57             return HIGHLIGHT_DOWN;
58 
59         case KEY_UP:
60         case KEY_VOLUMEUP:
61             return HIGHLIGHT_UP;
62 
63         case KEY_ENTER:
64         case KEY_MENU:
65             return SELECT_ITEM;
66         }
67     }
68 
69     return NO_ACTION;
70 }
71 
device_perform_action(int which)72 int device_perform_action(int which)
73 {
74     return which;
75 }
76 
device_wipe_data()77 int device_wipe_data()
78 {
79     return 0;
80 }
81