summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2015-10-19 16:52:08 -0700
committerJeff Sharkey <jsharkey@android.com>2015-10-19 16:52:08 -0700
commit56859f323c1e7da9d537478e080d73614b207376 (patch)
tree9bb84dcdf82d3ceb8d5cbb10b3a12a85718f1a04
parenta5917b71b0e2f98fa6906b795b28cab059cc092b (diff)
downloadframeworks_base-56859f323c1e7da9d537478e080d73614b207376.zip
frameworks_base-56859f323c1e7da9d537478e080d73614b207376.tar.gz
frameworks_base-56859f323c1e7da9d537478e080d73614b207376.tar.bz2
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
-rw-r--r--core/java/android/net/NetworkTemplate.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/java/android/net/NetworkTemplate.java b/core/java/android/net/NetworkTemplate.java
index 57eef83..b7a411e 100644
--- a/core/java/android/net/NetworkTemplate.java
+++ b/core/java/android/net/NetworkTemplate.java
@@ -288,7 +288,8 @@ public class NetworkTemplate implements Parcelable {
} else {
final boolean matchesType = (sForceAllNetworkTypes
|| contains(DATA_USAGE_NETWORK_TYPES, ident.mType));
- return matchesType && ArrayUtils.contains(mMatchSubscriberIds, ident.mSubscriberId);
+ return matchesType && !ArrayUtils.isEmpty(mMatchSubscriberIds)
+ && ArrayUtils.contains(mMatchSubscriberIds, ident.mSubscriberId);
}
}