Revert^3 "Enforce <uses-library> checks for android_app and android_app_import."
This reverts commit c2b6b65d7380407757dc596af00ee954b3cc2968.
Reason for revert: These changes should only be reverted in
rvc-qpr-dev-plus-aosp, but not in master.
Bug: 132357300
Test: treehugger
Change-Id: I3243668ce9a399936b0e9dde09c42db6cc45d562
diff --git a/java/app.go b/java/app.go
index 93bc8fa..ce89e9b 100755
--- a/java/app.go
+++ b/java/app.go
@@ -906,6 +906,8 @@
&module.appProperties,
&module.overridableAppProperties)
+ module.usesLibrary.enforce = true
+
android.InitAndroidMultiTargetsArchModule(module, android.DeviceSupported, android.MultilibCommon)
android.InitDefaultableModule(module)
android.InitOverridableModule(module, &module.appProperties.Overrides)
@@ -1176,6 +1178,9 @@
// with knowledge of their shared libraries.
type usesLibrary struct {
usesLibraryProperties UsesLibraryProperties
+
+ // Whether to enforce verify_uses_library check.
+ enforce bool
}
func (u *usesLibrary) addLib(lib string, optional bool) {
@@ -1242,7 +1247,7 @@
func (u *usesLibrary) enforceUsesLibraries() bool {
defaultEnforceUsesLibs := len(u.usesLibraryProperties.Uses_libs) > 0 ||
len(u.usesLibraryProperties.Optional_uses_libs) > 0
- return BoolDefault(u.usesLibraryProperties.Enforce_uses_libs, defaultEnforceUsesLibs)
+ return BoolDefault(u.usesLibraryProperties.Enforce_uses_libs, u.enforce || defaultEnforceUsesLibs)
}
// Freeze the value of `enforce_uses_libs` based on the current values of `uses_libs` and `optional_uses_libs`.