summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshubang <shubang@google.com>2021-08-13 15:42:15 -0700
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2021-09-20 22:30:19 +0000
commitaf6686bd5208632a01950e39db1a58812b794932 (patch)
tree8978f9510b900a8e00dcd628ddad5abdce026f5f
parent221e8967aa9db883811d22cbaabde5314c8c5d95 (diff)
downloadbase-af6686bd5208632a01950e39db1a58812b794932.tar.gz
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)
-rwxr-xr-xservices/core/java/com/android/server/tv/TvInputManagerService.java5
1 files 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 36a854e5374c..28947083854b 100755
--- a/services/core/java/com/android/server/tv/TvInputManagerService.java
+++ b/services/core/java/com/android/server/tv/TvInputManagerService.java
@@ -2304,10 +2304,9 @@ public final class TvInputManagerService extends SystemService {
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()