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

Commit b5beb127 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 12140224 from 999cf645 to 24Q4-release

Change-Id: I691805cb60a80e29e279c1cf039e140cc14f928e
parents aaa7dcbe 999cf645
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(),
+27 −16
Original line number Diff line number Diff line
@@ -677,25 +677,36 @@ public class ScanManager {
            if (mScanNative.isOpportunisticScanClient(client)) {
                return false;
            }
            int updatedScanMode = client.scanModeApp;
            if (!isAppForeground(client) || mScanNative.isForceDowngradedScanClient(client)) {
                return client.updateScanMode(ScanSettings.SCAN_MODE_SCREEN_OFF);
            }

                updatedScanMode = ScanSettings.SCAN_MODE_SCREEN_OFF;
            } else {
                // The following codes are effectively only for services
                // Apps are either already or will be soon handled by handleImportanceChange().
                switch (client.scanModeApp) {
                    case ScanSettings.SCAN_MODE_LOW_POWER:
                    return client.updateScanMode(ScanSettings.SCAN_MODE_SCREEN_OFF);
                        updatedScanMode = ScanSettings.SCAN_MODE_SCREEN_OFF;
                        break;
                    case ScanSettings.SCAN_MODE_BALANCED:
                    case ScanSettings.SCAN_MODE_AMBIENT_DISCOVERY:
                    return client.updateScanMode(ScanSettings.SCAN_MODE_SCREEN_OFF_BALANCED);
                        updatedScanMode = ScanSettings.SCAN_MODE_SCREEN_OFF_BALANCED;
                        break;
                    case ScanSettings.SCAN_MODE_LOW_LATENCY:
                    return client.updateScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY);
                        updatedScanMode = ScanSettings.SCAN_MODE_LOW_LATENCY;
                        break;
                    case ScanSettings.SCAN_MODE_OPPORTUNISTIC:
                    default:
                        return false;
                }
            }
            Log.d(
                    TAG,
                    "Scan mode update during screen off from "
                            + client.scanModeApp
                            + " to "
                            + updatedScanMode);
            return client.updateScanMode(updatedScanMode);
        }

        /**
         * Services and Apps are assumed to be in the foreground by default unless it changes to the
+0 −1
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@ aconfig_declarations {
        "connectivity.aconfig",
        "device_iot_config.aconfig",
        "did.aconfig",
        "discovery_service.aconfig",
        "dumpsys.aconfig",
        "framework.aconfig",
        "gap.aconfig",
+0 −1
Original line number Diff line number Diff line
@@ -15,7 +15,6 @@ aconfig("bluetooth_flags_c_lib") {
    "connectivity.aconfig",
    "device_iot_config.aconfig",
    "did.aconfig",
    "discovery_service.aconfig",
    "dumpsys.aconfig",
    "framework.aconfig",
    "gap.aconfig",
Loading