summaryrefslogtreecommitdiff
path: root/libhwc2.1/pixel-display.cpp
diff options
context:
space:
mode:
authorlinpeter <linpeter@google.com>2021-11-18 20:23:08 +0800
committerlinpeter <linpeter@google.com>2021-12-02 17:01:36 +0800
commiteeedc139da32923d4f19a28a827ef4b6da3fb80c (patch)
treebc9d14f055351eaa3e7c36ac53d307d56fbaf226 /libhwc2.1/pixel-display.cpp
parent1affb13728781d6cb71046ce84a4584e3ad9fd9e (diff)
libhwc2.1: add calibrated display check
Return ALS shadow compensation images if calibrated display. Bug: 186057327 test: check ALS shadow compensation images return Change-Id: I6c29ac46cb862db095bc9e9ad3ea173cab6c6a19
Diffstat (limited to 'libhwc2.1/pixel-display.cpp')
-rw-r--r--libhwc2.1/pixel-display.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/libhwc2.1/pixel-display.cpp b/libhwc2.1/pixel-display.cpp
index b6d0eb3..4f5f07d 100644
--- a/libhwc2.1/pixel-display.cpp
+++ b/libhwc2.1/pixel-display.cpp
@@ -137,7 +137,11 @@ ndk::ScopedAStatus Display::getLhbmState(bool *_aidl_return) {
ndk::ScopedAStatus Display::setCompensationImageHandle(const NativeHandle &native_handle,
const std::string &imageName,
int *_aidl_return) {
- *_aidl_return = readCompensationImage(native_handle, imageName);
+ if (mDevice && mDevice->isColorCalibratedByDevice()) {
+ *_aidl_return = readCompensationImage(native_handle, imageName);
+ } else {
+ *_aidl_return = -1;
+ }
return ndk::ScopedAStatus::ok();
}
} // namespace display