From 4c7af2afe07ca4685aa66052f36c324d39417062 Mon Sep 17 00:00:00 2001 From: Amir Hardon Date: Tue, 13 Aug 2019 13:59:11 -0700 Subject: [PATCH 1/2] Apply the display listeners workaround on all Android versions prior to P --- packages/webview_flutter/CHANGELOG.md | 5 +++++ .../plugins/webviewflutter/DisplayListenerProxy.java | 7 ++++--- packages/webview_flutter/pubspec.yaml | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/webview_flutter/CHANGELOG.md b/packages/webview_flutter/CHANGELOG.md index 0bcb47f4cab3..38b344d88f34 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 9335f6f37fcf..a48dc821a212 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 @@ public void onDisplayChanged(int displayId) { @SuppressWarnings({"unchecked", "PrivateApi"}) private static ArrayList 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 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 5af01a9b0a1c..d2f6aa0e81e1 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 homepage: https://github.com/flutter/plugins/tree/master/packages/webview_flutter From 21ed9febbcbc395dbd62aa17419e133bac7364c6 Mon Sep 17 00:00:00 2001 From: Amir Hardon Date: Tue, 13 Aug 2019 14:04:17 -0700 Subject: [PATCH 2/2] fix comment --- .../io/flutter/plugins/webviewflutter/DisplayListenerProxy.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 a48dc821a212..1273e7349620 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 @@ -109,7 +109,7 @@ public void onDisplayChanged(int displayId) { private static ArrayList yoinkDisplayListeners(DisplayManager displayManager) { 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 the bug this code is working around was + // 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<>(); }