fix(launcher): M47 r1 评审 P2 四项 — 未知态不写盘/不顶替 + deadline 从点击起算 + 开关弹窗后置清理
评审 r1 status=p2-4items / merge=fix-then-merge(reviewed e4eda3a)。逐条: P2-1 未知态被写成 settings=0,把失真推到别的入口 - bt_page.c / wifi_page.c:`meow_settings_set_bool(..., disp == 1)` 加 `disp >= 0` 门。 disp == -1(daemon 与直连都读不到)时**保留用户原意图不动**。该键被 notif_center / settings_page 当显示态读、被 app_launcher 用来决定自动拉起 WiFi,写 0 会把「不知道」 污染成「确定已关」。 - test_bt_page.c 5d 期望同步改:未知 → settings 保持原意图 1(不再期望「回滚为 0」)。 P2-2 收尾后「探测未知」仍显示成确定态,第三态丢失 - mtog_calc:显示态**只认 probe**,probe < 0 直接返回 -1;last_real 不再顶替确定态 (`(void)last_real`,仅由调用方用于弹窗文案)。超时/下发失败且探测未知 → 顶栏保留 「关+?」、行内保留「状态未知」,与文件头契约一致。 - 弹窗文案按结论区分:「无法确认当前状态(上次已知:开启/关闭/未知)」vs 「切换未生效:当前仍为开启/关闭」——不再出现「当前仍为开启」自相矛盾(该文案只在 probe 已知且 != 意图时出现)。日志加 elapsed。 P2-3 deadline 起点错,注释上限是假的 - bt_page/wifi_page:`deadline` 从**点击时刻**起算(含下发耗时)。 - 注释改成如实上限:快路径 1~2s / ≈16 次探测;慢路径(on-off 读超时 1.5s + hciconfig 0.3~2s,之后一次探测 status 1.5s + 直连 1.8s ≈3.3s)总阻塞最坏 ≈7s、预算内只够 1 次 探测,此时只能确认「探测超时」而非「设备无响应」——文案已按此区分。异步化留给后续单。 P2-4 开关路径弹窗后缺 after_modal / 按键基线复位 - subpage.c:顶开关命中分支补上与行命中分支相同的后置清理(排空触摸 + 40ms 二次排空、 触摸基线/cooldown、key_router_rebase、kd_*/kp_poll 基线、m_prev_*、after_modal=1)。 s_dd_modal 是全屏压暗层,否则关闭后状态栏(0..27)残留压暗到下一次时钟重绘,电源/播放键 也可能带进弹窗里的陈旧边沿。 顺带(评审观察,未改全局超时策略) - netmgr_ipc.c:拆出 `nm_cmd_t(..., int *read_timeout)`;`nm_bt_power_state()` 走它, **读超时 = 状态未知且不把可达性缓存打成 down**(netmgrd 单线程忙时 `bt status` 自己 跑 hciconfig 可能超 1.5s;旧行为会标 down 1s,令紧随的 bt_rows 闪出「服务未运行(直连 模式)」并把后续探测切到 1.8s 直连)。WiFi/DNS 等其它调用保持旧语义(传 NULL)。 验证 - `bash patch_v2/meow_launcherd/build_launcher.sh test` → exit 0,**65 PASS / 0 FAIL / 0 warning** (矩阵 13 组,新增「下发失败·探测未知 → 未知不顶替」)。 - 交叉编译 0 warning;产物(临时副本,不入库)901020 B / md5 e21450ff6621a67fd854165413c58be1。 - `test_time32_abi.sh` → 4263=3 / 4403=0 ALL PASS;`pkg_install` 与 7 条切换中/未知态文案 均在 strings 中(旧的两条「无法确认蓝牙/WiFi 状态」已合并为「无法确认当前状态(上次已知:%s)」)。 - 真机 --sysdump(只读,临时文件已删):exit 0,bt_on=1/wifi_on=1 与设备现状一致; Music du 前后 199164544;未替换 /usr/bin/meow_launcherd、未重启 launcherd。 - 交付形态不变:本 commit 只动 5 个源码文件;二进制与 scripts/build/fw_content.conf 对 main 零 diff。
This commit is contained in:
1 parent
e4eda3a06f
commit
f49585dd62
5 files changed
+110
-37
No files matched your search
@@ -101,9 +101,14 @@ static int nm_hello(int fd)
|
||||
}
|
||||
|
||||
/* 发一条 WIFI_CTL/BT_CTL 子命令,收 RESULT。返回 netmgrd 业务 code;NETMGR_UNREACH=不可达。
|
||||
* tmo_ms:读超时(connect/connecth/scan 需覆盖 netmgrd 同步等待,见 NM_TMO_*)。 */
|
||||
static int nm_cmd(uint16_t ctl_type, uint16_t res_type, const char *cmd, const char *arg,
|
||||
char *text, int tlen, int tmo_ms)
|
||||
* tmo_ms:读超时(connect/connecth/scan 需覆盖 netmgrd 同步等待,见 NM_TMO_*)。
|
||||
* read_timeout(可空):非空时,「帧收发失败/类型不符」这一支只回写 *read_timeout=1 且**不**
|
||||
* 把可达性缓存打成 down——调用方据此区分「读超时」与「真不可达」。M47 的 BT 状态查询用它:
|
||||
* netmgrd 单线程忙时(bt status 自己会跑 hciconfig)状态查询可能超过 1.5s,若据此标 down,
|
||||
* 紧随的 bt_rows 会闪出「服务未运行(直连模式)」并把后续探测切到 1.8s 的 hciconfig
|
||||
* (评审 r1 观察;global 超时常量不动,WiFi/DNS 路径行为不变)。 */
|
||||
static int nm_cmd_t(uint16_t ctl_type, uint16_t res_type, const char *cmd, const char *arg,
|
||||
char *text, int tlen, int tmo_ms, int *read_timeout)
|
||||
{
|
||||
m_net_cmd_t q;
|
||||
memset(&q, 0, sizeof q);
|
||||
@@ -115,7 +120,10 @@ static int nm_cmd(uint16_t ctl_type, uint16_t res_type, const char *cmd, const c
|
||||
uint8_t rbuf[MEOW_IPC_MAX]; uint16_t rtype = 0;
|
||||
memset(rbuf, 0, sizeof rbuf);
|
||||
if (nm_xchg(fd, ctl_type, 0x101, &q, sizeof q, rbuf, sizeof rbuf, &rtype, tmo_ms) < 0 || rtype != res_type) {
|
||||
close(fd); nm_cache(0); return NETMGR_UNREACH;
|
||||
close(fd);
|
||||
if (read_timeout) *read_timeout = 1;
|
||||
else nm_cache(0);
|
||||
return NETMGR_UNREACH;
|
||||
}
|
||||
m_net_cmd_result_t res; memcpy(&res, rbuf, sizeof res);
|
||||
close(fd);
|
||||
@@ -126,6 +134,12 @@ static int nm_cmd(uint16_t ctl_type, uint16_t res_type, const char *cmd, const c
|
||||
return (int)res.code;
|
||||
}
|
||||
|
||||
static int nm_cmd(uint16_t ctl_type, uint16_t res_type, const char *cmd, const char *arg,
|
||||
char *text, int tlen, int tmo_ms)
|
||||
{
|
||||
return nm_cmd_t(ctl_type, res_type, cmd, arg, text, tlen, tmo_ms, NULL);
|
||||
}
|
||||
|
||||
int netmgr_wifi_tmo(const char *cmd, const char *arg, char *text, int tlen, int tmo_ms)
|
||||
{ return nm_cmd(MSG_NET_WIFI_CTL, MSG_NET_WIFI_RESULT, cmd, arg, text, tlen, tmo_ms); }
|
||||
|
||||
@@ -563,7 +577,11 @@ int nm_bt_powered(void)
|
||||
int nm_bt_power_state(void)
|
||||
{
|
||||
char text[192];
|
||||
int rc = netmgr_bt("status", NULL, text, sizeof text);
|
||||
int read_timeout = 0;
|
||||
/* 状态查询走专用入口:读超时 = 「状态未知」,且不把 netmgrd 标成 down(见 nm_cmd_t 注释)。 */
|
||||
int rc = nm_cmd_t(MSG_NET_BT_CTL, MSG_NET_BT_RESULT, "status", NULL,
|
||||
text, sizeof text, NM_TMO_DFL, &read_timeout);
|
||||
if (read_timeout) return -1;
|
||||
if (rc == NETMGR_UNREACH) return net_bt_power_probe(); /* 直连回退;失败=未知 */
|
||||
if (rc != MEOW_OK) return -1; /* daemon 报错:不知道就是不知道 */
|
||||
char v[8];
|
||||
|
||||
Reference in new issue
Block a user