hwc: Apply Default Mode only after Bootanimation is really completed
Property "service.bootanim.exit" was read before applying Default
Mode. This property is set in SurfaceFlinger when boot finish is
triggered which is happening before Bootanimation is completed
which results into some of the Bootanimation frames with default
mode settings.
Replace this property with "init.svc.bootanim" which is checked to
be "stopped" before applying default mode. This results into first
frame of homescreen to be with default mode settings.
CRs-Fixed: 805499
Change-Id: I23298a8c61b9a5bda239839d9f8ca9ecc3a6ab59
diff --git a/libhwcomposer/hwc_utils.cpp b/libhwcomposer/hwc_utils.cpp
index 27243c4..a3cb196 100644
--- a/libhwcomposer/hwc_utils.cpp
+++ b/libhwcomposer/hwc_utils.cpp
@@ -2700,32 +2700,31 @@
void processBootAnimCompleted(hwc_context_t *ctx) {
char value[PROPERTY_VALUE_MAX];
- int boot_finished = 0, ret = -1;
+ int ret = -1;
int (*applyMode)(int) = NULL;
void *modeHandle = NULL;
- // Reading property set on boot finish in SF
- property_get("service.bootanim.exit", value, "0");
- boot_finished = atoi(value);
- if (!boot_finished)
- return;
+ // Applying default mode after bootanimation is finished
+ property_get("init.svc.bootanim", value, "running");
- modeHandle = dlopen("libmm-qdcm.so", RTLD_NOW);
- if (modeHandle) {
- *(void **)&applyMode = dlsym(modeHandle, "applyDefaults");
- if (applyMode) {
- ret = applyMode(HWC_DISPLAY_PRIMARY);
- if (ret)
- ALOGD("%s: Not able to apply default mode", __FUNCTION__);
+ if (!strncmp(value,"stopped",strlen("stopped"))) {
+ modeHandle = dlopen("libmm-qdcm.so", RTLD_NOW);
+ if (modeHandle) {
+ *(void **)&applyMode = dlsym(modeHandle, "applyDefaults");
+ if (applyMode) {
+ ret = applyMode(HWC_DISPLAY_PRIMARY);
+ if (ret)
+ ALOGD("%s: Not able to apply default mode", __FUNCTION__);
+ } else {
+ ALOGE("%s: No symbol applyDefaults found", __FUNCTION__);
+ }
+ dlclose(modeHandle);
} else {
- ALOGE("%s: No symbol applyDefaults found", __FUNCTION__);
+ ALOGE("%s: Not able to load libmm-qdcm.so", __FUNCTION__);
}
- dlclose(modeHandle);
- } else {
- ALOGE("%s: Not able to load libmm-qdcm.so", __FUNCTION__);
- }
- ctx->mBootAnimCompleted = true;
+ ctx->mBootAnimCompleted = true;
+ }
}
void BwcPM::setBwc(const hwc_context_t *ctx, const int& dpy,