Merge "EventLog for UserController broadcasts" into rvc-dev am: 576e8863fa am: 19fb13741f

Change-Id: If6af2ce6af98a66b38b987d6e23d5686141bbe23
This commit is contained in:
Adam Bookatz
2020-05-10 05:31:10 +00:00
committed by Automerger Merge Worker
2 changed files with 26 additions and 14 deletions

View File

@@ -95,14 +95,15 @@ option java_package com.android.server.am
30069 am_unfreeze (Pid|1|5),(Process Name|3) 30069 am_unfreeze (Pid|1|5),(Process Name|3)
# User switch events # User switch events
30070 uc_finish_user_unlocking (UID|1|5) 30070 uc_finish_user_unlocking (userId|1|5)
30071 uc_finish_user_unlocked (UID|1|5) 30071 uc_finish_user_unlocked (userId|1|5)
30072 uc_finish_user_unlocked_completed (UID|1|5) 30072 uc_finish_user_unlocked_completed (userId|1|5)
30073 uc_finish_user_stopping (UID|1|5) 30073 uc_finish_user_stopping (userId|1|5)
30074 uc_finish_user_stopped (UID|1|5) 30074 uc_finish_user_stopped (userId|1|5)
30075 uc_switch_user (UID|1|5) 30075 uc_switch_user (userId|1|5)
30076 uc_start_user_internal (UID|1|5) 30076 uc_start_user_internal (userId|1|5)
30077 uc_unlock_user (UID|1|5) 30077 uc_unlock_user (userId|1|5)
30078 uc_finish_user_boot (UID|1|5) 30078 uc_finish_user_boot (userId|1|5)
30079 uc_dispatch_user_switch (oldUID|1|5) (newUID|1|5) 30079 uc_dispatch_user_switch (oldUserId|1|5) (newUserId|1|5)
30080 uc_continue_user_switch (oldUID|1|5) (newUID|1|5) 30080 uc_continue_user_switch (oldUserId|1|5) (newUserId|1|5)
30081 uc_send_user_broadcast (userId|1|5) (IntentAction|3|)

View File

