33 lines
1.8 KiB
Diff
33 lines
1.8 KiB
Diff
![]() |
From 42d49fdc6c1fd642ee9cce75091f7a9eeea83649 Mon Sep 17 00:00:00 2001
|
||
|
From: shubang <shubang@google.com>
|
||
|
Date: Fri, 13 Aug 2021 15:42:15 -0700
|
||
|
Subject: [PATCH] TIF: fix issue of using caller-aware methods after
|
||
|
clearCallingIdentity()
|
||
|
|
||
|
Bug: 189824175
|
||
|
Test: atest android.media.tv.cts.TvInputManagerTest
|
||
|
Change-Id: Iced6c2245c0099bc4bcdaceb51f8cce4dbc0a392
|
||
|
(cherry picked from commit a2ab2772d70984b1c24d5d4509b9c7a5abea71f9)
|
||
|
(cherry picked from commit 05363ef193ae231fc7a1fe666de88861e1084b17)
|
||
|
---
|
||
|
.../java/com/android/server/tv/TvInputManagerService.java | 5 ++---
|
||
|
1 file changed, 2 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 d5e59c8dfd6a..e6d2cb50bf52 100644
|
||
|
--- a/services/core/java/com/android/server/tv/TvInputManagerService.java
|
||
|
+++ b/services/core/java/com/android/server/tv/TvInputManagerService.java
|
||
|
@@ -1970,10 +1970,9 @@ private void ensureCaptureTvInputPermission() {
|
||
|
public void requestChannelBrowsable(Uri channelUri, int userId)
|
||
|
throws RemoteException {
|
||
|
final String callingPackageName = getCallingPackageName();
|
||
|
+ final int resolvedUserId = resolveCallingUserId(Binder.getCallingPid(),
|
||
|
+ Binder.getCallingUid(), userId, "requestChannelBrowsable");
|
||
|
final long identity = Binder.clearCallingIdentity();
|
||
|
- final int callingUid = Binder.getCallingUid();
|
||
|
- final int resolvedUserId = resolveCallingUserId(Binder.getCallingPid(), callingUid,
|
||
|
- userId, "requestChannelBrowsable");
|
||
|
try {
|
||
|
Intent intent = new Intent(TvContract.ACTION_CHANNEL_BROWSABLE_REQUESTED);
|
||
|
List<ResolveInfo> list = getContext().getPackageManager()
|