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

Commit b245d169 authored by Venkatarama Avadhani's avatar Venkatarama Avadhani Committed by Yixiao Luo
Browse files

TVIF: Fix use of caller-aware methods after clearCallingIdentity()

Bug: 197160164
Test: atest android.media.tv.cts.TvInputManagerTest
Change-Id: I2c95962f1f8db97ed70c29705a0c88b21910e7ee
(cherry picked from commit 31318276a291039e0cb408356013deda7c9de416)
parent f0eb41bb
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -2184,10 +2184,10 @@ public final class TvInputManagerService extends SystemService {
                return null;
            }

            final long identity = Binder.clearCallingIdentity();
            final int callingUid = Binder.getCallingUid();
            final int resolvedUserId = resolveCallingUserId(Binder.getCallingPid(), callingUid,
                    userId, "acquireTvInputHardware");
            final long identity = Binder.clearCallingIdentity();
            try {
                return mTvInputHardwareManager.acquireHardware(
                        deviceId, callback, info, callingUid, resolvedUserId,
@@ -2205,10 +2205,10 @@ public final class TvInputManagerService extends SystemService {
                return;
            }

            final long identity = Binder.clearCallingIdentity();
            final int callingUid = Binder.getCallingUid();
            final int resolvedUserId = resolveCallingUserId(Binder.getCallingPid(), callingUid,
                    userId, "releaseTvInputHardware");
            final long identity = Binder.clearCallingIdentity();
            try {
                mTvInputHardwareManager.releaseHardware(
                        deviceId, hardware, callingUid, resolvedUserId);
@@ -2350,10 +2350,10 @@ public final class TvInputManagerService extends SystemService {
                throws RemoteException {
            ensureCaptureTvInputPermission();

            final long identity = Binder.clearCallingIdentity();
            final int callingUid = Binder.getCallingUid();
            final int resolvedUserId = resolveCallingUserId(Binder.getCallingPid(), callingUid,
                    userId, "getAvailableTvStreamConfigList");
            final long identity = Binder.clearCallingIdentity();
            try {
                return mTvInputHardwareManager.getAvailableTvStreamConfigList(
                        inputId, callingUid, resolvedUserId);
@@ -2368,10 +2368,10 @@ public final class TvInputManagerService extends SystemService {
                throws RemoteException {
            ensureCaptureTvInputPermission();

            final long identity = Binder.clearCallingIdentity();
            final int callingUid = Binder.getCallingUid();
            final int resolvedUserId = resolveCallingUserId(Binder.getCallingPid(), callingUid,
                    userId, "captureFrame");
            final long identity = Binder.clearCallingIdentity();
            try {
                String hardwareInputId = null;
                synchronized (mLock) {
@@ -2400,10 +2400,10 @@ public final class TvInputManagerService extends SystemService {
        @Override
        public boolean isSingleSessionActive(int userId) throws RemoteException {
            ensureCaptureTvInputPermission();
            final long identity = Binder.clearCallingIdentity();
            final int callingUid = Binder.getCallingUid();
            final int resolvedUserId = resolveCallingUserId(Binder.getCallingPid(), callingUid,
                    userId, "isSingleSessionActive");
            final long identity = Binder.clearCallingIdentity();
            try {
                synchronized (mLock) {
                    UserState userState = getOrCreateUserStateLocked(resolvedUserId);