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

Commit 5e67e269 authored by Ömer Faruk Yılmaz's avatar Ömer Faruk Yılmaz Committed by Automerger Merge Worker
Browse files

Merge "Properly set mGattService before other profile services such as...

Merge "Properly set mGattService before other profile services such as LeAudioService are initialized as they depend on it" into main am: cf45beb4

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



Change-Id: I348cc838b4a5b42b9cd44dbe5764602900495f51
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 94a30ed3 cf45beb4
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -1551,6 +1551,12 @@ public class AdapterService extends Service {
                addProfile(profileService);
                profileService.start();
                profileService.setAvailable(true);
                // With `Flags.scanManagerRefactor()` GattService initialization is pushed back to
                // `ON` state instead of `BLE_ON`. Here we ensure mGattService is set prior
                // to other Profiles using it.
                if (profileId == BluetoothProfile.GATT && Flags.scanManagerRefactor()) {
                    mGattService = GattService.getGattService();
                }
                onProfileServiceStateChanged(profileService, BluetoothAdapter.STATE_ON);
            } else {
                Log.e(
@@ -1997,9 +2003,6 @@ public class AdapterService extends Service {
        mLeAudioService = LeAudioService.getLeAudioService();
        mBassClientService = BassClientService.getBassClientService();
        mBatteryService = BatteryService.getBatteryService();
        if (Flags.scanManagerRefactor()) {
            mGattService = GattService.getGattService();
        }
    }

    @BluetoothAdapter.RfcommListenerResult
+6 −2
Original line number Diff line number Diff line
@@ -92,6 +92,9 @@ public class Config {
        if (Flags.leaudioSynchronizeStart()) {
            PROFILE_SERVICES_AND_FLAGS =
                    new ProfileConfig[] {
                        // Prioritize GattService startup by making it the first Profile to
                        // boot. This resolves dependency issues for some Profiles.
                        new ProfileConfig(GattService.isEnabled(), BluetoothProfile.GATT),
                        new ProfileConfig(A2dpService.isEnabled(), BluetoothProfile.A2DP),
                        new ProfileConfig(A2dpSinkService.isEnabled(), BluetoothProfile.A2DP_SINK),
                        new ProfileConfig(AvrcpTargetService.isEnabled(), BluetoothProfile.AVRCP),
@@ -115,7 +118,6 @@ public class Config {
                        new ProfileConfig(
                                HidDeviceService.isEnabled(), BluetoothProfile.HID_DEVICE),
                        new ProfileConfig(HidHostService.isEnabled(), BluetoothProfile.HID_HOST),
                        new ProfileConfig(GattService.isEnabled(), BluetoothProfile.GATT),
                        new ProfileConfig(TbsService.isEnabled(), BluetoothProfile.LE_CALL_CONTROL),
                        new ProfileConfig(BluetoothMapService.isEnabled(), BluetoothProfile.MAP),
                        new ProfileConfig(
@@ -137,6 +139,9 @@ public class Config {
        } else {
            PROFILE_SERVICES_AND_FLAGS =
                    new ProfileConfig[] {
                        // Prioritize GattService startup by making it the first Profile to
                        // boot. This resolves dependency issues for some Profiles.
                        new ProfileConfig(GattService.isEnabled(), BluetoothProfile.GATT),
                        new ProfileConfig(A2dpService.isEnabled(), BluetoothProfile.A2DP),
                        new ProfileConfig(A2dpSinkService.isEnabled(), BluetoothProfile.A2DP_SINK),
                        new ProfileConfig(AvrcpTargetService.isEnabled(), BluetoothProfile.AVRCP),
@@ -160,7 +165,6 @@ public class Config {
                        new ProfileConfig(
                                HidDeviceService.isEnabled(), BluetoothProfile.HID_DEVICE),
                        new ProfileConfig(HidHostService.isEnabled(), BluetoothProfile.HID_HOST),
                        new ProfileConfig(GattService.isEnabled(), BluetoothProfile.GATT),
                        new ProfileConfig(LeAudioService.isEnabled(), BluetoothProfile.LE_AUDIO),
                        new ProfileConfig(
                                LeAudioService.isBroadcastEnabled(),