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

Commit 62889cb9 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Added an event before clearning user journey" into rvc-dev am:...

Merge "Added an event before clearning user journey" into rvc-dev am: 15f86c34 am: 0b3e045a am: ec627b65 am: ad92ad91

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11812814

Change-Id: I47d78dd29ff4ad1634cfcc12f54e9e0b13f75061
parents c6f27a64 ad92ad91
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -2534,7 +2534,7 @@ class UserController implements Handler.Callback {
                showUserSwitchDialog(fromToUserPair);
                break;
            case CLEAR_USER_JOURNEY_SESSION_MSG:
                clearSessionId(msg.arg1);
                logAndClearSessionId(msg.arg1);
                break;
        }
        return false;
@@ -2648,6 +2648,21 @@ class UserController implements Handler.Callback {
        }
    }

    /**
     * Log a final event of the {@link UserJourneySession} and clear it.
     */
    private void logAndClearSessionId(@UserIdInt int userId) {
        synchronized (mUserIdToUserJourneyMap) {
            final UserJourneySession userJourneySession = mUserIdToUserJourneyMap.get(userId);
            if (userJourneySession != null) {
                FrameworkStatsLog.write(FrameworkStatsLog.USER_LIFECYCLE_EVENT_OCCURRED,
                        userJourneySession.mSessionId, userId, USER_LIFECYCLE_EVENT_UNKNOWN,
                        USER_LIFECYCLE_EVENT_STATE_NONE);
            }
            clearSessionId(userId);
        }
    }

    /**
     * Helper class to store user journey and session id.
     *