From a9b95f54be681b30f5263c984fe5deebc2197df0 Mon Sep 17 00:00:00 2001 From: Kensuke Miyagi Date: Mon, 19 Jul 2021 13:35:21 -0700 Subject: [PATCH] Update TV input list upon package state changes in Kids profile Bug: 194118080 Test: Confirmed buildTvInputListLocked() gets properly called in Kids profile as well Change-Id: I0d0537a62fe7728b8e59330817606a352af08180 --- .../java/com/android/server/tv/TvInputManagerService.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/services/core/java/com/android/server/tv/TvInputManagerService.java b/services/core/java/com/android/server/tv/TvInputManagerService.java index 8658334dba1dd..36a854e5374c2 100755 --- a/services/core/java/com/android/server/tv/TvInputManagerService.java +++ b/services/core/java/com/android/server/tv/TvInputManagerService.java @@ -209,10 +209,11 @@ public final class TvInputManagerService extends SystemService { private void registerBroadcastReceivers() { PackageMonitor monitor = new PackageMonitor() { private void buildTvInputList(String[] packages) { + int userId = getChangingUserId(); synchronized (mLock) { - if (mCurrentUserId == getChangingUserId()) { - buildTvInputListLocked(mCurrentUserId, packages); - buildTvContentRatingSystemListLocked(mCurrentUserId); + if (mCurrentUserId == userId || mRunningProfiles.contains(userId)) { + buildTvInputListLocked(userId, packages); + buildTvContentRatingSystemListLocked(userId); } } }