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

Commit e96125ae authored by Joseph Pirozzo's avatar Joseph Pirozzo Committed by Sanket Agarwal
Browse files

PBAP check device on disconnect

Upon receiving a disconnect message in Connecting or Connected verify
that the disconnect command is for the current device before
disconnecting.

bug: 28406739
Change-Id: I55498aa01a95c1ab9de1bda21c30db9c241dacc1
(cherry picked from commit 9541d943d7ca14b2e154199eaadce67a4bf12704)
parent 3e05f5ba
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -199,8 +199,11 @@ final class PbapClientStateMachine extends StateMachine {
            if (DBG) Log.d(TAG,"Processing MSG " + message.what + " from " + this.getName());
            switch (message.what) {
                case MSG_DISCONNECT:
                    if (message.obj instanceof BluetoothDevice &&
                            ((BluetoothDevice) message.obj).equals(mCurrentDevice)) {
                        removeMessages(MSG_CONNECT_TIMEOUT);
                        transitionTo(mDisconnecting);
                    }
                    break;

                case MSG_CONNECTION_COMPLETE:
@@ -299,7 +302,10 @@ final class PbapClientStateMachine extends StateMachine {
                    break;

                case MSG_DISCONNECT:
                    if ((message.obj instanceof BluetoothDevice) &&
                           ((BluetoothDevice) message.obj).equals(mCurrentDevice)) {
                        transitionTo(mDisconnecting);
                    }
                    break;

                case MSG_RESUME_DOWNLOAD: