Loading telephony/java/android/telephony/SubscriptionManager.java +23 −6 Original line number Diff line number Diff line Loading @@ -160,6 +160,10 @@ public class SubscriptionManager { private static final String CACHE_KEY_SUBSCRIPTION_MANAGER_SERVICE_PROPERTY = "cache_key.telephony.subscription_manager_service"; /** The temporarily cache key to indicate whether subscription manager service is enabled. */ private static final String CACHE_KEY_SUBSCRIPTION_MANAGER_SERVICE_ENABLED_PROPERTY = "cache_key.telephony.subscription_manager_service_enabled"; /** @hide */ public static final String GET_SIM_SPECIFIC_SETTINGS_METHOD_NAME = "getSimSpecificSettings"; Loading Loading @@ -340,6 +344,12 @@ public class SubscriptionManager { CACHE_KEY_SUBSCRIPTION_MANAGER_SERVICE_PROPERTY, INVALID_PHONE_INDEX); //TODO: Removed before U AOSP public release. private static VoidPropertyInvalidatedCache<Boolean> sIsSubscriptionManagerServiceEnabled = new VoidPropertyInvalidatedCache<>(ISub::isSubscriptionManagerServiceEnabled, CACHE_KEY_SUBSCRIPTION_MANAGER_SERVICE_ENABLED_PROPERTY, false); /** * Generates a content {@link Uri} used to receive updates on simInfo change * on the given subscriptionId Loading Loading @@ -1358,8 +1368,6 @@ public class SubscriptionManager { private final Context mContext; private static boolean sIsSubscriptionManagerServiceEnabled = false; // Cache of Resource that has been created in getResourcesForSubId. Key is a Pair containing // the Context and subId. private static final Map<Pair<Context, Integer>, Resources> sResourcesCache = Loading Loading @@ -1445,9 +1453,6 @@ public class SubscriptionManager { public SubscriptionManager(Context context) { if (DBG) logd("SubscriptionManager created"); mContext = context; sIsSubscriptionManagerServiceEnabled = mContext.getResources().getBoolean( com.android.internal.R.bool.config_using_subscription_manager_service); } /** Loading @@ -1456,8 +1461,9 @@ public class SubscriptionManager { * * @hide */ //TODO: Removed before U AOSP public release. public static boolean isSubscriptionManagerServiceEnabled() { return sIsSubscriptionManagerServiceEnabled; return sIsSubscriptionManagerServiceEnabled.query(null); } private NetworkPolicyManager getNetworkPolicyManager() { Loading Loading @@ -3971,6 +3977,13 @@ public class SubscriptionManager { PropertyInvalidatedCache.invalidateCache(CACHE_KEY_SUBSCRIPTION_MANAGER_SERVICE_PROPERTY); } /** @hide */ //TODO: Removed before U AOSP public release. public static void invalidateSubscriptionManagerServiceEnabledCaches() { PropertyInvalidatedCache.invalidateCache( CACHE_KEY_SUBSCRIPTION_MANAGER_SERVICE_ENABLED_PROPERTY); } /** * Allows a test process to disable client-side caching operations. * Loading @@ -3992,6 +4005,8 @@ public class SubscriptionManager { sGetSlotIndexCache.disableLocal(); sGetSubIdCache.disableLocal(); sGetPhoneIdCache.disableLocal(); sIsSubscriptionManagerServiceEnabled.disableLocal(); } /** Loading @@ -4014,6 +4029,8 @@ public class SubscriptionManager { sGetSlotIndexCache.clear(); sGetSubIdCache.clear(); sGetPhoneIdCache.clear(); sIsSubscriptionManagerServiceEnabled.clear(); } /** Loading telephony/java/com/android/internal/telephony/ISub.aidl +7 −0 Original line number Diff line number Diff line Loading @@ -356,4 +356,11 @@ interface ISub { * @hide */ List<SubscriptionInfo> getSubscriptionInfoListAssociatedWithUser(in UserHandle userHandle); /** * @return {@code true} if using SubscriptionManagerService instead of * SubscriptionController. */ //TODO: Removed before U AOSP public release. boolean isSubscriptionManagerServiceEnabled(); } Loading
telephony/java/android/telephony/SubscriptionManager.java +23 −6 Original line number Diff line number Diff line Loading @@ -160,6 +160,10 @@ public class SubscriptionManager { private static final String CACHE_KEY_SUBSCRIPTION_MANAGER_SERVICE_PROPERTY = "cache_key.telephony.subscription_manager_service"; /** The temporarily cache key to indicate whether subscription manager service is enabled. */ private static final String CACHE_KEY_SUBSCRIPTION_MANAGER_SERVICE_ENABLED_PROPERTY = "cache_key.telephony.subscription_manager_service_enabled"; /** @hide */ public static final String GET_SIM_SPECIFIC_SETTINGS_METHOD_NAME = "getSimSpecificSettings"; Loading Loading @@ -340,6 +344,12 @@ public class SubscriptionManager { CACHE_KEY_SUBSCRIPTION_MANAGER_SERVICE_PROPERTY, INVALID_PHONE_INDEX); //TODO: Removed before U AOSP public release. private static VoidPropertyInvalidatedCache<Boolean> sIsSubscriptionManagerServiceEnabled = new VoidPropertyInvalidatedCache<>(ISub::isSubscriptionManagerServiceEnabled, CACHE_KEY_SUBSCRIPTION_MANAGER_SERVICE_ENABLED_PROPERTY, false); /** * Generates a content {@link Uri} used to receive updates on simInfo change * on the given subscriptionId Loading Loading @@ -1358,8 +1368,6 @@ public class SubscriptionManager { private final Context mContext; private static boolean sIsSubscriptionManagerServiceEnabled = false; // Cache of Resource that has been created in getResourcesForSubId. Key is a Pair containing // the Context and subId. private static final Map<Pair<Context, Integer>, Resources> sResourcesCache = Loading Loading @@ -1445,9 +1453,6 @@ public class SubscriptionManager { public SubscriptionManager(Context context) { if (DBG) logd("SubscriptionManager created"); mContext = context; sIsSubscriptionManagerServiceEnabled = mContext.getResources().getBoolean( com.android.internal.R.bool.config_using_subscription_manager_service); } /** Loading @@ -1456,8 +1461,9 @@ public class SubscriptionManager { * * @hide */ //TODO: Removed before U AOSP public release. public static boolean isSubscriptionManagerServiceEnabled() { return sIsSubscriptionManagerServiceEnabled; return sIsSubscriptionManagerServiceEnabled.query(null); } private NetworkPolicyManager getNetworkPolicyManager() { Loading Loading @@ -3971,6 +3977,13 @@ public class SubscriptionManager { PropertyInvalidatedCache.invalidateCache(CACHE_KEY_SUBSCRIPTION_MANAGER_SERVICE_PROPERTY); } /** @hide */ //TODO: Removed before U AOSP public release. public static void invalidateSubscriptionManagerServiceEnabledCaches() { PropertyInvalidatedCache.invalidateCache( CACHE_KEY_SUBSCRIPTION_MANAGER_SERVICE_ENABLED_PROPERTY); } /** * Allows a test process to disable client-side caching operations. * Loading @@ -3992,6 +4005,8 @@ public class SubscriptionManager { sGetSlotIndexCache.disableLocal(); sGetSubIdCache.disableLocal(); sGetPhoneIdCache.disableLocal(); sIsSubscriptionManagerServiceEnabled.disableLocal(); } /** Loading @@ -4014,6 +4029,8 @@ public class SubscriptionManager { sGetSlotIndexCache.clear(); sGetSubIdCache.clear(); sGetPhoneIdCache.clear(); sIsSubscriptionManagerServiceEnabled.clear(); } /** Loading
telephony/java/com/android/internal/telephony/ISub.aidl +7 −0 Original line number Diff line number Diff line Loading @@ -356,4 +356,11 @@ interface ISub { * @hide */ List<SubscriptionInfo> getSubscriptionInfoListAssociatedWithUser(in UserHandle userHandle); /** * @return {@code true} if using SubscriptionManagerService instead of * SubscriptionController. */ //TODO: Removed before U AOSP public release. boolean isSubscriptionManagerServiceEnabled(); }