diff options
author | Yi-Yo Chiang <yochiang@google.com> | 2021-02-12 02:10:58 +0800 |
---|---|---|
committer | Yo Chiang <yochiang@google.com> | 2021-02-17 09:02:33 +0000 |
commit | 645cdedb2fe69c57fc10df7efe933cbdcadfb8aa (patch) | |
tree | 563bad1da605d346df7e4925ea55660be7080d44 /partition_installer.cpp | |
parent | c4e74fde3115e27c2f754930cfabd4fca2c5f6bf (diff) | |
download | gsid-645cdedb2fe69c57fc10df7efe933cbdcadfb8aa.tar.gz |
gsid: suggestScratchSize() respect kMinimumFreeSpaceThreshold
gsid should take kMinimumFreeSpaceThreshold into account when
calculating the suggested scratch partition size.
Also use uint64_t to store any calculated intermediate result, so we can
stay confortable from overflowing, and downcast the result to int64_t
in the end, after we clamped the value within int64_t range.
Bug: 165925766
Bug: 179980369
Test: Install DSU and verify adb remount works
Change-Id: I919c723369d7d788c5c83a19e6b87f077fb2521b
Diffstat (limited to 'partition_installer.cpp')
-rw-r--r-- | partition_installer.cpp | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/partition_installer.cpp b/partition_installer.cpp index 35ac884..fea1483 100644 --- a/partition_installer.cpp +++ b/partition_installer.cpp @@ -39,10 +39,6 @@ using namespace android::fiemap; using namespace android::fs_mgr; using android::base::unique_fd; -// The default size of userdata.img for GSI. -// We are looking for /data to have atleast 40% free space -static constexpr uint32_t kMinimumFreeSpaceThreshold = 40; - PartitionInstaller::PartitionInstaller(GsiService* service, const std::string& install_dir, const std::string& name, const std::string& active_dsu, int64_t size, bool read_only) |