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

Commit 8abc9e9b authored by Jeff Brown's avatar Jeff Brown Committed by Android (Google) Code Review
Browse files

Merge "Don't play a sound if a volume key press is canceled." into gingerbread

parents ff38e38d 8b7a982d
Loading
Loading
Loading
Loading
+14 −12
Original line number Diff line number Diff line
@@ -1317,6 +1317,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
        switch (keyCode) {
            case KeyEvent.KEYCODE_VOLUME_UP:
            case KeyEvent.KEYCODE_VOLUME_DOWN: {
                if (!event.isCanceled()) {
                    AudioManager audioManager = (AudioManager) getContext().getSystemService(
                            Context.AUDIO_SERVICE);
                    if (audioManager != null) {
@@ -1330,6 +1331,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
                                AudioManager.FLAG_PLAY_SOUND);
                        mVolumeKeyUpTime = SystemClock.uptimeMillis();
                    }
                }
                return true;
            }