Commit
2a57ca93 did not address the calling permission
for setMode() method which can also indirectly call
BluetoothHeadset APIs.
Bug
8242429
Change-Id: I8483c0492836192f47984c48629291cb261b001b
// 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);
}
}