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

Commit a0af5152 authored by Hyundo Moon's avatar Hyundo Moon
Browse files

Remove service.isEnabled() checks from unit tests

Bug: 263147370
Test: atest BluetoothInstrumentationTests
Change-Id: Id518025c5c94244d7b982ab2d464464e68230a84
parent 067e37d9
Loading
Loading
Loading
Loading
+0 −17
Original line number Diff line number Diff line
@@ -30,26 +30,9 @@
        <option name="run-command" value="settings put global ble_scan_always_enabled 0" />
        <option name="run-command" value="cmd bluetooth_manager disable" />
        <option name="run-command" value="cmd bluetooth_manager wait-for-state:STATE_OFF" />
        <option name="run-command" value="setprop bluetooth.profile.hfp.hf.enabled true" />
        <option name="run-command" value="setprop bluetooth.profile.pbap.client.enabled true" />
        <option name="run-command" value="setprop bluetooth.profile.map.client.enabled true" />
        <option name="run-command"
                value="setprop bluetooth.profile.avrcp.controller.enabled true" />
        <option name="run-command" value="setprop bluetooth.profile.a2dp.sink.enabled true" />
        <option name="run-command" value="setprop bluetooth.profile.sap.server.enabled true" />
        <option name="teardown-command" value="cmd bluetooth_manager enable" />
        <option name="teardown-command" value="cmd bluetooth_manager wait-for-state:STATE_ON" />
        <option name="teardown-command" value="settings put global ble_scan_always_enabled 1" />
        <option name="teardown-command" value="setprop bluetooth.profile.hfp.hf.enabled false" />
        <option name="teardown-command"
                value="setprop bluetooth.profile.pbap.client.enabled false" />
        <option name="teardown-command"
                value="setprop bluetooth.profile.map.client.enabled false" />
        <option name="teardown-command"
                value="setprop bluetooth.profile.avrcp.controller.enabled false" />
        <option name="teardown-command" value="setprop bluetooth.profile.a2dp.sink.enabled false" />
        <option name="teardown-command"
                value="setprop bluetooth.profile.sap.server.enabled false" />
    </target_preparer>
    <target_preparer class="com.android.tradefed.targetprep.FolderSaver">
        <option name="device-path" value="/data/vendor/ssrdump" />
+0 −17
Original line number Diff line number Diff line
@@ -30,26 +30,9 @@
        <option name="run-command" value="settings put global ble_scan_always_enabled 0" />
        <option name="run-command" value="cmd bluetooth_manager disable" />
        <option name="run-command" value="cmd bluetooth_manager wait-for-state:STATE_OFF" />
        <option name="run-command" value="setprop bluetooth.profile.hfp.hf.enabled true" />
        <option name="run-command" value="setprop bluetooth.profile.pbap.client.enabled true" />
        <option name="run-command" value="setprop bluetooth.profile.map.client.enabled true" />
        <option name="run-command"
                value="setprop bluetooth.profile.avrcp.controller.enabled true" />
        <option name="run-command" value="setprop bluetooth.profile.a2dp.sink.enabled true" />
        <option name="run-command" value="setprop bluetooth.profile.sap.server.enabled true" />
        <option name="teardown-command" value="cmd bluetooth_manager enable" />
        <option name="teardown-command" value="cmd bluetooth_manager wait-for-state:STATE_ON" />
        <option name="teardown-command" value="settings put global ble_scan_always_enabled 1" />
        <option name="teardown-command"
                value="setprop bluetooth.profile.pbap.client.enabled false" />
        <option name="teardown-command"
                value="setprop bluetooth.profile.map.client.enabled false" />
        <option name="teardown-command" value="setprop bluetooth.profile.hfp.hf.enabled false" />
        <option name="teardown-command"
                value="setprop bluetooth.profile.avrcp.controller.enabled false" />
        <option name="teardown-command" value="setprop bluetooth.profile.a2dp.sink.enabled false" />
        <option name="teardown-command"
                value="setprop bluetooth.profile.sap.server.enabled false" />
    </target_preparer>
    <target_preparer class="com.android.tradefed.targetprep.FolderSaver">
        <option name="device-path" value="/data/vendor/ssrdump" />
+0 −5
Original line number Diff line number Diff line
@@ -68,8 +68,6 @@ public class AvrcpControllerServiceTest {

    @Before
    public void setUp() throws Exception {
        Assume.assumeTrue("Ignore test when AvrcpControllerService is not enabled",
                AvrcpControllerService.isEnabled());
        MockitoAnnotations.initMocks(this);
        TestUtils.setAdapterService(mAdapterService);
        doReturn(true, false).when(mAdapterService).isStartedProfile(anyString());
@@ -85,9 +83,6 @@ public class AvrcpControllerServiceTest {

    @After
    public void tearDown() throws Exception {
        if (!AvrcpControllerService.isEnabled()) {
            return;
        }
        TestUtils.stopService(mServiceRule, AvrcpControllerService.class);
        mService = AvrcpControllerService.getAvrcpControllerService();
        assertThat(mService).isNull();
+0 −5
Original line number Diff line number Diff line
@@ -91,8 +91,6 @@ public class AvrcpControllerStateMachineTest {

    @Before
    public void setUp() throws Exception {
        Assume.assumeTrue("Ignore test when AVRCP Controller is not enabled",
                AvrcpControllerService.isEnabled());
        if (Looper.myLooper() == null) {
            Looper.prepare();
        }
@@ -142,9 +140,6 @@ public class AvrcpControllerStateMachineTest {

    @After
    public void tearDown() throws Exception {
        if (!AvrcpControllerService.isEnabled()) {
            return;
        }
        destroyStateMachine(mAvrcpStateMachine);
        TestUtils.clearAdapterService(mAvrcpAdapterService);
    }
+0 −6
Original line number Diff line number Diff line
@@ -72,9 +72,6 @@ public class BatteryServiceTest {
    @Before
    public void setUp() throws Exception {
        mTargetContext = InstrumentationRegistry.getTargetContext();
        Assume.assumeTrue("Ignore test when BatteryService is not enabled",
                BatteryService.isEnabled());

        if (Looper.myLooper() == null) {
            Looper.prepare();
        }
@@ -98,9 +95,6 @@ public class BatteryServiceTest {

    @After
    public void tearDown() throws Exception {
        if (!BatteryService.isEnabled()) {
            return;
        }
        stopService();
        TestUtils.clearAdapterService(mAdapterService);
    }
Loading