Loading android/app/src/com/android/bluetooth/avrcp/AvrcpCoverArtService.java +17 −14 Original line number Diff line number Diff line Loading @@ -195,13 +195,16 @@ public class AvrcpCoverArtService { if (mClients.containsKey(device)) return false; // Create a BIP OBEX Server session for the client and connect AvrcpBipObexServer s = new AvrcpBipObexServer(this, new AvrcpBipObexServer.Callback() { AvrcpBipObexServer s = new AvrcpBipObexServer( this, new AvrcpBipObexServer.Callback() { public void onConnected() { mNativeInterface.setBipClientStatus(device.getAddress(), true); mNativeInterface.setBipClientStatus(device, true); } public void onDisconnected() { mNativeInterface.setBipClientStatus(device.getAddress(), false); mNativeInterface.setBipClientStatus(device, false); } public void onClose() { Loading Loading @@ -232,7 +235,7 @@ public class AvrcpCoverArtService { // socket as well. No need to maintain and close anything else. synchronized (mClientsLock) { if (mClients.containsKey(device)) { mNativeInterface.setBipClientStatus(device.getAddress(), false); mNativeInterface.setBipClientStatus(device, false); ServerSession session = mClients.get(device); mClients.remove(device); session.close(); Loading android/app/src/com/android/bluetooth/avrcp/AvrcpNativeInterface.java +16 −12 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import com.android.bluetooth.audio_util.PlayStatus; import com.android.bluetooth.audio_util.PlayerInfo; import com.android.bluetooth.audio_util.PlayerSettingsManager.PlayerSettingsValues; import com.android.bluetooth.btservice.AdapterService; import com.android.bluetooth.flags.Flags; import com.android.internal.annotations.GuardedBy; import com.android.internal.annotations.VisibleForTesting; Loading Loading @@ -93,8 +94,11 @@ public class AvrcpNativeInterface { unregisterBipServerNative(); } void setBipClientStatus(String bdaddr, boolean connected) { String identityAddress = mAdapterService.getIdentityAddress(bdaddr); void setBipClientStatus(BluetoothDevice device, boolean connected) { String identityAddress = Flags.identityAddressNullIfUnknown() ? Utils.getBrEdrAddress(device) : mAdapterService.getIdentityAddress(device.getAddress()); setBipClientStatusNative(identityAddress, connected); } Loading Loading @@ -218,14 +222,11 @@ public class AvrcpNativeInterface { mAvrcpService.playItem(playerId, nowPlaying, mediaId); } boolean connectDevice(String bdaddr) { String identityAddress = mAdapterService.getIdentityAddress(bdaddr); d("connectDevice: identityAddress=" + identityAddress); return connectDeviceNative(identityAddress); } boolean disconnectDevice(String bdaddr) { String identityAddress = mAdapterService.getIdentityAddress(bdaddr); boolean disconnectDevice(BluetoothDevice device) { String identityAddress = Flags.identityAddressNullIfUnknown() ? Utils.getBrEdrAddress(device) : mAdapterService.getIdentityAddress(device.getAddress()); d("disconnectDevice: identityAddress=" + identityAddress); return disconnectDeviceNative(identityAddress); } Loading Loading @@ -258,9 +259,12 @@ public class AvrcpNativeInterface { mAvrcpService.deviceDisconnected(device); } void sendVolumeChanged(String bdaddr, int volume) { void sendVolumeChanged(BluetoothDevice device, int volume) { d("sendVolumeChanged: volume=" + volume); String identityAddress = mAdapterService.getIdentityAddress(bdaddr); String identityAddress = Flags.identityAddressNullIfUnknown() ? Utils.getBrEdrAddress(device) : mAdapterService.getIdentityAddress(device.getAddress()); sendVolumeChangedNative(identityAddress, volume); } Loading android/app/src/com/android/bluetooth/avrcp/AvrcpTargetService.java +1 −1 Original line number Diff line number Diff line Loading @@ -323,7 +323,7 @@ public class AvrcpTargetService extends ProfileService { if (device == null || mNativeInterface == null) return; if (newState == BluetoothProfile.STATE_DISCONNECTED) { // If there is no connection, disconnectDevice() will do nothing if (mNativeInterface.disconnectDevice(device.getAddress())) { if (mNativeInterface.disconnectDevice(device)) { Log.d(TAG, "request to disconnect device " + device); } } Loading android/app/src/com/android/bluetooth/avrcp/AvrcpVolumeManager.java +2 −2 Original line number Diff line number Diff line Loading @@ -95,7 +95,7 @@ class AvrcpVolumeManager extends AudioDeviceCallback { int avrcpVolume = systemToAvrcpVolume(savedVolume); mVolumeEventLogger.logd(TAG, "switchVolumeDevice: Updating device volume: avrcpVolume=" + avrcpVolume); mNativeInterface.sendVolumeChanged(device.getAddress(), avrcpVolume); mNativeInterface.sendVolumeChanged(device, avrcpVolume); } } Loading Loading @@ -200,7 +200,7 @@ class AvrcpVolumeManager extends AudioDeviceCallback { + " avrcpVolume=" + avrcpVolume + " deviceVolume=" + deviceVolume + " sDeviceMaxVolume=" + sDeviceMaxVolume); mNativeInterface.sendVolumeChanged(device.getAddress(), avrcpVolume); mNativeInterface.sendVolumeChanged(device, avrcpVolume); storeVolumeForDevice(device); } Loading android/app/tests/unit/src/com/android/bluetooth/avrcp/AvrcpVolumeManagerTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -100,7 +100,7 @@ public class AvrcpVolumeManagerTest { public void sendVolumeChanged() { mAvrcpVolumeManager.sendVolumeChanged(mRemoteDevice, TEST_DEVICE_MAX_VOUME); verify(mNativeInterface).sendVolumeChanged(REMOTE_DEVICE_ADDRESS, AVRCP_MAX_VOL); verify(mNativeInterface).sendVolumeChanged(mRemoteDevice, AVRCP_MAX_VOL); } @Test Loading Loading
android/app/src/com/android/bluetooth/avrcp/AvrcpCoverArtService.java +17 −14 Original line number Diff line number Diff line Loading @@ -195,13 +195,16 @@ public class AvrcpCoverArtService { if (mClients.containsKey(device)) return false; // Create a BIP OBEX Server session for the client and connect AvrcpBipObexServer s = new AvrcpBipObexServer(this, new AvrcpBipObexServer.Callback() { AvrcpBipObexServer s = new AvrcpBipObexServer( this, new AvrcpBipObexServer.Callback() { public void onConnected() { mNativeInterface.setBipClientStatus(device.getAddress(), true); mNativeInterface.setBipClientStatus(device, true); } public void onDisconnected() { mNativeInterface.setBipClientStatus(device.getAddress(), false); mNativeInterface.setBipClientStatus(device, false); } public void onClose() { Loading Loading @@ -232,7 +235,7 @@ public class AvrcpCoverArtService { // socket as well. No need to maintain and close anything else. synchronized (mClientsLock) { if (mClients.containsKey(device)) { mNativeInterface.setBipClientStatus(device.getAddress(), false); mNativeInterface.setBipClientStatus(device, false); ServerSession session = mClients.get(device); mClients.remove(device); session.close(); Loading
android/app/src/com/android/bluetooth/avrcp/AvrcpNativeInterface.java +16 −12 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import com.android.bluetooth.audio_util.PlayStatus; import com.android.bluetooth.audio_util.PlayerInfo; import com.android.bluetooth.audio_util.PlayerSettingsManager.PlayerSettingsValues; import com.android.bluetooth.btservice.AdapterService; import com.android.bluetooth.flags.Flags; import com.android.internal.annotations.GuardedBy; import com.android.internal.annotations.VisibleForTesting; Loading Loading @@ -93,8 +94,11 @@ public class AvrcpNativeInterface { unregisterBipServerNative(); } void setBipClientStatus(String bdaddr, boolean connected) { String identityAddress = mAdapterService.getIdentityAddress(bdaddr); void setBipClientStatus(BluetoothDevice device, boolean connected) { String identityAddress = Flags.identityAddressNullIfUnknown() ? Utils.getBrEdrAddress(device) : mAdapterService.getIdentityAddress(device.getAddress()); setBipClientStatusNative(identityAddress, connected); } Loading Loading @@ -218,14 +222,11 @@ public class AvrcpNativeInterface { mAvrcpService.playItem(playerId, nowPlaying, mediaId); } boolean connectDevice(String bdaddr) { String identityAddress = mAdapterService.getIdentityAddress(bdaddr); d("connectDevice: identityAddress=" + identityAddress); return connectDeviceNative(identityAddress); } boolean disconnectDevice(String bdaddr) { String identityAddress = mAdapterService.getIdentityAddress(bdaddr); boolean disconnectDevice(BluetoothDevice device) { String identityAddress = Flags.identityAddressNullIfUnknown() ? Utils.getBrEdrAddress(device) : mAdapterService.getIdentityAddress(device.getAddress()); d("disconnectDevice: identityAddress=" + identityAddress); return disconnectDeviceNative(identityAddress); } Loading Loading @@ -258,9 +259,12 @@ public class AvrcpNativeInterface { mAvrcpService.deviceDisconnected(device); } void sendVolumeChanged(String bdaddr, int volume) { void sendVolumeChanged(BluetoothDevice device, int volume) { d("sendVolumeChanged: volume=" + volume); String identityAddress = mAdapterService.getIdentityAddress(bdaddr); String identityAddress = Flags.identityAddressNullIfUnknown() ? Utils.getBrEdrAddress(device) : mAdapterService.getIdentityAddress(device.getAddress()); sendVolumeChangedNative(identityAddress, volume); } Loading
android/app/src/com/android/bluetooth/avrcp/AvrcpTargetService.java +1 −1 Original line number Diff line number Diff line Loading @@ -323,7 +323,7 @@ public class AvrcpTargetService extends ProfileService { if (device == null || mNativeInterface == null) return; if (newState == BluetoothProfile.STATE_DISCONNECTED) { // If there is no connection, disconnectDevice() will do nothing if (mNativeInterface.disconnectDevice(device.getAddress())) { if (mNativeInterface.disconnectDevice(device)) { Log.d(TAG, "request to disconnect device " + device); } } Loading
android/app/src/com/android/bluetooth/avrcp/AvrcpVolumeManager.java +2 −2 Original line number Diff line number Diff line Loading @@ -95,7 +95,7 @@ class AvrcpVolumeManager extends AudioDeviceCallback { int avrcpVolume = systemToAvrcpVolume(savedVolume); mVolumeEventLogger.logd(TAG, "switchVolumeDevice: Updating device volume: avrcpVolume=" + avrcpVolume); mNativeInterface.sendVolumeChanged(device.getAddress(), avrcpVolume); mNativeInterface.sendVolumeChanged(device, avrcpVolume); } } Loading Loading @@ -200,7 +200,7 @@ class AvrcpVolumeManager extends AudioDeviceCallback { + " avrcpVolume=" + avrcpVolume + " deviceVolume=" + deviceVolume + " sDeviceMaxVolume=" + sDeviceMaxVolume); mNativeInterface.sendVolumeChanged(device.getAddress(), avrcpVolume); mNativeInterface.sendVolumeChanged(device, avrcpVolume); storeVolumeForDevice(device); } Loading
android/app/tests/unit/src/com/android/bluetooth/avrcp/AvrcpVolumeManagerTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -100,7 +100,7 @@ public class AvrcpVolumeManagerTest { public void sendVolumeChanged() { mAvrcpVolumeManager.sendVolumeChanged(mRemoteDevice, TEST_DEVICE_MAX_VOUME); verify(mNativeInterface).sendVolumeChanged(REMOTE_DEVICE_ADDRESS, AVRCP_MAX_VOL); verify(mNativeInterface).sendVolumeChanged(mRemoteDevice, AVRCP_MAX_VOL); } @Test Loading