Added in API level 36

ProfilingTrigger


class ProfilingTrigger
kotlin.Any
   ↳ android.os.ProfilingTrigger

Encapsulates a single profiling trigger.

Summary

Nested classes

Builder class to create a ProfilingTrigger object.

Constants
static Int

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

static Int

Trigger occurs after Activity#reportFullyDrawn is called for a cold start.

static Int

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

static Int

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

static Int

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

static Int

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

static Int

No trigger.

Public methods
Int

The requester set rate limiting period in hours.

Int

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

Constants

TRIGGER_TYPE_ANR

Added in API level 36
static val TRIGGER_TYPE_ANR: Int

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.

Value: 2

TRIGGER_TYPE_APP_FULLY_DRAWN

Added in API level 36
static val TRIGGER_TYPE_APP_FULLY_DRAWN: Int

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

Value: 1

TRIGGER_TYPE_APP_REQUEST_RUNNING_TRACE

static val TRIGGER_TYPE_APP_REQUEST_RUNNING_TRACE: Int

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.

Value: 3

TRIGGER_TYPE_KILL_FORCE_STOP

static val TRIGGER_TYPE_KILL_FORCE_STOP: Int

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.

Value: 4

TRIGGER_TYPE_KILL_RECENTS

static val TRIGGER_TYPE_KILL_RECENTS: Int

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.

Value: 5

TRIGGER_TYPE_KILL_TASK_MANAGER

static val TRIGGER_TYPE_KILL_TASK_MANAGER: Int

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.

Value: 6

TRIGGER_TYPE_NONE

Added in API level 36
static val TRIGGER_TYPE_NONE: Int

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

Value: 0

Public methods

getRateLimitingPeriodHours

Added in API level 36
fun getRateLimitingPeriodHours(): Int

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.