public static interface AudioInterrupt.InterruptListener
If an application needs to receive audio interruption messages, a listener must be set.
After the listener is set, InterruptListener#onInterrupt(int, int) will be called to notify the
application, if audio is interrupted.
SystemCapability.Multimedia#AUDIO| 限定符和类型 | 方法 | 说明 |
|---|---|---|
void |
onInterrupt(int type,
int hint) |
Called back to notify an application when its audio is interrupted by another application.
|
void onInterrupt(int type,
int hint)
type - Indicates the interruption type, which can be AudioInterrupt#INTERRUPT_TYPE_BEGIN
or AudioInterrupt#INTERRUPT_TYPE_END.hint - Indicates the interruption prompt, which can be AudioInterrupt#INTERRUPT_HINT_NONE,
AudioInterrupt#INTERRUPT_HINT_PAUSE, or AudioInterrupt#INTERRUPT_HINT_RESUME.