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

Commit 3299c6ed authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Reorder LE Audio related services start." am: dd35660d am: 134aae5c am: 288d688c

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/1931096

Change-Id: Icb44156d714675a963b23b8a4c140145b2663554
parents ba2f791b 288d688c
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;
    }