diff options
author | Paul Keith <javelinanddart@gmail.com> | 2018-10-02 21:43:51 +0200 |
---|---|---|
committer | Paul Keith <javelinanddart@gmail.com> | 2019-01-19 05:24:14 +0100 |
commit | a7d4dff90240873f9321b44e99319cc0a1f028a8 (patch) | |
tree | a4a6504d703a37af39b923e148101e495310ee90 /lineage | |
parent | bd9f127ef84fb62c48a71c7c0baa00b76e62504c (diff) | |
download | lineage-sdk-a7d4dff90240873f9321b44e99319cc0a1f028a8.tar.gz lineage-sdk-a7d4dff90240873f9321b44e99319cc0a1f028a8.tar.bz2 lineage-sdk-a7d4dff90240873f9321b44e99319cc0a1f028a8.zip |
sdk: Split TWILIGHT_ADJUSTMENT_TIME in half
* The difference between civil and actual sun{rise,set}
is 6 degrees of movement of the Sun in its path in
the sky, astronomically speaking
* Since the Sun "travels" at 15 degrees/hr in the sky,
that means the difference between civil and actual sun{rise,set}
is about 24 minutes, temporally speaking
* In order to more closely match that temporal difference,
the TWILIGHT_ADJUSTMENT_TIME should be about 30 minutes
Change-Id: I30a600c71ce5dd01fcb96fb4f5108f45fa493b0c
Diffstat (limited to 'lineage')
-rw-r--r-- | lineage/lib/main/java/org/lineageos/platform/internal/display/ColorTemperatureController.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lineage/lib/main/java/org/lineageos/platform/internal/display/ColorTemperatureController.java b/lineage/lib/main/java/org/lineageos/platform/internal/display/ColorTemperatureController.java index 27b86d9a..40bc681f 100644 --- a/lineage/lib/main/java/org/lineageos/platform/internal/display/ColorTemperatureController.java +++ b/lineage/lib/main/java/org/lineageos/platform/internal/display/ColorTemperatureController.java @@ -62,7 +62,7 @@ public class ColorTemperatureController extends LiveDisplayFeature { private final LineageHardwareManager mHardware; - private static final long TWILIGHT_ADJUSTMENT_TIME = DateUtils.HOUR_IN_MILLIS * 1; + private static final long TWILIGHT_ADJUSTMENT_TIME = DateUtils.HOUR_IN_MILLIS / 2; private static final Uri DISPLAY_TEMPERATURE_DAY = LineageSettings.System.getUriFor(LineageSettings.System.DISPLAY_TEMPERATURE_DAY); @@ -295,21 +295,21 @@ public class ColorTemperatureController extends LiveDisplayFeature { if (sunset < 0 || sunrise < 0 || now < (sunset - TWILIGHT_ADJUSTMENT_TIME) || now > (sunrise + TWILIGHT_ADJUSTMENT_TIME)) { - // More than 1hr after civil sunrise or before civil sunset + // More than 0.5hr after civil sunrise or before civil sunset return 1.0f; } - // Scale the transition into night mode in 1hr before civil sunset + // Scale the transition into night mode in 0.5hr before civil sunset if (now <= sunset) { return (float) (sunset - now) / TWILIGHT_ADJUSTMENT_TIME; } - // Scale the transition into day mode in 1hr after civil sunrise + // Scale the transition into day mode in 0.5hr after civil sunrise if (now >= sunrise) { return (float) (now - sunrise) / TWILIGHT_ADJUSTMENT_TIME; } - // More than 1hr past civil sunset + // More than 0.5hr past civil sunset return 0.0f; } |