From b04f9d17ffe3e1b287f61f0d9e9ff1c36041d7a5 Mon Sep 17 00:00:00 2001
From: Scott Murray <scott.murray@konsulko.com>
Date: Thu, 13 Feb 2025 10:15:37 -0500
Subject: [PATCH] meta-agl-flutter: fix sample app installation

Fix TOML configuration file installation in the recipe for
the flutter-samples-material-3-demo sample app used in
agl-image-flutter.  Also tweak command-line in its systemd
unit to match embedder expectations.

Bug-AGL: SPEC-5362

Change-Id: I048b937bf5622504634f53c979b5442f3c325645
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Reviewed-on: https://gerrit.automotivelinux.org/gerrit/c/AGL/meta-agl/+/30838
ci-image-build: Jenkins Job builder account
Reviewed-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
Tested-by: Jenkins Job builder account
ci-image-boot-test: Jenkins Job builder account
(cherry picked from commit d3f1152d768fa4d9b0e42e82bf26193cdbb90283)
Reviewed-on: https://gerrit.automotivelinux.org/gerrit/c/AGL/meta-agl/+/30839
---
 .../flutter-samples-material-3-demo.service                   |  2 +-
 .../flutter-samples-material-3-demo_aglflutter.inc            | 11 +++--------
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/meta-agl-flutter/dynamic-layers/flutter-apps-layer/recipes-graphics/flutter-apps/first-party/flutter-samples-material-3-demo/flutter-samples-material-3-demo.service b/meta-agl-flutter/dynamic-layers/flutter-apps-layer/recipes-graphics/flutter-apps/first-party/flutter-samples-material-3-demo/flutter-samples-material-3-demo.service
index f3f4a94b1..f0b475baf 100644
--- a/meta-agl-flutter/dynamic-layers/flutter-apps-layer/recipes-graphics/flutter-apps/first-party/flutter-samples-material-3-demo/flutter-samples-material-3-demo.service
+++ b/meta-agl-flutter/dynamic-layers/flutter-apps-layer/recipes-graphics/flutter-apps/first-party/flutter-samples-material-3-demo/flutter-samples-material-3-demo.service
@@ -7,7 +7,7 @@ User=agl-driver
 EnvironmentFile=/etc/default/flutter
 EnvironmentFile=-/etc/default/flutter-samples-material-3-demo
 Environment=XDG_RUNTIME_DIR=/run/user/1001/
-ExecStart=/usr/bin/flutter-auto -b /usr/share/flutter/flutter-samples-material-3-demo/${FLUTTER_VERSION}/${FLUTTER_RUNTIME} -xdg-shell-app-id flutter-samples-material-3-demo
+ExecStart=/usr/bin/flutter-auto -b /usr/share/flutter/flutter-samples-material-3-demo/${FLUTTER_VERSION}/${FLUTTER_RUNTIME} --xdg-shell-app-id flutter-samples-material-3-demo
 
 [Install]
 WantedBy=graphical.target
diff --git a/meta-agl-flutter/dynamic-layers/flutter-apps-layer/recipes-graphics/flutter-apps/first-party/flutter-samples-material-3-demo_aglflutter.inc b/meta-agl-flutter/dynamic-layers/flutter-apps-layer/recipes-graphics/flutter-apps/first-party/flutter-samples-material-3-demo_aglflutter.inc
index 971756ad7..ebdf65d42 100644
--- a/meta-agl-flutter/dynamic-layers/flutter-apps-layer/recipes-graphics/flutter-apps/first-party/flutter-samples-material-3-demo_aglflutter.inc
+++ b/meta-agl-flutter/dynamic-layers/flutter-apps-layer/recipes-graphics/flutter-apps/first-party/flutter-samples-material-3-demo_aglflutter.inc
@@ -1,6 +1,8 @@
 FILESEXTRAPATHS:prepend := "${THISDIR}/flutter-samples-material-3-demo:"
 
-SRC_URI += "file://flutter-samples-material-3-demo.service"
+SRC_URI += "file://flutter-samples-material-3-demo.service \
+            file://flutter-samples-material-3-demo.toml \
+"
 
 APP_CONFIG = "flutter-samples-material-3-demo.toml"
 
@@ -8,13 +10,6 @@ inherit systemd
 
 do_install:append() {
     install -D -m 0644 ${WORKDIR}/${BPN}.service ${D}${systemd_system_unitdir}/${BPN}.service
-
-    # determine build type based on what flutter-engine installed.
-    for runtime_mode in ${FLUTTER_RUNTIME_MODES}
-    do
-        install -D -m 0644 ${WORKDIR}/${APP_CONFIG} \
-            ${D}${datadir}/flutter/${PUBSPEC_APPNAME}/${FLUTTER_SDK_VERSION}/${runtime_mode}/config.toml
-    done
 }
 
 RDEPENDS:${PN} += "agl-flutter-env"
-- 
2.16.6