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

Commit a993f6d7 authored by Brad Ebinger's avatar Brad Ebinger Committed by Gerrit Code Review
Browse files

Merge "Adds new Public ImsManager API"

parents e0f6d84b c5992534
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -59,6 +59,7 @@ import android.telephony.ims.aidl.IImsConfig;
import android.telephony.ims.aidl.IImsMmTelFeature;
import android.telephony.ims.aidl.IImsRcsFeature;
import android.telephony.ims.aidl.IImsRegistration;
import android.telephony.ims.feature.MmTelFeature;
import android.telephony.ims.stub.ImsRegistrationImplBase;
import android.text.TextUtils;
import android.util.Log;
@@ -7388,7 +7389,9 @@ public class TelephonyManager {
    @UnsupportedAppUsage
    public boolean isVolteAvailable() {
        try {
            return getITelephony().isVolteAvailable(getSubId());
            return getITelephony().isAvailable(getSubId(),
                    MmTelFeature.MmTelCapabilities.CAPABILITY_TYPE_VOICE,
                    ImsRegistrationImplBase.REGISTRATION_TECH_LTE, getOpPackageName());
        } catch (RemoteException | NullPointerException ex) {
            return false;
        }
+760 −0

File added.

Preview size limit exceeded, changes collapsed.

+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ import android.telephony.ims.stub.ImsFeatureConfiguration;
import android.telephony.ims.ImsReasonInfo;

/**
 * See ImsRegistrationImplBase.Callback for more information.
 * See {@link ImsManager#RegistrationCallback} for more information.
 *
 * {@hide}
 */
+0 −53
Original line number Diff line number Diff line
@@ -167,59 +167,6 @@ public abstract class ImsFeature {
     */
    public static final int CAPABILITY_SUCCESS = 0;


    /**
     * The framework implements this callback in order to register for Feature Capability status
     * updates, via {@link #onCapabilitiesStatusChanged(Capabilities)}, query Capability
     * configurations, via {@link #onQueryCapabilityConfiguration}, as well as to receive error
     * callbacks when the ImsService can not change the capability as requested, via
     * {@link #onChangeCapabilityConfigurationError}.
     *
     * @hide
     */
    public static class CapabilityCallback extends IImsCapabilityCallback.Stub {

        @Override
        public final void onCapabilitiesStatusChanged(int config) throws RemoteException {
            onCapabilitiesStatusChanged(new Capabilities(config));
        }

        /**
         * Returns the result of a query for the capability configuration of a requested capability.
         *
         * @param capability The capability that was requested.
         * @param radioTech The IMS radio technology associated with the capability.
         * @param isEnabled true if the capability is enabled, false otherwise.
         */
        @Override
        public void onQueryCapabilityConfiguration(int capability, int radioTech,
                boolean isEnabled) {

        }

        /**
         * Called when a change to the capability configuration has returned an error.
         *
         * @param capability The capability that was requested to be changed.
         * @param radioTech The IMS radio technology associated with the capability.
         * @param reason error associated with the failure to change configuration.
         */
        @Override
        public void onChangeCapabilityConfigurationError(int capability, int radioTech,
                @ImsCapabilityError int reason) {
        }

        /**
         * The status of the feature's capabilities has changed to either available or unavailable.
         * If unavailable, the feature is not able to support the unavailable capability at this
         * time.
         *
         * @param config The new availability of the capabilities.
         */
        public void onCapabilitiesStatusChanged(Capabilities config) {
        }
    }

    /**
     * Used by the ImsFeature to call back to the CapabilityCallback that the framework has
     * provided.
+0 −58
Original line number Diff line number Diff line
@@ -76,64 +76,6 @@ public class ImsRegistrationImplBase {
    private static final int REGISTRATION_STATE_REGISTERING = 1;
    private static final int REGISTRATION_STATE_REGISTERED = 2;

    /**
     * Callback class for receiving Registration callback events.
     * @hide
     */
    public static class Callback extends IImsRegistrationCallback.Stub {
        /**
         * Notifies the framework when the IMS Provider is connected to the IMS network.
         *
         * @param imsRadioTech the radio access technology. Valid values are defined in
         * {@link ImsRegistrationTech}.
         */
        @Override
        public void onRegistered(@ImsRegistrationTech int imsRadioTech) {
        }

        /**
         * Notifies the framework when the IMS Provider is trying to connect the IMS network.
         *
         * @param imsRadioTech the radio access technology. Valid values are defined in
         * {@link ImsRegistrationTech}.
         */
        @Override
        public void onRegistering(@ImsRegistrationTech int imsRadioTech) {
        }

        /**
         * Notifies the framework when the IMS Provider is disconnected from the IMS network.
         *
         * @param info the {@link ImsReasonInfo} associated with why registration was disconnected.
         */
        @Override
        public void onDeregistered(ImsReasonInfo info) {
        }

        /**
         * A failure has occurred when trying to handover registration to another technology type,
         * defined in {@link ImsRegistrationTech}
         *
         * @param imsRadioTech The {@link ImsRegistrationTech} type that has failed
         * @param info A {@link ImsReasonInfo} that identifies the reason for failure.
         */
        @Override
        public void onTechnologyChangeFailed(@ImsRegistrationTech int imsRadioTech,
                ImsReasonInfo info) {
        }

        /**
         * Returns a list of subscriber {@link Uri}s associated with this IMS subscription when
         * it changes.
         * @param uris new array of subscriber {@link Uri}s that are associated with this IMS
         *         subscription.
         */
        @Override
        public void onSubscriberAssociatedUriChanged(Uri[] uris) {

        }
    }

    private final IImsRegistration mBinder = new IImsRegistration.Stub() {

        @Override
Loading