Skip to content

Add AdbRunner.EnrichDeviceAsync to populate device metadata via getprop#385

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/add-adbrunner-enrichdeviceasync
Draft

Add AdbRunner.EnrichDeviceAsync to populate device metadata via getprop#385
Copilot wants to merge 2 commits into
mainfrom
copilot/add-adbrunner-enrichdeviceasync

Conversation

Copilot AI commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

adb devices -l does not provide enough metadata for downstream device selection flows (architecture, manufacturer, Android version/SDK). This change adds a canonical opt-in enrichment API in AdbRunner so consumers can stop re-implementing per-device getprop orchestration.

  • API surface: richer AdbDeviceInfo

    • Added nullable properties:
      • CpuAbi
      • Manufacturer
      • ReleaseVersion
      • SdkVersion
    • Updated public API baselines for netstandard2.0 and net10.0.
  • AdbRunner enrichment API

    • Added EnrichDeviceAsync(AdbDeviceInfo device, CancellationToken cancellationToken = default).
    • Behavior:
      • No-op when device.Status != Online.
      • Preserves existing non-empty values.
      • Populates missing values from adb shell getprop in parallel.
      • Uses fallbacks:
        • ABI: ro.product.cpu.abilist (first entry) → ro.product.cpu.abi
        • Manufacturer: ro.product.manufacturerro.product.brand
        • Model refresh: ro.product.model
        • Android version: ro.build.version.release
        • SDK level: ro.build.version.sdk
      • Per-property failures are tolerated (cancellation still propagates).
  • Targeted coverage for new behavior

    • Added tests for:
      • Offline device no-op
      • Field population + preservation of existing values
      • Per-property failure tolerance with fallback resolution
var devices = await adb.ListDevicesAsync(cancellationToken);

foreach (var device in devices.Where(d => d.Status == AdbDeviceStatus.Online))
    await adb.EnrichDeviceAsync(device, cancellationToken);

// device.CpuAbi / Manufacturer / ReleaseVersion / SdkVersion now populated when available

Co-authored-by: rmarinho <1235097+rmarinho@users.noreply.github.com>
Copilot AI changed the title [WIP] Add AdbRunner.EnrichDeviceAsync to populate device information Add AdbRunner.EnrichDeviceAsync to populate device metadata via getprop Jun 2, 2026
Copilot AI requested a review from rmarinho June 2, 2026 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add AdbRunner.EnrichDeviceAsync to populate Architecture/Manufacturer/Version via getprop

2 participants