Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f40bca9a authored by shubang's avatar shubang Committed by Android Build Coastguard Worker
Browse files

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 a2ab2772)
(cherry picked from commit 05363ef1)
parent 20c6f8d5
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -1981,10 +1981,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()