Ensure MMIDialogActivity can respond to IMS MMI codes.
When determining whether to show the MMI progress dialog, only the base
phone was being considered for pending MMI codes. Adding in any pending
MMI codes for the IMS phone as well to solve the problem that IMS MMI
codes do not show a progress dialog.
Test: Manual
Bug: 62281419
Change-Id: I8f4fe72750dcf271538c6ea44a087808e717d4e3
diff --git a/src/com/android/phone/MMIDialogActivity.java b/src/com/android/phone/MMIDialogActivity.java
index 1e6fa41..00a543a 100644
--- a/src/com/android/phone/MMIDialogActivity.java
+++ b/src/com/android/phone/MMIDialogActivity.java
@@ -32,6 +32,7 @@
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.PhoneConstants;
+import java.util.ArrayList;
import java.util.List;
/**
@@ -87,7 +88,11 @@
}
private void showMMIDialog() {
- final List<? extends MmiCode> codes = mPhone.getPendingMmiCodes();
+ final List<MmiCode> codes = new ArrayList<>(mPhone.getPendingMmiCodes());
+ // If the phone has an IMS phone, also get pending imS MMIsl.
+ if (mPhone.getImsPhone() != null) {
+ codes.addAll(mPhone.getImsPhone().getPendingMmiCodes());
+ }
if (codes.size() > 0) {
final MmiCode mmiCode = codes.get(0);
final Message message = Message.obtain(mHandler, PhoneGlobals.MMI_CANCEL);