Keep legacy suppressed-effect Policy fields in MODES_UI

NMS calculates a set of suppressed visual effects based on the supplied Policy, the current Policy, and the targetSdk of the caller. That result can include a mix of "legacy" (pre-API-28) and "new" (post-API-28) effects. However, legacy effect cannot be stored in a ZenPolicy, which is what MODES_UI uses for the manual rule. Therefore, we store them in a different attribute and restore them on read, keeping the same behavior as pre-MODES_UI.

Note that this behavior, while unchanged, is still a bit inconsistent overall. For example, these legacy effects are not preserved in the consolidated policy (but always recalculated from the new ones).

Bug: 356334282
Test: atest ZenModeHelperTest ZenModeConfigTest NotificationManagerZenTest CtsLegacyNotification27TestCases
Flag: android.app.modes_ui

Change-Id: Iad1444ee2c3d69dedd24c14cafc7ff86783c2f07
4 files changed