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

Commit dc13d5e2 authored by kunleiz's avatar kunleiz Committed by Gerrit - the friendly Code Review server
Browse files

audio: Volume can't adjust during HFP call when screen is off.

PhoneWindowManager don't pass the key to the application when screen is
off. In handleVolumeKey(), the STREAM_VOICE_CALL volume was set, so the
STREAM_BLUETOOTH_SCO volume can't be adjusted.
Add a judgement to choose the correct stream to adjust when screen is off.

Change-Id: I1ab06617d59b9bf2eabed9ed8b6892bc20db75b9
CRs-Fixed: 649548
parent 16ed8dbd
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -3959,6 +3959,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        final boolean down = event.getAction() == KeyEvent.ACTION_DOWN;
        final boolean canceled = event.isCanceled();
        final int keyCode = event.getKeyCode();
        AudioManager audioManager = (AudioManager) mContext.getSystemService(
                Context.AUDIO_SERVICE);

        if (SystemProperties.getInt("sys.quickboot.enable", 0) == 1) {

@@ -4092,7 +4094,11 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                                    && (result & ACTION_PASS_TO_USER) == 0) {
                                // If we are in call but we decided not to pass the key to
                                // the application, handle the volume change here.
                                if(audioManager.isBluetoothScoOn()) {
                                    handleVolumeKey(AudioManager.STREAM_BLUETOOTH_SCO, keyCode);
                                } else {
                                    handleVolumeKey(AudioManager.STREAM_VOICE_CALL, keyCode);
                                }
                                break;
                            }
                        } catch (RemoteException ex) {