@@ -668,6 +668,8 @@ class UserController implements Handler.Callback {
// Spin up app widgets prior to boot-complete, so they can be ready promptly // Spin up app widgets prior to boot-complete, so they can be ready promptly
mInjector.startUserWidgets(userId); mInjector.startUserWidgets(userId);
mHandler.obtainMessage(USER_UNLOCKED_MSG, userId, 0).sendToTarget();
Slog.i(TAG, "Posting BOOT_COMPLETED user #" + userId); Slog.i(TAG, "Posting BOOT_COMPLETED user #" + userId);
// Do not report secondary users, runtime restarts or first boot/upgrade // Do not report secondary users, runtime restarts or first boot/upgrade
if (userId == UserHandle.USER_SYSTEM if (userId == UserHandle.USER_SYSTEM
@@ -677,9 +679,6 @@ class UserController implements Handler.Callback {
FrameworkStatsLog.BOOT_TIME_EVENT_ELAPSED_TIME__EVENT__FRAMEWORK_BOOT_COMPLETED, FrameworkStatsLog.BOOT_TIME_EVENT_ELAPSED_TIME__EVENT__FRAMEWORK_BOOT_COMPLETED,
elapsedTimeMs); elapsedTimeMs);
} }
mHandler.obtainMessage(USER_UNLOCKED_MSG, userId, 0).sendToTarget();
final Intent bootIntent = new Intent(Intent.ACTION_BOOT_COMPLETED, null); final Intent bootIntent = new Intent(Intent.ACTION_BOOT_COMPLETED, null);
bootIntent.putExtra(Intent.EXTRA_USER_HANDLE, userId); bootIntent.putExtra(Intent.EXTRA_USER_HANDLE, userId);
bootIntent.addFlags(Intent.FLAG_RECEIVER_NO_ABORT bootIntent.addFlags(Intent.FLAG_RECEIVER_NO_ABORT
@@ -2423,8 +2422,10 @@ class UserController implements Handler.Callback {
logUserJourneyInfo(null, getUserInfo(msg.arg1), USER_JOURNEY_USER_START); logUserJourneyInfo(null, getUserInfo(msg.arg1), USER_JOURNEY_USER_START);
logUserLifecycleEvent(msg.arg1, USER_JOURNEY_USER_START, logUserLifecycleEvent(msg.arg1, USER_JOURNEY_USER_START,
USER_LIFECYCLE_EVENT_START_USER, true); USER_LIFECYCLE_EVENT_START_USER, true);
mInjector.getSystemServiceManager().startUser(TimingsTraceAndSlog.newAsyncLog(), mInjector.getSystemServiceManager().startUser(TimingsTraceAndSlog.newAsyncLog(),
msg.arg1); msg.arg1);
logUserLifecycleEvent(msg.arg1, USER_JOURNEY_USER_START, logUserLifecycleEvent(msg.arg1, USER_JOURNEY_USER_START,
USER_LIFECYCLE_EVENT_START_USER, false); USER_LIFECYCLE_EVENT_START_USER, false);
clearSessionId(msg.arg1, USER_JOURNEY_USER_START); clearSessionId(msg.arg1, USER_JOURNEY_USER_START);
@@ -2456,6 +2457,7 @@ class UserController implements Handler.Callback {
break; break;
case REPORT_USER_SWITCH_COMPLETE_MSG: case REPORT_USER_SWITCH_COMPLETE_MSG:
dispatchUserSwitchComplete(msg.arg1); dispatchUserSwitchComplete(msg.arg1);
final int currentJourney = mUserSwitchUiEnabled ? USER_JOURNEY_USER_SWITCH_UI final int currentJourney = mUserSwitchUiEnabled ? USER_JOURNEY_USER_SWITCH_UI
: USER_JOURNEY_USER_SWITCH_FG; : USER_JOURNEY_USER_SWITCH_FG;
logUserLifecycleEvent(msg.arg1, currentJourney, logUserLifecycleEvent(msg.arg1, currentJourney,
@@ -2601,6 +2603,13 @@ class UserController implements Handler.Callback {
Bundle resultExtras, String[] requiredPermissions, int appOp, Bundle bOptions, Bundle resultExtras, String[] requiredPermissions, int appOp, Bundle bOptions,
boolean ordered, boolean sticky, int callingPid, int callingUid, int realCallingUid, boolean ordered, boolean sticky, int callingPid, int callingUid, int realCallingUid,
int realCallingPid, @UserIdInt int userId) { int realCallingPid, @UserIdInt int userId) {
int logUserId = intent.getIntExtra(Intent.EXTRA_USER_HANDLE, UserHandle.USER_NULL);
if (logUserId == UserHandle.USER_NULL) {
logUserId = userId;
}
EventLog.writeEvent(EventLogTags.UC_SEND_USER_BROADCAST, logUserId, intent.getAction());
// TODO b/64165549 Verify that mLock is not held before calling AMS methods // TODO b/64165549 Verify that mLock is not held before calling AMS methods
synchronized (mService) { synchronized (mService) {
return mService.broadcastIntentLocked(null, null, null, intent, resolvedType, return mService.broadcastIntentLocked(null, null, null, intent, resolvedType,
@@ -2666,6 +2675,8 @@ class UserController implements Handler.Callback {
} }
void sendPreBootBroadcast(@UserIdInt int userId, boolean quiet, final Runnable onFinish) { void sendPreBootBroadcast(@UserIdInt int userId, boolean quiet, final Runnable onFinish) {
EventLog.writeEvent(EventLogTags.UC_SEND_USER_BROADCAST,
userId, Intent.ACTION_PRE_BOOT_COMPLETED);
new PreBootBroadcaster(mService, userId, null, quiet) { new PreBootBroadcaster(mService, userId, null, quiet) {
@Override @Override
public void onFinished() { public void onFinished() {