Loading src/com/android/server/telecom/InCallAdapter.java +11 −4 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.net.Uri; import android.os.Binder; import android.os.Bundle; import android.os.ResultReceiver; import android.os.UserHandle; import android.telecom.CallEndpoint; import android.telecom.Log; import android.telecom.PhoneAccountHandle; Loading Loading @@ -420,7 +421,8 @@ class InCallAdapter extends IInCallAdapter.Stub { Log.startSession(LogUtils.Sessions.ICA_ENTER_AUDIO_PROCESSING, mOwnerPackageAbbreviation); // TODO: enforce the extra permission. Binder.withCleanCallingIdentity(() -> { long token = Binder.clearCallingIdentity(); try { synchronized (mLock) { Call call = mCallIdMapper.getCall(callId); if (call != null) { Loading @@ -429,7 +431,9 @@ class InCallAdapter extends IInCallAdapter.Stub { Log.w(this, "enterBackgroundAudioProcessing, unknown call id: %s", callId); } } }); } finally { Binder.restoreCallingIdentity(token); } } finally { Log.endSession(); } Loading @@ -440,7 +444,8 @@ class InCallAdapter extends IInCallAdapter.Stub { try { Log.startSession(LogUtils.Sessions.ICA_EXIT_AUDIO_PROCESSING, mOwnerPackageAbbreviation); Binder.withCleanCallingIdentity(() -> { long token = Binder.clearCallingIdentity(); try { synchronized (mLock) { Call call = mCallIdMapper.getCall(callId); if (call != null) { Loading @@ -450,7 +455,9 @@ class InCallAdapter extends IInCallAdapter.Stub { "exitBackgroundAudioProcessing, unknown call id: %s", callId); } } }); } finally { Binder.restoreCallingIdentity(token); } } finally { Log.endSession(); } Loading src/com/android/server/telecom/TelecomServiceImpl.java +16 −6 Original line number Diff line number Diff line Loading @@ -1994,8 +1994,12 @@ public class TelecomServiceImpl { if (args != null && args.length > 0 && Analytics.ANALYTICS_DUMPSYS_ARG.equals( args[0])) { Binder.withCleanCallingIdentity(() -> Analytics.dumpToEncodedProto(mContext, writer, args)); long token = Binder.clearCallingIdentity(); try { Analytics.dumpToEncodedProto(mContext, writer, args); } finally { Binder.restoreCallingIdentity(token); } return; } Loading Loading @@ -2243,7 +2247,8 @@ public class TelecomServiceImpl { try { synchronized (mLock) { enforceShellOnly(Binder.getCallingUid(), "cleanupStuckCalls"); Binder.withCleanCallingIdentity(() -> { long token = Binder.clearCallingIdentity(); try { Set<UserHandle> userHandles = new HashSet<>(); for (Call call : mCallsManager.getCalls()) { call.cleanup(); Loading @@ -2256,7 +2261,9 @@ public class TelecomServiceImpl { for (UserHandle userHandle : userHandles) { mCallsManager.getInCallController().unbindFromServices(userHandle); } }); } finally { Binder.restoreCallingIdentity(token); } } } finally { Log.endSession(); Loading Loading @@ -2333,11 +2340,14 @@ public class TelecomServiceImpl { try { synchronized (mLock) { enforceShellOnly(Binder.getCallingUid(), "resetCarMode"); Binder.withCleanCallingIdentity(() -> { long token = Binder.clearCallingIdentity(); try { UiModeManager uiModeManager = mContext.getSystemService(UiModeManager.class); uiModeManager.disableCarMode(UiModeManager.DISABLE_CAR_MODE_ALL_PRIORITIES); }); } finally { Binder.restoreCallingIdentity(token); } } } finally { Log.endSession(); Loading Loading
src/com/android/server/telecom/InCallAdapter.java +11 −4 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.net.Uri; import android.os.Binder; import android.os.Bundle; import android.os.ResultReceiver; import android.os.UserHandle; import android.telecom.CallEndpoint; import android.telecom.Log; import android.telecom.PhoneAccountHandle; Loading Loading @@ -420,7 +421,8 @@ class InCallAdapter extends IInCallAdapter.Stub { Log.startSession(LogUtils.Sessions.ICA_ENTER_AUDIO_PROCESSING, mOwnerPackageAbbreviation); // TODO: enforce the extra permission. Binder.withCleanCallingIdentity(() -> { long token = Binder.clearCallingIdentity(); try { synchronized (mLock) { Call call = mCallIdMapper.getCall(callId); if (call != null) { Loading @@ -429,7 +431,9 @@ class InCallAdapter extends IInCallAdapter.Stub { Log.w(this, "enterBackgroundAudioProcessing, unknown call id: %s", callId); } } }); } finally { Binder.restoreCallingIdentity(token); } } finally { Log.endSession(); } Loading @@ -440,7 +444,8 @@ class InCallAdapter extends IInCallAdapter.Stub { try { Log.startSession(LogUtils.Sessions.ICA_EXIT_AUDIO_PROCESSING, mOwnerPackageAbbreviation); Binder.withCleanCallingIdentity(() -> { long token = Binder.clearCallingIdentity(); try { synchronized (mLock) { Call call = mCallIdMapper.getCall(callId); if (call != null) { Loading @@ -450,7 +455,9 @@ class InCallAdapter extends IInCallAdapter.Stub { "exitBackgroundAudioProcessing, unknown call id: %s", callId); } } }); } finally { Binder.restoreCallingIdentity(token); } } finally { Log.endSession(); } Loading
src/com/android/server/telecom/TelecomServiceImpl.java +16 −6 Original line number Diff line number Diff line Loading @@ -1994,8 +1994,12 @@ public class TelecomServiceImpl { if (args != null && args.length > 0 && Analytics.ANALYTICS_DUMPSYS_ARG.equals( args[0])) { Binder.withCleanCallingIdentity(() -> Analytics.dumpToEncodedProto(mContext, writer, args)); long token = Binder.clearCallingIdentity(); try { Analytics.dumpToEncodedProto(mContext, writer, args); } finally { Binder.restoreCallingIdentity(token); } return; } Loading Loading @@ -2243,7 +2247,8 @@ public class TelecomServiceImpl { try { synchronized (mLock) { enforceShellOnly(Binder.getCallingUid(), "cleanupStuckCalls"); Binder.withCleanCallingIdentity(() -> { long token = Binder.clearCallingIdentity(); try { Set<UserHandle> userHandles = new HashSet<>(); for (Call call : mCallsManager.getCalls()) { call.cleanup(); Loading @@ -2256,7 +2261,9 @@ public class TelecomServiceImpl { for (UserHandle userHandle : userHandles) { mCallsManager.getInCallController().unbindFromServices(userHandle); } }); } finally { Binder.restoreCallingIdentity(token); } } } finally { Log.endSession(); Loading Loading @@ -2333,11 +2340,14 @@ public class TelecomServiceImpl { try { synchronized (mLock) { enforceShellOnly(Binder.getCallingUid(), "resetCarMode"); Binder.withCleanCallingIdentity(() -> { long token = Binder.clearCallingIdentity(); try { UiModeManager uiModeManager = mContext.getSystemService(UiModeManager.class); uiModeManager.disableCarMode(UiModeManager.DISABLE_CAR_MODE_ALL_PRIORITIES); }); } finally { Binder.restoreCallingIdentity(token); } } } finally { Log.endSession(); Loading