Profiling

Added in 1.15.0-alpha02

public final class Profiling


Summary

Public methods

static final @NonNull Flow<@NonNull <Error class: unknown class>>

Obtain a flow to be called with all profiling results for this UID.

static final void

Register a listener to be called with all profiling results for this UID.

static final void
@RequiresApi
requestProfiling(
    @NonNull Context context,
    @NonNull ProfilingRequest profilingRequest,
    Executor executor,
    Consumer<@NonNull <Error class: unknown class>> listener
)

Request profiling using a {@link ProfilingRequest} generated by one of the provided builders.

static final void

Unregister a listener that was to be called for all profiling results.

Public methods

registerForAllProfilingResults

@RequiresApi
public static final @NonNull Flow<@NonNull <Error class: unknown class>registerForAllProfilingResults(@NonNull Context context)

Obtain a flow to be called with all profiling results for this UID.

registerForAllProfilingResults

@RequiresApi
public static final void registerForAllProfilingResults(
    @NonNull Context context,
    @NonNull Executor executor,
    @NonNull Consumer<@NonNull <Error class: unknown class>> listener
)

Register a listener to be called with all profiling results for this UID.

requestProfiling

@RequiresApi
public static final void requestProfiling(
    @NonNull Context context,
    @NonNull ProfilingRequest profilingRequest,
    Executor executor,
    Consumer<@NonNull <Error class: unknown class>> listener
)

Request profiling using a {@link ProfilingRequest} generated by one of the provided builders.

If the executor and/or listener are null, and if no global listener and executor combinations are registered using {@link registerForAllProfilingResults}, the request will be dropped.

unregisterForAllProfilingResults

@RequiresApi
public static final void unregisterForAllProfilingResults(
    @NonNull Context context,
    @NonNull Consumer<@NonNull <Error class: unknown class>> listener
)

Unregister a listener that was to be called for all profiling results.