Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use real Android code for ContentProviderClient.release #6908

Merged
merged 1 commit into from Dec 6, 2021

Conversation

copybara-service[bot]
Copy link

Use real Android code for ContentProviderClient.release

This fixes two issues:

  1. Because 'release' was shadowed, the underlying CloseGuard for the
    ContentProviderClient was never closed, leading to CloseGuard errors that could
    not be suppressed.

  2. The behavior of 'release' was not correct for SDK > 23, where calling it
    multiple times does not result in an IllegalStateException.

Also, update ShadowContentProviderClientTest to use a real ContentProvider, and
remove the interaction test. Trying to release a ContentProviderClient for a
mock ContentProvider results in an exception.

This fixes two issues:
1) Because 'release' was shadowed, the underlying CloseGuard for the
ContentProviderClient was never closed, leading to CloseGuard errors that could
not be suppressed.

2) The behavior of 'release' was not correct for SDK > 23, where calling it
multiple times does not result in an IllegalStateException.

Also, update ShadowContentProviderClientTest to use a real ContentProvider, and
remove the interaction test. Trying to release a ContentProviderClient for a
mock ContentProvider results in an exception.

PiperOrigin-RevId: 413795247
@hoisie hoisie merged commit 2b5f09d into master Dec 6, 2021
@hoisie hoisie deleted the piper_413795247 branch December 6, 2021 03:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant