aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2022-06-10 14:45:31 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2022-06-10 14:45:31 +0000
commit1018e40f2dea81997b3420352d4349b7c78d1696 (patch)
tree2e082d09eede6b444ff6e9653c0930e4ee9cd8f1
parenta676dcfe89945aeda5d90d902b8c7f47e222a33f (diff)
parent3865c72f0f0aff56ed684a4988c8ca3106d9e5f6 (diff)
downloadtelephony-1018e40f2dea81997b3420352d4349b7c78d1696.tar.gz
Merge "Resend the EVENT_RESUME_NOW_FOREGROUND_CALL message after onCallHeld." into tm-dev am: 3865c72f0f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/opt/telephony/+/18750981 Change-Id: I603afd0cb501cfb18d4d67db15b2f89ef358cc19 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java29
1 files changed, 24 insertions, 5 deletions
diff --git a/src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java b/src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java
index ac2398c5ec..cc8af38cdd 100644
--- a/src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java
+++ b/src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java
@@ -506,6 +506,8 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
PENDING_RESUME_FOREGROUND_AFTER_FAILURE,
// Pending holding a call to dial another outgoing call
HOLDING_TO_DIAL_OUTGOING,
+ // Pending resuming the foreground call after it has completed an ongoing hold operation.
+ PENDING_RESUME_FOREGROUND_AFTER_HOLD
}
//***** Instance Variables
@@ -2068,9 +2070,15 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
//they were switched before holding
ImsCall imsCall = mForegroundCall.getImsCall();
if (imsCall != null) {
- imsCall.resume();
- mMetrics.writeOnImsCommand(mPhone.getPhoneId(), imsCall.getSession(),
- ImsCommand.IMS_CMD_RESUME);
+ if (!imsCall.isPendingHold()) {
+ imsCall.resume();
+ mMetrics.writeOnImsCommand(mPhone.getPhoneId(), imsCall.getSession(),
+ ImsCommand.IMS_CMD_RESUME);
+ } else {
+ mHoldSwitchingState =
+ HoldSwapState.PENDING_RESUME_FOREGROUND_AFTER_HOLD;
+ logHoldSwapState("resumeForegroundCall - unhold pending; resume request again");
+ }
}
}
@@ -3449,7 +3457,12 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
// processCallStateChange above may have caused the mBackgroundCall and
// mForegroundCall references below to change meaning. Watch out for this if you
// are reading through this code.
- if (oldState == ImsPhoneCall.State.ACTIVE) {
+ if (mHoldSwitchingState
+ == HoldSwapState.PENDING_RESUME_FOREGROUND_AFTER_HOLD) {
+ sendEmptyMessage(EVENT_RESUME_NOW_FOREGROUND_CALL);
+ mHoldSwitchingState = HoldSwapState.INACTIVE;
+ mCallExpectedToResume = null;
+ } else if (oldState == ImsPhoneCall.State.ACTIVE) {
// Note: This case comes up when we have just held a call in response to a
// switchWaitingOrHoldingAndActive. We now need to resume the background call.
if (mForegroundCall.getState() == ImsPhoneCall.State.HOLDING
@@ -3494,7 +3507,10 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
synchronized (mSyncHold) {
ImsPhoneCall.State bgState = mBackgroundCall.getState();
- if (reasonInfo.getCode() == ImsReasonInfo.CODE_LOCAL_CALL_TERMINATED) {
+ if (mHoldSwitchingState
+ == HoldSwapState.PENDING_RESUME_FOREGROUND_AFTER_HOLD) {
+ mHoldSwitchingState = HoldSwapState.INACTIVE;
+ } else if (reasonInfo.getCode() == ImsReasonInfo.CODE_LOCAL_CALL_TERMINATED) {
// disconnected while processing hold
if (mPendingMO != null) {
dialPendingMO();
@@ -4591,6 +4607,9 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
case HOLDING_TO_DIAL_OUTGOING:
holdSwapState = "HOLDING_TO_DIAL_OUTGOING";
break;
+ case PENDING_RESUME_FOREGROUND_AFTER_HOLD:
+ holdSwapState = "PENDING_RESUME_FOREGROUND_AFTER_HOLD";
+ break;
}
logi("holdSwapState set to " + holdSwapState + " at " + loc);
}