diff options
author | Santos Cordon <santoscordon@google.com> | 2013-09-20 17:06:18 -0700 |
---|---|---|
committer | Santos Cordon <santoscordon@google.com> | 2013-09-23 19:33:43 -0700 |
commit | 9ccf74a1e34b0a08b8d74cbb5a494eea879fd15e (patch) | |
tree | 22ecd3d50053702e84483a8f45234007e858ec2b /InCallUI/src/com/android/incallui/AnswerPresenter.java | |
parent | cd72227f331b862d70c1271b1c9a5f3a1ab30bee (diff) |
Add generic error code dialogs for failed calls.
This change listens for disconnected calls and if the disconnection
cause matches a set of predefined causes, we show a dialog to the user.
New dialog messages:
- You can\'t make outgoing calls while call barring is on.
- All calls are restricted by access control.
- Emergency calls are restricted by access control.
- Normal calls are restricted by access control.
- Outgoing calls are restricted by FDN.
Several changes were necessary to support this:
1) Dialog code (InCallActivity.java)
2) Notifications for a new disconnect (CallList.java)
- previously we sent a large update for ondisconnect, now we just
send the notice for that particular call. InCallPresenter was
written so that the same thing that used to happen still happens.
3) Check if we need to show a disconnect dialog when the UI comes up.
- I found that FDN disconnection happens so quickly that the
disconnect came before the UI was up, so this was necessary.
(InCallPresenter.setActivity())
4) CallCard should be initialized with disconnecting/disconnecting calls.
- Call Card presenter intializes itself when it starts up using live
calls, but as with the FDN case above, a disconnected call should be
used if no live calls exist. (CallList.getFirstCall())
5) If a dialog is up while an incoming call comes up, dismiss it
automatically so that users can see incoming UI.
- (InCallPresenter.startOrFinishUi())
6) Keep the UI up as long as there is a dialog for the incoming call.
- Previously, UI would come down once all calls were shut down but
in the case of present dialogs, we want it to stay up.
(InCallActivity.finish())
- When the dialog is dismissed, check if we want to tear down UI.
(InCallActivity.onDialogDismissed())
7) Only tear down UI once we are in the NO_CALL state.
- We used to tear down when the activity was null (closed) and the
service was disconnected. This is problematic because a call that
immediately disconnects (like FDN errors) would shut down the service
before the UI had a chance to come up. We added a check to the
conditional for the state NO_CALL before shutting down.
(InCallPresenter.attemptCleanup()).
bug: 10680210
Change-Id: I1fd33dd53dc0eec5a02b7a940cfd018cec3d20c0
Diffstat (limited to 'InCallUI/src/com/android/incallui/AnswerPresenter.java')
-rw-r--r-- | InCallUI/src/com/android/incallui/AnswerPresenter.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/InCallUI/src/com/android/incallui/AnswerPresenter.java b/InCallUI/src/com/android/incallui/AnswerPresenter.java index e820929a0..b3deb641e 100644 --- a/InCallUI/src/com/android/incallui/AnswerPresenter.java +++ b/InCallUI/src/com/android/incallui/AnswerPresenter.java @@ -64,6 +64,11 @@ public class AnswerPresenter extends Presenter<AnswerPresenter.AnswerUi> } @Override + public void onDisconnect(Call call) { + // no-op + } + + @Override public void onIncomingCall(Call call) { // TODO: Ui is being destroyed when the fragment detaches. Need clean up step to stop // getting updates here. |