Loading src/java/com/android/ims/ImsManager.java +42 −0 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ import android.telephony.ims.aidl.IImsMmTelFeature; import android.telephony.ims.aidl.IImsRegistration; import android.telephony.ims.aidl.IImsRegistrationCallback; import android.telephony.ims.aidl.IImsSmsListener; import android.telephony.ims.aidl.IRcsConfigCallback; import android.telephony.ims.aidl.ISipTransport; import android.telephony.ims.feature.CapabilityChangeRequest; import android.telephony.ims.feature.ImsFeature; Loading Loading @@ -2828,6 +2829,47 @@ public class ImsManager implements FeatureUpdates { provisionStatus); } /** * Adds a callback of RCS provisioning for a specified subscription. * @param callback A {@link android.telephony.ims.aidl.IRcsConfigCallback} * for RCS provisioning change. * @param subId The subscription that is associated with the callback. * @throws IllegalStateException when the {@link ImsService} connection is not available. * @throws IllegalArgumentException when the {@link IRcsConfigCallback} argument is null. */ public void addRcsProvisioningCallbackForSubscription(IRcsConfigCallback callback, int subId) { if (callback == null) { throw new IllegalArgumentException("provisioning callback can't be null"); } mMmTelConnectionRef.get().addRcsProvisioningCallbackForSubscription(callback, subId); log("Capability Callback registered for subscription."); } /** * Removes a previously registered {@link android.telephony.ims.aidl.IRcsConfigCallback}. * @throws IllegalStateException when the {@link ImsService} connection is not available. * @throws IllegalArgumentException when the {@link IRcsConfigCallback} argument is null. */ public void removeRcsProvisioningCallbackForSubscription( IRcsConfigCallback callback, int subId) { if (callback == null) { throw new IllegalArgumentException("provisioning callback can't be null"); } mMmTelConnectionRef.get().removeRcsProvisioningCallbackForSubscription(callback, subId); } /** * Removes all RCS provisioning callbacks * * <p>This method is called when default message application change or some other event * which need force to remove all RCS provisioning callbacks. */ public void clearRcsProvisioningCallbacks() { mMmTelConnectionRef.get().clearRcsProvisioningCallbacks(); } private boolean isDataEnabled() { return new TelephonyManager(mContext, getSubId()).isDataConnectionAllowed(); } Loading src/java/com/android/ims/MmTelFeatureConnection.java +63 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import android.telephony.ims.aidl.IImsMmTelFeature; import android.telephony.ims.aidl.IImsRegistration; import android.telephony.ims.aidl.IImsRegistrationCallback; import android.telephony.ims.aidl.IImsSmsListener; import android.telephony.ims.aidl.IRcsConfigCallback; import android.telephony.ims.aidl.ISipTransport; import android.telephony.ims.feature.CapabilityChangeRequest; import android.telephony.ims.feature.ImsFeature; Loading Loading @@ -197,6 +198,52 @@ public class MmTelFeatureConnection extends FeatureConnection { } } private class RcsProvisioningCallbackManager extends ImsCallbackAdapterManager<IRcsConfigCallback> { public RcsProvisioningCallbackManager (Context context, Object lock) { super(context, lock, mSlotId); } @Override public void registerCallback(IRcsConfigCallback localCallback) { IImsConfig binder = getConfig(); if (binder == null) { // Config interface is not currently available. Log.w(TAG + " [" + mSlotId + "]", "RcsProvisioningCallbackManager - couldn't register," + " binder is null."); throw new IllegalStateException("RcsConfig is not available!"); } try { binder.addRcsConfigCallback(localCallback); }catch (RemoteException e) { throw new IllegalStateException("ImsService is not available!"); } } @Override public void unregisterCallback(IRcsConfigCallback localCallback) { IImsConfig binder = getConfig(); if (binder != null) { try { binder.removeRcsConfigCallback(localCallback); } catch (RemoteException e) { Log.w(TAG + " [" + mSlotId + "]", "RcsProvisioningCallbackManager - couldn't" + " unregister, binder is dead."); } } else { Log.w(TAG + " [" + mSlotId + "]", "RcsProvisioningCallbackManager - couldn't" + " unregister, binder is null."); } try { localCallback.onRemoved(); } catch (RemoteException e) { Log.w(TAG + " [" + mSlotId + "]", "RcsProvisioningCallbackManager - couldn't" + " notify onRemoved, binder is dead."); } } } // Updated by IImsServiceFeatureCallback when FEATURE_EMERGENCY_MMTEL is sent. private boolean mSupportsEmergencyCalling = false; // MMTEL specific binder Interfaces Loading @@ -207,6 +254,7 @@ public class MmTelFeatureConnection extends FeatureConnection { private final ImsRegistrationCallbackAdapter mRegistrationCallbackManager; private final CapabilityCallbackManager mCapabilityCallbackManager; private final ProvisioningCallbackManager mProvisioningCallbackManager; private final RcsProvisioningCallbackManager mRcsProvisioningCallbackManager; public MmTelFeatureConnection(Context context, int slotId, IImsMmTelFeature f, IImsConfig c, IImsRegistration r, ISipTransport s) { Loading @@ -216,6 +264,7 @@ public class MmTelFeatureConnection extends FeatureConnection { mRegistrationCallbackManager = new ImsRegistrationCallbackAdapter(context, mLock); mCapabilityCallbackManager = new CapabilityCallbackManager(context, mLock); mProvisioningCallbackManager = new ProvisioningCallbackManager(context, mLock); mRcsProvisioningCallbackManager = new RcsProvisioningCallbackManager(context, mLock); } @Override Loading Loading @@ -464,6 +513,20 @@ public class MmTelFeatureConnection extends FeatureConnection { } } public void addRcsProvisioningCallbackForSubscription(IRcsConfigCallback callback, int subId) { mRcsProvisioningCallbackManager.addCallbackForSubscription(callback, subId); } public void removeRcsProvisioningCallbackForSubscription(IRcsConfigCallback callback, int subId) { mRcsProvisioningCallbackManager.removeCallbackForSubscription(callback , subId); } public void clearRcsProvisioningCallbacks() { mRcsProvisioningCallbackManager.close(); } @Override protected Integer retrieveFeatureState() { if (mBinder != null) { Loading Loading
src/java/com/android/ims/ImsManager.java +42 −0 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ import android.telephony.ims.aidl.IImsMmTelFeature; import android.telephony.ims.aidl.IImsRegistration; import android.telephony.ims.aidl.IImsRegistrationCallback; import android.telephony.ims.aidl.IImsSmsListener; import android.telephony.ims.aidl.IRcsConfigCallback; import android.telephony.ims.aidl.ISipTransport; import android.telephony.ims.feature.CapabilityChangeRequest; import android.telephony.ims.feature.ImsFeature; Loading Loading @@ -2828,6 +2829,47 @@ public class ImsManager implements FeatureUpdates { provisionStatus); } /** * Adds a callback of RCS provisioning for a specified subscription. * @param callback A {@link android.telephony.ims.aidl.IRcsConfigCallback} * for RCS provisioning change. * @param subId The subscription that is associated with the callback. * @throws IllegalStateException when the {@link ImsService} connection is not available. * @throws IllegalArgumentException when the {@link IRcsConfigCallback} argument is null. */ public void addRcsProvisioningCallbackForSubscription(IRcsConfigCallback callback, int subId) { if (callback == null) { throw new IllegalArgumentException("provisioning callback can't be null"); } mMmTelConnectionRef.get().addRcsProvisioningCallbackForSubscription(callback, subId); log("Capability Callback registered for subscription."); } /** * Removes a previously registered {@link android.telephony.ims.aidl.IRcsConfigCallback}. * @throws IllegalStateException when the {@link ImsService} connection is not available. * @throws IllegalArgumentException when the {@link IRcsConfigCallback} argument is null. */ public void removeRcsProvisioningCallbackForSubscription( IRcsConfigCallback callback, int subId) { if (callback == null) { throw new IllegalArgumentException("provisioning callback can't be null"); } mMmTelConnectionRef.get().removeRcsProvisioningCallbackForSubscription(callback, subId); } /** * Removes all RCS provisioning callbacks * * <p>This method is called when default message application change or some other event * which need force to remove all RCS provisioning callbacks. */ public void clearRcsProvisioningCallbacks() { mMmTelConnectionRef.get().clearRcsProvisioningCallbacks(); } private boolean isDataEnabled() { return new TelephonyManager(mContext, getSubId()).isDataConnectionAllowed(); } Loading
src/java/com/android/ims/MmTelFeatureConnection.java +63 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import android.telephony.ims.aidl.IImsMmTelFeature; import android.telephony.ims.aidl.IImsRegistration; import android.telephony.ims.aidl.IImsRegistrationCallback; import android.telephony.ims.aidl.IImsSmsListener; import android.telephony.ims.aidl.IRcsConfigCallback; import android.telephony.ims.aidl.ISipTransport; import android.telephony.ims.feature.CapabilityChangeRequest; import android.telephony.ims.feature.ImsFeature; Loading Loading @@ -197,6 +198,52 @@ public class MmTelFeatureConnection extends FeatureConnection { } } private class RcsProvisioningCallbackManager extends ImsCallbackAdapterManager<IRcsConfigCallback> { public RcsProvisioningCallbackManager (Context context, Object lock) { super(context, lock, mSlotId); } @Override public void registerCallback(IRcsConfigCallback localCallback) { IImsConfig binder = getConfig(); if (binder == null) { // Config interface is not currently available. Log.w(TAG + " [" + mSlotId + "]", "RcsProvisioningCallbackManager - couldn't register," + " binder is null."); throw new IllegalStateException("RcsConfig is not available!"); } try { binder.addRcsConfigCallback(localCallback); }catch (RemoteException e) { throw new IllegalStateException("ImsService is not available!"); } } @Override public void unregisterCallback(IRcsConfigCallback localCallback) { IImsConfig binder = getConfig(); if (binder != null) { try { binder.removeRcsConfigCallback(localCallback); } catch (RemoteException e) { Log.w(TAG + " [" + mSlotId + "]", "RcsProvisioningCallbackManager - couldn't" + " unregister, binder is dead."); } } else { Log.w(TAG + " [" + mSlotId + "]", "RcsProvisioningCallbackManager - couldn't" + " unregister, binder is null."); } try { localCallback.onRemoved(); } catch (RemoteException e) { Log.w(TAG + " [" + mSlotId + "]", "RcsProvisioningCallbackManager - couldn't" + " notify onRemoved, binder is dead."); } } } // Updated by IImsServiceFeatureCallback when FEATURE_EMERGENCY_MMTEL is sent. private boolean mSupportsEmergencyCalling = false; // MMTEL specific binder Interfaces Loading @@ -207,6 +254,7 @@ public class MmTelFeatureConnection extends FeatureConnection { private final ImsRegistrationCallbackAdapter mRegistrationCallbackManager; private final CapabilityCallbackManager mCapabilityCallbackManager; private final ProvisioningCallbackManager mProvisioningCallbackManager; private final RcsProvisioningCallbackManager mRcsProvisioningCallbackManager; public MmTelFeatureConnection(Context context, int slotId, IImsMmTelFeature f, IImsConfig c, IImsRegistration r, ISipTransport s) { Loading @@ -216,6 +264,7 @@ public class MmTelFeatureConnection extends FeatureConnection { mRegistrationCallbackManager = new ImsRegistrationCallbackAdapter(context, mLock); mCapabilityCallbackManager = new CapabilityCallbackManager(context, mLock); mProvisioningCallbackManager = new ProvisioningCallbackManager(context, mLock); mRcsProvisioningCallbackManager = new RcsProvisioningCallbackManager(context, mLock); } @Override Loading Loading @@ -464,6 +513,20 @@ public class MmTelFeatureConnection extends FeatureConnection { } } public void addRcsProvisioningCallbackForSubscription(IRcsConfigCallback callback, int subId) { mRcsProvisioningCallbackManager.addCallbackForSubscription(callback, subId); } public void removeRcsProvisioningCallbackForSubscription(IRcsConfigCallback callback, int subId) { mRcsProvisioningCallbackManager.removeCallbackForSubscription(callback , subId); } public void clearRcsProvisioningCallbacks() { mRcsProvisioningCallbackManager.close(); } @Override protected Integer retrieveFeatureState() { if (mBinder != null) { Loading