Merge "Do not allow WebView instantiation from privileged processes."

This commit is contained in:
TreeHugger Robot
2017-03-21 13:25:19 +00:00
committed by Android (Google) Code Review

View File

@@ -198,7 +198,9 @@ public final class WebViewFactory {
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) {
if (uid == android.os.Process.ROOT_UID || uid == android.os.Process.SYSTEM_UID
|| uid == android.os.Process.PHONE_UID || uid == android.os.Process.NFC_UID
|| uid == android.os.Process.BLUETOOTH_UID) {
throw new UnsupportedOperationException(
"For security reasons, WebView is not allowed in privileged processes");
}