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

Commit 09e621a7 authored by Eric Laurent's avatar Eric Laurent
Browse files

audiopolicy: increase binder command timeout for some commmands

Extend timeout for SET_DEVICE_CONNECTION_STATE and HANDLE_DEVICE_CONFIG_CHANGE
binder commmands in IAudioPolicyService.cpp while we investigate why BT A2DP
device connection/disconnection can sometimes take more than 5 seconds.

Bug: 74840091
Test: check that no timout occurs for A2DP headset connections
Change-Id: I7dcba80059898ac1c73d580594d4956b4608ade0
parent bebc764c
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -883,7 +883,20 @@ status_t BnAudioPolicyService::onTransact(
            break;
    }

    TimeCheck check("IAudioPolicyService");
    // FIXME: extend timeout for SET_DEVICE_CONNECTION_STATE and HANDLE_DEVICE_CONFIG_CHANGE
    // while we investigate why BT A2DP device connection/disconnection can sometimes
    // take more than 5 seconds
    uint32_t timeoutMs = TimeCheck::kDefaultTimeOutMs;
    switch (code) {
        case SET_DEVICE_CONNECTION_STATE:
        case HANDLE_DEVICE_CONFIG_CHANGE:
            timeoutMs *= 2;
            break;
        default:
            break;
    }

    TimeCheck check("IAudioPolicyService", timeoutMs);

    switch (code) {
        case SET_DEVICE_CONNECTION_STATE: {