diff options
author | Sal Savage <salsavage@google.com> | 2020-02-06 15:36:50 -0800 |
---|---|---|
committer | Joseph Pirozzo <pirozzoj@google.com> | 2020-03-16 19:12:43 +0000 |
commit | 0c5249af8f81b0b9aac51cc233914b1649c5f000 (patch) | |
tree | 044ad5124bc65dd474d8b297753cab5c52dc452f | |
parent | 6034badf786924de33103f7dea77b9652c827b9c (diff) | |
download | android_packages_apps_Bluetooth-0c5249af8f81b0b9aac51cc233914b1649c5f000.tar.gz android_packages_apps_Bluetooth-0c5249af8f81b0b9aac51cc233914b1649c5f000.tar.bz2 android_packages_apps_Bluetooth-0c5249af8f81b0b9aac51cc233914b1649c5f000.zip |
Return an empty list when the requested node is not in the tree
This change makes it so a request for the data in a folder that doesn't
exist always returns promptly. Prior to this, all requests would hang
indefinitely instead.
This is only a stand in for a future solution to send a null result
through the media framework instead. Unfortunately, our structure needs
some tweaking to make that work. This will be fine for the interim.
Bug: 148604797
Test: Build, flash, browse deep into a tree, switch players to invalid
that parents of the node you're on, try browsing upward. See that we
return an empty list for all missing nodes.
Change-Id: Ifd5ed106d3b46377f0d7cd2d1e565cde45ab06f9
Merged-In: Ifd5ed106d3b46377f0d7cd2d1e565cde45ab06f9
-rw-r--r-- | src/com/android/bluetooth/avrcpcontroller/AvrcpControllerService.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/com/android/bluetooth/avrcpcontroller/AvrcpControllerService.java b/src/com/android/bluetooth/avrcpcontroller/AvrcpControllerService.java index 693b4a291..56684cd7c 100644 --- a/src/com/android/bluetooth/avrcpcontroller/AvrcpControllerService.java +++ b/src/com/android/bluetooth/avrcpcontroller/AvrcpControllerService.java @@ -172,9 +172,11 @@ public class AvrcpControllerService extends ProfileService { } } + // If we don't find a node in the tree then do not have any way to browse for the contents. + // Return an empty list instead. if (requestedNode == null) { if (DBG) Log.d(TAG, "Didn't find a node"); - return null; + return new ArrayList(0); } else { if (!requestedNode.isCached()) { if (DBG) Log.d(TAG, "node is not cached"); |