android/usb: pass the usbDevice for intent handling

Instead of creating a string with all the object information, simply pass
the actual object to the C++ code.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2020-03-14 17:57:36 -07:00
parent c19e3bd5ba
commit b0eccec8ed
2 changed files with 13 additions and 8 deletions

View file

@ -27,7 +27,7 @@ public class SubsurfaceMobileActivity extends QtActivity
public static boolean isIntentPending;
public static boolean isInitialized;
private static final String TAG = "subsurfacedivelog.mobile";
public static native void setDeviceString(String deviceString);
public static native void setUsbDevice(UsbDevice usbDevice);
private static Context appContext;
// we need to provide two endpoints:
@ -105,7 +105,7 @@ public class SubsurfaceMobileActivity extends QtActivity
return;
}
Log.i(TAG + " processIntent device name", device.getDeviceName());
setDeviceString(device.toString());
setUsbDevice(device);
} // processIntent