summaryrefslogtreecommitdiffstats
path: root/packages/DocumentsUI/src/com/android/documentsui/DirectoryLoader.java
diff options
context:
space:
mode:
Diffstat (limited to 'packages/DocumentsUI/src/com/android/documentsui/DirectoryLoader.java')
-rw-r--r--packages/DocumentsUI/src/com/android/documentsui/DirectoryLoader.java18
1 files changed, 3 insertions, 15 deletions
diff --git a/packages/DocumentsUI/src/com/android/documentsui/DirectoryLoader.java b/packages/DocumentsUI/src/com/android/documentsui/DirectoryLoader.java
index 14d6fd5..4ce5ef8 100644
--- a/packages/DocumentsUI/src/com/android/documentsui/DirectoryLoader.java
+++ b/packages/DocumentsUI/src/com/android/documentsui/DirectoryLoader.java
@@ -26,7 +26,6 @@ import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import android.os.CancellationSignal;
-import android.provider.DocumentsContract.DocumentColumns;
import android.util.Log;
import com.android.documentsui.model.Document;
@@ -77,9 +76,10 @@ public class DirectoryLoader extends UriDerivativeLoader<Uri, DirectoryResult> {
}
private void loadInBackgroundInternal(
- DirectoryResult result, Uri uri, CancellationSignal signal) {
+ DirectoryResult result, Uri uri, CancellationSignal signal) throws RuntimeException {
+ // TODO: switch to using unstable CPC
final ContentResolver resolver = getContext().getContentResolver();
- final Cursor cursor = resolver.query(uri, null, null, null, getQuerySortOrder(), signal);
+ final Cursor cursor = resolver.query(uri, null, null, null, null, signal);
result.cursor = cursor;
result.cursor.registerContentObserver(mObserver);
@@ -110,16 +110,4 @@ public class DirectoryLoader extends UriDerivativeLoader<Uri, DirectoryResult> {
Collections.sort(result.contents, mSortOrder);
}
}
-
- private String getQuerySortOrder() {
- if (mSortOrder instanceof Document.DateComparator) {
- return DocumentColumns.LAST_MODIFIED + " DESC";
- } else if (mSortOrder instanceof Document.NameComparator) {
- return DocumentColumns.DISPLAY_NAME + " ASC";
- } else if (mSortOrder instanceof Document.SizeComparator) {
- return DocumentColumns.SIZE + " DESC";
- } else {
- return null;
- }
- }
}