fix(launcher/amsd): amsd MSG_AMS_START 拉起缺口——pending-start 抽 meow_ams_start 模块复用启动链 + 负错误码符修复
根因(真机日志实证,M2.92 遗留):meow_ams_pending_start_set 误返回正错误码 (-MEOW_ERR_BUSY=+8/-MEOW_ERR_INVAL=+1),ipc_dispatch 的 rc<0?-rc:MEOW_OK 把「有前台 App 拒绝/空包名非法」误判为 OK(0) → amsd 报 OK 但 pending 未置位 → App 永不拉起(am start 报 OK 但界面没出现/进程未起)。 launcher: - 新增自包含模块 meow_ams_start.c/.h(ops 注入 launch=launch_app/launch_activity、 resolve=resolve_chain、log=logmsg):pending 状态 + 拉起决策 + picker 上下文。 - set 统一返回负 MEOW_ERR_*(根因修复);consume 复用既有启动链路真正拉起目标 App, 列表未就绪(state!=0)保留 pending 待 2s 重扫重试,不再静默丢弃。 - main_menu run_menu 改经 meow_ams_start_consume 消费(保留 launch_fail_toast/菜单收尾); app_launcher 移除旧 g_ams_start/g_ams_pick_* 迁入模块;util meow_ipc_process 顶部同步 busy、 meow_ipc_init 末尾 meow_ams_launcher_init()。 - build_launcher.sh 编入 meow_ams_start.c;meow_launcher_internal.h 更新挂点声明。 amsd(协议层归属说明):cmd_start 的 busy 判定对照 launcher ACK 正幅度(busy=8), 原 (uint32_t)MEOW_ERR_BUSY=0xFFFFFFF8 永不匹配 → busy 落入 launcher offline,改 (uint32_t)(-MEOW_ERR_BUSY)。 验证:宿主 test_ams_start.c 33 断言全 PASS(合法->拉起链、activity chain 透传、空包名/非法/busy 不拉起不崩、列表未就绪保留 pending、无路由 NO ROUTE、启动失败 idx 回报、picker 取回); launcher 目录全量回归 test_media/bgplay/depends/notif_panel/notif_tf/settings_brightness/ vol_ramp_jack/host_icon + test_font_tier/weight 全 PASS;mipsel -Wall -Wextra 0 warning。 新 md5:meow_launcherd a8200ae1b0aa68d7262749db87377d49、meow_amsd 7ddc677ce7938bc9b95c83c17bc78295。(M2.98 待打包,未刷机)
This commit is contained in:
1 parent
7e7e45ae26
commit
980d161972
13 files changed
+446
-101
No files matched your search
@@ -1,6 +1,7 @@
|
||||
/* main_menu.c — MeowOS launcher 拆分模块(LAUNCHER_SPLIT_PLAN 拆分)。*/
|
||||
/* 本文件由拆分工具从 meow_launcherd.c 按职责搬移;逻辑与原文 0-diff(仅 static 可见性按跨模块需求调整)。*/
|
||||
#include "meow_launcher_internal.h"
|
||||
#include "meow_ams_start.h" /* MSG_AMS_START 拉起决策(meow_ams_start.c):run_menu 消费用 */
|
||||
|
||||
|
||||
/* set by run_menu: the player's panel was blanked (screen timeout) when the
|
||||
@@ -885,43 +886,28 @@ static void run_menu(struct app apps[MAX_APPS], int napps, int state,
|
||||
|
||||
/* 阶段 D · M0:菜单/主屏循环内排空 IPC(非阻塞;应用可随时查询/声明路由) */
|
||||
meow_ipc_process();
|
||||
/* AMSD_DESIGN §4.3:amsd `am start` → 消费 pending-start(仅菜单态/无前台 App 时拉起)。
|
||||
/* AMSD_DESIGN §4.3:amsd `am start` → meow_ams_start_consume 消费 pending-start,
|
||||
* 复用既有启动链路(launch_app/launch_activity)真正拉起目标 App。
|
||||
* 镜像 sim-tap 启动路径:launch 后 menu_after_app_exit + dirty 重绘菜单。 */
|
||||
{
|
||||
char spkg[MEOW_APP_ID_MAX], sact[MEOW_ACT_MAX];
|
||||
if (meow_ams_take_start(spkg, sizeof spkg, sact, sizeof sact)) {
|
||||
if (state != 0) {
|
||||
snprintf(toast, sizeof toast, "AMS START: app list not ready");
|
||||
toast_ms = TOAST_MS;
|
||||
} else {
|
||||
int idx = -1;
|
||||
for (int i = 0; i < napps; i++)
|
||||
if (!strcmp(apps[i].id, spkg)) { idx = i; break; }
|
||||
if (idx < 0) {
|
||||
snprintf(toast, sizeof toast, "AMS START: NO APP %s", spkg);
|
||||
toast_ms = TOAST_MS;
|
||||
} else {
|
||||
int ret;
|
||||
if (sact[0]) {
|
||||
char chain[MEOW_CHAIN_MAX]; int depth;
|
||||
if (resolve_chain(spkg, sact, chain, &depth) == MEOW_OK)
|
||||
ret = launch_activity(&apps[idx], chain);
|
||||
else {
|
||||
snprintf(toast, sizeof toast, "AMS: NO ROUTE %s/%s", spkg, sact);
|
||||
toast_ms = TOAST_MS; ret = 0;
|
||||
}
|
||||
} else {
|
||||
ret = launch_app(&apps[idx]);
|
||||
}
|
||||
if (ret != 0) {
|
||||
launch_fail_toast(toast, sizeof toast, apps[idx].name);
|
||||
toast_ms = TOAST_MS;
|
||||
}
|
||||
menu_after_app_exit(ret == 0);
|
||||
last_input_ms = now_ms(); /* M2.17:回主界面即视为输入 */
|
||||
dirty = 1;
|
||||
}
|
||||
const char *ids[MAX_APPS];
|
||||
for (int i = 0; i < napps; i++) ids[i] = apps[i].id;
|
||||
meow_ams_ctx_set(apps, napps); /* ops.launch 的 idx→struct app 映射 */
|
||||
int app_ran = 0, idx = -1;
|
||||
int r = meow_ams_start_consume(ids, napps, state, toast, sizeof toast,
|
||||
&app_ran, &idx);
|
||||
if (r == 1) {
|
||||
if (!app_ran && idx >= 0 && idx < napps) {
|
||||
/* 启动失败:复用 run_menu 的失败 toast(缺依赖/exec 失败,含 app 名)。 */
|
||||
launch_fail_toast(toast, sizeof toast, apps[idx].name);
|
||||
}
|
||||
toast_ms = TOAST_MS;
|
||||
menu_after_app_exit(app_ran);
|
||||
last_input_ms = now_ms(); /* M2.17:回主界面即视为输入 */
|
||||
dirty = 1;
|
||||
} else if (r == 2) {
|
||||
/* 应用列表未就绪:pending 保留(下次重扫即拉起),仅提示,不红冲免忙循环。 */
|
||||
toast_ms = TOAST_MS;
|
||||
}
|
||||
}
|
||||
meow_notif_tick(); /* M2a:通知 TTL 10s 转储(§8)*/
|
||||
|
||||
Reference in new issue
Block a user