From 5d5abd863e8758447eb7e68baff022df1332b3cf Mon Sep 17 00:00:00 2001 From: Michael Bestas Date: Sat, 23 Mar 2019 17:28:22 +0200 Subject: recovery: Blank screen on init * Fixes touch on some devices like chiron/sagit * Some other devices (e.g. most MTK) need this because their kernel driver implementations do not perform as expected (initial unblank is only happening when altering the panel brightness x -> 0 -> y). In regular Android, that "unblanking" is done on boot when the lights HAL loads and sets the initial brightness. Change-Id: I2fffac508d09d07355a7a7f087805b0dceb5f97e --- Android.mk | 4 ++++ screen_ui.cpp | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/Android.mk b/Android.mk index 5b3a2578..173f0b16 100644 --- a/Android.mk +++ b/Android.mk @@ -148,6 +148,10 @@ else LOCAL_CFLAGS += -DRECOVERY_UI_VR_STEREO_OFFSET=0 endif +ifeq ($(TARGET_RECOVERY_UI_BLANK_UNBLANK_ON_INIT),true) +LOCAL_CFLAGS += -DRECOVERY_UI_BLANK_UNBLANK_ON_INIT +endif + ifneq ($(TARGET_RECOVERY_BACKLIGHT_PATH),) LOCAL_CFLAGS += -DBACKLIGHT_PATH=\"$(TARGET_RECOVERY_BACKLIGHT_PATH)\" else diff --git a/screen_ui.cpp b/screen_ui.cpp index d763343b..4fd11831 100644 --- a/screen_ui.cpp +++ b/screen_ui.cpp @@ -873,6 +873,11 @@ bool ScreenRecoveryUI::Init(const std::string& locale) { return false; } +#ifdef RECOVERY_UI_BLANK_UNBLANK_ON_INIT + gr_fb_blank(true); + gr_fb_blank(false); +#endif + // Are we portrait or landscape? layout_ = (gr_fb_width() > gr_fb_height()) ? LANDSCAPE : PORTRAIT; // Are we the large variant of our base layout? -- cgit v1.2.3