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

Commit a6b6e1ee authored by Aayush Soni's avatar Aayush Soni
Browse files

VtsHalAudioEffectTargetTest: Fix crash issue

Ensure all pending binder transactions are completed before proceeding. Add a delay to allow the binder destruction to propagate and ensure the remote objects are properly cleaned up.

Bug: 272442019
Test: atest VtsHalAudioEffectV7_0TargetTest

Change-Id: I6dc054b8f7895334c31c5579afb86eacba28d832
parent 9a63fb94
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@
#include <gtest/gtest.h>
#include <hidl/GtestPrinter.h>
#include <hidl/ServiceManagement.h>
#include <hwbinder/IPCThreadState.h>

using ::android::sp;
using ::android::hardware::hidl_handle;
@@ -205,6 +206,11 @@ class AudioEffectHidlTest : public ::testing::TestWithParam<EffectParameter> {
    void TearDown() override {
        effect.clear();
        effectsFactory.clear();
        // Ensure all pending binder transactions are completed before proceeding.
        android::hardware::IPCThreadState::self()->flushCommands();
        // Add a delay to allow the binder destruction to propagate and ensure
        // the remote objects are properly cleaned up.
        usleep(100 * 1000);
    }

   protected: