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:
1 parent
21519ce2e4
commit
9b4195724c
37 files changed
+1042
-21
No files matched your search
@@ -280,3 +280,55 @@ void meow_notify_ipc_update_progress(uint32_t nid, int progress)
|
||||
}
|
||||
close(fd);
|
||||
}
|
||||
|
||||
/* ---- 通用一次性帧(meow_ui_nav / notif_open 复用本传输层) ---- */
|
||||
int meow_notify_ipc_send_raw(uint16_t type, const void *payload, uint32_t len, int want_ack)
|
||||
{
|
||||
int fd = conn_path(ipc_sock_path());
|
||||
if (fd < 0) return -1;
|
||||
set_ack_timeout(fd);
|
||||
if (!send_frame(fd, type, 0, payload, len)) { close(fd); return -1; }
|
||||
if (want_ack) {
|
||||
/* 阻塞读一帧应答头(best-effort:读到即确认 launcher 已处理;内容不关心)。
|
||||
* 超时(SO_RCVTIMEO)/断开 → read_all 返回 0,视为已发出(不崩)。 */
|
||||
uint8_t rhdr[MEOW_IPC_HDR_LEN];
|
||||
if (read_all(fd, rhdr, sizeof rhdr)) {
|
||||
/* 读完应答负载(若声明),保持连接语义一致;不校验 magic(best-effort) */
|
||||
uint32_t rlen;
|
||||
memcpy(&rlen, rhdr + 12, 4);
|
||||
if (rlen > 0 && rlen <= MEOW_IPC_MAX) {
|
||||
uint8_t pay[256];
|
||||
size_t to = rlen < sizeof pay ? rlen : sizeof pay;
|
||||
(void)read_all(fd, pay, to);
|
||||
}
|
||||
}
|
||||
}
|
||||
close(fd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void meow_notify_ipc_notif_open(const char *app_id, uint32_t event_seq,
|
||||
uint16_t origin_x, uint16_t origin_y,
|
||||
uint16_t hotzone, uint8_t flags)
|
||||
{
|
||||
m_notif_open_t o;
|
||||
memset(&o, 0, sizeof o);
|
||||
snprintf(o.app_id, sizeof o.app_id, "%s",
|
||||
(app_id && app_id[0]) ? app_id : meow_notify_ipc_app_id());
|
||||
o.event_seq = event_seq;
|
||||
o.origin_x = origin_x;
|
||||
o.origin_y = origin_y;
|
||||
o.hotzone = hotzone;
|
||||
o.flags = flags;
|
||||
(void)meow_notify_ipc_send_raw(MSG_NOTIF_OPEN, &o, (uint32_t)sizeof o, 1);
|
||||
}
|
||||
|
||||
void meow_notify_ipc_notif_close(const char *app_id, uint32_t reason)
|
||||
{
|
||||
m_notif_close_t o;
|
||||
memset(&o, 0, sizeof o);
|
||||
snprintf(o.app_id, sizeof o.app_id, "%s",
|
||||
(app_id && app_id[0]) ? app_id : meow_notify_ipc_app_id());
|
||||
o.reason = reason;
|
||||
(void)meow_notify_ipc_send_raw(MSG_NOTIF_CLOSE, &o, (uint32_t)sizeof o, 1);
|
||||
}
|
||||
Reference in new issue
Block a user