aboutsummaryrefslogtreecommitdiff
path: root/bufferinfo/BufferInfoGetter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'bufferinfo/BufferInfoGetter.cpp')
-rw-r--r--bufferinfo/BufferInfoGetter.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/bufferinfo/BufferInfoGetter.cpp b/bufferinfo/BufferInfoGetter.cpp
index 7f7f8ae..c284365 100644
--- a/bufferinfo/BufferInfoGetter.cpp
+++ b/bufferinfo/BufferInfoGetter.cpp
@@ -32,17 +32,17 @@ namespace android {
BufferInfoGetter *BufferInfoGetter::GetInstance() {
static std::unique_ptr<BufferInfoGetter> inst;
- if (inst == nullptr) {
-#if PLATFORM_SDK_VERSION >= 30
+ if (!inst) {
+#if PLATFORM_SDK_VERSION >= 30 && defined(USE_IMAPPER4_METADATA_API)
inst.reset(BufferInfoMapperMetadata::CreateInstance());
- if (inst == nullptr) {
+ if (!inst) {
ALOGW(
"Generic buffer getter is not available. Falling back to legacy...");
+ }
#endif
+ if (!inst) {
inst = LegacyBufferInfoGetter::CreateInstance();
-#if PLATFORM_SDK_VERSION >= 30
}
-#endif
}
return inst.get();