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

Commit 0a1b0a7e authored by William Escande's avatar William Escande Committed by Automerger Merge Worker
Browse files

Merge "audio_routing_centralization: rm flag and revert" into main am: ec52808e

parents c26d25a3 ec52808e
Loading
Loading
Loading
Loading
+4 −12
Original line number Diff line number Diff line
@@ -59,7 +59,6 @@ import com.android.bluetooth.BluetoothStatsLog;
import com.android.bluetooth.Utils;
import com.android.bluetooth.btservice.ActiveDeviceManager;
import com.android.bluetooth.btservice.AdapterService;
import com.android.bluetooth.btservice.AudioRoutingManager;
import com.android.bluetooth.btservice.MetricsLogger;
import com.android.bluetooth.btservice.ProfileService;
import com.android.bluetooth.btservice.ServiceFactory;
@@ -1298,13 +1297,11 @@ public class A2dpService extends ProfileService {
        if (toState == BluetoothProfile.STATE_CONNECTED) {
            MetricsLogger.logProfileConnectionEvent(BluetoothMetricsProto.ProfileId.A2DP);
        }
        if (!Flags.audioRoutingCentralization()) {
        // Set the active device if only one connected device is supported and it was connected
        if (toState == BluetoothProfile.STATE_CONNECTED && (mMaxConnectedAudioDevices == 1)) {
            setActiveDevice(device);
        }
        // When disconnected, ActiveDeviceManager will call setActiveDevice(null)
        }

        // Check if the device is disconnected - if unbond, remove the state machine
        if (toState == BluetoothProfile.STATE_DISCONNECTED) {
@@ -1443,11 +1440,6 @@ public class A2dpService extends ProfileService {
            if (service == null) {
                return false;
            }
            if (Flags.audioRoutingCentralization()) {
                return ((AudioRoutingManager) service.getActiveDeviceManager())
                        .activateDeviceProfile(device, BluetoothProfile.A2DP)
                        .join();
            }

            if (device == null) {
                return service.removeActiveDevice(false);
+1 −5
Original line number Diff line number Diff line
@@ -720,11 +720,7 @@ public class AdapterService extends Service {
            Log.i(TAG, "Phone policy disabled");
        }

        if (Flags.audioRoutingCentralization()) {
            mActiveDeviceManager = new AudioRoutingManager(this, new ServiceFactory());
        } else {
        mActiveDeviceManager = new ActiveDeviceManager(this, new ServiceFactory());
        }
        mActiveDeviceManager.start();

        mSilenceDeviceManager.start();
+0 −792

File deleted.

Preview size limit exceeded, changes collapsed.

+4 −7
Original line number Diff line number Diff line
@@ -50,7 +50,6 @@ import com.android.bluetooth.btservice.ProfileService;
import com.android.bluetooth.btservice.ServiceFactory;
import com.android.bluetooth.btservice.storage.DatabaseManager;
import com.android.bluetooth.csip.CsipSetCoordinatorService;
import com.android.bluetooth.flags.Flags;
import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting;

@@ -399,14 +398,12 @@ public class HapClientService extends ProfileService {
                removeStateMachine(device);
            }
        }
        if (!Flags.audioRoutingCentralization()) {
        ActiveDeviceManager adManager = mAdapterService.getActiveDeviceManager();
        if (adManager != null) {
            adManager.profileConnectionStateChanged(
                    BluetoothProfile.HAP_CLIENT, device, fromState, toState);
        }
    }
    }

    /**
     * Connects the hearing access service client to the passed in device
+0 −6
Original line number Diff line number Diff line
@@ -49,7 +49,6 @@ import com.android.bluetooth.BluetoothMetricsProto;
import com.android.bluetooth.BluetoothStatsLog;
import com.android.bluetooth.Utils;
import com.android.bluetooth.btservice.AdapterService;
import com.android.bluetooth.btservice.AudioRoutingManager;
import com.android.bluetooth.btservice.MetricsLogger;
import com.android.bluetooth.btservice.ProfileService;
import com.android.bluetooth.btservice.storage.DatabaseManager;
@@ -955,11 +954,6 @@ public class HearingAidService extends ProfileService {
                return false;
            }

            if (Flags.audioRoutingCentralization()) {
                return ((AudioRoutingManager) service.mAdapterService.getActiveDeviceManager())
                        .activateDeviceProfile(device, BluetoothProfile.HEARING_AID)
                        .join();
            }
            if (device == null) {
                return service.removeActiveDevice(false);
            } else {
Loading