Android Audio Mode Check isPhoneSilent(AudioManager audioManager)

Here you can find the source of isPhoneSilent(AudioManager audioManager)

Description

Returns whether the phone is currently in silent mode.

Declaration

public static boolean isPhoneSilent(AudioManager audioManager) 

Method Source Code

//package com.java2s;
import android.media.AudioManager;

public class Main {
    /**//from ww w.  j ava 2  s.c o  m
     * Returns whether the phone is currently in silent mode.
     */
    public static boolean isPhoneSilent(AudioManager audioManager) {
        return audioManager.getRingerMode() == AudioManager.RINGER_MODE_SILENT;
    }
}