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

Commit 7d4d2279 authored by kunleiz's avatar kunleiz Committed by Steve Kondik
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.

CRs-Fixed: 649548

Conflicts:
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java

Change-Id: I1ab06617d59b9bf2eabed9ed8b6892bc20db75b9
parent 2a8064c8
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -4575,6 +4575,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        final boolean canceled = event.isCanceled();
        int keyCode = event.getKeyCode();
        int scanCode = event.getScanCode();
        AudioManager audioManager = (AudioManager) mContext.getSystemService(
                Context.AUDIO_SERVICE);

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

@@ -4807,7 +4809,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) {