mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
android/usb: show download page again after USB permission granted
If the user hadn't granted USB permissions, yet, we asynchronously get informed once they did that. This ensures that the user gets taken back to the download page once they approve. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
4cd453dc92
commit
1495aa2dbf
1 changed files with 5 additions and 5 deletions
|
@ -109,17 +109,17 @@ public class SubsurfaceMobileActivity extends QtActivity
|
|||
} // processIntent
|
||||
|
||||
|
||||
private final BroadcastReceiver usbReceiver = new BroadcastReceiver() {
|
||||
private final BroadcastReceiver usbReceiver = new BroadcastReceiver()
|
||||
{
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
String action = intent.getAction();
|
||||
if ("org.subsurfacedivelog.mobile.USB_PERMISSION".equals(action)) {
|
||||
synchronized (this) {
|
||||
if (intent.getBooleanExtra(UsbManager.EXTRA_PERMISSION_GRANTED, false)) {
|
||||
Log.d(TAG, "USB device permission granted");
|
||||
// Stub: press the download button here :)
|
||||
}
|
||||
else {
|
||||
Log.d(TAG, "USB device permission granted");
|
||||
setUsbDevice(null);
|
||||
} else {
|
||||
Log.d(TAG, "USB device permission denied");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue