StubVolume as first class Volume in Vold
StubVolume is a Volume that is maintained by external party such as the
ChromeOS processes in ARC++.
Bug: 110380403
Test: Tested on ARC++
Change-Id: I3198bd7283d5f60a524da3707dea7385ffec599d
diff --git a/VoldNativeService.cpp b/VoldNativeService.cpp
index 5987849..a06b357 100644
--- a/VoldNativeService.cpp
+++ b/VoldNativeService.cpp
@@ -479,6 +479,29 @@
return translate(VolumeManager::Instance()->destroyObb(volId));
}
+binder::Status VoldNativeService::createStubVolume(
+ const std::string& sourcePath, const std::string& mountPath, const std::string& fsType,
+ const std::string& fsUuid, const std::string& fsLabel, std::string* _aidl_return) {
+ ENFORCE_UID(AID_SYSTEM);
+ CHECK_ARGUMENT_PATH(sourcePath);
+ CHECK_ARGUMENT_PATH(mountPath);
+ CHECK_ARGUMENT_HEX(fsUuid);
+ // Label limitation seems to be different between fs (including allowed characters), so checking
+ // is quite meaningless.
+ ACQUIRE_LOCK;
+
+ return translate(VolumeManager::Instance()->createStubVolume(sourcePath, mountPath, fsType,
+ fsUuid, fsLabel, _aidl_return));
+}
+
+binder::Status VoldNativeService::destroyStubVolume(const std::string& volId) {
+ ENFORCE_UID(AID_SYSTEM);
+ CHECK_ARGUMENT_ID(volId);
+ ACQUIRE_LOCK;
+
+ return translate(VolumeManager::Instance()->destroyStubVolume(volId));
+}
+
binder::Status VoldNativeService::fstrim(
int32_t fstrimFlags, const android::sp<android::os::IVoldTaskListener>& listener) {
ENFORCE_UID(AID_SYSTEM);