From 1ad3955a6008f5f442fa5eb0adf7c4e6ba2f17cd Mon Sep 17 00:00:00 2001 From: Michael Wright Date: Wed, 27 Apr 2016 13:07:18 -0400 Subject: [PATCH] Remove onUhandledInputEvent API. This callback was never used by WebView and anyone that overrides it is going to just be broken since we never actually call into it from the method that WebView does call. Furthermore, the WebView team has decided that the API has too many complications to ever implement, the most notable of which is that MotionEvents tend to come in streams that would need to be buffered in order to detect the event before it can be determined whether they were handled or not which means that any uses of the API are inevitably going to be janky experiences. Bug: 14279909 Change-Id: I068601ce947bccacabfe55b86b06005449b65bcf --- api/current.txt | 3 +-- api/removed.txt | 8 ++++++++ api/system-current.txt | 3 +-- api/system-removed.txt | 8 ++++++++ api/test-current.txt | 3 +-- api/test-removed.txt | 8 ++++++++ core/java/android/webkit/WebViewClient.java | 3 +-- 7 files changed, 28 insertions(+), 8 deletions(-) diff --git a/api/current.txt b/api/current.txt index cc3b0852f2608..214e56e38ac6e 100644 --- a/api/current.txt +++ b/api/current.txt @@ -45774,8 +45774,7 @@ package android.webkit { method public void onReceivedSslError(android.webkit.WebView, android.webkit.SslErrorHandler, android.net.http.SslError); method public void onScaleChanged(android.webkit.WebView, float, float); method public deprecated void onTooManyRedirects(android.webkit.WebView, android.os.Message, android.os.Message); - method public void onUnhandledInputEvent(android.webkit.WebView, android.view.InputEvent); - method public deprecated void onUnhandledKeyEvent(android.webkit.WebView, android.view.KeyEvent); + method public void onUnhandledKeyEvent(android.webkit.WebView, android.view.KeyEvent); method public deprecated android.webkit.WebResourceResponse shouldInterceptRequest(android.webkit.WebView, java.lang.String); method public android.webkit.WebResourceResponse shouldInterceptRequest(android.webkit.WebView, android.webkit.WebResourceRequest); method public boolean shouldOverrideKeyEvent(android.webkit.WebView, android.view.KeyEvent); diff --git a/api/removed.txt b/api/removed.txt index de8a7244d388e..94bba439bc6f5 100644 --- a/api/removed.txt +++ b/api/removed.txt @@ -427,6 +427,14 @@ package android.view { } +package android.webkit { + + public class WebViewClient { + method public void onUnhandledInputEvent(android.webkit.WebView, android.view.InputEvent); + } + +} + package android.widget { public class TextView extends android.view.View implements android.view.ViewTreeObserver.OnPreDrawListener { diff --git a/api/system-current.txt b/api/system-current.txt index e05d9fe07a2f5..adec9f8c48a26 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -48853,8 +48853,7 @@ package android.webkit { method public void onReceivedSslError(android.webkit.WebView, android.webkit.SslErrorHandler, android.net.http.SslError); method public void onScaleChanged(android.webkit.WebView, float, float); method public deprecated void onTooManyRedirects(android.webkit.WebView, android.os.Message, android.os.Message); - method public void onUnhandledInputEvent(android.webkit.WebView, android.view.InputEvent); - method public deprecated void onUnhandledKeyEvent(android.webkit.WebView, android.view.KeyEvent); + method public void onUnhandledKeyEvent(android.webkit.WebView, android.view.KeyEvent); method public deprecated android.webkit.WebResourceResponse shouldInterceptRequest(android.webkit.WebView, java.lang.String); method public android.webkit.WebResourceResponse shouldInterceptRequest(android.webkit.WebView, android.webkit.WebResourceRequest); method public boolean shouldOverrideKeyEvent(android.webkit.WebView, android.view.KeyEvent); diff --git a/api/system-removed.txt b/api/system-removed.txt index 844604ce15109..232c7c9921fe8 100644 --- a/api/system-removed.txt +++ b/api/system-removed.txt @@ -425,6 +425,14 @@ package android.view { } +package android.webkit { + + public class WebViewClient { + method public void onUnhandledInputEvent(android.webkit.WebView, android.view.InputEvent); + } + +} + package android.widget { public class TextView extends android.view.View implements android.view.ViewTreeObserver.OnPreDrawListener { diff --git a/api/test-current.txt b/api/test-current.txt index 39d69f3011f38..435044e653d20 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -45851,8 +45851,7 @@ package android.webkit { method public void onReceivedSslError(android.webkit.WebView, android.webkit.SslErrorHandler, android.net.http.SslError); method public void onScaleChanged(android.webkit.WebView, float, float); method public deprecated void onTooManyRedirects(android.webkit.WebView, android.os.Message, android.os.Message); - method public void onUnhandledInputEvent(android.webkit.WebView, android.view.InputEvent); - method public deprecated void onUnhandledKeyEvent(android.webkit.WebView, android.view.KeyEvent); + method public void onUnhandledKeyEvent(android.webkit.WebView, android.view.KeyEvent); method public deprecated android.webkit.WebResourceResponse shouldInterceptRequest(android.webkit.WebView, java.lang.String); method public android.webkit.WebResourceResponse shouldInterceptRequest(android.webkit.WebView, android.webkit.WebResourceRequest); method public boolean shouldOverrideKeyEvent(android.webkit.WebView, android.view.KeyEvent); diff --git a/api/test-removed.txt b/api/test-removed.txt index de8a7244d388e..94bba439bc6f5 100644 --- a/api/test-removed.txt +++ b/api/test-removed.txt @@ -427,6 +427,14 @@ package android.view { } +package android.webkit { + + public class WebViewClient { + method public void onUnhandledInputEvent(android.webkit.WebView, android.view.InputEvent); + } + +} + package android.widget { public class TextView extends android.view.View implements android.view.ViewTreeObserver.OnPreDrawListener { diff --git a/core/java/android/webkit/WebViewClient.java b/core/java/android/webkit/WebViewClient.java index 8318656342d76..76d3fb15d0496 100644 --- a/core/java/android/webkit/WebViewClient.java +++ b/core/java/android/webkit/WebViewClient.java @@ -403,9 +403,7 @@ public class WebViewClient { * * @param view The WebView that is initiating the callback. * @param event The key event. - * @deprecated This method is subsumed by the more generic onUnhandledInputEvent. */ - @Deprecated public void onUnhandledKeyEvent(WebView view, KeyEvent event) { onUnhandledInputEventInternal(view, event); } @@ -427,6 +425,7 @@ public class WebViewClient { * * @param view The WebView that is initiating the callback. * @param event The input event. + * @removed */ public void onUnhandledInputEvent(WebView view, InputEvent event) { if (event instanceof KeyEvent) {