diff options
author | Santiago Etchebehere <santie@google.com> | 2023-06-06 15:55:33 -0700 |
---|---|---|
committer | Santiago Etchebehere <santie@google.com> | 2023-06-12 12:11:51 -0700 |
commit | fda7aeceaa918c65f7429989a97e72902e4ae688 (patch) | |
tree | 85f3456c867d1e832b58006b41b4f93bd01c63ec | |
parent | c1e062b9e756c5aa813b198bb49afbf317092e87 (diff) | |
download | ThemePicker-fda7aeceaa918c65f7429989a97e72902e4ae688.tar.gz |
Fix more Activity leaks
Fix more leaks from GridFramgent2 and ClockSettingsFragment
Test: ran profiler, switched wallpapers via quick-switch, colors, manually
set live wallpapers, clocks, and changed affordances
Bug: 285978251
Change-Id: I8c37ef3338ba3de2a259ffc13ca3e7eac3044071
3 files changed, 4 insertions, 4 deletions
diff --git a/src/com/android/customization/model/grid/ui/fragment/GridFragment2.kt b/src/com/android/customization/model/grid/ui/fragment/GridFragment2.kt index 7f890e1d..6ab561f3 100644 --- a/src/com/android/customization/model/grid/ui/fragment/GridFragment2.kt +++ b/src/com/android/customization/model/grid/ui/fragment/GridFragment2.kt @@ -124,7 +124,7 @@ class GridFragment2 : AppbarFragment() { wallpaperInteractor = wallpaperInteractor, screen = CustomizationSections.Screen.HOME_SCREEN, ), - lifecycleOwner = this, + lifecycleOwner = viewLifecycleOwner, offsetToStart = false, onWallpaperPreviewDirty = { activity?.recreate() }, ) diff --git a/src/com/android/customization/module/ThemePickerInjector.kt b/src/com/android/customization/module/ThemePickerInjector.kt index a9d28748..d00ed28e 100644 --- a/src/com/android/customization/module/ThemePickerInjector.kt +++ b/src/com/android/customization/module/ThemePickerInjector.kt @@ -237,8 +237,8 @@ open class ThemePickerInjector : WallpaperPicker2Injector(), CustomizationInject client = WallpaperClientImpl( context = appContext, - infoFactory = getCurrentWallpaperInfoFactory(context), - wallpaperManager = WallpaperManager.getInstance(context) + infoFactory = getCurrentWallpaperInfoFactory(appContext), + wallpaperManager = WallpaperManager.getInstance(appContext) ), wallpaperPreferences = getPreferences(context = appContext), backgroundDispatcher = Dispatchers.IO, diff --git a/src/com/android/customization/picker/clock/ui/fragment/ClockSettingsFragment.kt b/src/com/android/customization/picker/clock/ui/fragment/ClockSettingsFragment.kt index e476d6a8..f4684d88 100644 --- a/src/com/android/customization/picker/clock/ui/fragment/ClockSettingsFragment.kt +++ b/src/com/android/customization/picker/clock/ui/fragment/ClockSettingsFragment.kt @@ -127,7 +127,7 @@ class ClockSettingsFragment : AppbarFragment() { ) .get(), injector.getClockViewFactory(activity), - this@ClockSettingsFragment, + viewLifecycleOwner, ) return view |