Sfoglia il codice sorgente

vender ID改为内部变量,否则某些时候获取不对

robbin 3 anni fa
parent
commit
231445cbef

+ 3 - 3
app/src/main/java/com/example/administrator/wingcool_gt9_apk/GT9MainActivity.java

@@ -102,7 +102,7 @@ public class GT9MainActivity extends AppCompatActivity
     public static List<Activity> activityList = new LinkedList();
 
     private int iProductId;
-    private int iVendorId;
+    //private int iVendorId;
     private String strVersion;
     private int iDeviceId;
 
@@ -562,7 +562,7 @@ public class GT9MainActivity extends AppCompatActivity
 
                             for (UsbDevice usbDevice : deviceList.values()) {
                                 //int productId = usbDevice.getProductId();
-                                iVendorId = usbDevice.getVendorId();
+                                int iVendorId = usbDevice.getVendorId();
                                 if ((iVendorId == 0x27C0)          //之前VID错误了,做兼容
                                         ||(iVendorId == 0x27C6)    //汇顶的VID
                                         ||(iVendorId == 0x222A)    //奕力的VID
@@ -616,7 +616,7 @@ public class GT9MainActivity extends AppCompatActivity
         if (!values.isEmpty()) {
             for (UsbDevice usbDevice : values) {
                 //int productId = usbDevice.getProductId();
-                iVendorId = usbDevice.getVendorId();
+                int iVendorId = usbDevice.getVendorId();
                 //if (productId == 0x0818 || productId == 0x0001 )
                 if ((iVendorId == 0x27C0)          //之前VID错误了,做兼容
                         ||(iVendorId == 0x27C6)    //汇顶的VID