Prevent Caching the Invalid Resource

In the old design, device may cached the invalid resource,
SubscriptionManager#getResourcesForSubId return the wrong
resource after factory reset. We clear the cache to prevent
the invalid resource.

Bug: 181202520
Test: atest SubscriptionControllerTest#testGetResourcesForSubId
      atest FrameworksTelephonyTests
Change-Id: Id16c76bec55b32937a723f1a0d825ab16f5e8afb
diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java
index 85fe14e..47a802f 100644
--- a/telephony/java/android/telephony/SubscriptionManager.java
+++ b/telephony/java/android/telephony/SubscriptionManager.java
@@ -2465,7 +2465,10 @@
         if (subInfo != null) {
             overrideConfig.mcc = subInfo.getMcc();
             overrideConfig.mnc = subInfo.getMnc();
-            if (overrideConfig.mnc == 0) overrideConfig.mnc = Configuration.MNC_ZERO;
+            if (overrideConfig.mnc == 0) {
+                overrideConfig.mnc = Configuration.MNC_ZERO;
+                cacheKey = null;
+            }
         }
 
         if (useRootLocale) {