diff options
author | Santos Cordon <santoscordon@google.com> | 2013-08-08 02:07:10 -0700 |
---|---|---|
committer | Santos Cordon <santoscordon@google.com> | 2013-08-08 18:59:25 +0000 |
commit | e067a78c4c0817e9e81c41327460aedce7f1091d (patch) | |
tree | c9253619fa841e89690979ec82009c8a6670514d /InCallUI/src/com/android/incallui/InCallActivity.java | |
parent | b6404417362ca02c940807426fefdb7568e269e3 (diff) |
Improve outgoing call sequence
Changes:
- When we get a new outgoing call, fire up the UI (without the
notification) by sending it an ACTION_MAIN intent.
- Fix up the InCallState-setting code in InCallPresenter to be a
little cleaner and accomodate new OUTGOING code.
- Add missing call to set HOLD Ui button
- Fix an occassional NullPointerException in CallCardPresenter.java
Change-Id: I557a777287d9ab25ef1447be63b5da080f1b2532
(cherry picked from commit 4d5c29af103c13e78568dc772d26eb56a3e6d3e1)
Diffstat (limited to 'InCallUI/src/com/android/incallui/InCallActivity.java')
-rw-r--r-- | InCallUI/src/com/android/incallui/InCallActivity.java | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/InCallUI/src/com/android/incallui/InCallActivity.java b/InCallUI/src/com/android/incallui/InCallActivity.java index 28e02b3b3..8ff43d5a1 100644 --- a/InCallUI/src/com/android/incallui/InCallActivity.java +++ b/InCallUI/src/com/android/incallui/InCallActivity.java @@ -129,7 +129,7 @@ public class InCallActivity extends Activity { // we can count on our onResume() method being called next. // Just like in onCreate(), handle the intent. - //TODO(klp): handle intent + internalResolveIntent(intent); } @Override @@ -199,6 +199,46 @@ public class InCallActivity extends Activity { return super.onKeyDown(keyCode, event); } + private void internalResolveIntent(Intent intent) { + final String action = intent.getAction(); + + if (action.equals(intent.ACTION_MAIN)) { + // This action is the normal way to bring up the in-call UI. + // + // 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 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()); + } + } + */ + // ...and in onResume() we'll update the onscreen dialpad state to + // match the InCallUiState. + + return; + } + } + private void initializeInCall() { // TODO(klp): Make sure that this doesn't need to move back to onResume() since they are // statically added fragments. |