diff options
author | wangqi <wangqi@google.com> | 2017-07-25 16:08:11 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-07-26 08:59:51 -0700 |
commit | 753904d60efa39c4aed3c3a3688ceee8d8d730e5 (patch) | |
tree | 515cb9e2f158a9e3ff5f9cbfd911f412b6adb2a9 /java/com | |
parent | 4442990e9e8f1220616a074df693668b5b82d331 (diff) |
Fix bug that cannot add call if there are multiple calling account.
Repro steps:
1. setup multiple calling account (multi-sim or sip etc.)
2. make a ongoing call
3. click "Add call"
4. make another call in dialer
This is caused by recreating incall activity when adding new call that
will go through its lifecycle thus disconnecting the call with account
selection states automatically.
It's a regression caused by cl/162562378.
Bug: 64014929
Test: manual
PiperOrigin-RevId: 163138094
Change-Id: Ia979f7d63bd85cfaa6550c58e552759d66ec937c
Diffstat (limited to 'java/com')
-rw-r--r-- | java/com/android/incallui/InCallActivityCommon.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/java/com/android/incallui/InCallActivityCommon.java b/java/com/android/incallui/InCallActivityCommon.java index f7d858389..94fe6ec4f 100644 --- a/java/com/android/incallui/InCallActivityCommon.java +++ b/java/com/android/incallui/InCallActivityCommon.java @@ -106,6 +106,8 @@ public class InCallActivityCommon { private boolean animateDialpadOnShow; private String dtmfTextToPreopulate; @DialpadRequestType private int showDialpadRequest = DIALPAD_REQUEST_NONE; + // If activity is going to be recreated. This is usually happening in {@link onNewIntent}. + private boolean isRecreating; private final SelectPhoneAccountListener selectAccountListener = new SelectPhoneAccountListener() { @@ -324,7 +326,8 @@ public class InCallActivityCommon { // This is necessary otherwise the pending call will stuck on account choose and no new call // will be able to create. See b/63600434 for more details. // Skip this on locked screen since the activity may go over life cycle and start again. - if (!inCallActivity.getSystemService(KeyguardManager.class).isKeyguardLocked()) { + if (!isRecreating + && !inCallActivity.getSystemService(KeyguardManager.class).isKeyguardLocked()) { DialerCall waitingForAccountCall = CallList.getInstance().getWaitingForAccountCall(); if (waitingForAccountCall != null) { waitingForAccountCall.disconnect(); @@ -343,6 +346,7 @@ public class InCallActivityCommon { void onNewIntent(Intent intent, boolean isRecreating) { LogUtil.i("InCallActivityCommon.onNewIntent", ""); + this.isRecreating = isRecreating; // We're being re-launched with a new Intent. Since it's possible for a // single InCallActivity instance to persist indefinitely (even if we |