Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit bdec6441 authored by alukin's avatar alukin Committed by Aleksandr Lukin
Browse files

Fix StorageStatsService#getTotalBytes

Fixing getTotalBytes by calling a new API in Vold.

1. Returned the original implementation of rounding logic.
Now it only rounds the bytes by increasing the size,
and never by decreasing.
2. Returned the original logic for all the device sizes <= 512GB  to
prevent any potential regressions.
3. For devices with larger capacities now calling vold (one-time call,
then the value is stored in memory) to get the block device size. It's
a very precise number of bytes, so only doing a small rounding (up to
3GB) to try to bring the totalBytes to a nice-looking value, otherwise
just return as is.

Should be tested together with a Settings UI fix: I3dcc9698403612f961cf0de41925dcbcb43e260b

Verified on multiple devices with storage <= 512GB: b/290892417#comment26.
Also verified for 1TB devices: personally and in b/295265657#comment10

Bug: 290892417
Bug: 295358118
Test: verified manually + manually verified calling of new API
Test: atest FileUtilsTest
Test: atest StorageHostTest
Change-Id: I01d72ede6c3ac62198d04829866655ba5a92dc45
(cherry picked from commit be2ec6d9)
parent 017d5586
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment