[ApiModel] Ensure we only desugar non-synthesized methods

Change-Id: I7b3657d03cc75d9cbe8214c4828d1d5787880d14
diff --git a/src/main/java/com/android/tools/r8/ir/desugar/apimodel/ApiInvokeOutlinerDesugaring.java b/src/main/java/com/android/tools/r8/ir/desugar/apimodel/ApiInvokeOutlinerDesugaring.java
index dfbfc0e..82ada16 100644
--- a/src/main/java/com/android/tools/r8/ir/desugar/apimodel/ApiInvokeOutlinerDesugaring.java
+++ b/src/main/java/com/android/tools/r8/ir/desugar/apimodel/ApiInvokeOutlinerDesugaring.java
@@ -73,7 +73,7 @@
       CfInstructionDesugaringCollection desugaringCollection,
       DexItemFactory dexItemFactory) {
     ComputedApiLevel computedApiLevel =
-        getComputedApiLevelInstructionOnHolderWithMinApi(instruction);
+        getComputedApiLevelInstructionOnHolderWithMinApi(instruction, context);
     if (computedApiLevel.isGreaterThan(appView.computedMinApiLevel())) {
       return desugarLibraryCall(
           methodProcessingContext.createUniqueContext(),
@@ -88,15 +88,15 @@
 
   @Override
   public boolean needsDesugaring(CfInstruction instruction, ProgramMethod context) {
-    if (context.getDefinition().isD8R8Synthesized()) {
-      return false;
-    }
-    return getComputedApiLevelInstructionOnHolderWithMinApi(instruction)
+    return getComputedApiLevelInstructionOnHolderWithMinApi(instruction, context)
         .isGreaterThan(appView.computedMinApiLevel());
   }
 
   private ComputedApiLevel getComputedApiLevelInstructionOnHolderWithMinApi(
-      CfInstruction instruction) {
+      CfInstruction instruction, ProgramMethod context) {
+    if (context.getDefinition().isD8R8Synthesized()) {
+      return appView.computedMinApiLevel();
+    }
     DexReference reference;
     if (instruction.isInvoke()) {
       CfInvoke cfInvoke = instruction.asInvoke();