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

HttpEngine should use RequiresExtension #1262

Closed
yschimke opened this issue Apr 10, 2024 · 3 comments
Closed

HttpEngine should use RequiresExtension #1262

yschimke opened this issue Apr 10, 2024 · 3 comments
Assignees

Comments

@yschimke
Copy link
Contributor

yschimke commented Apr 10, 2024

HttpEngine is marked as @RequiresApi(34)

But HttpEngine is based on extension versions

@RequiresExtension(extension = Build.VERSION_CODES.S, version = 7)

In practice trying to configure HttpEngine and pass it to HttpEngineDataSource, Android Studio wanted me to add both.

Should HttpEngineDataSource be changed to use RequiresExtension, so that it works on API 31 devices that have received the latest mainline versions?

@marcbaechinger
Copy link
Contributor

Thanks for raising this!

I think we should do what makes the least hassle for our users. So if AS complains, we probably should do this.

For my education: with @RequiresApi I know how I as a developer can code and take different API levels into account. Like

if (Util.SDK_INT >= 21) {
  // here
}

How would that work with such a @RequiresExtension annotation? Do you know?

@yschimke
Copy link
Contributor Author

yschimke commented Apr 11, 2024

SdkExtensions.getExtensionVersion(Build.VERSION_CODES.S) >= 7

It should clear IDE errors when you check this.

copybara-service bot pushed a commit that referenced this issue Jul 8, 2024
This earlier version supports [HttpEngine](https://developer.android.com/reference/android/net/http/HttpEngine) and thus this change allows more devices to use HttpEngine.

This fixes Issue: #1262, which suggests to do this.

PiperOrigin-RevId: 650224711
@icbaker
Copy link
Collaborator

icbaker commented Jul 9, 2024

This was done in 91633e6, which was then reverted and then re-done in 00d1e70.

@icbaker icbaker closed this as completed Jul 9, 2024
copybara-service bot pushed a commit that referenced this issue Jul 10, 2024
When testing locally it seemed that upgrading KGP to `1.9.20` resolved
this, but testing again confirms this was incorrect, so the problem
was reintroduced in 00d1e70.

This change reverts back to KGP `1.9.0` (since upgrading didn't help)
and instead implements the workaround suggested in
https://issuetracker.google.com/278545487. The workaround is now in
the `lib-common` `build.gradle` file, which is transitively depended
on by all modules (and therefore all apps that use this library), so
there's no need for any developer action, and so the release note is
removed.

Issue: #1262
PiperOrigin-RevId: 651066418
@androidx androidx locked and limited conversation to collaborators Sep 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants