OSDN Git Service

WebView: require APKs to target OMR1
authorNate Fischer <ntfschr@google.com>
Mon, 28 Aug 2017 19:15:56 +0000 (12:15 -0700)
committerNate Fischer <ntfschr@google.com>
Mon, 28 Aug 2017 19:15:56 +0000 (12:15 -0700)
This disallows WebView/Monochrome APKs targeting O or below to be chosen
as WebView providers.

Bug: 65080651
Test: Open WebView shell with webview from system image, no crash
Test: Install Monochrome compiled for O, it's not in the webview provider list
Change-Id: I79162cedaa801ce227ad4c2eb3cbea9c08704da8

core/java/android/webkit/UserPackage.java

index 8920089..9da6455 100644 (file)
@@ -83,7 +83,7 @@ public class UserPackage {
      * supported by the current framework version.
      */
     public static boolean hasCorrectTargetSdkVersion(PackageInfo packageInfo) {
-        return packageInfo.applicationInfo.targetSdkVersion >= Build.VERSION_CODES.O;
+        return packageInfo.applicationInfo.targetSdkVersion >= Build.VERSION_CODES.O_MR1;
     }
 
     public UserInfo getUserInfo() {