From a897e5f5e32557efa03c375fde17faae3282673f Mon Sep 17 00:00:00 2001 From: Dongwon Kang Date: Tue, 19 Apr 2016 13:39:47 -0700 Subject: [PATCH] TIF: Do not build input list for background user Building input list for background user leads to unnecessary connection request to hardware input and that causes incomplete service state. Bug: 27407198 Change-Id: Id8d5d5001394781edd2dafe8681c674855332ae3 --- .../java/com/android/server/tv/TvInputManagerService.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/tv/TvInputManagerService.java b/services/core/java/com/android/server/tv/TvInputManagerService.java index 30442bcba48f2..e13ee13e06533 100644 --- a/services/core/java/com/android/server/tv/TvInputManagerService.java +++ b/services/core/java/com/android/server/tv/TvInputManagerService.java @@ -161,8 +161,10 @@ public final class TvInputManagerService extends SystemService { PackageMonitor monitor = new PackageMonitor() { private void buildTvInputList(String[] packages) { synchronized (mLock) { - buildTvInputListLocked(getChangingUserId(), packages); - buildTvContentRatingSystemListLocked(getChangingUserId()); + if (mCurrentUserId == getChangingUserId()) { + buildTvInputListLocked(mCurrentUserId, packages); + buildTvContentRatingSystemListLocked(mCurrentUserId); + } } }