diff options
author | Jeff Sharkey <jsharkey@android.com> | 2013-09-09 09:16:29 -0700 |
---|---|---|
committer | Jeff Sharkey <jsharkey@android.com> | 2013-09-09 17:52:47 -0700 |
commit | 66bdbe486e572aee1b06e3dbea9daf87ceb0e1bb (patch) | |
tree | f9b577f6d38a34c4420b1899e9431fc82e525892 /src/com/android | |
parent | 3c03d1b8b7d96209d7b83b6881421ddfc17ccc52 (diff) | |
download | android_packages_providers_DownloadProvider-66bdbe486e572aee1b06e3dbea9daf87ceb0e1bb.tar.gz android_packages_providers_DownloadProvider-66bdbe486e572aee1b06e3dbea9daf87ceb0e1bb.tar.bz2 android_packages_providers_DownloadProvider-66bdbe486e572aee1b06e3dbea9daf87ceb0e1bb.zip |
Hint sorting, remove XML, follow refactor.
Bug: 10672973, 10577809
Change-Id: I92314c35b37ac590830e881489e6a88afd860de4
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/providers/downloads/DownloadStorageProvider.java | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/src/com/android/providers/downloads/DownloadStorageProvider.java b/src/com/android/providers/downloads/DownloadStorageProvider.java index f1cd8fa9..9315ea32 100644 --- a/src/com/android/providers/downloads/DownloadStorageProvider.java +++ b/src/com/android/providers/downloads/DownloadStorageProvider.java @@ -83,12 +83,12 @@ public class DownloadStorageProvider extends DocumentsProvider { public Cursor queryRoots(String[] projection) throws FileNotFoundException { final MatrixCursor result = new MatrixCursor(resolveRootProjection(projection)); final RowBuilder row = result.newRow(); - row.offer(Root.COLUMN_ROOT_ID, DOC_ID_ROOT); - row.offer(Root.COLUMN_ROOT_TYPE, Root.ROOT_TYPE_SHORTCUT); - row.offer(Root.COLUMN_FLAGS, Root.FLAG_LOCAL_ONLY | Root.FLAG_SUPPORTS_RECENTS); - row.offer(Root.COLUMN_ICON, R.mipmap.ic_launcher_download); - row.offer(Root.COLUMN_TITLE, getContext().getString(R.string.root_downloads)); - row.offer(Root.COLUMN_DOCUMENT_ID, DOC_ID_ROOT); + row.add(Root.COLUMN_ROOT_ID, DOC_ID_ROOT); + row.add(Root.COLUMN_ROOT_TYPE, Root.ROOT_TYPE_SHORTCUT); + row.add(Root.COLUMN_FLAGS, Root.FLAG_LOCAL_ONLY | Root.FLAG_SUPPORTS_RECENTS); + row.add(Root.COLUMN_ICON, R.mipmap.ic_launcher_download); + row.add(Root.COLUMN_TITLE, getContext().getString(R.string.root_downloads)); + row.add(Root.COLUMN_DOCUMENT_ID, DOC_ID_ROOT); return result; } @@ -198,8 +198,9 @@ public class DownloadStorageProvider extends DocumentsProvider { private void includeDefaultDocument(MatrixCursor result) { final RowBuilder row = result.newRow(); - row.offer(Document.COLUMN_DOCUMENT_ID, DOC_ID_ROOT); - row.offer(Document.COLUMN_MIME_TYPE, Document.MIME_TYPE_DIR); + row.add(Document.COLUMN_DOCUMENT_ID, DOC_ID_ROOT); + row.add(Document.COLUMN_MIME_TYPE, Document.MIME_TYPE_DIR); + row.add(Document.COLUMN_FLAGS, Document.FLAG_DIR_PREFERS_LAST_MODIFIED); } private void includeDownloadFromCursor(MatrixCursor result, Cursor cursor) { @@ -257,12 +258,12 @@ public class DownloadStorageProvider extends DocumentsProvider { cursor.getColumnIndexOrThrow(DownloadManager.COLUMN_LAST_MODIFIED_TIMESTAMP)); final RowBuilder row = result.newRow(); - row.offer(Document.COLUMN_DOCUMENT_ID, docId); - row.offer(Document.COLUMN_DISPLAY_NAME, displayName); - row.offer(Document.COLUMN_SUMMARY, summary); - row.offer(Document.COLUMN_SIZE, size); - row.offer(Document.COLUMN_MIME_TYPE, mimeType); - row.offer(Document.COLUMN_LAST_MODIFIED, lastModified); - row.offer(Document.COLUMN_FLAGS, flags); + row.add(Document.COLUMN_DOCUMENT_ID, docId); + row.add(Document.COLUMN_DISPLAY_NAME, displayName); + row.add(Document.COLUMN_SUMMARY, summary); + row.add(Document.COLUMN_SIZE, size); + row.add(Document.COLUMN_MIME_TYPE, mimeType); + row.add(Document.COLUMN_LAST_MODIFIED, lastModified); + row.add(Document.COLUMN_FLAGS, flags); } } |