Index: android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java |
diff --git a/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java b/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java |
index 0ea08497cb7717c0143ce83d383b73c463d12917..66779333e88e2b0175f4f0dcb441510308e16486 100644 |
--- a/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java |
+++ b/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java |
@@ -1695,8 +1695,7 @@ class WebViewChromium implements WebViewProvider, WebViewProvider.ScrollDelegate |
mAwContents.setLayoutParams(layoutParams); |
} |
- // Overrides WebViewProvider.ViewDelegate.onActivityResult (not in system api jar yet). |
- // crbug.com/543272. |
+ @Override |
public void onActivityResult(final int requestCode, final int resultCode, final Intent data) { |
if (checkNeedsPost()) { |
mFactory.addTask(new Runnable() { |
@@ -1730,8 +1729,7 @@ class WebViewChromium implements WebViewProvider, WebViewProvider.ScrollDelegate |
mAwContents.onConfigurationChanged(newConfig); |
} |
- //TODO(hush): add override after release. |
- //@Override |
+ @Override |
public boolean onDragEvent(final DragEvent event) { |
mFactory.startYourEngines(false); |
if (checkNeedsPost()) { |
@@ -2213,14 +2211,16 @@ class WebViewChromium implements WebViewProvider, WebViewProvider.ScrollDelegate |
@Override |
public void super_startActivityForResult(Intent intent, int requestCode) { |
- // TODO(hush): Use mWebViewPrivate.super_startActivityForResult |
- // after N release. crbug.com/543272. |
- try { |
- Method startActivityForResultMethod = |
- View.class.getMethod("startActivityForResult", Intent.class, int.class); |
- startActivityForResultMethod.invoke(mWebView, intent, requestCode); |
- } catch (Exception e) { |
- throw new RuntimeException("Invalid reflection", e); |
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { |
+ mWebViewPrivate.super_startActivityForResult(intent, requestCode); |
+ } else { |
+ try { |
+ Method startActivityForResultMethod = |
+ View.class.getMethod("startActivityForResult", Intent.class, int.class); |
+ startActivityForResultMethod.invoke(mWebView, intent, requestCode); |
+ } catch (Exception e) { |
+ throw new RuntimeException("Invalid reflection", e); |
+ } |
} |
} |