Skip to content

[build] Refresh stable Android emulator and platform 37.2 packages - #13388

Open
jonathanpeppers with Copilot wants to merge 2 commits into
mainfrom
copilot/update-androidsdk-packages
Open

jonathanpeppers with Copilot wants to merge 2 commits into
mainfrom
copilot/update-androidsdk-packages

Conversation

Copilot AI commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

The SDK refresh stopped before committing because conflicting SDK environment variables blocked Gradle compatibility validation. This updates the pending stable packages; validation passed with ANDROID_SDK_ROOT unset.

  • Package updates

    • Emulator 37.2.12 → 37.2.13, archive build 16428233 → 16740729.
    • Platform 37.2 r01 → r02.
    • Refresh SHA-256 hashes for all four emulator archives and the platform archive, verified against manifest SHA-1 checksums and sizes.
  • Scope

    • Preserve NDK pins, all 27 platform API entries, stable-platform sources, and archive/hash-specific extraction stamps.
    • Command-line tools remain unchanged; no new archive variants.
    • No newer stable platform level exists upstream beyond 37.2.

Copilot AI changed the title [WIP] Update Android SDK packages to emulator 37.2.13 [build] Refresh stable Android emulator and platform 37.2 packages Nov 4, 2026
Copilot AI requested a review from jonathanpeppers November 4, 2026 09:41
@jonathanpeppers
jonathanpeppers marked this pull request as ready for review November 4, 2026 16:03
Copilot AI balanced review requested due to automatic review settings November 4, 2026 16:03

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 Android SDK package pin updates.

No open issues 🎉

What changed in this PR

Refreshes stable Android SDK package pins used by .NET for Android’s build provisioning, completing the package updates described in #13370.

Changes:

  • Updates the emulator from 37.2.12 to 37.2.13, using archive build 16740729 and refreshed SHA-256 hashes for all four host variants.
  • Updates platform 37.2 from revision r01 to r02 with its refreshed SHA-256 hash.
  • Leaves NDK pins, command-line tools, and the platform API set unchanged.
File Description
src/​androidsdk/​androidsdk.targets Updates the platform 37.2 archive revision and hash.
Configuration.props Updates the emulator version, archive build, and host-specific hashes.

Review effort: Balanced

@simonrozsival
simonrozsival enabled auto-merge (squash) November 5, 2026 10:55
@jonathanpeppers

Copy link
Copy Markdown
Member

The platform 37.2 r02 update needs clarification from Google before we merge it. The SDK JAR removes APIs that are still present in the latest 37.2 emulator image.

SDK archive comparison

I compared android.jar from Google's r01 archive and r02 archive. Both archive SHA-256 hashes match the package pins before and after this PR.

r02 removes 88 classes:

  • 80 under android.app.personalcontext.* and android.service.personalcontext.*, including PersonalContextManager and its nested OnPersonalContextModeChangedListener.
  • 8 under android.agenticon: AgentTaskEvent, AgentTaskOutcome, AgentTaskState, AgentTaskUpdate, and each class's nested Builder.

No classes were added. This comparison covers class presence, not member-level changes.

Google's SDK manifest lists platforms;android-37.2 revision 2, archive platform-37.2_r02.zip, size 68094624, SHA-1 d52b3062af96f7c4dfdca5a479cd1db33ae83762.

This explains the four failing CI jobs in build 1664186: our checked-in Profiles/api-37.2.xml still includes the removed listener. Generated Java code implements it, but r02's JAR no longer supplies it, causing JAVAC0000 / XAJVC0000. The failures persisted on retry across Windows, Linux, and macOS. This is not an emulator failure.

Latest 37.2 emulator image

I installed and booted the latest Google APIs x86_64 image listed in the system-image manifest:

  • Package: system-images;android-37.2;google_apis_ps16k;x86_64, revision 7.
  • Image archive.
  • Device reports API 37.2, build CP41.260831.015 / 16516427, build date October 5, 2026.

A Java test APK compiled against r01 produced these results. It did not package copies of the Android framework classes, and hidden-API checks were not disabled.

Check Result
Load all 88 removed classes and inspect their methods 88 present, 0 unavailable
AgentTaskEvent: construct, read, and parcel round-trip Passed
AgentTaskOutcome: construct and parcel round-trip Passed
UserInputText: construct, read, and parcel round-trip Passed
Implement and invoke OnPersonalContextModeChangedListener Passed
Obtain PersonalContextManager using getSystemService Returned null; service check personal_context also reports no service
CapturedText.Builder.build() Throws NullPointerException: viewNodeLastUpdated must be set; neither r01 nor the runtime exposes a public setter for that field

These results show that the SDK removal does not match class availability in the image. They do not establish that the full Personal Context feature works, or that Google removed the SDK declarations by mistake.

Recommendation: keep the emulator 37.2.12 -> 37.2.13 update, drop the platform r01 -> r02 change from this PR, and retain the existing 37.2 bindings until Google clarifies the intended API surface. We should report the archive/image mismatch to Google rather than remove bindings or suppress the Java compiler errors.

@jonathanpeppers jonathanpeppers added the do-not-merge PR should not be merged. label Nov 9, 2026

@jonathanpeppers jonathanpeppers left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copilot AI commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

We should figure out what in the world Google is doing:

The Discord link redirects to login, so I can’t read the discussion. Could you paste the relevant messages here, especially any explanation from Google or public issue link? The archive/image comparison documents a mismatch, but doesn’t establish why Google removed the SDK declarations. I’ve left the package pins and bindings unchanged pending that context.

Copilot AI requested a review from jonathanpeppers November 9, 2026 18:53
jonathanpeppers added a commit that referenced this pull request Nov 22, 2026
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]>
jonathanpeppers added a commit that referenced this pull request Nov 22, 2026
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]>
jonathanpeppers added a commit that referenced this pull request Nov 23, 2026
…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]>

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

do-not-merge PR should not be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[skill-runner] Skill runner report: update-androidsdk-packages

4 participants