diff options
author | TreeHugger Robot | 2017-07-21 01:42:49 -0500 |
---|---|---|
committer | Android (Google) Code Review | 2017-07-21 01:42:49 -0500 |
commit | 3eba4064efec313dd619e51c4f32cd40d8758d63 (patch) | |
tree | 4ca87bd17fc1088b42346679faeb90de77887c4a /services/surfaceflinger | |
parent | f9b05eeb5f3b3ea92ea196f37a53df06b535690c (diff) | |
parent | 11d63f4b7d99cc09ff1f8c320bb7a8648ca07fa1 (diff) | |
download | frameworks-native-3eba4064efec313dd619e51c4f32cd40d8758d63.tar.gz frameworks-native-3eba4064efec313dd619e51c4f32cd40d8758d63.tar.xz frameworks-native-3eba4064efec313dd619e51c4f32cd40d8758d63.zip |
Merge "Properly applies the selected saturation boost (vivid mode)" into oc-dr1-dev
Diffstat (limited to 'services/surfaceflinger')
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 19 | ||||
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.h | 5 |
2 files changed, 22 insertions, 2 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index e137a784d..d30f2e24d 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp | |||
@@ -227,8 +227,10 @@ SurfaceFlinger::SurfaceFlinger() | |||
227 | mLayerTripleBufferingDisabled = atoi(value); | 227 | mLayerTripleBufferingDisabled = atoi(value); |
228 | ALOGI_IF(mLayerTripleBufferingDisabled, "Disabling Triple Buffering"); | 228 | ALOGI_IF(mLayerTripleBufferingDisabled, "Disabling Triple Buffering"); |
229 | 229 | ||
230 | property_get("persist.sys.sf.color_saturation", value, "1.0"); | 230 | // We should be reading 'persist.sys.sf.color_saturation' here |
231 | mSaturation = atof(value); | 231 | // but since /data may be encrypted, we need to wait until after vold |
232 | // comes online to attempt to read the property. The property is | ||
233 | // instead read after the boot animation | ||
232 | } | 234 | } |
233 | 235 | ||
234 | void SurfaceFlinger::onFirstRef() | 236 | void SurfaceFlinger::onFirstRef() |
@@ -373,6 +375,11 @@ void SurfaceFlinger::bootFinished() | |||
373 | const int LOGTAG_SF_STOP_BOOTANIM = 60110; | 375 | const int LOGTAG_SF_STOP_BOOTANIM = 60110; |
374 | LOG_EVENT_LONG(LOGTAG_SF_STOP_BOOTANIM, | 376 | LOG_EVENT_LONG(LOGTAG_SF_STOP_BOOTANIM, |
375 | ns2ms(systemTime(SYSTEM_TIME_MONOTONIC))); | 377 | ns2ms(systemTime(SYSTEM_TIME_MONOTONIC))); |
378 | |||
379 | sp<LambdaMessage> readProperties = new LambdaMessage([&]() { | ||
380 | readPersistentProperties(); | ||
381 | }); | ||
382 | postMessageAsync(readProperties); | ||
376 | } | 383 | } |
377 | 384 | ||
378 | void SurfaceFlinger::deleteTextureAsync(uint32_t texture) { | 385 | void SurfaceFlinger::deleteTextureAsync(uint32_t texture) { |
@@ -631,6 +638,14 @@ void SurfaceFlinger::init() { | |||
631 | ALOGV("Done initializing"); | 638 | ALOGV("Done initializing"); |
632 | } | 639 | } |
633 | 640 | ||
641 | void SurfaceFlinger::readPersistentProperties() { | ||
642 | char value[PROPERTY_VALUE_MAX]; | ||
643 | |||
644 | property_get("persist.sys.sf.color_saturation", value, "1.0"); | ||
645 | mSaturation = atof(value); | ||
646 | ALOGV("Saturation is set to %.2f", mSaturation); | ||
647 | } | ||
648 | |||
634 | void SurfaceFlinger::startBootAnim() { | 649 | void SurfaceFlinger::startBootAnim() { |
635 | // Start boot animation service by setting a property mailbox | 650 | // Start boot animation service by setting a property mailbox |
636 | // if property setting thread is already running, Start() will be just a NOP | 651 | // 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 dfdc424c9..48bbd13b5 100644 --- a/services/surfaceflinger/SurfaceFlinger.h +++ b/services/surfaceflinger/SurfaceFlinger.h | |||
@@ -436,6 +436,11 @@ private: | |||
436 | sp<StartPropertySetThread> mStartPropertySetThread = nullptr; | 436 | sp<StartPropertySetThread> mStartPropertySetThread = nullptr; |
437 | 437 | ||
438 | /* ------------------------------------------------------------------------ | 438 | /* ------------------------------------------------------------------------ |
439 | * Properties | ||
440 | */ | ||
441 | void readPersistentProperties(); | ||
442 | |||
443 | /* ------------------------------------------------------------------------ | ||
439 | * EGL | 444 | * EGL |
440 | */ | 445 | */ |
441 | size_t getMaxTextureSize() const; | 446 | size_t getMaxTextureSize() const; |