Commit Graph

6 Commits

Author SHA1 Message Date
Steve Kondik 86cae92291 livedisplay: Add support for direct color balance control
* We currently use the DisplayColorCalibration API for setting display
   temperature which makes a lot of guesses about what temperature
   the display really is. Some devices will support the new ColorBalance
   API (via QDCM or other mechanism), which offers a calibrated
   alternative. Add support for this, which will supercede DCC if
   available.
 * Additionally, define the available color temperature range as a
   set of overlayable values so this can be specified per-device.
   This range will be mapped to balance values using the power curve
   calculations in the new MathUtils class.

Change-Id: I99608c09807b747d962680293c7b0cee8d669003
2016-07-20 10:07:31 -07:00
Steve Kondik 153bd2287c livedisplay: Fix another transition issue
* If the screen is off during the entire transition period,
   when we turn the display back on it is not updated with
   the correct color temperature.
 * The code here is trying to be Mr. Smarty Pants and avoid
   extra updates, but it's totally pointless and also broken.
   There's no ill effects from writing to the hardware when
   the screen comes on, and updateColorTemperature already
   has all the other conditionals we need.
 * Just call updateColorTemperature every time, regardless.
   The LiveDisplayService ensures the callbacks run on the
   handler thread and all this crap can be removed.

Change-Id: Ib9560e13870a5c6bbe9c5a26fad40f5ec1cefa83
2016-04-26 22:36:52 -07:00
Steve Kondik 7a4fed9640 livedisplay: Always check for transition
* If the device is started in the middle of a transition period,
   the transition would not occur. Always check for this condition
   instead of only firing it when TwilightService updates.

Change-Id: Ibe6cfa69506ffc6a9bf6390ee7e13863f275ec2a
2016-04-21 20:45:32 -07:00
Steve Kondik b00c945e35 livedisplay: Bugfixes and cleanups
* Simplify the code and callback mechanisms
 * Fix bug where settings weren't applied at startup
 * Make stuff immutable where possible
 * Corrected the sunrise calculation to start on time
 * Fix issue where tile state could become out of sync
 * Don't spam the hardware on screen on/off
 * Stop trying to cache values in so many places, they get out of sync
   too easily.
 * Move the animator to the general display adjustments
 * Clean up outdoor mode state on screen toggle

Change-Id: Ic14425e5294d78698b9280dfb1237b222bb706cc
2016-04-21 00:26:40 -07:00
Steve Kondik 7cd7f79c75 livedisplay: Fix bad state after bootup
* Make sure all modules are updated, and clean up a little code.

Change-Id: Id02ddb1558deea4451783fbe27f495d63f63c910
2016-04-15 03:15:28 -07:00
Steve Kondik 1dab5a0ca9 cmsdk: Refactoring LiveDisplay
* Moving LiveDisplay to CMSDK!
 * Completely redesigned the feature for future expansion.
 * No new features in this patch, but a proper API is being
   designed.

Change-Id: Ic8f55678f9141bf3386b2a1cf2fd1e8b3916c278
2016-04-13 01:37:08 -07:00