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

Commit ce0b58e0 authored by twyen's avatar twyen Committed by android-build-merger
Browse files

Merge "Check null for getPhoneAccount()" am: 117486bc

am: c66177fa

Change-Id: Ib95d91c51beb8fdcf7ac2fe41f3267a6035d53f7
parents 755f87b6 c66177fa
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -531,6 +531,9 @@ public class CallSubjectDialog extends Activity {

    TelecomManager telecomManager = (TelecomManager) getSystemService(Context.TELECOM_SERVICE);
    final PhoneAccount account = telecomManager.getPhoneAccount(mPhoneAccountHandle);
    if (account == null) {
      return;
    }

    Bundle phoneAccountExtras = account.getExtras();
    if (phoneAccountExtras == null) {
+4 −3
Original line number Diff line number Diff line
@@ -141,14 +141,15 @@ public final class LegacyVoicemailNotifier {
    if (TelecomUtil.getCallCapablePhoneAccounts(context).size() > 1) {
      TelecomManager telecomManager = context.getSystemService(TelecomManager.class);
      PhoneAccount phoneAccount = telecomManager.getPhoneAccount(handle);
      if (phoneAccount != null) {
        return phoneAccount.getShortDescription().toString();
    } else {
      }
    }
      return String.format(
          context.getString(R.string.notification_voicemail_text_format),
          PhoneNumberHelper.formatNumber(
              context, voicemailNumber, GeoUtil.getCurrentCountryIso(context)));
  }
  }

  public static void cancelNotification(
      @NonNull Context context, @NonNull PhoneAccountHandle phoneAccountHandle) {
+3 −0
Original line number Diff line number Diff line
@@ -241,6 +241,9 @@ public class DialerSettingsActivity extends AppCompatPreferenceActivity {
    PhoneAccountHandle result = null;
    for (PhoneAccountHandle phoneAccountHandle : telecomManager.getCallCapablePhoneAccounts()) {
      PhoneAccount phoneAccount = telecomManager.getPhoneAccount(phoneAccountHandle);
      if (phoneAccount == null) {
        continue;
      }
      if (phoneAccount.hasCapabilities(PhoneAccount.CAPABILITY_SIM_SUBSCRIPTION)) {
        LogUtil.i(
            "DialerSettingsActivity.getSoleSimAccount", phoneAccountHandle + " is a SIM account");
+3 −0
Original line number Diff line number Diff line
@@ -311,6 +311,9 @@ public abstract class TelecomUtil {
    TelecomManager telecomManager = context.getSystemService(TelecomManager.class);
    for (PhoneAccountHandle phoneAccountHandle : telecomManager.getCallCapablePhoneAccounts()) {
      PhoneAccount phoneAccount = telecomManager.getPhoneAccount(phoneAccountHandle);
      if (phoneAccount == null) {
        continue;
      }
      if (phoneAccount.hasCapabilities(PhoneAccount.CAPABILITY_SIM_SUBSCRIPTION)
          && !phoneAccountHandle.equals(currentAccount)) {
        return phoneAccountHandle;
+3 −0
Original line number Diff line number Diff line
@@ -803,6 +803,9 @@ public class StatusBarNotifier
  private CharSequence getMultiSimIncomingText(DialerCall call) {
    PhoneAccount phoneAccount =
        context.getSystemService(TelecomManager.class).getPhoneAccount(call.getAccountHandle());
    if (phoneAccount == null) {
      return context.getString(R.string.notification_incoming_call);
    }
    SpannableString string =
        new SpannableString(
            context.getString(