Loading android/app/src/com/android/bluetooth/ObexServerSockets.java +1 −1 Original line number Diff line number Diff line Loading @@ -96,6 +96,7 @@ public class ObexServerSockets { BluetoothAdapter.SOCKET_CHANNEL_AUTO_STATIC_NO_SDP, false); } private static final int CREATE_RETRY_TIME = 10; /** * Creates an RFCOMM {@link BluetoothServerSocket} and a L2CAP {@link BluetoothServerSocket} * with specific l2cap and RFCOMM channel numbers. It is the responsibility of the caller to Loading @@ -120,7 +121,6 @@ public class ObexServerSockets { BluetoothServerSocket rfcommSocket = null; BluetoothServerSocket l2capSocket = null; boolean initSocketOK = false; final int CREATE_RETRY_TIME = 10; // It's possible that create will fail in some cases. retry for 10 times for (int i = 0; i < CREATE_RETRY_TIME; i++) { Loading android/app/src/com/android/bluetooth/avrcp/AddressedMediaPlayer.java +6 −6 Original line number Diff line number Diff line Loading @@ -267,22 +267,22 @@ public class AddressedMediaPlayer { if (DEBUG) Log.d(TAG, "getFolderItemsFilterAttr: startItem =" + startItem + ", endItem = " + endItem); List<MediaSession.QueueItem> result_items = getQueueSubset(items, startItem, endItem); List<MediaSession.QueueItem> resultItems = getQueueSubset(items, startItem, endItem); /* check for index out of bound errors */ if (result_items == null) { Log.w(TAG, "getFolderItemsFilterAttr: result_items is empty"); if (resultItems == null) { Log.w(TAG, "getFolderItemsFilterAttr: resultItems is empty"); mMediaInterface.folderItemsRsp(bdaddr, AvrcpConstants.RSP_INV_RANGE, null); return; } FolderItemsData folderDataNative = new FolderItemsData(result_items.size()); FolderItemsData folderDataNative = new FolderItemsData(resultItems.size()); /* variables to accumulate attrs */ ArrayList<String> attrArray = new ArrayList<String>(); ArrayList<Integer> attrId = new ArrayList<Integer>(); for (int itemIndex = 0; itemIndex < result_items.size(); itemIndex++) { MediaSession.QueueItem item = result_items.get(itemIndex); for (int itemIndex = 0; itemIndex < resultItems.size(); itemIndex++) { MediaSession.QueueItem item = resultItems.get(itemIndex); // get the queue id long qid = item.getQueueId(); byte[] uid = ByteBuffer.allocate(AvrcpConstants.UID_SIZE).putLong(qid).array(); Loading android/app/src/com/android/bluetooth/avrcp/Avrcp.java +7 −7 Original line number Diff line number Diff line Loading @@ -286,11 +286,11 @@ public final class Avrcp { if (resources != null) { mAbsVolThreshold = resources.getInteger(R.integer.a2dp_absolute_volume_initial_threshold); // Update the threshold if the threshold_percent is valid int threshold_percent = // Update the threshold if the thresholdPercent is valid int thresholdPercent = resources.getInteger(R.integer.a2dp_absolute_volume_initial_threshold_percent); if (threshold_percent >= 0 && threshold_percent <= 100) { mAbsVolThreshold = (threshold_percent * mAudioStreamMax) / 100; if (thresholdPercent >= 0 && thresholdPercent <= 100) { mAbsVolThreshold = (thresholdPercent * mAudioStreamMax) / 100; } } Loading Loading @@ -606,10 +606,10 @@ public final class Avrcp { /* oops, the volume is still same, remote does not like the value * retry a volume one step up/down */ if (DEBUG) Log.d(TAG, "Remote device didn't tune volume, let's try one more step."); int retry_volume = Math.min(AVRCP_MAX_VOL, int retryVolume = Math.min(AVRCP_MAX_VOL, Math.max(0, mLastRemoteVolume + mLastDirection)); if (setVolumeNative(retry_volume)) { mLastRemoteVolume = retry_volume; if (setVolumeNative(retryVolume)) { mLastRemoteVolume = retryVolume; sendMessageDelayed(obtainMessage(MSG_ABS_VOL_TIMEOUT), CMD_TIMEOUT_DELAY); mVolCmdAdjustInProgress = true; } Loading android/app/src/com/android/bluetooth/avrcp/BrowsedMediaPlayer.java +8 −8 Original line number Diff line number Diff line Loading @@ -563,7 +563,7 @@ class BrowsedMediaPlayer { Log.d(TAG, "getFolderItemsFilterAttr: startItem =" + startItem + ", endItem = " + endItem); List<MediaBrowser.MediaItem> result_items = new ArrayList<MediaBrowser.MediaItem>(); List<MediaBrowser.MediaItem> resultItems = new ArrayList<MediaBrowser.MediaItem>(); if (children == null) { Log.e(TAG, "Error: children are null in getFolderItemsFilterAttr"); Loading @@ -572,21 +572,21 @@ class BrowsedMediaPlayer { } /* check for index out of bound errors */ result_items = checkIndexOutofBounds(bdaddr, children, startItem, endItem); if (result_items == null) { Log.w(TAG, "result_items is null."); resultItems = checkIndexOutofBounds(bdaddr, children, startItem, endItem); if (resultItems == null) { Log.w(TAG, "resultItems is null."); mMediaInterface.folderItemsRsp(bdaddr, AvrcpConstants.RSP_INV_RANGE, null); return; } FolderItemsData folderDataNative = new FolderItemsData(result_items.size()); FolderItemsData folderDataNative = new FolderItemsData(resultItems.size()); /* variables to temperorily add attrs */ ArrayList<String> attrArray = new ArrayList<String>(); ArrayList<Integer> attrId = new ArrayList<Integer>(); for (int itemIndex = 0; itemIndex < result_items.size(); itemIndex++) { for (int itemIndex = 0; itemIndex < resultItems.size(); itemIndex++) { /* item type. Needs to be set by media player */ MediaBrowser.MediaItem item = result_items.get(itemIndex); MediaBrowser.MediaItem item = resultItems.get(itemIndex); int flags = item.getFlags(); if ((flags & MediaBrowser.MediaItem.FLAG_BROWSABLE) != 0) { folderDataNative.mItemTypes[itemIndex] = AvrcpConstants.BTRC_ITEM_FOLDER; Loading Loading @@ -632,7 +632,7 @@ class BrowsedMediaPlayer { int attribId = isAllAttribRequested ? (idx + 1) : mFolderItemsReqObj.mAttrIDs[idx]; value = getAttrValue(attribId, result_items.get(itemIndex)); value = getAttrValue(attribId, resultItems.get(itemIndex)); if (value != null) { attrArray.add(value); attrId.add(attribId); Loading android/app/src/com/android/bluetooth/btservice/AbstractionLayer.java +3 −3 Original line number Diff line number Diff line Loading @@ -48,9 +48,9 @@ public final class AbstractionLayer { static final int BT_PROPERTY_REMOTE_VERSION_INFO = 0x0C; static final int BT_PROPERTY_LOCAL_LE_FEATURES = 0x0D; static final int BT_DEVICE_TYPE_BREDR = 0x01; static final int BT_DEVICE_TYPE_BLE = 0x02; static final int BT_DEVICE_TYPE_DUAL = 0x03; public static final int BT_DEVICE_TYPE_BREDR = 0x01; public static final int BT_DEVICE_TYPE_BLE = 0x02; public static final int BT_DEVICE_TYPE_DUAL = 0x03; static final int BT_BOND_STATE_NONE = 0x00; static final int BT_BOND_STATE_BONDING = 0x01; Loading Loading
android/app/src/com/android/bluetooth/ObexServerSockets.java +1 −1 Original line number Diff line number Diff line Loading @@ -96,6 +96,7 @@ public class ObexServerSockets { BluetoothAdapter.SOCKET_CHANNEL_AUTO_STATIC_NO_SDP, false); } private static final int CREATE_RETRY_TIME = 10; /** * Creates an RFCOMM {@link BluetoothServerSocket} and a L2CAP {@link BluetoothServerSocket} * with specific l2cap and RFCOMM channel numbers. It is the responsibility of the caller to Loading @@ -120,7 +121,6 @@ public class ObexServerSockets { BluetoothServerSocket rfcommSocket = null; BluetoothServerSocket l2capSocket = null; boolean initSocketOK = false; final int CREATE_RETRY_TIME = 10; // It's possible that create will fail in some cases. retry for 10 times for (int i = 0; i < CREATE_RETRY_TIME; i++) { Loading
android/app/src/com/android/bluetooth/avrcp/AddressedMediaPlayer.java +6 −6 Original line number Diff line number Diff line Loading @@ -267,22 +267,22 @@ public class AddressedMediaPlayer { if (DEBUG) Log.d(TAG, "getFolderItemsFilterAttr: startItem =" + startItem + ", endItem = " + endItem); List<MediaSession.QueueItem> result_items = getQueueSubset(items, startItem, endItem); List<MediaSession.QueueItem> resultItems = getQueueSubset(items, startItem, endItem); /* check for index out of bound errors */ if (result_items == null) { Log.w(TAG, "getFolderItemsFilterAttr: result_items is empty"); if (resultItems == null) { Log.w(TAG, "getFolderItemsFilterAttr: resultItems is empty"); mMediaInterface.folderItemsRsp(bdaddr, AvrcpConstants.RSP_INV_RANGE, null); return; } FolderItemsData folderDataNative = new FolderItemsData(result_items.size()); FolderItemsData folderDataNative = new FolderItemsData(resultItems.size()); /* variables to accumulate attrs */ ArrayList<String> attrArray = new ArrayList<String>(); ArrayList<Integer> attrId = new ArrayList<Integer>(); for (int itemIndex = 0; itemIndex < result_items.size(); itemIndex++) { MediaSession.QueueItem item = result_items.get(itemIndex); for (int itemIndex = 0; itemIndex < resultItems.size(); itemIndex++) { MediaSession.QueueItem item = resultItems.get(itemIndex); // get the queue id long qid = item.getQueueId(); byte[] uid = ByteBuffer.allocate(AvrcpConstants.UID_SIZE).putLong(qid).array(); Loading
android/app/src/com/android/bluetooth/avrcp/Avrcp.java +7 −7 Original line number Diff line number Diff line Loading @@ -286,11 +286,11 @@ public final class Avrcp { if (resources != null) { mAbsVolThreshold = resources.getInteger(R.integer.a2dp_absolute_volume_initial_threshold); // Update the threshold if the threshold_percent is valid int threshold_percent = // Update the threshold if the thresholdPercent is valid int thresholdPercent = resources.getInteger(R.integer.a2dp_absolute_volume_initial_threshold_percent); if (threshold_percent >= 0 && threshold_percent <= 100) { mAbsVolThreshold = (threshold_percent * mAudioStreamMax) / 100; if (thresholdPercent >= 0 && thresholdPercent <= 100) { mAbsVolThreshold = (thresholdPercent * mAudioStreamMax) / 100; } } Loading Loading @@ -606,10 +606,10 @@ public final class Avrcp { /* oops, the volume is still same, remote does not like the value * retry a volume one step up/down */ if (DEBUG) Log.d(TAG, "Remote device didn't tune volume, let's try one more step."); int retry_volume = Math.min(AVRCP_MAX_VOL, int retryVolume = Math.min(AVRCP_MAX_VOL, Math.max(0, mLastRemoteVolume + mLastDirection)); if (setVolumeNative(retry_volume)) { mLastRemoteVolume = retry_volume; if (setVolumeNative(retryVolume)) { mLastRemoteVolume = retryVolume; sendMessageDelayed(obtainMessage(MSG_ABS_VOL_TIMEOUT), CMD_TIMEOUT_DELAY); mVolCmdAdjustInProgress = true; } Loading
android/app/src/com/android/bluetooth/avrcp/BrowsedMediaPlayer.java +8 −8 Original line number Diff line number Diff line Loading @@ -563,7 +563,7 @@ class BrowsedMediaPlayer { Log.d(TAG, "getFolderItemsFilterAttr: startItem =" + startItem + ", endItem = " + endItem); List<MediaBrowser.MediaItem> result_items = new ArrayList<MediaBrowser.MediaItem>(); List<MediaBrowser.MediaItem> resultItems = new ArrayList<MediaBrowser.MediaItem>(); if (children == null) { Log.e(TAG, "Error: children are null in getFolderItemsFilterAttr"); Loading @@ -572,21 +572,21 @@ class BrowsedMediaPlayer { } /* check for index out of bound errors */ result_items = checkIndexOutofBounds(bdaddr, children, startItem, endItem); if (result_items == null) { Log.w(TAG, "result_items is null."); resultItems = checkIndexOutofBounds(bdaddr, children, startItem, endItem); if (resultItems == null) { Log.w(TAG, "resultItems is null."); mMediaInterface.folderItemsRsp(bdaddr, AvrcpConstants.RSP_INV_RANGE, null); return; } FolderItemsData folderDataNative = new FolderItemsData(result_items.size()); FolderItemsData folderDataNative = new FolderItemsData(resultItems.size()); /* variables to temperorily add attrs */ ArrayList<String> attrArray = new ArrayList<String>(); ArrayList<Integer> attrId = new ArrayList<Integer>(); for (int itemIndex = 0; itemIndex < result_items.size(); itemIndex++) { for (int itemIndex = 0; itemIndex < resultItems.size(); itemIndex++) { /* item type. Needs to be set by media player */ MediaBrowser.MediaItem item = result_items.get(itemIndex); MediaBrowser.MediaItem item = resultItems.get(itemIndex); int flags = item.getFlags(); if ((flags & MediaBrowser.MediaItem.FLAG_BROWSABLE) != 0) { folderDataNative.mItemTypes[itemIndex] = AvrcpConstants.BTRC_ITEM_FOLDER; Loading Loading @@ -632,7 +632,7 @@ class BrowsedMediaPlayer { int attribId = isAllAttribRequested ? (idx + 1) : mFolderItemsReqObj.mAttrIDs[idx]; value = getAttrValue(attribId, result_items.get(itemIndex)); value = getAttrValue(attribId, resultItems.get(itemIndex)); if (value != null) { attrArray.add(value); attrId.add(attribId); Loading
android/app/src/com/android/bluetooth/btservice/AbstractionLayer.java +3 −3 Original line number Diff line number Diff line Loading @@ -48,9 +48,9 @@ public final class AbstractionLayer { static final int BT_PROPERTY_REMOTE_VERSION_INFO = 0x0C; static final int BT_PROPERTY_LOCAL_LE_FEATURES = 0x0D; static final int BT_DEVICE_TYPE_BREDR = 0x01; static final int BT_DEVICE_TYPE_BLE = 0x02; static final int BT_DEVICE_TYPE_DUAL = 0x03; public static final int BT_DEVICE_TYPE_BREDR = 0x01; public static final int BT_DEVICE_TYPE_BLE = 0x02; public static final int BT_DEVICE_TYPE_DUAL = 0x03; static final int BT_BOND_STATE_NONE = 0x00; static final int BT_BOND_STATE_BONDING = 0x01; Loading