Skip to content

Commit

Permalink
Ignore /storage/container (fix #43)
Browse files Browse the repository at this point in the history
  • Loading branch information
codekidX committed Aug 10, 2017
1 parent fc87dfe commit 234d11c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ private void populateList() {
if(!f.getName().equals(MemoryUtil.SELF_DIR_NAME)
&& !f.getName().equals(MemoryUtil.EMULATED_DIR_KNOX)
&& !f.getName().equals(MemoryUtil.EMULATED_DIR_NAME)
&& !f.getName().equals(MemoryUtil.SDCARD0_DIR_NAME)) {
&& !f.getName().equals(MemoryUtil.SDCARD0_DIR_NAME)
&& !f.getName().equals(MemoryUtil.CONTAINER)) {
Storages sharedStorage = new Storages();
String fPath = f.getAbsolutePath();
sharedStorage.setStorageTitle(f.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class MemoryUtil {
public static final String EMULATED_DIR_NAME = "emulated";
public static final String EMULATED_DIR_KNOX = "knox-emulated";
public static final String SDCARD0_DIR_NAME = "sdcard0";
public static final String CONTAINER = "container";

public boolean isExternalStoragePresent() {
return getStorageListSize() != 1;
Expand All @@ -30,16 +31,12 @@ public int getStorageListSize() {
Collections.addAll(volumeList, storageDir.listFiles());
// segregate the list
for(int i=0;i < volumeList.size(); i++) {
if(volumeList.get(i).getName().equals(SELF_DIR_NAME)) {
volumeList.remove(i);
}
if(volumeList.get(i).getName().equals(EMULATED_DIR_NAME)) {
volumeList.remove(i);
}
if(volumeList.get(i).getName().equals(EMULATED_DIR_KNOX)) {
volumeList.remove(i);
}
if(volumeList.get(i).getName().equals(SDCARD0_DIR_NAME)) {
String storageName = volumeList.get(i).getName();
if(storageName.equals(SELF_DIR_NAME) ||
storageName.equals(EMULATED_DIR_KNOX) ||
storageName.equals(EMULATED_DIR_KNOX) ||
storageName.equals(SDCARD0_DIR_NAME) ||
storageName.equals(CONTAINER)) {
volumeList.remove(i);
}
}
Expand Down

0 comments on commit 234d11c

Please sign in to comment.