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

Commit 117486bc authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Check null for getPhoneAccount()"

parents 077dc7af e931c124
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(