Prevent Telecom from holding focus indefinitely
In certain churny conditions, CARSM may receive a notification that says
that we're releasing focus after it's transitioned into a quiescent
state. In these cases, notify CAMSM that all audio operations are
complete (there's nothing to do anyway), since CAMSM waits for
confirmation that CARSM is done before actually releasing focus.
Fixes: 184238880
Test: manual
Change-Id: I88a457394f9a2371278bd1001a9f044bcd651495
diff --git a/src/com/android/server/telecom/CallAudioRouteStateMachine.java b/src/com/android/server/telecom/CallAudioRouteStateMachine.java
index bcfdedf..7bf94ed 100644
--- a/src/com/android/server/telecom/CallAudioRouteStateMachine.java
+++ b/src/com/android/server/telecom/CallAudioRouteStateMachine.java
@@ -493,6 +493,8 @@
case SWITCH_FOCUS:
if (msg.arg1 == ACTIVE_FOCUS || msg.arg1 == RINGING_FOCUS) {
transitionTo(mActiveEarpieceRoute);
+ } else {
+ mCallAudioManager.notifyAudioOperationsComplete();
}
return HANDLED;
default:
@@ -695,6 +697,8 @@
case SWITCH_FOCUS:
if (msg.arg1 == ACTIVE_FOCUS || msg.arg1 == RINGING_FOCUS) {
transitionTo(mActiveHeadsetRoute);
+ } else {
+ mCallAudioManager.notifyAudioOperationsComplete();
}
return HANDLED;
default:
@@ -1051,6 +1055,8 @@
} else {
transitionTo(mRingingBluetoothRoute);
}
+ } else {
+ mCallAudioManager.notifyAudioOperationsComplete();
}
return HANDLED;
case BT_AUDIO_DISCONNECTED:
@@ -1274,6 +1280,8 @@
if (msg.arg1 == ACTIVE_FOCUS || msg.arg1 == RINGING_FOCUS) {
setSpeakerphoneOn(true);
transitionTo(mActiveSpeakerRoute);
+ } else {
+ mCallAudioManager.notifyAudioOperationsComplete();
}
return HANDLED;
default: