|
1 | 1 | package ru.nikita.adb;
|
2 | 2 |
|
3 |
| -import java.util.HashMap; |
4 |
| -import java.util.Iterator; |
5 | 3 | import java.util.List;
|
6 | 4 | import java.util.ArrayList;
|
7 | 5 | import android.os.Bundle;
|
|
11 | 9 | import android.widget.ArrayAdapter;
|
12 | 10 | import android.widget.Toast;
|
13 | 11 | import android.app.Activity;
|
| 12 | +import android.app.AlertDialog; |
14 | 13 | import android.content.Intent;
|
| 14 | +import android.content.DialogInterface; |
15 | 15 | import android.hardware.usb.UsbManager;
|
16 | 16 | import android.hardware.usb.UsbDevice;
|
17 | 17 | import ru.nikita.adb.FastbootVariablesListActivity;
|
@@ -78,8 +78,23 @@ public void deviceInfoAll(View view){
|
78 | 78 | }
|
79 | 79 | public void reboot(View view){
|
80 | 80 | try {
|
81 |
| - if(getSelectedDevice().openConnection(this)) |
82 |
| - getSelectedDevice().reboot(); |
| 81 | + if(getSelectedDevice().openConnection(this)) { |
| 82 | + AlertDialog.Builder b = new AlertDialog.Builder(this); |
| 83 | + b.setTitle(R.string.reboot); |
| 84 | + final String[] items = { |
| 85 | + "", |
| 86 | + "bootloader", |
| 87 | + "recovery", |
| 88 | + }; |
| 89 | + b.setItems(R.array.fastboot_reboot, new DialogInterface.OnClickListener() { |
| 90 | + @Override |
| 91 | + public void onClick(DialogInterface dialog, int which){ |
| 92 | + dialog.dismiss(); |
| 93 | + getSelectedDevice().reboot(items[which]); |
| 94 | + } |
| 95 | + }); |
| 96 | + b.show(); |
| 97 | + } |
83 | 98 | } catch(FastbootException e) {
|
84 | 99 | e.showToast(this);
|
85 | 100 | }
|
|
0 commit comments