언어

ProfilingTriggerType Enum

Definition

Defines profiling trigger type values used by the Android OS API.

public enum ProfilingTriggerType
type ProfilingTriggerType = 
Inheritance
ProfilingTriggerType

Fields

Name Value Description
None 0

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

AppFullyDrawn 1

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.

Anr 2

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.

TriggerTypeAppRequestRunningTrace 3
TriggerTypeKillForceStop 4
TriggerTypeKillRecents 5
TriggerTypeKillTaskManager 6
TriggerTypeOom 7

Trigger occurs when an app has an Out Of Memory Exception.

System will provide a Java heap dump in response to this trigger.

Use of this trigger requires that any custom Thread.UncaughtExceptionHandler call through to the default uncaught exception handler (Thread.getDefaultUncaughtExceptionHandler()). If the default uncaught exception handler is not called, then this trigger cannot be used. The app can still obtain a Java heap dump in this case, but will have to request the profiling itself using ProfilingManager.requestProfiling.

Android reference for android.os.ProfilingTrigger.TRIGGER_TYPE_OOM.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Anomaly 8

Trigger occurs when the system detects an anomalous behavior by the app. Anomalous behaviors may span all areas. The artifact returned will vary by the anomaly.

The tag returned with the ProfilingResult.getTag() will contain additional information about the type of anomaly.

Android reference for android.os.ProfilingTrigger.TRIGGER_TYPE_ANOMALY.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

KillExcessiveCpuUsage 9

Trigger occurs when an app is killed due to excessive CPU usage with an ApplicationExitInfo.getReason() of ApplicationExitInfo.REASON_EXCESSIVE_RESOURCE_USAGE.

System will provide a snapshot of a running system trace in response to this trigger.

Android reference for android.os.ProfilingTrigger.TRIGGER_TYPE_KILL_EXCESSIVE_CPU_USAGE.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

ColdStart 10

Trigger occurs as early as possible when an app cold starts.

This happens when the ApplicationStartInfo.getStartType() start type is ApplicationStartInfo.START_TYPE_COLD.

The system will provide a newly started system trace and stack sampling profile in response to this trigger. Profiling will continue until the app calls Activity.reportFullyDrawn(); otherwise, it will stop after a default period of 5 seconds.

The system uses a discard buffer for this trigger. This means that if the buffer fills up, newer events are discarded. This ensures that the earliest available tracepoints are always retained.

Note: There might be a delay before profiling begins, similar to when ProfilingManager.requestProfiling is used.

Android reference for android.os.ProfilingTrigger.TRIGGER_TYPE_COLD_START.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

AppCompat 11

Trigger occurs when the system detects an anomalous behavior by the app which will become unsupported in future Android versions. The artifact returned will vary by the anomaly.

The tag returned with the ProfilingResult.getTag() will contain additional information about the app compatibility issues.

Android reference for android.os.ProfilingTrigger.TRIGGER_TYPE_APP_COMPAT.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Remarks

Encapsulates a single profiling trigger.

Java documentation for android.os.ProfilingTrigger.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to