Fix Valid<T> to contain non nullable value

This corrects a design mistake: the Valid<T> subclass of
ValidationResult should have a non-null value, so the value
can be taken directly after a smart-cast.

Usage becomes more concise:

when (val result = validateInput(source) {
    is Valid -> processValue(result.value) // also result.warnings
    is Invalid -> handleInvalid(result.errors)
}

Bug: 309960444
Test: atest com.android.intentresolver.v2.validation
Change-Id: Ia4ee53413d729e551b8b7ec21a8765ae7d4f5e95
17 files changed
tree: fcb2a381a41dc47dffc8d420198d10c4672a44d9
  1. aconfig/
  2. java/
  3. tests/
  4. Android.bp
  5. AndroidManifest-app.xml
  6. AndroidManifest-lib.xml
  7. OWNERS
  8. PREUPLOAD.cfg
  9. proguard.flags
  10. README.md
  11. TEST_MAPPING
README.md

IntentResolver

About

IntentResolver provides the implementation for Intent ACTION_CHOOSER

See also: ShareCompat.IntentBuilder