From 6b5e22d52c69cb6d80ff09bd32395b0034ada343 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Thu, 28 Mar 2013 16:10:45 -0700 Subject: audio service: fix BT SCO intent permission again Commit 2a57ca93 did not address the calling permission for setMode() method which can also indirectly call BluetoothHeadset APIs. Bug 8242429 Change-Id: I8483c0492836192f47984c48629291cb261b001b --- media/java/android/media/AudioService.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java index 38cdb8a71a8e..cf48cdbdeca3 100644 --- a/media/java/android/media/AudioService.java +++ b/media/java/android/media/AudioService.java @@ -1533,7 +1533,9 @@ public class AudioService extends IAudioService.Stub implements OnFinished { // when entering RINGTONE, IN_CALL or IN_COMMUNICATION mode, clear all // SCO connections not started by the application changing the mode if (newModeOwnerPid != 0) { - disconnectBluetoothSco(newModeOwnerPid); + final long ident = Binder.clearCallingIdentity(); + disconnectBluetoothSco(newModeOwnerPid); + Binder.restoreCallingIdentity(ident); } } -- cgit v1.2.3-59-g8ed1b