Add API to query ApexInfo for staged apex sessions from apexd
We now have clients who are interested in information regarding staged
apexes that are waiting to be installed. Using this method, we can now
extract the desired information into PackageManager world, which is
where the clients will be making the requests.
There is, however, another API which comes close to providing the
information we desire: submitStagedSession. It takes new sessions as
input, verifies them, marks them as staged and returns the desired
ApexInfo. We can cache the returned ApexInfo in PackageManager world
(which we will in follow up cls) and use that to answer all the queries.
But, unless we persist the information on disk, we risk to lose the
information on system server restart. After that, we have no way to
regenerate the cache without calling submitStagedSession again, which
will re-verify the sessions unnecessarily.
Hence, we are adding a new API to query ApexInfo for staged sessions.
Bug: 187444679
Test: atest ApexServiceTest
Test: atest ApexdUnitTest
Change-Id: I38c74c54b917efc7120a1579834ae859a578d5b9
6 files changed