Retain the image loader through configuration change

Make PreviewViewModel own an image loader instance.
This required ImagePreviewImageLoader to:
 * receive a CoroutineScope instance instead of a Lifecycle as ViewModel
   does not offer an associated Lifecycle;
 * make ImagePreviewImageLoader#loadImage to receive a caller's
   Lifecycle to avoid potential memory (Activity) leak.
With ImagePreviewImageLoader now receiving a scope, the dispatcher
argument is dropped as a scope can be configured with a proper
dispatcher.
As ChooserActivity is no longer responsible for the image loader
instantiation, to facilitate testing, a method hook to create an image
loader is replaced with a method hook to create a preview view model and
all the associated plumbing is done for the tests.

Plus some kfmt complience changes.
ImagePreviewImageLoader (and ImagePreviewImageLoaderTest) is moved into
contentpreview package as it's accessed only from within this package.

Fix: 282029067
Test: manual testing with an injected debug logging
Change-Id: I5dcdee2599714a2c51c3e1b63f5c727e43b26f6a
13 files changed