ProfilingTrigger


public final class ProfilingTrigger
extends Object

java.lang.Object
   ↳ android.os.ProfilingTrigger


Encapsulates a single profiling trigger.

Summary

Nested classes

class ProfilingTrigger.Builder

Builder class to create a ProfilingTrigger object. 

Constants

int TRIGGER_TYPE_ANR

Trigger occurs after an ANR has been identified, but before the system would attempt to kill the app.

int TRIGGER_TYPE_APP_FULLY_DRAWN

Trigger occurs after ERROR(/Activity#reportFullyDrawn) is called for a cold start.

int TRIGGER_TYPE_APP_REQUEST_RUNNING_TRACE

Trigger occurs when an app requests the actively running trace by calling ProfilingManager.requestRunningSystemTrace.

int TRIGGER_TYPE_KILL_FORCE_STOP

Trigger occurs when an app is killed due to the user clicking the "Force stop" button of the App info page in Settings.

int TRIGGER_TYPE_KILL_RECENTS

Trigger occurs when an app is killed due to the user removing it in the Recents screen.

int TRIGGER_TYPE_KILL_TASK_MANAGER

Trigger occurs when an app is killed due to the user clicking the "Stop" button for the application in Task Manager.

int TRIGGER_TYPE_NONE

No trigger.

Public methods

int getRateLimitingPeriodHours()

The requester set rate limiting period in hours.

int getTriggerType()

The trigger type indicates which event should trigger the requested profiling.

Inherited methods

Constants

TRIGGER_TYPE_ANR

Added in API level 36
public static final int TRIGGER_TYPE_ANR

Trigger occurs after an ANR has been identified, but before the system would attempt to kill the app. The trigger does not necessarily indicate that the app was killed due to the ANR. System will provide a snapshot of a running system trace in response to this trigger.

Constant Value: 2 (0x00000002)

TRIGGER_TYPE_APP_FULLY_DRAWN

Added in API level 36
public static final int TRIGGER_TYPE_APP_FULLY_DRAWN

Trigger occurs after ERROR(/Activity#reportFullyDrawn) is called for a cold start. System will provide a snapshot of a running system trace in response to this trigger.

Constant Value: 1 (0x00000001)

TRIGGER_TYPE_APP_REQUEST_RUNNING_TRACE

public static final int TRIGGER_TYPE_APP_REQUEST_RUNNING_TRACE

Trigger occurs when an app requests the actively running trace by calling ProfilingManager.requestRunningSystemTrace. System will provide a snapshot of a running system trace in response to this trigger.

Constant Value: 3 (0x00000003)

TRIGGER_TYPE_KILL_FORCE_STOP

public static final int TRIGGER_TYPE_KILL_FORCE_STOP

Trigger occurs when an app is killed due to the user clicking the "Force stop" button of the App info page in Settings. System will provide a snapshot of a running system trace in response to this trigger.

Constant Value: 4 (0x00000004)

TRIGGER_TYPE_KILL_RECENTS

public static final int TRIGGER_TYPE_KILL_RECENTS

Trigger occurs when an app is killed due to the user removing it in the Recents screen. System will provide a snapshot of a running system trace in response to this trigger.

Constant Value: 5 (0x00000005)

TRIGGER_TYPE_KILL_TASK_MANAGER

public static final int TRIGGER_TYPE_KILL_TASK_MANAGER

Trigger occurs when an app is killed due to the user clicking the "Stop" button for the application in Task Manager. System will provide a snapshot of a running system trace in response to this trigger.

Constant Value: 6 (0x00000006)

TRIGGER_TYPE_NONE

Added in API level 36
public static final int TRIGGER_TYPE_NONE

No trigger. Used in ProfilingResult for non trigger caused results.

Constant Value: 0 (0x00000000)

Public methods

getRateLimitingPeriodHours

Added in API level 36
public int getRateLimitingPeriodHours ()

The requester set rate limiting period in hours. The period is the minimum time the system should wait before providing another profiling result for the same trigger; actual time between events may be longer. If the rate limiting period is set to 0, no app-provided rate limiting will be used. This rate limiting is in addition to any system level rate limiting that may be applied.

Returns
int

getTriggerType

Added in API level 36
public int getTriggerType ()

The trigger type indicates which event should trigger the requested profiling.

Returns
int Value is TRIGGER_TYPE_NONE, TRIGGER_TYPE_APP_FULLY_DRAWN, TRIGGER_TYPE_ANR, TRIGGER_TYPE_APP_REQUEST_RUNNING_TRACE, TRIGGER_TYPE_KILL_FORCE_STOP, TRIGGER_TYPE_KILL_RECENTS, or TRIGGER_TYPE_KILL_TASK_MANAGER