Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bfd30802 authored by Tim Volodine's avatar Tim Volodine Committed by Android (Google) Code Review
Browse files

Merge "WebView Tracing API: address comments from the API council."

parents 8b049b30 88604f2f
Loading
Loading
Loading
Loading
+21 −25
Original line number Original line Diff line number Diff line
@@ -50766,41 +50766,37 @@ package android.webkit {
  }
  }
  public class TracingConfig {
  public class TracingConfig {
    ctor public TracingConfig(int);
    method public java.util.List<java.lang.String> getCustomIncludedCategories();
    ctor public TracingConfig(int, java.lang.String, int);
    method public int getPredefinedCategories();
    method public java.lang.String getCustomCategoryPattern();
    method public int getPresetCategories();
    method public int getTracingMode();
    method public int getTracingMode();
    field public static final int CATEGORIES_FRAME_VIEWER = 4; // 0x4
    field public static final int CATEGORIES_ALL = 1; // 0x1
    field public static final int CATEGORIES_INPUT_LATENCY = 1; // 0x1
    field public static final int CATEGORIES_ANDROID_WEBVIEW = 2; // 0x2
    field public static final int CATEGORIES_JAVASCRIPT_AND_RENDERING = 3; // 0x3
    field public static final int CATEGORIES_FRAME_VIEWER = 64; // 0x40
    field public static final int CATEGORIES_NONE = -1; // 0xffffffff
    field public static final int CATEGORIES_INPUT_LATENCY = 8; // 0x8
    field public static final int CATEGORIES_RENDERING = 2; // 0x2
    field public static final int CATEGORIES_JAVASCRIPT_AND_RENDERING = 32; // 0x20
    field public static final int CATEGORIES_WEB_DEVELOPER = 0; // 0x0
    field public static final int CATEGORIES_NONE = 0; // 0x0
    field public static final int CATEGORIES_RENDERING = 16; // 0x10
    field public static final int CATEGORIES_WEB_DEVELOPER = 4; // 0x4
    field public static final int RECORD_CONTINUOUSLY = 1; // 0x1
    field public static final int RECORD_CONTINUOUSLY = 1; // 0x1
    field public static final int RECORD_TO_CONSOLE = 3; // 0x3
    field public static final int RECORD_UNTIL_FULL = 0; // 0x0
    field public static final int RECORD_UNTIL_FULL = 0; // 0x0
    field public static final int RECORD_UNTIL_FULL_LARGE_BUFFER = 2; // 0x2
    field public static final int RECORD_UNTIL_FULL_LARGE_BUFFER = 2; // 0x2
  }
  }
  public static class TracingConfig.Builder {
    ctor public TracingConfig.Builder();
    method public android.webkit.TracingConfig.Builder addCategories(int...);
    method public android.webkit.TracingConfig.Builder addCategories(java.lang.String...);
    method public android.webkit.TracingConfig.Builder addCategories(java.util.Collection<java.lang.String>);
    method public android.webkit.TracingConfig build();
    method public android.webkit.TracingConfig.Builder setTracingMode(int);
  }
  public abstract class TracingController {
  public abstract class TracingController {
    ctor public TracingController();
    ctor public TracingController();
    method public static android.webkit.TracingController getInstance();
    method public static android.webkit.TracingController getInstance();
    method public abstract boolean isTracing();
    method public abstract boolean isTracing();
    method public abstract boolean start(android.webkit.TracingConfig);
    method public abstract void start(android.webkit.TracingConfig);
    method public abstract boolean stop();
    method public abstract boolean stop(java.io.OutputStream, java.util.concurrent.Executor);
    method public abstract boolean stopAndFlush(android.webkit.TracingController.TracingOutputStream, android.os.Handler);
  }
  public static abstract interface TracingController.TracingOutputStream {
    method public abstract void complete();
    method public abstract void write(byte[]);
  }
  public class TracingFileOutputStream implements android.webkit.TracingController.TracingOutputStream {
    ctor public TracingFileOutputStream(java.lang.String) throws java.io.FileNotFoundException;
    method public void complete();
    method public void write(byte[]);
  }
  }
  public final class URLUtil {
  public final class URLUtil {
+160 −99
Original line number Original line Diff line number Diff line
@@ -21,61 +21,76 @@ import android.annotation.NonNull;


import java.lang.annotation.Retention;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;


/**
/**
 * Holds tracing configuration information and predefined settings.
 * Holds tracing configuration information and predefined settings.
 */
 */
public class TracingConfig {
public class TracingConfig {


    private final String mCustomCategoryPattern;
    private @PredefinedCategories int mPredefinedCategories;
    private final @PresetCategories int mPresetCategories;
    private final List<String> mCustomIncludedCategories = new ArrayList<String>();
    private @TracingMode int mTracingMode;
    private @TracingMode int mTracingMode;


    /** @hide */
    /** @hide */
    @IntDef({CATEGORIES_NONE, CATEGORIES_WEB_DEVELOPER, CATEGORIES_INPUT_LATENCY,
    @IntDef(flag = true, value = {CATEGORIES_NONE, CATEGORIES_WEB_DEVELOPER,
            CATEGORIES_RENDERING, CATEGORIES_JAVASCRIPT_AND_RENDERING, CATEGORIES_FRAME_VIEWER})
            CATEGORIES_INPUT_LATENCY, CATEGORIES_RENDERING, CATEGORIES_JAVASCRIPT_AND_RENDERING,
            CATEGORIES_FRAME_VIEWER})
    @Retention(RetentionPolicy.SOURCE)
    @Retention(RetentionPolicy.SOURCE)
    public @interface PresetCategories {}
    public @interface PredefinedCategories {}


    /**
    /**
     * Indicates that there are no preset categories.
     * Indicates that there are no predefined categories.
     */
     */
    public static final int CATEGORIES_NONE = -1;
    public static final int CATEGORIES_NONE = 0;


    /**
    /**
     * Predefined categories typically useful for web developers.
     * Predefined set of categories, includes all categories enabled by default in chromium.
     * Use with caution: this setting may produce large trace output.
     */
    public static final int CATEGORIES_ALL = 1 << 0;

    /**
     * Predefined set of categories typically useful for analyzing WebViews.
     * Typically includes android_webview and Java.
     */
    public static final int CATEGORIES_ANDROID_WEBVIEW = 1 << 1;

    /**
     * Predefined set of categories typically useful for web developers.
     * Typically includes blink, compositor, renderer.scheduler and v8 categories.
     * Typically includes blink, compositor, renderer.scheduler and v8 categories.
     */
     */
    public static final int CATEGORIES_WEB_DEVELOPER = 0;
    public static final int CATEGORIES_WEB_DEVELOPER = 1 << 2;


    /**
    /**
     * Predefined categories for analyzing input latency issues.
     * Predefined set of categories for analyzing input latency issues.
     * Typically includes input, renderer.scheduler categories.
     * Typically includes input, renderer.scheduler categories.
     */
     */
    public static final int CATEGORIES_INPUT_LATENCY = 1;
    public static final int CATEGORIES_INPUT_LATENCY = 1 << 3;


    /**
    /**
     * Predefined categories for analyzing rendering issues.
     * Predefined set of categories for analyzing rendering issues.
     * Typically includes blink, compositor and gpu categories.
     * Typically includes blink, compositor and gpu categories.
     */
     */
    public static final int CATEGORIES_RENDERING = 2;
    public static final int CATEGORIES_RENDERING = 1 << 4;


    /**
    /**
     * Predefined categories for analyzing javascript and rendering issues.
     * Predefined set of categories for analyzing javascript and rendering issues.
     * Typically includes blink, compositor, gpu, renderer.schduler and v8 categories.
     * Typically includes blink, compositor, gpu, renderer.scheduler and v8 categories.
     */
     */
    public static final int CATEGORIES_JAVASCRIPT_AND_RENDERING = 3;
    public static final int CATEGORIES_JAVASCRIPT_AND_RENDERING = 1 << 5;


    /**
    /**
     * Predefined categories for studying difficult rendering performance problems.
     * Predefined set of categories for studying difficult rendering performance problems.
     * Typically includes blink, compositor, gpu, renderer.scheduler, v8 and
     * Typically includes blink, compositor, gpu, renderer.scheduler, v8 and
     * some other compositor categories which are disabled by default.
     * some other compositor categories which are disabled by default.
     */
     */
    public static final int CATEGORIES_FRAME_VIEWER = 4;
    public static final int CATEGORIES_FRAME_VIEWER = 1 << 6;


    /** @hide */
    /** @hide */
    @IntDef({RECORD_UNTIL_FULL, RECORD_CONTINUOUSLY, RECORD_UNTIL_FULL_LARGE_BUFFER,
    @IntDef({RECORD_UNTIL_FULL, RECORD_CONTINUOUSLY, RECORD_UNTIL_FULL_LARGE_BUFFER})
            RECORD_TO_CONSOLE})
    @Retention(RetentionPolicy.SOURCE)
    @Retention(RetentionPolicy.SOURCE)
    public @interface TracingMode {}
    public @interface TracingMode {}


@@ -97,107 +112,153 @@ public class TracingConfig {


    /**
    /**
     * Record trace events using a larger internal tracing buffer until it is full.
     * Record trace events using a larger internal tracing buffer until it is full.
     * Uses more memory than the other modes and may not be suitable on devices
     * Uses significantly more memory than {@link #RECORD_UNTIL_FULL} and may not be
     * with smaller RAM. Depending on the implementation typically allows up to
     * suitable on devices with smaller RAM.
     * 512 million events to be stored.
     */
     */
    public static final int RECORD_UNTIL_FULL_LARGE_BUFFER = 2;
    public static final int RECORD_UNTIL_FULL_LARGE_BUFFER = 2;


    /**
    /**
     * Record trace events to console (logcat). The events are discarded and nothing
     * @hide
     * is sent back to the caller. Uses the least memory as compared to the other modes.
     */
     */
    public static final int RECORD_TO_CONSOLE = 3;
    public TracingConfig(@PredefinedCategories int predefinedCategories,
            @NonNull List<String> customIncludedCategories,
            @TracingMode int tracingMode) {
        mPredefinedCategories = predefinedCategories;
        mCustomIncludedCategories.addAll(customIncludedCategories);
        mTracingMode = tracingMode;
    }


    /**
    /**
     * Create config with the preset categories.
     * Returns a bitmask of the predefined categories values of this configuration.
     * <p>
     * Example:
     *    TracingConfig(CATEGORIES_WEB_DEVELOPER) -- records trace events from the "web developer"
     *                                               preset categories.
     *
     * @param presetCategories preset categories to use, one of {@link #CATEGORIES_WEB_DEVELOPER},
     *                    {@link #CATEGORIES_INPUT_LATENCY}, {@link #CATEGORIES_RENDERING},
     *                    {@link #CATEGORIES_JAVASCRIPT_AND_RENDERING} or
     *                    {@link #CATEGORIES_FRAME_VIEWER}.
     *
     * Note: for specifying custom categories without presets use
     * {@link #TracingConfig(int, String, int)}.
     *
     */
     */
    public TracingConfig(@PresetCategories int presetCategories) {
    @PredefinedCategories
        this(presetCategories, "", RECORD_UNTIL_FULL);
    public int getPredefinedCategories() {
        return mPredefinedCategories;
    }
    }


    /**
    /**
     * Create a configuration with both preset categories and custom categories.
     * Returns the list of included custom category patterns for this configuration.
     * Also allows to specify the tracing mode.
     *
     *
     * Note that the categories are defined by the currently-in-use version of WebView. They live
     * @return empty list if no custom category patterns are specified.
     * in chromium code and are not part of the Android API. See
     */
     * See <a href="https://www.chromium.org/developers/how-tos/trace-event-profiling-tool">
    @NonNull
     * chromium documentation on tracing</a> for more details.
    public List<String> getCustomIncludedCategories() {
        return mCustomIncludedCategories;
    }

    /**
     * Returns the tracing mode of this configuration.
     */
    @TracingMode
    public int getTracingMode() {
        return mTracingMode;
    }

    /**
     * Builder used to create {@link TracingConfig} objects.
     *
     *
     * <p>
     * Examples:
     * Examples:
     *
     *   new TracingConfig.Builder().build()
     *  Preset category with a specified trace mode:
     *       -- creates a configuration with default options: {@link #CATEGORIES_NONE},
     *    TracingConfig(CATEGORIES_WEB_DEVELOPER, "", RECORD_UNTIL_FULL_LARGE_BUFFER);
     *          {@link #RECORD_UNTIL_FULL}.
     *  Custom categories:
     *   new TracingConfig.Builder().addCategories(CATEGORIES_WEB_DEVELOPER).build()
     *    TracingConfig(CATEGORIES_NONE, "browser", RECORD_UNTIL_FULL)
     *       -- records trace events from the "web developer" predefined category sets.
     *   new TracingConfig.Builder().addCategories(CATEGORIES_RENDERING,
     *                                             CATEGORIES_INPUT_LATENCY).build()
     *       -- records trace events from the "rendering" and "input latency" predefined
     *          category sets.
     *   new TracingConfig.Builder().addCategories("browser").build()
     *       -- records only the trace events from the "browser" category.
     *       -- records only the trace events from the "browser" category.
     *    TraceConfig(CATEGORIES_NONE, "-input,-gpu", RECORD_UNTIL_FULL)
     *   new TracingConfig.Builder().addCategories("blink*","renderer*").build()
     *      -- records all trace events excluding the events from the "input" and 'gpu' categories.
     *       -- records only the trace events matching the "blink*" and "renderer*" patterns
     *    TracingConfig(CATEGORIES_NONE, "blink*,devtools*", RECORD_UNTIL_FULL)
     *          (e.g. "blink.animations", "renderer_host" and "renderer.scheduler" categories).
     *      -- records only the trace events matching the "blink*" and "devtools*" patterns
     *   new TracingConfig.Builder().addCategories(CATEGORIES_WEB_DEVELOPER)
     *         (e.g. "blink_gc" and "devtools.timeline" categories).
     *                              .addCategories("disabled-by-default-v8.gc")
     *
     *                              .setTracingMode(RECORD_CONTINUOUSLY).build()
     *  Combination of preset and additional custom categories:
     *       -- records events from the "web developer" predefined category set and events from
     *    TracingConfig(CATEGORIES_WEB_DEVELOPER, "memory-infra", RECORD_CONTINUOUSLY)
     *          the "disabled-by-default-v8.gc" category to understand where garbage collection
     *      -- records events from the "web developer" categories and events from the "memory-infra"
     *          is being triggered. Uses a ring buffer for internal storage during tracing.
     *         category to understand where memory is being used.
     */
    public static class Builder {
        private @PredefinedCategories int mPredefinedCategories = CATEGORIES_NONE;
        private final List<String> mCustomIncludedCategories = new ArrayList<String>();
        private @TracingMode int mTracingMode = RECORD_UNTIL_FULL;

        /**
         * Default constructor for Builder.
         */
        public Builder() {}

        /**
         * Build {@link TracingConfig} using the current settings.
         */
        public TracingConfig build() {
            return new TracingConfig(mPredefinedCategories, mCustomIncludedCategories,
                    mTracingMode);
        }

        /**
         * Adds categories from a predefined set of categories to be included in the trace output.
         *
         *
     * @param presetCategories preset categories to use, one of {@link #CATEGORIES_WEB_DEVELOPER},
         * @param predefinedCategories list or bitmask of predefined category sets to use:
     *                    {@link #CATEGORIES_INPUT_LATENCY}, {@link #CATEGORIES_RENDERING},
         *                    {@link #CATEGORIES_NONE}, {@link #CATEGORIES_ALL},
         *                    {@link #CATEGORIES_WEB_DEVELOPER}, {@link #CATEGORIES_INPUT_LATENCY},
         *                    {@link #CATEGORIES_RENDERING},
         *                    {@link #CATEGORIES_JAVASCRIPT_AND_RENDERING} or
         *                    {@link #CATEGORIES_JAVASCRIPT_AND_RENDERING} or
         *                    {@link #CATEGORIES_FRAME_VIEWER}.
         *                    {@link #CATEGORIES_FRAME_VIEWER}.
     * @param customCategories a comma-delimited list of category wildcards. A category can
         * @return The builder to facilitate chaining.
     *                         have an optional '-' prefix to make it an excluded category.
         */
     * @param tracingMode tracing mode to use, one of {@link #RECORD_UNTIL_FULL},
        public Builder addCategories(@PredefinedCategories int... predefinedCategories) {
     *                    {@link #RECORD_CONTINUOUSLY}, {@link #RECORD_UNTIL_FULL_LARGE_BUFFER}
            for (int categorySet : predefinedCategories) {
     *                    or {@link #RECORD_TO_CONSOLE}.
                mPredefinedCategories |= categorySet;
     */
            }
    public TracingConfig(@PresetCategories int presetCategories,
            return this;
            @NonNull String customCategories, @TracingMode int tracingMode) {
        mPresetCategories = presetCategories;
        mCustomCategoryPattern = customCategories;
        mTracingMode = RECORD_UNTIL_FULL;
        }
        }


        /**
        /**
     * Returns the custom category pattern for this configuration.
         * Adds custom categories to be included in trace output.
         *
         *
     * @return empty string if no custom category pattern is specified.
         * Note that the categories are defined by the currently-in-use version of WebView. They
         * live in chromium code and are not part of the Android API. See
         * See <a href="https://www.chromium.org/developers/how-tos/trace-event-profiling-tool">
         * chromium documentation on tracing</a> for more details.
         *
         * @param categories a list of category patterns. A category pattern can contain wilcards,
         *        e.g. "blink*" or full category name e.g. "renderer.scheduler".
         * @return The builder to facilitate chaining.
         */
         */
    @NonNull
        public Builder addCategories(String... categories) {
    public String getCustomCategoryPattern() {
            for (String category: categories) {
        return mCustomCategoryPattern;
                mCustomIncludedCategories.add(category);
            }
            return this;
        }
        }


        /**
        /**
     * Returns the preset categories value of this configuration.
         * Adds custom categories to be included in trace output.
         *
         * Same as {@link #addCategories(String...)} but allows to pass a Collection as a parameter.
         *
         * @param categories a list of category patters.
         * @return The builder to facilitate chaining.
         */
         */
    @PresetCategories
        public Builder addCategories(Collection<String> categories) {
    public int getPresetCategories() {
            mCustomIncludedCategories.addAll(categories);
        return mPresetCategories;
            return this;
        }
        }


        /**
        /**
     * Returns the tracing mode of this configuration.
         * Sets the tracing mode for this configuration.
         *
         * @param tracingMode tracing mode to use, one of {@link #RECORD_UNTIL_FULL},
         *                    {@link #RECORD_CONTINUOUSLY} or
         *                    {@link #RECORD_UNTIL_FULL_LARGE_BUFFER}.
         * @return The builder to facilitate chaining.
         */
         */
    @TracingMode
        public Builder setTracingMode(@TracingMode int tracingMode) {
    public int getTracingMode() {
            mTracingMode = tracingMode;
        return mTracingMode;
            return this;
        }
    }
    }


}
}
+23 −55
Original line number Original line Diff line number Diff line
@@ -16,9 +16,12 @@


package android.webkit;
package android.webkit;


import android.annotation.CallbackExecutor;
import android.annotation.NonNull;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.Nullable;
import android.os.Handler;

import java.io.OutputStream;
import java.util.concurrent.Executor;


/**
/**
 * Manages tracing of WebViews. In particular provides functionality for the app
 * Manages tracing of WebViews. In particular provides functionality for the app
@@ -29,40 +32,22 @@ import android.os.Handler;
 * The resulting trace data is sent back as a byte sequence in json format. This
 * The resulting trace data is sent back as a byte sequence in json format. This
 * file can be loaded in "chrome://tracing" for further analysis.
 * file can be loaded in "chrome://tracing" for further analysis.
 * <p>
 * <p>
 * Note: All methods in this class must be called on the UI thread. All callbacks
 * are also called on the UI thread.
 * <p>
 * Example usage:
 * Example usage:
 * <pre class="prettyprint">
 * <pre class="prettyprint">
 * TracingController tracingController = TracingController.getInstance();
 * TracingController tracingController = TracingController.getInstance();
 * tracingController.start(new TraceConfig(CATEGORIES_WEB_DEVELOPER));
 * tracingController.start(new TraceConfig.Builder()
 *                  .addCategories(CATEGORIES_WEB_DEVELOPER).build());
 * [..]
 * [..]
 * tracingController.stopAndFlush(new TraceFileOutput("trace.json"), null);
 * tracingController.stop(new FileOutputStream("trace.json"),
 *                        Executors.newSingleThreadExecutor());
 * </pre></p>
 * </pre></p>
 */
 */
public abstract class TracingController {
public abstract class TracingController {


    /**
     * Interface for capturing tracing data.
     */
    public interface TracingOutputStream {
        /**
         * Will be called to return tracing data in chunks.
         * Tracing data is returned in json format an array of bytes.
         */
        void write(byte[] chunk);

        /**
         * Called when tracing is finished and the data collection is over.
         * There will be no calls to #write after #complete is called.
         */
        void complete();
    }

    /**
    /**
     * Returns the default TracingController instance. At present there is
     * Returns the default TracingController instance. At present there is
     * only one TracingController instance for all WebView instances,
     * only one TracingController instance for all WebView instances,
     * however this restriction may be relaxed in the future.
     * however this restriction may be relaxed in a future Android release.
     *
     *
     * @return the default TracingController instance
     * @return the default TracingController instance
     */
     */
@@ -72,55 +57,38 @@ public abstract class TracingController {
    }
    }


    /**
    /**
     * Starts tracing all webviews. Depeding on the trace mode in traceConfig
     * Starts tracing all webviews. Depending on the trace mode in traceConfig
     * specifies how the trace events are recorded.
     * specifies how the trace events are recorded.
     *
     *
     * For tracing modes {@link TracingConfig#RECORD_UNTIL_FULL},
     * For tracing modes {@link TracingConfig#RECORD_UNTIL_FULL},
     * {@link TracingConfig#RECORD_CONTINUOUSLY} and
     * {@link TracingConfig#RECORD_CONTINUOUSLY} and
     * {@link TracingConfig#RECORD_UNTIL_FULL_LARGE_BUFFER} the events are recorded
     * {@link TracingConfig#RECORD_UNTIL_FULL_LARGE_BUFFER} the events are recorded
     * using an internal buffer and flushed to the outputStream when
     * using an internal buffer and flushed to the outputStream when
     * {@link #stopAndFlush(TracingOutputStream, Handler)} is called.
     * {@link #stop(OutputStream, Executor)} is called.
     *
     *
     * @param tracingConfig configuration options to use for tracing
     * @param tracingConfig configuration options to use for tracing
     * @return false if the system is already tracing, true otherwise.
     * @throws IllegalStateException if the system is already tracing.
     */
     */
    public abstract boolean start(TracingConfig tracingConfig);
    public abstract void start(@NonNull TracingConfig tracingConfig);


    /**
    /**
     * Stops tracing and discards all tracing data.
     * Stops tracing and flushes tracing data to the specified outputStream.
     *
     *
     * This method is particularly useful in conjunction with the
     * The data is sent to the specified output stream in json format typically
     * {@link TracingConfig#RECORD_TO_CONSOLE} tracing mode because tracing data is logged to
     * in chunks by invoking {@link java.io.OutputStream#write(byte[])}. On completion
     * console and not sent to an outputStream as with
     * the {@link java.io.OutputStream#close()} method is called.
     * {@link #stopAndFlush(TracingOutputStream, Handler)}.
     *
     *
     * @param outputStream the output steam the tracing data will be sent to. If null
     *                     the tracing data will be discarded.
     * @param executor the {@link java.util.concurrent.Executor} on which the
     *        outputStream #write and #close methods will be invoked.
     * @return false if the system was not tracing at the time of the call, true
     * @return false if the system was not tracing at the time of the call, true
     *         otherwise.
     *         otherwise.
     */
     */
    public abstract boolean stop();
    public abstract boolean stop(@Nullable OutputStream outputStream,

            @NonNull @CallbackExecutor Executor executor);
    /**
     * Stops tracing and flushes tracing data to the specifid outputStream.
     *
     * Note that if the {@link TracingConfig#RECORD_TO_CONSOLE} tracing mode is used
     * nothing will be sent to the outputStream and no TracingOuputStream methods will be
     * called. In that case it is more convenient to just use {@link #stop()} instead.
     *
     * @param outputStream the output steam the tracing data will be sent to.
     * @param handler the {@link android.os.Handler} on which the outputStream callbacks
     *                will be invoked. If the handler is null the current thread's Looper
     *                will be used.
     * @return false if the system was not tracing at the time of the call, true
     *         otherwise.
     */
    public abstract boolean stopAndFlush(TracingOutputStream outputStream,
            @Nullable Handler handler);


    /** True if the system is tracing */
    /** True if the system is tracing */
    public abstract boolean isTracing();
    public abstract boolean isTracing();


    // TODO: consider adding getTraceBufferUsage, percentage and approx event count.
    // TODO: consider adding String getCategories(), for obtaining the actual list
    // of categories used (given that presets are ints).

}
}
+0 −63

File deleted.

Preview size limit exceeded, changes collapsed.