Commit ebdb4d92 authored by zzy's avatar zzy Committed by Matthew Xie
Browse files

When pbap cleanup, stopSelfResult called twice with same service id

This seemed like to be the root casue of bug 7136940.  The thread 3564 stuck after following log:
09-10 11:24:08.882  3564  V BluetoothPbapService: Pbap Service closeService

bug 7136940
parent 826318bb
......@@ -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 {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment