Merge "audioservice: Clear calling identity upon calling HdmiControlService" into lmp-mr1-dev

This commit is contained in:
Jinsuk Kim
2014-12-13 23:41:46 +00:00
committed by Android (Google) Code Review

View File

@@ -1159,8 +1159,13 @@ public class AudioService extends IAudioService.Stub {
synchronized (mHdmiManager) { synchronized (mHdmiManager) {
if (!mHdmiSystemAudioSupported) return; if (!mHdmiSystemAudioSupported) return;
synchronized (mHdmiTvClient) { synchronized (mHdmiTvClient) {
final long token = Binder.clearCallingIdentity();
try {
mHdmiTvClient.setSystemAudioVolume( mHdmiTvClient.setSystemAudioVolume(
(oldVolume + 5) / 10, (newVolume + 5) / 10, maxVolume); (oldVolume + 5) / 10, (newVolume + 5) / 10, maxVolume);
} finally {
Binder.restoreCallingIdentity(token);
}
} }
} }
} }
@@ -1538,18 +1543,17 @@ public class AudioService extends IAudioService.Stub {
private void setSystemAudioMute(boolean state) { private void setSystemAudioMute(boolean state) {
if (mHdmiManager == null || mHdmiTvClient == null) return; if (mHdmiManager == null || mHdmiTvClient == null) return;
synchronized (mHdmiManager) { synchronized (mHdmiManager) {
if (!mHdmiSystemAudioSupported) return;
synchronized (mHdmiTvClient) {
final long token = Binder.clearCallingIdentity(); final long token = Binder.clearCallingIdentity();
try { try {
synchronized (mHdmiTvClient) {
if (mHdmiSystemAudioSupported) {
mHdmiTvClient.setSystemAudioMute(state); mHdmiTvClient.setSystemAudioMute(state);
}
}
} finally { } finally {
Binder.restoreCallingIdentity(token); Binder.restoreCallingIdentity(token);
} }
} }
} }
}
/** get stream mute state. */ /** get stream mute state. */
public boolean isStreamMute(int streamType) { public boolean isStreamMute(int streamType) {