Commit d71aa0d9 authored by Clark DuVall's avatar Clark DuVall Committed by Commit Bot

[WebLayer] Ignore strict mode violations from createContextForSplit()

This method may try to access the dex file, so ignore strict mode
violations.

Bug: 1105096
Change-Id: I4afe88888ec8de39e7c4ea9c1ee89e1dba9ce2f4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2404379Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Clark DuVall <cduvall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#806239}
parent f10c723b
......@@ -15,6 +15,7 @@ import android.view.Display;
import android.view.View;
import android.view.Window;
import org.chromium.base.StrictModeContext;
import org.chromium.base.annotations.VerifiesOnO;
/**
......@@ -65,6 +66,8 @@ public final class ApiHelperForO {
/** See {@link Context.createContextForSplit(String) }. */
public static Context createContextForSplit(Context context, String name)
throws PackageManager.NameNotFoundException {
return context.createContextForSplit(name);
try (StrictModeContext ignored = StrictModeContext.allowDiskReads()) {
return context.createContextForSplit(name);
}
}
}
......@@ -13,6 +13,7 @@ import android.os.Build;
import android.os.Bundle;
import android.os.IBinder;
import android.os.RemoteException;
import android.os.StrictMode;
import android.util.AndroidRuntimeException;
import android.util.Log;
import android.webkit.ValueCallback;
......@@ -710,7 +711,12 @@ public class WebLayer {
/** See {@link Context.createContextForSplit(String) }. */
public static Context createContextForSplit(Context context, String name)
throws PackageManager.NameNotFoundException {
return context.createContextForSplit(name);
StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskReads();
try {
return context.createContextForSplit(name);
} finally {
StrictMode.setThreadPolicy(oldPolicy);
}
}
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment