Revert "Enforce <uses-library> checks for android_app and android_app_import."
This reverts commit 22890c466e
.
Reason for revert: Broken build 7065627 on git_rvc-qpr-dev-plus-aosp
on aosp_sunfish-userdebug branch.
Bug: 176892941
Test: treehugger
Change-Id: I0f5da13644fd2ec7b0472fe82918e3c6a72d953c
This commit is contained in:
@@ -905,8 +905,6 @@ func AndroidAppFactory() android.Module {
|
|||||||
&module.appProperties,
|
&module.appProperties,
|
||||||
&module.overridableAppProperties)
|
&module.overridableAppProperties)
|
||||||
|
|
||||||
module.usesLibrary.enforce = true
|
|
||||||
|
|
||||||
android.InitAndroidMultiTargetsArchModule(module, android.DeviceSupported, android.MultilibCommon)
|
android.InitAndroidMultiTargetsArchModule(module, android.DeviceSupported, android.MultilibCommon)
|
||||||
android.InitDefaultableModule(module)
|
android.InitDefaultableModule(module)
|
||||||
android.InitOverridableModule(module, &module.appProperties.Overrides)
|
android.InitOverridableModule(module, &module.appProperties.Overrides)
|
||||||
@@ -1177,9 +1175,6 @@ type UsesLibraryProperties struct {
|
|||||||
// with knowledge of their shared libraries.
|
// with knowledge of their shared libraries.
|
||||||
type usesLibrary struct {
|
type usesLibrary struct {
|
||||||
usesLibraryProperties UsesLibraryProperties
|
usesLibraryProperties UsesLibraryProperties
|
||||||
|
|
||||||
// Whether to enforce verify_uses_library check.
|
|
||||||
enforce bool
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u *usesLibrary) addLib(lib string, optional bool) {
|
func (u *usesLibrary) addLib(lib string, optional bool) {
|
||||||
@@ -1246,7 +1241,7 @@ func (u *usesLibrary) classLoaderContextForUsesLibDeps(ctx android.ModuleContext
|
|||||||
func (u *usesLibrary) enforceUsesLibraries() bool {
|
func (u *usesLibrary) enforceUsesLibraries() bool {
|
||||||
defaultEnforceUsesLibs := len(u.usesLibraryProperties.Uses_libs) > 0 ||
|
defaultEnforceUsesLibs := len(u.usesLibraryProperties.Uses_libs) > 0 ||
|
||||||
len(u.usesLibraryProperties.Optional_uses_libs) > 0
|
len(u.usesLibraryProperties.Optional_uses_libs) > 0
|
||||||
return BoolDefault(u.usesLibraryProperties.Enforce_uses_libs, u.enforce || defaultEnforceUsesLibs)
|
return BoolDefault(u.usesLibraryProperties.Enforce_uses_libs, defaultEnforceUsesLibs)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Freeze the value of `enforce_uses_libs` based on the current values of `uses_libs` and `optional_uses_libs`.
|
// Freeze the value of `enforce_uses_libs` based on the current values of `uses_libs` and `optional_uses_libs`.
|
||||||
|
@@ -430,8 +430,6 @@ func AndroidAppImportFactory() android.Module {
|
|||||||
android.InitDefaultableModule(module)
|
android.InitDefaultableModule(module)
|
||||||
android.InitSingleSourcePrebuiltModule(module, &module.properties, "Apk")
|
android.InitSingleSourcePrebuiltModule(module, &module.properties, "Apk")
|
||||||
|
|
||||||
module.usesLibrary.enforce = true
|
|
||||||
|
|
||||||
return module
|
return module
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -182,31 +182,31 @@ func TestAndroidAppImport_DpiVariants(t *testing.T) {
|
|||||||
name: "no preferred",
|
name: "no preferred",
|
||||||
aaptPreferredConfig: nil,
|
aaptPreferredConfig: nil,
|
||||||
aaptPrebuiltDPI: []string{},
|
aaptPrebuiltDPI: []string{},
|
||||||
expected: "verify_uses_libraries/apk/app.apk",
|
expected: "prebuilts/apk/app.apk",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "AAPTPreferredConfig matches",
|
name: "AAPTPreferredConfig matches",
|
||||||
aaptPreferredConfig: proptools.StringPtr("xhdpi"),
|
aaptPreferredConfig: proptools.StringPtr("xhdpi"),
|
||||||
aaptPrebuiltDPI: []string{"xxhdpi", "ldpi"},
|
aaptPrebuiltDPI: []string{"xxhdpi", "ldpi"},
|
||||||
expected: "verify_uses_libraries/apk/app_xhdpi.apk",
|
expected: "prebuilts/apk/app_xhdpi.apk",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "AAPTPrebuiltDPI matches",
|
name: "AAPTPrebuiltDPI matches",
|
||||||
aaptPreferredConfig: proptools.StringPtr("mdpi"),
|
aaptPreferredConfig: proptools.StringPtr("mdpi"),
|
||||||
aaptPrebuiltDPI: []string{"xxhdpi", "xhdpi"},
|
aaptPrebuiltDPI: []string{"xxhdpi", "xhdpi"},
|
||||||
expected: "verify_uses_libraries/apk/app_xxhdpi.apk",
|
expected: "prebuilts/apk/app_xxhdpi.apk",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "non-first AAPTPrebuiltDPI matches",
|
name: "non-first AAPTPrebuiltDPI matches",
|
||||||
aaptPreferredConfig: proptools.StringPtr("mdpi"),
|
aaptPreferredConfig: proptools.StringPtr("mdpi"),
|
||||||
aaptPrebuiltDPI: []string{"ldpi", "xhdpi"},
|
aaptPrebuiltDPI: []string{"ldpi", "xhdpi"},
|
||||||
expected: "verify_uses_libraries/apk/app_xhdpi.apk",
|
expected: "prebuilts/apk/app_xhdpi.apk",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "no matches",
|
name: "no matches",
|
||||||
aaptPreferredConfig: proptools.StringPtr("mdpi"),
|
aaptPreferredConfig: proptools.StringPtr("mdpi"),
|
||||||
aaptPrebuiltDPI: []string{"ldpi", "xxxhdpi"},
|
aaptPrebuiltDPI: []string{"ldpi", "xxxhdpi"},
|
||||||
expected: "verify_uses_libraries/apk/app.apk",
|
expected: "prebuilts/apk/app.apk",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -225,7 +225,7 @@ func TestAndroidAppImport_DpiVariants(t *testing.T) {
|
|||||||
if len(matches) != 2 {
|
if len(matches) != 2 {
|
||||||
t.Errorf("failed to extract the src apk path from %q", jniRuleCommand)
|
t.Errorf("failed to extract the src apk path from %q", jniRuleCommand)
|
||||||
}
|
}
|
||||||
if strings.HasSuffix(matches[1], test.expected) {
|
if test.expected != matches[1] {
|
||||||
t.Errorf("wrong src apk, expected: %q got: %q", test.expected, matches[1])
|
t.Errorf("wrong src apk, expected: %q got: %q", test.expected, matches[1])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -302,7 +302,7 @@ func TestAndroidAppImport_ArchVariants(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
expected: "verify_uses_libraries/apk/app_arm64.apk",
|
expected: "prebuilts/apk/app_arm64.apk",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "no matching arch",
|
name: "no matching arch",
|
||||||
@@ -321,7 +321,7 @@ func TestAndroidAppImport_ArchVariants(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
expected: "verify_uses_libraries/apk/app.apk",
|
expected: "prebuilts/apk/app.apk",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "no matching arch without default",
|
name: "no matching arch without default",
|
||||||
@@ -359,7 +359,7 @@ func TestAndroidAppImport_ArchVariants(t *testing.T) {
|
|||||||
if len(matches) != 2 {
|
if len(matches) != 2 {
|
||||||
t.Errorf("failed to extract the src apk path from %q", jniRuleCommand)
|
t.Errorf("failed to extract the src apk path from %q", jniRuleCommand)
|
||||||
}
|
}
|
||||||
if strings.HasSuffix(matches[1], test.expected) {
|
if test.expected != matches[1] {
|
||||||
t.Errorf("wrong src apk, expected: %q got: %q", test.expected, matches[1])
|
t.Errorf("wrong src apk, expected: %q got: %q", test.expected, matches[1])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user