From 348ad6866b91afa4d59d45df533ef88094c74d13 Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Mon, 2 Sep 2013 17:19:40 -0700 Subject: Filter roots based on incoming request. When incoming request is for local-only content, or for ACTION_CREATE, only include roots advertise those features. Filters roots based on the allowed MIME types and the supported types advertised by each root. This supports displaying Images and Audio roots only when requesting those content types. Applies the same filter when deciding which roots to query for recents. Fixes advanced filtering instead of limiting to just devices. Update sorting so that Recent always appears first. Add testing support for LOCAL_ONLY. Bug: 10597317, 10526535 Change-Id: Ic5ccf475c4fe93fd52b29388d369d7f6915c0c42 --- .../src/com/android/externalstorage/ExternalStorageProvider.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'packages/ExternalStorageProvider/src') diff --git a/packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java b/packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java index de8c29a..bbe3b45 100644 --- a/packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java +++ b/packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java @@ -87,9 +87,7 @@ public class ExternalStorageProvider extends DocumentsProvider { final RootInfo root = new RootInfo(); root.rootId = "primary"; root.rootType = Root.ROOT_TYPE_DEVICE; - root.flags = Root.FLAG_SUPPORTS_CREATE | Root.FLAG_LOCAL_ONLY | Root.FLAG_ADVANCED - | Root.FLAG_PROVIDES_AUDIO | Root.FLAG_PROVIDES_VIDEO - | Root.FLAG_PROVIDES_IMAGES; + root.flags = Root.FLAG_SUPPORTS_CREATE | Root.FLAG_LOCAL_ONLY | Root.FLAG_ADVANCED; root.icon = R.drawable.ic_pdf; root.title = getContext().getString(R.string.root_internal_storage); root.docId = getDocIdForFile(path); -- cgit v1.1