| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package com.android.webview.chromium; | 5 package com.android.webview.chromium; |
| 6 | 6 |
| 7 import android.Manifest; | 7 import android.Manifest; |
| 8 import android.app.ActivityManager; | 8 import android.app.ActivityManager; |
| 9 import android.content.ComponentCallbacks2; | 9 import android.content.ComponentCallbacks2; |
| 10 import android.content.Context; | 10 import android.content.Context; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 import org.chromium.base.PathService; | 57 import org.chromium.base.PathService; |
| 58 import org.chromium.base.PathUtils; | 58 import org.chromium.base.PathUtils; |
| 59 import org.chromium.base.ThreadUtils; | 59 import org.chromium.base.ThreadUtils; |
| 60 import org.chromium.base.TraceEvent; | 60 import org.chromium.base.TraceEvent; |
| 61 import org.chromium.base.annotations.SuppressFBWarnings; | 61 import org.chromium.base.annotations.SuppressFBWarnings; |
| 62 import org.chromium.base.library_loader.LibraryLoader; | 62 import org.chromium.base.library_loader.LibraryLoader; |
| 63 import org.chromium.base.library_loader.LibraryProcessType; | 63 import org.chromium.base.library_loader.LibraryProcessType; |
| 64 import org.chromium.base.library_loader.NativeLibraries; | 64 import org.chromium.base.library_loader.NativeLibraries; |
| 65 import org.chromium.base.library_loader.ProcessInitException; | 65 import org.chromium.base.library_loader.ProcessInitException; |
| 66 import org.chromium.content.browser.ContentViewStatics; | 66 import org.chromium.content.browser.ContentViewStatics; |
| 67 import org.chromium.content.browser.input.LGEmailActionModeWorkaround; |
| 67 import org.chromium.net.NetworkChangeNotifier; | 68 import org.chromium.net.NetworkChangeNotifier; |
| 68 | 69 |
| 69 import java.io.File; | 70 import java.io.File; |
| 70 import java.util.Queue; | 71 import java.util.Queue; |
| 71 import java.util.concurrent.Callable; | 72 import java.util.concurrent.Callable; |
| 72 import java.util.concurrent.ConcurrentLinkedQueue; | 73 import java.util.concurrent.ConcurrentLinkedQueue; |
| 73 import java.util.concurrent.FutureTask; | 74 import java.util.concurrent.FutureTask; |
| 74 import java.util.concurrent.TimeUnit; | 75 import java.util.concurrent.TimeUnit; |
| 75 | 76 |
| 76 /** | 77 /** |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 @Override | 550 @Override |
| 550 public WebViewProvider createWebView(WebView webView, WebView.PrivateAccess
privateAccess) { | 551 public WebViewProvider createWebView(WebView webView, WebView.PrivateAccess
privateAccess) { |
| 551 return new WebViewChromium(this, webView, privateAccess, mShouldDisableT
hreadChecking); | 552 return new WebViewChromium(this, webView, privateAccess, mShouldDisableT
hreadChecking); |
| 552 } | 553 } |
| 553 | 554 |
| 554 // Workaround for IME thread crashes on grandfathered OEM apps. | 555 // Workaround for IME thread crashes on grandfathered OEM apps. |
| 555 private boolean shouldDisableThreadChecking(Context context) { | 556 private boolean shouldDisableThreadChecking(Context context) { |
| 556 String appName = context.getPackageName(); | 557 String appName = context.getPackageName(); |
| 557 int versionCode = PackageUtils.getPackageVersion(context, appName); | 558 int versionCode = PackageUtils.getPackageVersion(context, appName); |
| 558 int appTargetSdkVersion = context.getApplicationInfo().targetSdkVersion; | 559 int appTargetSdkVersion = context.getApplicationInfo().targetSdkVersion; |
| 560 if (versionCode == -1) return false; |
| 559 | 561 |
| 560 boolean shouldDisable = false; | 562 boolean shouldDisable = false; |
| 561 | 563 |
| 562 // crbug.com/651706 | 564 // crbug.com/651706 |
| 563 final String lgeMailPackageId = "com.lge.email"; | 565 final String lgeMailPackageId = "com.lge.email"; |
| 564 if (lgeMailPackageId.equals(appName)) { | 566 if (lgeMailPackageId.equals(appName)) { |
| 565 // The version code is provided by LGE. | 567 if (appTargetSdkVersion > Build.VERSION_CODES.N) return false; |
| 566 if (versionCode == -1 || versionCode >= 67700000) return false; | 568 // This is the last broken version shipped on LG V20/NRD90M. |
| 569 if (versionCode > LGEmailActionModeWorkaround.LGEmailWorkaroundMaxVe
rsion) return false; |
| 567 shouldDisable = true; | 570 shouldDisable = true; |
| 568 } | 571 } |
| 569 | 572 |
| 570 // crbug.com/655759 | 573 // crbug.com/655759 |
| 571 // Also want to cover ".att" variant suffix package name. | 574 // Also want to cover ".att" variant suffix package name. |
| 572 final String yahooMailPackageId = "com.yahoo.mobile.client.android.mail"
; | 575 final String yahooMailPackageId = "com.yahoo.mobile.client.android.mail"
; |
| 573 if (appName.startsWith(yahooMailPackageId)) { | 576 if (appName.startsWith(yahooMailPackageId)) { |
| 574 if (appTargetSdkVersion > Build.VERSION_CODES.M) return false; | 577 if (appTargetSdkVersion > Build.VERSION_CODES.M) return false; |
| 575 if (versionCode == -1 || versionCode > 1315849) return false; | 578 if (versionCode > 1315849) return false; |
| 576 shouldDisable = true; | 579 shouldDisable = true; |
| 577 } | 580 } |
| 578 | 581 |
| 579 // crbug.com/622151 | 582 // crbug.com/622151 |
| 580 final String htcMailPackageId = "com.htc.android.mail"; | 583 final String htcMailPackageId = "com.htc.android.mail"; |
| 581 if (htcMailPackageId.equals(appName)) { | 584 if (htcMailPackageId.equals(appName)) { |
| 582 if (appTargetSdkVersion > Build.VERSION_CODES.M) return false; | 585 if (appTargetSdkVersion > Build.VERSION_CODES.M) return false; |
| 583 if (versionCode == -1) return false; | |
| 584 // This value is provided by HTC. | 586 // This value is provided by HTC. |
| 585 if (versionCode >= 866001861) return false; | 587 if (versionCode >= 866001861) return false; |
| 586 shouldDisable = true; | 588 shouldDisable = true; |
| 587 } | 589 } |
| 588 | 590 |
| 589 if (shouldDisable) { | 591 if (shouldDisable) { |
| 590 Log.w(TAG, "Disabling thread check in WebView. " | 592 Log.w(TAG, "Disabling thread check in WebView. " |
| 591 + "APK name: " + appName + ", versionCode: " + versi
onCode | 593 + "APK name: " + appName + ", versionCode: " + versi
onCode |
| 592 + ", targetSdkVersion: " + appTargetSdkVersion); | 594 + ", targetSdkVersion: " + appTargetSdkVersion); |
| 593 } | 595 } |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 669 WebViewDelegate getWebViewDelegate() { | 671 WebViewDelegate getWebViewDelegate() { |
| 670 return mWebViewDelegate; | 672 return mWebViewDelegate; |
| 671 } | 673 } |
| 672 | 674 |
| 673 // The method to support unreleased Android. | 675 // The method to support unreleased Android. |
| 674 WebViewContentsClientAdapter createWebViewContentsClientAdapter(WebView webV
iew, | 676 WebViewContentsClientAdapter createWebViewContentsClientAdapter(WebView webV
iew, |
| 675 Context context) { | 677 Context context) { |
| 676 return new WebViewContentsClientAdapter(webView, context, mWebViewDelega
te); | 678 return new WebViewContentsClientAdapter(webView, context, mWebViewDelega
te); |
| 677 } | 679 } |
| 678 } | 680 } |
| OLD | NEW |