Improve docs of PerDisplayRepository Bug: 362719719 Bug: 398011576 Test: NONE - just docs Flag: com.android.systemui.shade_window_goes_around Change-Id: I6d06eccc80aa24a8834c13cdba862f02a274d54f
diff --git a/packages/SystemUI/src/com/android/systemui/display/data/repository/PerDisplayRepository.kt b/packages/SystemUI/src/com/android/systemui/display/data/repository/PerDisplayRepository.kt index adf8490..d27e33e 100644 --- a/packages/SystemUI/src/com/android/systemui/display/data/repository/PerDisplayRepository.kt +++ b/packages/SystemUI/src/com/android/systemui/display/data/repository/PerDisplayRepository.kt
@@ -184,8 +184,13 @@ * Provides an instance of a given class **only** for the default display, even if asked for another * display. * - * This is useful in case of flag refactors: it can be provided instead of an instance of + * This is useful in case of **flag refactors**: it can be provided instead of an instance of * [PerDisplayInstanceRepositoryImpl] when a flag related to multi display refactoring is off. + * + * Note that this still requires all instances to be provided by a [PerDisplayInstanceProvider]. If + * you want to provide an existing instance instead for the default display, either implement it in + * a custom [PerDisplayInstanceProvider] (e.g. inject it in the constructor and return it if the + * displayId is zero), or use [SingleInstanceRepositoryImpl]. */ class DefaultDisplayOnlyInstanceRepositoryImpl<T>( override val debugName: String, @@ -200,11 +205,12 @@ } /** - * Always returns only one instance. + * Always returns [instance] for any display. * * This can be used to provide a single instance based on a flag value during a refactor. Similar to * [DefaultDisplayOnlyInstanceRepositoryImpl], but also avoids creating the - * [PerDisplayInstanceProvider]. + * [PerDisplayInstanceProvider]. This is useful when you want to provide an existing instance only, + * without even instantiating a [PerDisplayInstanceProvider]. */ class SingleInstanceRepositoryImpl<T>(override val debugName: String, private val instance: T) : PerDisplayRepository<T> {