Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e465c979 authored by Erik Wolsheimer's avatar Erik Wolsheimer
Browse files

Prevent phone process crashing on bad params to TelephonyTester

BUG: 35128562
Change-Id: I4231b2507cd6e2e98be53a5409f98417964648d3
parent a2db360c
Loading
Loading
Loading
Loading
+24 −18
Original line number Original line Diff line number Diff line
@@ -22,6 +22,7 @@ import android.content.Intent;
import android.content.IntentFilter;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.content.SharedPreferences;
import android.net.Uri;
import android.net.Uri;
import android.os.BadParcelableException;
import android.os.Build;
import android.os.Build;
import android.preference.PreferenceManager;
import android.preference.PreferenceManager;
import android.telephony.Rlog;
import android.telephony.Rlog;
@@ -92,6 +93,7 @@ public class TelephonyTester {
            @Override
            @Override
        public void onReceive(Context context, Intent intent) {
        public void onReceive(Context context, Intent intent) {
            String action = intent.getAction();
            String action = intent.getAction();
            try {
                if (DBG) log("sIntentReceiver.onReceive: action=" + action);
                if (DBG) log("sIntentReceiver.onReceive: action=" + action);
                if (action.equals(mPhone.getActionDetached())) {
                if (action.equals(mPhone.getActionDetached())) {
                    log("simulate detaching");
                    log("simulate detaching");
@@ -101,7 +103,8 @@ public class TelephonyTester {
                    mPhone.getServiceStateTracker().mAttachedRegistrants.notifyRegistrants();
                    mPhone.getServiceStateTracker().mAttachedRegistrants.notifyRegistrants();
                } else if (action.equals(ACTION_TEST_CONFERENCE_EVENT_PACKAGE)) {
                } else if (action.equals(ACTION_TEST_CONFERENCE_EVENT_PACKAGE)) {
                    log("inject simulated conference event package");
                    log("inject simulated conference event package");
                handleTestConferenceEventPackage(context, intent.getStringExtra(EXTRA_FILENAME));
                    handleTestConferenceEventPackage(context,
                            intent.getStringExtra(EXTRA_FILENAME));
                } else if (action.equals(ACTION_TEST_DIALOG_EVENT_PACKAGE)) {
                } else if (action.equals(ACTION_TEST_DIALOG_EVENT_PACKAGE)) {
                    log("handle test dialog event package intent");
                    log("handle test dialog event package intent");
                    handleTestDialogEventPackageIntent(intent);
                    handleTestDialogEventPackageIntent(intent);
@@ -111,6 +114,9 @@ public class TelephonyTester {
                } else {
                } else {
                    if (DBG) log("onReceive: unknown action=" + action);
                    if (DBG) log("onReceive: unknown action=" + action);
                }
                }
            } catch (BadParcelableException e) {
                Rlog.w(LOG_TAG, e);
            }
        }
        }
    };
    };