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

Commit ab5d0ba2 authored by Torne (Richard Coles)'s avatar Torne (Richard Coles)
Browse files

resolve merge conflicts of 0d16fa40 to master

Change-Id: I3c01fe6f5439885d28c6d28415004b26845f06b0
parents 3f2e215c 0d16fa40
Loading
Loading
Loading
Loading
+16 −2
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.pm.UserInfo;
import android.content.res.XmlResourceParser;
import android.database.ContentObserver;
import android.os.Build;
import android.os.RemoteException;
import android.os.UserHandle;
@@ -270,8 +271,21 @@ public class SystemImpl implements SystemInterface {
    }

    @Override
    public void setMultiprocessEnabled(boolean enabled) {
        WebViewZygote.setMultiprocessEnabled(enabled);
    public void setMultiProcessEnabledFromContext(Context context) {
        boolean enableMultiProcess = false;
        try {
            enableMultiProcess = Settings.Global.getInt(context.getContentResolver(),
                    Settings.Global.WEBVIEW_MULTIPROCESS) == 1;
        } catch (Settings.SettingNotFoundException ex) {
        }
        WebViewZygote.setMultiprocessEnabled(enableMultiProcess);
    }

    @Override
    public void registerContentObserver(Context context, ContentObserver contentObserver) {
        context.getContentResolver().registerContentObserver(
                Settings.Global.getUriFor(Settings.Global.WEBVIEW_MULTIPROCESS),
                false, contentObserver);
    }

    // flags declaring we want extra info from the package manager for webview providers
+3 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.server.webkit;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager.NameNotFoundException;
import android.database.ContentObserver;
import android.webkit.WebViewProviderInfo;

/**
@@ -49,5 +50,6 @@ public interface SystemInterface {
    public PackageInfo getPackageInfoForProvider(WebViewProviderInfo configInfo)
            throws NameNotFoundException;

    public void setMultiprocessEnabled(boolean enabled);
    public void setMultiProcessEnabledFromContext(Context context);
    public void registerContentObserver(Context context, ContentObserver contentObserver);
}
+3 −18
Original line number Diff line number Diff line
@@ -20,12 +20,10 @@ import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.pm.Signature;
import android.content.ContentResolver;
import android.database.ContentObserver;
import android.net.Uri;
import android.os.Handler;
import android.os.UserHandle;
import android.provider.Settings;
import android.util.Base64;
import android.util.Slog;
import android.webkit.WebViewFactory;
@@ -79,7 +77,7 @@ public class WebViewUpdateServiceImpl {
    private SystemInterface mSystemInterface;
    private WebViewUpdater mWebViewUpdater;
    private SettingsObserver mSettingsObserver;
    private Context mContext;
    final private Context mContext;

    public WebViewUpdateServiceImpl(Context context, SystemInterface systemInterface) {
        mContext = context;
@@ -725,15 +723,10 @@ public class WebViewUpdateServiceImpl {
     * appropriately.
     */
    private class SettingsObserver extends ContentObserver {
        private final ContentResolver mResolver;

        SettingsObserver() {
            super(new Handler());

            mResolver = mContext.getContentResolver();
            mResolver.registerContentObserver(
                    Settings.Global.getUriFor(Settings.Global.WEBVIEW_MULTIPROCESS),
                    false, this);
            mSystemInterface.registerContentObserver(mContext, this);

            // Push the current value of the setting immediately.
            notifyZygote();
@@ -745,15 +738,7 @@ public class WebViewUpdateServiceImpl {
        }

        private void notifyZygote() {
            boolean enableMultiprocess = false;

            try {
                enableMultiprocess = Settings.Global.getInt(mResolver,
                        Settings.Global.WEBVIEW_MULTIPROCESS) == 1;
            } catch (Settings.SettingNotFoundException ex) {
            }

            mSystemInterface.setMultiprocessEnabled(enableMultiprocess);
            mSystemInterface.setMultiProcessEnabledFromContext(mContext);
        }
    }
}
+5 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.server.webkit;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager.NameNotFoundException;
import android.database.ContentObserver;
import android.webkit.WebViewProviderInfo;

import java.util.HashMap;
@@ -120,5 +121,8 @@ public class TestSystemImpl implements SystemInterface {
    }

    @Override
    public void setMultiprocessEnabled(boolean enabled) {}
    public void setMultiProcessEnabledFromContext(Context context) {}

    @Override
    public void registerContentObserver(Context context, ContentObserver contentObserver) {}
}
+93 −31

File changed.

Preview size limit exceeded, changes collapsed.