Troubleshoot device previously claimed issues
This commit is contained in:
parent
23f0842e9a
commit
1296c3ec39
1 changed files with 23 additions and 15 deletions
|
@ -64,6 +64,7 @@ class ConfirmInfoFragment : WizardFragment() {
|
||||||
|
|
||||||
view.confirm_sel_usbdev.text = StateKeeper.usbDevice?.name
|
view.confirm_sel_usbdev.text = StateKeeper.usbDevice?.name
|
||||||
|
|
||||||
|
for (trial in 0..1) {
|
||||||
try {
|
try {
|
||||||
StateKeeper.usbMassStorageDevice!!.init()
|
StateKeeper.usbMassStorageDevice!!.init()
|
||||||
val blockDev = StateKeeper.usbMassStorageDevice?.blockDevice
|
val blockDev = StateKeeper.usbMassStorageDevice?.blockDevice
|
||||||
|
@ -82,7 +83,14 @@ class ConfirmInfoFragment : WizardFragment() {
|
||||||
view.confirm_extra_info.text = getString(R.string.cant_read_usbdev)
|
view.confirm_extra_info.text = getString(R.string.cant_read_usbdev)
|
||||||
}
|
}
|
||||||
} catch (e: IOException) {
|
} 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."
|
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
|
return view
|
||||||
|
|
Loading…
Reference in a new issue