Loading android/app/jni/com_android_bluetooth_avrcp.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -295,9 +295,9 @@ static void btavrcp_get_folder_items_callback( (jint*)puiAttr); } sCallbackEnv->CallVoidMethod(mCallbacksObj, method_getFolderItemsCallback, addr.get(), (jbyte)scope, (jint)start_item, (jint)end_item, (jbyte)num_attr, attr_ids.get()); sCallbackEnv->CallVoidMethod( mCallbacksObj, method_getFolderItemsCallback, addr.get(), (jbyte)scope, (jlong)start_item, (jlong)end_item, (jbyte)num_attr, attr_ids.get()); } static void btavrcp_change_path_callback(uint8_t direction, uint8_t* folder_uid, Loading Loading @@ -547,7 +547,7 @@ static void classInitNative(JNIEnv* env, jclass clazz) { env->GetMethodID(clazz, "setBrowsedPlayerRequestFromNative", "([BI)V"); method_getFolderItemsCallback = env->GetMethodID(clazz, "getFolderItemsRequestFromNative", "([BBIIB[I)V"); env->GetMethodID(clazz, "getFolderItemsRequestFromNative", "([BBJJB[I)V"); method_changePathCallback = env->GetMethodID(clazz, "changePathRequestFromNative", "([BB[B)V"); Loading android/app/src/com/android/bluetooth/avrcp/AddressedMediaPlayer.java +5 −3 Original line number Diff line number Diff line Loading @@ -264,10 +264,12 @@ public class AddressedMediaPlayer { * MediaItem list. (Resultset containing all items in current path) */ private List<MediaSession.QueueItem> checkIndexOutofBounds( byte[] bdaddr, List<MediaSession.QueueItem> items, int startItem, int endItem) { byte[] bdaddr, List<MediaSession.QueueItem> items, long startItem, long endItem) { if (endItem > items.size()) endItem = items.size() - 1; if (startItem > Integer.MAX_VALUE) startItem = Integer.MAX_VALUE; try { List<MediaSession.QueueItem> selected = items.subList(startItem, Math.min(items.size(), endItem + 1)); items.subList((int) startItem, (int) Math.min(items.size(), endItem + 1)); if (selected.isEmpty()) { Log.i(TAG, "itemsSubList is empty."); return null; Loading @@ -286,7 +288,7 @@ public class AddressedMediaPlayer { * response */ private void getFolderItemsFilterAttr(byte[] bdaddr, AvrcpCmd.FolderItemsCmd folderItemsReqObj, List<MediaSession.QueueItem> items, byte scope, int startItem, int endItem, List<MediaSession.QueueItem> items, byte scope, long startItem, long endItem, MediaController mediaController) { if (DEBUG) Log.d(TAG, "getFolderItemsFilterAttr: startItem =" + startItem + ", endItem = " + endItem); Loading android/app/src/com/android/bluetooth/avrcp/Avrcp.java +2 −2 Original line number Diff line number Diff line Loading @@ -1233,8 +1233,8 @@ public final class Avrcp { mHandler.sendMessage(msg); } private void getFolderItemsRequestFromNative(byte[] address, byte scope, int startItem, int endItem, byte numAttr, int[] attrIds) { private void getFolderItemsRequestFromNative( byte[] address, byte scope, long startItem, long endItem, byte numAttr, int[] attrIds) { if (DEBUG) Log.v(TAG, "getFolderItemsRequestFromNative: scope=" + scope + ", numAttr=" + numAttr); AvrcpCmd avrcpCmdobj = new AvrcpCmd(); AvrcpCmd.FolderItemsCmd folderObj = avrcpCmdobj.new FolderItemsCmd(address, scope, Loading android/app/src/com/android/bluetooth/avrcp/AvrcpHelperClasses.java +4 −4 Original line number Diff line number Diff line Loading @@ -36,14 +36,14 @@ class AvrcpCmd { /* Helper classes to pass parameters from callbacks to Avrcp handler */ class FolderItemsCmd { byte mScope; int mStartItem; int mEndItem; long mStartItem; long mEndItem; byte mNumAttr; int[] mAttrIDs; public byte[] mAddress; public FolderItemsCmd(byte[] address,byte scope, int startItem, int endItem, byte numAttr, int[] attrIds) { public FolderItemsCmd(byte[] address, byte scope, long startItem, long endItem, byte numAttr, int[] attrIds) { mAddress = address; this.mScope = scope; this.mStartItem = startItem; Loading android/app/src/com/android/bluetooth/avrcp/BrowsedMediaPlayer.java +6 −4 Original line number Diff line number Diff line Loading @@ -438,11 +438,13 @@ class BrowsedMediaPlayer { * helper method to check if startItem and endItem index is with range of * MediaItem list. (Resultset containing all items in current path) */ private List<MediaBrowser.MediaItem> checkIndexOutofBounds(byte[] bdaddr, List<MediaBrowser.MediaItem> children, int startItem, int endItem) { private List<MediaBrowser.MediaItem> checkIndexOutofBounds( byte[] bdaddr, List<MediaBrowser.MediaItem> children, long startItem, long endItem) { if (endItem > children.size()) endItem = children.size() - 1; if (startItem >= Integer.MAX_VALUE) startItem = Integer.MAX_VALUE; try { List<MediaBrowser.MediaItem> childrenSubList = children.subList(startItem, Math.min(children.size(), endItem + 1)); children.subList((int) startItem, (int) endItem + 1); if (childrenSubList.isEmpty()) { Log.i(TAG, "childrenSubList is empty."); throw new IndexOutOfBoundsException(); Loading @@ -465,7 +467,7 @@ class BrowsedMediaPlayer { * helper method to filter required attibutes before sending GetFolderItems response */ public void getFolderItemsFilterAttr(byte[] bdaddr, AvrcpCmd.FolderItemsCmd mFolderItemsReqObj, List<MediaBrowser.MediaItem> children, byte scope, int startItem, int endItem) { List<MediaBrowser.MediaItem> children, byte scope, long startItem, long endItem) { if (DEBUG) Log.d(TAG, "getFolderItemsFilterAttr: startItem =" + startItem + ", endItem = " + endItem); Loading Loading
android/app/jni/com_android_bluetooth_avrcp.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -295,9 +295,9 @@ static void btavrcp_get_folder_items_callback( (jint*)puiAttr); } sCallbackEnv->CallVoidMethod(mCallbacksObj, method_getFolderItemsCallback, addr.get(), (jbyte)scope, (jint)start_item, (jint)end_item, (jbyte)num_attr, attr_ids.get()); sCallbackEnv->CallVoidMethod( mCallbacksObj, method_getFolderItemsCallback, addr.get(), (jbyte)scope, (jlong)start_item, (jlong)end_item, (jbyte)num_attr, attr_ids.get()); } static void btavrcp_change_path_callback(uint8_t direction, uint8_t* folder_uid, Loading Loading @@ -547,7 +547,7 @@ static void classInitNative(JNIEnv* env, jclass clazz) { env->GetMethodID(clazz, "setBrowsedPlayerRequestFromNative", "([BI)V"); method_getFolderItemsCallback = env->GetMethodID(clazz, "getFolderItemsRequestFromNative", "([BBIIB[I)V"); env->GetMethodID(clazz, "getFolderItemsRequestFromNative", "([BBJJB[I)V"); method_changePathCallback = env->GetMethodID(clazz, "changePathRequestFromNative", "([BB[B)V"); Loading
android/app/src/com/android/bluetooth/avrcp/AddressedMediaPlayer.java +5 −3 Original line number Diff line number Diff line Loading @@ -264,10 +264,12 @@ public class AddressedMediaPlayer { * MediaItem list. (Resultset containing all items in current path) */ private List<MediaSession.QueueItem> checkIndexOutofBounds( byte[] bdaddr, List<MediaSession.QueueItem> items, int startItem, int endItem) { byte[] bdaddr, List<MediaSession.QueueItem> items, long startItem, long endItem) { if (endItem > items.size()) endItem = items.size() - 1; if (startItem > Integer.MAX_VALUE) startItem = Integer.MAX_VALUE; try { List<MediaSession.QueueItem> selected = items.subList(startItem, Math.min(items.size(), endItem + 1)); items.subList((int) startItem, (int) Math.min(items.size(), endItem + 1)); if (selected.isEmpty()) { Log.i(TAG, "itemsSubList is empty."); return null; Loading @@ -286,7 +288,7 @@ public class AddressedMediaPlayer { * response */ private void getFolderItemsFilterAttr(byte[] bdaddr, AvrcpCmd.FolderItemsCmd folderItemsReqObj, List<MediaSession.QueueItem> items, byte scope, int startItem, int endItem, List<MediaSession.QueueItem> items, byte scope, long startItem, long endItem, MediaController mediaController) { if (DEBUG) Log.d(TAG, "getFolderItemsFilterAttr: startItem =" + startItem + ", endItem = " + endItem); Loading
android/app/src/com/android/bluetooth/avrcp/Avrcp.java +2 −2 Original line number Diff line number Diff line Loading @@ -1233,8 +1233,8 @@ public final class Avrcp { mHandler.sendMessage(msg); } private void getFolderItemsRequestFromNative(byte[] address, byte scope, int startItem, int endItem, byte numAttr, int[] attrIds) { private void getFolderItemsRequestFromNative( byte[] address, byte scope, long startItem, long endItem, byte numAttr, int[] attrIds) { if (DEBUG) Log.v(TAG, "getFolderItemsRequestFromNative: scope=" + scope + ", numAttr=" + numAttr); AvrcpCmd avrcpCmdobj = new AvrcpCmd(); AvrcpCmd.FolderItemsCmd folderObj = avrcpCmdobj.new FolderItemsCmd(address, scope, Loading
android/app/src/com/android/bluetooth/avrcp/AvrcpHelperClasses.java +4 −4 Original line number Diff line number Diff line Loading @@ -36,14 +36,14 @@ class AvrcpCmd { /* Helper classes to pass parameters from callbacks to Avrcp handler */ class FolderItemsCmd { byte mScope; int mStartItem; int mEndItem; long mStartItem; long mEndItem; byte mNumAttr; int[] mAttrIDs; public byte[] mAddress; public FolderItemsCmd(byte[] address,byte scope, int startItem, int endItem, byte numAttr, int[] attrIds) { public FolderItemsCmd(byte[] address, byte scope, long startItem, long endItem, byte numAttr, int[] attrIds) { mAddress = address; this.mScope = scope; this.mStartItem = startItem; Loading
android/app/src/com/android/bluetooth/avrcp/BrowsedMediaPlayer.java +6 −4 Original line number Diff line number Diff line Loading @@ -438,11 +438,13 @@ class BrowsedMediaPlayer { * helper method to check if startItem and endItem index is with range of * MediaItem list. (Resultset containing all items in current path) */ private List<MediaBrowser.MediaItem> checkIndexOutofBounds(byte[] bdaddr, List<MediaBrowser.MediaItem> children, int startItem, int endItem) { private List<MediaBrowser.MediaItem> checkIndexOutofBounds( byte[] bdaddr, List<MediaBrowser.MediaItem> children, long startItem, long endItem) { if (endItem > children.size()) endItem = children.size() - 1; if (startItem >= Integer.MAX_VALUE) startItem = Integer.MAX_VALUE; try { List<MediaBrowser.MediaItem> childrenSubList = children.subList(startItem, Math.min(children.size(), endItem + 1)); children.subList((int) startItem, (int) endItem + 1); if (childrenSubList.isEmpty()) { Log.i(TAG, "childrenSubList is empty."); throw new IndexOutOfBoundsException(); Loading @@ -465,7 +467,7 @@ class BrowsedMediaPlayer { * helper method to filter required attibutes before sending GetFolderItems response */ public void getFolderItemsFilterAttr(byte[] bdaddr, AvrcpCmd.FolderItemsCmd mFolderItemsReqObj, List<MediaBrowser.MediaItem> children, byte scope, int startItem, int endItem) { List<MediaBrowser.MediaItem> children, byte scope, long startItem, long endItem) { if (DEBUG) Log.d(TAG, "getFolderItemsFilterAttr: startItem =" + startItem + ", endItem = " + endItem); Loading