Skip to content

[cleanup] Delete unused public types from inlined platform-support projects#11612

Merged
jonathanpeppers merged 4 commits into
mainfrom
jonathanpeppers/delete-dead-public-types
Jun 10, 2026
Merged

[cleanup] Delete unused public types from inlined platform-support projects#11612
jonathanpeppers merged 4 commits into
mainfrom
jonathanpeppers/delete-dead-public-types

Conversation

@jonathanpeppers

Copy link
Copy Markdown
Member

Follow-up to #11607.

The three inlined android-platform-support projects (src/Xamarin.AndroidTools/, src/Mono.AndroidTools/, src/Xamarin.Installer.AndroidSDK/) ship via MicrosoftAndroidSdkOutDir, but a lot of their surface area is dead. This pass deletes public (and a handful of related internal) types that have zero callers anywhere in the repo and are not transitively reachable from the live external surface (the bits consumed by Xamarin.Android.Build.Debugging.Tasks and Xamarin.Installer.Build.Tasks).

Verified by iterative delete + build: all five affected projects build clean.

src/Xamarin.AndroidTools/Xamarin.AndroidTools.csproj
src/Mono.AndroidTools/Mono.AndroidTools.csproj
src/Xamarin.Installer.AndroidSDK/Xamarin.Installer.AndroidSDK.csproj
src/Xamarin.Installer.Build.Tasks/Xamarin.Installer.Build.Tasks.csproj
src/Xamarin.Android.Build.Debugging.Tasks/Xamarin.Android.Build.Debugging.Tasks.csproj

Summary

Project Types removed Files LOC
Mono.AndroidTools DeviceConnection, AdbStartServerProcess, AdbStartWindowsServerProcess, IAdbStartServerProcess, Win32Interop and its P/Invoke types (CreateProcessFlags, HandleFlags, ProcessInfo, ProcessWaitHandle, SafeProcessHandle, SecurityAttributes, StartF, StartupInfo) 4 deleted 1198
Xamarin.AndroidTools RegistryEx (file + nested), Wow64, AndroidVersionExtensions, Utils, AmIntentCommandParser, dead ExecutionConfiguration(string, string) overload 4 deleted, 3 modified 702
Xamarin.Installer.AndroidSDK CustomVSAndroidLicensesStorage, SystemImageSpec, IAndroidArchive, IAndroidComponentDescriptor, IProgressMonitorFactory 4 deleted, 1 modified 137
Total 15 files 2,037

jonathanpeppers and others added 3 commits June 9, 2026 12:13
…Tools

Continues #11607 by deleting public types that have zero callers in
the repo and aren't transitively reachable from the live external surface
consumed by Xamarin.Android.Build.Debugging.Tasks and
Xamarin.Installer.Build.Tasks.

Mono.AndroidTools deletions:
- Adb/DeviceConnection.cs (DeviceConnection)
- Internal/AdbStartServerProcess.cs (IAdbStartServerProcess, AdbStartServerProcess)
- Internal/AdbStartWindowsServerProcess.cs (AdbStartWindowsServerProcess)
- Util/Win32Interop.cs (Win32Interop, ProcessInfo, SecurityAttributes,
  StartupInfo, StartF, HandleFlags, CreateProcessFlags, SafeProcessHandle,
  ProcessWaitHandle)

Xamarin.AndroidTools deletions:
- Sdks/RegistryEx.cs (entire file - internal class with zero callers)
- OS.cs: nested internal RegistryEx class and Wow64 enum (no callers)
- AndroidVersion.cs: AndroidVersionExtensions.ToLegacyVersion (no callers)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…arin.AndroidTools

- Delete Utils.cs (Xamarin.AndroidTools): all members unused by consumers.
- Delete CustomVSAndroidLicensesStorage.cs: unused.
- Delete SystemImageSpec.cs: unused.
- Delete IAndroidArchive.cs and IAndroidComponentDescriptor.cs: only
  referenced by each other, no implementers.

All five downstream csprojs build cleanly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Delete AmIntentCommandParser.cs and the matching
  ExecutionConfiguration(string, string) constructor: only consumer
  (RunActivity.cs) calls the (string, AmIntentCommand) overload.
- Remove IProgressMonitorFactory interface from IProgressMonitor.cs:
  no callers anywhere in the repo.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 9, 2026 17:35

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.

Pull request overview

This PR continues the android-platform-support inlining cleanup by removing unused public (and related internal) types from the inlined platform-support projects that ship via MicrosoftAndroidSdkOutDir, reducing dead surface area while keeping the in-repo consumers building.

Changes:

  • Removed legacy/unused ADB start-server helpers, Win32 interop types, and a direct-to-daemon DeviceConnection implementation from Mono.AndroidTools.
  • Removed unused debugging helpers (intent parser + ExecutionConfiguration string overload), obsolete utility shims, and Windows registry helpers from Xamarin.AndroidTools.
  • Removed unused installer/SDK-manager model and helper interfaces/types from Xamarin.Installer.AndroidSDK (including SystemImageSpec and a custom license storage implementation).

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/Xamarin.Installer.AndroidSDK/Xamarin.Installer.AndroidSDK/SystemImageSpec.cs Deletes unused public system-image spec type.
src/Xamarin.Installer.AndroidSDK/Xamarin.Installer.AndroidSDK/IProgressMonitor.cs Removes unused IProgressMonitorFactory interface.
src/Xamarin.Installer.AndroidSDK/Xamarin.Installer.AndroidSDK/Common/IAndroidComponentDescriptor.cs Deletes unused component-descriptor interface.
src/Xamarin.Installer.AndroidSDK/Xamarin.Installer.AndroidSDK/Common/IAndroidArchive.cs Deletes unused archive interface.
src/Xamarin.Installer.AndroidSDK/Xamarin.Installer.AndroidSDK/Common/CustomVSAndroidLicensesStorage.cs Deletes unused custom license storage implementation.
src/Xamarin.AndroidTools/Utils.cs Deletes obsolete utility shim with no remaining callers.
src/Xamarin.AndroidTools/Sdks/RegistryEx.cs Deletes unused registry helper implementation.
src/Xamarin.AndroidTools/OS.cs Removes now-dead embedded RegistryEx helper from OS.cs.
src/Xamarin.AndroidTools/Debugging/ExecutionConfiguration.cs Removes unused constructor overload taking a string run command.
src/Xamarin.AndroidTools/Debugging/AmIntentCommandParser.cs Deletes unused am command parser implementation.
src/Xamarin.AndroidTools/AndroidVersion.cs Removes unused legacy extension method AndroidVersionExtensions.
src/Mono.AndroidTools/Util/Win32Interop.cs Deletes unused Win32 interop/pinvoke definitions.
src/Mono.AndroidTools/Internal/AdbStartWindowsServerProcess.cs Deletes unused Windows-specific adb start-server workaround implementation.
src/Mono.AndroidTools/Internal/AdbStartServerProcess.cs Deletes unused adb start-server process wrapper and related interface.
src/Mono.AndroidTools/Adb/DeviceConnection.cs Deletes unused direct adb-daemon connection implementation.

@jonathanpeppers

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@jonathanpeppers jonathanpeppers added the ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable). label Jun 10, 2026
@jonathanpeppers jonathanpeppers merged commit 2d62cbb into main Jun 10, 2026
40 checks passed
@jonathanpeppers jonathanpeppers deleted the jonathanpeppers/delete-dead-public-types branch June 10, 2026 14:56
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.

3 participants