Merge "setWiredDeviceConnectionState requires MODIFY_AUDIO_ROUTING"
This commit is contained in:
@@ -4213,6 +4213,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 {
|
||||
|
||||
@@ -4318,6 +4318,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);
|
||||
|
||||
Reference in New Issue
Block a user