通过dumpsys audio查看当前系统音量状态
adb shell dumpsys audio
MediaFocusControl dump time: 上午6:20:53
Audio Focus stack entries (last is top of stack):
No external focus policy
Notify on duck: true
In ring or call: false
Audio event log: focus commands as seen by MediaFocusControl
Stream volumes (device: index)
- STREAM_VOICE_CALL:
Muted: false
Min: 1
Max: 7
Current: 40000000 (default): 6
Devices: earpiece
- STREAM_SYSTEM:
Muted: true
Min: 0
Max: 15
Current: 2 (speaker): 0, 40000000 (default): 15
Devices: speaker
- STREAM_RING:
Muted: true
Min: 0
Max: 15
Current: 2 (speaker): 0, 40000000 (default): 15
Devices: speaker
- STREAM_MUSIC:
Muted: false
Min: 0
Max: 15
Current: 4 (headset): 10, 8 (headphone): 10, 4000000 (usb_headset): 2, 40000000 (default): 12
Devices: speaker
- STREAM_ALARM:
Muted: false
Min: 1
Max: 15
Current: 40000000 (default): 12
Devices: speaker
- STREAM_NOTIFICATION:
Muted: false
Min: 0
Max: 15
Current: 2 (speaker): 12, 40000000 (default): 8
Devices: speaker
- STREAM_BLUETOOTH_SCO:
Muted: false
Min: 0
Max: 15
Current: 40000000 (default): 7
Devices: earpiece
- STREAM_SYSTEM_ENFORCED:
Muted: true
Min: 0
Max: 15
Current: 2 (speaker): 0, 40000000 (default): 15
Devices: speaker
- STREAM_DTMF:
Muted: true
Min: 0
Max: 15
Current: 2 (speaker): 0, 40000000 (default): 15
Devices: speaker
- STREAM_TTS:
Muted: false
Min: 0
Max: 15
Current: 4 (headset): 10, 8 (headphone): 10, 4000000 (usb_headset): 2, 40000000 (default): 12
Devices: speaker
- STREAM_ACCESSIBILITY:
Muted: false
Min: 1
Max: 15
Current: 4 (headset): 10, 8 (headphone): 10, 4000000 (usb_headset): 2, 40000000 (default): 12
Devices: speaker
- mute affected streams = 0x2f
通过上面可以清晰的看到当前这种音量的状态