diff options
author | Tommy Webb <tommy@calyxinstitute.org> | 2023-06-20 13:20:57 -0400 |
---|---|---|
committer | alk3pInjection <webmaster@raspii.tech> | 2023-07-04 20:04:45 +0800 |
commit | b770fd55789893acdca3d5cfd3eb8b474b72e383 (patch) | |
tree | 1620650ca33d18e827f0b66c5fc33706f6ef43a6 | |
parent | 0bc576f5f86f1029b14c54b2bbcdb6a96394a831 (diff) |
ThemePicker: Fix crash choosing Live Wallpaperstachibana-mr1
LivePreviewFragment expects arguments, too.
Issue: LineageOS#5789
Change-Id: I9ec7ff501dba4b4ed3d1747c2593afc7dc949f53
-rw-r--r-- | src/com/android/customization/module/ThemePickerInjector.kt | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/com/android/customization/module/ThemePickerInjector.kt b/src/com/android/customization/module/ThemePickerInjector.kt index eb20037b..da4d65eb 100644 --- a/src/com/android/customization/module/ThemePickerInjector.kt +++ b/src/com/android/customization/module/ThemePickerInjector.kt @@ -160,18 +160,19 @@ open class ThemePickerInjector : WallpaperPicker2Injector(), CustomizationInject viewFullScreen: Boolean, testingModeEnabled: Boolean ): Fragment { - return if (wallpaperInfo is LiveWallpaperInfo) LivePreviewFragment() - else - ImagePreviewFragment().apply { - arguments = - Bundle().apply { - putParcelable(PreviewFragment.ARG_WALLPAPER, wallpaperInfo) - putInt(PreviewFragment.ARG_PREVIEW_MODE, mode) - putBoolean(PreviewFragment.ARG_VIEW_AS_HOME, viewAsHome) - putBoolean(PreviewFragment.ARG_FULL_SCREEN, viewFullScreen) - putBoolean(PreviewFragment.ARG_TESTING_MODE_ENABLED, testingModeEnabled) - } - } + val fragment = if (wallpaperInfo is LiveWallpaperInfo) LivePreviewFragment() + else ImagePreviewFragment() + + return fragment.apply { + arguments = + Bundle().apply { + putParcelable(PreviewFragment.ARG_WALLPAPER, wallpaperInfo) + putInt(PreviewFragment.ARG_PREVIEW_MODE, mode) + putBoolean(PreviewFragment.ARG_VIEW_AS_HOME, viewAsHome) + putBoolean(PreviewFragment.ARG_FULL_SCREEN, viewFullScreen) + putBoolean(PreviewFragment.ARG_TESTING_MODE_ENABLED, testingModeEnabled) + } + } } @Synchronized |