Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e0930192 authored by Torne (Richard Coles)'s avatar Torne (Richard Coles) Committed by Android (Google) Code Review
Browse files

Merge "Store the WebView's package info." into lmp-dev

parents e9b78fdb 84392d74
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -72,12 +72,17 @@ public final class WebViewFactory {
    private static WebViewFactoryProvider sProviderInstance;
    private static final Object sProviderLock = new Object();
    private static boolean sAddressSpaceReserved = false;
    private static PackageInfo sPackageInfo;

    public static String getWebViewPackageName() {
        return AppGlobals.getInitialApplication().getString(
                com.android.internal.R.string.config_webViewPackageName);
    }

    public static PackageInfo getLoadedPackageInfo() {
        return sPackageInfo;
    }

    static WebViewFactoryProvider getProvider() {
        synchronized (sProviderLock) {
            // For now the main purpose of this function (and the factory abstraction) is to keep
@@ -125,9 +130,9 @@ public final class WebViewFactory {
        try {
            // First fetch the package info so we can log the webview package version.
            String packageName = getWebViewPackageName();
            PackageInfo pi = initialApplication.getPackageManager().getPackageInfo(packageName, 0);
            Log.i(LOGTAG, "Loading " + packageName + " version " + pi.versionName +
                          " (code " + pi.versionCode + ")");
            sPackageInfo = initialApplication.getPackageManager().getPackageInfo(packageName, 0);
            Log.i(LOGTAG, "Loading " + packageName + " version " + sPackageInfo.versionName +
                          " (code " + sPackageInfo.versionCode + ")");

            // Construct a package context to load the Java code into the current app.
            Context webViewContext = initialApplication.createPackageContext(packageName,