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

Skip to content
Commit 38de1a3f authored by Matías Hernández's avatar Matías Hernández
Browse files

Fix reading of ZenModeConfig.manualRule in MODES_UI transition

Presence of the manualRule on pre-modes_ui xml meant that DND was active, thus to preserve this state when upgrading to modes_ui we must set a condition with STATE_TRUE. This conversion already existed, but it had an issue -- if the rule didn't have a conditionId set (very likely, since only DND-with-a-timeout adds one) then the result of the conversion would be a rule with _null_ conditionId but a condition with _empty_ id. This mismatch caused the isValidConfig() check to fail, thus discarding the previous configuration altogether!

This issue manifested as "rules are gone on flag flip" (although this wouldn't be noticeable if only "default" rules, like the built-in ones or Bedtime, were the only ones present). It also resulted in DND turning off.

Fixes: 369678857
Test: atest ZenModeConfigTest
Flag: android.app.modes_ui
Change-Id: I2787e8593b5305bfbe07681c5d0b5e19a3c12ed0
parent 6f273d49
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment