[Telephony] Handling to cache the instance of BinderCacheManager when

createForSubscriptionId is called

Bug: b/237248121
Test: (TMUS) Calling Dial, Receive, Messaging Send, receive, airplane on/off
Change-Id: I4aeeb621246fe49ade21d36d3d0aa94fe4f69ea3
This commit is contained in:
donaldahn
2022-07-21 03:33:36 +00:00
committed by Sungcheol Ahn
parent c326217c51
commit 81513212f0

View File

@@ -223,6 +223,10 @@ public class ImsMmTelManager implements RegistrationManager {
private final int mSubId;
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.
*
@@ -251,8 +255,7 @@ public class ImsMmTelManager implements RegistrationManager {
throw new IllegalArgumentException("Invalid subscription ID");
}
return new ImsMmTelManager(subId, new BinderCacheManager<>(
ImsMmTelManager::getITelephonyInterface));
return new ImsMmTelManager(subId, sTelephonyCache);
}
/**