Fix/android alerts and location - #541
Merged
Merged
Conversation
Platform: android Fix(zh-Hant): 修正正式版 Android 上 16 個通知頻道註冊失敗,其中包含所有地震速報頻道 Fix(en-US): fix 16 notification channels failing to register on release Android builds, every earthquake alert channel among them Every channel names its sound as a runtime string — `resource://raw/eew` — so nothing in code or XML ever references @raw/*, the shrinker concludes they are unused, and a release APK ships without them. A release APK's resource table had no `raw` type at all; the debug one had thirteen entries. Android then refuses the channel outright, with `PlatformException(INVALID_ARGUMENTS, Audio media is not valid)`, and the app records it and carries on. On the device this was found on, that had happened 96 times: 16 of 24 channels rejected, including eew_alert, eew, eq, tsunami and every evacuation and weather channel. tool/check/notification_sounds.sh could not have caught it. It reads the source tree, and the source tree was always correct — the files are lost between the build and the APK. Verified the other way after the fix: the release table now carries all ten, and a device install registers 24 of 24 with no error logged.
Platform: android Fix(zh-Hant): 修正背景定位回報過於頻繁被伺服器擋下,位置一直沒有更新 Fix(en-US): background location reports are no longer rejected by the server for arriving too fast Four callers fire a report independently — the geofence, the alarm fallback, and two paths from Dart — and nothing coordinated them, so a crossing that arrived alongside an alarm sent two reports seconds apart. The server answers 429 and the position never lands, which looks from the outside exactly like background location having stopped: on the device this was found on, `last_report_code` was 429 with the geofence armed and a fix in hand. The window is measured from a new `last_sent_at`, not from `last_report_at`. The latter is stamped on every outcome, this one included, so gating on it would let a burst of triggers push the window ahead of itself and starve reporting completely. The dropped triggers are counted rather than hidden, and -4 is named on the diagnostics page: an unexplained negative number beside "Last report" reads as a fault, and this one is the throttle working. The swallowed exception now leaves its class name in the breadcrumbs. -1 was all the app could say for a failure, and it fits a DNS miss, a timeout, a TLS error and a Doze block equally well — with the name in hand, three failures after a package replace turned out to be UnknownHostException, a report firing before the network was up. Measured on a Pixel 9: 71 triggers dropped, the code moved 429 to 202, and a report inside forced deep Doze still returned 202.
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 3 selected item(s). |
whes1015
enabled auto-merge (rebase)
August 18, 2026 15:44
whes1015
disabled auto-merge
August 18, 2026 15:44
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
這個 PR 做了什麼
相關 issue
怎麼驗
檢查清單
tool/check/commits.sh origin/main..HEAD通過—— commit 訊息就是更新日誌,格式見 commit.md
mise exec -- flutter analyze與mise exec -- flutter test通過AppLocalizations,沒有寫死AppSpacing/AppRadius/AppMotion,深色模式看過,文字對比度可接受