diff --git a/shell/platform/android/io/flutter/embedding/engine/FlutterEngine.java b/shell/platform/android/io/flutter/embedding/engine/FlutterEngine.java index 71a93c0a04330174a338ffef688fd579c7e58db4..cd22f732d8b75a8a392652c1d4a1fa80b5bfac7b 100644 --- a/shell/platform/android/io/flutter/embedding/engine/FlutterEngine.java +++ b/shell/platform/android/io/flutter/embedding/engine/FlutterEngine.java @@ -103,10 +103,6 @@ public class FlutterEngine { platformViewsController.onPreEngineRestart(); } - - public void onDisplayPlatformView(int viewId, int x, int y, int width, int height) { - platformViewsController.onDisplayPlatformView(viewId, x, y, width, height); - } }; /** @@ -211,7 +207,6 @@ public class FlutterEngine { flutterLoader.ensureInitializationComplete(context, dartVmArgs); flutterJNI.addEngineLifecycleListener(engineLifecycleListener); - flutterJNI.setPlatformViewsController(platformViewsController); attachToJni(); this.dartExecutor = new DartExecutor(flutterJNI, context.getAssets()); diff --git a/shell/platform/android/io/flutter/embedding/engine/FlutterJNI.java b/shell/platform/android/io/flutter/embedding/engine/FlutterJNI.java index 478db5b90981ab6d81af85b2a8cac9a00f37ec99..b0d5ad9ba19e268f308f9cc358ca5b1108329dfb 100644 --- a/shell/platform/android/io/flutter/embedding/engine/FlutterJNI.java +++ b/shell/platform/android/io/flutter/embedding/engine/FlutterJNI.java @@ -22,7 +22,6 @@ import io.flutter.embedding.engine.dart.PlatformMessageHandler; import io.flutter.embedding.engine.renderer.FlutterUiDisplayListener; import io.flutter.embedding.engine.renderer.RenderSurface; import io.flutter.plugin.common.StandardMessageCodec; -import io.flutter.plugin.platform.PlatformViewsController; import io.flutter.view.AccessibilityBridge; import io.flutter.view.FlutterCallbackInformation; import java.nio.ByteBuffer; @@ -169,7 +168,6 @@ public class FlutterJNI { @Nullable private Long nativePlatformViewId; @Nullable private AccessibilityDelegate accessibilityDelegate; @Nullable private PlatformMessageHandler platformMessageHandler; - @Nullable private PlatformViewsController platformViewsController; @NonNull private final Set engineLifecycleListeners = new CopyOnWriteArraySet<>(); @@ -417,12 +415,6 @@ public class FlutterJNI { long nativePlatformViewId, @NonNull ByteBuffer buffer, int position); // ------ End Touch Interaction Support --- - @UiThread - public void setPlatformViewsController(@NonNull PlatformViewsController platformViewsController) { - ensureRunningOnMainThread(); - this.platformViewsController = platformViewsController; - } - // ------ Start Accessibility Support ----- /** * Sets the {@link AccessibilityDelegate} for the attached Flutter context. @@ -790,17 +782,6 @@ public class FlutterJNI { } // ----- End Engine Lifecycle Support ---- - // @SuppressWarnings("unused") - @UiThread - public void onDisplayPlatformView(int viewId, int x, int y, int width, int height) { - ensureRunningOnMainThread(); - if (platformViewsController == null) { - throw new RuntimeException( - "platformViewsController must be set before attempting to position a platform view"); - } - platformViewsController.onDisplayPlatformView(viewId, x, y, width, height); - } - // TODO(mattcarroll): determine if this is nonull or nullable @UiThread public Bitmap getBitmap() { diff --git a/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java b/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java index fad763e339fa8e2fd0e71ced03688e4bcc163148..bc36210e4c9b780649618767d3d46c205f8cf53c 100644 --- a/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java +++ b/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java @@ -533,8 +533,4 @@ public class PlatformViewsController implements PlatformViewsAccessibilityDelega } vdControllers.clear(); } - - public void onDisplayPlatformView(int viewId, int x, int y, int width, int height) { - // TODO: Implement this method. https://github.com/flutter/flutter/issues/58288 - } } diff --git a/shell/platform/android/platform_view_android_jni.cc b/shell/platform/android/platform_view_android_jni.cc index 81a6caad1a15c845941e20feab3a64b9de548026..4f6f9258b3e11285a27b219b2b19e77f03db60fa 100644 --- a/shell/platform/android/platform_view_android_jni.cc +++ b/shell/platform/android/platform_view_android_jni.cc @@ -118,19 +118,6 @@ void FlutterViewOnPreEngineRestart(JNIEnv* env, jobject obj) { FML_CHECK(CheckException(env)); } -static jmethodID g_on_display_platform_view_method = nullptr; -void FlutterViewOnDisplayPlatformView(JNIEnv* env, - jobject obj, - jint view_id, - jint x, - jint y, - jint width, - jint height) { - env->CallVoidMethod(obj, g_on_display_platform_view_method, view_id, x, y, - width, height); - FML_CHECK(CheckException(env)); -} - static jmethodID g_attach_to_gl_context_method = nullptr; void SurfaceTextureAttachToGLContext(JNIEnv* env, jobject obj, jint textureId) { env->CallVoidMethod(obj, g_attach_to_gl_context_method, textureId); @@ -763,14 +750,6 @@ bool PlatformViewAndroid::Register(JNIEnv* env) { return false; } - g_on_display_platform_view_method = env->GetMethodID( - g_flutter_jni_class->obj(), "onDisplayPlatformView", "(IIIII)V"); - - if (g_on_display_platform_view_method == nullptr) { - FML_LOG(ERROR) << "Could not locate onDisplayPlatformView method"; - return false; - } - g_surface_texture_class = new fml::jni::ScopedJavaGlobalRef( env, env->FindClass("android/graphics/SurfaceTexture")); if (g_surface_texture_class->is_null()) { diff --git a/shell/platform/android/platform_view_android_jni.h b/shell/platform/android/platform_view_android_jni.h index 199af74bd6a86b37f433f48ec9d6ea52439418bf..07c70b2a45b50a2687c92de55b83bd33cc3337ca 100644 --- a/shell/platform/android/platform_view_android_jni.h +++ b/shell/platform/android/platform_view_android_jni.h @@ -36,14 +36,6 @@ void FlutterViewOnFirstFrame(JNIEnv* env, jobject obj); void FlutterViewOnPreEngineRestart(JNIEnv* env, jobject obj); -void FlutterViewOnDisplayPlatformView(JNIEnv* env, - jobject obj, - jint view_id, - jint x, - jint y, - jint width, - jint height); - void SurfaceTextureAttachToGLContext(JNIEnv* env, jobject obj, jint textureId); void SurfaceTextureUpdateTexImage(JNIEnv* env, jobject obj); diff --git a/shell/platform/android/test/io/flutter/embedding/engine/FlutterJNITest.java b/shell/platform/android/test/io/flutter/embedding/engine/FlutterJNITest.java index c2bd1294c0351c7e2337d8e6e1c5c157d649d41e..98b8660683837520d11de62b11e745b22e096aab 100644 --- a/shell/platform/android/test/io/flutter/embedding/engine/FlutterJNITest.java +++ b/shell/platform/android/test/io/flutter/embedding/engine/FlutterJNITest.java @@ -1,7 +1,6 @@ package io.flutter.embedding.engine; import static org.junit.Assert.assertEquals; -import static org.mockito.Mockito.verify; import io.flutter.embedding.engine.renderer.FlutterUiDisplayListener; import java.util.concurrent.atomic.AtomicInteger; @@ -45,21 +44,4 @@ public class FlutterJNITest { // --- Verify Results --- assertEquals(1, callbackInvocationCount.get()); } - - @Test - public void onDisplayPlatformView__callsPlatformViewsController() { - PlatformViewsController platformViewsController = mock(PlatformViewsController.class); - - FlutterJNI flutterJNI = new FlutterJNI(); - flutterJNI.setPlatformViewsController(platformViewsController); - - // --- Execute Test --- - flutterJNI.onDisplayPlatformView( - /*viewId=*/ 1, /*x=*/ 10, /*y=*/ 20, /*width=*/ 100, /*height=*/ 200); - - // --- Verify Results --- - verify(platformViewsController, times(1)) - .onDisplayPlatformView( - /*viewId=*/ 1, /*x=*/ 10, /*y=*/ 20, /*width=*/ 100, /*height=*/ 200); - } }