VtsHalBluetoothV1_0: Turn off/on BT for all users

Using the current user for the command to disable
BT before the test and enable after the test.
This ensures the proper command is used for
devices running in secondary user

Bug: 202873250
Test: run vts -m VtsHalBluetoothV1_0TargetTest
          -t PerInstance/BluetoothHidlTest#InitializeAndClose/0_default
Change-Id: Ica83f4959a87b8fb498b535572738e4e790c6ddb
This commit is contained in:
Karthik Ramakrishnan
2022-02-07 17:37:39 -08:00
parent 8a76d40f99
commit 0dc66a2c69

View File

@@ -22,8 +22,11 @@
<target_preparer class="com.android.tradefed.targetprep.StopServicesSetup">
</target_preparer>
<target_preparer class="com.android.tradefed.targetprep.DeviceSetup">
<option name="bluetooth" value="off" />
<target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
<option name="run-command" value="settings put global ble_scan_always_enabled 0" />
<option name="run-command" value="su u$(am get-current-user)_system svc bluetooth disable" />
<option name="teardown-command" value="su u$(am get-current-user)_system svc bluetooth enable" />
<option name="teardown-command" value="settings put global ble_scan_always_enabled 1" />
</target_preparer>
<target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">