Merge NotificationsSoundPolicyRepository and ZenModeRepository
These were essentially doing the same thing in slightly different ways. NotificationsSoundPolicyRepository is the one we're keeping under a new name: it uses BroadcastReceiver to listen for policy changes. Meanwhile, the other ZenModeRepository was using ZenModeController, which in turn uses ContentObserver to listen for changes. In the long run, we want to replace the callback-based ZenModeController with flows, so this is one step towards that goal. Note that the notificationPolicy flow in the old NotificationSoundPolicyRepository was actually returning the consolidatedNotificationPolicy. To make it more explicit, I included both in the new repository, but changed the existing users of notificationPolicy to use consolidatedNotificationPolicy to avoid a behavior change. Also replaced the ZenMode class with a simple int to avoid confusion with the ZenMode class we're introducing from settings in a follow-up CL. The only thing it was doing was validation, but that's not strictly necessary since every consumer of this value (aka the interactors) has to decide what to do with an "unknown" value anyway. Bug: 308591859 Bug: 346519570 Test: ZenModeRepositoryTest Flag: android.app.modes_api Flag: com.android.systemui.new_volume_panel Flag: com.android.systemui.notifications_footer_view_refactor Change-Id: Ie02480dec05055ad3d7c24bd16c76f91bc64c58c
Loading
Please register or sign in to comment