summaryrefslogtreecommitdiff
path: root/src/com/android/customization/picker/clock/ui/fragment/ClockCustomDemoFragment.kt
diff options
context:
space:
mode:
authorAustin Wang <wangaustin@google.com>2023-06-02 17:33:05 -0700
committerAustin Wang <wangaustin@google.com>2023-06-07 23:04:19 +0000
commitac7d7a07e95e6235843da8e7e1d4c4e1dd868b1c (patch)
tree5f8f87d8093c7a8993c7541ed71d49dfbc4a56e9 /src/com/android/customization/picker/clock/ui/fragment/ClockCustomDemoFragment.kt
parentc424efb6754b7755fb47ca927100c2630d9ac907 (diff)
downloadThemePicker-ac7d7a07e95e6235843da8e7e1d4c4e1dd868b1c.tar.gz
Fixed leak and no clock carousel (1/3)
Previously, ClockRegistry is bond to activity lifecycle and it's not stable with unregister call followed by register in a short period of time. Remove the register/unregister ClockRegistry from ClockRegistryProvider (used in activity), and move to app level singleton. Register ClockRegistry listeners when app started and cleaned up when app ended. Bug: 285348630 Bug: 285321790 Test: resume/destroy WPP then launch LS tab Test: rotate foldable inner screen Test: run profiler check no related leaks Change-Id: I5b9d8eba17b3164a3da5f81058c5c6c90f6a2272
Diffstat (limited to 'src/com/android/customization/picker/clock/ui/fragment/ClockCustomDemoFragment.kt')
-rw-r--r--src/com/android/customization/picker/clock/ui/fragment/ClockCustomDemoFragment.kt1
1 files changed, 0 insertions, 1 deletions
diff --git a/src/com/android/customization/picker/clock/ui/fragment/ClockCustomDemoFragment.kt b/src/com/android/customization/picker/clock/ui/fragment/ClockCustomDemoFragment.kt
index 6203e24c..f138d6a4 100644
--- a/src/com/android/customization/picker/clock/ui/fragment/ClockCustomDemoFragment.kt
+++ b/src/com/android/customization/picker/clock/ui/fragment/ClockCustomDemoFragment.kt
@@ -37,7 +37,6 @@ class ClockCustomDemoFragment : AppbarFragment() {
clockRegistry =
(InjectorProvider.getInjector() as ThemePickerInjector).getClockRegistry(
requireContext(),
- this
)
val listInUse = clockRegistry.getClocks().filter { "NOT_IN_USE" !in it.clockId }