aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Wolsheimer <ewol@google.com>2017-02-08 20:59:59 -0800
committerErik Wolsheimer <ewol@google.com>2017-02-09 09:21:51 -0800
commite465c979041310a5e5edc83e36a02e2788e2ee00 (patch)
tree5c001423900d2ae3bc3b1208520264c5be4b8bc7
parenta2db360ce762894d7ad8be4e49696b26e972abcd (diff)
downloadandroid_frameworks_opt_telephony-e465c979041310a5e5edc83e36a02e2788e2ee00.tar.gz
android_frameworks_opt_telephony-e465c979041310a5e5edc83e36a02e2788e2ee00.tar.bz2
android_frameworks_opt_telephony-e465c979041310a5e5edc83e36a02e2788e2ee00.zip
Prevent phone process crashing on bad params to TelephonyTester
BUG: 35128562 Change-Id: I4231b2507cd6e2e98be53a5409f98417964648d3
-rw-r--r--src/java/com/android/internal/telephony/TelephonyTester.java42
1 files changed, 24 insertions, 18 deletions
diff --git a/src/java/com/android/internal/telephony/TelephonyTester.java b/src/java/com/android/internal/telephony/TelephonyTester.java
index ba59e6d33..3de356fa9 100644
--- a/src/java/com/android/internal/telephony/TelephonyTester.java
+++ b/src/java/com/android/internal/telephony/TelephonyTester.java
@@ -22,6 +22,7 @@ import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.net.Uri;
+import android.os.BadParcelableException;
import android.os.Build;
import android.preference.PreferenceManager;
import android.telephony.Rlog;
@@ -92,24 +93,29 @@ public class TelephonyTester {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
- if (DBG) log("sIntentReceiver.onReceive: action=" + action);
- if (action.equals(mPhone.getActionDetached())) {
- log("simulate detaching");
- mPhone.getServiceStateTracker().mDetachedRegistrants.notifyRegistrants();
- } else if (action.equals(mPhone.getActionAttached())) {
- log("simulate attaching");
- mPhone.getServiceStateTracker().mAttachedRegistrants.notifyRegistrants();
- } else if (action.equals(ACTION_TEST_CONFERENCE_EVENT_PACKAGE)) {
- log("inject simulated conference event package");
- handleTestConferenceEventPackage(context, intent.getStringExtra(EXTRA_FILENAME));
- } else if (action.equals(ACTION_TEST_DIALOG_EVENT_PACKAGE)) {
- log("handle test dialog event package intent");
- handleTestDialogEventPackageIntent(intent);
- } else if (action.equals(ACTION_TEST_HANDOVER_FAIL)) {
- log("handle handover fail test intent");
- handleHandoverFailedIntent();
- } else {
- if (DBG) log("onReceive: unknown action=" + action);
+ try {
+ if (DBG) log("sIntentReceiver.onReceive: action=" + action);
+ if (action.equals(mPhone.getActionDetached())) {
+ log("simulate detaching");
+ mPhone.getServiceStateTracker().mDetachedRegistrants.notifyRegistrants();
+ } else if (action.equals(mPhone.getActionAttached())) {
+ log("simulate attaching");
+ mPhone.getServiceStateTracker().mAttachedRegistrants.notifyRegistrants();
+ } else if (action.equals(ACTION_TEST_CONFERENCE_EVENT_PACKAGE)) {
+ log("inject simulated conference event package");
+ handleTestConferenceEventPackage(context,
+ intent.getStringExtra(EXTRA_FILENAME));
+ } else if (action.equals(ACTION_TEST_DIALOG_EVENT_PACKAGE)) {
+ log("handle test dialog event package intent");
+ handleTestDialogEventPackageIntent(intent);
+ } else if (action.equals(ACTION_TEST_HANDOVER_FAIL)) {
+ log("handle handover fail test intent");
+ handleHandoverFailedIntent();
+ } else {
+ if (DBG) log("onReceive: unknown action=" + action);
+ }
+ } catch (BadParcelableException e) {
+ Rlog.w(LOG_TAG, e);
}
}
};