Merge "setWiredDeviceConnectionState requires MODIFY_AUDIO_ROUTING"
This commit is contained in:
@@ -4213,6 +4213,7 @@ public class AudioManager {
|
|||||||
* {@hide}
|
* {@hide}
|
||||||
*/
|
*/
|
||||||
@UnsupportedAppUsage
|
@UnsupportedAppUsage
|
||||||
|
@RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING)
|
||||||
public void setWiredDeviceConnectionState(int type, int state, String address, String name) {
|
public void setWiredDeviceConnectionState(int type, int state, String address, String name) {
|
||||||
final IAudioService service = getService();
|
final IAudioService service = getService();
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -4318,6 +4318,7 @@ public class AudioService extends IAudioService.Stub
|
|||||||
public void setWiredDeviceConnectionState(int type,
|
public void setWiredDeviceConnectionState(int type,
|
||||||
@ConnectionState int state, String address, String name,
|
@ConnectionState int state, String address, String name,
|
||||||
String caller) {
|
String caller) {
|
||||||
|
enforceModifyAudioRoutingPermission();
|
||||||
if (state != CONNECTION_STATE_CONNECTED
|
if (state != CONNECTION_STATE_CONNECTED
|
||||||
&& state != CONNECTION_STATE_DISCONNECTED) {
|
&& state != CONNECTION_STATE_DISCONNECTED) {
|
||||||
throw new IllegalArgumentException("Invalid state " + state);
|
throw new IllegalArgumentException("Invalid state " + state);
|
||||||
|
|||||||
Reference in New Issue
Block a user