Skip to content

feat: Android runtime device profiler (1.1.0) - #1

Merged
ucguy4u merged 1 commit into
mainfrom
feat/android-runtime-profiler
Oct 17, 2026
Merged

ucguy4u merged 1 commit into
mainfrom
feat/android-runtime-profiler

Conversation

@ucguy4u

@ucguy4u ucguy4u commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Before: airo_device_profile 1.0.0 was pure Dart. It defined AiroRuntimeDeviceProfiler but shipped only the no-op and fake profilers, so apps such as 360 Unfold had no way to read real RAM or free storage before offering the Gemma download.

After: the package is a Flutter plugin with an Android implementation. AiroAndroidRuntimeDeviceProfiler returns a real profile (API level, total RAM, free app-private storage, memory/storage/thermal pressure, phone/tablet/TV category, security patch age, best-effort decoders and D-pad), classified by the existing AiroRuntimeDeviceProfilePolicy. quickDeviceFit() returns ({int memoryMb, int freeStorageMb}) without building the full profile. On other platforms, or if the plugin fails, it falls back to the no-op profile (and zeros for quickDeviceFit) instead of throwing. No permissions in the manifest, no network calls, API 24 to 36 (thermal is only read on API 29+). Version is 1.1.0; README lists which fields are real and which are defaults.

How: a Kotlin AiroDeviceProfilePlugin answers getSignals on the airo_device_profile method channel with a map of raw values. A pure-Dart mapper (airoAndroidSignalsFromMap) turns that map into AiroRuntimeDeviceSignals, and the profiler hands those to the policy, the same way AiroFakeRuntimeDeviceProfiler does. The mapper and profiler are unit-tested with a mocked method channel (41 tests pass, flutter analyze clean). example/ prints the profile. The Android build file follows the current Flutter plugin template (AGP 9, built-in Kotlin).

Note: the Kotlin was not compiled locally, because there is no Android SDK in the environment. Please build the example on a device or in CI before merging.

Not done here: publishing to pub.dev.


Generated by Claude Code

Make the package a Flutter plugin with an Android implementation.
AiroAndroidRuntimeDeviceProfiler reads API level, RAM, free app-private
storage, memory/thermal pressure, UI mode, security patch and decoder
info over the airo_device_profile method channel, maps it with a
pure-Dart mapper and classifies it with AiroRuntimeDeviceProfilePolicy.
Falls back to the no-op profile off Android. Adds quickDeviceFit().
No permissions, no network calls, API 24 to 36.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RxXoWLQRgXsmwAQhoTDdcP
@ucguy4u
ucguy4u marked this pull request as ready for review October 17, 2026 13:19
@ucguy4u
ucguy4u merged commit d684db3 into main Oct 17, 2026
1 check passed
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.

2 participants