From ce761e92df47b50ae3206dd402a46413e8ac3943 Mon Sep 17 00:00:00 2001 From: twyen Date: Mon, 17 Jul 2017 10:30:20 -0700 Subject: Handle null host for secret code The "host" is the number in the "*#*#NUMBER#*#*" format. It was assumed that it could never be null, but silent crash reports proved it wrong. Repro steps are unknown. Bug: 63711549 Test: PawSecretCodeListenerTest PiperOrigin-RevId: 162232903 Change-Id: I15419178099cea7f05c1c9ed5cd595a01ae8db2b --- .../com/android/incallui/answer/impl/hint/PawSecretCodeListener.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'java/com/android') diff --git a/java/com/android/incallui/answer/impl/hint/PawSecretCodeListener.java b/java/com/android/incallui/answer/impl/hint/PawSecretCodeListener.java index 204c4e131..871d80c23 100644 --- a/java/com/android/incallui/answer/impl/hint/PawSecretCodeListener.java +++ b/java/com/android/incallui/answer/impl/hint/PawSecretCodeListener.java @@ -24,7 +24,6 @@ import android.support.annotation.IntDef; import android.support.annotation.VisibleForTesting; import android.text.TextUtils; import android.widget.Toast; -import com.android.dialer.common.Assert; import com.android.dialer.common.LogUtil; import com.android.dialer.configprovider.ConfigProviderBindings; import com.android.dialer.logging.DialerImpression.Type; @@ -59,7 +58,9 @@ public class PawSecretCodeListener extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { String host = intent.getData().getHost(); - Assert.checkState(!TextUtils.isEmpty(host)); + if (TextUtils.isEmpty(host)) { + return; + } String secretCode = ConfigProviderBindings.get(context).getString(CONFIG_PAW_SECRET_CODE, "729"); if (secretCode == null) { -- cgit v1.2.3