[incremental] storage is regarded as fully loaded if there's no file or only empty files
Test: atest service.incremental_test
BUG: 165799231
Change-Id: I3b6be3918d53ce4ab0a30a4da493d9730a31ed3c
diff --git a/services/incremental/IncrementalService.cpp b/services/incremental/IncrementalService.cpp
index ba6ae92..9836262e 100644
--- a/services/incremental/IncrementalService.cpp
+++ b/services/incremental/IncrementalService.cpp
@@ -1706,8 +1706,8 @@
}
if (totalBlocks == 0) {
- LOG(ERROR) << "getLoadingProgress failed to get total num of blocks";
- return -EINVAL;
+ // No file in the storage or files are empty; regarded as fully loaded
+ return 1;
}
return (float)filledBlocks / (float)totalBlocks;
}