Fix errors in Allocator::isSupported

Bug: 315883761
Test: VtsHalGraphicsAllocatorAidl_TargetTest
Change-Id: I5bcbb2edb38d86e0016e66aff8f9ff5713f162d0
Signed-off-by: Devika Krishnadas <kdevika@google.com>
diff --git a/gralloc4/src/aidl/GrallocAllocator.cpp b/gralloc4/src/aidl/GrallocAllocator.cpp
index 8e82036..2b01b80 100644
--- a/gralloc4/src/aidl/GrallocAllocator.cpp
+++ b/gralloc4/src/aidl/GrallocAllocator.cpp
@@ -154,12 +154,13 @@
     return ndk::ScopedAStatus::ok();
 }
 
+// TODO(b/315883761): isSupported should return false for unknown-to-HAL usage
 ndk::ScopedAStatus GrallocAllocator::isSupported(
         const AidlAllocator::BufferDescriptorInfo& descriptor, bool* result) {
     buffer_descriptor_t bufferDescriptor = decodeBufferDescriptorInfo(descriptor);
 
     int isBufferDescriptorSupported = arm::allocator::common::isSupported(&bufferDescriptor);
-    *result = isBufferDescriptorSupported;
+    *result = (isBufferDescriptorSupported == 0);
 
     if (isBufferDescriptorSupported) {
         MALI_GRALLOC_LOGV("Allocation for the given description will not succeed. error %d",