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

Commit e42bc52d authored by Noah Zimmt's avatar Noah Zimmt
Browse files

Reduce calls to installd when resolving volume

Optimizes PackageHelper#resolveInstallVolume to aggressively avoid
querying volume storage statistics unless absolutely neeeded.

The previous implementation queries storage data for each volume on the
device before evaluating which volume to select. The new implementation
defers querying storage stats for a given volume until it is absolutely
neccessary.

For example, if the application is already installed to a particular
volume, only that volume needs to be queried for available space.

In addition, querying for available space on a volume is done in two
steps. The first step does not take into account freeable cache; only
if this pessimistic assessment of available space fails do we call
installd to obtain cache information.

Bug: 138450974
Test: atest frameworks/base/core/tests/coretests/src/android/content/pm/PackageHelperTests.java
&& atest cts/tests/tests/os/src/android/os/storage/cts/StorageManagerTest.java
Change-Id: I403318de364d41019cb3d43e93b91cdd06fe1b9c
parent b2558071
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment