feat(launcher): M3导航栈+M5通知点击跳转 (agent-202) — nav_stack(≤16深)+MSG_NAV REPORT/EXIT+launch_activity链路注入(MEOW_ACTIVITY/MEOW_CHAIN)+栈根退出回主屏; 通知点击按route_status(0拉起/1 NO ROUTE/2 SOURCE NOT FOUND/-1 NONE关面板不动作); picker协议位预留(0x0070/0x0071); 裸App兼容

launcher 4fe4103a→a42171a1; qemu实测 declare/query/nav report/exit/notify+querynotif 全过
发现: §10.5 App前台通知中心叠加会话(MSG_NOTIF_OPEN)实际未实现,文档超前,待补
This commit is contained in:
MeowOS committed 2026-08-31 06:27:10 +08:00
1 parent 955dbe1228
commit 85b4aea24f
9 files changed
+321 -39

No files matched your search

@@ -471,6 +471,7 @@ enum { NCP_CHIP_WIFI=0, NCP_CHIP_BT=1, NCP_CHIP_THEME=2, NCP_CHIP_BRIGHT=3,
typedef struct {
uint32_t id;
char app_id[MEOW_NOTIF_APP_ID_MAX];
char category[MEOW_NOTIF_CAT_MAX]; /* 通知类型(媒体="media")——点击 route_status 判定用 */
char summary[MEOW_NOTIF_SUMMARY_MAX];
char body[MEOW_NOTIF_BODY_MAX];
char icon[MEOW_NOTIF_ICON_MAX];
@@ -481,6 +482,22 @@ typedef struct {
meow_img *img; /* 缓存图标(meow_img_load_file 结果;NULL=回退首字符圆点) */
} ncp_row_t;
/* M5 通知中心点击产出:run_notif_center 经 *click 回报,run_menu 消费。
* app_idx: -1=无启动;>=0 = apps[] 下标(本批 run_menu 传入同源)。
* status : route_status(FRAMEWORK_DESIGN §4):-1=NONE(面板已关,未点任何通知,run_menu 不动);
* 0=OK 跳转;1=NO ROUTE;2=SOURCE NOT FOUND。
* chain : status==0 时解析出的 activity 链路(';' 分隔);空=裸启动/整 app 级(媒体→主屏)。
* status==1/2/NONE 时置空。 */
#define NOTIF_CLICK_STATUS_NONE (-1)
#define NOTIF_CLICK_STATUS_OK 0
#define NOTIF_CLICK_STATUS_NOROUTE 1
#define NOTIF_CLICK_STATUS_NOSRC 2
typedef struct notif_click {
int app_idx;
int status;
char chain[MEOW_CHAIN_MAX];
} notif_click_t;
/* ---- ⑧ 一键清除(批量):先转储留档 → 再清空显示(红线:保留 ongoing/media/progress)---- */
typedef struct { uint32_t ids[NCP_MAX_ROWS]; int n; } ncp_clear_ctx_t;
@@ -598,6 +615,9 @@ int kp_open(struct keypoll *kp, const char *dev);
int kp_poll(struct keypoll *kp, int (*cb)(int code, int down, void *ctx),
void *ctx);
int launch_app(struct app *a);
/* M3:以指定 activity 链路冷启动某 app(注入 MEOW_ACTIVITY/MEOW_CHAIN + 设 nav_stack 栈深)。
* chain=NULL 或空 = 裸启动(进 App 主屏/首页,不注入 activity env)。 */
int launch_activity(struct app *a, const char *chain);
void load_config(void);
void log_cleanup_old(void);
int log_open_card(void);
@@ -607,6 +627,14 @@ void meow_acct_declare(const char *app_id, const char *entries, int count);
struct meow_acct *meow_acct_find(const char *app_id);
void meow_acct_hello(const char *app_id, uint32_t version, uint32_t flags);
void meow_dac_vol_flush(void);
/* M3 导航栈(每 app ≤16 深;v1 单前台应用)。launcher 侧镜像,主循环单写者。 */
#define MEOW_NAV_MAX_DEPTH 16
void meow_nav_begin(const char *app_id, const char *chain); /* chain=NULL→depth 0(裸启动) */
void meow_nav_report(const char *app_id, uint32_t depth, const char *current);
void meow_nav_exit(void); /* 清栈(应用退出/EXIT) */
void meow_nav_request_exit(void); /* MSG_NAV{EXIT}:置位让前台 waitpid 循环终止 app */
int meow_nav_exit_pending(void); /* 读取并清除退出请求(前台 launch_* 循环轮询) */
void meow_dac_vol_write(int pct);
void meow_dac_vol_write_throttled(void);
void meow_dirty_add(int x, int y, int w, int h);
@@ -656,7 +684,7 @@ int read_file_int(const char *path);
int resolve_chain(const char *app_id, const char *activity, char *out, int *depth);
void restore_backlight(void);
uint16_t rgb565(uint32_t c);
void run_notif_center(struct app *apps, int napps, int *want_launch,
void run_notif_center(struct app *apps, int napps, notif_click_t *click,
int live_open, int lox, int loy);
void run_settings_page(void);
void s_about_open(void);