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
Bug: 226452499
Test: run vts -m VtsHalBluetoothV1_0TargetTest
          -t PerInstance/BluetoothHidlTest#InitializeAndClose/0_default
Change-Id: Ica83f4959a87b8fb498b535572738e4e790c6ddb
Merged-In: Ica83f4959a87b8fb498b535572738e4e790c6ddb
(cherry picked from commit 0dc66a2c69)
This commit is contained in:
Karthik Ramakrishnan 2022-02-07 17:37:39 -08:00 committed by Cheney Ni
parent bb3b37ec0f
commit 94a3a178aa

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">