Merge "AudioService: fix broadcast of ACTION_SPEAKERPHONE_STATE_CHANGED" into qt-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
95baff256e
@@ -3368,8 +3368,14 @@ public class AudioService extends IAudioService.Stub
|
|||||||
.append(Binder.getCallingPid()).toString();
|
.append(Binder.getCallingPid()).toString();
|
||||||
final boolean stateChanged = mDeviceBroker.setSpeakerphoneOn(on, eventSource);
|
final boolean stateChanged = mDeviceBroker.setSpeakerphoneOn(on, eventSource);
|
||||||
if (stateChanged) {
|
if (stateChanged) {
|
||||||
mContext.sendBroadcast(new Intent(AudioManager.ACTION_SPEAKERPHONE_STATE_CHANGED)
|
final long ident = Binder.clearCallingIdentity();
|
||||||
.setFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY));
|
try {
|
||||||
|
mContext.sendBroadcastAsUser(
|
||||||
|
new Intent(AudioManager.ACTION_SPEAKERPHONE_STATE_CHANGED)
|
||||||
|
.setFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY), UserHandle.ALL);
|
||||||
|
} finally {
|
||||||
|
Binder.restoreCallingIdentity(ident);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user