diff options
| author | 2018-12-27 22:03:45 +0000 | |
|---|---|---|
| committer | 2018-12-27 22:03:45 +0000 | |
| commit | cfc6518c48d1648bb33a0f6633132a726a9bc7f9 (patch) | |
| tree | 762c47bc6988c42d1c70597940db0d690db4af5d | |
| parent | 755f2a38ac442b1cde94a1a71a51c1a3a91fae33 (diff) | |
| parent | b1f54cf1071a50c53f7a0f5c862bc56915c5f4f6 (diff) | |
Merge "Add Emergency service categories in ImsCallProfile"
| -rw-r--r-- | api/system-current.txt | 2 | ||||
| -rw-r--r-- | telephony/java/android/telephony/emergency/EmergencyNumber.java | 5 | ||||
| -rw-r--r-- | telephony/java/android/telephony/ims/ImsCallProfile.java | 75 |
3 files changed, 80 insertions, 2 deletions
diff --git a/api/system-current.txt b/api/system-current.txt index af902d4d32bb..5b27b1235116 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 2d46ec26a755..41f7bd7ade63 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<EmergencyNu private final int mEmergencyNumberSourceBitmask; /** @hide */ - public EmergencyNumber(String number, String countryIso, + public EmergencyNumber(@NonNull String number, @NonNull String countryIso, int emergencyServiceCategories, int emergencyNumberSources) { this.mNumber = number; @@ -403,7 +404,7 @@ public final class EmergencyNumber implements Parcelable, Comparable<EmergencyNu * 0 if both have equal display priority. */ @Override - public int compareTo(EmergencyNumber emergencyNumber) { + public int compareTo(@NonNull EmergencyNumber emergencyNumber) { if (this.getDisplayPriorityScore() > emergencyNumber.getDisplayPriorityScore()) { return -1; diff --git a/telephony/java/android/telephony/ims/ImsCallProfile.java b/telephony/java/android/telephony/ims/ImsCallProfile.java index f73036e88a95..a6c24bf4e18a 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; @@ -295,6 +297,28 @@ public final class ImsCallProfile implements Parcelable { 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: + * <ol> + * <li>{@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_UNSPECIFIED} </li> + * <li>{@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_POLICE} </li> + * <li>{@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_AMBULANCE} </li> + * <li>{@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_FIRE_BRIGADE} </li> + * <li>{@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_MARINE_GUARD} </li> + * <li>{@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_MOUNTAIN_RESCUE} </li> + * <li>{@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_MIEC} </li> + * <li>{@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_AIEC} </li> + * </ol> + * + * 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}. * <p> * Valid data types include: @@ -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<ImsCallProfile> CREATOR = new Creator<ImsCallProfile>() { @@ -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: + * <ol> + * <li>{@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_UNSPECIFIED} </li> + * <li>{@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_POLICE} </li> + * <li>{@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_AMBULANCE} </li> + * <li>{@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_FIRE_BRIGADE} </li> + * <li>{@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_MARINE_GUARD} </li> + * <li>{@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_MOUNTAIN_RESCUE} </li> + * <li>{@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_MIEC} </li> + * <li>{@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_AIEC} </li> + * </ol> + * + * 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: + * <ol> + * <li>{@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_UNSPECIFIED} </li> + * <li>{@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_POLICE} </li> + * <li>{@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_AMBULANCE} </li> + * <li>{@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_FIRE_BRIGADE} </li> + * <li>{@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_MARINE_GUARD} </li> + * <li>{@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_MOUNTAIN_RESCUE} </li> + * <li>{@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_MIEC} </li> + * <li>{@link EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_AIEC} </li> + * </ol> + * + * Reference: 3gpp 23.167, Section 6 - Functional description; + * 3gpp 22.101, Section 10 - Emergency Calls. + */ + public @EmergencyServiceCategories int getEmergencyServiceCategories() { + return mEmergencyServiceCategories; + } } |