Troubleshoot device previously claimed issues
This commit is contained in:
parent
0ab09c1f16
commit
5c714a2ad1
1 changed files with 23 additions and 15 deletions
|
@ -64,6 +64,7 @@ class ConfirmInfoFragment : WizardFragment() {
|
|||
|
||||
view.confirm_sel_usbdev.text = StateKeeper.usbDevice?.name
|
||||
|
||||
for (trial in 0..1) {
|
||||
try {
|
||||
StateKeeper.usbMassStorageDevice!!.init()
|
||||
val blockDev = StateKeeper.usbMassStorageDevice?.blockDevice
|
||||
|
@ -82,7 +83,14 @@ class ConfirmInfoFragment : WizardFragment() {
|
|||
view.confirm_extra_info.text = getString(R.string.cant_read_usbdev)
|
||||
}
|
||||
} catch (e: IOException) {
|
||||
if (trial == 0) {
|
||||
StateKeeper.usbMassStorageDevice!!.close()
|
||||
continue
|
||||
} else {
|
||||
view.confirm_extra_info.text = "Could not access USB device. Maybe you ran the app previously and it crashed? Remove and reinsert the USB drive, then restart the app."
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return view
|
||||
|
|
Loading…
Reference in a new issue