Fix Telephony crashes from bad broadcast receiver behavior.
1) Removes old classes that are no longer used or caused
a crash in Telephony when adb was used to start them.
2) Fixes some potential issues when starting Telephony
components from other processes.
Bug: 66504458
Test: Launch with adb and make sure nothing crashes
Change-Id: If1cae5d41cc21c48d248a018dd393c41fe1e595d
diff --git a/src/com/android/phone/MMIDialogActivity.java b/src/com/android/phone/MMIDialogActivity.java
index 4afa6be..c9be2ac 100644
--- a/src/com/android/phone/MMIDialogActivity.java
+++ b/src/com/android/phone/MMIDialogActivity.java
@@ -25,7 +25,6 @@
import android.os.Message;
import android.telephony.SubscriptionManager;
import android.util.Log;
-import android.widget.Toast;
import com.android.internal.telephony.CallManager;
import com.android.internal.telephony.MmiCode;
@@ -56,6 +55,11 @@
int subId = intent.getIntExtra(PhoneConstants.SUBSCRIPTION_KEY,
SubscriptionManager.DEFAULT_SUBSCRIPTION_ID);
mPhone = PhoneGlobals.getPhone(subId);
+ if (mPhone == null) {
+ Log.w(TAG, "onCreate: invalid subscription id (" + subId + ") lead to null"
+ + " Phone.");
+ finish();
+ }
mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {