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

Commit 27936ad3 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Android (Google) Code Review
Browse files

Merge "Block loading WebView in privileged processes." into lmp-mr1-dev

parents 03dd6845 85844916
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -18,8 +18,8 @@ package android.webkit;

import android.annotation.SystemApi;
import android.app.ActivityManagerInternal;
import android.app.Application;
import android.app.AppGlobals;
import android.app.Application;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
@@ -34,14 +34,14 @@ import android.os.Trace;
import android.text.TextUtils;
import android.util.AndroidRuntimeException;
import android.util.Log;

import com.android.server.LocalServices;

import dalvik.system.VMRuntime;

import java.io.File;
import java.util.Arrays;

import com.android.internal.os.Zygote;

/**
 * Top level factory, used creating all the main WebView implementation classes.
 *
@@ -91,6 +91,12 @@ public final class WebViewFactory {
            // us honest and minimize usage of WebView internals when binding the proxy.
            if (sProviderInstance != null) return sProviderInstance;

            final int uid = android.os.Process.myUid();
            if (uid == android.os.Process.ROOT_UID || uid == android.os.Process.SYSTEM_UID) {
                throw new UnsupportedOperationException(
                        "For security reasons, WebView is not allowed in privileged processes");
            }

            Trace.traceBegin(Trace.TRACE_TAG_WEBVIEW, "WebViewFactory.getProvider()");
            try {
                Trace.traceBegin(Trace.TRACE_TAG_WEBVIEW, "WebViewFactory.loadNativeLibrary()");