summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTommy Chiu <tommychiu@google.com>2019-01-02 23:43:15 -0800
committerandroid-build-merger <android-build-merger@google.com>2019-01-02 23:43:15 -0800
commit857088b39d7cfe3158e49840093b41e35df84df4 (patch)
tree335d69511dfe5c0d321649116dfa2327b942ac82
parent0ef969cbefc8c61b1dd0fa0a9adf2eee9d2720d3 (diff)
parent6ab7f067c31adbf1300add2e3c1a949917589d7d (diff)
downloaddisplay-857088b39d7cfe3158e49840093b41e35df84df4.tar.gz
hwc2: Ignore Notify to non-existance file node
am: 6ab7f067c3 Change-Id: Idcdc3e2c7421d3a56b887ad6cf433704bf81b7cc
-rw-r--r--sdm/libs/hwc2/hwc_display_primary.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/sdm/libs/hwc2/hwc_display_primary.cpp b/sdm/libs/hwc2/hwc_display_primary.cpp
index b1eeecdf..6eaf11db 100644
--- a/sdm/libs/hwc2/hwc_display_primary.cpp
+++ b/sdm/libs/hwc2/hwc_display_primary.cpp
@@ -73,6 +73,10 @@ void HWCDisplayPrimary::PMICInterface::Deinit() {
DisplayError HWCDisplayPrimary::PMICInterface::Notify(bool secure_display_start) {
std::string str_sd_start = secure_display_start ? std::to_string(1) : std::to_string(0);
+ if (fd_lcd_bias_ < 0 || fd_wled_ < 0) {
+ DLOGI("Ignore notify because fd_lcd_bias_ or fd_wled_ open failed");
+ return kErrorNotSupported;
+ }
ssize_t err = ::pwrite(fd_lcd_bias_, str_sd_start.c_str(), str_sd_start.length(), 0);
if (err <= 0) {
DLOGE("Write failed for lcd_bias, Error = %s", strerror(errno));