Repository navigation
[Mono.Android] Remove APIs dropped in API-37.2 platform r02 - #13661
Conversation
Context: https://issuetracker.google.com/issues/584834598 Context: #13388 Google republished the Android 37.2 platform as `platform-37.2_r02`. It removes APIs that were in `platform-37.2_r01`, which our API-37.2 binding is built from: * The `android.app.personalcontext.*` and `android.service.personalcontext.*` packages * The `android.agenticon` package * `Notification.FLAG_AGENT_TASK_INTERACTION_*`, `Notification.getAgentInteractionFlags()`, `Notification.Builder.setAgentInteractionFlags()`, and `NotificationListenerService.Ranking.getAgentInteractionFlags()` * `StatusBarManager.ACTION_AGENT_TASK_MAIN`, `canSetAgentTask()`, `getAgentStateScreenLocation()`, `isAgentTaskFeatureSupported()`, `isAgentTaskLaunchSupported()`, and `setAgentTask()` These bindings call Java members that no longer exist on r02 devices, so remove them. Update `platform-37.2_r01` to `platform-37.2_r02` in `androidsdk.targets`, the same bump as in #13388, and remove the related `map.csv`, `methodmap.csv`, and `metadata` entries. This change must also go to servicing, so it binds only changes that do not break C# code. r02 also has these changes, which are intentionally not bound: * New: `Manifest.permission.READ_UPDATE_ENGINE_LOGS` and `ViewGroup.requestChildRectangleOnScreen(View, Rect, boolean, int)`. * `PolicyIdentifier` is no longer `final`. Unsealing it in C# makes its `(IntPtr, JniHandleOwnership)` constructor `protected`, which adds public API. * The `HandlerThread(String, int)` parameter is renamed from `priority` to `linuxPriority`. This breaks C# callers that use named arguments. The only binding change kept is `[Obsolete]` on `PolicyIdentifier.CreateForTesting()`, because r02 deprecates it. `api-37.2.xml` and `api-37.2.params.txt` were regenerated with `class-parse`, `api-xml-adjuster`, `api-merge`, and `java-source-utils` against r01 and r02. The r01 output was compared with the committed files to confirm the tools reproduce them; then only the r01 → r02 removals and the deprecation were applied. Validation: * `build.cmd Prepare`: passed; downloaded `platform-37.2_r02.zip`, SHA-1 matches `repository2-3.xml`. * `dotnet-local.cmd build Microsoft.Android.slnx`: passed. * `dotnet-local.cmd build src/Mono.Android/Mono.Android.csproj -p:AndroidApiLevel=37.2 -p:AndroidPlatformId=37.2 -p:AndroidFrameworkVersion=v17.2`: passed, 0 errors; `CheckApiCompatibility` for v17.2 (against v17.1) passed. Co-authored-by: Copilot App <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
An API-37.2 rebuild without cleaning can retain deleted types because stale generated files and Compile items remain included.
1 open issue
What changed in this PR
Aligns Mono.Android’s API-37.2 bindings with Android platform r02, removing bindings for unavailable Java APIs while leaving unrelated C# API changes out of scope for servicing.
Changes:
- Removes personal-context, agent-icon, and related notification/status-bar bindings.
- Cleans up associated metadata and mappings; marks
PolicyIdentifier.CreateForTesting()obsolete. - Updates the platform archive and checksum to r02, matching #13388.
| File | Description |
|---|---|
src/Mono.Android/Profiles/api-37.2.xml |
Removes dropped APIs and records the deprecation. |
src/Mono.Android/Profiles/api-37.2.params.txt |
Removes parameter metadata for deleted APIs. |
src/Mono.Android/methodmap.csv |
Removes enum conversions for deleted members. |
src/Mono.Android/metadata |
Removes unused namespace replacements. |
src/Mono.Android/map.csv |
Removes associated enum and constant mappings. |
src/androidsdk/androidsdk.targets |
Pins the r02 platform archive and checksum. |
Review effort: Balanced
Google republished the Android 37.2 platform as platform-37.2_r02 (https://issuetracker.google.com/issues/584834598). dotnet/android#13661 updates the API-37.2 binding to match. Update the docs to that binding: * Remove the Android.AgentIcon, Android.App.PersonalContext*, and Android.Service.PersonalContext* namespaces and their types. * Remove Android.App.NotificationAgentTaskInteractionFlags. * Remove the agent-task members from Notification, Notification.Builder, NotificationListenerService.Ranking, and StatusBarManager. * Add [Obsolete("deprecated")] to PolicyIdentifier.CreateForTesting(string). * Remove the matching entries and NamespaceMapping attributes from FrameworksIndex/net-android-37.0.xml and index.xml. The removal set was verified against `mdoc update --delete` run on a scratch copy with the r02 Mono.Android.dll; unrelated mdoc churn from other dotnet/android changes is excluded. Co-authored-by: Copilot App <[email protected]>
|
/review |
|
✅ Android PR Reviewer completed successfully!
|
There was a problem hiding this comment.
The changes are narrowly scoped: the withdrawn packages and their enum/method/namespace mappings are removed together, the Notification and StatusBarManager removals match the stated scope, and the only modified surviving XML member is the PolicyIdentifier.createForTesting() deprecation. Whole-file searches found no remaining references to the withdrawn packages or agent-task members in the Mono.Android source. The retained PolicyIdentifier finality and HandlerThread parameter name match the stated compatibility decisions. The platform revision and SHA-256 match #13388. I did not re-flag the resolved, pre-existing local incremental-generation issue.
CI: Of the 7 checks currently reported for build 1692969, 2 passed, 4 are running, and 1 is queued; none is currently failing. Azure build/timeline queries were unavailable, so the overall Azure result is not independently confirmed and this is not a green-CI verdict.
Review limits: The large generated profiles were inspected through diff hunks, relevant surrounding source, and whole-file reference searches rather than an exhaustive line-by-line reading of all 43 MB of changed files. Local builds and regeneration were not rerun; the build results in the description remain author-reported.
Generated by Android PR Reviewer for #13661 · copilot · gpt61 · 39 AIC · ⌖ 4.74 AIC · ⊞ 21K
Comment /review to run again
| @@ -14510,7 +14491,7 @@ | |||
| <typeParameters> | |||
| <typeParameter name="T" classBound="java.lang.Object" jni-classBound="Ljava/lang/Object;"></typeParameter> | |||
| </typeParameters> | |||
| <method abstract="false" deprecated="not deprecated" final="false" name="createForTesting" jni-signature="(Ljava/lang/String;)Landroid/app/admin/PolicyIdentifier;" bridge="false" native="false" return="android.app.admin.PolicyIdentifier<U>" jni-return="Landroid/app/admin/PolicyIdentifier<TU;>;" return-not-null="true" static="true" synchronized="false" synthetic="false" visibility="public"> | |||
| <method abstract="false" deprecated="deprecated" final="false" name="createForTesting" jni-signature="(Ljava/lang/String;)Landroid/app/admin/PolicyIdentifier;" bridge="false" native="false" return="android.app.admin.PolicyIdentifier<U>" jni-return="Landroid/app/admin/PolicyIdentifier<TU;>;" return-not-null="true" static="true" synchronized="false" synthetic="false" visibility="public"> | |||
There was a problem hiding this comment.
🤖 💡 Documentation — Could you record the deliberate r01/r02 profile differences in an in-tree maintenance note, rather than only in the PR description? This profile now intentionally keeps PolicyIdentifier final and HandlerThread's priority parameter name while adopting this r02 deprecation. A future regeneration against the newly pinned r02 SDK could silently undo those compatibility decisions. A short note near the relevant metadata/profile maintenance instructions would make the exceptions discoverable when updating bindings.
{Rule: Document non-obvious behavioral decisions; preserve API compatibility}
|
/backport to release/11.0.1xx |
|
Started backporting to |
Context: #13388 Context: #13661 Context: https://issuetracker.google.com/issues/584834598 #13388 bumped `platform-37.2_r01` to `platform-37.2_r02` and changed only the hash. r02 removed public API that `src/Mono.Android/Profiles/api-37.2.xml` still bound, and nobody saw it until #13661. The removed APIs had no `@SystemApi`, `@FlaggedApi`, or `@hide` in r01, so an annotation filter would not catch this. A diff of the two `android.jar` files does. Add `scripts/diff_platform_api.cs` to the `update-androidsdk-packages` skill: dotnet run .github/skills/update-androidsdk-packages/scripts/diff_platform_api.cs -- \ <old-zip-url> <old-sha256> <new-zip-url> <new-sha1> <new-size> It checks the old zip against the SHA-256 pinned in `androidsdk.targets` and the new zip against the manifest SHA-1 and size. It hashes every `.class` in both `android.jar` files, runs `javap -protected` on the removed, added, and changed classes, and prints a Markdown report with the new SHA-256. Package-private types are ignored. `javap` does not show parameter names, so a parameter rename is not reported. New hard rule 8: every revision bump of an existing `_PlatformPackage` entry puts the report in the PR description. If public API was removed or changed, the PR still opens, but its description starts with a "Do not merge" warning to update `api-<level>.xml` first. skill-runner can only change `Configuration.props` and `androidsdk.targets`, so it cannot fix the binding itself; stopping would hide the change in the tracking issue. `skill-runner.md` (lock recompiled), `package-catalog.md`, and a new eval follow the same rule. Co-authored-by: Copilot App <[email protected]>
…13711) Context: https://issuetracker.google.com/issues/584834598 Context: #13388 Google republished the Android 37.2 platform as `platform-37.2_r02`. It removes APIs that were in `platform-37.2_r01`, which our API-37.2 binding is built from: * The `android.app.personalcontext.*` and `android.service.personalcontext.*` packages * The `android.agenticon` package * `Notification.FLAG_AGENT_TASK_INTERACTION_*`, `Notification.getAgentInteractionFlags()`, `Notification.Builder.setAgentInteractionFlags()`, and `NotificationListenerService.Ranking.getAgentInteractionFlags()` * `StatusBarManager.ACTION_AGENT_TASK_MAIN`, `canSetAgentTask()`, `getAgentStateScreenLocation()`, `isAgentTaskFeatureSupported()`, `isAgentTaskLaunchSupported()`, and `setAgentTask()` These bindings call Java members that no longer exist on r02 devices, so remove them. Update `platform-37.2_r01` to `platform-37.2_r02` in `androidsdk.targets`, the same bump as in #13388, and remove the related `map.csv`, `methodmap.csv`, and `metadata` entries. This change must also go to servicing, so it binds only changes that do not break C# code. r02 also has these changes, which are intentionally not bound: * New: `Manifest.permission.READ_UPDATE_ENGINE_LOGS` and `ViewGroup.requestChildRectangleOnScreen(View, Rect, boolean, int)`. * `PolicyIdentifier` is no longer `final`. Unsealing it in C# makes its `(IntPtr, JniHandleOwnership)` constructor `protected`, which adds public API. * The `HandlerThread(String, int)` parameter is renamed from `priority` to `linuxPriority`. This breaks C# callers that use named arguments. The only binding change kept is `[Obsolete]` on `PolicyIdentifier.CreateForTesting()`, because r02 deprecates it. `api-37.2.xml` and `api-37.2.params.txt` were regenerated with `class-parse`, `api-xml-adjuster`, `api-merge`, and `java-source-utils` against r01 and r02. The r01 output was compared with the committed files to confirm the tools reproduce them; then only the r01 → r02 removals and the deprecation were applied. Validation: * `build.cmd Prepare`: passed; downloaded `platform-37.2_r02.zip`, SHA-1 matches `repository2-3.xml`. * `dotnet-local.cmd build Microsoft.Android.slnx`: passed. * `dotnet-local.cmd build src/Mono.Android/Mono.Android.csproj -p:AndroidApiLevel=37.2 -p:AndroidPlatformId=37.2 -p:AndroidFrameworkVersion=v17.2`: passed, 0 errors; `CheckApiCompatibility` for v17.2 (against v17.1) passed. Co-authored-by: Jonathan Peppers <[email protected]> Co-authored-by: Copilot App <[email protected]>

