Add subId while launching MMI dialog
While creating intent to MMI dialog activity pass subscription
info as well to the corresponding phone.
Bug: 34872761
Change-Id: I830655bb18eed6845240cb701ea27c50129d93dc
diff --git a/src/com/android/phone/MMIDialogActivity.java b/src/com/android/phone/MMIDialogActivity.java
index 5ac6b85..1e6fa41 100644
--- a/src/com/android/phone/MMIDialogActivity.java
+++ b/src/com/android/phone/MMIDialogActivity.java
@@ -18,10 +18,12 @@
import android.app.Activity;
import android.app.Dialog;
+import android.content.Intent;
import android.os.AsyncResult;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
+import android.telephony.SubscriptionManager;
import android.util.Log;
import android.widget.Toast;
@@ -43,12 +45,16 @@
private Handler mHandler;
private CallManager mCM = PhoneGlobals.getInstance().getCallManager();
- private Phone mPhone = PhoneGlobals.getPhone();
+ private Phone mPhone;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+ Intent intent = getIntent();
+ int subId = intent.getIntExtra(PhoneConstants.SUBSCRIPTION_KEY,
+ SubscriptionManager.DEFAULT_SUBSCRIPTION_ID);
+ mPhone = PhoneGlobals.getPhone(subId);
mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {