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
This commit is contained in:
Willy Hu
2021-03-22 11:36:54 +08:00
parent efbd8b3961
commit 138b89d652

View File

@@ -2465,7 +2465,10 @@ public class SubscriptionManager {
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) {