Revert "APK-in-APEX should set use_embedded_native_libs: true"
Revert submission 3088867
Reason for revert: On cf_auto build, we are seeing a symlink of jni lib pointing to lib64/libcarservicejni.so, which does not exist on the device.
Reverted changes: /q/submissionid:3088867
Bug: b/341335305
Change-Id: I3064caef0cb55d1594951835a1173c667f58e607
diff --git a/java/app.go b/java/app.go
index 441091b..22958e5 100644
--- a/java/app.go
+++ b/java/app.go
@@ -334,7 +334,6 @@
func (a *AndroidApp) GenerateAndroidBuildActions(ctx android.ModuleContext) {
a.checkAppSdkVersions(ctx)
- a.checkEmbedJnis(ctx)
a.generateAndroidBuildActions(ctx)
a.generateJavaUsedByApex(ctx)
}
@@ -379,17 +378,6 @@
a.checkSdkVersions(ctx)
}
-// Ensures that use_embedded_native_libs are set for apk-in-apex
-func (a *AndroidApp) checkEmbedJnis(ctx android.BaseModuleContext) {
- apexInfo, _ := android.ModuleProvider(ctx, android.ApexInfoProvider)
- apkInApex := !apexInfo.IsForPlatform()
- hasJnis := len(a.appProperties.Jni_libs) > 0
-
- if apkInApex && hasJnis && !Bool(a.appProperties.Use_embedded_native_libs) {
- ctx.ModuleErrorf("APK in APEX should have use_embedded_native_libs: true")
- }
-}
-
// If an updatable APK sets min_sdk_version, min_sdk_vesion of JNI libs should match with it.
// This check is enforced for "updatable" APKs (including APK-in-APEX).
func (a *AndroidApp) checkJniLibsSdkVersion(ctx android.ModuleContext, minSdkVersion android.ApiLevel) {
@@ -445,9 +433,9 @@
}
func (a *AndroidApp) shouldEmbedJnis(ctx android.BaseModuleContext) bool {
+ apexInfo, _ := android.ModuleProvider(ctx, android.ApexInfoProvider)
return ctx.Config().UnbundledBuild() || Bool(a.appProperties.Use_embedded_native_libs) ||
- Bool(a.appProperties.Updatable) ||
- a.appProperties.AlwaysPackageNativeLibs
+ !apexInfo.IsForPlatform() || a.appProperties.AlwaysPackageNativeLibs
}
func generateAaptRenamePackageFlags(packageName string, renameResourcesPackage bool) []string {