Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for android 9.0 #454

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public void onCancel(final DialogInterface dialog) {
public void updateDevices() {
// mUSBMonitor.dumpDevices();
final List<DeviceFilter> filter = DeviceFilter.getDeviceFilters(getActivity(), R.xml.device_filter);
mDeviceListAdapter = new DeviceListAdapter(getActivity(), mUSBMonitor.getDeviceList(filter.get(0)));
mDeviceListAdapter = new DeviceListAdapter(getActivity(), mUSBMonitor.getDeviceList(filter));
mSpinner.setAdapter(mDeviceListAdapter);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ private boolean matches(final int clasz, final int subclass, final int protocol)
* @return
*/
public boolean matches(final UsbDevice device) {
Log.i(TAG, "class=" + device.getDeviceClass() + ",subClass=" + device.getDeviceSubclass());
if (mVendorId != -1 && device.getVendorId() != mVendorId) {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -982,6 +982,8 @@ private UsbControlBlock(final USBMonitor monitor, final UsbDevice device) {
}
mBusNum = busnum;
mDevNum = devnum;

try {
// if (DEBUG) {
if (mConnection != null) {
final int desc = mConnection.getFileDescriptor();
Expand All @@ -991,6 +993,9 @@ private UsbControlBlock(final USBMonitor monitor, final UsbDevice device) {
Log.e(TAG, "could not connect to device " + name);
}
// }
} catch (Throwable e){
Log.e(TAG, "UsbControlBlock Throwable:" + e.toString());
}
}

/**
Expand Down
3 changes: 3 additions & 0 deletions libuvccamera/src/main/jni/libusb/libusb/os/android_usbfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2726,6 +2726,9 @@ static int handle_iso_completion(struct libusb_device_handle *handle, // XXX add

usbi_mutex_lock(&itransfer->lock);
for (i = 0; i < num_urbs; i++) {
if (tpriv->iso_urbs == NULL) {
break;
}
if (urb == tpriv->iso_urbs[i]) {
urb_idx = i + 1;
break;
Expand Down
3 changes: 2 additions & 1 deletion usbCameraTest/src/main/res/xml/device_filter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@

<usb>
<usb-device class="239" subclass="2" /> <!-- all device of UVC -->
<usb-device vendor-id="0x1b80" />
<usb-device class="0" subclass="9" />
<usb-device class="2" subclass="0" />
</usb>