diff options
| author | 2020-06-18 21:32:00 +0000 | |
|---|---|---|
| committer | 2020-06-18 21:32:00 +0000 | |
| commit | 22e9ee7459b8f21c0ee98a43c999e87cadc9ae53 (patch) | |
| tree | 5aade93a0f2b11b6d03a66a60cae0b7c3a8aed87 | |
| parent | 29db7a6a62aed57c9001fa504357b3dcee5acb36 (diff) | |
| parent | 9628953e14c4f1a0cfc64d41df8e6cd97a70d78b (diff) | |
Merge "Handle user create failure correctly for lifecycle atom." into rvc-dev
| -rw-r--r-- | services/core/java/com/android/server/pm/UserManagerService.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/services/core/java/com/android/server/pm/UserManagerService.java b/services/core/java/com/android/server/pm/UserManagerService.java index 2a6997cba4bb..398ff4b8b9f9 100644 --- a/services/core/java/com/android/server/pm/UserManagerService.java +++ b/services/core/java/com/android/server/pm/UserManagerService.java @@ -3291,11 +3291,13 @@ public class UserManagerService extends IUserManager.Stub { final TimingsTraceAndSlog t = new TimingsTraceAndSlog(); t.traceBegin("createUser-" + flags); final long sessionId = logUserCreateJourneyBegin(nextProbableUserId, userType, flags); + UserInfo newUser = null; try { - return createUserInternalUncheckedNoTracing(name, userType, flags, parentId, - preCreate, disallowedPackages, t); + newUser = createUserInternalUncheckedNoTracing(name, userType, flags, parentId, + preCreate, disallowedPackages, t); + return newUser; } finally { - logUserCreateJourneyFinish(sessionId, nextProbableUserId); + logUserCreateJourneyFinish(sessionId, nextProbableUserId, newUser != null); t.traceEnd(); } } @@ -3314,10 +3316,11 @@ public class UserManagerService extends IUserManager.Stub { return sessionId; } - private void logUserCreateJourneyFinish(long sessionId, @UserIdInt int userId) { + private void logUserCreateJourneyFinish(long sessionId, @UserIdInt int userId, boolean finish) { FrameworkStatsLog.write(FrameworkStatsLog.USER_LIFECYCLE_EVENT_OCCURRED, sessionId, userId, FrameworkStatsLog.USER_LIFECYCLE_EVENT_OCCURRED__EVENT__CREATE_USER, - FrameworkStatsLog.USER_LIFECYCLE_EVENT_OCCURRED__STATE__FINISH); + finish ? FrameworkStatsLog.USER_LIFECYCLE_EVENT_OCCURRED__STATE__FINISH + : FrameworkStatsLog.USER_LIFECYCLE_EVENT_OCCURRED__STATE__NONE); } private UserInfo createUserInternalUncheckedNoTracing(@Nullable String name, |