From 0de9a836b74a5ffcc8d520ee7d1d53a68b564804 Mon Sep 17 00:00:00 2001 From: Jaewan Kim Date: Tue, 11 May 2021 21:21:40 +0900 Subject: [PATCH] Stop ignoring media key events in PhoneFallbackEventHandler while in call Without the extra check, keys will be routed to the telecom service via MediaSessionService. The telecom service can decide the media key handling. Bug: 187527519 Test: Manually press media play/pause key on 3.5mm headset while in call with Pixel 3a Change-Id: I01002a83e0b752f8355dca307b42400a9489097a --- .../android/internal/policy/PhoneFallbackEventHandler.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/core/java/com/android/internal/policy/PhoneFallbackEventHandler.java b/core/java/com/android/internal/policy/PhoneFallbackEventHandler.java index f07f667f269fa..b321ac08912b8 100644 --- a/core/java/com/android/internal/policy/PhoneFallbackEventHandler.java +++ b/core/java/com/android/internal/policy/PhoneFallbackEventHandler.java @@ -97,11 +97,6 @@ public class PhoneFallbackEventHandler implements FallbackEventHandler { case KeyEvent.KEYCODE_MEDIA_PLAY: case KeyEvent.KEYCODE_MEDIA_PAUSE: case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE: - /* Suppress PLAY/PAUSE toggle when phone is ringing or in-call - * to avoid music playback */ - if (getTelephonyManager().getCallState() != TelephonyManager.CALL_STATE_IDLE) { - return true; // suppress key event - } case KeyEvent.KEYCODE_MUTE: case KeyEvent.KEYCODE_HEADSETHOOK: case KeyEvent.KEYCODE_MEDIA_STOP: