diff options
author | twyen <twyen@google.com> | 2017-07-17 10:30:20 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-07-24 20:39:23 +0000 |
commit | ce761e92df47b50ae3206dd402a46413e8ac3943 (patch) | |
tree | f16cf2481d9ff34da361154f62098313d3e7f689 /java | |
parent | 01eeb0980b82e1f674973c3ea2721446b9938bf9 (diff) |
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
Diffstat (limited to 'java')
-rw-r--r-- | java/com/android/incallui/answer/impl/hint/PawSecretCodeListener.java | 5 |
1 files changed, 3 insertions, 2 deletions
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) { |