Merge "Revert "BluetoothProfileConnecter now calls the ServiceListener'..."" into rvc-dev am: 1c85c4501b am: ea25bab747 am: a2cdf90fe3
Change-Id: I0d8e7873d52ed7fa7d26df0ca30f31ae8c7e3e6d
This commit is contained in:
@@ -103,21 +103,14 @@ public abstract class BluetoothProfileConnector<T> {
|
||||
|
||||
private void doUnbind() {
|
||||
synchronized (mConnection) {
|
||||
try {
|
||||
if (mService != null) {
|
||||
logDebug("Unbinding service...");
|
||||
try {
|
||||
mContext.unbindService(mConnection);
|
||||
} catch (IllegalArgumentException ie) {
|
||||
logError("Unable to unbind service: " + ie);
|
||||
} finally {
|
||||
mService = null;
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
if (mServiceListener != null) {
|
||||
mServiceListener.onServiceDisconnected(mProfileId);
|
||||
mServiceListener = null;
|
||||
if (mService != null) {
|
||||
logDebug("Unbinding service...");
|
||||
try {
|
||||
mContext.unbindService(mConnection);
|
||||
} catch (IllegalArgumentException ie) {
|
||||
logError("Unable to unbind service: " + ie);
|
||||
} finally {
|
||||
mService = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -138,6 +131,7 @@ public abstract class BluetoothProfileConnector<T> {
|
||||
}
|
||||
|
||||
void disconnect() {
|
||||
mServiceListener = null;
|
||||
IBluetoothManager mgr = BluetoothAdapter.getDefaultAdapter().getBluetoothManager();
|
||||
if (mgr != null) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user