Version 2.2.26

Cherry-pick: Change type of minApiLevel to int
CL: https://r8-review.googlesource.com/c/r8/+/54484

Change-Id: I93179fa317c658864f1895aaa1d6376790d1eb88
diff --git a/src/main/java/com/android/tools/r8/Version.java b/src/main/java/com/android/tools/r8/Version.java
index 2537dcf..0d8ef44 100644
--- a/src/main/java/com/android/tools/r8/Version.java
+++ b/src/main/java/com/android/tools/r8/Version.java
@@ -11,7 +11,7 @@
 
   // This field is accessed from release scripts using simple pattern matching.
   // Therefore, changing this field could break our release scripts.
-  public static final String LABEL = "2.2.25";
+  public static final String LABEL = "2.2.26";
 
   private Version() {
   }
diff --git a/src/test/java/com/android/tools/r8/D8TestCompileResult.java b/src/test/java/com/android/tools/r8/D8TestCompileResult.java
index ea8ff8b..1fcd0e7 100644
--- a/src/test/java/com/android/tools/r8/D8TestCompileResult.java
+++ b/src/test/java/com/android/tools/r8/D8TestCompileResult.java
@@ -4,12 +4,10 @@
 package com.android.tools.r8;
 
 import com.android.tools.r8.ToolHelper.ProcessResult;
