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

Commit f4b08e08 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Fix concurrency issues on state machine shutdown" am: a342218e am:...

Merge "Fix concurrency issues on state machine shutdown" am: a342218e am: 9a2de913 am: 8bb033e5

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/1976760

Change-Id: I571a4b7c83b31cc2364d1799000105428c0cd3c3
parents c9eb2de7 8bb033e5
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -216,8 +216,13 @@ public class A2dpService extends ProfileService {
        }

        if (mStateMachinesThread != null) {
            try {
                mStateMachinesThread.quitSafely();
                mStateMachinesThread.join();
                mStateMachinesThread = null;
            } catch (InterruptedException e) {
                // Do not rethrow as we are shutting down anyway
            }
        }
        // Step 2: Reset maximum number of connected audio devices
        mMaxConnectedAudioDevices = 1;
+7 −2
Original line number Diff line number Diff line
@@ -182,8 +182,13 @@ public class CsipSetCoordinatorService extends ProfileService {
        }

        if (mStateMachinesThread != null) {
            try {
                mStateMachinesThread.quitSafely();
                mStateMachinesThread.join();
                mStateMachinesThread = null;
            } catch (InterruptedException e) {
                // Do not rethrow as we are shutting down anyway
            }
        }

        mDeviceGroupIdMap.clear();
+7 −2
Original line number Diff line number Diff line
@@ -208,8 +208,13 @@ public class HapClientService extends ProfileService {
        mPresetsMap.clear();

        if (mStateMachinesThread != null) {
            try {
                mStateMachinesThread.quitSafely();
                mStateMachinesThread.join();
                mStateMachinesThread = null;
            } catch (InterruptedException e) {
                // Do not rethrow as we are shutting down anyway
            }
        }

        // Clear AdapterService
+7 −2
Original line number Diff line number Diff line
@@ -189,8 +189,13 @@ public class HearingAidService extends ProfileService {
        mHiSyncIdConnectedMap.clear();

        if (mStateMachinesThread != null) {
            try {
                mStateMachinesThread.quitSafely();
                mStateMachinesThread.join();
                mStateMachinesThread = null;
            } catch (InterruptedException e) {
                // Do not rethrow as we are shutting down anyway
            }
        }

        // Clear AdapterService, HearingAidNativeInterface
+8 −2
Original line number Diff line number Diff line
@@ -237,8 +237,14 @@ public class HeadsetService extends ProfileService {
        // Step 3: Destroy system interface
        mSystemInterface.stop();
        // Step 2: Stop handler thread
        try {
            mStateMachinesThread.quitSafely();
            mStateMachinesThread.join();
            mStateMachinesThread = null;
        } catch (InterruptedException e) {
            // Do not rethrow as we are shutting down anyway
        }

        mStateMachinesThreadHandler = null;
        // Step 1: Clear
        synchronized (mStateMachines) {
Loading