feat(sdk+launcher): SDK nav/media封装 + §10.5 App前台唤起通知中心 (agent-206) — meow_ui_nav.c(env栈初始化+report/request_exit) + meow_ui_media.c(懒连断线重连, meta上报+playctl接收) + MSG_NOTIF_OPEN=0x28/CLOSE=0x29(0x25/26已被占); SDK顶部下滑手势→IPC; launcher App前台会话叠加通知中心(SIGSTOP→读帧→接管输入→恢复SIGCONT, 面板内App崩溃即关); hello接线验证

meow_ui.a→9a8eb7ef; hello→fc299577; launcher→b33da20a; 宿主5套件+新test_notif_open+qemu分发 全过
出入: SDK符号用meow_ui_前缀防与launcher内同名冲突; 叠加会话真机待验; §10.5文档旧号段已过时
This commit is contained in:
MeowOS committed 2026-08-31 07:53:57 +08:00
1 parent 21519ce2e4
commit 9b4195724c
37 files changed
+1042 -21

No files matched your search

+25
View File
@@ -8,6 +8,8 @@
* 契约(MEOW_APP_SDK.md §1/§3/§6):应用只调 meow_ui API。
*/
#include "hello_internal.h"
#include "meow_ui_nav.h" /* ①:App 侧 M3 导航上报封装(上报页面深度/顶层) */
#include "meow_ui_media.h" /* ②:媒体会话封装(demo 页按钮上报 META + 收 PLAYCTL) */
#include <signal.h>
/* Dialog / BottomSheet(阻塞模态;非控件,main() 创建一次,demo 页打开/关) */
@@ -20,6 +22,24 @@ static meow_view *g_demo_view;
static void on_sigterm(int s) { (void)s; meow_ui_request_exit(); }
/* ② 媒体会话播放控制回调(launcher 下发 MSG_PLAYCTL 到最活跃媒体会话)。 */
static void demo_media_playctl(int cmd, int64_t seek_ms)
{
meow_log(MEOW_LOG_INFO, "media playctl cmd=%d seek=%lld", cmd, (long long)seek_ms);
}
/* ① 导航上报:把当前 Activity 栈深/顶层报给 launcher(M3 导航栈)。每个页面 on_enter 时调用
* (view_page_push/pop 会同步触发新页 on_enter),保证 pop/push 后 launcher 的 nav_stack 跟随。
* depth 取 meow_ui_activity_depth()(实际 push 页数,≥1);top 取 activity id 映射的字符串。 */
void hello_nav_report(void)
{
int depth = meow_ui_activity_depth();
if (depth <= 0) depth = 1;
int id = meow_ui_activity_active();
const char *top = (id == ACT_FULL) ? "full" : (id == ACT_DEMO) ? "demo" : "home";
meow_ui_nav_report((uint32_t)depth, top);
}
/* ============================================================ */
/* 事件分发:meow_ui_run 平铺回调 → 当前页 */
/* ============================================================ */
@@ -79,6 +99,11 @@ int main(void)
meow_ui_opts o = { 480, 720 };
if (meow_ui_init(&o) != 0) { meow_log(MEOW_LOG_ERROR, "init failed"); return 1; }
meow_theme_add_listener(NULL);
meow_ui_nav_init(); /* ① 读 MEOW_ACTIVITY/MEOW_CHAIN 初始化导航栈 */
meow_ui_media_init(NULL); /* ② app_id=env MEOW_LOG_APP */
/* ② 注册播放控制回调(launcher 经媒体会话下发 MSG_PLAYCTL):hello 只打日志验证。 */
meow_ui_media_on_playctl(demo_media_playctl);
signal(SIGTERM, on_sigterm);