From 1495aa2dbf5366cc135c1ceb959c6a12abbb3e0b Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 14 Mar 2020 18:07:24 -0700 Subject: 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 --- .../org/subsurfacedivelog/mobile/SubsurfaceMobileActivity.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'android-mobile') 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"); } } } -- cgit v1.2.3-70-g09d2