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

Commit 486b36f9 authored by Grace Jia's avatar Grace Jia Committed by Android (Google) Code Review
Browse files

Merge "Set audio mode back to normal before we abandon the audio focus after call." into main

parents d1f46f22 e8d55d48
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ aconfig_declarations {
      "telecom_incallservice_flags.aconfig",
      "telecom_default_phone_account_flags.aconfig",
      "telecom_callaudioroutestatemachine_flags.aconfig",
      "telecom_callaudiomodestatemachine_flags.aconfig",
      "telecom_calllog_flags.aconfig",
      "telecom_resolve_hidden_dependencies.aconfig"
    ],
+8 −0
Original line number Diff line number Diff line
package: "com.android.server.telecom.flags"

flag {
  name: "set_audio_mode_before_abandon_focus"
  namespace: "telecom"
  description: "Set audio mode to MODE_NORMAL before abandon the audio focus."
  bug: "281841785"
}
+9 −2
Original line number Diff line number Diff line
@@ -277,8 +277,15 @@ public class CallAudioModeStateMachine extends StateMachine {
            Log.i(LOG_TAG, "Audio focus entering UNFOCUSED state");
            mLocalLog.log("Enter UNFOCUSED");
            if (mIsInitialized) {
                mCallAudioManager.setCallAudioRouteFocusState(CallAudioRouteStateMachine.NO_FOCUS);
                if (mFeatureFlags.setAudioModeBeforeAbandonFocus()) {
                    mAudioManager.setMode(AudioManager.MODE_NORMAL);
                    mCallAudioManager.setCallAudioRouteFocusState(
                            CallAudioRouteStateMachine.NO_FOCUS);
                } else {
                    mCallAudioManager.setCallAudioRouteFocusState(
                            CallAudioRouteStateMachine.NO_FOCUS);
                    mAudioManager.setMode(AudioManager.MODE_NORMAL);
                }
                mLocalLog.log("Mode MODE_NORMAL");
                mMostRecentMode = AudioManager.MODE_NORMAL;
                // Don't release focus here -- wait until we get a signal that any other audio