Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f0bc082a authored by Brad Ebinger's avatar Brad Ebinger
Browse files

Integrate IMS Registration API

Integrates the new IMS Registration API into the framework
and add two APIs for feature parity.

1) Moves ImsRegistrationImplBase to the android.telephony.ims
namespace
2) Expose ImsRegistration AIDL in TelephonyManager as hidden
API.
3) Adds onVoicemailCountUpdate and
onSubscriberAssociatedUriChanged APIs for feature parity.

Bug: 63987047
Test: Telephony unit tests, manual IMS tests
Merged-In: I51a8ae5cf58b81708c21adc1b26a9eb59f6280fd
Change-Id: I51a8ae5cf58b81708c21adc1b26a9eb59f6280fd
parent 9c1279d2
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -461,8 +461,6 @@ java_library {
        "telephony/java/android/telephony/ims/internal/aidl/IImsMmTelFeature.aidl",
        "telephony/java/android/telephony/ims/internal/aidl/IImsMmTelFeature.aidl",
        "telephony/java/android/telephony/ims/internal/aidl/IImsMmTelListener.aidl",
        "telephony/java/android/telephony/ims/internal/aidl/IImsMmTelListener.aidl",
        "telephony/java/android/telephony/ims/internal/aidl/IImsRcsFeature.aidl",
        "telephony/java/android/telephony/ims/internal/aidl/IImsRcsFeature.aidl",
        "telephony/java/android/telephony/ims/internal/aidl/IImsRegistration.aidl",
        "telephony/java/android/telephony/ims/internal/aidl/IImsRegistrationCallback.aidl",
        "telephony/java/android/telephony/ims/internal/aidl/IImsServiceController.aidl",
        "telephony/java/android/telephony/ims/internal/aidl/IImsServiceController.aidl",
        "telephony/java/android/telephony/ims/internal/aidl/IImsServiceControllerListener.aidl",
        "telephony/java/android/telephony/ims/internal/aidl/IImsServiceControllerListener.aidl",
	"telephony/java/android/telephony/ims/internal/aidl/IImsSmsListener.aidl",
	"telephony/java/android/telephony/ims/internal/aidl/IImsSmsListener.aidl",
@@ -482,6 +480,8 @@ java_library {
        "telephony/java/com/android/ims/internal/IImsFeatureStatusCallback.aidl",
        "telephony/java/com/android/ims/internal/IImsFeatureStatusCallback.aidl",
        "telephony/java/com/android/ims/internal/IImsMMTelFeature.aidl",
        "telephony/java/com/android/ims/internal/IImsMMTelFeature.aidl",
        "telephony/java/com/android/ims/internal/IImsMultiEndpoint.aidl",
        "telephony/java/com/android/ims/internal/IImsMultiEndpoint.aidl",
        "telephony/java/com/android/ims/internal/IImsRegistration.aidl",
        "telephony/java/com/android/ims/internal/IImsRegistrationCallback.aidl",
        "telephony/java/com/android/ims/internal/IImsRcsFeature.aidl",
        "telephony/java/com/android/ims/internal/IImsRcsFeature.aidl",
        "telephony/java/com/android/ims/internal/IImsService.aidl",
        "telephony/java/com/android/ims/internal/IImsService.aidl",
        "telephony/java/com/android/ims/internal/IImsServiceController.aidl",
        "telephony/java/com/android/ims/internal/IImsServiceController.aidl",
+20 −0
Original line number Original line Diff line number Diff line
@@ -54,6 +54,7 @@ import android.util.Log;


import com.android.ims.internal.IImsMMTelFeature;
import com.android.ims.internal.IImsMMTelFeature;
import com.android.ims.internal.IImsRcsFeature;
import com.android.ims.internal.IImsRcsFeature;
import com.android.ims.internal.IImsRegistration;
import com.android.ims.internal.IImsServiceFeatureCallback;
import com.android.ims.internal.IImsServiceFeatureCallback;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.telecom.ITelecomService;
import com.android.internal.telecom.ITelecomService;
@@ -4719,6 +4720,25 @@ public class TelephonyManager {
        return null;
        return null;
    }
    }


    /**
     * @return the {@IImsRegistration} interface that corresponds with the slot index and feature.
     * @param slotIndex The SIM slot corresponding to the ImsService ImsRegistration is active for.
     * @param feature An integer indicating the feature that we wish to get the ImsRegistration for.
     * Corresponds to features defined in ImsFeature.
     * @hide
     */
    public @Nullable IImsRegistration getImsRegistration(int slotIndex, int feature) {
        try {
            ITelephony telephony = getITelephony();
            if (telephony != null) {
                return telephony.getImsRegistration(slotIndex, feature);
            }
        } catch (RemoteException e) {
            Rlog.e(TAG, "getImsRegistration, RemoteException: " + e.getMessage());
        }
        return null;
    }

    /**
    /**
     * Set IMS registration state
     * Set IMS registration state
     *
     *
+19 −0
Original line number Original line Diff line number Diff line
@@ -26,12 +26,14 @@ import android.telephony.CarrierConfigManager;
import android.telephony.ims.feature.ImsFeature;
import android.telephony.ims.feature.ImsFeature;
import android.telephony.ims.feature.MMTelFeature;
import android.telephony.ims.feature.MMTelFeature;
import android.telephony.ims.feature.RcsFeature;
import android.telephony.ims.feature.RcsFeature;
import android.telephony.ims.stub.ImsRegistrationImplBase;
import android.util.Log;
import android.util.Log;
import android.util.SparseArray;
import android.util.SparseArray;


import com.android.ims.internal.IImsFeatureStatusCallback;
import com.android.ims.internal.IImsFeatureStatusCallback;
import com.android.ims.internal.IImsMMTelFeature;
import com.android.ims.internal.IImsMMTelFeature;
import com.android.ims.internal.IImsRcsFeature;
import com.android.ims.internal.IImsRcsFeature;
import com.android.ims.internal.IImsRegistration;
import com.android.ims.internal.IImsServiceController;
import com.android.ims.internal.IImsServiceController;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.annotations.VisibleForTesting;


@@ -113,6 +115,12 @@ public class ImsService extends Service {
                throws RemoteException {
                throws RemoteException {
            ImsService.this.removeImsFeature(slotId, featureType, c);
            ImsService.this.removeImsFeature(slotId, featureType, c);
        }
        }

        @Override
        public IImsRegistration getRegistration(int slotId) throws RemoteException {
            ImsRegistrationImplBase r = ImsService.this.getRegistration(slotId);
            return r != null ? r.getBinder() : null;
        }
    };
    };


    /**
    /**
@@ -174,6 +182,8 @@ public class ImsService extends Service {
        f.setSlotId(slotId);
        f.setSlotId(slotId);
        f.addImsFeatureStatusCallback(c);
        f.addImsFeatureStatusCallback(c);
        addImsFeature(slotId, featureType, f);
        addImsFeature(slotId, featureType, f);
        // TODO: Remove once new onFeatureReady AIDL is merged in.
        f.onFeatureReady();
    }
    }


    private void addImsFeature(int slotId, int featureType, ImsFeature f) {
    private void addImsFeature(int slotId, int featureType, ImsFeature f) {
@@ -236,4 +246,13 @@ public class ImsService extends Service {
    public @Nullable RcsFeature onCreateRcsFeature(int slotId) {
    public @Nullable RcsFeature onCreateRcsFeature(int slotId) {
        return null;
        return null;
    }
    }

    /**
     * @param slotId The slot that is associated with the IMS Registration.
     * @return the ImsRegistration implementation associated with the slot.
     * @hide
     */
    public ImsRegistrationImplBase getRegistration(int slotId) {
        return new ImsRegistrationImplBase();
    }
}
}
+1 −1
Original line number Original line Diff line number Diff line
@@ -96,7 +96,7 @@ public abstract class ImsFeature {
            new WeakHashMap<IImsFeatureStatusCallback, Boolean>());
            new WeakHashMap<IImsFeatureStatusCallback, Boolean>());
    private @ImsState int mState = STATE_NOT_AVAILABLE;
    private @ImsState int mState = STATE_NOT_AVAILABLE;
    private int mSlotId = SubscriptionManager.INVALID_SIM_SLOT_INDEX;
    private int mSlotId = SubscriptionManager.INVALID_SIM_SLOT_INDEX;
    private Context mContext;
    protected Context mContext;


    public void setContext(Context context) {
    public void setContext(Context context) {
        mContext = context;
        mContext = context;
+2 −2
Original line number Original line Diff line number Diff line
@@ -24,7 +24,6 @@ import android.telephony.CarrierConfigManager;
import android.telephony.ims.internal.aidl.IImsConfig;
import android.telephony.ims.internal.aidl.IImsConfig;
import android.telephony.ims.internal.aidl.IImsMmTelFeature;
import android.telephony.ims.internal.aidl.IImsMmTelFeature;
import android.telephony.ims.internal.aidl.IImsRcsFeature;
import android.telephony.ims.internal.aidl.IImsRcsFeature;
import android.telephony.ims.internal.aidl.IImsRegistration;
import android.telephony.ims.internal.aidl.IImsServiceController;
import android.telephony.ims.internal.aidl.IImsServiceController;
import android.telephony.ims.internal.aidl.IImsServiceControllerListener;
import android.telephony.ims.internal.aidl.IImsServiceControllerListener;
import android.telephony.ims.internal.feature.ImsFeature;
import android.telephony.ims.internal.feature.ImsFeature;
@@ -32,11 +31,12 @@ import android.telephony.ims.internal.feature.MmTelFeature;
import android.telephony.ims.internal.feature.RcsFeature;
import android.telephony.ims.internal.feature.RcsFeature;
import android.telephony.ims.internal.stub.ImsConfigImplBase;
import android.telephony.ims.internal.stub.ImsConfigImplBase;
import android.telephony.ims.internal.stub.ImsFeatureConfiguration;
import android.telephony.ims.internal.stub.ImsFeatureConfiguration;
import android.telephony.ims.internal.stub.ImsRegistrationImplBase;
import android.telephony.ims.stub.ImsRegistrationImplBase;
import android.util.Log;
import android.util.Log;
import android.util.SparseArray;
import android.util.SparseArray;


import com.android.ims.internal.IImsFeatureStatusCallback;
import com.android.ims.internal.IImsFeatureStatusCallback;
import com.android.ims.internal.IImsRegistration;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.annotations.VisibleForTesting;


/**
/**
Loading