Remove storage sandboxes related code.
Bug: 131115422
Test: manual
Test: atest --test-mapping packages/providers/MediaProvider
Test: atest cts/hostsidetests/appsecurity/src/android/appsecurity/cts/ExternalStorageHostTest.java
Test: atest DownloadProviderTests
Test: atest cts/tests/app/src/android/app/cts/DownloadManagerTest.java
Test: atest cts/tests/app/DownloadManagerLegacyTest/src/android/app/cts/DownloadManagerLegacyTest.java
Test: atest cts/tests/app/DownloadManagerApi28Test/src/android/app/cts/DownloadManagerApi28Test.java
Change-Id: Ib3272a47a901ed106474039e72f123b11f5443ff
diff --git a/model/EmulatedVolume.cpp b/model/EmulatedVolume.cpp
index 73bf6d1..552fe2f 100644
--- a/model/EmulatedVolume.cpp
+++ b/model/EmulatedVolume.cpp
@@ -70,7 +70,6 @@
setInternalPath(mRawPath);
setPath(StringPrintf("/storage/%s", label.c_str()));
- setLabel(label);
if (fs_prepare_dir(mFuseDefault.c_str(), 0700, AID_ROOT, AID_ROOT) ||
fs_prepare_dir(mFuseRead.c_str(), 0700, AID_ROOT, AID_ROOT) ||
diff --git a/model/PublicVolume.cpp b/model/PublicVolume.cpp
index 1eb6008..0a6b351 100644
--- a/model/PublicVolume.cpp
+++ b/model/PublicVolume.cpp
@@ -129,7 +129,6 @@
} else {
setPath(mRawPath);
}
- setLabel(stableName);
if (fs_prepare_dir(mRawPath.c_str(), 0700, AID_ROOT, AID_ROOT)) {
PLOG(ERROR) << getId() << " failed to create mount points";
diff --git a/model/VolumeBase.cpp b/model/VolumeBase.cpp
index a9c7fa3..ffc7900 100644
--- a/model/VolumeBase.cpp
+++ b/model/VolumeBase.cpp
@@ -143,16 +143,6 @@
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() const {
if (mSilent) {
return nullptr;
@@ -229,9 +219,6 @@
setState(State::kChecking);
status_t res = doMount();
- if (res == OK) {
- res = VolumeManager::Instance()->onVolumeMounted(this);
- }
setState(res == OK ? State::kMounted : State::kUnmountable);
return res;
@@ -251,11 +238,8 @@
}
mVolumes.clear();
- status_t res = VolumeManager::Instance()->onVolumeUnmounted(this);
- if (res == OK) {
- res = doUnmount();
- setState(State::kUnmounted);
- }
+ status_t res = doUnmount();
+ setState(State::kUnmounted);
return res;
}
@@ -280,8 +264,8 @@
}
std::ostream& VolumeBase::operator<<(std::ostream& stream) const {
- return stream << " VolumeBase{id=" << mId << ",label=" << mLabel
- << ",mountFlags=" << mMountFlags << ",mountUserId=" << mMountUserId << "}";
+ return stream << " VolumeBase{id=" << mId << ",mountFlags=" << mMountFlags
+ << ",mountUserId=" << mMountUserId << "}";
}
} // namespace vold
diff --git a/model/VolumeBase.h b/model/VolumeBase.h
index e6c47f0..53eeb6f 100644
--- a/model/VolumeBase.h
+++ b/model/VolumeBase.h
@@ -87,7 +87,6 @@
State getState() const { return mState; }
const std::string& getPath() const { return mPath; }
const std::string& getInternalPath() const { return mInternalPath; }
- const std::string& getLabel() const { return mLabel; }
status_t setDiskId(const std::string& diskId);
status_t setPartGuid(const std::string& partGuid);
@@ -122,7 +121,6 @@
status_t setId(const std::string& id);
status_t setPath(const std::string& path);
status_t setInternalPath(const std::string& internalPath);
- status_t setLabel(const std::string& label);
android::sp<android::os::IVoldListener> getListener() const;
@@ -149,12 +147,6 @@
std::string mInternalPath;
/* Flag indicating that volume should emit no events */
bool mSilent;
- /**
- * Label used for representing the package sandboxes on external storage volumes.
- * For emulated volume, this would be "emulated" and for public volumes, UUID if available,
- * otherwise some other unique id.
- */
- std::string mLabel;
/* Volumes stacked on top of this volume */
std::list<std::shared_ptr<VolumeBase>> mVolumes;