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

Commit 36607396 authored by Gopi Sakshihally Bhuthaiah's avatar Gopi Sakshihally Bhuthaiah Committed by Gopi Sakshihally Bhuthaiah (xWF)
Browse files

Hid Java bumble test case

added Bond state and hid connection state check before
call hid disconnect from bumble

Bug: 356599351
Test: atest -v HidHostTest
Flag: EXEMPT Test case
Change-Id: I3e2674f55669fd7513e90fcc5830916ff74ca7ed
parent 0ed8ea93
Loading
Loading
Loading
Loading
+9 −3
Original line number Original line Diff line number Diff line
@@ -236,21 +236,27 @@ public class HidHostTest {
        mFutureConnectionIntent = SettableFuture.create();
        mFutureConnectionIntent = SettableFuture.create();


        mDevice = mBumble.getRemoteDevice();
        mDevice = mBumble.getRemoteDevice();
        mFutureBondIntent = SettableFuture.create();
        assertThat(mDevice.createBond()).isTrue();
        assertThat(mDevice.createBond()).isTrue();
        assertThat(mFutureBondIntent.get()).isEqualTo(BluetoothDevice.BOND_BONDED);


        assertThat(mFutureConnectionIntent.get()).isEqualTo(BluetoothProfile.STATE_CONNECTED);
        if (mA2dpService != null
        if (mA2dpService != null) {
                && mA2dpService.getConnectionPolicy(mDevice)
                        == BluetoothProfile.CONNECTION_POLICY_ALLOWED) {
            assertThat(
            assertThat(
                            mA2dpService.setConnectionPolicy(
                            mA2dpService.setConnectionPolicy(
                                    mDevice, BluetoothProfile.CONNECTION_POLICY_FORBIDDEN))
                                    mDevice, BluetoothProfile.CONNECTION_POLICY_FORBIDDEN))
                    .isTrue();
                    .isTrue();
        }
        }
        if (mHfpService != null) {
        if (mHfpService != null
                && mHfpService.getConnectionPolicy(mDevice)
                        == BluetoothProfile.CONNECTION_POLICY_ALLOWED) {
            assertThat(
            assertThat(
                            mHfpService.setConnectionPolicy(
                            mHfpService.setConnectionPolicy(
                                    mDevice, BluetoothProfile.CONNECTION_POLICY_FORBIDDEN))
                                    mDevice, BluetoothProfile.CONNECTION_POLICY_FORBIDDEN))
                    .isTrue();
                    .isTrue();
        }
        }
        assertThat(mFutureConnectionIntent.get()).isEqualTo(BluetoothProfile.STATE_CONNECTED);
    }
    }


    @After
    @After