forked from koush/Superuser
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make emulated storage available via su.
Apps (e.g. file managers) expect that they get the same view of files in su and non-su mode. Change-Id: I613d021dddb7b90c34bd6d7cf6d2234448404731
- Loading branch information
Showing
1 changed file
with
14 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
af18f5a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This bind mounts /mnt/shell/emulated to /storage/emulated, which seems wrong?... /storage/emulated should be a folder containing symlinks to folders from /mnt/shell/emulated, and in the case that something creates a legacy folder in /mnt/shell/emulated, breaks symlinking /mnt/shell/emulated/0 to /storage/emulated/legacy (as it's supposed to be), and consequently makes /sdcard/ and /storage/sdcard0/ point to the wrong directory.
On my ROM, "adb shell ls /sdcard/" is empty with this commit applied. Without this commit, the contents of my sdcard are correctly shown.
A large percentage of my rom's source is CM, so I can't say for sure that this commit causes the same issue on CM, but I've illustrated causation between this commit and what appears to be improperly initialized emulated storage.
af18f5a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commit makes apps under su have the same visibility as apps running under zygote (i.e., normal apps), as per https://github.com/CyanogenMod/android_dalvik/blob/cm-10.2/vm/native/dalvik_system_Zygote.cpp#L266
The mountloop applied is explicitly the same, in order to keep a consistent view.