What's new
Android: Audio capture & permission handling
- PerryActivity now requests all manifest permissions at startup — apps declare permissions in
perry.toml(e.g.permissions = ["RECORD_AUDIO"]) and the system dialog appears automatically before native code runs. No manual permission handling needed. - Audio capture API (
perry/system):audioStart(),audioStop(),audioGetLevel(),audioGetPeak()— real-time A-weighted dB(A) measurement via AudioRecord/JNI.
Android: Canvas rendering fixes
- Fixed Canvas widget invisible on Android —
CANVAS_STATESwasthread_local(created on perry-native thread, drawn from UI thread). Now uses globalMutex<HashMap>. - Fixed
drawLineJNI signature typo that silently broke all line drawing. - Canvas
ImageViewnow gets explicitLayoutParamsso it has visible dimensions. - Canvas
Clearnow usesPorterDuff.Mode.CLEARinstead of opaque white fill.
Android: Text rendering fix
- Fixed
set_font_weight()passing nullTypefacetosetTypeface(), which corrupted text to show "undefined". Now creates a valid Typeface viaTypeface.defaultFromStyle().
Audio capture API (all platforms)
- New
perry/systemaudio functions:audioStart,audioStop,audioGetLevel,audioGetPeak,audioGetWaveformSamples,getDeviceModel. - macOS/iOS: AVAudioEngine with block-based tap callback
- Android: AudioRecord via JNI with background Rust thread
- Linux: PulseAudio simple API (
libpulse-simple) - Windows: WASAPI shared-mode capture
- Web:
getUserMedia+AnalyserNode - All platforms share 48kHz A-weighting IIR filter, EMA smoothing, and atomic lock-free state.
perry run android pipeline
perry run androidnow compiles, packages (via Perry Hub), signs with debug keystore, installs viaadb, and launches — full end-to-end workflow.- Fixed
find_library()for cross-compile targets to searchtarget/<triple>/release/relative to the perry executable.
Other
- Upgraded Cranelift from 0.113 to 0.121.
- Windows: enabled geisterhand linking, registered all widget types.