summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--services/surfaceflinger/LayerBlur.cpp9
-rw-r--r--services/surfaceflinger/LayerBlur.h1
2 files changed, 9 insertions, 1 deletions
diff --git a/services/surfaceflinger/LayerBlur.cpp b/services/surfaceflinger/LayerBlur.cpp
index a49ff39..93f548f 100644
--- a/services/surfaceflinger/LayerBlur.cpp
+++ b/services/surfaceflinger/LayerBlur.cpp
@@ -404,6 +404,7 @@ void LayerBlur::ensureFbo(FBO& fbo, int width, int height, int textureName) {
// ---------------------------------------------------------------------------
void* LayerBlur::BlurImpl::sLibHandle = NULL;
+bool LayerBlur::BlurImpl::sUnsupported = false;
LayerBlur::BlurImpl::initBlurTokenFn LayerBlur::BlurImpl::initBlurToken = NULL;
LayerBlur::BlurImpl::releaseBlurTokenFn LayerBlur::BlurImpl::releaseBlurToken = NULL;
@@ -421,8 +422,13 @@ status_t LayerBlur::BlurImpl::initBlurImpl() {
if (sLibHandle != NULL) {
return OK;
}
+ if (sUnsupported) {
+ return NO_INIT;
+ }
+
sLibHandle = dlopen("libuiblur.so", RTLD_NOW);
if (sLibHandle == NULL) {
+ sUnsupported = true;
return NO_INIT;
}
@@ -444,13 +450,14 @@ status_t LayerBlur::BlurImpl::initBlurImpl() {
if (!initBlurToken || !releaseBlurToken || !doBlur) {
ALOGE("dlsym failed for blur impl!: %s", dlerror());
closeBlurImpl();
+ sUnsupported = true;
return NO_INIT;
}
return OK;
}
-LayerBlur::BlurImpl::BlurImpl() {
+LayerBlur::BlurImpl::BlurImpl() : mToken(NULL) {
Mutex::Autolock _l(sLock);
if (initBlurImpl() == OK) {
mToken = initBlurToken();
diff --git a/services/surfaceflinger/LayerBlur.h b/services/surfaceflinger/LayerBlur.h
index 63138c4..bd37ad3 100644
--- a/services/surfaceflinger/LayerBlur.h
+++ b/services/surfaceflinger/LayerBlur.h
@@ -68,6 +68,7 @@ private:
static status_t initBlurImpl();
static void closeBlurImpl();
static void* sLibHandle;
+ static bool sUnsupported;
typedef void* (*initBlurTokenFn)();
typedef void* (*releaseBlurTokenFn)(void*);