feat(reminder): add native alarm and Baidu location modules - #258
feat(reminder): add native alarm and Baidu location modules#258LUPENGHAN wants to merge 2 commits into
Conversation
Native Android modules for the reminder engine's device layer: timeflow-alarm (AlarmManager scheduling, ring UI, boot rescheduling) and timeflow-baidu-location (continuous positioning bridge). Includes the Expo config plugins that wire them into the native build, app.config.js (replaces static app.json so the Baidu API key can come from an env var), and the new package deps/patches these modules need. No app code references these yet -- pure addition, nothing wired in.
Three unrelated bugs in the already-merged voice/location-search path (PR 1024XEngineer#243), fixed together since they're small and independent of the reminder engine work in this stack: - reuse a recent position during voice handshake instead of blocking on a fresh fix (backend location tools + realtime agent) - preserve newly-started TTS after an interruption instead of letting the old stream clobber it - remove stale push-to-talk listeners left on the shared WebSocket connection after a session ends
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
拆分粒度还是太粗(这个都还有 55 个文件改动),先撤回去重新想怎么拆,关掉这个。 |
| LocationClient.setAgreePrivacy(true) | ||
| if (client == null) { | ||
| client = LocationClient(reactContext.applicationContext) |
There was a problem hiding this comment.
[P1] 不要在初始化定位时自动代表用户同意隐私条款
init()(以及下面的 startUpdating())无条件调用 LocationClient.setAgreePrivacy(true),所以调用方即使尚未展示/获得用户同意,甚至刚调用过 setAgreePrivacy(false),仍会被模块自动改回同意并创建、启动百度定位客户端。这使公开的 setAgreePrivacy 接口失去约束作用,并可能在取得授权前开始第三方定位处理。请只在调用方显式传入同意后保存该状态;未同意时 init/startUpdating 应拒绝或保持不可用。
| if (!firedNotified) { | ||
| firedNotified = true; | ||
| AlarmNativeBridge.notifyFired(this, scheduleId, alarmId, alarmTitle); |
There was a problem hiding this comment.
[P1] 为每次闹钟触发分别记录 fired 状态
Android 的 Service 是单实例的,第二个闹钟在第一个仍响铃时会再次进入同一个 onStartCommand()。这里的 alarmId/scheduleId/requestCode 会被第二次启动覆盖,但 firedNotified 仍为 true,因此第二条日程不会调用 notifyFired,后续停止和通知清理也只围绕最后一次启动的字段执行。AlarmScheduler 明确允许不同 scheduleId 同时存在,所以两条提醒同一时刻或第一条尚未关闭时第二条到点,就会造成原生 disposition 丢失或通知状态不一致。请为每个 start 独立发出/保存事件,并明确排队或合并多个正在响铃的闹钟,而不要用服务级布尔值屏蔽后续触发。
Closes #254
拆分 #245 的第 1/4 层:原生 Android 模块 + 构建脚手架,不依赖其它层,可以直接合。
顺带捎带一个跟提醒功能无关的小修复(语音握手复用最近定位、TTS 打断后保留新流、清理失效的按住说话监听器),已经在这个分支的第二个 commit 里,跟第一个 commit 完全独立。
纯新增,未接入 app 代码,不影响现有功能。
拆分顺序(依赖链)
后面三个都已经开出来了,标了 draft,因为它们的分支历史包含这个 PR 还没合的提交,diff 会显示多余内容,等这个合了它们会自动瘦身。