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

Commit 248896bf authored by Rahul Sabnis's avatar Rahul Sabnis Committed by Android (Google) Code Review
Browse files

Merge "BluetoothProfileConnecter now calls the ServiceListener's...

Merge "BluetoothProfileConnecter now calls the ServiceListener's onServiceDisconnected method after unbinding the service" into rvc-dev
parents ed278935 ee31c78c
Loading
Loading
Loading
Loading
+15 −9
Original line number Original line Diff line number Diff line
@@ -103,6 +103,7 @@ public abstract class BluetoothProfileConnector<T> {


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


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


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