summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Shubang Lu <shubang@google.com> 2023-08-11 18:25:57 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2023-08-11 18:25:57 +0000
commit95e590030a3320feb1a56f006deb74661eb625a4 (patch)
tree608079689d1f63eb618483e0e9f64e9a79f0e5bc
parent7511b573bd864f0f05aa4ef2a883748eced7ab9e (diff)
parent8b3f4d83d5ade6b1eef98a31e4262d0c6503e349 (diff)
Merge "[TIF CTS] logExternalInputEvent only when release sessions of current input" into main
-rw-r--r--services/core/java/com/android/server/tv/TvInputManagerService.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/tv/TvInputManagerService.java b/services/core/java/com/android/server/tv/TvInputManagerService.java
index 4698b6d4a271..dc4dc6f30a01 100644
--- a/services/core/java/com/android/server/tv/TvInputManagerService.java
+++ b/services/core/java/com/android/server/tv/TvInputManagerService.java
@@ -879,10 +879,13 @@ public final class TvInputManagerService extends SystemService {
sessionState.session = null;
}
}
- logExternalInputEvent(FrameworkStatsLog.EXTERNAL_TV_INPUT_EVENT__EVENT_TYPE__RELEASED,
- mCurrentInputId, sessionState);
- mCurrentInputId = null;
- mCurrentSessionState = null;
+ if (mCurrentSessionState == sessionState) {
+ // only log when releasing the current on-screen session
+ logExternalInputEvent(FrameworkStatsLog.EXTERNAL_TV_INPUT_EVENT__EVENT_TYPE__RELEASED,
+ mCurrentInputId, sessionState);
+ mCurrentInputId = null;
+ mCurrentSessionState = null;
+ }
removeSessionStateLocked(sessionToken, userId);
return sessionState;
}
@@ -3046,6 +3049,7 @@ public final class TvInputManagerService extends SystemService {
}
private void logExternalInputEvent(int eventType, String inputId, SessionState sessionState) {
+ // TODO: handle recording sessions
UserState userState = getOrCreateUserStateLocked(sessionState.userId);
TvInputState tvInputState = userState.inputMap.get(inputId);
TvInputInfo tvInputInfo = tvInputState.info;