Loading android/app/src/com/android/bluetooth/a2dp/A2dpService.java +7 −6 Original line number Diff line number Diff line Loading @@ -141,10 +141,13 @@ public class A2dpService extends ProfileService { return BluetoothProperties.isProfileA2dpSourceEnabled().orElse(false); } ActiveDeviceManager getActiveDeviceManager() { return mAdapterService.getActiveDeviceManager(); } @Override protected IProfileServiceBinder initBinder() { return new BluetoothA2dpBinder( this, AdapterService.getAdapterService().getActiveDeviceManager()); return new BluetoothA2dpBinder(this); } @Override Loading Loading @@ -1372,7 +1375,6 @@ public class A2dpService extends ProfileService { static class BluetoothA2dpBinder extends IBluetoothA2dp.Stub implements IProfileServiceBinder { private A2dpService mService; private ActiveDeviceManager mActiveDeviceManager; @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) private A2dpService getService(AttributionSource source) { Loading @@ -1387,9 +1389,8 @@ public class A2dpService extends ProfileService { return mService; } BluetoothA2dpBinder(A2dpService svc, ActiveDeviceManager activeDeviceManager) { BluetoothA2dpBinder(A2dpService svc) { mService = svc; mActiveDeviceManager = activeDeviceManager; } @Override Loading Loading @@ -1479,7 +1480,7 @@ public class A2dpService extends ProfileService { A2dpService service = getService(source); if (service != null) { if (Flags.audioRoutingCentralization()) { ((AudioRoutingManager) mActiveDeviceManager) ((AudioRoutingManager) service.getActiveDeviceManager()) .activateDeviceProfile(device, BluetoothProfile.A2DP, receiver); } else { boolean result; Loading android/app/tests/unit/src/com/android/bluetooth/a2dp/A2dpServiceBinderTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -57,7 +57,6 @@ public class A2dpServiceBinderTest { @Rule public final SetFlagsRule mSetFlagsRule = new SetFlagsRule(); @Mock private A2dpService mA2dpService; @Mock private A2dpNativeInterface mNativeInterface; @Mock private AudioRoutingManager mAudioRoutingManager; @Mock private PackageManager mPackageManager; Loading @@ -66,12 +65,13 @@ public class A2dpServiceBinderTest { @Before public void setUp() throws Exception { MockitoAnnotations.initMocks(this); doReturn(mAudioRoutingManager).when(mA2dpService).getActiveDeviceManager(); doReturn(mPackageManager).when(mA2dpService).getPackageManager(); ApplicationInfo appInfo = new ApplicationInfo(); appInfo.targetSdkVersion = android.os.Build.VERSION_CODES.CUR_DEVELOPMENT; doReturn(appInfo).when(mPackageManager).getApplicationInfo(any(), anyInt()); mBinder = new A2dpService.BluetoothA2dpBinder(mA2dpService, mAudioRoutingManager); mBinder = new A2dpService.BluetoothA2dpBinder(mA2dpService); } @After Loading Loading
android/app/src/com/android/bluetooth/a2dp/A2dpService.java +7 −6 Original line number Diff line number Diff line Loading @@ -141,10 +141,13 @@ public class A2dpService extends ProfileService { return BluetoothProperties.isProfileA2dpSourceEnabled().orElse(false); } ActiveDeviceManager getActiveDeviceManager() { return mAdapterService.getActiveDeviceManager(); } @Override protected IProfileServiceBinder initBinder() { return new BluetoothA2dpBinder( this, AdapterService.getAdapterService().getActiveDeviceManager()); return new BluetoothA2dpBinder(this); } @Override Loading Loading @@ -1372,7 +1375,6 @@ public class A2dpService extends ProfileService { static class BluetoothA2dpBinder extends IBluetoothA2dp.Stub implements IProfileServiceBinder { private A2dpService mService; private ActiveDeviceManager mActiveDeviceManager; @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) private A2dpService getService(AttributionSource source) { Loading @@ -1387,9 +1389,8 @@ public class A2dpService extends ProfileService { return mService; } BluetoothA2dpBinder(A2dpService svc, ActiveDeviceManager activeDeviceManager) { BluetoothA2dpBinder(A2dpService svc) { mService = svc; mActiveDeviceManager = activeDeviceManager; } @Override Loading Loading @@ -1479,7 +1480,7 @@ public class A2dpService extends ProfileService { A2dpService service = getService(source); if (service != null) { if (Flags.audioRoutingCentralization()) { ((AudioRoutingManager) mActiveDeviceManager) ((AudioRoutingManager) service.getActiveDeviceManager()) .activateDeviceProfile(device, BluetoothProfile.A2DP, receiver); } else { boolean result; Loading
android/app/tests/unit/src/com/android/bluetooth/a2dp/A2dpServiceBinderTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -57,7 +57,6 @@ public class A2dpServiceBinderTest { @Rule public final SetFlagsRule mSetFlagsRule = new SetFlagsRule(); @Mock private A2dpService mA2dpService; @Mock private A2dpNativeInterface mNativeInterface; @Mock private AudioRoutingManager mAudioRoutingManager; @Mock private PackageManager mPackageManager; Loading @@ -66,12 +65,13 @@ public class A2dpServiceBinderTest { @Before public void setUp() throws Exception { MockitoAnnotations.initMocks(this); doReturn(mAudioRoutingManager).when(mA2dpService).getActiveDeviceManager(); doReturn(mPackageManager).when(mA2dpService).getPackageManager(); ApplicationInfo appInfo = new ApplicationInfo(); appInfo.targetSdkVersion = android.os.Build.VERSION_CODES.CUR_DEVELOPMENT; doReturn(appInfo).when(mPackageManager).getApplicationInfo(any(), anyInt()); mBinder = new A2dpService.BluetoothA2dpBinder(mA2dpService, mAudioRoutingManager); mBinder = new A2dpService.BluetoothA2dpBinder(mA2dpService); } @After Loading