summaryrefslogtreecommitdiff
path: root/InCallUI/src/com/android/incallui/InCallActivity.java
diff options
context:
space:
mode:
authorAndrew Lee <anwlee@google.com>2014-03-31 16:58:21 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-03-31 16:58:21 +0000
commit80ba6e3503aef5ccc691ec6cee579ce67203c0bb (patch)
tree5cb25d6d08e2d1c392b1b5887e814a9cc2a9797a /InCallUI/src/com/android/incallui/InCallActivity.java
parent917bb0e20a146a3ab4f7b0cebc4465d0806d0181 (diff)
parente30f7aeb2d251023b21927a86dd723a299908bb6 (diff)
Merge "Don't show wait dialog if the activity is paused."
Diffstat (limited to 'InCallUI/src/com/android/incallui/InCallActivity.java')
-rw-r--r--InCallUI/src/com/android/incallui/InCallActivity.java47
1 files changed, 33 insertions, 14 deletions
diff --git a/InCallUI/src/com/android/incallui/InCallActivity.java b/InCallUI/src/com/android/incallui/InCallActivity.java
index 207036f4b..a0e0c473b 100644
--- a/InCallUI/src/com/android/incallui/InCallActivity.java
+++ b/InCallUI/src/com/android/incallui/InCallActivity.java
@@ -56,6 +56,11 @@ public class InCallActivity extends Activity {
/** Use to pass 'showDialpad' from {@link #onNewIntent} to {@link #onResume} */
private boolean mShowDialpadRequested;
+ /** Use to pass parameters for showing the PostCharDialog to {@link #onResume} */
+ private boolean mShowPostCharWaitDialogOnResume;
+ private int mShowPostCharWaitDialogCallId;
+ private String mShowPostCharWaitDialogChars;
+
@Override
protected void onCreate(Bundle icicle) {
Log.d(this, "onCreate()... this = " + this);
@@ -103,6 +108,10 @@ public class InCallActivity extends Activity {
mCallButtonFragment.displayDialpad(true);
mShowDialpadRequested = false;
}
+
+ if (mShowPostCharWaitDialogOnResume) {
+ showPostCharWaitDialog(mShowPostCharWaitDialogCallId, mShowPostCharWaitDialogChars);
+ }
}
// onPause is guaranteed to be called when the InCallActivity goes
@@ -428,8 +437,18 @@ public class InCallActivity extends Activity {
}
public void showPostCharWaitDialog(int callId, String chars) {
- final PostCharDialogFragment fragment = new PostCharDialogFragment(callId, chars);
- fragment.show(getFragmentManager(), "postCharWait");
+ if (isForegroundActivity()) {
+ final PostCharDialogFragment fragment = new PostCharDialogFragment(callId, chars);
+ fragment.show(getFragmentManager(), "postCharWait");
+
+ mShowPostCharWaitDialogOnResume = false;
+ mShowPostCharWaitDialogCallId = 0;
+ mShowPostCharWaitDialogChars = null;
+ } else {
+ mShowPostCharWaitDialogOnResume = true;
+ mShowPostCharWaitDialogCallId = callId;
+ mShowPostCharWaitDialogChars = chars;
+ }
}
@Override
@@ -472,18 +491,18 @@ public class InCallActivity extends Activity {
dismissPendingDialogs();
mDialog = new AlertDialog.Builder(this)
- .setMessage(msg)
- .setPositiveButton(R.string.ok, new OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- onDialogDismissed();
- }})
- .setOnCancelListener(new OnCancelListener() {
- @Override
- public void onCancel(DialogInterface dialog) {
- onDialogDismissed();
- }})
- .create();
+ .setMessage(msg)
+ .setPositiveButton(R.string.ok, new OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ onDialogDismissed();
+ }})
+ .setOnCancelListener(new OnCancelListener() {
+ @Override
+ public void onCancel(DialogInterface dialog) {
+ onDialogDismissed();
+ }})
+ .create();
mDialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
mDialog.show();