From 74e3cc911b8cecd4f3d75613055c213a8bcebcdb Mon Sep 17 00:00:00 2001 From: OpenAI Codex Date: Mon, 7 Sep 2026 14:21:55 +0800 Subject: [PATCH] fix: preserve WeatherRuntime timeline rejection --- .../ParticleCoreLayerValidationActivity.kt | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/platform/android/MapLibreAndroidTestApp/src/main/java/org/maplibre/android/testapp/activity/particle/ParticleCoreLayerValidationActivity.kt b/platform/android/MapLibreAndroidTestApp/src/main/java/org/maplibre/android/testapp/activity/particle/ParticleCoreLayerValidationActivity.kt index 5590c27b1..036afa78e 100644 --- a/platform/android/MapLibreAndroidTestApp/src/main/java/org/maplibre/android/testapp/activity/particle/ParticleCoreLayerValidationActivity.kt +++ b/platform/android/MapLibreAndroidTestApp/src/main/java/org/maplibre/android/testapp/activity/particle/ParticleCoreLayerValidationActivity.kt @@ -364,14 +364,19 @@ class ParticleCoreLayerValidationActivity : AppCompatActivity() { 2 -> when (value) { 0.5f -> runtime?.setPlaybackSpeed(WeatherRuntime.PlaybackSpeed.HALF); 1.0f -> runtime?.setPlaybackSpeed(WeatherRuntime.PlaybackSpeed.NORMAL); 2.0f -> runtime?.setPlaybackSpeed(WeatherRuntime.PlaybackSpeed.DOUBLE); else -> null } else -> null // Existing fixture-only diagnostic commands remain outside the REAL WEATHER Host facade. } - if (accepted != WeatherRuntime.CommandResult.ACCEPTED && !realWeatherMode && (runtime == null || !maplibreMap.controlRasterArraySourceTimeline(PARTICLE_SOURCE_ID, command, value))) { - Log.i(TAG, "ParticleTimeline: event=REJECTED command=$command") - } else { - timelineState = when (command) { 0 -> "PLAY"; 1 -> "PAUSE"; 6 -> "WAIT"; 7 -> "INVALID"; 8 -> "PAUSE"; else -> timelineState } - if (command == 2) timelineSpeed = "${value}x" - status.text = statusText() - Log.i(TAG, "ParticleTimeline: event=COMMAND command=$command value=$value") + val commandAccepted = when { + accepted == WeatherRuntime.CommandResult.ACCEPTED -> true + realWeatherMode -> false + else -> maplibreMap.controlRasterArraySourceTimeline(PARTICLE_SOURCE_ID, command, value) } + if (!commandAccepted) { + Log.i(TAG, "ParticleTimeline: event=REJECTED command=$command") + return + } + timelineState = when (command) { 0 -> "PLAY"; 1 -> "PAUSE"; 6 -> "WAIT"; 7 -> "INVALID"; 8 -> "PAUSE"; else -> timelineState } + if (command == 2) timelineSpeed = "${value}x" + status.text = statusText() + Log.i(TAG, "ParticleTimeline: event=COMMAND command=$command value=$value") } private fun actionLabel(id: Int): String = when (id) {