diff --git a/api/system-current.txt b/api/system-current.txt index af902d4d32bbc..5b27b12351165 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -5873,6 +5873,7 @@ package android.telephony.ims { method public android.os.Bundle getCallExtras(); method public int getCallType(); method public static int getCallTypeFromVideoState(int); + method public int getEmergencyServiceCategories(); method public android.telephony.ims.ImsStreamMediaProfile getMediaProfile(); method public int getRestrictCause(); method public int getServiceType(); @@ -5885,6 +5886,7 @@ package android.telephony.ims { method public void setCallExtraBoolean(java.lang.String, boolean); method public void setCallExtraInt(java.lang.String, int); method public void setCallRestrictCause(int); + method public void setEmergencyServiceCategories(int); method public void updateCallExtras(android.telephony.ims.ImsCallProfile); method public void updateCallType(android.telephony.ims.ImsCallProfile); method public void updateMediaProfile(android.telephony.ims.ImsCallProfile); diff --git a/telephony/java/android/telephony/emergency/EmergencyNumber.java b/telephony/java/android/telephony/emergency/EmergencyNumber.java index 2d46ec26a7554..41f7bd7ade634 100644 --- a/telephony/java/android/telephony/emergency/EmergencyNumber.java +++ b/telephony/java/android/telephony/emergency/EmergencyNumber.java @@ -17,6 +17,7 @@ package android.telephony.emergency; import android.annotation.IntDef; +import android.annotation.NonNull; import android.hardware.radio.V1_4.EmergencyNumberSource; import android.hardware.radio.V1_4.EmergencyServiceCategory; import android.os.Parcel; @@ -196,7 +197,7 @@ public final class EmergencyNumber implements Parcelable, Comparable emergencyNumber.getDisplayPriorityScore()) { return -1; diff --git a/telephony/java/android/telephony/ims/ImsCallProfile.java b/telephony/java/android/telephony/ims/ImsCallProfile.java index f73036e88a951..a6c24bf4e18aa 100644 --- a/telephony/java/android/telephony/ims/ImsCallProfile.java +++ b/telephony/java/android/telephony/ims/ImsCallProfile.java @@ -23,6 +23,8 @@ import android.os.Bundle; import android.os.Parcel; import android.os.Parcelable; import android.telecom.VideoProfile; +import android.telephony.emergency.EmergencyNumber; +import android.telephony.emergency.EmergencyNumber.EmergencyServiceCategories; import android.util.Log; import com.android.internal.telephony.PhoneConstants; @@ -294,6 +296,28 @@ public final class ImsCallProfile implements Parcelable { @UnsupportedAppUsage public @CallRestrictCause int mRestrictCause = CALL_RESTRICT_CAUSE_NONE; + /** + * The emergency service categories, only valid if {@link #getServiceType} returns + * {@link #SERVICE_TYPE_EMERGENCY} + * + * If valid, the value is the bitwise-OR combination of the following constants: + *
    + *
  1. {@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_UNSPECIFIED}
  2. + *
  3. {@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_POLICE}
  4. + *
  5. {@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_AMBULANCE}
  6. + *
  7. {@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_FIRE_BRIGADE}
  8. + *
  9. {@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_MARINE_GUARD}
  10. + *
  11. {@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_MOUNTAIN_RESCUE}
  12. + *
  13. {@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_MIEC}
  14. + *
  15. {@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_AIEC}
  16. + *
+ * + * Reference: 3gpp 23.167, Section 6 - Functional description; + * 3gpp 22.101, Section 10 - Emergency Calls. + */ + private @EmergencyServiceCategories int mEmergencyServiceCategories = + EmergencyNumber.EMERGENCY_SERVICE_CATEGORY_UNSPECIFIED; + /** * Extras associated with this {@link ImsCallProfile}. *

@@ -495,6 +519,7 @@ public final class ImsCallProfile implements Parcelable { out.writeInt(mCallType); out.writeBundle(filteredExtras); out.writeParcelable(mMediaProfile, 0); + out.writeInt(mEmergencyServiceCategories); } private void readFromParcel(Parcel in) { @@ -502,6 +527,7 @@ public final class ImsCallProfile implements Parcelable { mCallType = in.readInt(); mCallExtras = in.readBundle(); mMediaProfile = in.readParcelable(ImsStreamMediaProfile.class.getClassLoader()); + mEmergencyServiceCategories = in.readInt(); } public static final Creator CREATOR = new Creator() { @@ -710,4 +736,53 @@ public final class ImsCallProfile implements Parcelable { private static boolean isVideoStateSet(int videoState, int videoStateToCheck) { return (videoState & videoStateToCheck) == videoStateToCheck; } + + /** + * Set the emergency service categories. The set value is valid only if + * {@link #getServiceType} returns {@link #SERVICE_TYPE_EMERGENCY} + * + * If valid, the value is the bitwise-OR combination of the following constants: + *

    + *
  1. {@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_UNSPECIFIED}
  2. + *
  3. {@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_POLICE}
  4. + *
  5. {@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_AMBULANCE}
  6. + *
  7. {@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_FIRE_BRIGADE}
  8. + *
  9. {@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_MARINE_GUARD}
  10. + *
  11. {@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_MOUNTAIN_RESCUE}
  12. + *
  13. {@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_MIEC}
  14. + *
  15. {@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_AIEC}
  16. + *
+ * + * Reference: 3gpp 23.167, Section 6 - Functional description; + * 3gpp 22.101, Section 10 - Emergency Calls. + */ + public void setEmergencyServiceCategories( + @EmergencyServiceCategories int emergencyServiceCategories) { + mEmergencyServiceCategories = emergencyServiceCategories; + } + + /** + * Get the emergency service categories, only valid if {@link #getServiceType} returns + * {@link #SERVICE_TYPE_EMERGENCY} + * + * @return the emergency service categories, + * + * If valid, the value is the bitwise-OR combination of the following constants: + *
    + *
  1. {@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_UNSPECIFIED}
  2. + *
  3. {@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_POLICE}
  4. + *
  5. {@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_AMBULANCE}
  6. + *
  7. {@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_FIRE_BRIGADE}
  8. + *
  9. {@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_MARINE_GUARD}
  10. + *
  11. {@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_MOUNTAIN_RESCUE}
  12. + *
  13. {@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_MIEC}
  14. + *
  15. {@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_AIEC}
  16. + *
+ * + * Reference: 3gpp 23.167, Section 6 - Functional description; + * 3gpp 22.101, Section 10 - Emergency Calls. + */ + public @EmergencyServiceCategories int getEmergencyServiceCategories() { + return mEmergencyServiceCategories; + } }