summaryrefslogtreecommitdiff
path: root/docs/html/sdk/api_diff/3/changes
diff options
context:
space:
mode:
authorTobias Thierer <tobiast@google.com>2019-05-08 22:00:38 +0100
committerTobias Thierer <tobiast@google.com>2019-05-09 16:53:42 +0100
commitc9afa38f974317b6b0e28410bbc3426a41791660 (patch)
tree7e25a99a916b71b80183be385f051661a247b6ec /docs/html/sdk/api_diff/3/changes
parentb639ce9e47bd91bb0ae5a22543070db4cb73bcb8 (diff)
Parcel only the canonical Uri.Part representation, not both.
Before this CL, Uri.AbstractPart's implementation of Parcelable was parceling and unparceling both the encoded and the decoded representation. A Uri with inconsistent decoded/encoded representation of its Parts would have remained inconsistent across parcel/unparcel cycles. For example, such a Uri's uri.getDecodedAuthority() might have returned "good.com" while url.getEncodedAuthority() (used e.g. for toString()) returned "evil.com". After this CL, AbstractPart's constructor allows at most one of the representations to be set (exception: NULL and EMPTY); this means that no Part instance with inconsistent values can be constructed via the constructor (e.g. by unparceling parceled data). The historical parcel representation of a Part with both values present can no longer be unparceled, which is safe because Parcel does not guarantee backwards compatibility (the parceled form must not be persisted across Android version upgrades). When parceling, only one of the values is now stored, namely the (canonical) one that was passed to the constructor. Bug: 124526860 Test: atest FrameworksCoreTests:android.net.UriTest Test: Checked that if run before this CL, the added tests would fail with a failure along the lines of: ComparisonFailure: expected:</foo/[b]> but was:</foo/[a]> or (if the first assertion was commented out): ComparisonFailure: expected:<[b].com> but was:<[a].com> Change-Id: I2bc2008e49de5a66641ecdbd8e5354dfa647269d
Diffstat (limited to 'docs/html/sdk/api_diff/3/changes')
0 files changed, 0 insertions, 0 deletions