|
[插件开发]
求教,自定义插件 apploader在特定设备不执行回调
[复制链接]
在as运行和安卓11用apploader测试都正常,但是在安卓4的设备上不会执行回调
是我哪里写错了吗
```
public void jsmethod_initFingerDevices_sync(final UZModuleContext moduleContext) throws JSONException{
JSONObject json = new JSONObject();
try {
startFingerprintSensor();
initUSBPermission();
fingerprintSensor.open(0);
VerifyOrEnroll();
fingerprintSensor.startCapture(0);
json.put("code",2200);
bstart = true;
moduleContext.success(json,true);
}catch (Exception e){
moduleContext.success(JSON.getErr(e),true);
}
}
public void initUSBPermission()
{
UsbManager usbManager = (UsbManager) getContext().getSystemService(Context.USB_SERVICE);
for (UsbDevice device : usbManager.getDeviceList().values())
{
if (device.getVendorId() == VID && device.getProductId() == PID)
{
Intent intent = new Intent(ACTION_USB_PERMISSION);
PendingIntent pendingIntent = PendingIntent.getBroadcast(getContext(), 0, intent, 0);
usbManager.requestPermission(device, pendingIntent);
}
}
}
```
|
|