From 7542cfca1e7e76e7ee11a0976391cb8a15928b91 Mon Sep 17 00:00:00 2001 From: Jack Yu Date: Tue, 18 Jul 2023 19:33:58 -0700 Subject: [PATCH] Fixed subscription database cache out of sync The subscription reloading from database could cause cache to be out-of-sync. Fixed by making reloading synchronous and only reload when necessary (e.g. Backup restore actually changes the database). Fix: 290295550 Test: atest SubscriptionManagerServiceTest TelephonyProviderTests Test: Manually test backup/restore Test: Telephony basic functionality tests Test: Re-tested passed on b/290295550#comment#23 Change-Id: Ib818110a1f03536ed9082e779b3cc89e56608084 --- .../java/android/telephony/SubscriptionManager.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java index 64e43568e4d61..8e4ec0914563a 100644 --- a/telephony/java/android/telephony/SubscriptionManager.java +++ b/telephony/java/android/telephony/SubscriptionManager.java @@ -150,6 +150,15 @@ public class SubscriptionManager { public static final String RESTORE_SIM_SPECIFIC_SETTINGS_METHOD_NAME = "restoreSimSpecificSettings"; + /** + * The key of the boolean flag indicating whether restoring subscriptions actually changes + * the subscription database or not. + * + * @hide + */ + public static final String RESTORE_SIM_SPECIFIC_SETTINGS_DATABASE_UPDATED = + "restoreSimSpecificSettingsDatabaseUpdated"; + /** * Key to the backup & restore data byte array in the Bundle that is returned by {@link * #getAllSimSpecificSettingsForBackup()} or to be pass in to {@link