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

Commit f99a9737 authored by Anubhav Gupta's avatar Anubhav Gupta Committed by Andre Eisenbach
Browse files

Check for AVRCP handler validity before cleanup

In stress testing of BT on-off usecase, crash was observed
due to triggering double clean-up. This fix introduces
additional Check for handler validity while clean-up to
avoid the crash.

Bug: 21896912
Change-Id: I14b1c35d1fa0345c59d61682d92795aa617436b5
parent 3e246e22
Loading
Loading
Loading
Loading
+4 −5
Original line number Original line Diff line number Diff line
@@ -82,14 +82,13 @@ public class AvrcpControllerService extends ProfileService {
    }
    }


    protected boolean cleanup() {
    protected boolean cleanup() {
        if (mHandler != null) {
            mHandler.removeCallbacksAndMessages(null);
            mHandler.removeCallbacksAndMessages(null);
            Looper looper = mHandler.getLooper();
            Looper looper = mHandler.getLooper();
        if (looper != null) {
            if (looper != null) looper.quit();
            looper.quit();
        }
        }


        clearAvrcpControllerService();
        clearAvrcpControllerService();

        cleanupNative();
        cleanupNative();


        return true;
        return true;