From 8c9ae7ed6770b45f1337722a2e61cb22317659aa Mon Sep 17 00:00:00 2001 From: Spandan Das Date: Fri, 3 Mar 2023 21:20:36 +0000 Subject: Update min_sdk_version from SdkSpec to ApiLevel This relands aosp/2457063. The original change broke T and U since those branches still contain soong modules of type (kind+level). Those soong modules have been cleaned up now Test: Used go/abtd to test T and U branches with this change Bug: 208456999 Change-Id: I0ef7933c055f88cb512a02108f1173e51156ef1c --- java/hiddenapi.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'java/hiddenapi.go') diff --git a/java/hiddenapi.go b/java/hiddenapi.go index c4fc65f2e..d25096b15 100644 --- a/java/hiddenapi.go +++ b/java/hiddenapi.go @@ -73,7 +73,7 @@ type hiddenAPIModule interface { android.Module hiddenAPIIntf - MinSdkVersion(ctx android.EarlyModuleContext) android.SdkSpec + MinSdkVersion(ctx android.EarlyModuleContext) android.ApiLevel } type hiddenAPIIntf interface { @@ -157,7 +157,7 @@ func (h *hiddenAPI) hiddenAPIEncodeDex(ctx android.ModuleContext, dexJar android // Create a copy of the dex jar which has been encoded with hiddenapi flags. flagsCSV := hiddenAPISingletonPaths(ctx).flags outputDir := android.PathForModuleOut(ctx, "hiddenapi").OutputPath - encodedDex := hiddenAPIEncodeDex(ctx, dexJar, flagsCSV, uncompressDex, android.SdkSpecNone, outputDir) + encodedDex := hiddenAPIEncodeDex(ctx, dexJar, flagsCSV, uncompressDex, android.NoneApiLevel, outputDir) // Use the encoded dex jar from here onwards. return encodedDex @@ -253,7 +253,7 @@ var hiddenAPIEncodeDexRule = pctx.AndroidStaticRule("hiddenAPIEncodeDex", bluepr // The encode dex rule requires unzipping, encoding and rezipping the classes.dex files along with // all the resources from the input jar. It also ensures that if it was uncompressed in the input // it stays uncompressed in the output. -func hiddenAPIEncodeDex(ctx android.ModuleContext, dexInput, flagsCSV android.Path, uncompressDex bool, minSdkVersion android.SdkSpec, outputDir android.OutputPath) android.OutputPath { +func hiddenAPIEncodeDex(ctx android.ModuleContext, dexInput, flagsCSV android.Path, uncompressDex bool, minSdkVersion android.ApiLevel, outputDir android.OutputPath) android.OutputPath { // The output file has the same name as the input file and is in the output directory. output := outputDir.Join(ctx, dexInput.Base()) @@ -283,7 +283,7 @@ func hiddenAPIEncodeDex(ctx android.ModuleContext, dexInput, flagsCSV android.Pa // If the library is targeted for Q and/or R then make sure that they do not // have any S+ flags encoded as that will break the runtime. - minApiLevel := minSdkVersion.ApiLevel + minApiLevel := minSdkVersion if !minApiLevel.IsNone() { if minApiLevel.LessThanOrEqualTo(android.ApiLevelOrPanic(ctx, "R")) { hiddenapiFlags = hiddenapiFlags + " --max-hiddenapi-level=max-target-r" -- cgit v1.2.3-59-g8ed1b