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

Commit 36aff502 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "AVRCP, HIDD: Fix crash if stop() is called before start()" into pi-dev

parents 80245ac9 5f4c5cce
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -657,6 +657,11 @@ public class HidDeviceService extends ProfileService {
            Log.d(TAG, "stop()");
            Log.d(TAG, "stop()");
        }
        }


        if (sHidDeviceService == null) {
            Log.w(TAG, "stop() called before start()");
            return true;
        }

        setHidDeviceService(null);
        setHidDeviceService(null);
        if (mNativeAvailable) {
        if (mNativeAvailable) {
            mHidDeviceNativeInterface.cleanup();
            mHidDeviceNativeInterface.cleanup();
+5 −0
Original line number Original line Diff line number Diff line
@@ -169,6 +169,11 @@ public class AvrcpTargetService extends ProfileService {
    protected boolean stop() {
    protected boolean stop() {
        Log.i(TAG, "Stopping the AVRCP Target Service");
        Log.i(TAG, "Stopping the AVRCP Target Service");


        if (sInstance == null) {
            Log.w(TAG, "stop() called before start()");
            return true;
        }

        sInstance = null;
        sInstance = null;
        unregisterReceiver(mReceiver);
        unregisterReceiver(mReceiver);