公开 SDK 落后主仓的一批 bugfix(主仓是固件构建源,这些修复已在设备上跑过)。 本次只做「主仓 → 公开仓」单向同步,图像栈方向由主仓侧另一单处理。 时钟 ABI(M16 第二弹,原文件自认「残余未修」): - meow_ui_time.c 147→345 行:futex 相对超时接管(__timedwait/_cp)、 timerfd_create/settime/gettime 的 itimerspec 64↔32 双向转换、 __clock_settime64 越界返 ENOTSUP,另有 4 个纯换算函数 - meow_ui_internal.h:struct meow_time32 / meow_itimerspec32 契约移入内部头 - CLOCK_ABI.md:补接管机制、验证配方与 objdump 证据 - 新增 test_meow_time64.c IME bug3(成对才有意义): - meow_ui_ime.c:IME_TAP_COOLDOWN_MS 200 冷却窗 + 打开时二次 drain - meow_ui_input.c:meow_input_touch_reset() 并在 drain 内调用(复位触摸状态机) - test_ime_fix.c:新增用例④ stray-tap 列表行高(M15,修用户可见 bug): - meow_ui_widget.c:listv_item_h() 由主题字体行高派生,不再写死 56 (两行列表 62 > 56 会让首行标题被裁剪守卫整条跳过) - include/meow_ui_widgets.h:新增 meow_listview_item_h() - 新增 test_meow_ui_listview_rowh.c 其余:meow_select.c / meow_ui_dialog.c 统一 MD3 形状 token; include/meow_ipc.h 补 MSG_KEY_PAGEUP/PAGEDOWN 枚举; meow_ui_sys.c / meow_cachegov.c 取时统一走 meow_ui_time_ms()。 测试辅助函数标定:tuku/test/test_settings_lock_host.c 的注入前等待 150ms→350ms。 该等待按修复前 IME 标定,新冷却窗下首键 dt_open≈114ms 会被当迟到抬起吞掉, 只录到 "68" 两位。仅改等待时长,断言原样保留。 验证:tuku 四套脚本全绿(run_tests 644 PASS / zip 106 / cbz 296 / webtoon PASS); 12 个源文件与主仓逐字节一致;sdk/build_sdk.sh 34 成员; tuku/build_tuku.sh 产出静态 MIPS32r2 ELF。
127 lines
5.7 KiB
C
127 lines
5.7 KiB
C
/* test_overlay_suppress.c — §10.5 叠加让位 present 自抑宿主验证(离屏 480x720,16bpp)。
|
||
*
|
||
* 背景:媒体播放中的 App 前台唤起通知中心时 launcher 不 SIGSTOP(保 PCM 供流),改由 SDK
|
||
* present 层见 /tmp/meow_notif_active(宿主用 MEOW_NOTIF_ACTIVE_FILE 覆写)自抑上屏;
|
||
* 批①后台常驻后标记**内容化**:内容=当前前台 app_id(空=菜单/叠加=全抑制)。本测试同时验证
|
||
* 批①多 App 常驻的「前台/后台」判定:内容==本进程 app_id(env MEOW_LOG_APP)→ 前台不抑制;
|
||
* 内容为其它 app_id / 空 → 后台常驻/被覆盖 → 自抑。
|
||
*
|
||
* 覆盖:
|
||
* T1 无标记:flush 正常上屏(frames_presented 递增,抑制计数 0);
|
||
* T2 标记=其它 app_id(后台常驻)→ 抑制(只画进 back_buf 不上屏:frames 不变、计数递增);
|
||
* T2b 抑制期第二次 flush 仍被抑制(200ms 节流缓存内行为一致);
|
||
* T2c 标记=自身 app_id(前台 App)→ 不抑制(恢复上屏,恢复边沿整帧重画;计数不再增长);
|
||
* T3 标记=空内容(菜单/叠加全抑制)→ 仍抑制;
|
||
* T3b 标记消失 → 恢复上屏(抑制期累积脏区一次上屏,无需重画);
|
||
* T4 系统 UI 进程(launcher,system_mode=1)即使有标记也不抑制(面板必须照常上屏)。
|
||
*
|
||
* 编译(宿主 gcc,链真实 gfx/sys/theme/vol/log/widget/input/activity/dialog/ime + 打桩 font/global):
|
||
* gcc -Wall -Wextra -o test_overlay_suppress test_overlay_suppress.c test_host_stub.c \
|
||
* meow_ui_gfx.c meow_ui_time.c meow_ui_sys.c meow_ui_theme.c meow_ui_vol.c meow_ui_log.c \
|
||
* meow_ui_widget.c meow_ui_input.c meow_ui_activity.c meow_ui_dialog.c meow_ui_ime.c meow_ui_str.c \
|
||
* meow_pinyin.c meow_ui_draw.c meow_ui_view.c meow_ui_box.c meow_ui_anim.c meow_ui_media.c \
|
||
* meow_notify_ipc.c meow_ui_nav.c \
|
||
* -I. -Iinclude -DMEOW_UI_HOST_TEST -pthread
|
||
*/
|
||
#include "meow_ui.h"
|
||
#include "meow_ui_internal.h"
|
||
#include <stdio.h>
|
||
#include <stdlib.h>
|
||
#include <string.h>
|
||
#include <assert.h>
|
||
#include <unistd.h>
|
||
#include <fcntl.h>
|
||
|
||
#define MARKER "/tmp/test_notif_active_sdk"
|
||
#define SELF_ID "testapp"
|
||
|
||
static void marker_write(const char *content)
|
||
{
|
||
int fd = open(MARKER, O_WRONLY | O_CREAT | O_TRUNC, 0644);
|
||
assert(fd >= 0);
|
||
if (content && content[0]) {
|
||
if (write(fd, content, strlen(content)) < 0) assert(0);
|
||
}
|
||
close(fd);
|
||
}
|
||
|
||
int main(void)
|
||
{
|
||
setenv("MEOW_UI_DUMP", "/tmp/overlay_suppress.ppm", 1);
|
||
setenv("MEOW_NOTIF_ACTIVE_FILE", MARKER, 1);
|
||
setenv("MEOW_LOG_APP", SELF_ID, 1); /* 本测试进程身份=前台/后台的判定锚 */
|
||
unlink(MARKER);
|
||
meow_ui_opts o = { 480, 720 };
|
||
assert(meow_ui_init(&o) == 0);
|
||
meow_ui_set_refresh_always_max(1); /* 绕过帧率门控:每次 flush 都直达 present 判定 */
|
||
|
||
/* T1:无标记正常上屏(默认 App 进程模式:render_enabled==0) */
|
||
assert(meow_ui_sys_render_enabled() == 0);
|
||
meow_ui_clear(0x112233);
|
||
meow_ui_flush();
|
||
assert(meow_ui_frames_presented() == 1);
|
||
assert(meow_gfx_overlay_suppressed_count() == 0);
|
||
printf("T1 PASS: no marker -> presented=1 suppressed=0\n");
|
||
|
||
/* T2:标记=其它 app_id(后台常驻 App)→ 抑制(等 >200ms 越过存在性节流缓存) */
|
||
marker_write("ncm");
|
||
usleep(250000);
|
||
unsigned long long f0 = meow_ui_frames_presented();
|
||
meow_ui_clear(0x223344);
|
||
meow_ui_flush();
|
||
assert(meow_ui_frames_presented() == f0);
|
||
assert(meow_gfx_overlay_suppressed_count() == 1);
|
||
printf("T2 PASS: marker=other app -> suppressed (frames frozen at %llu)\n", f0);
|
||
|
||
/* T2b:抑制期再次 flush 仍抑制(节流缓存内一致) */
|
||
meow_ui_clear(0x334455);
|
||
meow_ui_flush();
|
||
assert(meow_ui_frames_presented() == f0);
|
||
assert(meow_gfx_overlay_suppressed_count() == 2);
|
||
printf("T2b PASS: still suppressed within throttle window\n");
|
||
|
||
/* T2c:标记=自身 app_id(前台 App)→ 不抑制(批①前后台判定核心;恢复边沿整帧重画一次上屏) */
|
||
marker_write(SELF_ID);
|
||
usleep(250000);
|
||
meow_ui_clear(0x445566);
|
||
meow_ui_flush();
|
||
assert(meow_ui_frames_presented() == f0 + 1);
|
||
assert(meow_gfx_overlay_suppressed_count() == 2); /* 不再增长(前台不抑制) */
|
||
printf("T2c PASS: marker=self -> foreground, present resumed (accumulated dirty flushed)\n");
|
||
|
||
/* T3:标记=空内容(菜单/叠加层覆盖=全抑制)→ 仍抑制 */
|
||
marker_write("");
|
||
usleep(250000);
|
||
unsigned long long f1 = meow_ui_frames_presented();
|
||
meow_ui_clear(0x556677);
|
||
meow_ui_flush();
|
||
assert(meow_ui_frames_presented() == f1);
|
||
assert(meow_gfx_overlay_suppressed_count() == 3);
|
||
printf("T3 PASS: empty marker (menu/overlay) -> suppressed\n");
|
||
|
||
/* T3b:标记消失 → 恢复上屏(抑制期累积的整帧脏一次上屏) */
|
||
unlink(MARKER);
|
||
usleep(250000);
|
||
meow_ui_flush();
|
||
assert(meow_ui_frames_presented() == f1 + 1);
|
||
assert(meow_gfx_overlay_suppressed_count() == 3);
|
||
printf("T3b PASS: marker gone -> present resumed (accumulated dirty flushed)\n");
|
||
|
||
/* T4:系统 UI 进程(launcher)不抑制——通知中心面板本身必须照常上屏 */
|
||
meow_ui_sys_set_system_mode(1);
|
||
assert(meow_ui_sys_render_enabled() == 1);
|
||
marker_write("ncm");
|
||
usleep(250000);
|
||
unsigned long long f2 = meow_ui_frames_presented();
|
||
meow_ui_clear(0x667788);
|
||
meow_ui_flush();
|
||
assert(meow_ui_frames_presented() == f2 + 1);
|
||
assert(meow_gfx_overlay_suppressed_count() == 3); /* 不再增长 */
|
||
unlink(MARKER);
|
||
printf("T4 PASS: system-UI process (launcher) never suppressed\n");
|
||
|
||
meow_ui_shutdown();
|
||
printf("ALL PASS\n");
|
||
return 0;
|
||
}
|