From e8eeec913f4c8cd00cfa30afc064b229fcdf0a51 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Thu, 14 Dec 2023 14:50:05 -0800 Subject: [PATCH] Fix TestAarImportProducesJniPackages/aar-no-jni TestAarImportProducesJniPackages was attempting to assert that an aar_import module always had a JniPackageProvider, but was instead asserting that the return type was always a JniPackageInfo. Since ModuleProvider returned the zero value of JniPackageInfo even when there was no provider that was always true. Fix aar_import to always set JniPackageProvider. Test: TestAarImportProducesJniPackages Change-Id: Idaf106e14373490d4eb807892e174aaaf094bbcf --- java/aar.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/java/aar.go b/java/aar.go index af99cd0eb..aca73aa9d 100644 --- a/java/aar.go +++ b/java/aar.go @@ -1256,11 +1256,11 @@ func (a *AARImport) GenerateAndroidBuildActions(ctx android.ModuleContext) { }, }) } - - ctx.SetProvider(JniPackageProvider, JniPackageInfo{ - JniPackages: a.jniPackages, - }) } + + ctx.SetProvider(JniPackageProvider, JniPackageInfo{ + JniPackages: a.jniPackages, + }) } func (a *AARImport) HeaderJars() android.Paths {