diff options
| author | 2024-02-22 12:43:31 -0500 | |
|---|---|---|
| committer | 2024-02-29 12:13:57 -0500 | |
| commit | 9cc60a052019f38f17d09879091539af6cc8c2ad (patch) | |
| tree | 42c4522f6f0633e603ff01d6c3d4a77743b90c1c /libs/androidfw/StringPool.cpp | |
| parent | 230a6ecbae42b84011c584cdbec0f1c4e2e68824 (diff) | |
[Mobile] Create a child scope for mobile view models
MobileIconsViewModel was mistakenly using the @Application scope when
instantiating the child view models that are passed out to the status
bar. Instead, this change creates a child scope of the application scope
and tracks it along in the reuse cache so that the child scopes can be
properly canceled.
There is a discussion to be had about the existing architecture, namely
better ways that this problem could be fixed. We could find a different
way to solve the duplicate log problem (i.e., remove the need for
caching), remove the usage of `stateIn` for the view models, or find a
better place to bind the models to a single scope while in use. All of
these changes are potentially valid, though they would represent a
larger change. For now, creating child scopes should solve the issue at
hand.
Test: MobileIconsViewModelTest
Bug: 325198700
Flag: NONE
Change-Id: I7f2c6a1644620d2e16fb1dc8ad986fa3c6e01bd4
Diffstat (limited to 'libs/androidfw/StringPool.cpp')
0 files changed, 0 insertions, 0 deletions