Doug Zongker | ddd6a28 | 2009-06-09 12:22:33 -0700 | [diff] [blame] | 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[] = { "Android system recovery utility", |
| 23 | "", |
| 24 | NULL }; |
| 25 | |
| 26 | char* MENU_ITEMS[] = { "reboot system now", |
Doug Zongker | dc9e87c | 2010-07-29 17:08:50 -0700 | [diff] [blame] | 27 | "apply update from external storage", |
Doug Zongker | ddd6a28 | 2009-06-09 12:22:33 -0700 | [diff] [blame] | 28 | "wipe data/factory reset", |
| 29 | "wipe cache partition", |
| 30 | NULL }; |
| 31 | |
Doug Zongker | 6809c51 | 2011-03-01 14:04:34 -0800 | [diff] [blame] | 32 | void device_ui_init(UIParameters* ui_parameters) { |
| 33 | } |
| 34 | |
Doug Zongker | efa1bab | 2010-02-01 15:59:12 -0800 | [diff] [blame] | 35 | int device_recovery_start() { |
| 36 | return 0; |
| 37 | } |
| 38 | |
Doug Zongker | 23412e6 | 2009-07-23 10:16:07 -0700 | [diff] [blame] | 39 | int device_toggle_display(volatile char* key_pressed, int key_code) { |
Doug Zongker | cbb9129 | 2009-06-11 14:54:41 -0700 | [diff] [blame] | 40 | return key_code == KEY_HOME; |
Doug Zongker | ddd6a28 | 2009-06-09 12:22:33 -0700 | [diff] [blame] | 41 | } |
| 42 | |
Doug Zongker | 23412e6 | 2009-07-23 10:16:07 -0700 | [diff] [blame] | 43 | int device_reboot_now(volatile char* key_pressed, int key_code) { |
Doug Zongker | cbb9129 | 2009-06-11 14:54:41 -0700 | [diff] [blame] | 44 | return 0; |
Doug Zongker | ddd6a28 | 2009-06-09 12:22:33 -0700 | [diff] [blame] | 45 | } |
| 46 | |
| 47 | int device_handle_key(int key_code, int visible) { |
Doug Zongker | cbb9129 | 2009-06-11 14:54:41 -0700 | [diff] [blame] | 48 | if (visible) { |
| 49 | switch (key_code) { |
| 50 | case KEY_DOWN: |
| 51 | case KEY_VOLUMEDOWN: |
| 52 | return HIGHLIGHT_DOWN; |
Doug Zongker | ddd6a28 | 2009-06-09 12:22:33 -0700 | [diff] [blame] | 53 | |
Doug Zongker | cbb9129 | 2009-06-11 14:54:41 -0700 | [diff] [blame] | 54 | case KEY_UP: |
| 55 | case KEY_VOLUMEUP: |
| 56 | return HIGHLIGHT_UP; |
Doug Zongker | ddd6a28 | 2009-06-09 12:22:33 -0700 | [diff] [blame] | 57 | |
Doug Zongker | cbb9129 | 2009-06-11 14:54:41 -0700 | [diff] [blame] | 58 | case KEY_ENTER: |
| 59 | return SELECT_ITEM; |
| 60 | } |
Doug Zongker | ddd6a28 | 2009-06-09 12:22:33 -0700 | [diff] [blame] | 61 | } |
Doug Zongker | ddd6a28 | 2009-06-09 12:22:33 -0700 | [diff] [blame] | 62 | |
Doug Zongker | cbb9129 | 2009-06-11 14:54:41 -0700 | [diff] [blame] | 63 | return NO_ACTION; |
Doug Zongker | ddd6a28 | 2009-06-09 12:22:33 -0700 | [diff] [blame] | 64 | } |
| 65 | |
Doug Zongker | cbb9129 | 2009-06-11 14:54:41 -0700 | [diff] [blame] | 66 | int device_perform_action(int which) { |
| 67 | return which; |
Doug Zongker | ddd6a28 | 2009-06-09 12:22:33 -0700 | [diff] [blame] | 68 | } |
Doug Zongker | b128f54 | 2009-06-18 15:07:14 -0700 | [diff] [blame] | 69 | |
| 70 | int device_wipe_data() { |
| 71 | return 0; |
| 72 | } |