-import com.android.tools.r8.utils.AndroidApiLevel;
 import com.android.tools.r8.utils.AndroidApp;
 
 public class D8TestCompileResult extends TestCompileResult<D8TestCompileResult, D8TestRunResult> {
-  D8TestCompileResult(
-      TestState state, AndroidApp app, AndroidApiLevel minApiLevel, OutputMode outputMode) {
+  D8TestCompileResult(TestState state, AndroidApp app, int minApiLevel, OutputMode outputMode) {
     super(state, app, minApiLevel, outputMode);
   }
 
diff --git a/src/test/java/com/android/tools/r8/DXTestBuilder.java b/src/test/java/com/android/tools/r8/DXTestBuilder.java
index 49055a1..30917a7 100644
--- a/src/test/java/com/android/tools/r8/DXTestBuilder.java
+++ b/src/test/java/com/android/tools/r8/DXTestBuilder.java
@@ -51,7 +51,7 @@
       Path outJar = dxOutputFolder.resolve("output.jar");
 
       List<String> args = new ArrayList<>();
-      args.add("--min-sdk-version=" + minApiLevel.getLevel());
+      args.add("--min-sdk-version=" + minApiLevel);
       args.add("--output=" + outJar.toString());
       args.addAll(injars.stream().map(Path::toString).collect(Collectors.toList()));
       ProcessResult result =
diff --git a/src/test/java/com/android/tools/r8/DXTestCompileResult.java b/src/test/java/com/android/tools/r8/DXTestCompileResult.java
index 9cb6482..4a0c42f 100644
--- a/src/test/java/com/android/tools/r8/DXTestCompileResult.java
+++ b/src/test/java/com/android/tools/r8/DXTestCompileResult.java
@@ -5,12 +5,11 @@
 
 import com.android.tools.r8.ToolHelper.ProcessResult;
 import com.android.tools.r8.errors.Unimplemented;
-import com.android.tools.r8.utils.AndroidApiLevel;
 import com.android.tools.r8.utils.AndroidApp;
 
 public class DXTestCompileResult extends TestCompileResult<DXTestCompileResult, DXTestRunResult> {
 
-  DXTestCompileResult(TestState state, AndroidApp app, AndroidApiLevel minApiLevel) {
+  DXTestCompileResult(TestState state, AndroidApp app, int minApiLevel) {
     super(state, app, minApiLevel, OutputMode.DexIndexed);
   }
 
diff --git a/src/test/java/com/android/tools/r8/ExternalR8TestCompileResult.java b/src/test/java/com/android/tools/r8/ExternalR8TestCompileResult.java
index 73fe9b4..ea6b2f7 100644
--- a/src/test/java/com/android/tools/r8/ExternalR8TestCompileResult.java
+++ b/src/test/java/com/android/tools/r8/ExternalR8TestCompileResult.java
@@ -6,7 +6,6 @@
 
 import com.android.tools.r8.ToolHelper.ProcessResult;
 import com.android.tools.r8.errors.Unimplemented;
-import com.android.tools.r8.utils.AndroidApiLevel;
 import com.android.tools.r8.utils.AndroidApp;
 import com.android.tools.r8.utils.codeinspector.CodeInspector;
 import java.io.IOException;
@@ -25,7 +24,7 @@
       Path outputJar,
       ProcessResult processResult,
       String proguardMap,
-      AndroidApiLevel minApiLevel,
+      int minApiLevel,
       OutputMode outputMode) {
     super(state, AndroidApp.builder().addProgramFiles(outputJar).build(), minApiLevel, outputMode);
     assert processResult.exitCode == 0;
diff --git a/src/test/java/com/android/tools/r8/ProguardTestCompileResult.java b/src/test/java/com/android/tools/r8/ProguardTestCompileResult.java
index b51c598..c352417 100644
--- a/src/test/java/com/android/tools/r8/ProguardTestCompileResult.java
+++ b/src/test/java/com/android/tools/r8/ProguardTestCompileResult.java
@@ -5,7 +5,6 @@
 
 import com.android.tools.r8.ToolHelper.ProcessResult;
 import com.android.tools.r8.errors.Unimplemented;
-import com.android.tools.r8.utils.AndroidApiLevel;
 import com.android.tools.r8.utils.AndroidApp;
 import com.android.tools.r8.utils.codeinspector.CodeInspector;
 import java.io.IOException;
@@ -18,8 +17,7 @@
   private final Path outputJar;
   private final String proguardMap;
 
-  ProguardTestCompileResult(
-      TestState state, Path outputJar, AndroidApiLevel minApiLevel, String proguardMap) {
+  ProguardTestCompileResult(TestState state, Path outputJar, int minApiLevel, String proguardMap) {
     super(
         state,
         AndroidApp.builder().addProgramFiles(outputJar).build(),
diff --git a/src/test/java/com/android/tools/r8/R8TestCompileResult.java b/src/test/java/com/android/tools/r8/R8TestCompileResult.java
index 0deb4f5..85c6b96 100644
--- a/src/test/java/com/android/tools/r8/R8TestCompileResult.java
+++ b/src/test/java/com/android/tools/r8/R8TestCompileResult.java
@@ -12,7 +12,6 @@
 import com.android.tools.r8.shaking.CollectingGraphConsumer;
 import com.android.tools.r8.shaking.ProguardConfiguration;
 import com.android.tools.r8.shaking.ProguardConfigurationRule;
-import com.android.tools.r8.utils.AndroidApiLevel;
 import com.android.tools.r8.utils.AndroidApp;
 import com.android.tools.r8.utils.FileUtils;
 import com.android.tools.r8.utils.ThrowingConsumer;
@@ -40,7 +39,7 @@
       List<ProguardConfigurationRule> syntheticProguardRules,
       String proguardMap,
       CollectingGraphConsumer graphConsumer,
-      AndroidApiLevel minApiLevel,
+      int minApiLevel,
       List<Path> features) {
     super(state, app, minApiLevel, outputMode);
     this.proguardConfiguration = proguardConfiguration;
diff --git a/src/test/java/com/android/tools/r8/TestCompileResult.java b/src/test/java/com/android/tools/r8/TestCompileResult.java
index 7dfe4b5..c888c1d 100644
--- a/src/test/java/com/android/tools/r8/TestCompileResult.java
+++ b/src/test/java/com/android/tools/r8/TestCompileResult.java
@@ -45,19 +45,18 @@
 import org.hamcrest.Matcher;
 
 public abstract class TestCompileResult<
-        CR extends TestCompileResult<CR, RR>, RR extends TestRunResult>
+        CR extends TestCompileResult<CR, RR>, RR extends TestRunResult<RR>>
     extends TestBaseResult<CR, RR> {
 
   public final AndroidApp app;
-  public final AndroidApiLevel minApiLevel;
+  public final int minApiLevel;
   private final OutputMode outputMode;
   final List<Path> additionalRunClassPath = new ArrayList<>();
   final List<String> vmArguments = new ArrayList<>();
   private boolean withArt6Plus64BitsLib = false;
   private boolean withArtFrameworks = true;
 
-  TestCompileResult(
-      TestState state, AndroidApp app, AndroidApiLevel minApiLevel, OutputMode outputMode) {
+  TestCompileResult(TestState state, AndroidApp app, int minApiLevel, OutputMode outputMode) {
     super(state);
     this.app = app;
     this.minApiLevel = minApiLevel;
diff --git a/src/test/java/com/android/tools/r8/TestCompilerBuilder.java b/src/test/java/com/android/tools/r8/TestCompilerBuilder.java
index 590f10a..3e5ba5f 100644
--- a/src/test/java/com/android/tools/r8/TestCompilerBuilder.java
+++ b/src/test/java/com/android/tools/r8/TestCompilerBuilder.java
@@ -53,7 +53,7 @@
   private final List<Path> additionalRunClassPath = new ArrayList<>();
   private ProgramConsumer programConsumer;
   private StringConsumer mainDexListConsumer;
-  protected AndroidApiLevel minApiLevel = ToolHelper.getMinApiLevelForDexVm();
+  protected int minApiLevel = ToolHelper.getMinApiLevelForDexVm().getLevel();
   private Consumer<InternalOptions> optionsConsumer = DEFAULT_OPTIONS;
   private ByteArrayOutputStream stdout = null;
   private PrintStream oldStdout = null;
@@ -110,7 +110,7 @@
     if (backend.isDex() || !isTestShrinkerBuilder()) {
       assert !builder.isMinApiLevelSet()
           : "Don't set the API level directly through BaseCompilerCommand.Builder in tests";
-      builder.setMinApiLevel(minApiLevel.getLevel());
+      builder.setMinApiLevel(minApiLevel);
     }
     if (useDefaultRuntimeLibrary) {
       if (backend == Backend.DEX) {
@@ -238,7 +238,7 @@
   }
 
   public T setMinApi(int minApiLevel) {
-    this.minApiLevel = AndroidApiLevel.getAndroidApiLevel(minApiLevel);
+    this.minApiLevel = minApiLevel;
     return self();
   }