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

Commit 3219c845 authored by Łukasz Rymanowski's avatar Łukasz Rymanowski
Browse files

leaudio: Remove not needed group id from the state machine

It is not used, therefor removing it

Bug: 150670922
Tag: #feature
Sponsor: jpawlowski@
Test: atest BluetoothInstrumentationTests
Change-Id: Iaf779eeb90b59db7b0531de02b71b50df94b0926
parent 3fe0941f
Loading
Loading
Loading
Loading
+12 −11
Original line number Diff line number Diff line
@@ -276,7 +276,7 @@ public class LeAudioService extends ProfileService {
                Log.e(TAG, "Ignored connect request for " + device + " : no state machine");
                return false;
            }
            sm.sendMessage(LeAudioStateMachine.CONNECT, groupId);
            sm.sendMessage(LeAudioStateMachine.CONNECT);
        }

        // Connect other devices from this group
@@ -295,10 +295,11 @@ public class LeAudioService extends ProfileService {
                                 + " : no state machine");
                         continue;
                     }
                    sm.sendMessage(LeAudioStateMachine.CONNECT, groupId);
                     sm.sendMessage(LeAudioStateMachine.CONNECT);
                 }
             }
         }

        return true;
    }

+9 −10
Original line number Diff line number Diff line
@@ -157,8 +157,7 @@ final class LeAudioStateMachine extends StateMachine {

            switch (message.what) {
                case CONNECT:
                    int groupId = message.arg1;
                    log("Connecting to " + mDevice + " group " + groupId);
                    log("Connecting to " + mDevice);
                    if (!mNativeInterface.connectLeAudio(mDevice)) {
                        Log.e(TAG, "Disconnected: error connecting to " + mDevice);
                        break;
@@ -184,7 +183,7 @@ final class LeAudioStateMachine extends StateMachine {
                    }
                    switch (event.type) {
                        case LeAudioStackEvent.EVENT_TYPE_CONNECTION_STATE_CHANGED:
                            processConnectionEvent(event.valueInt1, event.valueInt2);
                            processConnectionEvent(event.valueInt1);
                            break;
                        default:
                            Log.e(TAG, "Disconnected: ignoring stack event: " + event);
@@ -198,7 +197,7 @@ final class LeAudioStateMachine extends StateMachine {
        }

        // in Disconnected state
        private void processConnectionEvent(int state, int groupId) {
        private void processConnectionEvent(int state) {
            switch (state) {
                case LeAudioStackEvent.CONNECTION_STATE_DISCONNECTED:
                    Log.w(TAG, "Ignore LeAudio DISCONNECTED event: " + mDevice);
@@ -285,7 +284,7 @@ final class LeAudioStateMachine extends StateMachine {
                    }
                    switch (event.type) {
                        case LeAudioStackEvent.EVENT_TYPE_CONNECTION_STATE_CHANGED:
                            processConnectionEvent(event.valueInt1, event.valueInt2);
                            processConnectionEvent(event.valueInt1);
                            break;
                        default:
                            Log.e(TAG, "Connecting: ignoring stack event: " + event);
@@ -299,7 +298,7 @@ final class LeAudioStateMachine extends StateMachine {
        }

        // in Connecting state
        private void processConnectionEvent(int state, int groupId) {
        private void processConnectionEvent(int state) {
            switch (state) {
                case LeAudioStackEvent.CONNECTION_STATE_DISCONNECTED:
                    Log.w(TAG, "Connecting device disconnected: " + mDevice);
@@ -371,7 +370,7 @@ final class LeAudioStateMachine extends StateMachine {
                    }
                    switch (event.type) {
                        case LeAudioStackEvent.EVENT_TYPE_CONNECTION_STATE_CHANGED:
                            processConnectionEvent(event.valueInt1, event.valueInt2);
                            processConnectionEvent(event.valueInt1);
                            break;
                        default:
                            Log.e(TAG, "Disconnecting: ignoring stack event: " + event);
@@ -385,7 +384,7 @@ final class LeAudioStateMachine extends StateMachine {
        }

        // in Disconnecting state
        private void processConnectionEvent(int state, int groupId) {
        private void processConnectionEvent(int state) {
            switch (state) {
                case LeAudioStackEvent.CONNECTION_STATE_DISCONNECTED:
                    Log.i(TAG, "Disconnected: " + mDevice);
@@ -465,7 +464,7 @@ final class LeAudioStateMachine extends StateMachine {
                    }
                    switch (event.type) {
                        case LeAudioStackEvent.EVENT_TYPE_CONNECTION_STATE_CHANGED:
                            processConnectionEvent(event.valueInt1, event.valueInt2);
                            processConnectionEvent(event.valueInt1);
                            break;
                        default:
                            Log.e(TAG, "Connected: ignoring stack event: " + event);
@@ -479,7 +478,7 @@ final class LeAudioStateMachine extends StateMachine {
        }

        // in Connected state
        private void processConnectionEvent(int state, int groupId) {
        private void processConnectionEvent(int state) {
            switch (state) {
                case LeAudioStackEvent.CONNECTION_STATE_DISCONNECTED:
                    Log.i(TAG, "Disconnected from " + mDevice);