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

Commit 717e5fcf authored by William Escande's avatar William Escande Committed by Automerger Merge Worker
Browse files

Merge "Remove leaudio_resume_active_after_hfp_handover flag" into main am: 99a80c71

parents 53332df3 99a80c71
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -679,14 +679,10 @@ public class ActiveDeviceManager implements AdapterService.BluetoothStateCallbac
                        && mAdapterService.isAllSupportedClassicAudioProfilesActive(device)) {
                    setLeAudioActiveDevice(device);
                } else {
                    if (Flags.leaudioResumeActiveAfterHfpHandover()) {
                    if (device != null) {
                        // remove LE audio active device when it is not null, and not dual mode
                        setLeAudioActiveDevice(null, true);
                    }
                    } else {
                        setLeAudioActiveDevice(null, true);
                    }
                }
            }
            // Just assign locally the new value
+11 −24
Original line number Diff line number Diff line
@@ -1429,9 +1429,7 @@ public class HeadsetService extends ProfileService {
             */
            if (mSystemInterface.isInCall() || mSystemInterface.isRinging()) {
                LeAudioService leAudioService = mFactory.getLeAudioService();
                if (leAudioService != null
                        && !leAudioService.getConnectedDevices().isEmpty()
                        && Flags.leaudioResumeActiveAfterHfpHandover()) {
                if (leAudioService != null && !leAudioService.getConnectedDevices().isEmpty()) {
                    Log.i(TAG, "Make sure no le audio device active for HFP handover.");
                    leAudioService.setInactiveForHfpHandover(mActiveDevice);
                }
@@ -1464,15 +1462,6 @@ public class HeadsetService extends ProfileService {
                    updateInbandRinging(device, true);
                }
            } else if (shouldPersistAudio()) {
                /* If HFP is getting active for a phonecall and there is LeAudio device active,
                 * Lets inactive LeAudio device as soon as possible so there is no CISes connected
                 * when SCO is created
                 */
                LeAudioService leAudioService = mFactory.getLeAudioService();
                if (leAudioService != null && !Flags.leaudioResumeActiveAfterHfpHandover()) {
                    Log.i(TAG, "Make sure there is no le audio device active.");
                    leAudioService.setInactiveForHfpHandover(mActiveDevice);
                }
                if (Utils.isScoManagedByAudioEnabled()) {
                    // tell Audio Framework that active device changed
                    mSystemInterface
@@ -2357,7 +2346,6 @@ public class HeadsetService extends ProfileService {
                // Resumes LE audio previous active device if HFP handover happened before.
                // Do it here because some controllers cannot handle SCO and CIS
                // co-existence see {@link LeAudioService#setInactiveForHfpHandover}
                if (Flags.leaudioResumeActiveAfterHfpHandover()) {
                LeAudioService leAudioService = mFactory.getLeAudioService();
                boolean isLeAudioConnectedDeviceNotActive = leAudioService != null
                        && !leAudioService.getConnectedDevices().isEmpty()
@@ -2369,7 +2357,6 @@ public class HeadsetService extends ProfileService {
                        && isLeAudioConnectedDeviceNotActive) {
                    leAudioService.setActiveAfterHfpHandover();
                }
                }

                // Unsuspend A2DP when SCO connection is gone and call state is idle
                if (mSystemInterface.isCallIdle() && !Utils.isScoManagedByAudioEnabled()) {
+2 −4
Original line number Diff line number Diff line
@@ -4344,10 +4344,8 @@ public class LeAudioService extends ProfileService {
        }
        if (getActiveGroupId() != LE_AUDIO_GROUP_ID_INVALID) {
            mHfpHandoverDevice = hfpHandoverDevice;
            if (Flags.leaudioResumeActiveAfterHfpHandover()) {
            // record the lead device
            mLeAudioDeviceInactivatedForHfpHandover = mExposedActiveDevice;
            }
            removeActiveDevice(true);
        }
    }
+0 −1
Original line number Diff line number Diff line
@@ -1558,7 +1558,6 @@ public class HeadsetServiceAndStateMachineTest {
    @Test
    public void testHfpOnlyHandoverToLeAudioAfterScoDisconnect() {
        BluetoothDevice device = TestUtils.getTestDevice(mAdapter, 0);
        mSetFlagsRule.enableFlags(Flags.FLAG_LEAUDIO_RESUME_ACTIVE_AFTER_HFP_HANDOVER);

        assertThat(mHeadsetService.mFactory).isNotNull();
        mHeadsetService.mFactory = mServiceFactory;
+0 −10
Original line number Diff line number Diff line
@@ -95,16 +95,6 @@ flag {
    }
}

flag {
    name: "leaudio_resume_active_after_hfp_handover"
    namespace: "bluetooth"
    description: "Fix for if HFP- LE Audio handover happened, LE audio resume active after the call"
    bug: "331468678"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
    name: "leaudio_allow_leaudio_only_devices"
    namespace: "bluetooth"