diff options
| author | 2024-08-20 15:01:21 -0700 | |
|---|---|---|
| committer | 2024-08-21 11:06:05 -0700 | |
| commit | c13087d5c71a0d84818e892ad090f8e7e00907e7 (patch) | |
| tree | cb323cfb4084b13924c0f24792ca939b238bc098 | |
| parent | 4241d874d38022f15344a333cd7cfb463fd83cba (diff) | |
Adds some missing doc
Bug: 354269846
Test: N/A this is only docs
Flag: NONE this is only docs
Change-Id: Ie74543bdc67e7e7b2a8b45b0e85af61bb7fbb9c7
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/lifecycle/SysUiViewModel.kt | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/lifecycle/SysUiViewModel.kt b/packages/SystemUI/src/com/android/systemui/lifecycle/SysUiViewModel.kt index 32c476093774..979eaef30a23 100644 --- a/packages/SystemUI/src/com/android/systemui/lifecycle/SysUiViewModel.kt +++ b/packages/SystemUI/src/com/android/systemui/lifecycle/SysUiViewModel.kt @@ -30,6 +30,12 @@ import kotlinx.coroutines.launch /** Base class for all System UI view-models. */ abstract class SysUiViewModel : BaseActivatable() { + /** + * Returns a snapshot [State] that's kept up-to-date as long as the [SysUiViewModel] is active. + * + * @param source The upstream [StateFlow] to collect from; values emitted to it will be + * automatically set on the returned [State]. + */ @StateFactoryMarker fun <T> hydratedStateOf( source: StateFlow<T>, @@ -40,6 +46,13 @@ abstract class SysUiViewModel : BaseActivatable() { ) } + /** + * Returns a snapshot [State] that's kept up-to-date as long as the [SysUiViewModel] is active. + * + * @param initialValue The first value to place on the [State] + * @param source The upstream [Flow] to collect from; values emitted to it will be automatically + * set on the returned [State]. + */ @StateFactoryMarker fun <T> hydratedStateOf( initialValue: T, |