Don't send the onServiceDisconnected callback after close.

Bug: 18667402
Change-Id: Ia029fd861d643f6646fb124d76ca2a1d2a1a695a
This commit is contained in:
Benjamin Franz
2014-12-16 15:33:03 +00:00
parent 48f9c8e48c
commit c88b6bdcfa

View File

@@ -229,7 +229,6 @@ public final class BluetoothHeadset implements BluetoothProfile {
private ServiceListener mServiceListener;
private IBluetoothHeadset mService;
private BluetoothAdapter mAdapter;
private boolean mIsClosed;
final private IBluetoothStateChangeCallback mBluetoothStateChangeCallback =
new IBluetoothStateChangeCallback.Stub() {
@@ -260,7 +259,6 @@ public final class BluetoothHeadset implements BluetoothProfile {
mContext = context;
mServiceListener = l;
mAdapter = BluetoothAdapter.getDefaultAdapter();
mIsClosed = false;
IBluetoothManager mgr = mAdapter.getBluetoothManager();
if (mgr != null) {
@@ -314,7 +312,7 @@ public final class BluetoothHeadset implements BluetoothProfile {
Log.e(TAG,"",e);
}
}
mIsClosed = true;
mServiceListener = null;
doUnbind();
}
@@ -983,9 +981,6 @@ public final class BluetoothHeadset implements BluetoothProfile {
if (mServiceListener != null) {
mServiceListener.onServiceDisconnected(BluetoothProfile.HEADSET);
}
if (mIsClosed){
mServiceListener = null;
}
break;
}
}