Merge "[Telephony] Handling to cache the instance of BinderCacheManager when createForSubscriptionId is called" into tm-qpr-dev

This commit is contained in:
Sungcheol Ahn
2022-08-26 01:31:48 +00:00
committed by Android (Google) Code Review

View File

@@ -223,6 +223,10 @@ public class ImsMmTelManager implements RegistrationManager {
private final int mSubId; private final int mSubId;
private final BinderCacheManager<ITelephony> mBinderCache; private final BinderCacheManager<ITelephony> mBinderCache;
// Cache Telephony Binder interfaces, one cache per process.
private static final BinderCacheManager<ITelephony> sTelephonyCache =
new BinderCacheManager<>(ImsMmTelManager::getITelephonyInterface);
/** /**
* Create an instance of {@link ImsMmTelManager} for the subscription id specified. * Create an instance of {@link ImsMmTelManager} for the subscription id specified.
* *
@@ -251,8 +255,7 @@ public class ImsMmTelManager implements RegistrationManager {
throw new IllegalArgumentException("Invalid subscription ID"); throw new IllegalArgumentException("Invalid subscription ID");
} }
return new ImsMmTelManager(subId, new BinderCacheManager<>( return new ImsMmTelManager(subId, sTelephonyCache);
ImsMmTelManager::getITelephonyInterface));
} }
/** /**