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

Commit f5820276 authored by Jason Monk's avatar Jason Monk Committed by Android (Google) Code Review
Browse files

Merge "Don't reinflate signal icons unless we really need to." into mnc-dev

parents a5aabfeb f535cf04
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -251,6 +251,9 @@ public class SignalClusterView

    @Override
    public void setSubs(List<SubscriptionInfo> subs) {
        if (hasCorrectSubs(subs)) {
            return;
        }
        // Clear out all old subIds.
        mPhoneStates.clear();
        if (mMobileSignalGroup != null) {
@@ -265,6 +268,19 @@ public class SignalClusterView
        }
    }

    private boolean hasCorrectSubs(List<SubscriptionInfo> subs) {
        final int N = subs.size();
        if (N != mPhoneStates.size()) {
            return false;
        }
        for (int i = 0; i < N; i++) {
            if (mPhoneStates.get(i).mSubId != subs.get(i).getSubscriptionId()) {
                return false;
            }
        }
        return true;
    }

    private PhoneState getOrInflateState(int subId) {
        for (PhoneState state : mPhoneStates) {
            if (state.mSubId == subId) {