Ignore network policies with missing IMSI.
In rare cases, we might have created a network policy before an IMSI was available. Because this policy is persisted, and we incorrectly think that it always applies, we end up annoying the user when data usage goes over the 2GB default warning threshold. This patch fixes the network matching logic to ignore these empty network policies when present. Bug: 24972775 Change-Id: Id26499b6716121dddf0f2c05b848b0bed5995e72
This commit is contained in:
@@ -288,7 +288,8 @@ public class NetworkTemplate implements Parcelable {
|
|||||||
} else {
|
} else {
|
||||||
final boolean matchesType = (sForceAllNetworkTypes
|
final boolean matchesType = (sForceAllNetworkTypes
|
||||||
|| contains(DATA_USAGE_NETWORK_TYPES, ident.mType));
|
|| contains(DATA_USAGE_NETWORK_TYPES, ident.mType));
|
||||||
return matchesType && ArrayUtils.contains(mMatchSubscriberIds, ident.mSubscriberId);
|
return matchesType && !ArrayUtils.isEmpty(mMatchSubscriberIds)
|
||||||
|
&& ArrayUtils.contains(mMatchSubscriberIds, ident.mSubscriberId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user