Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion ci/licenses_golden/licenses_flutter
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,6 @@ FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/Flutte
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/FlutterEngineCache.java
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/FlutterEnginePluginRegistry.java
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/FlutterJNI.java
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/FlutterOverlaySurface.java
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/FlutterShellArgs.java
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/dart/DartExecutor.java
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/dart/DartMessenger.java
Expand Down
1 change: 0 additions & 1 deletion shell/platform/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ android_java_sources = [
"io/flutter/embedding/engine/FlutterEngineCache.java",
"io/flutter/embedding/engine/FlutterEnginePluginRegistry.java",
"io/flutter/embedding/engine/FlutterJNI.java",
"io/flutter/embedding/engine/FlutterOverlaySurface.java",
"io/flutter/embedding/engine/FlutterShellArgs.java",
"io/flutter/embedding/engine/dart/DartExecutor.java",
"io/flutter/embedding/engine/dart/DartMessenger.java",
Expand Down
11 changes: 0 additions & 11 deletions shell/platform/android/io/flutter/embedding/engine/FlutterJNI.java
Original file line number Diff line number Diff line change
Expand Up @@ -827,17 +827,6 @@ public void onEndFrame() {
}
platformViewsController.onEndFrame();
}

@SuppressWarnings("unused")
@UiThread
public FlutterOverlaySurface createOverlaySurface() {
ensureRunningOnMainThread();
if (platformViewsController == null) {
throw new RuntimeException(
"platformViewsController must be set before attempting to position an overlay surface");
}
return platformViewsController.createOverlaySurface();
}
// ----- End Engine Lifecycle Support ----

// ----- Start Localization Support ----
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import androidx.annotation.NonNull;
import androidx.annotation.UiThread;
import androidx.annotation.VisibleForTesting;
import io.flutter.embedding.engine.FlutterOverlaySurface;
import io.flutter.embedding.engine.dart.DartExecutor;
import io.flutter.embedding.engine.systemchannels.PlatformViewsChannel;
import io.flutter.plugin.editing.TextInputPlugin;
Expand Down Expand Up @@ -550,9 +549,4 @@ public void onBeginFrame() {
public void onEndFrame() {
// TODO: Implement this method. https://github.com/flutter/flutter/issues/58288
}

public FlutterOverlaySurface createOverlaySurface() {
// TODO: Implement this method. https://github.com/flutter/flutter/issues/58288
return null;
}
}
8 changes: 0 additions & 8 deletions shell/platform/android/jni/platform_view_android_jni.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ class PlatformViewAndroidJNI {
int y,
int width,
int height) = 0;

//----------------------------------------------------------------------------
/// @brief Initiates a frame if using hybrid composition.
///
Expand All @@ -147,13 +146,6 @@ class PlatformViewAndroidJNI {
///
virtual void FlutterViewEndFrame() = 0;

//----------------------------------------------------------------------------
/// @brief Instantiates an overlay surface in hybrid composition.
///
/// @note Must be called from the platform thread.
///
virtual void FlutterViewCreateOverlaySurface() = 0;

//----------------------------------------------------------------------------
/// @brief Computes the locale Android would select.
///
Expand Down
32 changes: 0 additions & 32 deletions shell/platform/android/platform_view_android_jni_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include "flutter/shell/platform/android/android_shell_holder.h"
#include "flutter/shell/platform/android/apk_asset_provider.h"
#include "flutter/shell/platform/android/flutter_main.h"
#include "flutter/shell/platform/android/jni/platform_view_android_jni.h"
#include "flutter/shell/platform/android/platform_view_android.h"

#define ANDROID_SHELL_HOLDER \
Expand Down Expand Up @@ -81,8 +80,6 @@ static jmethodID g_on_first_frame_method = nullptr;

static jmethodID g_on_engine_restart_method = nullptr;

static jmethodID g_create_overlay_surface_method = nullptr;

static jmethodID g_on_begin_frame_method = nullptr;

static jmethodID g_on_end_frame_method = nullptr;
Expand Down Expand Up @@ -689,10 +686,6 @@ bool RegisterApi(JNIEnv* env) {
return false;
}

g_create_overlay_surface_method =
env->GetMethodID(g_flutter_jni_class->obj(), "createOverlaySurface",
"()Lio/flutter/embedding/engine/FlutterOverlaySurface;");

return true;
}

Expand All @@ -717,10 +710,6 @@ bool PlatformViewAndroid::Register(JNIEnv* env) {
return false;
}

g_create_overlay_surface_method =
env->GetMethodID(g_flutter_jni_class->obj(), "createOverlaySurface",
"()Lio/flutter/embedding/engine/FlutterOverlaySurface;");

g_flutter_jni_class = new fml::jni::ScopedJavaGlobalRef<jclass>(
env, env->FindClass("io/flutter/embedding/engine/FlutterJNI"));
if (g_flutter_jni_class->is_null()) {
Expand Down Expand Up @@ -752,14 +741,6 @@ bool PlatformViewAndroid::Register(JNIEnv* env) {
return false;
}

g_create_overlay_surface_method = env->GetMethodID(
g_flutter_jni_class->obj(), "createOverlaySurface", "()V");

if (g_create_overlay_surface_method == nullptr) {
FML_LOG(ERROR) << "Could not locate createOverlaySurface method";
return false;
}

g_on_display_overlay_surface_method = env->GetMethodID(
g_flutter_jni_class->obj(), "onDisplayOverlaySurface", "(IIIII)V");

Expand Down Expand Up @@ -1111,19 +1092,6 @@ void PlatformViewAndroidJNIImpl::FlutterViewEndFrame() {
FML_CHECK(CheckException(env));
}

void PlatformViewAndroidJNIImpl::FlutterViewCreateOverlaySurface() {
JNIEnv* env = fml::jni::AttachCurrentThread();

auto java_object = java_object_.get(env);
if (java_object.is_null()) {
return;
}

env->CallVoidMethod(java_object.obj(), g_create_overlay_surface_method);

FML_CHECK(CheckException(env));
}

std::unique_ptr<std::vector<std::string>>
PlatformViewAndroidJNIImpl::FlutterViewComputePlatformResolvedLocale(
std::vector<std::string> supported_locales_data) {
Expand Down
2 changes: 0 additions & 2 deletions shell/platform/android/platform_view_android_jni_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ class PlatformViewAndroidJNIImpl final : public PlatformViewAndroidJNI {

void FlutterViewEndFrame() override;

void FlutterViewCreateOverlaySurface() override;

std::unique_ptr<std::vector<std::string>>
FlutterViewComputePlatformResolvedLocale(
std::vector<std::string> supported_locales_data) override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,18 +201,4 @@ public void onEndFrame__callsPlatformViewsController() {
// --- Verify Results ---
verify(platformViewsController, times(1)).onEndFrame();
}

@Test
public void createOverlaySurface__callsPlatformViewsController() {
PlatformViewsController platformViewsController = mock(PlatformViewsController.class);

FlutterJNI flutterJNI = new FlutterJNI();
flutterJNI.setPlatformViewsController(platformViewsController);

// --- Execute Test ---
flutterJNI.createOverlaySurface();

// --- Verify Results ---
verify(platformViewsController, times(1)).createOverlaySurface();
}
}