Loading core/java/android/provider/Settings.java +10 −0 Original line number Diff line number Diff line Loading @@ -2374,6 +2374,16 @@ public final class Settings { */ public static final String VIBRATE_WHEN_RINGING = "vibrate_when_ringing"; /** * Whether automatic routing of system audio to USB audio peripheral is disabled. * The value is boolean (1 or 0), where 1 means automatic routing is disabled, * and 0 means automatic routing is enabled. * * @hide */ public static final String USB_AUDIO_AUTOMATIC_ROUTING_DISABLED = "usb_audio_automatic_routing_disabled"; /** * Whether the audible DTMF tones are played by the dialer when dialing. The value is * boolean (1 or 0). Loading media/java/android/media/AudioService.java +11 −0 Original line number Diff line number Diff line Loading @@ -4573,6 +4573,17 @@ public class AudioService extends IAudioService.Stub { outDevice = AudioSystem.DEVICE_OUT_USB_ACCESSORY; setWiredDeviceConnectionState(outDevice, state, params); } else if (action.equals(Intent.ACTION_USB_AUDIO_DEVICE_PLUG)) { // FIXME Does not yet handle the case where the setting is changed // after device connection. Ideally we should handle the settings change // in SettingsObserver. Here we should log that a USB device is connected // and disconnected with its address (card , device) and force the // connection or disconnection when the setting changes. int isDisabled = Settings.System.getInt(mContentResolver, Settings.System.USB_AUDIO_AUTOMATIC_ROUTING_DISABLED, 0); if (isDisabled != 0) { return; } state = intent.getIntExtra("state", 0); int alsaCard = intent.getIntExtra("card", -1); Loading Loading
core/java/android/provider/Settings.java +10 −0 Original line number Diff line number Diff line Loading @@ -2374,6 +2374,16 @@ public final class Settings { */ public static final String VIBRATE_WHEN_RINGING = "vibrate_when_ringing"; /** * Whether automatic routing of system audio to USB audio peripheral is disabled. * The value is boolean (1 or 0), where 1 means automatic routing is disabled, * and 0 means automatic routing is enabled. * * @hide */ public static final String USB_AUDIO_AUTOMATIC_ROUTING_DISABLED = "usb_audio_automatic_routing_disabled"; /** * Whether the audible DTMF tones are played by the dialer when dialing. The value is * boolean (1 or 0). Loading
media/java/android/media/AudioService.java +11 −0 Original line number Diff line number Diff line Loading @@ -4573,6 +4573,17 @@ public class AudioService extends IAudioService.Stub { outDevice = AudioSystem.DEVICE_OUT_USB_ACCESSORY; setWiredDeviceConnectionState(outDevice, state, params); } else if (action.equals(Intent.ACTION_USB_AUDIO_DEVICE_PLUG)) { // FIXME Does not yet handle the case where the setting is changed // after device connection. Ideally we should handle the settings change // in SettingsObserver. Here we should log that a USB device is connected // and disconnected with its address (card , device) and force the // connection or disconnection when the setting changes. int isDisabled = Settings.System.getInt(mContentResolver, Settings.System.USB_AUDIO_AUTOMATIC_ROUTING_DISABLED, 0); if (isDisabled != 0) { return; } state = intent.getIntExtra("state", 0); int alsaCard = intent.getIntExtra("card", -1); Loading