summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Romain Guy <romainguy@google.com> 2017-07-20 12:47:14 -0700
committer Romain Guy <romainguy@google.com> 2017-07-20 23:55:50 +0000
commit11d63f4b7d99cc09ff1f8c320bb7a8648ca07fa1 (patch)
tree4ed492af52eb2ea31b5ab8ab4027c96bfae1bbee
parent53e5aa93fa2855616b9691c5e1878f1db1464ace (diff)
Properly applies the selected saturation boost (vivid mode)
The saturation boost setting is read by SurfaceFlinger as a persistent system property. Unfortunately, persistent props are only available after Vold is up and /data is decrypted, which may happen before or after SF attempts to read the property. This CL moves the propery lookup to the end of the boot animation. This solves two issues: - The saturation boost will not be applied to the boot animation - The vivid colors user setting is now reliably applied Bug: 63823274 Test: Manual Change-Id: Icb8e30c799c30cf674f0fc0bab0369f4c99367ed
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp19
-rw-r--r--services/surfaceflinger/SurfaceFlinger.h5
2 files changed, 22 insertions, 2 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index bd2441f6b1..474db47c23 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -227,8 +227,10 @@ SurfaceFlinger::SurfaceFlinger()
mLayerTripleBufferingDisabled = atoi(value);
ALOGI_IF(mLayerTripleBufferingDisabled, "Disabling Triple Buffering");
- property_get("persist.sys.sf.color_saturation", value, "1.0");
- mSaturation = atof(value);
+ // We should be reading 'persist.sys.sf.color_saturation' here
+ // but since /data may be encrypted, we need to wait until after vold
+ // comes online to attempt to read the property. The property is
+ // instead read after the boot animation
}
void SurfaceFlinger::onFirstRef()
@@ -373,6 +375,11 @@ void SurfaceFlinger::bootFinished()
const int LOGTAG_SF_STOP_BOOTANIM = 60110;
LOG_EVENT_LONG(LOGTAG_SF_STOP_BOOTANIM,
ns2ms(systemTime(SYSTEM_TIME_MONOTONIC)));
+
+ sp<LambdaMessage> readProperties = new LambdaMessage([&]() {
+ readPersistentProperties();
+ });
+ postMessageAsync(readProperties);
}
void SurfaceFlinger::deleteTextureAsync(uint32_t texture) {
@@ -630,6 +637,14 @@ void SurfaceFlinger::init() {
ALOGV("Done initializing");
}
+void SurfaceFlinger::readPersistentProperties() {
+ char value[PROPERTY_VALUE_MAX];
+
+ property_get("persist.sys.sf.color_saturation", value, "1.0");
+ mSaturation = atof(value);
+ ALOGV("Saturation is set to %.2f", mSaturation);
+}
+
void SurfaceFlinger::startBootAnim() {
// Start boot animation service by setting a property mailbox
// if property setting thread is already running, Start() will be just a NOP
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index 53c3823ce3..e00b3d1a18 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -437,6 +437,11 @@ private:
sp<StartBootAnimThread> mStartBootAnimThread = nullptr;
/* ------------------------------------------------------------------------
+ * Properties
+ */
+ void readPersistentProperties();
+
+ /* ------------------------------------------------------------------------
* EGL
*/
size_t getMaxTextureSize() const;