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

Commit ab41fd13 authored by Jack He's avatar Jack He
Browse files

Revert "port this change to aosp/ I3fb908c43f869e8816f6e46c6b271ef0bbd15be0"

This reverts commit ec863325.

Revert because another fix is available
https://android-review.googlesource.com/#/c/platform/packages/apps/Bluetooth/+/525056/

Bug: 67942165
Test: make
Change-Id: I5867345a70ddca32a6c82c57cfe495475b169acd
parent 2aaf2a2c
Loading
Loading
Loading
Loading
+7 −18
Original line number Diff line number Diff line
@@ -49,11 +49,14 @@ public class RemoteDevicesTest {

    @Test
    public void testSendUuidIntent() {
        MyAdapterSvc m = new MyAdapterSvc();
        RemoteDevices instance = new RemoteDevices(m);
        instance.updateUuids(mDevice1);
        mRemoteDevices.updateUuids(mDevice1);
        if (Looper.myLooper() != null) {
            Looper.myLooper().quitSafely();
        }
        Looper.loop();
        Assert.assertTrue(m.isRecvd());

        verify(mAdapterService).sendBroadcast(any(), anyString());
        verifyNoMoreInteractions(mAdapterService);
    }

    @Test
@@ -462,18 +465,4 @@ public class RemoteDevicesTest {
        list.add(0);
        return list.toArray();
    }

    public class MyAdapterSvc extends AdapterService {
        private boolean recvd = false;

        @Override
        public void sendBroadcast(Intent intent, String receiverPermission) {
            recvd = (intent.getAction() == BluetoothDevice.ACTION_UUID);
            if (recvd || Looper.myQueue().isIdle()) Looper.myLooper().quitSafely();
        }

        boolean isRecvd() {
            return recvd;
        }
    }
}