diff options
| author | 2019-09-18 13:49:58 -0700 | |
|---|---|---|
| committer | 2019-11-06 19:19:31 +0000 | |
| commit | c2257b6d6f6675f5b024203b7be89336db82724c (patch) | |
| tree | e0fef95e24dab8d1ed9b74ebeb5cef45bba814e2 | |
| parent | 4471d28a9f253ebd4c7d97bc53e410a070f8ce9f (diff) | |
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
| -rw-r--r-- | api/system-current.txt | 5 | ||||
| -rw-r--r-- | telephony/java/android/telephony/ims/ImsCallProfile.java | 59 |
2 files changed, 63 insertions, 1 deletions
diff --git a/api/system-current.txt b/api/system-current.txt index d364026d7af6..0fa0a4ef6397 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -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 { diff --git a/telephony/java/android/telephony/ims/ImsCallProfile.java b/telephony/java/android/telephony/ims/ImsCallProfile.java index 77ee20512d11..4ddeb908a200 100644 --- a/telephony/java/android/telephony/ims/ImsCallProfile.java +++ b/telephony/java/android/telephony/ims/ImsCallProfile.java @@ -309,6 +309,37 @@ public final class ImsCallProfile implements Parcelable { 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>() { |