diff --git a/api/system-current.txt b/api/system-current.txt index 184ed44f4ebd2..863bfdf684b7a 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -4969,6 +4969,28 @@ package android.telephony.ims { field public static final int CODE_RADIO_SETUP_FAILURE = 1509; // 0x5e5 field public static final int CODE_RADIO_UPLINK_FAILURE = 1508; // 0x5e4 field public static final int CODE_REGISTRATION_ERROR = 1000; // 0x3e8 + field public static final int CODE_REJECT_1X_COLLISION = 1603; // 0x643 + field public static final int CODE_REJECT_CALL_ON_OTHER_SUB = 1602; // 0x642 + field public static final int CODE_REJECT_CALL_TYPE_NOT_ALLOWED = 1605; // 0x645 + field public static final int CODE_REJECT_CONFERENCE_TTY_NOT_ALLOWED = 1617; // 0x651 + field public static final int CODE_REJECT_INTERNAL_ERROR = 1612; // 0x64c + field public static final int CODE_REJECT_MAX_CALL_LIMIT_REACHED = 1608; // 0x648 + field public static final int CODE_REJECT_ONGOING_CALL_SETUP = 1607; // 0x647 + field public static final int CODE_REJECT_ONGOING_CALL_TRANSFER = 1611; // 0x64b + field public static final int CODE_REJECT_ONGOING_CALL_UPGRADE = 1616; // 0x650 + field public static final int CODE_REJECT_ONGOING_CALL_WAITING_DISABLED = 1601; // 0x641 + field public static final int CODE_REJECT_ONGOING_CONFERENCE_CALL = 1618; // 0x652 + field public static final int CODE_REJECT_ONGOING_CS_CALL = 1621; // 0x655 + field public static final int CODE_REJECT_ONGOING_E911_CALL = 1606; // 0x646 + field public static final int CODE_REJECT_ONGOING_ENCRYPTED_CALL = 1620; // 0x654 + field public static final int CODE_REJECT_ONGOING_HANDOVER = 1614; // 0x64e + field public static final int CODE_REJECT_QOS_FAILURE = 1613; // 0x64d + field public static final int CODE_REJECT_SERVICE_NOT_REGISTERED = 1604; // 0x644 + field public static final int CODE_REJECT_UNKNOWN = 1600; // 0x640 + field public static final int CODE_REJECT_UNSUPPORTED_SDP_HEADERS = 1610; // 0x64a + field public static final int CODE_REJECT_UNSUPPORTED_SIP_HEADERS = 1609; // 0x649 + field public static final int CODE_REJECT_VT_AVPF_NOT_ALLOWED = 1619; // 0x653 + field public static final int CODE_REJECT_VT_TTY_NOT_ALLOWED = 1615; // 0x64f field public static final int CODE_REMOTE_CALL_DECLINE = 1404; // 0x57c field public static final int CODE_SIP_ALTERNATE_EMERGENCY_CALL = 1514; // 0x5ea field public static final int CODE_SIP_BAD_ADDRESS = 337; // 0x151 @@ -5240,6 +5262,7 @@ package android.telephony.ims.feature { method public android.telephony.ims.stub.ImsUtImplBase getUt(); method public final void notifyCapabilitiesStatusChanged(android.telephony.ims.feature.MmTelFeature.MmTelCapabilities); method public final void notifyIncomingCall(android.telephony.ims.stub.ImsCallSessionImplBase, android.os.Bundle); + method public final void notifyRejectedCall(android.telephony.ims.ImsCallProfile, android.telephony.ims.ImsReasonInfo); method public final void notifyVoiceMessageCountUpdate(int); method public void onFeatureReady(); method public void onFeatureRemoved(); diff --git a/telephony/java/android/telephony/ims/ImsReasonInfo.java b/telephony/java/android/telephony/ims/ImsReasonInfo.java index 7d654305015ea..e70e6334f8467 100644 --- a/telephony/java/android/telephony/ims/ImsReasonInfo.java +++ b/telephony/java/android/telephony/ims/ImsReasonInfo.java @@ -399,6 +399,160 @@ public final class ImsReasonInfo implements Parcelable { */ public static final int CODE_UNOBTAINABLE_NUMBER = 1515; + /** + * The rejection cause is not known. + *
+ * Used with implicit call rejection. + */ + public static final int CODE_REJECT_UNKNOWN = 1600; + + /** + * Ongoing call, and call waiting is disabled. + *
+ * Used with implicit call rejection. + */ + public static final int CODE_REJECT_ONGOING_CALL_WAITING_DISABLED = 1601; + + /** + * A call is ongoing on another sub. + *
+ * Used with implicit call rejection. + */ + public static final int CODE_REJECT_CALL_ON_OTHER_SUB = 1602; + + /** + * CDMA call collision. + *
+ * Used with implicit call rejection. + */ + public static final int CODE_REJECT_1X_COLLISION = 1603; + + /** + * IMS is not registered for service yet. + *
+ * Used with implicit call rejection. + */ + public static final int CODE_REJECT_SERVICE_NOT_REGISTERED = 1604; + + /** + * The call type is not allowed on the current RAT. + *
+ * Used with implicit call rejection. + */ + public static final int CODE_REJECT_CALL_TYPE_NOT_ALLOWED = 1605; + + /** + * And emergency call is ongoing. + *
+ * Used with implicit call rejection. + */ + public static final int CODE_REJECT_ONGOING_E911_CALL = 1606; + + /** + * Another call is in the process of being establilshed. + *
+ * Used with implicit call rejection. + */ + public static final int CODE_REJECT_ONGOING_CALL_SETUP = 1607; + + /** + * Maximum number of allowed calls are already in progress. + *
+ * Used with implicit call rejection. + */ + public static final int CODE_REJECT_MAX_CALL_LIMIT_REACHED = 1608; + + /** + * Invalid/unsupported SIP headers received. + *
+ * Used with implicit call rejection. + */ + public static final int CODE_REJECT_UNSUPPORTED_SIP_HEADERS = 1609; + + /** + * Invalid/unsupported SDP headers received. + *
+ * Used with implicit call rejection. + */ + public static final int CODE_REJECT_UNSUPPORTED_SDP_HEADERS = 1610; + + /** + * A call transfer is in progress. + *
+ * Used with implicit call rejection. + */ + public static final int CODE_REJECT_ONGOING_CALL_TRANSFER = 1611; + + /** + * An internal error occured while processing the call. + *
+ * Used with implicit call rejection. + */ + public static final int CODE_REJECT_INTERNAL_ERROR = 1612; + + /** + * Call failure due to lack of dedicated bearer. + *
+ * Used with implicit call rejection. + */ + public static final int CODE_REJECT_QOS_FAILURE = 1613; + + /** + * A call handover is in progress. + *
+ * Used with implicit call rejection. + */ + public static final int CODE_REJECT_ONGOING_HANDOVER = 1614; + + /** + * Video calling not supported with TTY. + *
+ * Used with implicit call rejection. + */ + public static final int CODE_REJECT_VT_TTY_NOT_ALLOWED = 1615; + + /** + * A call upgrade is in progress. + *
+ * Used with implicit call rejection. + */ + public static final int CODE_REJECT_ONGOING_CALL_UPGRADE = 1616; + + /** + * Call from conference server, when TTY mode is ON. + *
+ * Used with implicit call rejection. + */ + public static final int CODE_REJECT_CONFERENCE_TTY_NOT_ALLOWED = 1617; + + /** + * A conference call is ongoing. + *
+ * Used with implicit call rejection. + */ + public static final int CODE_REJECT_ONGOING_CONFERENCE_CALL = 1618; + + /** + * A video call with AVPF is not supported. + *
+ * Used with implicit call rejection. + */ + public static final int CODE_REJECT_VT_AVPF_NOT_ALLOWED = 1619; + + /** + * And encrypted call is ongoing; other calls not supported. + *
+ * Used with implicit call rejection. + */ + public static final int CODE_REJECT_ONGOING_ENCRYPTED_CALL = 1620; + + /** + * A CS call is ongoing. + *
+ * Used with implicit call rejection. + */ + public static final int CODE_REJECT_ONGOING_CS_CALL = 1621; + /* OEM specific error codes. To be used by OEMs when they don't want to reveal error code which would be replaced by ERROR_UNSPECIFIED */ public static final int CODE_OEM_CAUSE_1 = 0xf001; diff --git a/telephony/java/android/telephony/ims/aidl/IImsMmTelListener.aidl b/telephony/java/android/telephony/ims/aidl/IImsMmTelListener.aidl index 904e7cad9c149..7bbe30a444b9a 100644 --- a/telephony/java/android/telephony/ims/aidl/IImsMmTelListener.aidl +++ b/telephony/java/android/telephony/ims/aidl/IImsMmTelListener.aidl @@ -18,6 +18,9 @@ package android.telephony.ims.aidl; import android.os.Bundle; +import android.telephony.ims.ImsCallProfile; +import android.telephony.ims.ImsReasonInfo; + import com.android.ims.internal.IImsCallSession; /** @@ -26,5 +29,6 @@ import com.android.ims.internal.IImsCallSession; */ oneway interface IImsMmTelListener { void onIncomingCall(IImsCallSession c, in Bundle extras); + void onRejectedCall(in ImsCallProfile callProfile, in ImsReasonInfo reason); void onVoiceMessageCountUpdate(int count); -} \ No newline at end of file +} diff --git a/telephony/java/android/telephony/ims/feature/MmTelFeature.java b/telephony/java/android/telephony/ims/feature/MmTelFeature.java index aaf1a1cf8f206..f12540f8dd137 100644 --- a/telephony/java/android/telephony/ims/feature/MmTelFeature.java +++ b/telephony/java/android/telephony/ims/feature/MmTelFeature.java @@ -36,6 +36,7 @@ import android.telephony.ims.stub.ImsUtImplBase; import android.util.Log; import android.telephony.ims.ImsCallProfile; +import android.telephony.ims.ImsReasonInfo; import com.android.ims.internal.IImsCallSession; import com.android.ims.internal.IImsEcbm; import com.android.ims.internal.IImsMultiEndpoint; @@ -325,6 +326,16 @@ public class MmTelFeature extends ImsFeature { } + /** + * Called when the IMS provider implicitly rejects an incoming call during setup. + * @param callProfile An {@link ImsCallProfile} with the call details. + * @param reason The {@link ImsReasonInfo} reason for call rejection. + */ + @Override + public void onRejectedCall(ImsCallProfile callProfile, ImsReasonInfo reason) { + + } + /** * Updates the Listener when the voice message count for IMS has changed. * @param count an integer representing the new message count. @@ -428,6 +439,26 @@ public class MmTelFeature extends ImsFeature { } } + /** + * Notify the framework that a call has been implicitly rejected by this MmTelFeature + * during call setup. + * @param callProfile The {@link ImsCallProfile} IMS call profile with details. + * This can be null if no call information is available for the rejected call. + * @param reason The {@link ImsReasonInfo} call rejection reason. + */ + public final void notifyRejectedCall(ImsCallProfile callProfile, ImsReasonInfo reason) { + synchronized (mLock) { + if (mListener == null) { + throw new IllegalStateException("Session is not available."); + } + try { + mListener.onRejectedCall(callProfile, reason); + } catch (RemoteException e) { + throw new RuntimeException(e); + } + } + } + /** * * @hide