summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTheScarastic <warabhishek@gmail.com>2019-06-01 12:06:59 +0530
committerBruno Martins <bgcngm@gmail.com>2019-06-01 12:00:01 +0200
commitfd1713f0bae7db27d2341ac010c8393cc7f8d643 (patch)
tree0d52f76dea175b7252f1f3a38f8e12cbeb68625f
parentd84525d3e7a5f4ccf3833d9bc62a1681843b7c8b (diff)
downloadhardware_lineage_livedisplay-lineage-16.0.tar.gz
hardware_lineage_livedisplay-lineage-16.0.tar.bz2
hardware_lineage_livedisplay-lineage-16.0.zip
sdm: Fix restoring default mode when using prebuilt vendorlineage-17.0lineage-16.0
This conditionally reverts d84525d3e7a5f4ccf3833d9bc62a1681843b7c8b for devices that build system variant of livedisplay hal since most OEM's set vendor.display.enable_default_color_mode=0 in vendor causing livedisplay modes to reset on boot. Change-Id: I37c56c79c7792932ddf4ca38d12d3b0e82ea8194
-rw-r--r--sdm/DisplayModes.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/sdm/DisplayModes.cpp b/sdm/DisplayModes.cpp
index 0cc900d..ac9c8d9 100644
--- a/sdm/DisplayModes.cpp
+++ b/sdm/DisplayModes.cpp
@@ -51,6 +51,15 @@ DisplayModes::DisplayModes(void* libHandle, uint64_t cookie) {
disp_api_set_default_display_mode =
reinterpret_cast<int32_t (*)(uint64_t, uint32_t, int32_t, uint32_t)>(
dlsym(mLibHandle, "disp_api_set_default_display_mode"));
+
+#ifdef LIVES_IN_SYSTEM
+ if (isSupported()) {
+ DisplayMode mode = getDefaultDisplayModeInternal();
+ if (mode.id >= 0) {
+ setDisplayMode(mode.id, false);
+ }
+ }
+#endif
}
bool DisplayModes::isSupported() {