[release/10.0] [System.Native] check ro.build.version.sdk_full
for minor Android releases
#119848
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.
Backport of #119826 to release/10.0
/cc @akoeplinger @jonathanpeppers
Allows
Environment.OSVersion
andSystem.IsAndroidVersionAtLeast()
to support the new minor Android releases concept.Customer Impact
Context: https://developer.android.com/about/versions/16/qpr2/
Context: dotnet/android@35d471e
Context: https://developer.android.com/reference/android/os/Build.VERSION#SDK_INT_FULL
Android 16 Quarterly Platform Release 2 (QPR2) Beta 2 has been released.
Android 16 QPR2 adds a new concept, "minor" SDK versions.
Reviewing Android's implementation of
Build.VERSION.SDK_INT_FULL
we can check thero.build.version.sdk_full
system property to get the minor version and falling back toro.build.version.sdk
otherwise.libSystem.Native.so
can return the value fromSystemNative_GetUnixRelease()
making bothEnvironment.OSVersion
andSystem.IsAndroidVersionAtLeast()
support minor Android releases.Regression
Testing
Local testing using a test app to confirm that the value returned by Java and .NET agree. A unit test will be added in dotnet/android since testing this without the Java integration in dotnet/runtime is cumbersome.
Risk
Low. This just adds checking for a new system property that will be defined on new OS releases and fallback to the previous property otherwise.