Skip to content

[Mono.Android] Correct CellInfo getter availability - #13342

Open
simonrozsival wants to merge 1 commit into
mainfrom
simonrozsival-jni-cellinfo-api30
Open

simonrozsival wants to merge 1 commit into
mainfrom
simonrozsival-jni-cellinfo-api30

Conversation

@simonrozsival

Copy link
Copy Markdown
Member

Context: https://developer.android.com/reference/android/telephony/CellInfo#getCellIdentity()
Context: https://developer.android.com/reference/android/telephony/CellInfo#getCellSignalStrength()

Found during the unsafe audit. CellInfo's base getCellIdentity() and getCellSignalStrength() methods were added in Android API 30, but their handwritten managed properties and callback helpers advertise earlier availability or lack matching guards.

Require Android 30 consistently and link each corrected annotation to its Android reference. Preserve the existing Register declarations, which already specify ApiSince = 30. No dedicated annotation regression tests are added, as requested.

Validation

Validation was performed locally on the combined audit checkout before partitioning, not on seven separately rebuilt SDKs. The per-type commits contain the same validated product sources.

make prepare
make leeroy MSBUILD_ARGS="-p:AndroidSdkDirectory=$PWD/bin/android-sdk"

Both passed, including all configured stable API levels and API compatibility. A private Android SDK copy avoided concurrent extraction conflicts in the shared SDK.

No dedicated API-30 annotation tests were added, at the user's request.

git diff-tree --check passed for this isolated commit. This PR targets main and has no dependency on the other audit PRs.

Context: https://developer.android.com/reference/android/telephony/CellInfo#getCellIdentity()
Context: https://developer.android.com/reference/android/telephony/CellInfo#getCellSignalStrength()

Found during the `unsafe` audit. CellInfo's base getCellIdentity() and getCellSignalStrength() methods were added in Android API 30, but their handwritten managed properties and callback helpers advertise earlier availability or lack matching guards.

Require Android 30 consistently and link each corrected annotation to its Android reference. Preserve the existing Register declarations, which already specify ApiSince = 30. No dedicated annotation regression tests are added, as requested.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 30, 2026 13:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are recorded for the CellInfo Android API 30 availability annotation changes.

No open issues 🎉

What changed in this PR

Corrects the handwritten CellInfo bindings so their platform availability annotations match the Android API 30 base getters.

Changes:

  • Updates CellIdentity and its callback helpers from Android 28 to Android 30.
  • Adds Android 30 annotations to CellSignalStrength and its callback helpers.
  • Adds Android reference links while preserving the existing Register declarations and ApiSince = 30 values.
File Description
src/​Mono.Android/​Android.Telephony/​CellInfo.cs Aligns both getter properties and callback helpers with Android API 30 availability.

Review effort: Balanced

@simonrozsival simonrozsival added the ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable). label Oct 30, 2026
@simonrozsival

Copy link
Copy Markdown
Member Author

/review

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

✅ Android PR Reviewer completed successfully!

Generated by Android PR Reviewer for #13342

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review: no blocking findings. 0 errors, 0 warnings, 1 optional documentation suggestion inline.

The API-30 annotations now consistently cover both public properties and their callback helpers. They agree with the existing ANDROID_30 compilation guard, Register(ApiSince = 30) declarations, and API-30 metadata removal rules. JNI signatures, virtual dispatch, exception handling, and reference ownership remain unchanged. I read the complete changed source file and checked its project inclusion and binding metadata. The absence of dedicated regression tests is explicitly documented as requested in the PR description.

CI: All 42 reported GitHub checks succeeded, including the aggregate Azure DevOps dotnet-android check for build 1656039. Direct Azure build/timeline verification was blocked because az devops invoke requires authentication in this environment, so that additional verification is incomplete. Fetching the linked Android reference was also denied; the API-level assessment is corroborated by the existing in-tree binding metadata rather than a fresh documentation fetch. No local build or tests were run for this review.

Generated by Android PR Reviewer for #13342 · copilot · gpt61 · 18.2 AIC · ⌖ 4.62 AIC · ⊞ 20K
Comment /review to run again


[global::System.Diagnostics.DebuggerDisableUserUnhandledExceptions]
[global::System.Runtime.Versioning.SupportedOSPlatform ("android28.0")]
// Added in API 30: https://developer.android.com/reference/android/telephony/CellInfo#getCellIdentity()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 💡 Documentation — Consider keeping each Android reference link only above its public property, rather than repeating the same API-level explanation on both callback helpers as well. The matching SupportedOSPlatform attributes already express the helpers’ requirement; one source link per getter would preserve the rationale with less duplication. This applies to both getter groups.

{Rule: Comments explain why; minimal duplication}

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

⌂ Proxy