Code example for AudioManager

Methods: getRingerModesetRingerMode

0
        public void run() { 
            faceDownIsRunning = true; 
            if (cancelRunDown) { 
                switch (getUserFlipAudioMode(service)) { 
                    case MODE_SILENT: 
                        if (am.getRingerMode() == AudioManager.RINGER_MODE_NORMAL) { 
                            am.setRingerMode(MODE_SILENT); 
                            switchSoundBack = true; 
                            wasFaceUp = false; 
                            wasFaceDown = true; 
                            vib.vibrate(pattern, -1); 
                            log("face over, lets go silent!"); 
                        } 
                        break; 
                    case MODE_VIBRATE: 
                        if (am.getRingerMode() == AudioManager.RINGER_MODE_NORMAL) { 
                            am.setRingerMode(MODE_VIBRATE); 
                            switchSoundBack = true; 
                            wasFaceUp = false; 
                            wasFaceDown = true; 
                            vib.vibrate(pattern, -1);