[webview_flutter] Workaround display listeners bug on all Android versions prior to P (#1975)
Apply the display listeners workaround on all Android versions prior to P
diff --git a/packages/webview_flutter/CHANGELOG.md b/packages/webview_flutter/CHANGELOG.md
index 0bcb47f..38b344d 100644
--- a/packages/webview_flutter/CHANGELOG.md
+++ b/packages/webview_flutter/CHANGELOG.md
@@ -1,3 +1,8 @@
+## 0.3.11+3
+
+* Apply the display listeners workaround that was shipped in 0.3.11+1 on
+ all Android versions prior to P.
+
## 0.3.11+2
* Add fix for input connection being dropped after a screen resize on certain
diff --git a/packages/webview_flutter/android/src/main/java/io/flutter/plugins/webviewflutter/DisplayListenerProxy.java b/packages/webview_flutter/android/src/main/java/io/flutter/plugins/webviewflutter/DisplayListenerProxy.java
index 9335f6f..1273e73 100644
--- a/packages/webview_flutter/android/src/main/java/io/flutter/plugins/webviewflutter/DisplayListenerProxy.java
+++ b/packages/webview_flutter/android/src/main/java/io/flutter/plugins/webviewflutter/DisplayListenerProxy.java
@@ -107,9 +107,10 @@
@SuppressWarnings({"unchecked", "PrivateApi"})
private static ArrayList<DisplayListener> yoinkDisplayListeners(DisplayManager displayManager) {
- if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
- // We cannot use reflection on Android O, but it shouldn't matter as it shipped
- // with a WebView version that has the bug this code is working around fixed.
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
+ // We cannot use reflection on Android P, but it shouldn't matter as it shipped
+ // with WebView 66.0.3359.158 and the WebView version the bug this code is working around was
+ // fixed in 61.0.3116.0.
return new ArrayList<>();
}
try {
diff --git a/packages/webview_flutter/pubspec.yaml b/packages/webview_flutter/pubspec.yaml
index 5af01a9..d2f6aa0 100644
--- a/packages/webview_flutter/pubspec.yaml
+++ b/packages/webview_flutter/pubspec.yaml
@@ -1,6 +1,6 @@
name: webview_flutter
description: A Flutter plugin that provides a WebView widget on Android and iOS.
-version: 0.3.11+2
+version: 0.3.11+3
author: Flutter Team <flutter-dev@googlegroups.com>
homepage: https://github.com/flutter/plugins/tree/master/packages/webview_flutter