diff options
| author | 2023-10-31 06:26:08 +0000 | |
|---|---|---|
| committer | 2023-10-31 06:26:08 +0000 | |
| commit | ff60959bdfc77b01bc0fbfa8d44dcf4d07f6bf7e (patch) | |
| tree | 88d379bc5af41e07cb63b3c02d0aae7369f3229f | |
| parent | 911f76c3bedc1e451e67491f6e86c0dd6c854020 (diff) | |
| parent | 343cab409a3f78adc9739be8867abf3664681bb3 (diff) | |
Merge "Revert "Limited profiles to access only associated subscriptions"" into main
| -rw-r--r-- | telephony/java/android/telephony/SubscriptionManager.java | 22 | ||||
| -rw-r--r-- | telephony/java/com/android/internal/telephony/ISub.aidl | 3 |
2 files changed, 11 insertions, 14 deletions
diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java index f8608b8fead2..8e90fe7ea975 100644 --- a/telephony/java/android/telephony/SubscriptionManager.java +++ b/telephony/java/android/telephony/SubscriptionManager.java @@ -265,8 +265,8 @@ public class SubscriptionManager { } } - private static IntegerPropertyInvalidatedCache<Integer> sGetDefaultSubIdCacheAsUser = - new IntegerPropertyInvalidatedCache<>(ISub::getDefaultSubIdAsUser, + private static VoidPropertyInvalidatedCache<Integer> sGetDefaultSubIdCache = + new VoidPropertyInvalidatedCache<>(ISub::getDefaultSubId, CACHE_KEY_SUBSCRIPTION_MANAGER_SERVICE_PROPERTY, INVALID_SUBSCRIPTION_ID); @@ -275,8 +275,8 @@ public class SubscriptionManager { CACHE_KEY_SUBSCRIPTION_MANAGER_SERVICE_PROPERTY, INVALID_SUBSCRIPTION_ID); - private static IntegerPropertyInvalidatedCache<Integer> sGetDefaultSmsSubIdCacheAsUser = - new IntegerPropertyInvalidatedCache<>(ISub::getDefaultSmsSubIdAsUser, + private static VoidPropertyInvalidatedCache<Integer> sGetDefaultSmsSubIdCache = + new VoidPropertyInvalidatedCache<>(ISub::getDefaultSmsSubId, CACHE_KEY_SUBSCRIPTION_MANAGER_SERVICE_PROPERTY, INVALID_SUBSCRIPTION_ID); @@ -2309,7 +2309,7 @@ public class SubscriptionManager { * @return the "system" default subscription id. */ public static int getDefaultSubscriptionId() { - return sGetDefaultSubIdCacheAsUser.query(Process.myUserHandle().getIdentifier()); + return sGetDefaultSubIdCache.query(null); } /** @@ -2325,7 +2325,7 @@ public class SubscriptionManager { try { ISub iSub = TelephonyManager.getSubscriptionService(); if (iSub != null) { - subId = iSub.getDefaultVoiceSubIdAsUser(Process.myUserHandle().getIdentifier()); + subId = iSub.getDefaultVoiceSubId(); } } catch (RemoteException ex) { // ignore it @@ -2397,7 +2397,7 @@ public class SubscriptionManager { * @return the default SMS subscription Id. */ public static int getDefaultSmsSubscriptionId() { - return sGetDefaultSmsSubIdCacheAsUser.query(Process.myUserHandle().getIdentifier()); + return sGetDefaultSmsSubIdCache.query(null); } /** @@ -3927,10 +3927,10 @@ public class SubscriptionManager { * @hide */ public static void disableCaching() { - sGetDefaultSubIdCacheAsUser.disableLocal(); + sGetDefaultSubIdCache.disableLocal(); sGetDefaultDataSubIdCache.disableLocal(); sGetActiveDataSubscriptionIdCache.disableLocal(); - sGetDefaultSmsSubIdCacheAsUser.disableLocal(); + sGetDefaultSmsSubIdCache.disableLocal(); sGetSlotIndexCache.disableLocal(); sGetSubIdCache.disableLocal(); sGetPhoneIdCache.disableLocal(); @@ -3941,10 +3941,10 @@ public class SubscriptionManager { * * @hide */ public static void clearCaches() { - sGetDefaultSubIdCacheAsUser.clear(); + sGetDefaultSubIdCache.clear(); sGetDefaultDataSubIdCache.clear(); sGetActiveDataSubscriptionIdCache.clear(); - sGetDefaultSmsSubIdCacheAsUser.clear(); + sGetDefaultSmsSubIdCache.clear(); sGetSlotIndexCache.clear(); sGetSubIdCache.clear(); sGetPhoneIdCache.clear(); diff --git a/telephony/java/com/android/internal/telephony/ISub.aidl b/telephony/java/com/android/internal/telephony/ISub.aidl index d2dbeb7aff74..a5a23e8659d8 100644 --- a/telephony/java/com/android/internal/telephony/ISub.aidl +++ b/telephony/java/com/android/internal/telephony/ISub.aidl @@ -239,7 +239,6 @@ interface ISub { int getSubId(int slotIndex); int getDefaultSubId(); - int getDefaultSubIdAsUser(int userId); int getPhoneId(int subId); @@ -252,12 +251,10 @@ 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); |