Loading src/com/android/documentsui/base/RootInfo.java +10 −0 Original line number Original line Diff line number Diff line Loading @@ -298,6 +298,16 @@ public class RootInfo implements Durable, Parcelable, Comparable<RootInfo> { return authority == null && rootId == null; 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() { public boolean isExternalStorage() { return Providers.AUTHORITY_STORAGE.equals(authority); return Providers.AUTHORITY_STORAGE.equals(authority); } } Loading src/com/android/documentsui/sidebar/RootsFragment.java +3 −1 Original line number Original line Diff line number Diff line Loading @@ -308,7 +308,9 @@ public class RootsFragment extends Fragment { for (final RootInfo root : roots) { for (final RootInfo root : roots) { final RootItem item; final RootItem item; if (root.isLibrary() || root.isDownloads()) { if (root.isExternalStorageHome()) { continue; } else if (root.isLibrary() || root.isDownloads()) { item = new RootItem(root, mActionHandler, maybeShowBadge); item = new RootItem(root, mActionHandler, maybeShowBadge); librariesBuilder.add(item); librariesBuilder.add(item); } else if (root.isStorage()) { } else if (root.isStorage()) { Loading Loading
src/com/android/documentsui/base/RootInfo.java +10 −0 Original line number Original line Diff line number Diff line Loading @@ -298,6 +298,16 @@ public class RootInfo implements Durable, Parcelable, Comparable<RootInfo> { return authority == null && rootId == null; 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() { public boolean isExternalStorage() { return Providers.AUTHORITY_STORAGE.equals(authority); return Providers.AUTHORITY_STORAGE.equals(authority); } } Loading
src/com/android/documentsui/sidebar/RootsFragment.java +3 −1 Original line number Original line Diff line number Diff line Loading @@ -308,7 +308,9 @@ public class RootsFragment extends Fragment { for (final RootInfo root : roots) { for (final RootInfo root : roots) { final RootItem item; final RootItem item; if (root.isLibrary() || root.isDownloads()) { if (root.isExternalStorageHome()) { continue; } else if (root.isLibrary() || root.isDownloads()) { item = new RootItem(root, mActionHandler, maybeShowBadge); item = new RootItem(root, mActionHandler, maybeShowBadge); librariesBuilder.add(item); librariesBuilder.add(item); } else if (root.isStorage()) { } else if (root.isStorage()) { Loading