From 7af0ff9f38c4582d93ab484090b09a768886e398 Mon Sep 17 00:00:00 2001 From: "Baohe.Wang" Date: Sun, 30 Jun 2019 22:34:16 +0800 Subject: [PATCH] TvInputManagerService patch Fix potential null pointer access at TvInputManagerService.java Bug: 136411969 --- .../java/com/android/server/tv/TvInputManagerService.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/core/java/com/android/server/tv/TvInputManagerService.java b/services/core/java/com/android/server/tv/TvInputManagerService.java index b2677cb77d9c7..ef57ca1cf5cb6 100644 --- a/services/core/java/com/android/server/tv/TvInputManagerService.java +++ b/services/core/java/com/android/server/tv/TvInputManagerService.java @@ -840,6 +840,10 @@ public final class TvInputManagerService extends SystemService { private void setStateLocked(String inputId, int state, int userId) { UserState userState = getOrCreateUserStateLocked(userId); TvInputState inputState = userState.inputMap.get(inputId); + if (inputState == null) { + Slog.e(TAG, "failed to setStateLocked - unknown input id " + inputId); + return; + } ServiceState serviceState = userState.serviceStateMap.get(inputState.info.getComponent()); int oldState = inputState.state; inputState.state = state;