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

Commit 163e709f authored by twyen's avatar twyen Committed by Brandon Maxwell
Browse files

Fix NPE in CallLogCacheLollipopMr1.isVoicemailNumber()

Bug: 63012482
Test: CallLogCacheLollipopMr1Test
PiperOrigin-RevId: 160303077
Change-Id: I00c80a681963c5a7a25fffd04e02db32ca2386dd
parent e85fa664
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.dialer.app.calllog.calllogcache;

import android.content.Context;
import android.support.annotation.Nullable;
import android.telecom.PhoneAccountHandle;
import com.android.dialer.app.calllog.CallLogAdapter;
import com.android.dialer.util.CallUtil;
@@ -57,7 +58,8 @@ public abstract class CallLogCache {
   * Returns true if the given number is the number of the configured voicemail. To be able to
   * mock-out this, it is not a static method.
   */
  public abstract boolean isVoicemailNumber(PhoneAccountHandle accountHandle, CharSequence number);
  public abstract boolean isVoicemailNumber(
      PhoneAccountHandle accountHandle, @Nullable CharSequence number);

  /**
   * Returns {@code true} when the current sim supports checking video calling capabilities via the
+7 −1
Original line number Diff line number Diff line
@@ -17,7 +17,9 @@
package com.android.dialer.app.calllog.calllogcache;

import android.content.Context;
import android.support.annotation.Nullable;
import android.telecom.PhoneAccountHandle;
import android.text.TextUtils;
import android.util.ArrayMap;
import com.android.dialer.calllogutils.PhoneAccountUtils;
import com.android.dialer.telecom.TelecomUtil;
@@ -50,7 +52,11 @@ class CallLogCacheLollipopMr1 extends CallLogCache {
  }

  @Override
  public boolean isVoicemailNumber(PhoneAccountHandle accountHandle, CharSequence number) {
  public boolean isVoicemailNumber(
      PhoneAccountHandle accountHandle, @Nullable CharSequence number) {
    if (TextUtils.isEmpty(number)) {
      return false;
    }
    return TelecomUtil.isVoicemailNumber(mContext, accountHandle, number.toString());
  }