Android S Beta 1
Refactor CAPEX decompression flow

Currently, we take decompressed APEX in consideration when adding data
apex to ApexFileRepository and when selecting APEX for activation. Such
considerations make the logic more complicated than required.

In this CL, we get rid of considerations for decompressed APEX in both
addition of data apex and selecting APEX for activation. We only
consider pre-installed APEX present in system and updated data apex
present in /data/apex/active. This results in CAPEX being selected for
activation, regardless of whether it has been decompressed already or
not.

These selected CAPEX then gets sent to ProcessCompressedApex method,
which is now smart enough to determine when decompression can be
avoided.

Bug: 185708645
Test: atest ApexTestCases ApexCompressionTests
Test: Manually tested that updating system APEX that has different root
digest without a version bump gets decompressed (via adb and OTA).

Change-Id: Id76c1caab84e9b5ae09196267eb096c4aa7cddb2
8 files changed