@@ -32,15 +32,15 @@ public class HIDDeviceManager {
3232 private static HIDDeviceManager sManager ;
3333 private static int sManagerRefCount = 0 ;
3434
35- public static HIDDeviceManager acquire (Context context ) {
35+ static public HIDDeviceManager acquire (Context context ) {
3636 if (sManagerRefCount == 0 ) {
3737 sManager = new HIDDeviceManager (context );
3838 }
3939 ++sManagerRefCount ;
4040 return sManager ;
4141 }
4242
43- public static void release (HIDDeviceManager manager ) {
43+ static public void release (HIDDeviceManager manager ) {
4444 if (manager == sManager ) {
4545 --sManagerRefCount ;
4646 if (sManagerRefCount == 0 ) {
@@ -121,11 +121,11 @@ private HIDDeviceManager(final Context context) {
121121 }
122122 }
123123
124- public Context getContext () {
124+ Context getContext () {
125125 return mContext ;
126126 }
127127
128- public int getDeviceIDForIdentifier (String identifier ) {
128+ int getDeviceIDForIdentifier (String identifier ) {
129129 SharedPreferences .Editor spedit = mSharedPreferences .edit ();
130130
131131 int result = mSharedPreferences .getInt (identifier , 0 );
@@ -288,9 +288,13 @@ private boolean isXboxOneController(UsbDevice usbDevice, UsbInterface usbInterfa
288288 0x1532 , // Razer Wildcat
289289 0x20d6 , // PowerA
290290 0x24c6 , // PowerA
291+ 0x294b , // Snakebyte
291292 0x2dc8 , // 8BitDo
292293 0x2e24 , // Hyperkin
294+ 0x2e95 , // SCUF
295+ 0x3285 , // Nacon
293296 0x3537 , // GameSir
297+ 0x366c , // ByoWave
294298 };
295299
296300 if (usbInterface .getId () == 0 &&
@@ -355,7 +359,7 @@ private void connectHIDDeviceUSB(UsbDevice usbDevice) {
355359 HIDDeviceUSB device = new HIDDeviceUSB (this , usbDevice , interface_index );
356360 int id = device .getId ();
357361 mDevicesById .put (id , device );
358- HIDDeviceConnected (id , device .getIdentifier (), device .getVendorId (), device .getProductId (), device .getSerialNumber (), device .getVersion (), device .getManufacturerName (), device .getProductName (), usbInterface .getId (), usbInterface .getInterfaceClass (), usbInterface .getInterfaceSubclass (), usbInterface .getInterfaceProtocol ());
362+ HIDDeviceConnected (id , device .getIdentifier (), device .getVendorId (), device .getProductId (), device .getSerialNumber (), device .getVersion (), device .getManufacturerName (), device .getProductName (), usbInterface .getId (), usbInterface .getInterfaceClass (), usbInterface .getInterfaceSubclass (), usbInterface .getInterfaceProtocol (), false );
359363 }
360364 }
361365 }
@@ -439,7 +443,7 @@ private void shutdownBluetooth() {
439443 // Chromebooks do not pass along ACTION_ACL_CONNECTED / ACTION_ACL_DISCONNECTED properly.
440444 // This function provides a sort of dummy version of that, watching for changes in the
441445 // connected devices and attempting to add controllers as things change.
442- public void chromebookConnectionHandler () {
446+ void chromebookConnectionHandler () {
443447 if (!mIsChromebook ) {
444448 return ;
445449 }
@@ -478,7 +482,7 @@ public void run() {
478482 }, 10000 );
479483 }
480484
481- public boolean connectBluetoothDevice (BluetoothDevice bluetoothDevice ) {
485+ boolean connectBluetoothDevice (BluetoothDevice bluetoothDevice ) {
482486 Log .v (TAG , "connectBluetoothDevice device=" + bluetoothDevice );
483487 synchronized (this ) {
484488 if (mBluetoothDevices .containsKey (bluetoothDevice )) {
@@ -499,7 +503,7 @@ public boolean connectBluetoothDevice(BluetoothDevice bluetoothDevice) {
499503 return true ;
500504 }
501505
502- public void disconnectBluetoothDevice (BluetoothDevice bluetoothDevice ) {
506+ void disconnectBluetoothDevice (BluetoothDevice bluetoothDevice ) {
503507 synchronized (this ) {
504508 HIDDeviceBLESteamController device = mBluetoothDevices .get (bluetoothDevice );
505509 if (device == null )
@@ -513,7 +517,7 @@ public void disconnectBluetoothDevice(BluetoothDevice bluetoothDevice) {
513517 }
514518 }
515519
516- public boolean isSteamController (BluetoothDevice bluetoothDevice ) {
520+ boolean isSteamController (BluetoothDevice bluetoothDevice ) {
517521 // Sanity check. If you pass in a null device, by definition it is never a Steam Controller.
518522 if (bluetoothDevice == null ) {
519523 return false ;
@@ -567,7 +571,7 @@ private HIDDevice getDevice(int id) {
567571 ////////// JNI interface functions
568572 //////////////////////////////////////////////////////////////////////////////////////////////////////
569573
570- public boolean initialize (boolean usb , boolean bluetooth ) {
574+ boolean initialize (boolean usb , boolean bluetooth ) {
571575 Log .v (TAG , "initialize(" + usb + ", " + bluetooth + ")" );
572576
573577 if (usb ) {
@@ -579,7 +583,7 @@ public boolean initialize(boolean usb, boolean bluetooth) {
579583 return true ;
580584 }
581585
582- public boolean openDevice (int deviceID ) {
586+ boolean openDevice (int deviceID ) {
583587 Log .v (TAG , "openDevice deviceID=" + deviceID );
584588 HIDDevice device = getDevice (deviceID );
585589 if (device == null ) {
@@ -621,7 +625,7 @@ public boolean openDevice(int deviceID) {
621625 return false ;
622626 }
623627
624- public int writeReport (int deviceID , byte [] report , boolean feature ) {
628+ int writeReport (int deviceID , byte [] report , boolean feature ) {
625629 try {
626630 //Log.v(TAG, "writeReport deviceID=" + deviceID + " length=" + report.length);
627631 HIDDevice device ;
@@ -638,7 +642,7 @@ public int writeReport(int deviceID, byte[] report, boolean feature) {
638642 return -1 ;
639643 }
640644
641- public boolean readReport (int deviceID , byte [] report , boolean feature ) {
645+ boolean readReport (int deviceID , byte [] report , boolean feature ) {
642646 try {
643647 //Log.v(TAG, "readReport deviceID=" + deviceID);
644648 HIDDevice device ;
@@ -655,7 +659,7 @@ public boolean readReport(int deviceID, byte[] report, boolean feature) {
655659 return false ;
656660 }
657661
658- public void closeDevice (int deviceID ) {
662+ void closeDevice (int deviceID ) {
659663 try {
660664 Log .v (TAG , "closeDevice deviceID=" + deviceID );
661665 HIDDevice device ;
@@ -679,7 +683,7 @@ public void closeDevice(int deviceID) {
679683 private native void HIDDeviceRegisterCallback ();
680684 private native void HIDDeviceReleaseCallback ();
681685
682- native void HIDDeviceConnected (int deviceID , String identifier , int vendorId , int productId , String serial_number , int release_number , String manufacturer_string , String product_string , int interface_number , int interface_class , int interface_subclass , int interface_protocol );
686+ native void HIDDeviceConnected (int deviceID , String identifier , int vendorId , int productId , String serial_number , int release_number , String manufacturer_string , String product_string , int interface_number , int interface_class , int interface_subclass , int interface_protocol , boolean bBluetooth );
683687 native void HIDDeviceOpenPending (int deviceID );
684688 native void HIDDeviceOpenResult (int deviceID , boolean opened );
685689 native void HIDDeviceDisconnected (int deviceID );
0 commit comments