@@ -79,10 +79,6 @@ static jmethodID g_update_custom_accessibility_actions_method = nullptr;
7979static jmethodID g_on_first_frame_method = nullptr ;
8080
8181static jmethodID g_on_engine_restart_method = nullptr ;
82- void FlutterViewOnPreEngineRestart (JNIEnv* env, jobject obj) {
83- env->CallVoidMethod (obj, g_on_engine_restart_method);
84- FML_CHECK (CheckException (env));
85- }
8682
8783static jmethodID g_on_begin_frame_method = nullptr ;
8884void FlutterViewBeginFrame (JNIEnv* env, jobject obj) {
@@ -720,8 +716,16 @@ bool PlatformViewAndroid::Register(JNIEnv* env) {
720716 return false ;
721717 }
722718
719+ g_on_display_platform_view_method = env->GetMethodID (
720+ g_flutter_jni_class->obj (), " onDisplayPlatformView" , " (IIIII)V" );
721+
722+ if (g_on_display_platform_view_method == nullptr ) {
723+ FML_LOG (ERROR) << " Could not locate onDisplayPlatformView method" ;
724+ return false ;
725+ }
726+
723727 g_on_begin_frame_method =
724- env->GetMethodID (g_flutter_jni_class->obj (), " onBeginFrame" , " ()V" );
728+ env->GetMethodID (g_flutter_jni_class->obj (), " onBeginFrame" , " ()V" );
725729
726730 if (g_on_begin_frame_method == nullptr ) {
727731 FML_LOG (ERROR) << " Could not locate onBeginFrame method" ;
@@ -1044,4 +1048,17 @@ void PlatformViewAndroidJNIImpl::FlutterViewDisplayOverlaySurface(
10441048 FML_CHECK (CheckException (env));
10451049}
10461050
1051+ void PlatformViewAndroidJNIImpl::FlutterViewBeginFrame () {
1052+ JNIEnv* env = fml::jni::AttachCurrentThread ();
1053+
1054+ auto java_object = java_object_.get (env);
1055+ if (java_object.is_null ()) {
1056+ return ;
1057+ }
1058+
1059+ env->CallVoidMethod (java_object.obj (), g_on_begin_frame_method);
1060+
1061+ FML_CHECK (CheckException (env));
1062+ }
1063+
10471064} // namespace flutter
0 commit comments