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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user