通知模型补全(agent-107: SDK icon+update_progress / IPC urgency+MSG_NOTIFY_PROGRESS / 存储 urgency+icon回退+progress / CSV加3列) + 全屏收合视觉+滑条(agent-108)
This commit is contained in:
1 parent
b3e57d4b55
commit
e8fa373a2f
18 files changed
+410
-56
No files matched your search
@@ -49,6 +49,7 @@ static void launcher_map(const m_notify_t *mn, meow_notif_t *n)
|
||||
snprintf(n->target_activity, sizeof n->target_activity, "%s", mn->target_activity);
|
||||
n->expire_timeout = mn->expire_timeout;
|
||||
n->progress = mn->progress;
|
||||
n->urgency = mn->urgency; /* 0-3;旧调用=0 → LOW(静默) */
|
||||
n->ongoing = mn->ongoing;
|
||||
n->media = mn->media;
|
||||
}
|
||||
@@ -59,6 +60,15 @@ static void launcher_map(const m_notify_t *mn, meow_notif_t *n)
|
||||
static int g_listen_fd = -1;
|
||||
static int g_stop = 0;
|
||||
static uint32_t g_posted_nid = 0;
|
||||
static meow_notif_t g_stored; /* 回读 launcher 存储的最近一条通知(store_cb) */
|
||||
static int g_store_called = 0;
|
||||
|
||||
static int store_cb(const meow_notif_t *n, void *ctx)
|
||||
{
|
||||
(void)ctx;
|
||||
if (n) { g_stored = *n; g_store_called = 1; }
|
||||
return 1; /* 只取第一条 */
|
||||
}
|
||||
|
||||
static void reply_ack(int c, uint16_t type, uint32_t req_id, uint32_t status)
|
||||
{
|
||||
@@ -130,13 +140,21 @@ int main(void)
|
||||
|
||||
/* SDK send → launcher 真存储。media + ONGOING 走全部映射分支。 */
|
||||
meow_notify nt; memset(&nt, 0, sizeof nt);
|
||||
nt.cat = MEOW_NOTIFY_CAT_MEDIA; nt.urgency = MEOW_NOTIFY_URG_NORMAL;
|
||||
nt.cat = MEOW_NOTIFY_CAT_MEDIA; nt.urgency = MEOW_NOTIFY_URG_HIGH;
|
||||
nt.title = "正在播放"; nt.timeout_ms = -1; nt.progress = 40;
|
||||
nt.icon = "os.meow.hello/icon.png";
|
||||
uint32_t nid = meow_notify_ipc_send(&nt, 0);
|
||||
check("send 经 launcher 真存储回 nid>0", nid != 0);
|
||||
check("send 拿到 launcher 分配的 nid(与 post 一致)", g_posted_nid == nid);
|
||||
check("launcher 存储 count(media app)=1", meow_notif_count("intgapp") == 1);
|
||||
|
||||
/* 回读 launcher 存储,验证 urgency/icon/progress 全链路落库 */
|
||||
g_store_called = 0; memset(&g_stored, 0, sizeof g_stored);
|
||||
meow_notif_list(NULL, store_cb, NULL);
|
||||
check("post 存储 urgency=HIGH(2)", g_store_called && g_stored.urgency == MEOW_NOTIFY_URG_HIGH);
|
||||
check("post 存储 icon→app_icon", g_stored.app_icon[0] && !strcmp(g_stored.app_icon, "os.meow.hello/icon.png"));
|
||||
check("post 存储 progress=40", g_stored.progress == 40);
|
||||
|
||||
/* SDK dismiss → launcher 撤下 */
|
||||
meow_notify_ipc_dismiss(nid);
|
||||
check("dismiss 后 launcher 存储 count=0", meow_notif_count("intgapp") == 0);
|
||||
|
||||
Reference in new issue
Block a user