Refactor selection logic to separate class
Previously, selection logic was added inside PickerViewModel.
Refactored selection logic to Selection class.
Added two new methods
1) returns LiveData for the number of selected items.
2) checks if the given item is present in selected items
With these new methods, we won't have to expose LiveData of selected
items, hence changed getSelectedItems to return list of selected items.
This refactoring will help to add preview on long press where we will
track preview items.
Bug: 197084072
Test: atest /packages/providers/MediaProvider
Change-Id: Ic11614c04fedfbe450b386bfabc5896075cba0f3
9 files changed