media: Use safe GetDeviceApiLevel helper and API constants in media_codec#11546
Open
borongc wants to merge 1 commit into
Open
media: Use safe GetDeviceApiLevel helper and API constants in media_codec#11546borongc wants to merge 1 commit into
borongc wants to merge 1 commit into
Conversation
Contributor
🤖 Gemini Suggested Commit Message💡 Pro Tips for a Better Commit Message:
|
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors the retrieval of the Android device API level by introducing a centralized GetDeviceApiLevel() helper function and corresponding API level constants in media_common.h, replacing direct calls to android_get_device_api_level() in media_codec.cc. The review feedback suggests explicitly including "starboard/android/shared/media_common.h" in media_codec.cc to adhere to "Include What You Use" (IWYU) guidelines, and using the global namespace qualifier :: for the C system function android_get_device_api_level to prevent potential namespace lookup issues.
Member
Author
|
See #11544 (comment) for the review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace direct calls to android_get_device_api_level() with a
centralized GetDeviceApiLevel() helper. This wrapper ensures
compatibility by handling potential null function pointers on older
Android versions. Additionally, replace hardcoded API level integers
with named constants to improve code maintainability and clarity.
This was caught in #11544.
Issue: 515461431