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

Commit 9febe073 authored by Zemiao Zhu's avatar Zemiao Zhu Committed by Android (Google) Code Review
Browse files

Merge "Make downloads as default root on browse mode."

parents 1f2380ea 44b75c33
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -59,9 +59,6 @@
    <bool name="feature_virtual_files_sharing">true</bool>
    <bool name="feature_inspector">true</bool>
    <bool name="feature_debug_mode">false</bool>
    <!-- If this value is true, the default root on action browse will be the root from
    "default_root_uri". Otherwise, the default root will be the recent root.-->
    <bool name="feature_default_root_in_browse">false</bool>

    <!-- Indicates if internal storage is shown as default or not. -->
    <bool name="config_default_show_device_root">false</bool>
+0 −1
Original line number Diff line number Diff line
@@ -44,7 +44,6 @@
            <!-- START BOOLEAN CONFIG -->
            <item type="bool" name="config_button_all_caps"/>
            <item type="bool" name="config_default_show_device_root"/>
            <item type="bool" name="feature_default_root_in_browse"/>
            <item type="bool" name="handle_view_downloads_intent"/>
            <item type="bool" name="is_launcher_enabled"/>
            <item type="bool" name="show_search_bar"/>
+2 −8
Original line number Diff line number Diff line
@@ -20,10 +20,10 @@ import android.content.res.Resources;
import android.os.UserManager;
import android.util.SparseBooleanArray;

import com.android.documentsui.R;

import androidx.annotation.BoolRes;

import com.android.documentsui.R;

/**
 * Provides access to feature flags configured in config.xml.
 */
@@ -44,7 +44,6 @@ public interface Features {
    boolean isRemoteActionsEnabled();
    boolean isSystemKeyboardNavigationEnabled();
    boolean isVirtualFilesSharingEnabled();
    boolean isDefaultRootInBrowseEnabled();


    /**
@@ -167,10 +166,5 @@ public interface Features {
        public boolean isVirtualFilesSharingEnabled() {
            return isEnabled(R.bool.feature_virtual_files_sharing);
        }

        @Override
        public boolean isDefaultRootInBrowseEnabled() {
            return isEnabled(R.bool.feature_default_root_in_browse);
        }
    }
}
+3 −1
Original line number Diff line number Diff line
@@ -245,7 +245,9 @@ public final class Shared {
        Uri defaultUri = Uri.parse(activity.getResources().getString(R.string.default_root_uri));

        if (!DocumentsContract.isRootUri(activity, defaultUri)) {
            throw new RuntimeException("Default Root URI is not a valid root URI.");
            Log.e(TAG, "Default Root URI is not a valid root URI, falling back to Downloads.");
            defaultUri = DocumentsContract.buildRootUri(Providers.AUTHORITY_DOWNLOADS,
                    Providers.ROOT_ID_DOWNLOADS);
        }

        return defaultUri;
+1 −5
Original line number Diff line number Diff line
@@ -463,11 +463,7 @@ public class ActionHandler<T extends FragmentActivity & AbstractActionHandler.Co

    @Override
    protected void launchToDefaultLocation() {
        if (mFeatures.isDefaultRootInBrowseEnabled()) {
        loadHomeDir();
        } else {
            loadRecent();
        }
    }

    // If EXTRA_STACK is not null in intent, we'll skip other means of loading
Loading