Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

For #11892 - Pass ParsedStructure as bytearray instead of as parcelable #11893

Merged
merged 1 commit into from
May 4, 2022

Conversation

Mugurell
Copy link
Contributor

@Mugurell Mugurell commented Mar 18, 2022

This avoids the system trying to remap our ParsedStructure parcelable failing
by not using the right ClassLoader.

Implementing Parcelable on our own was needed to be able to manually create
ParsedStructure from the unmarshalled parcel.

Passing out ClassLoader in the intent (as the recommended approach) did not work.

Pull Request checklist

  • Quality: This PR builds and passes detekt/ktlint checks (A pre-push hook is recommended)
  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Changelog: This PR includes a changelog entry or does not need one
  • Accessibility: The code in this PR follows accessibility best practices or does not include any user facing features

After merge

  • Milestone: Make sure issues closed by this pull request are added to the milestone of the version currently in development.
  • Breaking Changes: If this is a breaking change, please push a draft PR on Reference Browser to address the breaking issues.

@Mugurell Mugurell requested a review from grigoryk as a code owner March 18, 2022 17:27
@Mugurell Mugurell marked this pull request as draft March 18, 2022 17:31
@Mugurell Mugurell marked this pull request as ready for review March 22, 2022 14:21
@Amejia481 Amejia481 requested review from Amejia481 and removed request for grigoryk May 4, 2022 13:34
Copy link
Contributor

@Amejia481 Amejia481 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good!
Is possible to create tests to simulate the crash and ensure we are not regressing in the future?

@Mugurell
Copy link
Contributor Author

Mugurell commented May 4, 2022

This looks good! Is possible to create tests to simulate the crash and ensure we are not regressing in the future?

Managed to somehow add a test for the parcelable code but it seems most of the platform functionality is private, hard to peek into or test from outside.
Looked into testing that the FillResponse constructed when the user has to first log in contains the expected parcelable or that AbstractAutofillUnlockActivity does indeed recreate the expected object from the parcel but FieldResponse does not want to cooperate.
Not sure how to refactor the code to make it more easily testable and given the complexity I probably shouldn't.

…of as parcelable

This avoids the system trying to remap our ParsedStructure parcelable failing
by not using the right ClassLoader.

Implementing Parcelable on our own was needed to be able to manually create
`ParsedStructure` from the unmarshalled parcel.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🛬 needs landing PRs that are ready to land
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants