Avoid creating a storage folder for fastboot devices command
Bug: 284267164
Bug: 284786311
Test: fastboot devices doesn't create a .fastboot folder
Change-Id: I3e44c2a838e4287e6220c18f6e805cc71e0c9669
Signed-off-by: Dmitrii Merkurev <dimorinny@google.com>
diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp
index bec4ef1..ee99c17 100644
--- a/fastboot/fastboot.cpp
+++ b/fastboot/fastboot.cpp
@@ -396,7 +396,7 @@
ConnectedDevicesStorage storage;
std::set<std::string> devices;
- {
+ if (storage.Exists()) {
FileLock lock = storage.Lock();
devices = storage.ReadDevices(lock);
}