Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit b0e25804 authored by Lucas Silva's avatar Lucas Silva
Browse files

Add support for lazy conditions

Conditions now define a start strategy, which determines how they are
run. START_EAGERLY is how conditions function today, it starts the
condition immediately and doesn't stop it.

START_LAZILY will wait to start the condition until the previous one has
emitted a value which did not short-circuit. For AND operand, this means
the previous condition must have emitted true. For OR operand, it would
be false.

START_WHEN_NEEDED is similar to lazy, but will also cancel the condition
when not needed. This can be used for expensive conditions, such as the
low light condition, since it keeps the lowlight sensor on.

Bug: 278875229
Test: atest CombinedConditionTest
Change-Id: Ie81f74357f1d37c771fa91d097fef85ab11fa604
parent 3a2bda18
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment