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

Commit dfeb70b8 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "LeAudioService: Ignore store of intents when LeAudioService is inactive" into main

parents fe2f2821 75fe1574
Loading
Loading
Loading
Loading
+7 −2
Original line number Original line Diff line number Diff line
@@ -276,6 +276,11 @@ public class LeAudioServiceTest {
    private class LeAudioIntentReceiver extends BroadcastReceiver {
    private class LeAudioIntentReceiver extends BroadcastReceiver {
        @Override
        @Override
        public void onReceive(Context context, Intent intent) {
        public void onReceive(Context context, Intent intent) {
            /* Ignore intent when service is inactive */
            if (mService == null) {
                return;
            }

            if (BluetoothLeAudio.ACTION_LE_AUDIO_CONNECTION_STATE_CHANGED
            if (BluetoothLeAudio.ACTION_LE_AUDIO_CONNECTION_STATE_CHANGED
                    .equals(intent.getAction())) {
                    .equals(intent.getAction())) {
                try {
                try {
@@ -289,8 +294,8 @@ public class LeAudioServiceTest {
                    assertWithMessage("Cannot add Intent to the Connection State queue: "
                    assertWithMessage("Cannot add Intent to the Connection State queue: "
                            + e.getMessage()).fail();
                            + e.getMessage()).fail();
                }
                }
            }
            } else if (BluetoothLeAudio.ACTION_LE_AUDIO_ACTIVE_DEVICE_CHANGED.equals(
            if (BluetoothLeAudio.ACTION_LE_AUDIO_ACTIVE_DEVICE_CHANGED.equals(intent.getAction())) {
                    intent.getAction())) {
                try {
                try {
                    BluetoothDevice device = intent.getParcelableExtra(
                    BluetoothDevice device = intent.getParcelableExtra(
                            BluetoothDevice.EXTRA_DEVICE);
                            BluetoothDevice.EXTRA_DEVICE);