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

Commit 5379f131 authored by Aga Wronska's avatar Aga Wronska Committed by Android (Google) Code Review
Browse files

Merge "Add config flag to show/hide internal storage. Hide internal storage by...

Merge "Add config flag to show/hide internal storage. Hide internal storage by default." into nyc-dev
parents 8a4cc649 bffe6601
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -24,5 +24,6 @@
    <!-- Indicates if the home directory should be hidden in the roots list, that is presented
         in the drawer/left side panel ) -->
    <bool name="home_root_hidden">true</bool>

    <!-- Indicates if the advanced roots like internal storage should be hidden in the roots list) -->
    <bool name="advanced_roots_hidden">true</bool>
</resources>
+9 −0
Original line number Diff line number Diff line
@@ -320,6 +320,8 @@ public class RootsFragment extends Fragment {

                if (root.isHome() && isHomeRootHidden(context)) {
                    continue;
                } else if (root.isAdvanced() && areAdvancedRootsHidden(context)) {
                    continue;
                } else if (root.isLibrary()) {
                    if (DEBUG) Log.d(TAG, "Adding " + root + " as library.");
                    libraries.add(item);
@@ -377,6 +379,13 @@ public class RootsFragment extends Fragment {
            return context.getResources().getBoolean(R.bool.home_root_hidden);
        }

        /*
         * Indicates if the advanced roots should be hidden.
         */
        private boolean areAdvancedRootsHidden(Context context) {
            return context.getResources().getBoolean(R.bool.advanced_roots_hidden);
        }

        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            final Item item = getItem(position);
+4 −0
Original line number Diff line number Diff line
@@ -298,6 +298,10 @@ public class RootInfo implements Durable, Parcelable, Comparable<RootInfo> {
        return (flags & Root.FLAG_SUPPORTS_SEARCH) != 0;
    }

    public boolean isAdvanced() {
        return (flags & Root.FLAG_ADVANCED) != 0;
    }

    public boolean isLocalOnly() {
        return (flags & Root.FLAG_LOCAL_ONLY) != 0;
    }