diff options
| -rw-r--r-- | core/java/android/content/Intent.java | 8 | ||||
| -rw-r--r-- | telecomm/java/android/telecom/PhoneAccount.java | 22 | ||||
| -rw-r--r-- | telecomm/java/android/telecom/TelecomManager.java | 7 |
3 files changed, 35 insertions, 2 deletions
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java index 9e5fcfb6f73e..be75f6e7005d 100644 --- a/core/java/android/content/Intent.java +++ b/core/java/android/content/Intent.java @@ -58,6 +58,8 @@ import android.provider.DocumentsContract; import android.provider.DocumentsProvider; import android.provider.MediaStore; import android.provider.OpenableColumns; +import android.telecom.PhoneAccount; +import android.telecom.TelecomManager; import android.text.TextUtils; import android.util.ArraySet; import android.util.AttributeSet; @@ -1120,6 +1122,12 @@ public class Intent implements Parcelable, Cloneable { * <p>Input: {@link #getData} is URI of a phone number to be dialed or a * tel: URI of an explicit phone number. * <p>Output: nothing. + * + * <p class="note"><strong>Note:</strong> It is not guaranteed that the call will be placed on + * the {@link PhoneAccount} provided in the {@link TelecomManager#EXTRA_PHONE_ACCOUNT_HANDLE} + * extra (if specified) and may be placed on another {@link PhoneAccount} with the + * {@link PhoneAccount#CAPABILITY_PLACE_EMERGENCY_CALLS} capability, depending on external + * factors, such as network conditions and Modem/SIM status. * @hide */ @SystemApi diff --git a/telecomm/java/android/telecom/PhoneAccount.java b/telecomm/java/android/telecom/PhoneAccount.java index 5e13400af63a..1b783b7beb7f 100644 --- a/telecomm/java/android/telecom/PhoneAccount.java +++ b/telecomm/java/android/telecom/PhoneAccount.java @@ -17,6 +17,7 @@ package android.telecom; import android.annotation.SystemApi; +import android.content.Intent; import android.graphics.drawable.Icon; import android.net.Uri; import android.os.Bundle; @@ -24,7 +25,6 @@ import android.os.Parcel; import android.os.Parcelable; import android.text.TextUtils; -import java.lang.String; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -314,7 +314,22 @@ public final class PhoneAccount implements Parcelable { */ public static final int CAPABILITY_RTT = 0x1000; - /* NEXT CAPABILITY: 0x2000 */ + /** + * Flag indicating that this {@link PhoneAccount} is the preferred SIM subscription for + * emergency calls. A {@link PhoneAccount} that sets this capabilitiy must also + * set the {@link #CAPABILITY_SIM_SUBSCRIPTION} and {@link #CAPABILITY_PLACE_EMERGENCY_CALLS} + * capabilities. There should only be one emergency preferred {@link PhoneAccount}. + * <p> + * When set, Telecom will prefer this {@link PhoneAccount} over others for emergency calling, + * even if the emergency call was placed with a specific {@link PhoneAccount} set using the + * extra{@link TelecomManager#EXTRA_PHONE_ACCOUNT_HANDLE} in + * {@link Intent#ACTION_CALL_EMERGENCY} or {@link TelecomManager#placeCall(Uri, Bundle)}. + * + * @hide + */ + public static final int CAPABILITY_EMERGENCY_PREFERRED = 0x2000; + + /* NEXT CAPABILITY: 0x4000 */ /** * URI scheme for telephone number URIs. @@ -1020,6 +1035,9 @@ public final class PhoneAccount implements Parcelable { if (hasCapabilities(CAPABILITY_PLACE_EMERGENCY_CALLS)) { sb.append("PlaceEmerg "); } + if (hasCapabilities(CAPABILITY_EMERGENCY_PREFERRED)) { + sb.append("EmerPrefer "); + } if (hasCapabilities(CAPABILITY_EMERGENCY_VIDEO_CALLING)) { sb.append("EmergVideo "); } diff --git a/telecomm/java/android/telecom/TelecomManager.java b/telecomm/java/android/telecom/TelecomManager.java index be4729a679b9..64092034e0b2 100644 --- a/telecomm/java/android/telecom/TelecomManager.java +++ b/telecomm/java/android/telecom/TelecomManager.java @@ -1824,6 +1824,13 @@ public class TelecomManager { * Self-managed {@link ConnectionService}s require permission * {@link android.Manifest.permission#MANAGE_OWN_CALLS}. * + * <p class="note"><strong>Note:</strong> If this method is used to place an emergency call, it + * is not guaranteed that the call will be placed on the {@link PhoneAccount} provided in + * the {@link #EXTRA_PHONE_ACCOUNT_HANDLE} extra (if specified) and may be placed on another + * {@link PhoneAccount} with the {@link PhoneAccount#CAPABILITY_PLACE_EMERGENCY_CALLS} + * capability, depending on external factors, such as network conditions and Modem/SIM status. + * </p> + * * @param address The address to make the call to. * @param extras Bundle of extras to use with the call. */ |