Merge "Fix order of operations warning in libui" am: 73d4186757 am: 1b080b15aa
am: 544c391292
Change-Id: I8fbce66a7a5f41281fa12ce34869f2a1b5e10413
diff --git a/include/ui/Gralloc1On0Adapter.h b/include/ui/Gralloc1On0Adapter.h
index 33c2f87..d523c4f 100644
--- a/include/ui/Gralloc1On0Adapter.h
+++ b/include/ui/Gralloc1On0Adapter.h
@@ -416,10 +416,10 @@
if (!outData) {
const auto producerCpuUsage = GRALLOC1_PRODUCER_USAGE_CPU_READ |
GRALLOC1_PRODUCER_USAGE_CPU_WRITE;
- if (producerUsage & producerCpuUsage != 0) {
+ if ((producerUsage & producerCpuUsage) != 0) {
return static_cast<int32_t>(GRALLOC1_ERROR_BAD_VALUE);
}
- if (consumerUsage & GRALLOC1_CONSUMER_USAGE_CPU_READ != 0) {
+ if ((consumerUsage & GRALLOC1_CONSUMER_USAGE_CPU_READ) != 0) {
return static_cast<int32_t>(GRALLOC1_ERROR_BAD_VALUE);
}
}