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

Commit 895f3591 authored by Sungsoo Lim's avatar Sungsoo Lim
Browse files

Fix failing test of BluetoothOppBtEnableActivityTest

The test failes when the screen is off.
And remove unused code.

Bug: 259746458
Test: atest BluetoothInstrumentationTests:BluetoothOppBtEnableActivityTest
Change-Id: Ia87a963e7b9b57fe9979320972218126c268e1c2
Merged-In: Ia87a963e7b9b57fe9979320972218126c268e1c2
(cherry picked from commit f2e5e576)
parent b132f610
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -25,6 +25,8 @@
    </target_preparer>
    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
        <option name="throw-if-cmd-fail" value="true" />
        <option name="run-command" value="input keyevent KEYCODE_WAKEUP" />
        <option name="run-command" value="wm dismiss-keyguard" />
        <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" />
+2 −0
Original line number Diff line number Diff line
@@ -25,6 +25,8 @@
    </target_preparer>
    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
        <option name="throw-if-cmd-fail" value="true" />
        <option name="run-command" value="input keyevent KEYCODE_WAKEUP" />
        <option name="run-command" value="wm dismiss-keyguard" />
        <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" />
+0 −14
Original line number Diff line number Diff line
@@ -77,18 +77,4 @@ public class BluetoothOppBtEnableActivityTest {
                isDialog()).check(matches(isDisplayed())).perform(click());
        intended(hasComponent(BluetoothOppBtEnablingActivity.class.getName()));
    }


    private void enableActivity(boolean enable) {
        int enabledState = enable ? COMPONENT_ENABLED_STATE_ENABLED
                : COMPONENT_ENABLED_STATE_DEFAULT;

        mTargetContext.getPackageManager().setApplicationEnabledSetting(
                mTargetContext.getPackageName(), enabledState, DONT_KILL_APP);

        ComponentName activityName = new ComponentName(mTargetContext,
                BluetoothOppBtEnableActivity.class);
        mTargetContext.getPackageManager().setComponentEnabledSetting(
                activityName, enabledState, DONT_KILL_APP);
    }
}