diff options
| author | 2015-12-18 14:33:57 -0800 | |
|---|---|---|
| committer | 2015-12-18 14:33:57 -0800 | |
| commit | 014c711b0db81ce709b0ccad3e50b3d10227edd8 (patch) | |
| tree | d45a522fafc9a5fc00c2350d306ebebb2e78ebf6 | |
| parent | 938562500707b461506191d1336f634037addd20 (diff) | |
Fix capability/property checking methods to handle multi-bit capabilities.
Some capabilities, such as CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL
are defined in terms of other capabilities; eg:
CAPABILITY_SUPPORTS_VT_LOCAL_RX | CAPABILITY_SUPPORTS_VT_LOCAL_TX
The current capability logic will return TRUE if checking for
CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL and either of the TX or RX bits
is on; which is incorrect. Yay cts tests for finding this.
Bug: 26272951
Change-Id: I55a5676674ee74e213deb3a07e226b04a37d10ee
| -rw-r--r-- | telecomm/java/android/telecom/Call.java | 4 | ||||
| -rw-r--r-- | telecomm/java/android/telecom/Connection.java | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/telecomm/java/android/telecom/Call.java b/telecomm/java/android/telecom/Call.java index 8a1a55378321..6167a22d6af5 100644 --- a/telecomm/java/android/telecom/Call.java +++ b/telecomm/java/android/telecom/Call.java @@ -269,7 +269,7 @@ public final class Call { * @return Whether the specified capability is supported. */ public static boolean can(int capabilities, int capability) { - return (capabilities & capability) != 0; + return (capabilities & capability) == capability; } /** @@ -351,7 +351,7 @@ public final class Call { * @return Whether the specified property is supported. */ public static boolean hasProperty(int properties, int property) { - return (properties & property) != 0; + return (properties & property) == property; } /** diff --git a/telecomm/java/android/telecom/Connection.java b/telecomm/java/android/telecom/Connection.java index 17bd08c183c5..deb98f4211b1 100644 --- a/telecomm/java/android/telecom/Connection.java +++ b/telecomm/java/android/telecom/Connection.java @@ -294,7 +294,7 @@ public abstract class Connection extends Conferenceable { * @hide */ public static boolean can(int capabilities, int capability) { - return (capabilities & capability) != 0; + return (capabilities & capability) == capability; } /** |