Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d8f63303 authored by Adam Bookatz's avatar Adam Bookatz Committed by Automerger Merge Worker
Browse files

Merge "EventLog for UserController broadcasts" into rvc-dev am: 576e8863 am:...

Merge "EventLog for UserController broadcasts" into rvc-dev am: 576e8863 am: 19fb1374 am: fd6fc95b am: 12d34fdb

Change-Id: I63a953ea498957dfb7357053af949dac49dde747
parents 9a20d1d4 12d34fdb
Loading
Loading
Loading
Loading
+12 −11
Original line number Diff line number Diff line
@@ -95,14 +95,15 @@ option java_package com.android.server.am
30069 am_unfreeze (Pid|1|5),(Process Name|3)

# User switch events
30070 uc_finish_user_unlocking (UID|1|5)
30071 uc_finish_user_unlocked (UID|1|5)
30072 uc_finish_user_unlocked_completed (UID|1|5)
30073 uc_finish_user_stopping (UID|1|5)
30074 uc_finish_user_stopped (UID|1|5)
30075 uc_switch_user (UID|1|5)
30076 uc_start_user_internal (UID|1|5)
30077 uc_unlock_user (UID|1|5)
30078 uc_finish_user_boot (UID|1|5)
30079 uc_dispatch_user_switch (oldUID|1|5) (newUID|1|5)
30080 uc_continue_user_switch (oldUID|1|5) (newUID|1|5)
30070 uc_finish_user_unlocking (userId|1|5)
30071 uc_finish_user_unlocked (userId|1|5)
30072 uc_finish_user_unlocked_completed (userId|1|5)
30073 uc_finish_user_stopping (userId|1|5)
30074 uc_finish_user_stopped (userId|1|5)
30075 uc_switch_user (userId|1|5)
30076 uc_start_user_internal (userId|1|5)
30077 uc_unlock_user (userId|1|5)
30078 uc_finish_user_boot (userId|1|5)
30079 uc_dispatch_user_switch (oldUserId|1|5) (newUserId|1|5)
30080 uc_continue_user_switch (oldUserId|1|5) (newUserId|1|5)
30081 uc_send_user_broadcast (userId|1|5) (IntentAction|3|)
 No newline at end of file
+14 −3
Original line number Diff line number Diff line
@@ -675,6 +675,8 @@ class UserController implements Handler.Callback {
        // Spin up app widgets prior to boot-complete, so they can be ready promptly
        mInjector.startUserWidgets(userId);

        mHandler.obtainMessage(USER_UNLOCKED_MSG, userId, 0).sendToTarget();

        Slog.i(TAG, "Posting BOOT_COMPLETED user #" + userId);
        // Do not report secondary users, runtime restarts or first boot/upgrade
        if (userId == UserHandle.USER_SYSTEM
@@ -684,9 +686,6 @@ class UserController implements Handler.Callback {
                    FrameworkStatsLog.BOOT_TIME_EVENT_ELAPSED_TIME__EVENT__FRAMEWORK_BOOT_COMPLETED,
                    elapsedTimeMs);
        }

        mHandler.obtainMessage(USER_UNLOCKED_MSG, userId, 0).sendToTarget();

        final Intent bootIntent = new Intent(Intent.ACTION_BOOT_COMPLETED, null);
        bootIntent.putExtra(Intent.EXTRA_USER_HANDLE, userId);
        bootIntent.addFlags(Intent.FLAG_RECEIVER_NO_ABORT
@@ -2442,8 +2441,10 @@ class UserController implements Handler.Callback {
                logUserJourneyInfo(null, getUserInfo(msg.arg1), USER_JOURNEY_USER_START);
                logUserLifecycleEvent(msg.arg1, USER_JOURNEY_USER_START,
                        USER_LIFECYCLE_EVENT_START_USER, true);

                mInjector.getSystemServiceManager().startUser(TimingsTraceAndSlog.newAsyncLog(),
                        msg.arg1);

                logUserLifecycleEvent(msg.arg1, USER_JOURNEY_USER_START,
                        USER_LIFECYCLE_EVENT_START_USER, false);
                clearSessionId(msg.arg1, USER_JOURNEY_USER_START);
@@ -2475,6 +2476,7 @@ class UserController implements Handler.Callback {
                break;
            case REPORT_USER_SWITCH_COMPLETE_MSG:
                dispatchUserSwitchComplete(msg.arg1);

                final int currentJourney = mUserSwitchUiEnabled ? USER_JOURNEY_USER_SWITCH_UI
                                                                : USER_JOURNEY_USER_SWITCH_FG;
                logUserLifecycleEvent(msg.arg1, currentJourney,
@@ -2620,6 +2622,13 @@ class UserController implements Handler.Callback {
                Bundle resultExtras, String[] requiredPermissions, int appOp, Bundle bOptions,
                boolean ordered, boolean sticky, int callingPid, int callingUid, int realCallingUid,
                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
            synchronized (mService) {
                return mService.broadcastIntentLocked(null, null, null, intent, resolvedType,
@@ -2685,6 +2694,8 @@ class UserController implements Handler.Callback {
        }

        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) {
                @Override
                public void onFinished() {