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

Commit d8809d66 authored by zzy's avatar zzy Committed by Android Git Automerger
Browse files

am a6ad2d00: When pbap cleanup, stopSelfResult called twice with same service id

* commit 'a6ad2d00':
  When pbap cleanup,  stopSelfResult called twice with same service id
parents 66ac4242 a6ad2d00
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -385,18 +385,20 @@ public class BluetoothPbapService extends Service {

            if (mServerSocket != null) {
                mServerSocket.close();
                mServerSocket = null;
            }
        }

        if (accept == true) {
            if (mConnSocket != null) {
                mConnSocket.close();
                mConnSocket = null;
            }
        }
    }

    private final void closeService() {
        if (VERBOSE) Log.v(TAG, "Pbap Service closeService");
        if (VERBOSE) Log.v(TAG, "Pbap Service closeService in");

        try {
            closeSocket(true, true);
@@ -413,18 +415,17 @@ public class BluetoothPbapService extends Service {
                Log.w(TAG, "mAcceptThread close error" + ex);
            }
        }
        mServerSocket = null;
        mConnSocket = null;

        if (mServerSession != null) {
            mServerSession.close();
            mServerSession = null;
        }

        mHasStarted = false;
        if (stopSelfResult(mStartId)) {
        if (mStartId != -1 && stopSelfResult(mStartId)) {
            if (VERBOSE) Log.v(TAG, "successfully stopped pbap service");
            mStartId = -1;
        }
        if (VERBOSE) Log.v(TAG, "Pbap Service closeService out");
    }

    private final void startObexServerSession() throws IOException {