diff --git a/patch_v2/files_app/files b/patch_v2/files_app/files index 89083d5..d3e038c 100755 Binary files a/patch_v2/files_app/files and b/patch_v2/files_app/files differ diff --git a/patch_v2/hello_app/hello b/patch_v2/hello_app/hello index 98af913..0e34215 100755 Binary files a/patch_v2/hello_app/hello and b/patch_v2/hello_app/hello differ diff --git a/patch_v2/meow_launcherd/evtool.c b/patch_v2/meow_launcherd/evtool.c index 8a60bbd..70cd6a9 100644 --- a/patch_v2/meow_launcherd/evtool.c +++ b/patch_v2/meow_launcherd/evtool.c @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #ifndef EVIOCGRAB @@ -147,18 +147,15 @@ static void loop_forward(const char *dev, int fwd) fflush(stdout); struct pollfd pfd = { fd, POLLIN, 0 }; unsigned char ev[16]; - unsigned long long nread = 0, nwritten = 0; for (;;) { int r = poll(&pfd, 1, -1); if (r < 0) { perror("poll"); break; } if (pfd.revents & POLLIN) { ssize_t n = read(fd, ev, sizeof ev); if (n != 16) { if (n < 0) perror("read"); continue; } - nread++; print_ev("G", ev); if (fwd) { ssize_t w = write(fd, ev, sizeof ev); - nwritten++; if (w != 16) fprintf(stderr, " write-back failed: %s\n", strerror(errno)); } } diff --git a/patch_v2/meow_launcherd/test_host_icon.c b/patch_v2/meow_launcherd/test_host_icon.c index a8a24e2..9868db9 100644 --- a/patch_v2/meow_launcherd/test_host_icon.c +++ b/patch_v2/meow_launcherd/test_host_icon.c @@ -92,6 +92,7 @@ int main(void) setbuf(stdout, NULL); /* 立即冲刷,abort 前也能看到 printf */ setenv("MEOW_UI_DUMP", "/tmp/icon.ppm", 1); meow_ui_opts o = { FB_W, FB_H }; + (void)o; assert(meow_ui_init(&o) == 0); assert(meow_ui_width() == FB_W && meow_ui_height() == FB_H); diff --git a/patch_v2/meow_launcherd/test_notif_panel.c b/patch_v2/meow_launcherd/test_notif_panel.c index 4ffd7ab..4d35f3d 100644 --- a/patch_v2/meow_launcherd/test_notif_panel.c +++ b/patch_v2/meow_launcherd/test_notif_panel.c @@ -358,7 +358,6 @@ static void test_clear_drag_pure(void) /* mini 状态机:跟手下拉打开(seed 从0 升)→ 松手锚定 */ int seed = 0, p = 0; - int dy = 0; /* 手指下移 300px:reveal=seed+(tly-drag_y0) */ seed = 0; p = mnp_drag_progress(mnp_drag_reveal(seed, 300, PH), FIX, PH); CHECK(p > 0 && p < FIX, "mini open-follow: drag 300px -> partial progress"); diff --git a/patch_v2/meow_watchdog/test_wd_fw b/patch_v2/meow_watchdog/test_wd_fw index da55ff7..30b1939 100755 Binary files a/patch_v2/meow_watchdog/test_wd_fw and b/patch_v2/meow_watchdog/test_wd_fw differ diff --git a/patch_v2/meow_watchdog/test_wd_fw.c b/patch_v2/meow_watchdog/test_wd_fw.c index d1222f6..567091c 100644 --- a/patch_v2/meow_watchdog/test_wd_fw.c +++ b/patch_v2/meow_watchdog/test_wd_fw.c @@ -24,6 +24,25 @@ static void check(const char *name, int got, int want) else { g_fail++; printf("FAIL %s: got %d want %d\n", name, got, want); } } +/* ---- M2.87:SIGUSR1 手势让位(handle_touch 左缘滑动分支)---- + * 判定(meow_watchdog.c):`!g_fw_app && immersive` 才发 SIGUSR1(只给裸沉浸 App); + * SDK 框架 App(g_fw_app=1)不发(返回由 SDK on_swipe 处理),防 SIGUSR1 杀死 App。 */ +static volatile int g_sigusr1_hits = 0; +static void on_sigusr1(int s) { (void)s; g_sigusr1_hits++; } + +/* 经 handle_touch 模拟一次「左缘起点+向右滑」完整手势(press→release),返回 SIGUSR1 命中数。 */ +static int sim_swipe_sigusr1(int fw, int immersive) +{ + g_fw_app = fw; + g_sigusr1_hits = 0; + last_x = 5; last_y = 300; /* 左缘原点(xSWIPE_DX=50) */ + handle_touch(immersive, getpid(), now - 3000, 0); /* release */ + return g_sigusr1_hits; +} + /* 在 / 建目录并写 app.json;写失败返回 -1。 */ static int fixture(const char *base, const char *name, const char *appjson) { @@ -51,6 +70,7 @@ static int expect_fw(const char *base, const char *name, const char *appjson, in int main(void) { + signal(SIGUSR1, on_sigusr1); /* 捕获 handle_touch 可能发出的 SIGUSR1(测命中) */ char dir[] = "/tmp/wdfwXXXXXX"; if (!mkdtemp(dir)) { perror("mkdtemp"); return 2; } @@ -84,6 +104,11 @@ int main(void) /* wd_framework_from_pid:自进程 /proc/self/exe 目录无 app.json -> 0,不崩 */ check("from_pid(no app.json)", wd_framework_from_pid(getpid()), 0); + /* ---- M2.87 SIGUSR1 让位判定(仅裸沉浸 App 发 SIGUSR1)---- */ + check("sigusr1 fw-app (framework=1) -> 0", sim_swipe_sigusr1(1, 1), 0); /* SDK 框架 App:不发 */ + check("sigusr1 bare-immersive -> 1", sim_swipe_sigusr1(0, 1), 1); /* 裸沉浸:发(命中) */ + check("sigusr1 bare-nonimmersive -> 0", sim_swipe_sigusr1(0, 0), 0); /* 裸非沉浸:不发 */ + /* 清理 */ { char path[560]; diff --git a/patch_v2/ncm_app/ncm b/patch_v2/ncm_app/ncm index 92f9260..3bc9af0 100755 Binary files a/patch_v2/ncm_app/ncm and b/patch_v2/ncm_app/ncm differ diff --git a/patch_v2/sdk/meow_ui_log.c b/patch_v2/sdk/meow_ui_log.c index d5125ba..3817ea8 100644 --- a/patch_v2/sdk/meow_ui_log.c +++ b/patch_v2/sdk/meow_ui_log.c @@ -154,11 +154,12 @@ static void sigusr1_guard(int sig) { (void)sig; if (!g_log_open_tried) { g_log_open_tried = 1; log_open(); } - if (g_log_fd >= 0) { - char line[128]; - int n = snprintf(line, sizeof line, "%llu [%s] WARN sigusr1: ignored (guard)\n", - (unsigned long long)meow_ui_time_ms(), g_app_id); - if (n > 0) { ssize_t w = write(g_log_fd, line, (size_t)n); (void)w; } + char line[128]; + int n = snprintf(line, sizeof line, "%llu [%s] WARN sigusr1: ignored (guard)\n", + (unsigned long long)meow_ui_time_ms(), g_app_id); + if (n > 0) { + if (g_log_fd >= 0) { ssize_t w = write(g_log_fd, line, (size_t)n); (void)w; } + else { ssize_t w = write(2, line, (size_t)n); (void)w; } /* 无日志目录:写 stderr,护栏可观测 */ } /* 不 exit、不返回处理:返回交给 on_swipe/SDK。这里仅记录并吞掉。 */ } diff --git a/patch_v2/sdk/test_notif_gesture b/patch_v2/sdk/test_notif_gesture index feb309b..fdbfced 100755 Binary files a/patch_v2/sdk/test_notif_gesture and b/patch_v2/sdk/test_notif_gesture differ diff --git a/patch_v2/sdk/test_notif_open b/patch_v2/sdk/test_notif_open index 5ea8079..46ec474 100755 Binary files a/patch_v2/sdk/test_notif_open and b/patch_v2/sdk/test_notif_open differ