commit | bf8b6d3157f79dfaa1f3d41a7edec79c06e3b990 | [log] [tgz] |
---|---|---|
author | Mark Renouf <mrenouf@google.com> | Tue Feb 27 16:23:56 2024 -0500 |
committer | Mark Renouf <mrenouf@google.com> | Tue Feb 27 16:23:56 2024 -0500 |
tree | fcb2a381a41dc47dffc8d420198d10c4672a44d9 | |
parent | 48bd239ea762e4c0c6cf5b3bd1e53eb6720c9fbd [diff] |
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
IntentResolver
provides the implementation for Intent ACTION_CHOOSER
See also: ShareCompat.IntentBuilder