From f99f630265628ce4ff899d0ba74de91fb116ffdd Mon Sep 17 00:00:00 2001 From: linyuh Date: Wed, 15 Nov 2017 11:23:51 -0800 Subject: Move InCallActivityCommon#dismissPendingDialogs to InCallActivity. This is part of the effort to delete InCallActivityCommon. Related instance variables remain in InCallActivityCommon for now as they are used in several other places. Temporary getters/setters are added in InCallActivityCommon so that InCallActivity has access to these instance variables. Bug: 69272096 Test: None PiperOrigin-RevId: 175853702 Change-Id: Iaeb96c8ad7acb628393dd5c775ad7f3b40940a2b --- .../com/android/incallui/InCallActivityCommon.java | 70 +++++++++++----------- 1 file changed, 35 insertions(+), 35 deletions(-) (limited to 'java/com/android/incallui/InCallActivityCommon.java') diff --git a/java/com/android/incallui/InCallActivityCommon.java b/java/com/android/incallui/InCallActivityCommon.java index 3914e386c..e9c2467ef 100644 --- a/java/com/android/incallui/InCallActivityCommon.java +++ b/java/com/android/incallui/InCallActivityCommon.java @@ -105,7 +105,7 @@ public class InCallActivityCommon { private boolean showPostCharWaitDialogOnResume; private String showPostCharWaitDialogCallId; private String showPostCharWaitDialogChars; - private Dialog dialog; + private Dialog errorDialog; private SelectPhoneAccountDialogFragment selectPhoneAccountDialogFragment; private InCallOrientationEventListener inCallOrientationEventListener; private Animation dialpadSlideInAnimation; @@ -346,8 +346,8 @@ public class InCallActivityCommon { InCallPresenter.getInstance().onActivityStopped(); if (!isRecreating) { InCallPresenter.getInstance().onUiShowing(false); - if (dialog != null) { - dialog.dismiss(); + if (errorDialog != null) { + errorDialog.dismiss(); } } } @@ -574,29 +574,6 @@ public class InCallActivityCommon { } } - void dismissPendingDialogs() { - if (dialog != null) { - dialog.dismiss(); - dialog = null; - } - if (selectPhoneAccountDialogFragment != null) { - selectPhoneAccountDialogFragment.dismiss(); - selectPhoneAccountDialogFragment = null; - } - - InternationalCallOnWifiDialogFragment internationalCallOnWifiFragment = - (InternationalCallOnWifiDialogFragment) - inCallActivity - .getSupportFragmentManager() - .findFragmentByTag(TAG_INTERNATIONAL_CALL_ON_WIFI); - if (internationalCallOnWifiFragment != null) { - LogUtil.i( - "InCallActivityCommon.dismissPendingDialogs", - "dismissing InternationalCallOnWifiDialogFragment"); - internationalCallOnWifiFragment.dismiss(); - } - } - private void showErrorDialog(Dialog dialog, CharSequence message) { LogUtil.i("InCallActivityCommon.showErrorDialog", "message: %s", message); inCallActivity.dismissPendingDialogs(); @@ -607,7 +584,7 @@ public class InCallActivityCommon { return; } - this.dialog = dialog; + this.errorDialog = dialog; InCallUiLock lock = InCallPresenter.getInstance().acquireInCallUiLock("showErrorDialog"); dialog.setOnDismissListener( new OnDismissListener() { @@ -623,7 +600,7 @@ public class InCallActivityCommon { } private void onDialogDismissed() { - dialog = null; + errorDialog = null; CallList.getInstance().onErrorDialogDismissed(); } @@ -687,7 +664,7 @@ public class InCallActivityCommon { return; } - dismissPendingDialogs(); + inCallActivity.dismissPendingDialogs(); AlertDialog.Builder builder = new AlertDialog.Builder(inCallActivity) @@ -701,7 +678,7 @@ public class InCallActivityCommon { wifiHandoverFailureCheckbox.setChecked(false); InCallUiLock lock = InCallPresenter.getInstance().acquireInCallUiLock("WifiFailedDialog"); - dialog = + errorDialog = builder .setView(dialogCheckBoxView) .setMessage(R.string.video_call_lte_to_wifi_failed_message) @@ -727,7 +704,7 @@ public class InCallActivityCommon { .create(); LogUtil.i("InCallActivityCommon.showWifiFailedDialog", "as dialog"); - dialog.show(); + errorDialog.show(); } void updateNavigationBar(boolean isDialpadVisible) { @@ -852,10 +829,6 @@ public class InCallActivityCommon { inCallActivity.setTaskDescription(td); } - public boolean hasPendingDialogs() { - return dialog != null; - } - private void internalResolveIntent(Intent intent) { if (!intent.getAction().equals(Intent.ACTION_MAIN)) { return; @@ -925,4 +898,31 @@ public class InCallActivityCommon { inCallActivity.getFragmentManager(), TAG_SELECT_ACCOUNT_FRAGMENT); return true; } + + /** @deprecated Only for temporary use during the deprecation of {@link InCallActivityCommon} */ + @Deprecated + @Nullable + Dialog getErrorDialog() { + return errorDialog; + } + + /** @deprecated Only for temporary use during the deprecation of {@link InCallActivityCommon} */ + @Deprecated + void setErrorDialog(@Nullable Dialog errorDialog) { + this.errorDialog = errorDialog; + } + + /** @deprecated Only for temporary use during the deprecation of {@link InCallActivityCommon} */ + @Deprecated + @Nullable + SelectPhoneAccountDialogFragment getSelectPhoneAccountDialogFragment() { + return selectPhoneAccountDialogFragment; + } + + /** @deprecated Only for temporary use during the deprecation of {@link InCallActivityCommon} */ + @Deprecated + void setSelectPhoneAccountDialogFragment( + @Nullable SelectPhoneAccountDialogFragment selectPhoneAccountDialogFragment) { + this.selectPhoneAccountDialogFragment = selectPhoneAccountDialogFragment; + } } -- cgit v1.2.3