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

Commit cc90cf00 authored by Brad Ebinger's avatar Brad Ebinger Committed by Android (Google) Code Review
Browse files

Merge "Integrate IMS Registration API"

parents 3c8c9c1c 1fb61210
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -471,8 +471,6 @@ java_library {
        "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/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/IImsServiceControllerListener.aidl",
	"telephony/java/android/telephony/ims/internal/aidl/IImsSmsListener.aidl",
@@ -492,6 +490,8 @@ java_library {
        "telephony/java/com/android/ims/internal/IImsFeatureStatusCallback.aidl",
        "telephony/java/com/android/ims/internal/IImsMMTelFeature.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/IImsService.aidl",
        "telephony/java/com/android/ims/internal/IImsServiceController.aidl",
+20 −0
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ import android.util.Log;

import com.android.ims.internal.IImsMMTelFeature;
import com.android.ims.internal.IImsRcsFeature;
import com.android.ims.internal.IImsRegistration;
import com.android.ims.internal.IImsServiceFeatureCallback;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.telecom.ITelecomService;
@@ -4931,6 +4932,25 @@ public class TelephonyManager {
        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
     *
+19 −0
Original line number Diff line number Diff line
@@ -26,12 +26,14 @@ import android.telephony.CarrierConfigManager;
import android.telephony.ims.feature.ImsFeature;
import android.telephony.ims.feature.MMTelFeature;
import android.telephony.ims.feature.RcsFeature;
import android.telephony.ims.stub.ImsRegistrationImplBase;
import android.util.Log;
import android.util.SparseArray;

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

@@ -113,6 +115,12 @@ public class ImsService extends Service {
                throws RemoteException {
            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.addImsFeatureStatusCallback(c);
        addImsFeature(slotId, featureType, f);
        // TODO: Remove once new onFeatureReady AIDL is merged in.
        f.onFeatureReady();
    }

    private void addImsFeature(int slotId, int featureType, ImsFeature f) {
@@ -236,4 +246,13 @@ public class ImsService extends Service {
    public @Nullable RcsFeature onCreateRcsFeature(int slotId) {
        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 Diff line number Diff line
@@ -96,7 +96,7 @@ public abstract class ImsFeature {
            new WeakHashMap<IImsFeatureStatusCallback, Boolean>());
    private @ImsState int mState = STATE_NOT_AVAILABLE;
    private int mSlotId = SubscriptionManager.INVALID_SIM_SLOT_INDEX;
    private Context mContext;
    protected Context mContext;

    public void setContext(Context context) {
        mContext = context;
+2 −2
Original line number 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.IImsMmTelFeature;
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.IImsServiceControllerListener;
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.stub.ImsConfigImplBase;
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.SparseArray;

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

/**
Loading