Update vold to prepare package sandboxes for primary volume.
Vold is updated to create package specific sandboxes for primary
volume and mount them at
"/mnt/user/<user-id>/package/<package-name>/<primary-label>".
This will later be mounted at /storage when a new process starts.
Bug: 111890351
Test: Manually verified that a package has access to "/sdcard" and
"/storage/emulated/0", both of which are just the package specific
sandboxes and the package doesn't have access to other sandboxes
and can't see other package names.
Change-Id: I72dc8ae9eb2260a298159c5de18387dad2f9de48
diff --git a/model/VolumeBase.cpp b/model/VolumeBase.cpp
index 429f134..cf3d54e 100644
--- a/model/VolumeBase.cpp
+++ b/model/VolumeBase.cpp
@@ -136,6 +136,16 @@
return OK;
}
+status_t VolumeBase::setLabel(const std::string& label) {
+ if (mState != State::kChecking) {
+ LOG(WARNING) << getId() << " label change requires state checking";
+ return -EBUSY;
+ }
+
+ mLabel = label;
+ return OK;
+}
+
android::sp<android::os::IVoldListener> VolumeBase::getListener() {
if (mSilent) {
return nullptr;