Use unique_fd
Also allow the state just before doMount() as a valid state for setting
fuse fd.
Test: manual
BUG:140173712
Change-Id: I012f8a83fef00e68f33010954fbc2ebc53cf8f1d
diff --git a/VoldNativeService.cpp b/VoldNativeService.cpp
index 9004b40..9b223c7 100644
--- a/VoldNativeService.cpp
+++ b/VoldNativeService.cpp
@@ -345,7 +345,7 @@
return translate(res);
}
- _aidl_return->reset(vol->getDeviceFd());
+ _aidl_return->reset(dup(vol->getFuseFd().get()));
if (_aidl_return->get() == -1) {
// Let's not return invalid fd since binder will not allow null fds. Instead give it a
// default value.