Loading telephony/java/android/telephony/SubscriptionManager.java +11 −11 Original line number Diff line number Diff line Loading @@ -265,8 +265,8 @@ public class SubscriptionManager { } } private static VoidPropertyInvalidatedCache<Integer> sGetDefaultSubIdCache = new VoidPropertyInvalidatedCache<>(ISub::getDefaultSubId, private static IntegerPropertyInvalidatedCache<Integer> sGetDefaultSubIdCacheAsUser = new IntegerPropertyInvalidatedCache<>(ISub::getDefaultSubIdAsUser, CACHE_KEY_SUBSCRIPTION_MANAGER_SERVICE_PROPERTY, INVALID_SUBSCRIPTION_ID); Loading @@ -275,8 +275,8 @@ public class SubscriptionManager { CACHE_KEY_SUBSCRIPTION_MANAGER_SERVICE_PROPERTY, INVALID_SUBSCRIPTION_ID); private static VoidPropertyInvalidatedCache<Integer> sGetDefaultSmsSubIdCache = new VoidPropertyInvalidatedCache<>(ISub::getDefaultSmsSubId, private static IntegerPropertyInvalidatedCache<Integer> sGetDefaultSmsSubIdCacheAsUser = new IntegerPropertyInvalidatedCache<>(ISub::getDefaultSmsSubIdAsUser, CACHE_KEY_SUBSCRIPTION_MANAGER_SERVICE_PROPERTY, INVALID_SUBSCRIPTION_ID); Loading Loading @@ -2309,7 +2309,7 @@ public class SubscriptionManager { * @return the "system" default subscription id. */ public static int getDefaultSubscriptionId() { return sGetDefaultSubIdCache.query(null); return sGetDefaultSubIdCacheAsUser.query(Process.myUserHandle().getIdentifier()); } /** Loading @@ -2325,7 +2325,7 @@ public class SubscriptionManager { try { ISub iSub = TelephonyManager.getSubscriptionService(); if (iSub != null) { subId = iSub.getDefaultVoiceSubId(); subId = iSub.getDefaultVoiceSubIdAsUser(Process.myUserHandle().getIdentifier()); } } catch (RemoteException ex) { // ignore it Loading Loading @@ -2397,7 +2397,7 @@ public class SubscriptionManager { * @return the default SMS subscription Id. */ public static int getDefaultSmsSubscriptionId() { return sGetDefaultSmsSubIdCache.query(null); return sGetDefaultSmsSubIdCacheAsUser.query(Process.myUserHandle().getIdentifier()); } /** Loading Loading @@ -3927,10 +3927,10 @@ public class SubscriptionManager { * @hide */ public static void disableCaching() { sGetDefaultSubIdCache.disableLocal(); sGetDefaultSubIdCacheAsUser.disableLocal(); sGetDefaultDataSubIdCache.disableLocal(); sGetActiveDataSubscriptionIdCache.disableLocal(); sGetDefaultSmsSubIdCache.disableLocal(); sGetDefaultSmsSubIdCacheAsUser.disableLocal(); sGetSlotIndexCache.disableLocal(); sGetSubIdCache.disableLocal(); sGetPhoneIdCache.disableLocal(); Loading @@ -3941,10 +3941,10 @@ public class SubscriptionManager { * * @hide */ public static void clearCaches() { sGetDefaultSubIdCache.clear(); sGetDefaultSubIdCacheAsUser.clear(); sGetDefaultDataSubIdCache.clear(); sGetActiveDataSubscriptionIdCache.clear(); sGetDefaultSmsSubIdCache.clear(); sGetDefaultSmsSubIdCacheAsUser.clear(); sGetSlotIndexCache.clear(); sGetSubIdCache.clear(); sGetPhoneIdCache.clear(); Loading telephony/java/com/android/internal/telephony/ISub.aidl +3 −0 Original line number Diff line number Diff line Loading @@ -239,6 +239,7 @@ interface ISub { int getSubId(int slotIndex); int getDefaultSubId(); int getDefaultSubIdAsUser(int userId); int getPhoneId(int subId); Loading @@ -251,10 +252,12 @@ interface ISub { void setDefaultDataSubId(int subId); int getDefaultVoiceSubId(); int getDefaultVoiceSubIdAsUser(int userId); void setDefaultVoiceSubId(int subId); int getDefaultSmsSubId(); int getDefaultSmsSubIdAsUser(int userId); void setDefaultSmsSubId(int subId); Loading Loading
telephony/java/android/telephony/SubscriptionManager.java +11 −11 Original line number Diff line number Diff line Loading @@ -265,8 +265,8 @@ public class SubscriptionManager { } } private static VoidPropertyInvalidatedCache<Integer> sGetDefaultSubIdCache = new VoidPropertyInvalidatedCache<>(ISub::getDefaultSubId, private static IntegerPropertyInvalidatedCache<Integer> sGetDefaultSubIdCacheAsUser = new IntegerPropertyInvalidatedCache<>(ISub::getDefaultSubIdAsUser, CACHE_KEY_SUBSCRIPTION_MANAGER_SERVICE_PROPERTY, INVALID_SUBSCRIPTION_ID); Loading @@ -275,8 +275,8 @@ public class SubscriptionManager { CACHE_KEY_SUBSCRIPTION_MANAGER_SERVICE_PROPERTY, INVALID_SUBSCRIPTION_ID); private static VoidPropertyInvalidatedCache<Integer> sGetDefaultSmsSubIdCache = new VoidPropertyInvalidatedCache<>(ISub::getDefaultSmsSubId, private static IntegerPropertyInvalidatedCache<Integer> sGetDefaultSmsSubIdCacheAsUser = new IntegerPropertyInvalidatedCache<>(ISub::getDefaultSmsSubIdAsUser, CACHE_KEY_SUBSCRIPTION_MANAGER_SERVICE_PROPERTY, INVALID_SUBSCRIPTION_ID); Loading Loading @@ -2309,7 +2309,7 @@ public class SubscriptionManager { * @return the "system" default subscription id. */ public static int getDefaultSubscriptionId() { return sGetDefaultSubIdCache.query(null); return sGetDefaultSubIdCacheAsUser.query(Process.myUserHandle().getIdentifier()); } /** Loading @@ -2325,7 +2325,7 @@ public class SubscriptionManager { try { ISub iSub = TelephonyManager.getSubscriptionService(); if (iSub != null) { subId = iSub.getDefaultVoiceSubId(); subId = iSub.getDefaultVoiceSubIdAsUser(Process.myUserHandle().getIdentifier()); } } catch (RemoteException ex) { // ignore it Loading Loading @@ -2397,7 +2397,7 @@ public class SubscriptionManager { * @return the default SMS subscription Id. */ public static int getDefaultSmsSubscriptionId() { return sGetDefaultSmsSubIdCache.query(null); return sGetDefaultSmsSubIdCacheAsUser.query(Process.myUserHandle().getIdentifier()); } /** Loading Loading @@ -3927,10 +3927,10 @@ public class SubscriptionManager { * @hide */ public static void disableCaching() { sGetDefaultSubIdCache.disableLocal(); sGetDefaultSubIdCacheAsUser.disableLocal(); sGetDefaultDataSubIdCache.disableLocal(); sGetActiveDataSubscriptionIdCache.disableLocal(); sGetDefaultSmsSubIdCache.disableLocal(); sGetDefaultSmsSubIdCacheAsUser.disableLocal(); sGetSlotIndexCache.disableLocal(); sGetSubIdCache.disableLocal(); sGetPhoneIdCache.disableLocal(); Loading @@ -3941,10 +3941,10 @@ public class SubscriptionManager { * * @hide */ public static void clearCaches() { sGetDefaultSubIdCache.clear(); sGetDefaultSubIdCacheAsUser.clear(); sGetDefaultDataSubIdCache.clear(); sGetActiveDataSubscriptionIdCache.clear(); sGetDefaultSmsSubIdCache.clear(); sGetDefaultSmsSubIdCacheAsUser.clear(); sGetSlotIndexCache.clear(); sGetSubIdCache.clear(); sGetPhoneIdCache.clear(); Loading
telephony/java/com/android/internal/telephony/ISub.aidl +3 −0 Original line number Diff line number Diff line Loading @@ -239,6 +239,7 @@ interface ISub { int getSubId(int slotIndex); int getDefaultSubId(); int getDefaultSubIdAsUser(int userId); int getPhoneId(int subId); Loading @@ -251,10 +252,12 @@ interface ISub { void setDefaultDataSubId(int subId); int getDefaultVoiceSubId(); int getDefaultVoiceSubIdAsUser(int userId); void setDefaultVoiceSubId(int subId); int getDefaultSmsSubId(); int getDefaultSmsSubIdAsUser(int userId); void setDefaultSmsSubId(int subId); Loading