Really fix file picker.
This commit is contained in:
parent
3f0c7bb7a3
commit
4bd4fb700a
@ -440,8 +440,10 @@ public class FileSystemAdapter
|
||||
*/
|
||||
public void onItemClicked(Intent intent) {
|
||||
boolean isFolder = intent.getBooleanExtra(LibraryAdapter.DATA_EXPANDABLE, false);
|
||||
boolean isHeader = intent.getLongExtra(LibraryAdapter.DATA_ID, LibraryAdapter.INVALID_ID)
|
||||
== LibraryAdapter.HEADER_ID;
|
||||
|
||||
if (FileUtils.canDispatchIntent(intent) && FileUtils.dispatchIntent(mActivity, intent))
|
||||
if (!isHeader && FileUtils.canDispatchIntent(intent) && FileUtils.dispatchIntent(mActivity, intent))
|
||||
return;
|
||||
|
||||
if (isFolder) {
|
||||
|
@ -248,7 +248,7 @@ public class SlidingPlaybackActivity extends PlaybackActivity
|
||||
query = allSource.buildSongQuery(projection);
|
||||
query.data = id;
|
||||
} else if (type == MediaUtils.TYPE_FILE) {
|
||||
query = MediaUtils.buildFileQuery(intent.getStringExtra(LibraryAdapter.DATA_FILE), projection, false /* recursive */);
|
||||
query = MediaUtils.buildFileQuery(intent.getStringExtra(LibraryAdapter.DATA_FILE), projection, true /* recursive */);
|
||||
} else {
|
||||
query = MediaUtils.buildQuery(type, id, projection, null);
|
||||
}
|
||||
|
@ -749,7 +749,11 @@ public final class SongTimeline {
|
||||
int added = 0; // Items actually added to the queue
|
||||
|
||||
if (count == 0 && type == MediaUtils.TYPE_FILE && query.selectionArgs.length == 1) {
|
||||
// This seems to be a simple file query which lead to no results.
|
||||
// Assume that this was a LIKE query for an unindexed file, so drop the '%' char
|
||||
// at the end and return a fileCursor for it.
|
||||
String pathQuery = query.selectionArgs[0];
|
||||
pathQuery = pathQuery.substring(0,pathQuery.length()-1);
|
||||
cursor.close(); // close old version
|
||||
cursor = MediaUtils.getCursorForFileQuery(pathQuery);
|
||||
count = cursor.getCount();
|
||||
|
Loading…
x
Reference in New Issue
Block a user