Loading AndroidManifest.xml +6 −1 Original line number Diff line number Diff line Loading @@ -85,7 +85,12 @@ <data android:mimeType="vnd.android.document/root" /> </intent-filter> <intent-filter> <action android:name="android.provider.action.BROWSE" /> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="vnd.android.document/root" /> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="vnd.android.document/directory" /> </intent-filter> Loading res/xml/shortcuts.xml +1 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ android:icon="@drawable/ic_downloads_shortcut" android:shortcutShortLabel="@string/downloads_shortcut_label" > <intent android:action="android.provider.action.BROWSE" android:action="android.intent.action.VIEW" android:data="content://com.android.providers.downloads.documents/root/downloads" /> </shortcut> </shortcuts> No newline at end of file src/com/android/documentsui/files/ActionHandler.java +3 −2 Original line number Diff line number Diff line Loading @@ -399,7 +399,8 @@ public class ActionHandler<T extends Activity & Addons> extends AbstractActionHa } private boolean launchToRoot(Intent intent) { if (DocumentsContract.ACTION_BROWSE.equals(intent.getAction())) { String action = intent.getAction(); if (Intent.ACTION_VIEW.equals(action) || DocumentsContract.ACTION_BROWSE.equals(action)) { Uri uri = intent.getData(); if (DocumentsContract.isRootUri(mActivity, uri)) { if (DEBUG) Log.d(TAG, "Launching with root URI."); Loading @@ -413,7 +414,7 @@ public class ActionHandler<T extends Activity & Addons> extends AbstractActionHa } private boolean launchToDocument(Intent intent) { if (DocumentsContract.ACTION_BROWSE.equals(intent.getAction())) { if (Intent.ACTION_VIEW.equals(intent.getAction())) { Uri uri = intent.getData(); if (DocumentsContract.isDocumentUri(mActivity, uri)) { return launchToDocument(intent.getData()); Loading src/com/android/documentsui/services/Job.java +1 −1 Original line number Diff line number Diff line Loading @@ -316,9 +316,9 @@ abstract public class Job implements Runnable { * Creates an intent for navigating back to the destination directory. */ Intent buildNavigateIntent(String tag) { // TODO (b/35721285): Reuse an existing task rather than creating a new one every time. Intent intent = new Intent(service, FilesActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setAction(DocumentsContract.ACTION_BROWSE); intent.setData(getDataUriForIntent(tag)); intent.putExtra(Shared.EXTRA_STACK, (Parcelable) stack); return intent; Loading tests/functional/com/android/documentsui/ActivityTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -138,8 +138,8 @@ public abstract class ActivityTest<T extends Activity> extends ActivityInstrumen UiBot.TARGET_PKG); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK); if (getInitialRoot() != null) { intent.setAction(DocumentsContract.ACTION_BROWSE); intent.setData(getInitialRoot().getUri()); intent.setAction(Intent.ACTION_VIEW); intent.setDataAndType(getInitialRoot().getUri(), DocumentsContract.Root.MIME_TYPE_ITEM); } setActivityIntent(intent); getActivity(); // Launch the activity. Loading Loading
AndroidManifest.xml +6 −1 Original line number Diff line number Diff line Loading @@ -85,7 +85,12 @@ <data android:mimeType="vnd.android.document/root" /> </intent-filter> <intent-filter> <action android:name="android.provider.action.BROWSE" /> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="vnd.android.document/root" /> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="vnd.android.document/directory" /> </intent-filter> Loading
res/xml/shortcuts.xml +1 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ android:icon="@drawable/ic_downloads_shortcut" android:shortcutShortLabel="@string/downloads_shortcut_label" > <intent android:action="android.provider.action.BROWSE" android:action="android.intent.action.VIEW" android:data="content://com.android.providers.downloads.documents/root/downloads" /> </shortcut> </shortcuts> No newline at end of file
src/com/android/documentsui/files/ActionHandler.java +3 −2 Original line number Diff line number Diff line Loading @@ -399,7 +399,8 @@ public class ActionHandler<T extends Activity & Addons> extends AbstractActionHa } private boolean launchToRoot(Intent intent) { if (DocumentsContract.ACTION_BROWSE.equals(intent.getAction())) { String action = intent.getAction(); if (Intent.ACTION_VIEW.equals(action) || DocumentsContract.ACTION_BROWSE.equals(action)) { Uri uri = intent.getData(); if (DocumentsContract.isRootUri(mActivity, uri)) { if (DEBUG) Log.d(TAG, "Launching with root URI."); Loading @@ -413,7 +414,7 @@ public class ActionHandler<T extends Activity & Addons> extends AbstractActionHa } private boolean launchToDocument(Intent intent) { if (DocumentsContract.ACTION_BROWSE.equals(intent.getAction())) { if (Intent.ACTION_VIEW.equals(intent.getAction())) { Uri uri = intent.getData(); if (DocumentsContract.isDocumentUri(mActivity, uri)) { return launchToDocument(intent.getData()); Loading
src/com/android/documentsui/services/Job.java +1 −1 Original line number Diff line number Diff line Loading @@ -316,9 +316,9 @@ abstract public class Job implements Runnable { * Creates an intent for navigating back to the destination directory. */ Intent buildNavigateIntent(String tag) { // TODO (b/35721285): Reuse an existing task rather than creating a new one every time. Intent intent = new Intent(service, FilesActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setAction(DocumentsContract.ACTION_BROWSE); intent.setData(getDataUriForIntent(tag)); intent.putExtra(Shared.EXTRA_STACK, (Parcelable) stack); return intent; Loading
tests/functional/com/android/documentsui/ActivityTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -138,8 +138,8 @@ public abstract class ActivityTest<T extends Activity> extends ActivityInstrumen UiBot.TARGET_PKG); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK); if (getInitialRoot() != null) { intent.setAction(DocumentsContract.ACTION_BROWSE); intent.setData(getInitialRoot().getUri()); intent.setAction(Intent.ACTION_VIEW); intent.setDataAndType(getInitialRoot().getUri(), DocumentsContract.Root.MIME_TYPE_ITEM); } setActivityIntent(intent); getActivity(); // Launch the activity. Loading