diff --git a/android-mobile/AndroidManifest.xml b/android-mobile/AndroidManifest.xml index 0a591eb99..de4ff68ab 100644 --- a/android-mobile/AndroidManifest.xml +++ b/android-mobile/AndroidManifest.xml @@ -11,7 +11,7 @@ android:label="@string/app_name" android:icon="@drawable/subsurface_mobile_icon" > 20) { + // Log.i(TAG + " onNewIntent manufacturer name", device.getManufacturerName()); + // Log.i(TAG + " onNewIntent product name", device.getProductName()); + // } + Log.i(TAG + " onNewIntent toString", device.toString()); + super.onNewIntent(intent); + setIntent(intent); + // Intent will be processed, if all is initialized and Qt / QML can handle the event + if (isInitialized) { + processIntent(); + } else { + isIntentPending = true; + } + } // onNewIntent + + public void checkPendingIntents(String workingDir) { + isInitialized = true; + Log.i(TAG + " checkPendingIntents", workingDir); + if (isIntentPending) { + isIntentPending = false; + Log.i(TAG + " checkPendingIntents", "checkPendingIntents: true"); + processIntent(); + } else { + Log.i(TAG + " checkPendingIntents", "nothingPending"); + } + } // checkPendingIntents + + + private void processIntent() { + Intent intent = getIntent(); + 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()); + } // processIntent +}