Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(319)

Unified Diff: base/android/java/src/org/chromium/base/TraceEvent.java

Issue 2380563003: Fix Chromium tracing to not override app logging (Closed)
Patch Set: Improving comment Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/java/src/org/chromium/base/TraceEvent.java
diff --git a/base/android/java/src/org/chromium/base/TraceEvent.java b/base/android/java/src/org/chromium/base/TraceEvent.java
index 95d01dcef21e26d75c3c8d57c0d25eb7ed56e0ff..96ff10e9c611074efee6b3004ae1b7eeb6189bff 100644
--- a/base/android/java/src/org/chromium/base/TraceEvent.java
+++ b/base/android/java/src/org/chromium/base/TraceEvent.java
@@ -180,11 +180,16 @@ public class TraceEvent {
@CalledByNative
public static void setEnabled(boolean enabled) {
if (enabled) EarlyTraceEvent.disable();
- sEnabled = enabled;
- // Android M+ systrace logs this on its own. Only log it if not writing to Android systrace.
- if (sATraceEnabled) return;
- ThreadUtils.getUiThreadLooper().setMessageLogging(
- enabled ? LooperMonitorHolder.sInstance : null);
+ // Only disable logging if Chromium enabled it originally, so as to not disrupt logging done
+ // by other applications
+ if (sEnabled != enabled) {
+ sEnabled = enabled;
+ // Android M+ systrace logs this on its own. Only log it if not writing to Android
+ // systrace.
+ if (sATraceEnabled) return;
+ ThreadUtils.getUiThreadLooper().setMessageLogging(
+ enabled ? LooperMonitorHolder.sInstance : null);
+ }
}
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698