From 38edfda9bdd282228db08e3cc449b554b8744625 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Thu, 18 Dec 2014 17:38:04 -0800 Subject: AudioService: fix permission check. Clear caller identity before calling TelecomManager.isInCall(). Bug: 18702149. Change-Id: Ie057f3f261fc0a36dff51840cc8390408621d3bd --- media/java/android/media/AudioService.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'media/java') diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java index 8a543ce..1c10422 100644 --- a/media/java/android/media/AudioService.java +++ b/media/java/android/media/AudioService.java @@ -3248,7 +3248,10 @@ public class AudioService extends IAudioService.Stub { TelecomManager telecomManager = (TelecomManager) mContext.getSystemService(Context.TELECOM_SERVICE); + + final long ident = Binder.clearCallingIdentity(); IsInCall = telecomManager.isInCall(); + Binder.restoreCallingIdentity(ident); return (IsInCall || getMode() == AudioManager.MODE_IN_COMMUNICATION); } -- cgit v1.1