Merge "Add CAPABILITY_EMERGENCY_PREFERRED in PhoneAccount" into qt-dev

This commit is contained in:
Brad Ebinger
2019-05-24 17:45:47 +00:00
committed by Android (Google) Code Review
3 changed files with 35 additions and 2 deletions

View File

@@ -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

View File

@@ -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 ");
}

View File

@@ -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.
*/