From fd58441b085a55df6c6da75131eb75fb0a65a0a1 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Thu, 9 Aug 2018 07:14:56 -0700 Subject: Android: only handle Intents after the app is initialized The old code happened to work because this function only got called if the app was already running, but the correct thing to do is to always wait until we have first called back from C++ code, indicating that the app is indeed fully initialized. This way we only process the Intent in one place in the Java code. Signed-off-by: Dirk Hohndel --- .../subsurfacedivelog/mobile/SubsurfaceMobileActivity.java | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'android-mobile/src/org/subsurfacedivelog/mobile/SubsurfaceMobileActivity.java') diff --git a/android-mobile/src/org/subsurfacedivelog/mobile/SubsurfaceMobileActivity.java b/android-mobile/src/org/subsurfacedivelog/mobile/SubsurfaceMobileActivity.java index 432785f3c..881016285 100644 --- a/android-mobile/src/org/subsurfacedivelog/mobile/SubsurfaceMobileActivity.java +++ b/android-mobile/src/org/subsurfacedivelog/mobile/SubsurfaceMobileActivity.java @@ -53,13 +53,7 @@ public class SubsurfaceMobileActivity extends QtActivity public void onNewIntent(Intent intent) { Log.i(TAG + " onNewIntent", intent.getAction()); UsbDevice device = (UsbDevice) intent.getParcelableExtra(UsbManager.EXTRA_DEVICE); - Log.i(TAG + " onNewIntent device name", device.getDeviceName()); - // if (Build.VERSION.SDK_INT > 20) { - // Log.i(TAG + " onNewIntent manufacturer name", device.getManufacturerName()); - // Log.i(TAG + " onNewIntent product name", device.getProductName()); - // } Log.i(TAG + " onNewIntent toString", device.toString()); - setDeviceString(device.toString()); super.onNewIntent(intent); setIntent(intent); // Intent will be processed, if all is initialized and Qt / QML can handle the event @@ -88,10 +82,6 @@ public class SubsurfaceMobileActivity extends QtActivity Log.i(TAG + " processIntent", intent.getAction()); UsbDevice device = (UsbDevice) intent.getParcelableExtra(UsbManager.EXTRA_DEVICE); Log.i(TAG + " processIntent device name", device.getDeviceName()); - // if (Build.VERSION.SDK_INT > 20) { - // Log.i(TAG + " processIntent manufacturer name", device.getManufacturerName()); - // Log.i(TAG + " processIntent product name", device.getProductName()); - // } - Log.i(TAG + " processIntent toString", device.toString()); + setDeviceString(device.toString()); } // processIntent } -- cgit v1.2.3-70-g09d2