AudioService: fix permission check.

Clear caller identity before calling TelecomManager.isInCall().

Bug: 18702149.
Change-Id: Ie057f3f261fc0a36dff51840cc8390408621d3bd
This commit is contained in:
Eric Laurent
2014-12-18 17:38:04 -08:00
parent 8a0399c442
commit 38edfda9bd

View File

@@ -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);
}