aboutsummaryrefslogtreecommitdiff
path: root/src/java/com/android/ims/RcsFeatureConnection.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/com/android/ims/RcsFeatureConnection.java')
-rw-r--r--src/java/com/android/ims/RcsFeatureConnection.java106
1 files changed, 7 insertions, 99 deletions
diff --git a/src/java/com/android/ims/RcsFeatureConnection.java b/src/java/com/android/ims/RcsFeatureConnection.java
index 62685436..b13b4027 100644
--- a/src/java/com/android/ims/RcsFeatureConnection.java
+++ b/src/java/com/android/ims/RcsFeatureConnection.java
@@ -111,45 +111,15 @@ public class RcsFeatureConnection extends FeatureConnection {
}
}
- public static @NonNull RcsFeatureConnection create(Context context , int slotId,
- IFeatureUpdate callback) {
-
- RcsFeatureConnection serviceProxy = new RcsFeatureConnection(context, slotId, callback);
-
- if (!ImsManager.isImsSupportedOnDevice(context)) {
- // Return empty service proxy in the case that IMS is not supported.
- sImsSupportedOnDevice = false;
- Rlog.w(TAG, "create: IMS is not supported");
- return serviceProxy;
- }
-
- TelephonyManager tm =
- (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
- if (tm == null) {
- Rlog.w(TAG, "create: TelephonyManager is null");
- return serviceProxy;
- }
-
- IImsRcsFeature binder = tm.getImsRcsFeatureAndListen(slotId, serviceProxy.getListener());
- if (binder != null) {
- Rlog.d(TAG, "create: set binder");
- serviceProxy.setBinder(binder.asBinder());
- // Trigger the cache to be updated for feature status.
- serviceProxy.getFeatureState();
- } else {
- Rlog.i(TAG, "create: binder is null! Slot Id: " + slotId);
- }
- return serviceProxy;
- }
-
@VisibleForTesting
public AvailabilityCallbackManager mAvailabilityCallbackManager;
@VisibleForTesting
public RegistrationCallbackManager mRegistrationCallbackManager;
- private RcsFeatureConnection(Context context, int slotId, IFeatureUpdate callback) {
- super(context, slotId);
- setStatusCallback(callback);
+ public RcsFeatureConnection(Context context, int slotId, IImsRcsFeature feature, IImsConfig c,
+ IImsRegistration r) {
+ super(context, slotId, c, r);
+ setBinder(feature.asBinder());
mAvailabilityCallbackManager = new AvailabilityCallbackManager(mContext);
mRegistrationCallbackManager = new RegistrationCallbackManager(mContext);
}
@@ -162,68 +132,12 @@ public class RcsFeatureConnection extends FeatureConnection {
@Override
protected void onRemovedOrDied() {
- removeImsFeatureCallback();
super.onRemovedOrDied();
synchronized (mLock) {
close();
}
}
- private void removeImsFeatureCallback() {
- TelephonyManager tm = getTelephonyManager();
- if (tm != null) {
- tm.unregisterImsFeatureCallback(mSlotId, ImsFeature.FEATURE_RCS, getListener());
- }
- }
-
- @Override
- @VisibleForTesting
- public void handleImsFeatureCreatedCallback(int slotId, int feature) {
- logi("IMS feature created: slotId= " + slotId + ", feature=" + feature);
- if (!isUpdateForThisFeatureAndSlot(slotId, feature)) {
- return;
- }
- synchronized(mLock) {
- if (!mIsAvailable) {
- logi("RCS enabled on slotId: " + slotId);
- mIsAvailable = true;
- }
- }
- }
-
- @Override
- @VisibleForTesting
- public void handleImsFeatureRemovedCallback(int slotId, int feature) {
- logi("IMS feature removed: slotId= " + slotId + ", feature=" + feature);
- if (!isUpdateForThisFeatureAndSlot(slotId, feature)) {
- return;
- }
- synchronized(mLock) {
- logi("Rcs UCE removed on slotId: " + slotId);
- onRemovedOrDied();
- }
- }
-
- @Override
- @VisibleForTesting
- public void handleImsStatusChangedCallback(int slotId, int feature, int status) {
- logi("IMS status changed: slotId=" + slotId + ", feature=" + feature + ", status="
- + status);
- if (!isUpdateForThisFeatureAndSlot(slotId, feature)) {
- return;
- }
- synchronized(mLock) {
- mFeatureStateCached = status;
- }
- }
-
- private boolean isUpdateForThisFeatureAndSlot(int slotId, int feature) {
- if (mSlotId == slotId && feature == ImsFeature.FEATURE_RCS) {
- return true;
- }
- return false;
- }
-
public void setRcsFeatureListener(IRcsFeatureListener listener) throws RemoteException {
synchronized (mLock) {
checkServiceIsReady();
@@ -331,15 +245,9 @@ public class RcsFeatureConnection extends FeatureConnection {
}
@Override
- protected IImsRegistration getRegistrationBinder() {
- TelephonyManager tm = getTelephonyManager();
- return tm != null ? tm.getImsRegistration(mSlotId, ImsFeature.FEATURE_RCS) : null;
- }
-
- @Override
- protected IImsConfig getConfigBinder() {
- TelephonyManager tm = getTelephonyManager();
- return tm != null ? tm.getImsConfig(mSlotId, ImsFeature.FEATURE_RCS) : null;
+ public void onFeatureCapabilitiesUpdated(long capabilities)
+ {
+ // doesn't do anything for RCS yet.
}
@VisibleForTesting