[CS] 2/N: Define WallpaperRepository.wallpaperSupportsAmbientMode.
This will replace CentralSurfacesImpl.mWallpaperChangedReceiver. This CL moves ScrimController to the new repo; other controllers will be moved in future CLs. Reasoning around NoopWallpaperRepository: Previously, CentralSurfacesImpl was the only class calling ScrimController.setWallpaperSupportsAmbientMode. CentralSurfacesImpl is only included in AOSP SysUI and SysUIGo. So, the new WallpaperRepository should also only be enabled for AOSP SysUI and SysUIGo. However, ScrimController is included in *more* than just those two variants. NoopWallpaperRepository should be used for those variants to ensure that they can still use ScrimController and also still *not* pay attention to wallpaper changes. Bug: 277762009 Bug: 277764509 Test: manual: verify via logging that WallpaperRepository re-calcuates supportsAmbientMode at the same pace as CentralSurfacesImpl with the same values. Specifically verify the value is re-calcuated whenever the wallpaper is changed or the user is switched. Test: manual: switch users *without first switching the wallpaper* and verify via logging that the repository re-fetches supportsAmbientMode. (This specifically tests that the `wallpaperChanged` flow uses `.onStart { emit(Unit) }`, which was missing in the first iteration of this CL.) Test: atest WallpaperRepositoryImplTest ScrimControllerTest Change-Id: Icb69f842c52c19d89857218d07077ad90d83c1e6 Merged-In: Icb69f842c52c19d89857218d07077ad90d83c1e6
Loading
Please register or sign in to comment