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

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

Merge "Reorder LE Audio related services start."

parents 2ecced65 0f307203
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -117,8 +117,6 @@ public class Config {
                    (1 << BluetoothProfile.OPP)),
            new ProfileConfig(BluetoothPbapService.class, R.bool.profile_supported_pbap,
                    (1 << BluetoothProfile.PBAP)),
            new ProfileConfig(LeAudioService.class, R.bool.profile_supported_le_audio,
                    (1 << BluetoothProfile.LE_AUDIO)),
            new ProfileConfig(VolumeControlService.class, R.bool.profile_supported_vc,
                    (1 << BluetoothProfile.VOLUME_CONTROL)),
            new ProfileConfig(McpService.class, R.bool.profile_supported_mcp_server,
@@ -126,6 +124,8 @@ public class Config {
            new ProfileConfig(HearingAidService.class,
                    com.android.internal.R.bool.config_hearing_aid_profile_supported,
                    (1 << BluetoothProfile.HEARING_AID)),
            new ProfileConfig(LeAudioService.class, R.bool.profile_supported_le_audio,
                    (1 << BluetoothProfile.LE_AUDIO)),
            new ProfileConfig(CsipSetCoordinatorService.class,
                    R.bool.profile_supported_csip_set_coordinator,
                    (1 << BluetoothProfile.CSIP_SET_COORDINATOR)),
+7 −6
Original line number Diff line number Diff line
@@ -27,20 +27,17 @@ import android.bluetooth.BluetoothLeAudio;
import android.bluetooth.BluetoothProfile;
import android.bluetooth.BluetoothUuid;
import android.bluetooth.IBluetoothLeAudio;
import android.bluetooth.IBluetoothVolumeControl;
import android.content.AttributionSource;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.ServiceConnection;
import android.media.AudioManager;
import android.media.BtProfileConnectionInfo;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.IBinder;
import android.os.Looper;
import android.os.ParcelUuid;
import android.os.RemoteException;
import android.util.Log;

import com.android.bluetooth.Utils;
@@ -133,6 +130,7 @@ public class LeAudioService extends ProfileService {

    private BroadcastReceiver mBondStateChangedReceiver;
    private BroadcastReceiver mConnectionStateChangedReceiver;
    private Handler mHandler = new Handler(Looper.getMainLooper());

    @Override
    protected IProfileServiceBinder initBinder() {
@@ -186,7 +184,10 @@ public class LeAudioService extends ProfileService {
        // Setup codec config
        mLeAudioCodecConfig = new LeAudioCodecConfig(this);

        mLeAudioNativeInterface.init(mLeAudioCodecConfig.getCodecConfigOffloading());
        // Delay the call to init by posting it. This ensures TBS and MCS are fully initialized
        // before we start accepting connections
        mHandler.post(() ->
                mLeAudioNativeInterface.init(mLeAudioCodecConfig.getCodecConfigOffloading()));

        return true;
    }