Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 443a7030 authored by Rahul Sabnis's avatar Rahul Sabnis
Browse files

BluetoothProfileConnecter now calls the ServiceListener's

onServiceDisconnected method after unbinding the service

Bug: 155120232
Test: atest BluetoothHostTest#testMapClose
Change-Id: I324b4ea6654261eb67d5ec184f6b3456ba3d1aa4
parent 54846525
Loading
Loading
Loading
Loading
+15 −9
Original line number Diff line number Diff line
@@ -103,6 +103,7 @@ public abstract class BluetoothProfileConnector<T> {

    private void doUnbind() {
        synchronized (mConnection) {
            try {
                if (mService != null) {
                    logDebug("Unbinding service...");
                    try {
@@ -113,6 +114,12 @@ public abstract class BluetoothProfileConnector<T> {
                        mService = null;
                    }
                }
            } finally {
                if (mServiceListener != null) {
                    mServiceListener.onServiceDisconnected(mProfileId);
                    mServiceListener = null;
                }
            }
        }
    }

@@ -131,7 +138,6 @@ public abstract class BluetoothProfileConnector<T> {
    }

    void disconnect() {
        mServiceListener = null;
        IBluetoothManager mgr = BluetoothAdapter.getDefaultAdapter().getBluetoothManager();
        if (mgr != null) {
            try {