Loading cmds/statsd/src/atoms.proto +26 −0 Original line number Diff line number Diff line Loading @@ -391,6 +391,7 @@ message Atom { WifiHealthStatReported wifi_health_stat_reported = 251 [(module) = "wifi"]; WifiFailureStatReported wifi_failure_stat_reported = 252 [(module) = "wifi"]; WifiConnectionResultReported wifi_connection_result_reported = 253 [(module) = "wifi"]; AppFreezeChanged app_freeze_changed = 254 [(module) = "framework"]; SdkExtensionStatus sdk_extension_status = 354; } Loading Loading @@ -8366,3 +8367,28 @@ message SdkExtensionStatus { // "Failed" here can mean a symbol that wasn't meant to be visible was, or the other way around. optional int32 failed_call_symbol = 3; } /** * Logs when an app is frozen or unfrozen. * * Logged from: * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java */ message AppFreezeChanged { // The type of event. enum Action { UNKNOWN = 0; FREEZE_APP = 1; UNFREEZE_APP = 2; } optional Action action = 1; // Pid of the process being frozen. optional int32 pid = 2; // Name of the process being frozen. optional string process_name = 3; // Time since last unfrozen. optional int64 time_unfrozen_millis = 4; } services/core/java/com/android/server/am/CachedAppOptimizer.java +19 −0 Original line number Diff line number Diff line Loading @@ -946,6 +946,15 @@ public final class CachedAppOptimizer { } EventLog.writeEvent(EventLogTags.AM_FREEZE, pid, name); // See above for why we're not taking mPhenotypeFlagLock here if (mRandom.nextFloat() < mFreezerStatsdSampleRate) { FrameworkStatsLog.write(FrameworkStatsLog.APP_FREEZE_CHANGED, FrameworkStatsLog.APP_FREEZE_CHANGED__ACTION__FREEZE_APP, pid, name, unfrozenDuration); } } } Loading Loading @@ -994,6 +1003,16 @@ public final class CachedAppOptimizer { } EventLog.writeEvent(EventLogTags.AM_UNFREEZE, pid, name); // See above for why we're not taking mPhenotypeFlagLock here if (mRandom.nextFloat() < mFreezerStatsdSampleRate) { FrameworkStatsLog.write( FrameworkStatsLog.APP_FREEZE_CHANGED, FrameworkStatsLog.APP_FREEZE_CHANGED__ACTION__UNFREEZE_APP, pid, name, frozenDuration); } } } } Loading Loading
cmds/statsd/src/atoms.proto +26 −0 Original line number Diff line number Diff line Loading @@ -391,6 +391,7 @@ message Atom { WifiHealthStatReported wifi_health_stat_reported = 251 [(module) = "wifi"]; WifiFailureStatReported wifi_failure_stat_reported = 252 [(module) = "wifi"]; WifiConnectionResultReported wifi_connection_result_reported = 253 [(module) = "wifi"]; AppFreezeChanged app_freeze_changed = 254 [(module) = "framework"]; SdkExtensionStatus sdk_extension_status = 354; } Loading Loading @@ -8366,3 +8367,28 @@ message SdkExtensionStatus { // "Failed" here can mean a symbol that wasn't meant to be visible was, or the other way around. optional int32 failed_call_symbol = 3; } /** * Logs when an app is frozen or unfrozen. * * Logged from: * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java */ message AppFreezeChanged { // The type of event. enum Action { UNKNOWN = 0; FREEZE_APP = 1; UNFREEZE_APP = 2; } optional Action action = 1; // Pid of the process being frozen. optional int32 pid = 2; // Name of the process being frozen. optional string process_name = 3; // Time since last unfrozen. optional int64 time_unfrozen_millis = 4; }
services/core/java/com/android/server/am/CachedAppOptimizer.java +19 −0 Original line number Diff line number Diff line Loading @@ -946,6 +946,15 @@ public final class CachedAppOptimizer { } EventLog.writeEvent(EventLogTags.AM_FREEZE, pid, name); // See above for why we're not taking mPhenotypeFlagLock here if (mRandom.nextFloat() < mFreezerStatsdSampleRate) { FrameworkStatsLog.write(FrameworkStatsLog.APP_FREEZE_CHANGED, FrameworkStatsLog.APP_FREEZE_CHANGED__ACTION__FREEZE_APP, pid, name, unfrozenDuration); } } } Loading Loading @@ -994,6 +1003,16 @@ public final class CachedAppOptimizer { } EventLog.writeEvent(EventLogTags.AM_UNFREEZE, pid, name); // See above for why we're not taking mPhenotypeFlagLock here if (mRandom.nextFloat() < mFreezerStatsdSampleRate) { FrameworkStatsLog.write( FrameworkStatsLog.APP_FREEZE_CHANGED, FrameworkStatsLog.APP_FREEZE_CHANGED__ACTION__UNFREEZE_APP, pid, name, frozenDuration); } } } } Loading