diff options
author | Jae Seo <jaeseo@google.com> | 2014-07-12 19:25:24 -0700 |
---|---|---|
committer | Jae Seo <jaeseo@google.com> | 2014-07-17 20:25:01 -0700 |
commit | b375805f3b1672e68d1511565af4700e5fa8491d (patch) | |
tree | f76a703546a36c87bd3b4832d20b0a0a31d73841 /services | |
parent | 56d77b9c8325bd2f88c5214b670ac37c2b7460a3 (diff) | |
download | frameworks_base-b375805f3b1672e68d1511565af4700e5fa8491d.zip frameworks_base-b375805f3b1672e68d1511565af4700e5fa8491d.tar.gz frameworks_base-b375805f3b1672e68d1511565af4700e5fa8491d.tar.bz2 |
TIF: Add a method to get TvInputInfo for a given TV input
This is going to be needed by applications to get information about the
inputs that are just added thus not included in the previously retrieved
input list.
Bug: 16166859, Bug: 15838097
Change-Id: Icecd03fcea208a0c4d41caab1eec64e574f40877
Diffstat (limited to 'services')
-rw-r--r-- | services/core/java/com/android/server/tv/TvInputManagerService.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/tv/TvInputManagerService.java b/services/core/java/com/android/server/tv/TvInputManagerService.java index f679f79..0407b10 100644 --- a/services/core/java/com/android/server/tv/TvInputManagerService.java +++ b/services/core/java/com/android/server/tv/TvInputManagerService.java @@ -754,6 +754,22 @@ public final class TvInputManagerService extends SystemService { } @Override + public TvInputInfo getTvInputInfo(String inputId, int userId) { + final int resolvedUserId = resolveCallingUserId(Binder.getCallingPid(), + Binder.getCallingUid(), userId, "getTvInputInfo"); + final long identity = Binder.clearCallingIdentity(); + try { + synchronized (mLock) { + UserState userState = getUserStateLocked(resolvedUserId); + TvInputState state = userState.inputMap.get(inputId); + return state == null ? null : state.mInfo; + } + } finally { + Binder.restoreCallingIdentity(identity); + } + } + + @Override public void registerCallback(final ITvInputManagerCallback callback, int userId) { final int resolvedUserId = resolveCallingUserId(Binder.getCallingPid(), Binder.getCallingUid(), userId, "registerCallback"); |