Loading android/app/src/com/android/bluetooth/hid/HidHostService.java +9 −5 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.annotation.RequiresPermission; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothHidHost; import android.bluetooth.BluetoothProfile; import android.bluetooth.BluetoothUuid; import android.bluetooth.IBluetoothHidHost; import android.content.AttributionSource; import android.content.Intent; Loading Loading @@ -140,13 +141,16 @@ public class HidHostService extends ProfileService { setHidHostService(null); } private BluetoothDevice getDevice(byte[] address) { return mAdapterService.getDeviceFromByte(address); } private byte[] getByteAddress(BluetoothDevice device) { if (Utils.arrayContains(device.getUuids(), BluetoothUuid.HOGP)) { // if HOGP is available, use the address on initial bonding // (so if we bonded over LE, use the RPA) return Utils.getByteAddress(device); } else { // if only classic HID is available, force usage of BREDR address return mAdapterService.getByteIdentityAddress(device); } } public static synchronized HidHostService getHidHostService() { if (sHidHostService == null) { Loading Loading
android/app/src/com/android/bluetooth/hid/HidHostService.java +9 −5 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.annotation.RequiresPermission; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothHidHost; import android.bluetooth.BluetoothProfile; import android.bluetooth.BluetoothUuid; import android.bluetooth.IBluetoothHidHost; import android.content.AttributionSource; import android.content.Intent; Loading Loading @@ -140,13 +141,16 @@ public class HidHostService extends ProfileService { setHidHostService(null); } private BluetoothDevice getDevice(byte[] address) { return mAdapterService.getDeviceFromByte(address); } private byte[] getByteAddress(BluetoothDevice device) { if (Utils.arrayContains(device.getUuids(), BluetoothUuid.HOGP)) { // if HOGP is available, use the address on initial bonding // (so if we bonded over LE, use the RPA) return Utils.getByteAddress(device); } else { // if only classic HID is available, force usage of BREDR address return mAdapterService.getByteIdentityAddress(device); } } public static synchronized HidHostService getHidHostService() { if (sHidHostService == null) { Loading