Radiophonia 1.3.1 and 1.3.2 focus on two fronts since v1.3.0: hardening platform behaviour where stores, desktops, and streams behave differently from dev machines, and adding three user-facing features built on the existing stack — a configurable full-screen artwork clock overlay with OLED burn-in protection, podcast Up Next reordering and multi-part series tools, and a redesigned Settings layout.

Amazon Fire TV IAP: How Missing R8 Rules Triggered an Infinite Play Billing Loop
The Problem
Our Fire TV submission failed Amazon Appstore review with an ugly symptom: pressing Upgrade to Premium spun on “Processing…” forever without opening Amazon’s purchase sheet. Debug builds didn’t reproduce it, which pointed straight at release minification — and the fallback behind it:
- R8 stripped Amazon Appstore SDK internals:
android/app/proguard-rules.prolacked keep rules forcom.amazon.**and*Annotation*. In release APKs, R8 removed reflection metadata that the Amazon Appstore SDK needs to bind, causing Amazon IAP initialisation to fail cleanly enough to returnfalse. - Play Billing’s infinite reconnect loop on non-Play devices: When Amazon IAP returned
false,StorePurchaseServicefell back toin_app_purchase_android. On a Fire TV Stick with no Google Play Services,BillingClientManager.runWithClientretriesBillingResponse.serviceDisconnectedin an infinite backoff loop rather than surfacing unavailability — leaving the Flutter UI waiting for a result that never resolves. - Bridge lifecycle and signed-out fulfillment gaps: The native
MainActivity.ktAmazon IAP bridge also needed earlier listener registration inonCreate, explicit UI-thread callback marshalling (runOnUiThread), safe init retries after transient failures, andnotifyFulfillmenthandling for signed-out purchases and canceled receipts.
The Solution
- Added
-keep class com.amazon.** { *; }and-keepattributes *Annotation*toandroid/app/proguard-rules.proso release builds keep the Amazon Appstore SDK intact. - Made Play Billing instantiation lazy in
StorePurchaseServiceand pinnedSTORE_CHANNEL=amazonAppstorebuilds (_forceAmazonIap) strictly to the Amazon channel — they never construct or queryInAppPurchase.instance, even if Amazon SDK init returns an error. - Reworked the
com.gibbsoft.radiophonia/amazon_iapbridge inMainActivity.ktto registerPurchasingService.registerListenerinonCreate, marshal every response callback to the Android UI thread, clear canceled states, callnotifyFulfillmentfor signed-out local grants as well as server-validated ones, and allow clean re-initialisation retries. - Added regression coverage in
test/services/store_purchase_service_test.dartexercising Amazon init timeout, fallback suppression, and canceled/fulfilled states.
The Lesson
Fallback logic across mutually exclusive store SDKs is dangerous: if SDK A fails in release mode (say, because of R8) and falls through to SDK B whose retry loop never terminates on that hardware, a recoverable init error turns into an infinite hang. Make store channel selection a build-time invariant, not a runtime fallback.
Full-Screen Artwork Clock and OLED Burn-In Protection
The Problem
Radiophonia runs full screen on living-room Google TV and Fire TV sets as well as bedside tablets and desktops, and listeners asked for a subtle clock on top of full-screen album artwork. Two constraints shaped the design: it must never leave static bright pixels parked on OLED panels, and it must not wake the widget tree once per second when seconds aren’t shown.
The Solution
Built a self-contained clock subsystem (ClockSettings, ClockSettingsScreen, and ArtworkClockOverlay):
- Two faces, five typography styles:
ArtworkClockOverlayrenders either a custom-drawn_AnalogClockPainteror a formatted digital clock in Modern, Bold, Classic serif, Mono, or a geometric custom-drawn 7-segment LED painter (_SevenSegmentPainter). Options includeSystem/24-hour/12-hour, optional seconds, optional flashing colon (:), four corner/centre positions, scaling up to 300%, and independent foreground/backdrop swatches and opacity sliders. - Boundary-aligned timer scheduling:
_ArtworkClockOverlayStateschedules a single-shotTimeraligned to the next exact second only whenshowSeconds || (style == digital && flashColon). Otherwise it schedules straight to the next minute boundary (:00), avoiding 59 needless rebuilds per minute. - Unified OLED burn-in drift (
BurnInDrift): Rather than shifting only the clock,ArtworkClockOverlay.burnInOffsetForcomputes a smooth Lissajous orbit (step = now.millisecondsSinceEpoch ~/ 120000, every two minutes) shared across every static overlay on full-screen artwork — the clock, the “i” song-notes button, and the purple playing meter. - Non-intrusive and device-local:
ClockSettingsis omitted fromPreferencesRepository.syncableKeysso a living-room TV’s 250% corner clock never overwrites your phone; the overlay wraps itself inIgnorePointerso tapping anywhere still closes full-screen artwork; and it hides automatically whileSongNotesOverlayis open.ClockSettingsScreenadapts live previews side-by-side on wide/TV screens and pinned at the top on mobile.
The Lesson
Burn-in mitigation on an ambient screen has to be a property of the whole overlay layer, not one widget — shifting the clock while leaving the "i" badge or playing meter anchored at fixed pixel coordinates solves half the problem.
Podcast Queues and Multi-Part Series: Reordering Without Breaking Sync
The Problem
Radiophonia’s podcast Up next queue previously sorted entries strictly by episode state timestamps, which meant you couldn’t drag episodes into your preferred listening order, defer an episode to the back of the queue (Play later), or reset an accidentally tapped episode back to unplayed. Worse, multi-part series that vary their titles slightly — say Part 1, Part Two, IV, or a differently-named finale — forced listeners to scroll blindly through long feeds to line up the rest of the story.
The Solution
- Synced Up Next reordering without a sidecar table: Anchored explicit Up Next ordering timestamps in
PodcastRepositoryso mobile/desktop drag handles (ReorderableListViewcleanly integrated inside the outer scroll view), TV remote menu actions (Move up,Move down,Move to bottom), Play later (end of Up next), and Mark as unplayed persist reliably across restarts and sync through the existing episode-state sync model without inventing a fragile second priority list. - Automatic schema migration (
feedFormat = 4): BumpedPodcastRepository.feedFormatto4so cached podcast feeds from earlier versions automatically re-parse once to populate<itunes:season>and<itunes:episode>. That unlocks Newest first / Oldest first sorting plus All / Unplayed / In progress and Season filter chips on every show page. - Series & chronological neighbour finder (
podcast_series.dart+PodcastSeriesSheet): Find other parts detects series markers (Part 4,Pt. 4,Part Four, Roman numerals,4/6,#4, or matching<itunes:season>), extracts the series stem, offers one-tap Queue in order / Queue unplayed buttons, and always displays the chronological neighbours published right before and after the episode so an irregularly titled episode right next to it is one click away.
The Lesson
Encoding user-reordered queue positions into monotonic timestamps on the existing synced entity avoids dual-source-of-truth merge conflicts when two devices sync offline changes.
Desktop Power Efficiency, Station Hygiene, and the Play Store Rollout Trap (v1.3.1)
Between v1.3.0 and v1.3.2, v1.3.1 shipped several infrastructure fixes worth calling out:
Platform-Aware Desktop Efficiency (EfficiencyModeService)
Desktop listeners often leave Radiophonia minimized for hours. Listening to WindowListener focus/minimize transitions and active playback/recording state, EfficiencyModeService transitions each desktop OS between normal, lowPowerAudio, and lowPowerIdle over a com.gibbsoft.radiophonia/efficiency_mode channel:
- Windows (
windows/runner/efficiency_mode.cpp): UsesSetProcessInformation(ProcessPowerThrottling)(EcoQoS) paired withBELOW_NORMAL_PRIORITY_CLASSwhile streaming/recording (protecting audio buffers from starvation) andIDLE_PRIORITY_CLASS(Task Manager green leaf) when paused or stopped. - macOS (
macos/Runner/AppDelegate.swift): HoldsProcessInfo.processInfo.beginActivity(options: .userInitiatedAllowingIdleSystemSleep)only while streaming/recording in the background, releasing it when idle so macOS places the process straight into App Nap. - Linux (
linux/runner/my_application.cc): Lowers process niceness (+5audio /+10idle) viasetpriorityonly after checkingRLIMIT_NICEpermits restoring priority cleanly back to0on foregrounding.
Why Google Play’s API Told Us a Draft Was Live
Our version.json update check began offering v1.3.0 to Android Play users before Google Play had actually published it. The culprit was the Google Play Developer API’s tracks/production endpoint: it flips status to "completed" as soon as CI submits a 100% rollout — before Google Play human review approves and serves the APK. Switching scripts/store_monitor.py to parse the live public Play Store listing page directly — and adding an in-app InAppUpdate.checkForUpdate() gate on Play builds before showing a deferrable prompt — ensures regional or review lag can never trap users in an update loop.
Central Station Hygiene, Homepage Icons, ICY Encodings, and iOS DLNA
- Unified eligibility (
StationEligibilityService): Moved station filtering centrally ontoStationCacheService(covering Discover, Browse, Search, Voice, CarPlay, and Android Auto): drops bundledassets/curated/blacklist.jsonentries everywhere except existing Favourites (“Unreachable”), hides stale stations (lastcheckoktime_iso8601older than 7 days) from discovery, filters FLV and plainhttp://streams on the HTTPS web build, and suppresses stations after 2 consecutive terminal start failures in device-localStationFailureMemory(7-day decay, cleared immediately on playback). - Direct homepage icon fallback (
HomepageIconService): For stations with missing, broken, or.icofavicons in RadioBrowser (such as8080sandBFBS),StationAvatarnow resolvesapple-touch-icon, PNG<link rel="icon">, orog:imagedirectly from the station’s ownhomepageand caches it locally in Hive — zero third-party proxy, and kept inert in widget tests untilmain()initializes it so timer tests stay deterministic. - European ICY encodings (
IcyMetadataService): Shoutcast/Icecast streams frequently send track metadata in Windows-1252 or ISO-8859-1 rather than UTF-8. Added strict UTF-8 validation with Windows-1252/ISO-8859-1 fallback, ICY NUL trimming, and double-encoded UTF-8 mojibake repair (ö→ö). - Stream & route fixes: Migrated bundled Absolute Radio stations from retired
sharp-stream.comhosts to Bauer’sstream-ar.hellorayo.co.uk(carryingaw_0_1st.skey), treateddock,remoteSubmix, andcarAudioroute disconnects like Bluetooth disconnects to fix wired Android Auto unplugging, and enabled Apple’s approvedcom.apple.developer.networking.multicastentitlement so iOS discovers local DLNA/UPnP servers automatically. - Settings consolidation: Collapsed 12 flat Settings sections into 5 grouped Material 3 cards inside a centered
720 pxcolumn, moved Recording options toRecordingSettingsScreenwith a live summary row, moved achievement notification toggles intoBadgesScreen, and cachedPackageInfo.fromPlatform().
By the Numbers
- 1,680+ unit & widget tests passing across
test/(up from 1,624 in v1.3.0), zero analyzer issues - 3 native desktop power-management implementations (Windows 11 EcoQoS, macOS App Nap, Linux
RLIMIT_NICE-guardedsetpriority) - 5 clock typography styles (incl. custom 7-segment LED painter) + 1 custom Analog clock painter
- 120 s Lissajous burn-in drift cadence shared across full-screen artwork overlays
- 12 → 5 grouped Material 3 Settings cards inside a
720 pxmax-width layout feedFormat = 4podcast catalogue version triggering automatic one-time<itunes:season>/<itunes:episode>backfill
Lessons
- Test release minification and missing-store-service devices together. ProGuard/R8 stripping a third-party store SDK looks like “store SDK init returned false”, and any fallback into Google Play Billing on non-Play Android hardware can spin indefinitely.
- Store submission status is not public availability. Developer APIs often report a rollout as
"completed"the moment the bundle enters review; verify what end users actually see on the storefront and double-check via platform in-app update APIs. - Power policy belongs with lifecycle and audio state. A minimized desktop player shouldn’t run at normal priority while paused, and shouldn’t starve audio decoders on efficiency cores while streaming — splitting into
normal,lowPowerAudio, andlowPowerIdlefits all three desktop OSes cleanly.
Radiophonia 1.3.2 is live from radiophonia.app (including the web app at radiophonia.app/live/). Direct-download artifacts are published on the Radiophonia v1.3.2 release page.