Shareousel: Maintain cursor order for shated items

Add a position property to PreviewModel class to track relative order of
items. For each item, the initial value is artificial and derived from
the order of the initially shared items and is updated upon reading the
additional items cursor.
Upon sharing, If the selection has not change, the items will be shared
in their original order; If the selection has changed, the order of the
items will be affected by the observed items order in the cursor.

Fix: 329683774
Test: manual testing
Test: atest IntentResolver-tests-unit
Test: atest IntentResolver-tests-activity
Flag: android.service.chooser.chooser_payload_toggling
Change-Id: Ie552887702cde75cb1a05ed3ec5415f4f4a5c8dc
18 files changed
tree: 24b5d0d9ca23a0d52cfff084a9e67dda7c32f3d1
  1. aconfig/
  2. java/
  3. tests/
  4. Android.bp
  5. AndroidManifest-app.xml
  6. AndroidManifest-lib.xml
  7. lint-baseline.xml
  8. OWNERS
  9. PREUPLOAD.cfg
  10. proguard.flags
  11. README.md
  12. TEST_MAPPING
README.md

IntentResolver

About

IntentResolver provides the implementation for Intent ACTION_CHOOSER

See also: ShareCompat.IntentBuilder