Commit Graph

19 Commits

Author SHA1 Message Date
Danny Baumann fceb077b6f Don't unboundedly enqueue transition messages.
As long as the light sensor is providing values, each value change will
enqueue a transition message, which may queue up. Stop doing that and
ensure only one transition message is queued at any given time.

Change-Id: I6e9c5b265066089ff9e0cea7237c2023ed1af30c
2016-09-12 07:31:07 -07:00
Danny Baumann c0dd46d30f Introduce a hysteresis for outdoor condition determination.
Avoids flicker when brightness is around the threshold.

Change-Id: I8658725450496b89123abb26b6ef8ce333c709e5
2016-08-09 15:14:01 -07:00
Steve Kondik 87590f0b1e cmsdk/livedisplay: Add support for picture adjustment
* Allows adjustment of hue, saturation, intensity, and contrast.

Change-Id: Icf8ff6200a07b68e09dcd7f140a82e57b53944f7
2016-08-08 12:41:27 -07:00
Steve Kondik 7bf7c4b72e cmsdk: Allow services to conditionally start before decryption
* Essentially everything in CMSDK should remain silent when we
   are being prompted to enter a passcode for decrypting the
   device. Unfortunately, simply shutting off CMSDK entirely
   will cause crashes everywhere. We need to be somewhat
   selective about it.
 * Motivation for this was LiveDisplay kicking into night mode before
   decrypted due to location services failing.

Change-Id: I4d745debb2894776258343e8696ce5144f094404
2016-08-01 12:19:11 -07:00
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
Diogo Ferreira 19de84cd1b cmsdk: LiveDisplay: Enforce dump permission
Fixes android.security.cts.ServicePermissionsTest#testDumpProtected.

Change-Id: I5641b42c56d9783b1edb8fb397d51040cadb1467
2016-06-07 10:55:45 -07:00
Adnan Begovic b51572d697 cmsdk: Create CMSystemServer to handle our platform init.
Change-Id: I7b62978e2a284a3a1ec1ffc1d8c72545d7b0c939
2016-05-31 17:28:48 -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 35315d3c0f cmsdk: Fix crash when getting LiveDisplay config
* If capabilities is empty, BitSet.toLongArray returns an empty array.

Change-Id: I17476438995b581050feda346d0348228519ff44
2016-04-26 01:17:30 -07:00
Ethan Chen c68b38ac3a livedisplay: Connect display modes to CMHW
REF: CRACKLING-1069
Change-Id: I5be5cabf316d9bd02ab4ffc169d458ab8d1b46d4
2016-04-25 17:44:53 -07:00
Steve Kondik e41c2924cb livedisplay: Fix three bugs
* Fix issue with color adjustments not being applied at bootup.
 * Fix issue where hardware was always updated twice.
 * Check the display state inside the color animator- this was
   occasionally racing and triggering kernel bugs on some devices.

Change-Id: Ieb9845e6b0f1c7ca979cbfa35c0b9b688ef1a8cf
2016-04-24 01:43:55 -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
Adnan Begovic 18aa2f52eb cmsdk: Fix definition of live display tile, as its now dynamic.
Change-Id: I468e42b91996aad348fa0a1c85e0bc66597cf440
2016-04-18 12:27:47 -07:00
Danny Baumann 842344a358 livedisplay: Fix endless loop for devices that don't support outdoor
mode.

There was a logic mistake that caused _all_ modes to be skipped if
outdoor mode isn't supported. In order to avoid such mistakes in the
future, also simplify the logic and make it more easily understandable.

Change-Id: I5fe8edbb3c4d2dd05fc4b4a7f94ca05d4ecd408b
2016-04-15 12:48:07 +02: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 0ec60c69a0 livedisplay: Don't explode if no modes are available
* Don't create the mode observer or try to publish tiles if none
   of the adaptive modes are supported.

Change-Id: Iee6fe8131b0614e10f35b5a03d65fb44c71c0da9
2016-04-15 02:38:42 -07:00
Steve Kondik 712426f249 livedisplay: Publish our own damn tile!
Change-Id: If765cb1fe1cbc34c857dc6237cd25a1fb27f848e
2016-04-14 20:35:15 -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