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

Commit f3722be6 authored by Arthur Ishiguro's avatar Arthur Ishiguro
Browse files

Fix race condition in HubEndpoint active sessions

Bug: 381150090
Flag: android.chre.flags.offload_implementation
Test: Confirm race condition is fixed on device
Change-Id: I9855cba9f1330b4f18ff8d6e0466e2ee1289ae93
parent d8a54bb7
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -404,11 +404,11 @@ public class HubEndpoint {

        HubEndpointSession newSession;
        try {
            synchronized (mLock) {
                // Request system service to assign session id.
                int sessionId = mServiceToken.openSession(destinationInfo, serviceDescriptor);

                // Save the newly created session
            synchronized (mLock) {
                newSession =
                        new HubEndpointSession(
                                sessionId,