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

Commit a41f25b1 authored by Mathieu Mandret's avatar Mathieu Mandret Committed by Android Build Coastguard Worker
Browse files

Disable UWB before starting VtsHalUwbTargetTest

VtsHalUwbTargetTest opens/closes UWB HAL multiple times.
However UWB HAL only accepts 1 client at a time so if
UWB is enabled Android Framework will have UWB HAL open
and prevent any other client from opening it.

Matching NFC VTS behavior from VtsAidlHalNfcTargetTest.cpp, VtsHalUwbTargetTest now disables
UWB before running its tests.

Test: atest VtsHalUwbTargetTest
Bug: 328326697
(cherry picked from https://android-review.googlesource.com/q/commit:6bab73f7eaf9704347cbf5e7a56463b18c5773f9)
Merged-In: I4dfff45015232bbd0a4445e42b13db3ff2d9e87c
Change-Id: I4dfff45015232bbd0a4445e42b13db3ff2d9e87c
parent b5735405
Loading
Loading
Loading
Loading
+8 −1
Original line number Original line Diff line number Diff line
@@ -216,5 +216,12 @@ int main(int argc, char** argv) {
    ::testing::InitGoogleTest(&argc, argv);
    ::testing::InitGoogleTest(&argc, argv);
    ProcessState::self()->setThreadPoolMaxThreadCount(1);
    ProcessState::self()->setThreadPoolMaxThreadCount(1);
    ProcessState::self()->startThreadPool();
    ProcessState::self()->startThreadPool();
    return RUN_ALL_TESTS();
    // UWB HAL only allows 1 client, make sure framework
    // does not have UWB HAL open before running
    std::system("/system/bin/cmd uwb disable-uwb");
    sleep(3);
    auto status = RUN_ALL_TESTS();
    sleep(3);
    std::system("/system/bin/cmd uwb enable-uwb");
    return status;
}
}