diff options
| author | 2022-04-11 22:41:58 +0000 | |
|---|---|---|
| committer | 2022-04-13 23:24:56 +0000 | |
| commit | e401e88200dbd4acb8a6f9694490ac53254de809 (patch) | |
| tree | 6a41e3166cecf58d81da9ac5d00c7b9a20f73c0e /libs/ui/Gralloc4.cpp | |
| parent | bf980f9126b648906a3fb19c24e98a17303cc68b (diff) | |
Allow AIDL allocator service to be used by itself
The HIDL service was required to be available all of the time.
Bug: 205761012
Test: atest hal_implementation_test
Test: Build and boot cuttlefish without the HIDL service
Change-Id: I31dda32ee1758f55d745d00ab06ed890378e5e21
Diffstat (limited to 'libs/ui/Gralloc4.cpp')
| -rw-r--r-- | libs/ui/Gralloc4.cpp | 10 | 
1 files changed, 5 insertions, 5 deletions
diff --git a/libs/ui/Gralloc4.cpp b/libs/ui/Gralloc4.cpp index 1fce31d877..4f950b8c4a 100644 --- a/libs/ui/Gralloc4.cpp +++ b/libs/ui/Gralloc4.cpp @@ -1193,10 +1193,6 @@ std::string Gralloc4Mapper::dumpBuffers(bool less) const {  Gralloc4Allocator::Gralloc4Allocator(const Gralloc4Mapper& mapper) : mMapper(mapper) {      mAllocator = IAllocator::getService(); -    if (mAllocator == nullptr) { -        ALOGW("allocator 4.x is not supported"); -        return; -    }      if (__builtin_available(android 31, *)) {          if (hasIAllocatorAidl()) {              mAidlAllocator = AidlIAllocator::fromBinder(ndk::SpAIBinder( @@ -1204,10 +1200,14 @@ Gralloc4Allocator::Gralloc4Allocator(const Gralloc4Mapper& mapper) : mMapper(map              ALOGE_IF(!mAidlAllocator, "AIDL IAllocator declared but failed to get service");          }      } +    if (mAllocator == nullptr && mAidlAllocator == nullptr) { +        ALOGW("allocator 4.x is not supported"); +        return; +    }  }  bool Gralloc4Allocator::isLoaded() const { -    return mAllocator != nullptr; +    return mAllocator != nullptr || mAidlAllocator != nullptr;  }  std::string Gralloc4Allocator::dumpDebugInfo(bool less) const {  |