You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
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?
The text was updated successfully, but these errors were encountered: