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
Loading
Please register or sign in to comment