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

Commit 8f5d6e62 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Bluetooth: Cleanup the handler threads properly"

parents e5a7b1d0 a588c0ef
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -87,6 +87,16 @@ class AdvertiseManager {
    void cleanup() {
        logd("advertise clients cleared");
        mAdvertiseClients.clear();

        if (mHandler != null) {
            // Shut down the thread
            mHandler.removeCallbacksAndMessages(null);
            Looper looper = mHandler.getLooper();
            if (looper != null) {
                looper.quit();
            }
            mHandler = null;
        }
    }

    /**
+10 −0
Original line number Diff line number Diff line
@@ -101,6 +101,16 @@ public class ScanManager {
        mRegularScanClients.clear();
        mBatchClients.clear();
        mScanNative.cleanup();

        if (mHandler != null) {
            // Shut down the thread
            mHandler.removeCallbacksAndMessages(null);
            Looper looper = mHandler.getLooper();
            if (looper != null) {
                looper.quit();
            }
            mHandler = null;
        }
    }

    /**