Why does Android DDMS File Explorer show only 3 directories?

Why does Android DDMS File Explorer only display data, mnt and system directories? There are other directories and files if I run "adb shell ls -l"

+5
source share
1 answer

I dug a little and found that viewing ADT File Explorer is limited to a class named

com.android.ddmlib.FileListingService

Inside it, you will see a list of approved top-level directories:

/** Top level data folder. */
public final static String DIRECTORY_DATA = "data"; //$NON-NLS-1$
/** Top level sdcard folder. */
public final static String DIRECTORY_SDCARD = "sdcard"; //$NON-NLS-1$
/** Top level mount folder. */
public final static String DIRECTORY_MNT = "mnt"; //$NON-NLS-1$
/** Top level system folder. */
public final static String DIRECTORY_SYSTEM = "system"; //$NON-NLS-1$
/** Top level temp folder. */
public final static String DIRECTORY_TEMP = "tmp"; //$NON-NLS-1$
/** Application folder. */
public final static String DIRECTORY_APP = "app"; //$NON-NLS-1$

private final static String[] sRootLevelApprovedItems = {
    DIRECTORY_DATA,
    DIRECTORY_SDCARD,
    DIRECTORY_SYSTEM,
    DIRECTORY_TEMP,
    DIRECTORY_MNT,
};

Later, this announcement will be held, and if it is on the approved list, you will see it in the File Explorer in Eclipse:

            // if the parent is root, we only accept selected items
            if (mParentEntry.isRoot()) {
                boolean found = false;
                for (String approved : sRootLevelApprovedItems) {
                    if (approved.equals(name)) {
                        found = true;
                        break;
                    }
                }

                // if it not in the approved list we skip this entry.
                if (found == false) {
                    continue;
                }
            }

, , , , . ADT.

, :

adb shell ls -l

, Android-. .

+2

All Articles