From 8251f1c9056667aca13ffff0adc7be72ce3da427 Mon Sep 17 00:00:00 2001 From: Mike Armstrong Date: Tue, 6 Oct 2015 23:45:06 -0700 Subject: [PATCH] Systrace stub fixes Differential Revision: D2516670 fb-gh-sync-id: 89d7fdce569d4b37633fb4ab4acbeef707d54bac --- .../java/com/facebook/systrace/Systrace.java | 45 +++++++++++++++++++ .../com/facebook/systrace/TraceListener.java | 8 ++++ 2 files changed, 53 insertions(+) create mode 100644 ReactAndroid/src/main/java/com/facebook/systrace/TraceListener.java diff --git a/ReactAndroid/src/main/java/com/facebook/systrace/Systrace.java b/ReactAndroid/src/main/java/com/facebook/systrace/Systrace.java index 06a13ae97..e3642c478 100644 --- a/ReactAndroid/src/main/java/com/facebook/systrace/Systrace.java +++ b/ReactAndroid/src/main/java/com/facebook/systrace/Systrace.java @@ -15,6 +15,39 @@ package com.facebook.systrace; public class Systrace { public static final long TRACE_TAG_REACT_JAVA_BRIDGE = 0L; + public static final long TRACE_TAG_REACT_FRESCO = 0L; + + public enum EventScope { + THREAD('t'), + PROCESS('p'), + GLOBAL('g'); + + private final char mCode; + + private EventScope(char code) { + mCode = code; + } + + public char getCode() { + return mCode; + } + } + + public static void registerListener(TraceListener listener) { + } + + public static void unregisterListener(TraceListener listener) { + } + + public static boolean isTracing(long tag) { + return false; + } + + public static void traceInstant( + long tag, + final String title, + EventScope scope) { + } public static void beginSection(long tag, final String sectionName) { } @@ -22,6 +55,18 @@ public class Systrace { public static void endSection(long tag) { } + public static void beginAsyncSection( + long tag, + final String sectionName, + final int cookie) { + } + + public static void endAsyncSection( + long tag, + final String sectionName, + final int cookie) { + } + public static void traceCounter( long tag, final String counterName, diff --git a/ReactAndroid/src/main/java/com/facebook/systrace/TraceListener.java b/ReactAndroid/src/main/java/com/facebook/systrace/TraceListener.java new file mode 100644 index 000000000..d9f650d2d --- /dev/null +++ b/ReactAndroid/src/main/java/com/facebook/systrace/TraceListener.java @@ -0,0 +1,8 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +package com.facebook.systrace; + +public interface TraceListener { + void onTraceStarted(); + void onTraceStopped(); +}