Context: https://issuetracker.google.com/issues/584834598
Context: #13388
Google republished the Android 37.2 platform as
platform-37.2_r02. It removes APIs that were inplatform-37.2_r01, which our API-37.2 binding is built from:android.app.personalcontext.*andandroid.service.personalcontext.*packagesandroid.agenticonpackageNotification.FLAG_AGENT_TASK_INTERACTION_*,Notification.getAgentInteractionFlags(),Notification.Builder.setAgentInteractionFlags(), andNotificationListenerService.Ranking.getAgentInteractionFlags()StatusBarManager.ACTION_AGENT_TASK_MAIN,canSetAgentTask(),getAgentStateScreenLocation(),isAgentTaskFeatureSupported(),isAgentTaskLaunchSupported(), andsetAgentTask()These bindings call Java members that no longer exist on r02 devices, so remove them. Update
platform-37.2_r01toplatform-37.2_r02inandroidsdk.targets, the same bump as in #13388, and remove the relatedmap.csv,methodmap.csv, andmetadataentries.This change must also go to servicing, so it binds only changes that do not break C# code. r02 also has these changes, which are intentionally not bound:
Manifest.permission.READ_UPDATE_ENGINE_LOGSandViewGroup.requestChildRectangleOnScreen(View, Rect, boolean, int).PolicyIdentifieris no longerfinal. Unsealing it in C# makes its(IntPtr, JniHandleOwnership)constructorprotected, which adds public API.HandlerThread(String, int)parameter is renamed fromprioritytolinuxPriority. This breaks C# callers that use named arguments.The only binding change kept is
[Obsolete]onPolicyIdentifier.CreateForTesting(), because r02 deprecates it.api-37.2.xmlandapi-37.2.params.txtwere regenerated withclass-parse,api-xml-adjuster,api-merge, andjava-source-utilsagainst r01 and r02. The r01 output was compared with the committed files to confirm the tools reproduce them; then only the r01 → r02 removals and the deprecation were applied.Validation:
build.cmd Prepare: passed; downloadedplatform-37.2_r02.zip, SHA-1 matchesrepository2-3.xml.dotnet-local.cmd build Microsoft.Android.slnx: passed.dotnet-local.cmd build src/Mono.Android/Mono.Android.csproj -p:AndroidApiLevel=37.2 -p:AndroidPlatformId=37.2 -p:AndroidFrameworkVersion=v17.2: passed, 0 errors;CheckApiCompatibilityfor v17.2 (against v17.1) passed.