Loading android/app/src/com/android/bluetooth/a2dp/A2dpService.java +4 −4 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.media.AudioManager; import android.media.BtProfileConnectionInfo; import android.media.BluetoothProfileConnectionInfo; import android.os.HandlerThread; import android.util.Log; Loading Loading @@ -477,7 +477,7 @@ public class A2dpService extends ProfileService { boolean stopAudio = forceStopPlayingAudio || (getConnectionState(previousActiveDevice) != BluetoothProfile.STATE_CONNECTED); mAudioManager.handleBluetoothActiveDeviceChanged(null, previousActiveDevice, BtProfileConnectionInfo.a2dpInfo(!stopAudio, -1)); BluetoothProfileConnectionInfo.createA2dpInfo(!stopAudio, -1)); synchronized (mStateMachines) { // Make sure the Active device in native layer is set to null and audio is off Loading Loading @@ -591,7 +591,7 @@ public class A2dpService extends ProfileService { // change, so the Audio Service can reset accordingly the audio // feeding parameters in the Audio HAL to the Bluetooth stack. mAudioManager.handleBluetoothActiveDeviceChanged(newActiveDevice, previousActiveDevice, BtProfileConnectionInfo.a2dpInfo(true, rememberedVolume)); BluetoothProfileConnectionInfo.createA2dpInfo(true, rememberedVolume)); } return true; } Loading Loading @@ -981,7 +981,7 @@ public class A2dpService extends ProfileService { // is left unused until there) if (isActiveDevice(device)) { mAudioManager.handleBluetoothActiveDeviceChanged(device, device, BtProfileConnectionInfo.a2dpInfo(false, -1)); BluetoothProfileConnectionInfo.createA2dpInfo(false, -1)); } } Loading android/app/src/com/android/bluetooth/hearingaid/HearingAidService.java +2 −2 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.media.AudioManager; import android.media.BtProfileConnectionInfo; import android.media.BluetoothProfileConnectionInfo; import android.os.HandlerThread; import android.os.ParcelUuid; import android.util.Log; Loading Loading @@ -707,7 +707,7 @@ public class HearingAidService extends ProfileService { + ". Stop audio: " + stopAudio); } mAudioManager.handleBluetoothActiveDeviceChanged(device, mPreviousAudioDevice, BtProfileConnectionInfo.hearingAidInfo(!stopAudio)); BluetoothProfileConnectionInfo.createHearingAidInfo(!stopAudio)); mPreviousAudioDevice = device; } Loading android/app/src/com/android/bluetooth/le_audio/LeAudioService.java +8 −5 Original line number Diff line number Diff line Loading @@ -33,7 +33,7 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.media.AudioManager; import android.media.BtProfileConnectionInfo; import android.media.BluetoothProfileConnectionInfo; import android.os.Handler; import android.os.HandlerThread; import android.os.Looper; Loading Loading @@ -688,7 +688,7 @@ public class LeAudioService extends ProfileService { + " isLeOutput: false"); } mAudioManager.handleBluetoothActiveDeviceChanged(mActiveAudioInDevice,previousInDevice, BtProfileConnectionInfo.leAudio(false, false)); BluetoothProfileConnectionInfo.createLeAudioInfo(false, false)); return true; } Loading Loading @@ -750,7 +750,8 @@ public class LeAudioService extends ProfileService { + " isLeOutput: true"); } mAudioManager.handleBluetoothActiveDeviceChanged(mActiveAudioOutDevice, previousOutDevice, BtProfileConnectionInfo.leAudio(suppressNoisyIntent, true)); previousOutDevice, BluetoothProfileConnectionInfo.createLeAudioInfo(suppressNoisyIntent, true)); return true; } Log.d(TAG, "updateActiveOutDevice: Nothing to do."); Loading Loading @@ -1042,7 +1043,8 @@ public class LeAudioService extends ProfileService { BluetoothDevice previousDevice = mActiveAudioOutDevice; mActiveAudioOutDevice = device; mAudioManager.handleBluetoothActiveDeviceChanged(mActiveAudioOutDevice, previousDevice, BtProfileConnectionInfo.leAudio(false, true)); previousDevice, BluetoothProfileConnectionInfo.createLeAudioInfo(false, true)); } } } else { Loading @@ -1052,7 +1054,8 @@ public class LeAudioService extends ProfileService { BluetoothDevice previousDevice = mActiveAudioOutDevice; mActiveAudioOutDevice = null; mAudioManager.handleBluetoothActiveDeviceChanged(mActiveAudioOutDevice, previousDevice, BtProfileConnectionInfo.leAudio(true, true)); previousDevice, BluetoothProfileConnectionInfo.createLeAudioInfo(true, true)); } } } Loading android/app/tests/unit/src/com/android/bluetooth/hearingaid/HearingAidServiceTest.java +3 −3 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.media.AudioManager; import android.media.BtProfileConnectionInfo; import android.media.BluetoothProfileConnectionInfo; import android.os.Looper; import android.os.ParcelUuid; import android.sysprop.BluetoothProperties; Loading Loading @@ -524,7 +524,7 @@ public class HearingAidServiceTest { // Verify the audio is routed to Hearing Aid Profile verify(mAudioManager).handleBluetoothActiveDeviceChanged( any(BluetoothDevice.class), eq(null), any(BtProfileConnectionInfo.class)); any(BluetoothDevice.class), eq(null), any(BluetoothProfileConnectionInfo.class)); // Send a disconnect request Assert.assertTrue("Disconnect failed", mService.disconnect(mLeftDevice)); Loading Loading @@ -572,7 +572,7 @@ public class HearingAidServiceTest { // Verify the audio is not routed to Hearing Aid Profile verify(mAudioManager).handleBluetoothActiveDeviceChanged( eq(null), any(BluetoothDevice.class), any(BtProfileConnectionInfo.class)); eq(null), any(BluetoothDevice.class), any(BluetoothProfileConnectionInfo.class)); } /** Loading android/app/tests/unit/src/com/android/bluetooth/le_audio/LeAudioServiceTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -41,7 +41,7 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.media.AudioManager; import android.media.BtProfileConnectionInfo; import android.media.BluetoothProfileConnectionInfo; import android.os.ParcelUuid; import androidx.test.InstrumentationRegistry; Loading Loading
android/app/src/com/android/bluetooth/a2dp/A2dpService.java +4 −4 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.media.AudioManager; import android.media.BtProfileConnectionInfo; import android.media.BluetoothProfileConnectionInfo; import android.os.HandlerThread; import android.util.Log; Loading Loading @@ -477,7 +477,7 @@ public class A2dpService extends ProfileService { boolean stopAudio = forceStopPlayingAudio || (getConnectionState(previousActiveDevice) != BluetoothProfile.STATE_CONNECTED); mAudioManager.handleBluetoothActiveDeviceChanged(null, previousActiveDevice, BtProfileConnectionInfo.a2dpInfo(!stopAudio, -1)); BluetoothProfileConnectionInfo.createA2dpInfo(!stopAudio, -1)); synchronized (mStateMachines) { // Make sure the Active device in native layer is set to null and audio is off Loading Loading @@ -591,7 +591,7 @@ public class A2dpService extends ProfileService { // change, so the Audio Service can reset accordingly the audio // feeding parameters in the Audio HAL to the Bluetooth stack. mAudioManager.handleBluetoothActiveDeviceChanged(newActiveDevice, previousActiveDevice, BtProfileConnectionInfo.a2dpInfo(true, rememberedVolume)); BluetoothProfileConnectionInfo.createA2dpInfo(true, rememberedVolume)); } return true; } Loading Loading @@ -981,7 +981,7 @@ public class A2dpService extends ProfileService { // is left unused until there) if (isActiveDevice(device)) { mAudioManager.handleBluetoothActiveDeviceChanged(device, device, BtProfileConnectionInfo.a2dpInfo(false, -1)); BluetoothProfileConnectionInfo.createA2dpInfo(false, -1)); } } Loading
android/app/src/com/android/bluetooth/hearingaid/HearingAidService.java +2 −2 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.media.AudioManager; import android.media.BtProfileConnectionInfo; import android.media.BluetoothProfileConnectionInfo; import android.os.HandlerThread; import android.os.ParcelUuid; import android.util.Log; Loading Loading @@ -707,7 +707,7 @@ public class HearingAidService extends ProfileService { + ". Stop audio: " + stopAudio); } mAudioManager.handleBluetoothActiveDeviceChanged(device, mPreviousAudioDevice, BtProfileConnectionInfo.hearingAidInfo(!stopAudio)); BluetoothProfileConnectionInfo.createHearingAidInfo(!stopAudio)); mPreviousAudioDevice = device; } Loading
android/app/src/com/android/bluetooth/le_audio/LeAudioService.java +8 −5 Original line number Diff line number Diff line Loading @@ -33,7 +33,7 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.media.AudioManager; import android.media.BtProfileConnectionInfo; import android.media.BluetoothProfileConnectionInfo; import android.os.Handler; import android.os.HandlerThread; import android.os.Looper; Loading Loading @@ -688,7 +688,7 @@ public class LeAudioService extends ProfileService { + " isLeOutput: false"); } mAudioManager.handleBluetoothActiveDeviceChanged(mActiveAudioInDevice,previousInDevice, BtProfileConnectionInfo.leAudio(false, false)); BluetoothProfileConnectionInfo.createLeAudioInfo(false, false)); return true; } Loading Loading @@ -750,7 +750,8 @@ public class LeAudioService extends ProfileService { + " isLeOutput: true"); } mAudioManager.handleBluetoothActiveDeviceChanged(mActiveAudioOutDevice, previousOutDevice, BtProfileConnectionInfo.leAudio(suppressNoisyIntent, true)); previousOutDevice, BluetoothProfileConnectionInfo.createLeAudioInfo(suppressNoisyIntent, true)); return true; } Log.d(TAG, "updateActiveOutDevice: Nothing to do."); Loading Loading @@ -1042,7 +1043,8 @@ public class LeAudioService extends ProfileService { BluetoothDevice previousDevice = mActiveAudioOutDevice; mActiveAudioOutDevice = device; mAudioManager.handleBluetoothActiveDeviceChanged(mActiveAudioOutDevice, previousDevice, BtProfileConnectionInfo.leAudio(false, true)); previousDevice, BluetoothProfileConnectionInfo.createLeAudioInfo(false, true)); } } } else { Loading @@ -1052,7 +1054,8 @@ public class LeAudioService extends ProfileService { BluetoothDevice previousDevice = mActiveAudioOutDevice; mActiveAudioOutDevice = null; mAudioManager.handleBluetoothActiveDeviceChanged(mActiveAudioOutDevice, previousDevice, BtProfileConnectionInfo.leAudio(true, true)); previousDevice, BluetoothProfileConnectionInfo.createLeAudioInfo(true, true)); } } } Loading
android/app/tests/unit/src/com/android/bluetooth/hearingaid/HearingAidServiceTest.java +3 −3 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.media.AudioManager; import android.media.BtProfileConnectionInfo; import android.media.BluetoothProfileConnectionInfo; import android.os.Looper; import android.os.ParcelUuid; import android.sysprop.BluetoothProperties; Loading Loading @@ -524,7 +524,7 @@ public class HearingAidServiceTest { // Verify the audio is routed to Hearing Aid Profile verify(mAudioManager).handleBluetoothActiveDeviceChanged( any(BluetoothDevice.class), eq(null), any(BtProfileConnectionInfo.class)); any(BluetoothDevice.class), eq(null), any(BluetoothProfileConnectionInfo.class)); // Send a disconnect request Assert.assertTrue("Disconnect failed", mService.disconnect(mLeftDevice)); Loading Loading @@ -572,7 +572,7 @@ public class HearingAidServiceTest { // Verify the audio is not routed to Hearing Aid Profile verify(mAudioManager).handleBluetoothActiveDeviceChanged( eq(null), any(BluetoothDevice.class), any(BtProfileConnectionInfo.class)); eq(null), any(BluetoothDevice.class), any(BluetoothProfileConnectionInfo.class)); } /** Loading
android/app/tests/unit/src/com/android/bluetooth/le_audio/LeAudioServiceTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -41,7 +41,7 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.media.AudioManager; import android.media.BtProfileConnectionInfo; import android.media.BluetoothProfileConnectionInfo; import android.os.ParcelUuid; import androidx.test.InstrumentationRegistry; Loading