diff options
author | linyuh <linyuh@google.com> | 2017-11-16 11:24:09 -0800 |
---|---|---|
committer | zachh <zachh@google.com> | 2017-11-18 07:33:08 +0000 |
commit | 7b86f5621bb130bc1517db11a706d1518d141a52 (patch) | |
tree | 78d947597817240ba2c52dad4a3ca7e575ef88ad /java/com/android/incallui/InCallPresenter.java | |
parent | bf27d875b7c6e9dec5d3cfc1d4595a71af67deae (diff) |
Merge the following methods in InCallActivityCommon into InCallActivity:
1. maybeShowErrorDialogOnDisconnect(DisconnectMessage),
2. onDialogDismissed(),
3. showErrorDialog(Dialog, CharSequence),
4. showInternationalCallOnWifiDialog(DialerCall),
5. showWifiFailedDialog(DialerCall), and
6. showWifiToLteHandoverToast(DialerCall).
Renaming in InCallActivity:
1. "maybeShowErrorDialogOnDisconnect" -> "showDialogOrToastForDisconnectedCall",
2. "onHandoverToWifiFailed" -> "showDialogOrToastForWifiHandoverFailure",
3. "onInternationalCallOnWifi" -> "showDialogForInternationalCallOnWifi", and
4. "onWiFiToLteHandover" -> "showToastForWiFiToLteHandover".
This is part of the effort to delete InCallActivityCommon.
Bug: 69272096
Test: None
PiperOrigin-RevId: 175991784
Change-Id: I0b31bd93437e633d2f77b09982e0c7fc94ad8a32
Diffstat (limited to 'java/com/android/incallui/InCallPresenter.java')
-rw-r--r-- | java/com/android/incallui/InCallPresenter.java | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/java/com/android/incallui/InCallPresenter.java b/java/com/android/incallui/InCallPresenter.java index fc2f34efe..3ba2ccff6 100644 --- a/java/com/android/incallui/InCallPresenter.java +++ b/java/com/android/incallui/InCallPresenter.java @@ -467,7 +467,7 @@ public class InCallPresenter implements CallList.Listener, AudioModeProvider.Aud // By the time the UI finally comes up, the call may already be disconnected. // If that's the case, we may need to show an error dialog. if (mCallList != null && mCallList.getDisconnectedCall() != null) { - maybeShowErrorDialogOnDisconnect(mCallList.getDisconnectedCall()); + showDialogOrToastForDisconnectedCall(mCallList.getDisconnectedCall()); } // When the UI comes up, we need to first check the in-call state. @@ -681,14 +681,14 @@ public class InCallPresenter implements CallList.Listener, AudioModeProvider.Aud @Override public void onWiFiToLteHandover(DialerCall call) { if (mInCallActivity != null) { - mInCallActivity.onWiFiToLteHandover(call); + mInCallActivity.showToastForWiFiToLteHandover(call); } } @Override public void onHandoverToWifiFailed(DialerCall call) { if (mInCallActivity != null) { - mInCallActivity.onHandoverToWifiFailed(call); + mInCallActivity.showDialogOrToastForWifiHandoverFailure(call); } } @@ -696,7 +696,7 @@ public class InCallPresenter implements CallList.Listener, AudioModeProvider.Aud public void onInternationalCallOnWifi(@NonNull DialerCall call) { LogUtil.enterBlock("InCallPresenter.onInternationalCallOnWifi"); if (mInCallActivity != null) { - mInCallActivity.onInternationalCallOnWifi(call); + mInCallActivity.showDialogForInternationalCallOnWifi(call); } } @@ -832,7 +832,7 @@ public class InCallPresenter implements CallList.Listener, AudioModeProvider.Aud */ @Override public void onDisconnect(DialerCall call) { - maybeShowErrorDialogOnDisconnect(call); + showDialogOrToastForDisconnectedCall(call); // We need to do the run the same code as onCallListChange. onCallListChange(mCallList); @@ -1241,19 +1241,19 @@ public class InCallPresenter implements CallList.Listener, AudioModeProvider.Aud } } - /** - * For some disconnected causes, we show a dialog. This calls into the activity to show the dialog - * if appropriate for the call. - */ - private void maybeShowErrorDialogOnDisconnect(DialerCall call) { + /** Instruct the in-call activity to show an error dialog or toast for a disconnected call. */ + private void showDialogOrToastForDisconnectedCall(DialerCall call) { + if (!isActivityStarted() || call.getState() != DialerCall.State.DISCONNECTED) { + return; + } + // For newly disconnected calls, we may want to show a dialog on specific error conditions - if (isActivityStarted() && call.getState() == DialerCall.State.DISCONNECTED) { - if (call.getAccountHandle() == null && !call.isConferenceCall()) { - setDisconnectCauseForMissingAccounts(call); - } - mInCallActivity.maybeShowErrorDialogOnDisconnect( - new DisconnectMessage(mInCallActivity, call)); + if (call.getAccountHandle() == null && !call.isConferenceCall()) { + setDisconnectCauseForMissingAccounts(call); } + + mInCallActivity.showDialogOrToastForDisconnectedCall( + new DisconnectMessage(mInCallActivity, call)); } /** |