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

Commit cd5768fe authored by Tyler Gunn's avatar Tyler Gunn
Browse files

Fix NPE in CallStats.

If the target phone account for a call is not known, an NPE will take
place.

Fixes: 372974241
Flag: com.android.server.telecom.flags.telecom_metrics_support
Test: This is a bugfix to correct an NPE in the setup path for a flag.
Change-Id: I60f2ecb3144ca1ccca1716d66eaaa74545491444
parent 7c181fcf
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -165,6 +165,9 @@ public class CallStats extends TelecomPulledAtom {
    }

    private int getAccountType(PhoneAccount account) {
        if (account == null) {
            return CALL_STATS__ACCOUNT_TYPE__ACCOUNT_UNKNOWN;
        }
        if (account.hasCapabilities(PhoneAccount.CAPABILITY_SELF_MANAGED)) {
            return account.hasCapabilities(
                    PhoneAccount.CAPABILITY_SUPPORTS_TRANSACTIONAL_OPERATIONS)