summaryrefslogtreecommitdiff
path: root/java/hiddenapi_singleton.go
diff options
context:
space:
mode:
authorJiyong Park <jiyong@google.com>2019-12-19 02:11:10 +0000
committerJiyong Park <jiyong@google.com>2019-12-19 02:11:10 +0000
commit4ed468c1af57a218cf3d6910b476f6f59575aeca (patch)
tree47698aadbd5e682fb2344387d540343e0f484295 /java/hiddenapi_singleton.go
parent4752219db3f5ffd9445e048140aca69d057d7c71 (diff)
Revert submission 1194828-revert-1191937-art_apex_available-DWXQGTKMAR
Reason for revert: relanding with fix Reverted Changes: Ic4119368c:Revert submission 1191937-art_apex_available Ia084976bb:Revert submission 1191937-art_apex_available Iada86226d:Revert submission 1191937-art_apex_available Ic76735eac:Revert submission 1191937-art_apex_available I1eb30e355:Revert submission 1191937-art_apex_available Icaf95d260:Revert submission 1191937-art_apex_available Ie8bace4be:Revert submission 1191937-art_apex_available I8961702cf:Revert submission 1191937-art_apex_available I39316f9ef:Revert submission 1191937-art_apex_available I522a7e83b:Revert submission 1191937-art_apex_available I8b9424976:Revert submission 1191937-art_apex_available I48b998629:Revert submission 1191937-art_apex_available Change-Id: I95cef82fa5dfaba5b7044cf274ce59ab954b8f2b
Diffstat (limited to 'java/hiddenapi_singleton.go')
-rw-r--r--java/hiddenapi_singleton.go23
1 files changed, 5 insertions, 18 deletions
diff --git a/java/hiddenapi_singleton.go b/java/hiddenapi_singleton.go
index e9e4a45b0..ad84cdea2 100644
--- a/java/hiddenapi_singleton.go
+++ b/java/hiddenapi_singleton.go
@@ -16,7 +16,6 @@ package java
import (
"fmt"
- "strings"
"android/soong/android"
)
@@ -153,23 +152,11 @@ func stubFlagsRule(ctx android.SingletonContext) {
// Collect dex jar paths for modules that had hiddenapi encode called on them.
if h, ok := module.(hiddenAPIIntf); ok {
if jar := h.bootDexJar(); jar != nil {
- // Don't add multiple variants of the same library to bootDexJars, otherwise
- // hiddenapi tool will complain about duplicated classes. Such multiple variants
- // of the same library can happen when the library is included in one or more APEXes.
- // TODO(b/146308764): remove this heuristic
- if a, ok := module.(android.ApexModule); ok && android.InAnyApex(module.Name()) {
- if a.AvailableFor("//apex_available:platform") && !a.IsForPlatform() {
- // skip the apex variants if the jar is available for the platform
- return
- }
- apexName := a.ApexName()
- if strings.Contains(apexName, "test") {
- // skip the if the jar is in test APEX
- return
- }
-
- if strings.Contains(apexName, "com.android.art") && apexName != "com.android.art.release" {
- // skip the ART APEX variants other than com.android.art.release
+ // For a java lib included in an APEX, only take the one built for
+ // the platform variant, and skip the variants for APEXes.
+ // Otherwise, the hiddenapi tool will complain about duplicated classes
+ if a, ok := module.(android.ApexModule); ok {
+ if android.InAnyApex(module.Name()) && !a.IsForPlatform() {
return
}
}