Skip to content

HttpEngine should use RequiresExtension #1262

Closed
@yschimke

Description

@yschimke
Contributor

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?

Activity

marcbaechinger

marcbaechinger commented on Apr 11, 2024

@marcbaechinger
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

yschimke commented on Apr 11, 2024

@yschimke
ContributorAuthor
SdkExtensions.getExtensionVersion(Build.VERSION_CODES.S) >= 7

It should clear IDE errors when you check this.

icbaker

icbaker commented on Jul 9, 2024

@icbaker
Collaborator

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

locked and limited conversation to collaborators on Sep 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @yschimke@marcbaechinger@icbaker

      Issue actions

        HttpEngine should use RequiresExtension · Issue #1262 · androidx/media