diff options
author | Makoto Onuki <omakoto@google.com> | 2013-09-12 17:59:24 -0700 |
---|---|---|
committer | Makoto Onuki <omakoto@google.com> | 2013-09-16 10:15:21 -0700 |
commit | 91eb44029658695e655a20b06441628e6f151c11 (patch) | |
tree | 6d92e453bf020df1c304fa6d8d259dc38fa3382d /InCallUI/src/com/android/incallui/InCallActivity.java | |
parent | b1a2b9be59a1a3a2f283380d67ce3b945ae74e8e (diff) |
b/10699042 show dialpad when connects to voice mail.
Also now "Use touch tone keypad" in the dialer works, and
it automatically un-holds if there's only once call and it's
on hold. (which was a regression too.)
Change-Id: Id8eeb2737ffa2223acfbf9a8a30d957599c9db36
Diffstat (limited to 'InCallUI/src/com/android/incallui/InCallActivity.java')
-rw-r--r-- | InCallUI/src/com/android/incallui/InCallActivity.java | 49 |
1 files changed, 30 insertions, 19 deletions
diff --git a/InCallUI/src/com/android/incallui/InCallActivity.java b/InCallUI/src/com/android/incallui/InCallActivity.java index 7d7ca4bad..feb3ec137 100644 --- a/InCallUI/src/com/android/incallui/InCallActivity.java +++ b/InCallUI/src/com/android/incallui/InCallActivity.java @@ -16,6 +16,9 @@ package com.android.incallui; +import com.android.services.telephony.common.Call; +import com.android.services.telephony.common.Call.State; + import android.app.Activity; import android.content.Intent; import android.content.res.Configuration; @@ -30,6 +33,9 @@ import android.widget.Toast; * Phone app "in call" screen. */ public class InCallActivity extends Activity { + + public static final String SHOW_DIALPAD_EXTRA = "InCallActivity.show_dialpad"; + private CallButtonFragment mCallButtonFragment; private CallCardFragment mCallCardFragment; private AnswerFragment mAnswerFragment; @@ -37,6 +43,9 @@ public class InCallActivity extends Activity { private ConferenceManagerFragment mConferenceManagerFragment; private boolean mIsForegroundActivity; + /** Use to pass 'showDialpad' from {@link #onNewIntent} to {@link #onResume} */ + private boolean mShowDialpadRequested; + @Override protected void onCreate(Bundle icicle) { Log.d(this, "onCreate()... this = " + this); @@ -78,6 +87,11 @@ public class InCallActivity extends Activity { mIsForegroundActivity = true; InCallPresenter.getInstance().onUiShowing(true); + + if (mShowDialpadRequested) { + mCallButtonFragment.displayDialpad(true); + mShowDialpadRequested = false; + } } // onPause is guaranteed to be called when the InCallActivity goes @@ -236,37 +250,34 @@ public class InCallActivity extends Activity { // But we do check here for one extra that can come along with the // ACTION_MAIN intent: - // TODO(klp): Enable this for klp - /* if (intent.hasExtra(SHOW_DIALPAD_EXTRA)) { // SHOW_DIALPAD_EXTRA can be used here to specify whether the DTMF // dialpad should be initially visible. If the extra isn't // present at all, we just leave the dialpad in its previous state. - boolean showDialpad = intent.getBooleanExtra(SHOW_DIALPAD_EXTRA, false); - if (VDBG) log("- internalResolveIntent: SHOW_DIALPAD_EXTRA: " + showDialpad); - - // If SHOW_DIALPAD_EXTRA is specified, that overrides whatever - // the previous state of inCallUiState.showDialpad was. - mApp.inCallUiState.showDialpad = showDialpad; + final boolean showDialpad = intent.getBooleanExtra(SHOW_DIALPAD_EXTRA, false); + Log.d(this, "- internalResolveIntent: SHOW_DIALPAD_EXTRA: " + showDialpad); - final boolean hasActiveCall = mCM.hasActiveFgCall(); - final boolean hasHoldingCall = mCM.hasActiveBgCall(); - - // There's only one line in use, AND it's on hold, at which we're sure the user - // wants to use the dialpad toward the exact line, so un-hold the holding line. - if (showDialpad && !hasActiveCall && hasHoldingCall) { - PhoneUtils.switchHoldingAndActive(mCM.getFirstActiveBgCall()); - } + relaunchedFromDialer(showDialpad); } - */ - // ...and in onResume() we'll update the onscreen dialpad state to - // match the InCallUiState. return; } } + private void relaunchedFromDialer(boolean showDialpad) { + mShowDialpadRequested = showDialpad; + + if (mShowDialpadRequested) { + // If there's only one line in use, AND it's on hold, then we're sure the user + // wants to use the dialpad toward the exact line, so un-hold the holding line. + final Call call = CallList.getInstance().getActiveOrBackgroundCall(); + if (call != null && call.getState() == State.ONHOLD) { + CallCommandClient.getInstance().hold(call.getCallId(), false); + } + } + } + private void initializeInCall() { // TODO(klp): Make sure that this doesn't need to move back to onResume() since they are // statically added fragments. |