Check null for getPhoneAccount()
A phone account can be removed after calling getCallCapablePhoneAccounts(), so subsequent getPhoneAccount() can be null.
Other usages already has the null check.
Bug: 75598828
Test: N/A testing this involves getPhoneAccount() returning null on the nth call, which requires replacing the shadows with a mock and is highly coupled with the implementation. The is an edge case and is not worth the effort and brittleness it will cause.
PiperOrigin-RevId: 189644833
Change-Id: Ie92dda2537befb5936ad734954b4eaf75964f465
diff --git a/java/com/android/incallui/StatusBarNotifier.java b/java/com/android/incallui/StatusBarNotifier.java
index e2340b5..ef5965c 100644
--- a/java/com/android/incallui/StatusBarNotifier.java
+++ b/java/com/android/incallui/StatusBarNotifier.java
@@ -803,6 +803,9 @@
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(