summaryrefslogtreecommitdiff
path: root/InCallUI/src/com/android/incallui/InCallActivity.java
diff options
context:
space:
mode:
authorSantos Cordon <santoscordon@google.com>2013-08-19 20:12:16 -0700
committerSantos Cordon <santoscordon@google.com>2013-08-19 20:21:59 -0700
commitcab6935f7c42b32b128150ddbde818a902f1ca38 (patch)
tree2cf417515ed43e271d69b36aa9cab9d1003b006d /InCallUI/src/com/android/incallui/InCallActivity.java
parentd28fc12696fa706fed70e04698275af7be7fee82 (diff)
Support connecting and disconnecting from Phone app.
Phone app now connects/disconnects from the UI when there are no active calls but UI did not previously support being disconnected. This change adds the following functionality to support dis/reconnection: - CallCommandClient now supports setting new ICallCommandService instances. - CallCommandClient now checks if mCommandService is null before executing a method. - CallHandlerService performs more careful ordered cleanup with destroyed including removing pending messages and clearing any existing calls from the call list. - InCallActivity now performs tearDown of the presenters with onDestroy instead of finish() to reduce NPE instances. - InCallActivity not notifies InCallPresenter when is finishes, and not just when it starts. - InCallPresenter tears itself down after two things happen: the UI is destroyed and the service is disconnected. - InCallPresenter now issues a full-screen restart of the UI if the UI was previously hidden (except for new outgoing calls). This allows the UI to come back to the foreground if it was in the foreground when the app went down. The above changes also now protect against the phone app crashing or the incall UI crashing. bug: 10363682 Change-Id: I9b785f906f29015827e8e53e64cd5f5c72cd7981
Diffstat (limited to 'InCallUI/src/com/android/incallui/InCallActivity.java')
-rw-r--r--InCallUI/src/com/android/incallui/InCallActivity.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/InCallUI/src/com/android/incallui/InCallActivity.java b/InCallUI/src/com/android/incallui/InCallActivity.java
index e1a979693..5edfaa32a 100644
--- a/InCallUI/src/com/android/incallui/InCallActivity.java
+++ b/InCallUI/src/com/android/incallui/InCallActivity.java
@@ -88,6 +88,9 @@ public class InCallActivity extends Activity {
@Override
protected void onDestroy() {
Logger.d(this, "onDestroy()... this = " + this);
+
+ tearDownPresenters();
+
super.onDestroy();
}
@@ -116,13 +119,7 @@ public class InCallActivity extends Activity {
@Override
public void finish() {
Logger.d(this, "finish()...");
- tearDownPresenters();
-
super.finish();
-
- // TODO(klp): Actually finish the activity for now. Revisit performance implications of
- // this before launch.
- // moveTaskToBack(true);
}
@Override
@@ -299,11 +296,14 @@ public class InCallActivity extends Activity {
}
private void tearDownPresenters() {
+ Logger.d(this, "Tearing down presenters.");
InCallPresenter mainPresenter = InCallPresenter.getInstance();
mainPresenter.removeListener(mCallButtonFragment.getPresenter());
mainPresenter.removeListener(mCallCardFragment.getPresenter());
mainPresenter.removeListener(mAnswerFragment.getPresenter());
+
+ mainPresenter.setActivity(null);
}
private void toast(String text) {