Add @Keep annotations to avoid dead code elimination of classes only referenced by JNI (flutter/engine#44337)

Missing piece
This commit is contained in:
John McCutchan
2023-08-03 11:50:52 -07:00
committed by GitHub
parent 81eff8854f
commit 0cb36c4ad8
2 changed files with 4 additions and 0 deletions

View File

@@ -12,6 +12,7 @@ import android.media.Image;
import android.os.Build;
import android.os.Handler;
import android.view.Surface;
import androidx.annotation.Keep;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
@@ -319,6 +320,7 @@ public class FlutterRenderer implements TextureRegistry {
}
}
@Keep
final class ImageTextureRegistryEntry implements TextureRegistry.ImageTextureEntry {
private final long id;
private boolean released;

View File

@@ -6,6 +6,7 @@ package io.flutter.view;
import android.graphics.SurfaceTexture;
import android.media.Image;
import androidx.annotation.Keep;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@@ -75,6 +76,7 @@ public interface TextureRegistry {
default void setOnTrimMemoryListener(@Nullable OnTrimMemoryListener listener) {}
}
@Keep
interface ImageTextureEntry extends TextureEntry {
/** @return the identity of this ImageTextureEntry */
long id();