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

Commit ffb41749 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "audio: Inform audio HAL if it is a voice call initiated by Telephony"

parents 58f6adcb 59d961a1
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -446,6 +446,8 @@ public class AudioService extends IAudioService.Stub {

    private PowerManager.WakeLock mAudioEventWakeLock;

    private TelephonyManager mTelephonyManager;

    private final MediaFocusControl mMediaFocusControl;

    // Reference to BluetoothA2dp to query for AbsoluteVolume.
@@ -468,7 +470,6 @@ public class AudioService extends IAudioService.Stub {

        PowerManager pm = (PowerManager)context.getSystemService(Context.POWER_SERVICE);
        mAudioEventWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "handleAudioEvent");

        Vibrator vibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
        mHasVibrator = vibrator == null ? false : vibrator.hasVibrator();

@@ -481,6 +482,9 @@ public class AudioService extends IAudioService.Stub {
                com.android.internal.R.integer.config_soundEffectVolumeDb);

        mVolumePanel = new VolumePanel(context, this);

        mTelephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);

        mForcedUseForComm = AudioSystem.FORCE_NONE;

        createAudioSystemThread();
@@ -1585,6 +1589,11 @@ public class AudioService extends IAudioService.Stub {
            if (mode == AudioSystem.MODE_CURRENT) {
                mode = mMode;
            }

            if ((mode == AudioSystem.MODE_IN_CALL) &&
                (mTelephonyManager.getCallState() != TelephonyManager.CALL_STATE_IDLE)) {
                 AudioSystem.setParameters("in_call=true");
            }
            newModeOwnerPid = setModeInt(mode, cb, Binder.getCallingPid());
        }
        // when entering RINGTONE, IN_CALL or IN_COMMUNICATION mode, clear all