From ba5692ea724e14ca83715b1a00b28be838813945 Mon Sep 17 00:00:00 2001 From: Hungyen Weng Date: Mon, 4 May 2020 02:09:03 +0000 Subject: Revert "BluetoothProfileConnecter now calls the ServiceListener'..." Revert submission 11348591-btmap-close-gts Reason for revert: Droidcop reverted the change due to test failure, Test failed. https://android-build.googleplex.com/builds/tests/view?invocationId=I05500004181087103&testResultId=TR42507671126333727 Reverted Changes: I324b4ea66:BluetoothProfileConnecter now calls the ServiceLis... I1427f1a86:Add GTS test for BluetoothMap#close Bug: 155587865 Change-Id: I9a2645c7bbaec9fdf0c6f5972b08ba70cfe78741 --- .../bluetooth/BluetoothProfileConnector.java | 24 ++++++++-------------- 1 file changed, 9 insertions(+), 15 deletions(-) (limited to 'core/java') diff --git a/core/java/android/bluetooth/BluetoothProfileConnector.java b/core/java/android/bluetooth/BluetoothProfileConnector.java index 040f58ae4863..863fd3698cbd 100644 --- a/core/java/android/bluetooth/BluetoothProfileConnector.java +++ b/core/java/android/bluetooth/BluetoothProfileConnector.java @@ -103,21 +103,14 @@ public abstract class BluetoothProfileConnector { 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 { } void disconnect() { + mServiceListener = null; IBluetoothManager mgr = BluetoothAdapter.getDefaultAdapter().getBluetoothManager(); if (mgr != null) { try { -- cgit v1.2.3