aboutsummaryrefslogtreecommitdiffstats
path: root/android-mobile
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2020-03-14 18:07:24 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-03-16 07:58:20 -0700
commit1495aa2dbf5366cc135c1ceb959c6a12abbb3e0b (patch)
tree46e13344481a0bc20446dafaf29ed021f8d4d8bf /android-mobile
parent4cd453dc928397bb70c4bc0be4f27eb21894e3c8 (diff)
downloadsubsurface-1495aa2dbf5366cc135c1ceb959c6a12abbb3e0b.tar.gz
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>
Diffstat (limited to 'android-mobile')
-rw-r--r--android-mobile/src/org/subsurfacedivelog/mobile/SubsurfaceMobileActivity.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/android-mobile/src/org/subsurfacedivelog/mobile/SubsurfaceMobileActivity.java b/android-mobile/src/org/subsurfacedivelog/mobile/SubsurfaceMobileActivity.java
index c50dfb237..0d6e5bbe1 100644
--- a/android-mobile/src/org/subsurfacedivelog/mobile/SubsurfaceMobileActivity.java
+++ b/android-mobile/src/org/subsurfacedivelog/mobile/SubsurfaceMobileActivity.java
@@ -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");
}
}
}