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
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 @@
         } 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);
         }
     }