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

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

Merge "Add new API for call line identification query responses"

parents c7f1b38d a3e3c595
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -9240,14 +9240,17 @@ package android.telephony.ims {
  }
  public class ImsUtListener {
    method public void onLineIdentificationSupplementaryServiceResponse(int, @NonNull android.telephony.ims.ImsSsInfo);
    method public void onSupplementaryServiceIndication(android.telephony.ims.ImsSsData);
    method public void onUtConfigurationCallBarringQueried(int, android.telephony.ims.ImsSsInfo[]);
    method public void onUtConfigurationCallForwardQueried(int, android.telephony.ims.ImsCallForwardInfo[]);
    method public void onUtConfigurationCallWaitingQueried(int, android.telephony.ims.ImsSsInfo[]);
    method public void onUtConfigurationQueried(int, android.os.Bundle);
    method @Deprecated public void onUtConfigurationQueried(int, android.os.Bundle);
    method public void onUtConfigurationQueryFailed(int, android.telephony.ims.ImsReasonInfo);
    method public void onUtConfigurationUpdateFailed(int, android.telephony.ims.ImsReasonInfo);
    method public void onUtConfigurationUpdated(int);
    field @Deprecated public static final String BUNDLE_KEY_CLIR = "queryClir";
    field @Deprecated public static final String BUNDLE_KEY_SSINFO = "imsSsInfo";
  }
  public abstract class ImsVideoCallProvider {
+27 −0
Original line number Diff line number Diff line
@@ -336,4 +336,31 @@ public final class ImsSsInfo implements Parcelable {
    public @ClirInterrogationStatus int getClirInterrogationStatus() {
        return mClirInterrogationStatus;
    }

    /**
     * Parts of telephony still use the old {m,n} 3GPP definition, so convert to that format.
     * @hide
     */
    public int[] getCompatArray(@ImsSsData.ServiceType int type) {
        int[] result = new int[2];
        // Convert ImsSsInfo into a form that telephony can read (as per 3GPP 27.007)
        // CLIR (section 7.7)
        if (type == ImsSsData.SS_CLIR) {
            // Assume there will only be one ImsSsInfo.
            // contains {"n","m"} parameters
            result[0] = getClirOutgoingState();
            result[1] = getClirInterrogationStatus();
            return result;
        }
        // COLR 7.31
        if (type == ImsSsData.SS_COLR) {
            result[0] = getProvisionStatus();
        }
        // Facility Lock CLCK 7.4 (for call barring), CLIP 7.6, COLP 7.8, as well as any
        // other result, just return the status for the "n" parameter and provisioning status for
        // "m" as the default.
        result[0] = getStatus();
        result[1] = getProvisionStatus();
        return result;
    }
}
+75 −4
Original line number Diff line number Diff line
@@ -16,22 +16,53 @@

package android.telephony.ims;

import android.annotation.NonNull;
import android.annotation.SystemApi;
import android.os.Bundle;
import android.os.RemoteException;
import android.telephony.ims.stub.ImsUtImplBase;
import android.util.Log;

import com.android.ims.internal.IImsUtListener;

/**
 * Base implementation of the IMS UT listener interface, which implements stubs.
 * Override these methods to implement functionality.
 * Listener interface used to receive network responses back from UT supplementary service queries
 * made by the framework.
 * @hide
 */
// DO NOT remove or change the existing APIs, only add new ones to this Base implementation or you
// will break other implementations of ImsUt maintained by other ImsServices.
@SystemApi
public class ImsUtListener {

    /**
     * The {@link Bundle} key for a Calling Line Identification Restriction (CLIR) response. The
     * value will be an int[] with two values:
     * int[0] contains the 'n' parameter from TS 27.007 7.7, which is the
     * outgoing CLIR state. See {@link ImsSsInfo#CLIR_OUTGOING_DEFAULT},
     * {@link ImsSsInfo#CLIR_OUTGOING_INVOCATION}, and {@link ImsSsInfo#CLIR_OUTGOING_SUPPRESSION};
     * int[1] contains the 'm' parameter from TS 27.007 7.7, which is the CLIR interrogation status.
     * See {@link ImsSsInfo#CLIR_STATUS_NOT_PROVISIONED},
     * {@link ImsSsInfo#CLIR_STATUS_PROVISIONED_PERMANENT}, {@link ImsSsInfo#CLIR_STATUS_UNKNOWN},
     * {@link ImsSsInfo#CLIR_STATUS_TEMPORARILY_RESTRICTED}, and
     * {@link ImsSsInfo#CLIR_STATUS_TEMPORARILY_ALLOWED}.
     * @deprecated Use {@link #onLineIdentificationSupplementaryServiceResponse(int, ImsSsInfo)}
     * instead.
     */
    @Deprecated
    public static final String BUNDLE_KEY_CLIR = "queryClir";

    /**
     * The {@link Bundle} key for a Calling Line Identification Presentation (CLIP), Connected Line
     * Identification Presentation (COLP), or Connected Line Identification Restriction (COLR)
     * response. The value will be an instance of {@link ImsSsInfo}, which contains the response to
     * the query.
     * @deprecated Use {@link #onLineIdentificationSupplementaryServiceResponse(int, ImsSsInfo)}
     * instead.
     */
    @Deprecated
    public static final String BUNDLE_KEY_SSINFO = "imsSsInfo";

    private IImsUtListener mServiceInterface;
    private static final String LOG_TAG = "ImsUtListener";

@@ -51,14 +82,54 @@ public class ImsUtListener {
        }
    }

    public void onUtConfigurationQueried(int id, Bundle ssInfo) {
    /**
     * Notify the framework of a UT configuration response to a {@link ImsUtImplBase#queryClir()},
     * {@link ImsUtImplBase#queryClip()}, {@link ImsUtImplBase#queryColp()}, or
     * {@link ImsUtImplBase#queryColr()} query for the transaction ID specified. If the query fails,
     * {@link #onUtConfigurationQueryFailed(int, ImsReasonInfo)} should be called.
     * @param id The ID associated with this UT configuration transaction from the framework.
     * @param configuration A {@link Bundle} containing the result of querying the UT configuration.
     *                      Must contain {@link #BUNDLE_KEY_CLIR} if it is a response to
     *                      {@link ImsUtImplBase#queryClir()} or
     *                      {@link #BUNDLE_KEY_SSINFO} if it is a response to
     *                      {@link ImsUtImplBase#queryClip()}, {@link ImsUtImplBase#queryColp()}, or
     *                      {@link ImsUtImplBase#queryColr()}.
     * @deprecated Use {@link #onLineIdentificationSupplementaryServiceResponse(int, ImsSsInfo)}
     * instead.
     */
    @Deprecated
    public void onUtConfigurationQueried(int id, Bundle configuration) {
        try {
            mServiceInterface.utConfigurationQueried(null, id, ssInfo);
            mServiceInterface.utConfigurationQueried(null, id, configuration);
        } catch (RemoteException e) {
            Log.w(LOG_TAG, "utConfigurationQueried: remote exception");
        }
    }

    /**
     * Notify the framework of a UT configuration response to a {@link ImsUtImplBase#queryClir()},
     * {@link ImsUtImplBase#queryClip()}, {@link ImsUtImplBase#queryColp()}, or
     * {@link ImsUtImplBase#queryColr()} query for the transaction ID specified. If the query fails,
     * the framework should be notified via
     * {@link #onUtConfigurationQueryFailed(int, ImsReasonInfo)}.
     * @param id The ID associated with this UT configuration transaction from the framework.
     * @param configuration An {@link ImsSsInfo} instance containing the configuration for the
     *                      line identification supplementary service queried.
     */
    public void onLineIdentificationSupplementaryServiceResponse(int id,
            @NonNull ImsSsInfo configuration) {
        try {
            mServiceInterface.lineIdentificationSupplementaryServiceResponse(id, configuration);
        } catch (RemoteException e) {
            Log.w(LOG_TAG, "onLineIdentificationSupplementaryServicesResponse: remote exception");
        }
    }

    /**
     * Notify the Framework of the line identification query failure.
     * @param id The ID associated with the UT query transaction.
     * @param error The query failure reason.
     */
    public void onUtConfigurationQueryFailed(int id, ImsReasonInfo error) {
        try {
            mServiceInterface.utConfigurationQueryFailed(null, id, error);
+8 −2
Original line number Diff line number Diff line
@@ -18,12 +18,11 @@ package android.telephony.ims.compat.stub;

import android.os.Bundle;
import android.os.RemoteException;

import android.annotation.UnsupportedAppUsage;
import android.telephony.ims.ImsCallForwardInfo;
import android.telephony.ims.ImsReasonInfo;
import android.telephony.ims.ImsSsData;
import android.telephony.ims.ImsSsInfo;

import com.android.ims.internal.IImsUt;
import com.android.ims.internal.IImsUtListener;

@@ -64,6 +63,13 @@ public class ImsUtListenerImplBase extends IImsUtListener.Stub {
            throws RemoteException {
    }

    /**
     * Notifies the result of a line identification supplementary service query.
     */
    @Override
    public void lineIdentificationSupplementaryServiceResponse(int id, ImsSsInfo config) {
    }

    /**
     * Notifies the status of the call barring supplementary service.
     */
+1 −0
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ oneway interface IImsUtListener {
    @UnsupportedAppUsage
    void utConfigurationQueryFailed(in IImsUt ut, int id, in ImsReasonInfo error);

    void lineIdentificationSupplementaryServiceResponse(int id, in ImsSsInfo config);
    /**
     * Notifies the status of the call barring supplementary service.
     */