Add vdc volume getStorageSize
StorageStatsManager.getTotalBytes currently takes the size of /data and
rounds up to known probable sizes to guess the size of internal storage.
This is not always correct.
Instead, find the device /data is on and get the size of that device.
This should give a more accurate answer.
Bug: 295358118
Test: vdc volume getStorageSize returns storage size
Change-Id: I907892041b1ce2cd72092a9877ac34c12bf3f254
diff --git a/vdc.cpp b/vdc.cpp
index b63abbb..ee74146 100644
--- a/vdc.cpp
+++ b/vdc.cpp
@@ -122,6 +122,10 @@
checkStatus(args, vold->shutdown());
} else if (args[0] == "volume" && args[1] == "reset") {
checkStatus(args, vold->reset());
+ } else if (args[0] == "volume" && args[1] == "getStorageSize") {
+ int64_t size;
+ checkStatus(args, vold->getStorageSize(&size));
+ LOG(INFO) << size;
} else if (args[0] == "cryptfs" && args[1] == "bindkeys") {
bindkeys(args, vold);
} else if (args[0] == "cryptfs" && args[1] == "mountFstab" && args.size() == 5) {