Loading res/values/config.xml +0 −2 Original line number Diff line number Diff line Loading @@ -18,8 +18,6 @@ <!-- Intentionally unset. Vendors should set this in an overlay. --> <string name="trusted_quick_viewer_package" translatable="false"></string> <bool name="show_documents_root">false</bool> <!-- Indicates if DocumentsUI should handle VIEW_DOWNLOADS Intent. on ARC++ devices, there exists another handler which handles VIEW_DOWNLOADS Intent. --> <bool name="handle_view_downloads_intent">true</bool> Loading src/com/android/documentsui/base/RootInfo.java +1 −19 Original line number Diff line number Diff line Loading @@ -220,10 +220,7 @@ public class RootInfo implements Durable, Parcelable, Comparable<RootInfo> { private void deriveFields() { derivedMimeTypes = (mimeTypes != null) ? mimeTypes.split("\n") : null; if (isExternalStorageHome()) { derivedType = TYPE_LOCAL; derivedIcon = LOAD_FROM_CONTENT_RESOLVER; } else if (isMtp()) { if (isMtp()) { derivedType = TYPE_MTP; derivedIcon = R.drawable.ic_usb_storage; } else if (isUsb()) { Loading Loading @@ -277,16 +274,6 @@ public class RootInfo implements Durable, Parcelable, Comparable<RootInfo> { return authority == null && rootId == null; } /* * Return true, if the root is from ExternalStorage and the id is home. Otherwise, return false. */ public boolean isExternalStorageHome() { // Note that "home" is the expected root id for the auto-created // user home directory on external storage. The "home" value should // match ExternalStorageProvider.ROOT_ID_HOME. return isExternalStorage() && "home".equals(rootId); } public boolean isExternalStorage() { return Providers.AUTHORITY_STORAGE.equals(authority); } Loading Loading @@ -389,11 +376,6 @@ public class RootInfo implements Durable, Parcelable, Comparable<RootInfo> { } private Drawable loadMimeTypeIcon(Context context) { if (isExternalStorageHome()) { return IconUtils.loadMimeIcon(context, DocumentsContract.Document.MIME_TYPE_DIR); } switch (derivedType) { case TYPE_IMAGES: return IconUtils.loadMimeIcon(context, MimeTypes.IMAGE_MIME); Loading src/com/android/documentsui/base/Shared.java +0 −7 Original line number Diff line number Diff line Loading @@ -284,13 +284,6 @@ public final class Shared { } } /** * Returns true if "Documents" root should be shown. */ public static boolean shouldShowDocumentsRoot(Context context) { return context.getResources().getBoolean(R.bool.show_documents_root); } /** * Check config whether DocumentsUI is launcher enabled or not. * @return true if launcher icon is shown. Loading src/com/android/documentsui/sidebar/RootsFragment.java +1 −4 Original line number Diff line number Diff line Loading @@ -70,7 +70,6 @@ import com.android.documentsui.base.DocumentStack; import com.android.documentsui.base.Events; import com.android.documentsui.base.Providers; import com.android.documentsui.base.RootInfo; import com.android.documentsui.base.Shared; import com.android.documentsui.base.State; import com.android.documentsui.base.UserId; import com.android.documentsui.roots.ProvidersAccess; Loading Loading @@ -301,9 +300,7 @@ public class RootsFragment extends Fragment { for (final RootInfo root : roots) { final RootItem item; if (root.isExternalStorageHome() && !Shared.shouldShowDocumentsRoot(getContext())) { continue; } else if (root.isLibrary() || root.isDownloads()) { if (root.isLibrary() || root.isDownloads()) { item = new RootItem(root, mActionHandler); libraries.add(item); } else if (root.isStorage()) { Loading tests/common/com/android/documentsui/testing/TestResources.java +4 −9 Original line number Diff line number Diff line Loading @@ -16,13 +16,14 @@ package com.android.documentsui.testing; import android.content.res.Resources; import android.util.SparseArray; import android.util.SparseBooleanArray; import androidx.annotation.BoolRes; import androidx.annotation.NonNull; import androidx.annotation.PluralsRes; import androidx.annotation.StringRes; import android.content.res.Resources; import android.util.SparseArray; import android.util.SparseBooleanArray; import com.android.documentsui.R; import com.android.documentsui.files.QuickViewIntentBuilder; Loading Loading @@ -52,8 +53,6 @@ public abstract class TestResources extends Resources { res.strings = new SparseArray<>(); res.plurals = new SparseArray<>(); res.setProductivityDeviceEnabled(false); // quick view package can be set via system property on debug builds. // unfortunately that interfers with testing. For that reason we have // this little hack....QuickViewIntentBuilder will check for this value Loading @@ -71,10 +70,6 @@ public abstract class TestResources extends Resources { strings.put(R.string.default_root_uri, uri); } public void setProductivityDeviceEnabled(boolean enabled) { bools.put(R.bool.show_documents_root, enabled); } @Override public final boolean getBoolean(@BoolRes int id) throws NotFoundException { return bools.get(id); Loading Loading
res/values/config.xml +0 −2 Original line number Diff line number Diff line Loading @@ -18,8 +18,6 @@ <!-- Intentionally unset. Vendors should set this in an overlay. --> <string name="trusted_quick_viewer_package" translatable="false"></string> <bool name="show_documents_root">false</bool> <!-- Indicates if DocumentsUI should handle VIEW_DOWNLOADS Intent. on ARC++ devices, there exists another handler which handles VIEW_DOWNLOADS Intent. --> <bool name="handle_view_downloads_intent">true</bool> Loading
src/com/android/documentsui/base/RootInfo.java +1 −19 Original line number Diff line number Diff line Loading @@ -220,10 +220,7 @@ public class RootInfo implements Durable, Parcelable, Comparable<RootInfo> { private void deriveFields() { derivedMimeTypes = (mimeTypes != null) ? mimeTypes.split("\n") : null; if (isExternalStorageHome()) { derivedType = TYPE_LOCAL; derivedIcon = LOAD_FROM_CONTENT_RESOLVER; } else if (isMtp()) { if (isMtp()) { derivedType = TYPE_MTP; derivedIcon = R.drawable.ic_usb_storage; } else if (isUsb()) { Loading Loading @@ -277,16 +274,6 @@ public class RootInfo implements Durable, Parcelable, Comparable<RootInfo> { return authority == null && rootId == null; } /* * Return true, if the root is from ExternalStorage and the id is home. Otherwise, return false. */ public boolean isExternalStorageHome() { // Note that "home" is the expected root id for the auto-created // user home directory on external storage. The "home" value should // match ExternalStorageProvider.ROOT_ID_HOME. return isExternalStorage() && "home".equals(rootId); } public boolean isExternalStorage() { return Providers.AUTHORITY_STORAGE.equals(authority); } Loading Loading @@ -389,11 +376,6 @@ public class RootInfo implements Durable, Parcelable, Comparable<RootInfo> { } private Drawable loadMimeTypeIcon(Context context) { if (isExternalStorageHome()) { return IconUtils.loadMimeIcon(context, DocumentsContract.Document.MIME_TYPE_DIR); } switch (derivedType) { case TYPE_IMAGES: return IconUtils.loadMimeIcon(context, MimeTypes.IMAGE_MIME); Loading
src/com/android/documentsui/base/Shared.java +0 −7 Original line number Diff line number Diff line Loading @@ -284,13 +284,6 @@ public final class Shared { } } /** * Returns true if "Documents" root should be shown. */ public static boolean shouldShowDocumentsRoot(Context context) { return context.getResources().getBoolean(R.bool.show_documents_root); } /** * Check config whether DocumentsUI is launcher enabled or not. * @return true if launcher icon is shown. Loading
src/com/android/documentsui/sidebar/RootsFragment.java +1 −4 Original line number Diff line number Diff line Loading @@ -70,7 +70,6 @@ import com.android.documentsui.base.DocumentStack; import com.android.documentsui.base.Events; import com.android.documentsui.base.Providers; import com.android.documentsui.base.RootInfo; import com.android.documentsui.base.Shared; import com.android.documentsui.base.State; import com.android.documentsui.base.UserId; import com.android.documentsui.roots.ProvidersAccess; Loading Loading @@ -301,9 +300,7 @@ public class RootsFragment extends Fragment { for (final RootInfo root : roots) { final RootItem item; if (root.isExternalStorageHome() && !Shared.shouldShowDocumentsRoot(getContext())) { continue; } else if (root.isLibrary() || root.isDownloads()) { if (root.isLibrary() || root.isDownloads()) { item = new RootItem(root, mActionHandler); libraries.add(item); } else if (root.isStorage()) { Loading
tests/common/com/android/documentsui/testing/TestResources.java +4 −9 Original line number Diff line number Diff line Loading @@ -16,13 +16,14 @@ package com.android.documentsui.testing; import android.content.res.Resources; import android.util.SparseArray; import android.util.SparseBooleanArray; import androidx.annotation.BoolRes; import androidx.annotation.NonNull; import androidx.annotation.PluralsRes; import androidx.annotation.StringRes; import android.content.res.Resources; import android.util.SparseArray; import android.util.SparseBooleanArray; import com.android.documentsui.R; import com.android.documentsui.files.QuickViewIntentBuilder; Loading Loading @@ -52,8 +53,6 @@ public abstract class TestResources extends Resources { res.strings = new SparseArray<>(); res.plurals = new SparseArray<>(); res.setProductivityDeviceEnabled(false); // quick view package can be set via system property on debug builds. // unfortunately that interfers with testing. For that reason we have // this little hack....QuickViewIntentBuilder will check for this value Loading @@ -71,10 +70,6 @@ public abstract class TestResources extends Resources { strings.put(R.string.default_root_uri, uri); } public void setProductivityDeviceEnabled(boolean enabled) { bools.put(R.bool.show_documents_root, enabled); } @Override public final boolean getBoolean(@BoolRes int id) throws NotFoundException { return bools.get(id); Loading