From ee669d2774e72efddee08fa2152cf20377572be3 Mon Sep 17 00:00:00 2001 From: Tyler Gunn Date: Mon, 29 Aug 2016 15:36:24 -0700 Subject: [PATCH] Add CAPABILITY_SUPPORTS_VIDEO_CALLING to PhoneAccount. Adding companion PhoneAccount capability which is used to indicate when a PhoneAccount supports video calling. That is, whether it can potentially make video calls, but not necessarily at the current time. This is an often requested OEM enhancement which is used to drive UX (e.g. imagine a video calling icon showing up if the device supports video, but only being enabled when the device is in range of a VT capable tower). See bug for reference to design doc. Bug: 27328615 Change-Id: I08fc18950e6d35a8a7df47ce37aa2326624b9fd3 --- api/current.txt | 1 + api/system-current.txt | 1 + api/test-current.txt | 1 + .../java/android/telecom/PhoneAccount.java | 25 ++++++++++++++++++- 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/api/current.txt b/api/current.txt index 36a843882f67f..3d5fda754c093 100644 --- a/api/current.txt +++ b/api/current.txt @@ -36650,6 +36650,7 @@ package android.telecom { field public static final int CAPABILITY_CONNECTION_MANAGER = 1; // 0x1 field public static final int CAPABILITY_PLACE_EMERGENCY_CALLS = 16; // 0x10 field public static final int CAPABILITY_SIM_SUBSCRIPTION = 4; // 0x4 + field public static final int CAPABILITY_SUPPORTS_VIDEO_CALLING = 1024; // 0x400 field public static final int CAPABILITY_VIDEO_CALLING = 8; // 0x8 field public static final int CAPABILITY_VIDEO_CALLING_RELIES_ON_PRESENCE = 256; // 0x100 field public static final android.os.Parcelable.Creator CREATOR; diff --git a/api/system-current.txt b/api/system-current.txt index e4d53f0778f41..1a368fe781fe0 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -39677,6 +39677,7 @@ package android.telecom { field public static final int CAPABILITY_MULTI_USER = 32; // 0x20 field public static final int CAPABILITY_PLACE_EMERGENCY_CALLS = 16; // 0x10 field public static final int CAPABILITY_SIM_SUBSCRIPTION = 4; // 0x4 + field public static final int CAPABILITY_SUPPORTS_VIDEO_CALLING = 1024; // 0x400 field public static final int CAPABILITY_VIDEO_CALLING = 8; // 0x8 field public static final int CAPABILITY_VIDEO_CALLING_RELIES_ON_PRESENCE = 256; // 0x100 field public static final android.os.Parcelable.Creator CREATOR; diff --git a/api/test-current.txt b/api/test-current.txt index 1d583bb608059..a1ae45d7dc919 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -36732,6 +36732,7 @@ package android.telecom { field public static final int CAPABILITY_CONNECTION_MANAGER = 1; // 0x1 field public static final int CAPABILITY_PLACE_EMERGENCY_CALLS = 16; // 0x10 field public static final int CAPABILITY_SIM_SUBSCRIPTION = 4; // 0x4 + field public static final int CAPABILITY_SUPPORTS_VIDEO_CALLING = 1024; // 0x400 field public static final int CAPABILITY_VIDEO_CALLING = 8; // 0x8 field public static final int CAPABILITY_VIDEO_CALLING_RELIES_ON_PRESENCE = 256; // 0x100 field public static final android.os.Parcelable.Creator CREATOR; diff --git a/telecomm/java/android/telecom/PhoneAccount.java b/telecomm/java/android/telecom/PhoneAccount.java index 473e39457f584..0457d6372d8bd 100644 --- a/telecomm/java/android/telecom/PhoneAccount.java +++ b/telecomm/java/android/telecom/PhoneAccount.java @@ -114,7 +114,10 @@ public final class PhoneAccount implements Parcelable { public static final int CAPABILITY_SIM_SUBSCRIPTION = 0x4; /** - * Flag indicating that this {@code PhoneAccount} is capable of placing video calls. + * Flag indicating that this {@code PhoneAccount} is currently able to place video calls. + *

+ * See also {@link #CAPABILITY_SUPPORTS_VIDEO_CALLING} which indicates whether the + * {@code PhoneAccount} supports placing video calls. *

* See {@link #getCapabilities} */ @@ -178,6 +181,23 @@ public final class PhoneAccount implements Parcelable { */ public static final int CAPABILITY_EMERGENCY_VIDEO_CALLING = 0x200; + /** + * Flag indicating that this {@link PhoneAccount} supports video calling. + * This is not an indication that the {@link PhoneAccount} is currently able to make a video + * call, but rather that it has the ability to make video calls (but not necessarily at this + * time). + *

+ * Whether a {@link PhoneAccount} can make a video call is ultimately controlled by + * {@link #CAPABILITY_VIDEO_CALLING}, which indicates whether the {@link PhoneAccount} is + * currently capable of making a video call. Consider a case where, for example, a + * {@link PhoneAccount} supports making video calls (e.g. + * {@link #CAPABILITY_SUPPORTS_VIDEO_CALLING}), but a current lack of network connectivity + * prevents video calls from being made (e.g. {@link #CAPABILITY_VIDEO_CALLING}). + *

+ * See {@link #getCapabilities} + */ + public static final int CAPABILITY_SUPPORTS_VIDEO_CALLING = 0x400; + /** * URI scheme for telephone number URIs. */ @@ -762,6 +782,9 @@ public final class PhoneAccount implements Parcelable { */ private String capabilitiesToString(int capabilities) { StringBuilder sb = new StringBuilder(); + if (hasCapabilities(CAPABILITY_SUPPORTS_VIDEO_CALLING)) { + sb.append("SuppVideo "); + } if (hasCapabilities(CAPABILITY_VIDEO_CALLING)) { sb.append("Video "); }