Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d73ca454 authored by Himanshu Rawat's avatar Himanshu Rawat Committed by William Escande
Browse files

Avoid binder calls in HidHostService

Test: atest HidHostServiceTest
Bug: 332590397
Flag: EXEMPT mechanical refactor
Change-Id: I77fed50bb9653bc66b9137600dc2112c3b990f4f
parent effe9a8b
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -5432,7 +5432,6 @@ public class AdapterService extends Service {
     * @param device the remote device that we want to get UUIDs from
     * @return the uuids of the remote device
     */
    @VisibleForTesting
    public ParcelUuid[] getRemoteUuids(BluetoothDevice device) {
        DeviceProperties deviceProp = mRemoteDevices.getDeviceProperties(device);
        if (deviceProp == null) {
+3 −3
Original line number Diff line number Diff line
@@ -200,7 +200,7 @@ public class HidHostService extends ProfileService {
    }

    private byte[] getByteAddress(BluetoothDevice device, int transport) {
        ParcelUuid[] uuids = device.getUuids();
        ParcelUuid[] uuids = mAdapterService.getRemoteUuids(device);

        if (!Flags.allowSwitchingHidAndHogp()) {
            boolean hogpSupported = Utils.arrayContains(uuids, BluetoothUuid.HOGP);
@@ -1106,12 +1106,12 @@ public class HidHostService extends ProfileService {
    boolean setPreferredTransport(BluetoothDevice device, int transport) {
        Log.i(TAG, "setPreferredTransport: device=" + device + " transport=" + transport);

        if (device.getBondState() != BluetoothDevice.BOND_BONDED) {
        if (mAdapterService.getBondState(device) != BluetoothDevice.BOND_BONDED) {
            Log.w(TAG, "Device " + device + " not bonded");
            return false;
        }

        ParcelUuid[] uuids = device.getUuids();
        ParcelUuid[] uuids = mAdapterService.getRemoteUuids(device);
        boolean hidSupported = Utils.arrayContains(uuids, BluetoothUuid.HID);
        boolean hogpSupported = Utils.arrayContains(uuids, BluetoothUuid.HOGP);
        boolean headtrackerSupported =