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

Commit 8a7c41e0 authored by Łukasz Rymanowski's avatar Łukasz Rymanowski Committed by Automerger Merge Worker
Browse files

Merge changes I7a6882cc,I887f7b56,Id9d52a27,I2c0c7e94 into main am: ec4a8afc

parents d5a8c100 ec4a8afc
Loading
Loading
Loading
Loading
+6 −12
Original line number Diff line number Diff line
@@ -993,14 +993,12 @@ public class ActiveDeviceManager implements AdapterService.BluetoothStateCallbac
            if (device == null) {
                success = leAudioService.removeActiveDevice(hasFallbackDevice);
            } else {
                if (Flags.leaudioActiveDeviceManagerGroupHandlingFix()) {
                if ((mLeAudioActiveDevice != null)
                        && (Objects.equals(
                                mLeAudioActiveDevice, leAudioService.getLeadDevice(device)))) {
                    Log.d(TAG, "New LeAudioDevice is a part of an active group");
                    return true;
                }
                }
                success = leAudioService.setActiveDevice(device);
            }

@@ -1008,11 +1006,7 @@ public class ActiveDeviceManager implements AdapterService.BluetoothStateCallbac
                return false;
            }

            if (Flags.leaudioActiveDeviceManagerGroupHandlingFix()) {
            mLeAudioActiveDevice = leAudioService.getLeadDevice(device);
            } else {
                mLeAudioActiveDevice = device;
            }

            if (device == null) {
                mLeHearingAidActiveDevice = null;
+7 −18
Original line number Diff line number Diff line
@@ -2570,20 +2570,14 @@ public class LeAudioService extends ProfileService {
                                1);
                break;
            case LeAudioStackEvent.HEALTH_RECOMMENDATION_ACTION_INACTIVATE_GROUP:
                if (Flags.leaudioUnicastInactivateDeviceBasedOnContext()) {
                LeAudioGroupDescriptor groupDescriptor = getGroupDescriptor(groupId);
                if (groupDescriptor != null
                        && groupDescriptor.isActive()
                        && !isGroupReceivingBroadcast(groupId)) {
                        Log.i(
                                TAG,
                                "Group "
                                        + groupId
                                        + " is inactivated due to blocked media context");
                    Log.i(TAG, "Group " + groupId + " is inactivated due to blocked media context");
                    groupDescriptor.mInactivatedDueToContextType = true;
                    setActiveGroupWithDevice(null, false);
                }
                }
            default:
                break;
        }
@@ -4382,11 +4376,6 @@ public class LeAudioService extends ProfileService {
    }

    void removeAuthorizationInfoForRelatedProfiles(BluetoothDevice device) {
        if (!Flags.leaudioMcsTbsAuthorizationRebondFix()) {
            Log.i(TAG, "leaudio_mcs_tbs_authorization_rebond_fix is disabled");
            return;
        }

        McpService mcpService = getMcpService();
        if (mcpService != null) {
            mcpService.removeDeviceAuthorizationInfo(device);
+2 −5
Original line number Diff line number Diff line
@@ -1014,11 +1014,8 @@ public class VolumeControlService extends ProfileService {
            case AudioManager.MODE_IN_CALL:
                return AudioManager.STREAM_VOICE_CALL;
            case AudioManager.MODE_RINGTONE:
                if (Flags.leaudioVolumeChangeOnRingtoneFix()) {
                Log.d(TAG, " Update during ringtone applied to voice call");
                return AudioManager.STREAM_VOICE_CALL;
                }
                // fall through
            case AudioManager.MODE_NORMAL:
            default:
                // other conditions will influence the stream type choice, read on...
+0 −1
Original line number Diff line number Diff line
@@ -900,7 +900,6 @@ public class ActiveDeviceManagerTest {

    @Test
    public void leAudioSetConnectedGroupThenDisconnected_noFallback() {
        mSetFlagsRule.enableFlags(Flags.FLAG_LEAUDIO_ACTIVE_DEVICE_MANAGER_GROUP_HANDLING_FIX);
        when(mAudioManager.getMode()).thenReturn(AudioManager.MODE_NORMAL);

        leAudioConnected(mLeAudioDevice);
+0 −3
Original line number Diff line number Diff line
@@ -885,7 +885,6 @@ public class LeAudioServiceTest {
    @Test
    public void testAuthorizationInfoRemovedFromTbsMcsOnUnbondEvents() {
        mSetFlagsRule.enableFlags(Flags.FLAG_AUDIO_ROUTING_CENTRALIZATION);
        mSetFlagsRule.enableFlags(Flags.FLAG_LEAUDIO_MCS_TBS_AUTHORIZATION_REBOND_FIX);

        // Update the device priority so okToConnect() returns true
        when(mDatabaseManager.getProfileConnectionPolicy(mLeftDevice, BluetoothProfile.LE_AUDIO))
@@ -1943,7 +1942,6 @@ public class LeAudioServiceTest {

    @Test
    public void testMediaContextUnavailableForAWhile() {
        mSetFlagsRule.enableFlags(Flags.FLAG_LEAUDIO_UNICAST_INACTIVATE_DEVICE_BASED_ON_CONTEXT);
        mSetFlagsRule.enableFlags(Flags.FLAG_AUDIO_ROUTING_CENTRALIZATION);

        doReturn(true).when(mNativeInterface).connectLeAudio(any(BluetoothDevice.class));
@@ -1979,7 +1977,6 @@ public class LeAudioServiceTest {

    @Test
    public void testMediaContextUnavailableWhileReceivingBroadcast() {
        mSetFlagsRule.enableFlags(Flags.FLAG_LEAUDIO_UNICAST_INACTIVATE_DEVICE_BASED_ON_CONTEXT);
        mSetFlagsRule.enableFlags(Flags.FLAG_AUDIO_ROUTING_CENTRALIZATION);
        mSetFlagsRule.enableFlags(Flags.FLAG_LEAUDIO_BROADCAST_AUDIO_HANDOVER_POLICIES);

Loading