Merge "Don't reinflate signal icons unless we really need to." into mnc-dev
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user