Merge "setWiredDeviceConnectionState requires MODIFY_AUDIO_ROUTING" am: e0f643dd3c

Change-Id: Ia4fb1c4b5f7972531c3f71201f25761396d85dfc
This commit is contained in:
Treehugger Robot
2020-03-25 18:16:26 +00:00
committed by Automerger Merge Worker
2 changed files with 2 additions and 0 deletions

View File

@@ -4218,6 +4218,7 @@ public class AudioManager {
* {@hide}
*/
@UnsupportedAppUsage
@RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING)
public void setWiredDeviceConnectionState(int type, int state, String address, String name) {
final IAudioService service = getService();
try {

View File

@@ -4335,6 +4335,7 @@ public class AudioService extends IAudioService.Stub
public void setWiredDeviceConnectionState(int type,
@ConnectionState int state, String address, String name,
String caller) {
enforceModifyAudioRoutingPermission();
if (state != CONNECTION_STATE_CONNECTED
&& state != CONNECTION_STATE_DISCONNECTED) {
throw new IllegalArgumentException("Invalid state " + state);