Add event logging for UserState transitions.

Event log sticks around longer, and will help debug timing issues.

Test: builds and boots
Bug: 32719353
Change-Id: Ie19f76a341c58a8efee0eb1edbf183c22e9c5270
This commit is contained in:
Jeff Sharkey
2016-11-09 13:31:36 -07:00
parent 850c83e6da
commit 97c6d3d492
2 changed files with 3 additions and 0 deletions

View File

@@ -112,3 +112,5 @@ option java_package com.android.server.am
# Report changing memory conditions (Values are ProcessStats.ADJ_MEM_FACTOR* constants)
30050 am_mem_factor (Current|1|5),(Previous|1|5)
# UserState has changed
30051 am_user_state_changed (id|1|5),(state|1|5)

View File

@@ -70,6 +70,7 @@ public final class UserState {
public boolean setState(int oldState, int newState) {
if (state == oldState) {
setState(newState);
EventLogTags.writeAmUserStateChanged(mHandle.getIdentifier(), newState);
return true;
} else {
Slog.w(TAG, "Expected user " + mHandle.getIdentifier() + " in state "