mute the phone kotlin
snippet in kotlin

mute the phone kotlin

user8420

private fun mutePhone() {
  		// permission needed
  		// <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
        val audiomanager = getSystemService(Context.AUDIO_SERVICE) as AudioManager
        audiomanager.ringerMode = AudioManager.RINGER_MODE_SILENT
    }