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

Commit c2257b6d authored by Tyler Gunn's avatar Tyler Gunn Committed by Brad Ebinger
Browse files

Add Verstat support for incoming call number verification.

Update ImsCallProfile to indicate the verstat for incoming calls.

Test: Run new GTS tests.
Bug: 135929421
Merged-In: I712a42836382e8929e40b887fd01c450a4096bab
Change-Id: I712a42836382e8929e40b887fd01c450a4096bab
parent 4471d28a
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -8679,6 +8679,7 @@ package android.telephony.ims {
    method public android.os.Bundle getCallExtras();
    method public int getCallType();
    method public static int getCallTypeFromVideoState(int);
    method public int getCallerNumberVerificationStatus();
    method public int getEmergencyCallRouting();
    method public int getEmergencyServiceCategories();
    method @NonNull public java.util.List<java.lang.String> getEmergencyUrns();
@@ -8696,6 +8697,7 @@ package android.telephony.ims {
    method public void setCallExtraBoolean(String, boolean);
    method public void setCallExtraInt(String, int);
    method public void setCallRestrictCause(int);
    method public void setCallerNumberVerificationStatus(int);
    method public void setEmergencyCallRouting(int);
    method public void setEmergencyCallTesting(boolean);
    method public void setEmergencyServiceCategories(int);
@@ -8746,6 +8748,9 @@ package android.telephony.ims {
    field public static final int SERVICE_TYPE_EMERGENCY = 2; // 0x2
    field public static final int SERVICE_TYPE_NONE = 0; // 0x0
    field public static final int SERVICE_TYPE_NORMAL = 1; // 0x1
    field public static final int VERIFICATION_STATUS_FAILED = 2; // 0x2
    field public static final int VERIFICATION_STATUS_NOT_VERIFIED = 0; // 0x0
    field public static final int VERIFICATION_STATUS_PASSED = 1; // 0x1
  }
  public class ImsCallSessionListener {
+58 −1
Original line number Diff line number Diff line
@@ -308,6 +308,37 @@ public final class ImsCallProfile implements Parcelable {
    @UnsupportedAppUsage
    public @CallRestrictCause int mRestrictCause = CALL_RESTRICT_CAUSE_NONE;

    /**
     * The VERSTAT for an incoming call's phone number.
     */
    private @VerificationStatus int mCallerNumberVerificationStatus;

    /**
     * Indicates that the network could not perform verification.
     */
    public static final int VERIFICATION_STATUS_NOT_VERIFIED = 0;

    /**
     * Indicates that verification by the network passed.  This indicates there is a high likelihood
     * that the call originated from a valid source.
     */
    public static final int VERIFICATION_STATUS_PASSED = 1;

    /**
     * Indicates that verification by the network failed.  This indicates there is a high likelihood
     * that the call did not originate from a valid source.
     */
    public static final int VERIFICATION_STATUS_FAILED = 2;

    /**@hide*/
    @Retention(RetentionPolicy.SOURCE)
    @IntDef(prefix = "VERIFICATION_STATUS_", value = {
            VERIFICATION_STATUS_NOT_VERIFIED,
            VERIFICATION_STATUS_PASSED,
            VERIFICATION_STATUS_FAILED
    })
    public @interface VerificationStatus {}

    /**
     * The emergency service categories, only valid if {@link #getServiceType} returns
     * {@link #SERVICE_TYPE_EMERGENCY}
@@ -539,6 +570,29 @@ public final class ImsCallProfile implements Parcelable {
        mMediaProfile = profile.mMediaProfile;
    }

    /**
     * Sets the verification status for the phone number of an incoming call as identified in
     * ATIS-1000082.
     * <p>
     * The ImsService should parse the verstat information from the SIP INVITE headers for the call
     * to determine this information.  It is typically found in the P-Asserted-Identity OR From
     * header fields.
     * @param callerNumberVerificationStatus the new verification status.
     */
    public void setCallerNumberVerificationStatus(
            @VerificationStatus int callerNumberVerificationStatus) {
        mCallerNumberVerificationStatus = callerNumberVerificationStatus;
    }

    /**
     * Gets the verification status for the phone number of an incoming call as identified in
     * ATIS-1000082.
     * @return the verification status.
     */
    public @VerificationStatus int getCallerNumberVerificationStatus() {
        return mCallerNumberVerificationStatus;
    }

    @NonNull
    @Override
    public String toString() {
@@ -551,7 +605,8 @@ public final class ImsCallProfile implements Parcelable {
                + ", emergencyCallRouting=" + mEmergencyCallRouting
                + ", emergencyCallTesting=" + mEmergencyCallTesting
                + ", hasKnownUserIntentEmergency=" + mHasKnownUserIntentEmergency
                + ", mRestrictCause=" + mRestrictCause + " }";
                + ", mRestrictCause=" + mRestrictCause
                + ", mCallerNumberVerstat= " + mCallerNumberVerificationStatus + " }";
    }

    @Override
@@ -572,6 +627,7 @@ public final class ImsCallProfile implements Parcelable {
        out.writeBoolean(mEmergencyCallTesting);
        out.writeBoolean(mHasKnownUserIntentEmergency);
        out.writeInt(mRestrictCause);
        out.writeInt(mCallerNumberVerificationStatus);
    }

    private void readFromParcel(Parcel in) {
@@ -585,6 +641,7 @@ public final class ImsCallProfile implements Parcelable {
        mEmergencyCallTesting = in.readBoolean();
        mHasKnownUserIntentEmergency = in.readBoolean();
        mRestrictCause = in.readInt();
        mCallerNumberVerificationStatus = in.readInt();
    }

    public static final @android.annotation.NonNull Creator<ImsCallProfile> CREATOR = new Creator<ImsCallProfile>() {