Commit 13f7d65e authored by Andrew Grieve's avatar Andrew Grieve Committed by Commit Bot

Android: Do not call getProcessName() from initApplicationContext()

In cronet, initApplicationContext() is not guaranteed to be called from
the UI thread.

NOTRY=true  # time sensitive. bot timeout unrelated.

Bug: 825920
Change-Id: I85a8a9560fee726268637ac96d87d7637407f50a
Reviewed-on: https://chromium-review.googlesource.com/980586
Commit-Queue: agrieve <agrieve@chromium.org>
Reviewed-by: default avatarYaron Friedman <yfriedman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#545889}
parent 61612964
......@@ -134,9 +134,6 @@ public class ContextUtils {
throw new RuntimeException("Global application context cannot be set to null.");
}
sApplicationContext = appContext;
// TODO(agrieve): Remove when we stop supporting JB.
getProcessName(); // Prime the cache for getProcessName().
}
/**
......@@ -171,6 +168,8 @@ public class ContextUtils {
/** @return The name of the current process. E.g. "org.chromium.chrome:privileged_process0". */
public static String getProcessName() {
// Once we drop support JB, this method can be simplified to not cache sProcessName and call
// ActivityThread.currentProcessName().
if (sProcessName != null) {
return sProcessName;
}
......
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