Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 02f78708 authored by Garfield Tan's avatar Garfield Tan Committed by android-build-merger
Browse files

Merge "Use Intent.ACTION_VIEW to for launching file manager at a location." into arc-apps

am: 25a775f8

Change-Id: I67bb5bd073918b1b06d70d8534eca2ab61ca528f
parents 3cc69551 25a775f8
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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>
+1 −1
Original line number Diff line number Diff line
@@ -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
+3 −2
Original line number Diff line number Diff line
@@ -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.");
@@ -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());
+1 −1
Original line number Diff line number Diff line
@@ -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;
+2 −2
Original line number Diff line number Diff line
@@ -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