summaryrefslogtreecommitdiff
path: root/InCallUI
diff options
context:
space:
mode:
authorSantos Cordon <santoscordon@google.com>2013-08-28 19:12:30 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-08-28 19:12:31 +0000
commit7e51fe5856b214f1887886533e8266b8369a5287 (patch)
tree3db9c9ec40f56a5333a9a0d3d99500bcf3f20bc2 /InCallUI
parenta9d3844a67b66c5f2732eecd44223c83435f6223 (diff)
parent8ba37bb9d8f0b94ec1cdf38bf72f7d44ba1558ca (diff)
Merge "Remove extra code which set Activity to null." into klp-dev
Diffstat (limited to 'InCallUI')
-rw-r--r--InCallUI/src/com/android/incallui/InCallPresenter.java19
1 files changed, 14 insertions, 5 deletions
diff --git a/InCallUI/src/com/android/incallui/InCallPresenter.java b/InCallUI/src/com/android/incallui/InCallPresenter.java
index 8bb0973bf..c6051160a 100644
--- a/InCallUI/src/com/android/incallui/InCallPresenter.java
+++ b/InCallUI/src/com/android/incallui/InCallPresenter.java
@@ -276,11 +276,20 @@ public class InCallPresenter implements CallList.Listener {
// The new state is the hidden state (no calls). Tear everything down.
if (mInCallActivity != null) {
- // Null out reference before we start end sequence
- InCallActivity temp = mInCallActivity;
- mInCallActivity = null;
-
- temp.finish();
+ if (mInCallActivity.isFinishing()) {
+ // Tear down process:
+ // When there are no more calls to handle, two things happen:
+ // 1. The binding connection with TeleService ends
+ // 2. InCallState changes to HIDDEN and we call activity.finish() here.
+ //
+ // Without the service connection, we will not get updates from the service
+ // and so will never get a new call to move out of the HIDDEN state. Since this
+ // code is called when we move from a different state into the HIDDEN state,
+ // it should never get hit twice. In case it does, log an error.
+ Log.e(this, "Attempting to finish incall activity twice.");
+ } else {
+ mInCallActivity.finish();
+ }
// blow away stale contact info so that we get fresh data on
// the next set of calls