Loading android/app/src/com/android/bluetooth/BluetoothObexTransport.java +9 −1 Original line number Diff line number Diff line Loading @@ -40,6 +40,8 @@ public class BluetoothObexTransport implements ObexTransport { private int mMaxTransmitPacketSize = PACKET_SIZE_UNSPECIFIED; private int mMaxReceivePacketSize = PACKET_SIZE_UNSPECIFIED; private boolean mIsCoverArt = false; public BluetoothObexTransport(BluetoothSocket socket) { this.mSocket = socket; } Loading Loading @@ -97,7 +99,9 @@ public class BluetoothObexTransport implements ObexTransport { @Override public int getMaxTransmitPacketSize() { if (mSocket.getConnectionType() != BluetoothSocket.TYPE_L2CAP) { if (mSocket.getConnectionType() != BluetoothSocket.TYPE_L2CAP || (mIsCoverArt && mMaxTransmitPacketSize != PACKET_SIZE_UNSPECIFIED)) { return mMaxTransmitPacketSize; } return mSocket.getMaxTransmitPacketSize(); Loading Loading @@ -125,4 +129,8 @@ public class BluetoothObexTransport implements ObexTransport { } return false; } public void setConnectionForCoverArt(boolean isCoverArt) { mIsCoverArt = isCoverArt; } } android/app/src/com/android/bluetooth/avrcp/AvrcpCoverArtService.java +12 −3 Original line number Diff line number Diff line Loading @@ -35,8 +35,8 @@ import javax.obex.ServerSession; /** * The AVRCP Cover Art Service * * This service handles allocation of image handles and storage of images. It also owns the BIP OBEX * server that handles requests to get AVRCP cover artwork. * This service handles allocation of image handles and storage of images. It also owns the * BIP OBEX server that handles requests to get AVRCP cover artwork. */ public class AvrcpCoverArtService { private static final String TAG = "AvrcpCoverArtService"; Loading @@ -44,6 +44,12 @@ public class AvrcpCoverArtService { private static final int COVER_ART_STORAGE_MAX_ITEMS = 32; /** * Limiting transmit packet size because some carkits are disconnected if * AVRCP Cover Art OBEX packet size exceed 1024 bytes. */ private static final int MAX_TRANSMIT_PACKET_SIZE = 1024; private final Context mContext; // Cover Art and Image Handle objects Loading Loading @@ -207,7 +213,10 @@ public class AvrcpCoverArtService { disconnect(device); } }); BluetoothObexTransport transport = new BluetoothObexTransport(socket); BluetoothObexTransport transport = new BluetoothObexTransport(socket, MAX_TRANSMIT_PACKET_SIZE, BluetoothObexTransport.PACKET_SIZE_UNSPECIFIED); transport.setConnectionForCoverArt(true); try { ServerSession session = new ServerSession(transport, s, null); mClients.put(device, session); Loading Loading
android/app/src/com/android/bluetooth/BluetoothObexTransport.java +9 −1 Original line number Diff line number Diff line Loading @@ -40,6 +40,8 @@ public class BluetoothObexTransport implements ObexTransport { private int mMaxTransmitPacketSize = PACKET_SIZE_UNSPECIFIED; private int mMaxReceivePacketSize = PACKET_SIZE_UNSPECIFIED; private boolean mIsCoverArt = false; public BluetoothObexTransport(BluetoothSocket socket) { this.mSocket = socket; } Loading Loading @@ -97,7 +99,9 @@ public class BluetoothObexTransport implements ObexTransport { @Override public int getMaxTransmitPacketSize() { if (mSocket.getConnectionType() != BluetoothSocket.TYPE_L2CAP) { if (mSocket.getConnectionType() != BluetoothSocket.TYPE_L2CAP || (mIsCoverArt && mMaxTransmitPacketSize != PACKET_SIZE_UNSPECIFIED)) { return mMaxTransmitPacketSize; } return mSocket.getMaxTransmitPacketSize(); Loading Loading @@ -125,4 +129,8 @@ public class BluetoothObexTransport implements ObexTransport { } return false; } public void setConnectionForCoverArt(boolean isCoverArt) { mIsCoverArt = isCoverArt; } }
android/app/src/com/android/bluetooth/avrcp/AvrcpCoverArtService.java +12 −3 Original line number Diff line number Diff line Loading @@ -35,8 +35,8 @@ import javax.obex.ServerSession; /** * The AVRCP Cover Art Service * * This service handles allocation of image handles and storage of images. It also owns the BIP OBEX * server that handles requests to get AVRCP cover artwork. * This service handles allocation of image handles and storage of images. It also owns the * BIP OBEX server that handles requests to get AVRCP cover artwork. */ public class AvrcpCoverArtService { private static final String TAG = "AvrcpCoverArtService"; Loading @@ -44,6 +44,12 @@ public class AvrcpCoverArtService { private static final int COVER_ART_STORAGE_MAX_ITEMS = 32; /** * Limiting transmit packet size because some carkits are disconnected if * AVRCP Cover Art OBEX packet size exceed 1024 bytes. */ private static final int MAX_TRANSMIT_PACKET_SIZE = 1024; private final Context mContext; // Cover Art and Image Handle objects Loading Loading @@ -207,7 +213,10 @@ public class AvrcpCoverArtService { disconnect(device); } }); BluetoothObexTransport transport = new BluetoothObexTransport(socket); BluetoothObexTransport transport = new BluetoothObexTransport(socket, MAX_TRANSMIT_PACKET_SIZE, BluetoothObexTransport.PACKET_SIZE_UNSPECIFIED); transport.setConnectionForCoverArt(true); try { ServerSession session = new ServerSession(transport, s, null); mClients.put(device, session); Loading