Loading android/app/src/com/android/bluetooth/btservice/AdapterService.java +6 −3 Original line number Diff line number Diff line Loading @@ -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( Loading Loading @@ -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 Loading android/app/src/com/android/bluetooth/btservice/Config.java +6 −2 Original line number Diff line number Diff line Loading @@ -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), Loading @@ -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( Loading @@ -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), Loading @@ -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(), Loading android/app/src/com/android/bluetooth/le_scan/ScanManager.java +27 −16 Original line number Diff line number Diff line Loading @@ -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 Loading flags/Android.bp +0 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ aconfig_declarations { "connectivity.aconfig", "device_iot_config.aconfig", "did.aconfig", "discovery_service.aconfig", "dumpsys.aconfig", "framework.aconfig", "gap.aconfig", Loading flags/BUILD.gn +0 −1 Original line number Diff line number Diff line Loading @@ -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 Loading
android/app/src/com/android/bluetooth/btservice/AdapterService.java +6 −3 Original line number Diff line number Diff line Loading @@ -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( Loading Loading @@ -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 Loading
android/app/src/com/android/bluetooth/btservice/Config.java +6 −2 Original line number Diff line number Diff line Loading @@ -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), Loading @@ -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( Loading @@ -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), Loading @@ -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(), Loading
android/app/src/com/android/bluetooth/le_scan/ScanManager.java +27 −16 Original line number Diff line number Diff line Loading @@ -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 Loading
flags/Android.bp +0 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ aconfig_declarations { "connectivity.aconfig", "device_iot_config.aconfig", "did.aconfig", "discovery_service.aconfig", "dumpsys.aconfig", "framework.aconfig", "gap.aconfig", Loading
flags/BUILD.gn +0 −1 Original line number Diff line number Diff line Loading @@ -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