Loading src/java/com/android/ims/ImsManager.java +17 −4 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import android.os.SystemProperties; import android.provider.Settings; import android.telecom.TelecomManager; import android.telephony.AccessNetworkConstants; import android.telephony.BinderCacheManager; import android.telephony.CarrierConfigManager; import android.telephony.SubscriptionManager; import android.telephony.TelephonyFrameworkInitializer; Loading Loading @@ -376,10 +377,10 @@ public class ImsManager implements FeatureUpdates { private Context mContext; private CarrierConfigManager mConfigManager; private int mPhoneId; private final Object mLock = new Object(); private AtomicReference<MmTelFeatureConnection> mMmTelConnectionRef = new AtomicReference<>(); // Used for debug purposes only currently private boolean mConfigUpdated = false; private BinderCacheManager<ITelephony> mBinderCache; private ImsConfigListener mImsConfigListener; public static final String TRUE = "true"; Loading Loading @@ -1646,6 +1647,7 @@ public class ImsManager implements FeatureUpdates { mConfigManager = (CarrierConfigManager) context.getSystemService( Context.CARRIER_CONFIG_SERVICE); mExecutor = new LazyExecutor(); mBinderCache = new BinderCacheManager<>(ImsManager::getITelephonyInterface); // Start off with an empty MmTelFeatureConnection, which will be replaced one an // ImsService is available (ImsManager expects a non-null FeatureConnection) associate(null, null, null); Loading @@ -1665,6 +1667,7 @@ public class ImsManager implements FeatureUpdates { Context.CARRIER_CONFIG_SERVICE); // Do not multithread tests mExecutor = Runnable::run; mBinderCache = new BinderCacheManager<>(ImsManager::getITelephonyInterface); // MmTelFeatureConnection should be replaced for tests with mMmTelFeatureConnectionFactory. associate(null, null, null); } Loading Loading @@ -2390,7 +2393,13 @@ public class ImsManager implements FeatureUpdates { @Override public void registerFeatureCallback(int slotId, IImsServiceFeatureCallback cb) { try { ITelephony telephony = getITelephony(); ITelephony telephony = mBinderCache.listenOnBinder(cb, () -> { try { cb.imsFeatureRemoved( FeatureConnector.UNAVAILABLE_REASON_SERVER_UNAVAILABLE); } catch (RemoteException ignore) {} // This is local. }); if (telephony != null) { telephony.registerMmTelFeatureCallback(slotId, cb); } else { Loading Loading @@ -2418,7 +2427,7 @@ public class ImsManager implements FeatureUpdates { @Override public void unregisterFeatureCallback(IImsServiceFeatureCallback cb) { try { ITelephony telephony = getITelephony(); ITelephony telephony = mBinderCache.removeRunnable(cb); if (telephony != null) { telephony.unregisterImsFeatureCallback(cb); } Loading @@ -2440,6 +2449,10 @@ public class ImsManager implements FeatureUpdates { } private ITelephony getITelephony() { return mBinderCache.getBinder(); } private static ITelephony getITelephonyInterface() { return ITelephony.Stub.asInterface( TelephonyFrameworkInitializer .getTelephonyServiceManager() Loading src/java/com/android/ims/RcsFeatureManager.java +19 −5 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.os.IBinder; import android.os.PersistableBundle; import android.os.RemoteException; import android.os.ServiceSpecificException; import android.telephony.BinderCacheManager; import android.telephony.CarrierConfigManager; import android.telephony.SubscriptionManager; import android.telephony.TelephonyFrameworkInitializer; Loading @@ -47,6 +48,7 @@ import android.util.Log; import com.android.ims.internal.IImsServiceFeatureCallback; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.telephony.ITelephony; import com.android.telephony.Rlog; import java.util.ArrayList; Loading Loading @@ -157,6 +159,8 @@ public class RcsFeatureManager implements FeatureUpdates { private final int mSlotId; private final Context mContext; private final Set<RcsFeatureCallbacks> mRcsFeatureCallbacks = new CopyOnWriteArraySet<>(); private final BinderCacheManager<IImsRcsController> mBinderCache = new BinderCacheManager<>(RcsFeatureManager::getIImsRcsControllerInterface); @VisibleForTesting public RcsFeatureConnection mRcsFeatureConnection; Loading Loading @@ -498,7 +502,13 @@ public class RcsFeatureManager implements FeatureUpdates { @Override public void registerFeatureCallback(int slotId, IImsServiceFeatureCallback cb) { IImsRcsController controller = getIImsRcsController(); IImsRcsController controller = mBinderCache.listenOnBinder(cb, () -> { try { cb.imsFeatureRemoved( FeatureConnector.UNAVAILABLE_REASON_SERVER_UNAVAILABLE); } catch (RemoteException ignore) {} // This is local. }); try { if (controller == null) { Log.e(TAG, "registerRcsFeatureListener: IImsRcsController is null"); Loading Loading @@ -528,7 +538,7 @@ public class RcsFeatureManager implements FeatureUpdates { @Override public void unregisterFeatureCallback(IImsServiceFeatureCallback cb) { try { IImsRcsController imsRcsController = getIImsRcsController(); IImsRcsController imsRcsController = mBinderCache.removeRunnable(cb); if (imsRcsController != null) { imsRcsController.unregisterImsFeatureCallback(cb); } Loading @@ -540,6 +550,10 @@ public class RcsFeatureManager implements FeatureUpdates { } private IImsRcsController getIImsRcsController() { return mBinderCache.getBinder(); } private static IImsRcsController getIImsRcsControllerInterface() { IBinder binder = TelephonyFrameworkInitializer .getTelephonyServiceManager() .getTelephonyImsServiceRegisterer() Loading Loading
src/java/com/android/ims/ImsManager.java +17 −4 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import android.os.SystemProperties; import android.provider.Settings; import android.telecom.TelecomManager; import android.telephony.AccessNetworkConstants; import android.telephony.BinderCacheManager; import android.telephony.CarrierConfigManager; import android.telephony.SubscriptionManager; import android.telephony.TelephonyFrameworkInitializer; Loading Loading @@ -376,10 +377,10 @@ public class ImsManager implements FeatureUpdates { private Context mContext; private CarrierConfigManager mConfigManager; private int mPhoneId; private final Object mLock = new Object(); private AtomicReference<MmTelFeatureConnection> mMmTelConnectionRef = new AtomicReference<>(); // Used for debug purposes only currently private boolean mConfigUpdated = false; private BinderCacheManager<ITelephony> mBinderCache; private ImsConfigListener mImsConfigListener; public static final String TRUE = "true"; Loading Loading @@ -1646,6 +1647,7 @@ public class ImsManager implements FeatureUpdates { mConfigManager = (CarrierConfigManager) context.getSystemService( Context.CARRIER_CONFIG_SERVICE); mExecutor = new LazyExecutor(); mBinderCache = new BinderCacheManager<>(ImsManager::getITelephonyInterface); // Start off with an empty MmTelFeatureConnection, which will be replaced one an // ImsService is available (ImsManager expects a non-null FeatureConnection) associate(null, null, null); Loading @@ -1665,6 +1667,7 @@ public class ImsManager implements FeatureUpdates { Context.CARRIER_CONFIG_SERVICE); // Do not multithread tests mExecutor = Runnable::run; mBinderCache = new BinderCacheManager<>(ImsManager::getITelephonyInterface); // MmTelFeatureConnection should be replaced for tests with mMmTelFeatureConnectionFactory. associate(null, null, null); } Loading Loading @@ -2390,7 +2393,13 @@ public class ImsManager implements FeatureUpdates { @Override public void registerFeatureCallback(int slotId, IImsServiceFeatureCallback cb) { try { ITelephony telephony = getITelephony(); ITelephony telephony = mBinderCache.listenOnBinder(cb, () -> { try { cb.imsFeatureRemoved( FeatureConnector.UNAVAILABLE_REASON_SERVER_UNAVAILABLE); } catch (RemoteException ignore) {} // This is local. }); if (telephony != null) { telephony.registerMmTelFeatureCallback(slotId, cb); } else { Loading Loading @@ -2418,7 +2427,7 @@ public class ImsManager implements FeatureUpdates { @Override public void unregisterFeatureCallback(IImsServiceFeatureCallback cb) { try { ITelephony telephony = getITelephony(); ITelephony telephony = mBinderCache.removeRunnable(cb); if (telephony != null) { telephony.unregisterImsFeatureCallback(cb); } Loading @@ -2440,6 +2449,10 @@ public class ImsManager implements FeatureUpdates { } private ITelephony getITelephony() { return mBinderCache.getBinder(); } private static ITelephony getITelephonyInterface() { return ITelephony.Stub.asInterface( TelephonyFrameworkInitializer .getTelephonyServiceManager() Loading
src/java/com/android/ims/RcsFeatureManager.java +19 −5 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.os.IBinder; import android.os.PersistableBundle; import android.os.RemoteException; import android.os.ServiceSpecificException; import android.telephony.BinderCacheManager; import android.telephony.CarrierConfigManager; import android.telephony.SubscriptionManager; import android.telephony.TelephonyFrameworkInitializer; Loading @@ -47,6 +48,7 @@ import android.util.Log; import com.android.ims.internal.IImsServiceFeatureCallback; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.telephony.ITelephony; import com.android.telephony.Rlog; import java.util.ArrayList; Loading Loading @@ -157,6 +159,8 @@ public class RcsFeatureManager implements FeatureUpdates { private final int mSlotId; private final Context mContext; private final Set<RcsFeatureCallbacks> mRcsFeatureCallbacks = new CopyOnWriteArraySet<>(); private final BinderCacheManager<IImsRcsController> mBinderCache = new BinderCacheManager<>(RcsFeatureManager::getIImsRcsControllerInterface); @VisibleForTesting public RcsFeatureConnection mRcsFeatureConnection; Loading Loading @@ -498,7 +502,13 @@ public class RcsFeatureManager implements FeatureUpdates { @Override public void registerFeatureCallback(int slotId, IImsServiceFeatureCallback cb) { IImsRcsController controller = getIImsRcsController(); IImsRcsController controller = mBinderCache.listenOnBinder(cb, () -> { try { cb.imsFeatureRemoved( FeatureConnector.UNAVAILABLE_REASON_SERVER_UNAVAILABLE); } catch (RemoteException ignore) {} // This is local. }); try { if (controller == null) { Log.e(TAG, "registerRcsFeatureListener: IImsRcsController is null"); Loading Loading @@ -528,7 +538,7 @@ public class RcsFeatureManager implements FeatureUpdates { @Override public void unregisterFeatureCallback(IImsServiceFeatureCallback cb) { try { IImsRcsController imsRcsController = getIImsRcsController(); IImsRcsController imsRcsController = mBinderCache.removeRunnable(cb); if (imsRcsController != null) { imsRcsController.unregisterImsFeatureCallback(cb); } Loading @@ -540,6 +550,10 @@ public class RcsFeatureManager implements FeatureUpdates { } private IImsRcsController getIImsRcsController() { return mBinderCache.getBinder(); } private static IImsRcsController getIImsRcsControllerInterface() { IBinder binder = TelephonyFrameworkInitializer .getTelephonyServiceManager() .getTelephonyImsServiceRegisterer() Loading