While using the AudioManager API to get the Phone ringer mode, the value return only for the mute/sleep is wrong, it returns the RINGER_MODE_VIBRATE instead of RINGER_MODE_SILENT on Android 6, where as the values returned correctly on Android 9 and 10.
Code is:
AudioManager am = (AudioManager)getSystemService(Context.AUDIO_SERVICE);
switch (am.getRingerMode()) {
case AudioManager.RINGER_MODE_SILENT:
Log.i("MyApp","Silent mode");
break;
case AudioManager.RINGER_MODE_VIBRATE:
Log.i("MyApp","Vibrate mode");
break;
case AudioManager.RINGER_MODE_NORMAL:
Log.i("MyApp","Normal mode");
break;}
Ringer mode are set through phone sound/mute/vibrate profiles.
How to get correct value for silent mode?
Android OS : 6.0 Device : Moto-G 2nd Gen
While using the AudioManager API to get the Phone ringer mode, the value return only for the mute/sleep is wrong, it returns the RINGER_MODE_VIBRATE instead of RINGER_MODE_SILENT on Android 6, where as the values returned correctly on Android 9 and 10.
Code is:
AudioManager am = (AudioManager)getSystemService(Context.AUDIO_SERVICE);
Ringer mode are set through phone sound/mute/vibrate profiles. How to get correct value for silent mode?