Loading core/java/com/android/internal/policy/PhoneWindow.java +15 −3 Original line number Diff line number Diff line Loading @@ -1942,9 +1942,9 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { case KeyEvent.KEYCODE_VOLUME_UP: case KeyEvent.KEYCODE_VOLUME_DOWN: case KeyEvent.KEYCODE_VOLUME_MUTE: { // If we have a session send it the volume command, otherwise // use the suggested stream. if (mMediaController != null) { // If we have a session and no active phone call send it the volume command, // otherwise use the suggested stream. if (mMediaController != null && !isActivePhoneCallKnown()) { getMediaSessionManager().dispatchVolumeKeyEventToSessionAsSystemService(event, mMediaController.getSessionToken()); } else { Loading Loading @@ -1995,6 +1995,18 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { return false; } private boolean isActivePhoneCallKnown() { boolean isActivePhoneCallKnown = false; AudioManager audioManager = (AudioManager) getContext().getSystemService(Context.AUDIO_SERVICE); int audioManagerMode = audioManager.getMode(); if (audioManagerMode == AudioManager.MODE_IN_CALL || audioManagerMode == AudioManager.MODE_IN_COMMUNICATION) { isActivePhoneCallKnown = true; } return isActivePhoneCallKnown; } private KeyguardManager getKeyguardManager() { if (mKeyguardManager == null) { mKeyguardManager = (KeyguardManager) getContext().getSystemService( Loading Loading
core/java/com/android/internal/policy/PhoneWindow.java +15 −3 Original line number Diff line number Diff line Loading @@ -1942,9 +1942,9 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { case KeyEvent.KEYCODE_VOLUME_UP: case KeyEvent.KEYCODE_VOLUME_DOWN: case KeyEvent.KEYCODE_VOLUME_MUTE: { // If we have a session send it the volume command, otherwise // use the suggested stream. if (mMediaController != null) { // If we have a session and no active phone call send it the volume command, // otherwise use the suggested stream. if (mMediaController != null && !isActivePhoneCallKnown()) { getMediaSessionManager().dispatchVolumeKeyEventToSessionAsSystemService(event, mMediaController.getSessionToken()); } else { Loading Loading @@ -1995,6 +1995,18 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { return false; } private boolean isActivePhoneCallKnown() { boolean isActivePhoneCallKnown = false; AudioManager audioManager = (AudioManager) getContext().getSystemService(Context.AUDIO_SERVICE); int audioManagerMode = audioManager.getMode(); if (audioManagerMode == AudioManager.MODE_IN_CALL || audioManagerMode == AudioManager.MODE_IN_COMMUNICATION) { isActivePhoneCallKnown = true; } return isActivePhoneCallKnown; } private KeyguardManager getKeyguardManager() { if (mKeyguardManager == null) { mKeyguardManager = (KeyguardManager) getContext().getSystemService( Loading