diff options
author | wangqi <wangqi@google.com> | 2017-07-19 17:54:01 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-07-25 16:43:33 +0000 |
commit | 634e2ba297998fb44d5074e6c369eb0f840424d5 (patch) | |
tree | e65c2459c20df162b90226b50394c552ab1f7e22 | |
parent | 37768b95c107421320b7fba30bb81158b8215e2f (diff) |
Fix bug that pending account select call prevents new call being made.
If user press home button to hide the incall ui with pending account select
dialog, the call will stuck on SELECT_PHONE_ACCOUNT states and no new call
would be allowed to be made.
This change will disconnect the pending call in this case to allow new calls
being made.
Bug: 63600434
Test: manual
PiperOrigin-RevId: 162562378
Change-Id: I0334f95305d7c9714bcfb691772299c34b1a278e
-rw-r--r-- | java/com/android/incallui/InCallActivityCommon.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/java/com/android/incallui/InCallActivityCommon.java b/java/com/android/incallui/InCallActivityCommon.java index 3a264bed7..f7d858389 100644 --- a/java/com/android/incallui/InCallActivityCommon.java +++ b/java/com/android/incallui/InCallActivityCommon.java @@ -21,6 +21,7 @@ import android.app.ActivityManager.AppTask; import android.app.ActivityManager.TaskDescription; import android.app.AlertDialog; import android.app.Dialog; +import android.app.KeyguardManager; import android.content.DialogInterface; import android.content.DialogInterface.OnCancelListener; import android.content.DialogInterface.OnDismissListener; @@ -319,6 +320,17 @@ public class InCallActivityCommon { } public void onStop() { + // Disconnects call waiting for account when activity is hidden e.g. user press home button. + // 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()) { + DialerCall waitingForAccountCall = CallList.getInstance().getWaitingForAccountCall(); + if (waitingForAccountCall != null) { + waitingForAccountCall.disconnect(); + } + } + enableInCallOrientationEventListener(false); InCallPresenter.getInstance().updateIsChangingConfigurations(); InCallPresenter.getInstance().onActivityStopped(); |