Revert^2 "Preopt APEX system server jars."

This reverts commit 92346c4832.

Reason for revert: Fixed build error.

The build error is fixed by ag/15841934. This CL remains unchanged. This
CL will be submitted AFTER ag/15841934 is submitted.

Bug: 200024131
Test: 1. Patch this CL and ag/15841934 into internal master.
  2. sudo vendor/google/build/build_test.bash

Change-Id: I5f2b8357846fc7dda56e25ebe6ffb095e8047ec8
This commit is contained in:
Jiakai Zhang
2021-09-16 06:15:39 +00:00
parent 92346c4832
commit 519c5c82e5
9 changed files with 518 additions and 54 deletions

View File

@@ -61,7 +61,13 @@ func (library *Library) AndroidMkEntries() []android.AndroidMkEntries {
var entriesList []android.AndroidMkEntries
if library.hideApexVariantFromMake {
// For a java library built for an APEX we don't need Make module
// For a java library built for an APEX, we don't need a Make module for itself. Otherwise, it
// will conflict with the platform variant because they have the same module name in the
// makefile. However, we need to add its dexpreopt outputs as sub-modules, if it is preopted.
dexpreoptEntries := library.dexpreopter.AndroidMkEntriesForApex()
if len(dexpreoptEntries) > 0 {
entriesList = append(entriesList, dexpreoptEntries...)
}
entriesList = append(entriesList, android.AndroidMkEntries{Disabled: true})
} else if !library.ApexModuleBase.AvailableFor(android.AvailableToPlatform) {
// Platform variant. If not available for the platform, we don't need Make module.