Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d5a1530f authored by David Brown's avatar David Brown
Browse files

Make the dialpad silent in "vibrate only" mode (bug 1984905).

This is a followup to https://android-git.corp.google.com/g/5438 (see bug
1839556) which made the dialpad silent if the phone was in "silent mode".

But "vibrate only" mode has a separate AudioManager constant:
RINGER_MODE_VIBRATE.  I need to check for that too.
parent 12402fef
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -708,7 +708,9 @@ public class TwelveKeyDialer extends Activity implements View.OnClickListener,
        // onResume(), since it's possible to toggle silent mode without
        // leaving the current activity (via the ENDCALL-longpress menu.)
        AudioManager audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
        if (audioManager.getRingerMode() == AudioManager.RINGER_MODE_SILENT) {
        int ringerMode = audioManager.getRingerMode();
        if ((ringerMode == AudioManager.RINGER_MODE_SILENT)
            || (ringerMode == AudioManager.RINGER_MODE_VIBRATE)) {
            return;
        }