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

Commit 95e59003 authored by Shubang Lu's avatar Shubang Lu Committed by Android (Google) Code Review
Browse files

Merge "[TIF CTS] logExternalInputEvent only when release sessions of current input" into main

parents 7511b573 8b3f4d83
Loading
Loading
Loading
Loading
+8 −4
Original line number Original line Diff line number Diff line
@@ -879,10 +879,13 @@ public final class TvInputManagerService extends SystemService {
                sessionState.session = null;
                sessionState.session = null;
            }
            }
        }
        }
        if (mCurrentSessionState == sessionState) {
            // only log when releasing the current on-screen session
            logExternalInputEvent(FrameworkStatsLog.EXTERNAL_TV_INPUT_EVENT__EVENT_TYPE__RELEASED,
            logExternalInputEvent(FrameworkStatsLog.EXTERNAL_TV_INPUT_EVENT__EVENT_TYPE__RELEASED,
                    mCurrentInputId, sessionState);
                    mCurrentInputId, sessionState);
            mCurrentInputId = null;
            mCurrentInputId = null;
            mCurrentSessionState = null;
            mCurrentSessionState = null;
        }
        removeSessionStateLocked(sessionToken, userId);
        removeSessionStateLocked(sessionToken, userId);
        return sessionState;
        return sessionState;
    }
    }
@@ -3046,6 +3049,7 @@ public final class TvInputManagerService extends SystemService {
    }
    }


    private void logExternalInputEvent(int eventType, String inputId, SessionState sessionState) {
    private void logExternalInputEvent(int eventType, String inputId, SessionState sessionState) {
        // TODO: handle recording sessions
        UserState userState = getOrCreateUserStateLocked(sessionState.userId);
        UserState userState = getOrCreateUserStateLocked(sessionState.userId);
        TvInputState tvInputState = userState.inputMap.get(inputId);
        TvInputState tvInputState = userState.inputMap.get(inputId);
        TvInputInfo tvInputInfo = tvInputState.info;
        TvInputInfo tvInputInfo = tvInputState.info;