Merge "Don't send the onServiceDisconnected callback after close." into lmp-mr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
cd460538a4
@@ -229,7 +229,6 @@ public final class BluetoothHeadset implements BluetoothProfile {
|
|||||||
private ServiceListener mServiceListener;
|
private ServiceListener mServiceListener;
|
||||||
private IBluetoothHeadset mService;
|
private IBluetoothHeadset mService;
|
||||||
private BluetoothAdapter mAdapter;
|
private BluetoothAdapter mAdapter;
|
||||||
private boolean mIsClosed;
|
|
||||||
|
|
||||||
final private IBluetoothStateChangeCallback mBluetoothStateChangeCallback =
|
final private IBluetoothStateChangeCallback mBluetoothStateChangeCallback =
|
||||||
new IBluetoothStateChangeCallback.Stub() {
|
new IBluetoothStateChangeCallback.Stub() {
|
||||||
@@ -260,7 +259,6 @@ public final class BluetoothHeadset implements BluetoothProfile {
|
|||||||
mContext = context;
|
mContext = context;
|
||||||
mServiceListener = l;
|
mServiceListener = l;
|
||||||
mAdapter = BluetoothAdapter.getDefaultAdapter();
|
mAdapter = BluetoothAdapter.getDefaultAdapter();
|
||||||
mIsClosed = false;
|
|
||||||
|
|
||||||
IBluetoothManager mgr = mAdapter.getBluetoothManager();
|
IBluetoothManager mgr = mAdapter.getBluetoothManager();
|
||||||
if (mgr != null) {
|
if (mgr != null) {
|
||||||
@@ -314,7 +312,7 @@ public final class BluetoothHeadset implements BluetoothProfile {
|
|||||||
Log.e(TAG,"",e);
|
Log.e(TAG,"",e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mIsClosed = true;
|
mServiceListener = null;
|
||||||
doUnbind();
|
doUnbind();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -983,9 +981,6 @@ public final class BluetoothHeadset implements BluetoothProfile {
|
|||||||
if (mServiceListener != null) {
|
if (mServiceListener != null) {
|
||||||
mServiceListener.onServiceDisconnected(BluetoothProfile.HEADSET);
|
mServiceListener.onServiceDisconnected(BluetoothProfile.HEADSET);
|
||||||
}
|
}
|
||||||
if (mIsClosed){
|
|
||||||
mServiceListener = null;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user