Update Dialer source to latest internal Google revision.
Previously, Android's Dialer app was developed in an internal Google
source control system and only exported to public during AOSP drops.
The Dialer team is now switching to a public development model similar
to the telephony team.
This CL represents all internal Google changes that were committed to
Dialer between the public O release and today's tip of tree on internal
master. This CL squashes those changes into a single commit.
In subsequent changes, changes will be exported on a per-commit basis.
(cherry picked from commit 2ca4318cc1ee57dda907ba2069bd61d162b1baef
and amended to match paths of dependencies under
prebuilts/maven_repo/bumptech/com/github/bumptech/glide/.)
This CL was generated using these commands from a repository at
stage-stage-master at revision ea7b4dc89590ffa3332766a531e0eab6ffb9aebd
("Merge "Update Dialer source to latest internal Google revision." am: c39ea3c55f -s ours"):
git diff --binary 2ca4318cc1ee57dda907ba2069bd61d162b1baef | git apply -R --index
git commit -c 2ca4318cc1ee57dda907ba2069bd61d162b1baef
Test: make, flash install, run
Change-Id: I529aaeb88535b9533c0ae4ef4e6c1222d4e0f1c8
PiperOrigin-RevId: 167068436
diff --git a/java/com/android/incallui/InCallActivityCommon.java b/java/com/android/incallui/InCallActivityCommon.java
index 3a264be..14531e0 100644
--- a/java/com/android/incallui/InCallActivityCommon.java
+++ b/java/com/android/incallui/InCallActivityCommon.java
@@ -21,6 +21,7 @@
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;
@@ -105,6 +106,8 @@
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() {
@@ -209,7 +212,8 @@
}
});
- if (icicle != null) {
+ // Don't override the value if show dialpad request is true in intent extras.
+ if (icicle != null && showDialpadRequest == DIALPAD_REQUEST_NONE) {
// If the dialpad was shown before, set variables indicating it should be shown and
// populated with the previous DTMF text. The dialpad is actually shown and populated
// in onResume() to ensure the hosting fragment has been inflated and is ready to receive it.
@@ -319,6 +323,18 @@
}
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 (!isRecreating
+ && !inCallActivity.getSystemService(KeyguardManager.class).isKeyguardLocked()) {
+ DialerCall waitingForAccountCall = CallList.getInstance().getWaitingForAccountCall();
+ if (waitingForAccountCall != null) {
+ waitingForAccountCall.disconnect();
+ }
+ }
+
enableInCallOrientationEventListener(false);
InCallPresenter.getInstance().updateIsChangingConfigurations();
InCallPresenter.getInstance().onActivityStopped();
@@ -331,6 +347,7 @@
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