Live Update通知をPromoted Ongoing対応してAOD・ロック画面・ステータスバーに表示#5392
Conversation
📝 WalkthroughWalkthroughAndroidManifest.xmlに新しいAndroidパーミッション(POST_PROMOTED_NOTIFICATIONS)を追加し、LiveUpdateModule.ktの通知ビルダーにshortCriticalTextの計算と2つの設定呼び出し(setShortCriticalText、setRequestPromotedOngoing)を追加しました。 Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
android/app/src/main/java/me/tinykitten/trainlcd/LiveUpdateModule.kt (1)
187-202:⚠️ Potential issue | 🟡 MinorshortCriticalText が空になるケースのフォールバックを追加してください
passingStationName、stationName、nextStationNameがすべて空文字になる可能性があり、その場合 shortCriticalText も空文字になってロック画面で空表示になります。フォールバック値を追加することで安全にできます。ただし、
setRequestPromotedOngoing(true)の権限については、POST_PROMOTED_NOTIFICATIONSはマニフェストのみの権限(runtime permission ではない)で、既に AndroidManifest.xml に宣言されています。POST_NOTIFICATIONSの実行時権限 については Privacy.tsx で既にリクエスト実装があるため、追加対応は不要です。🛠️ 空文字フォールバック修正案
val shortCriticalText = when { passingStationName.isNotEmpty() -> passingStationName stopped -> stationName else -> nextStationName - } + }.ifBlank { contentTitle }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@android/app/src/main/java/me/tinykitten/trainlcd/LiveUpdateModule.kt` around lines 187 - 202, shortCriticalText can end up empty if passingStationName, stationName, and nextStationName are all empty; update the when expression that defines shortCriticalText to provide a safe fallback (e.g. contentTitle or a localized string resource like a default "Live update") so setShortCriticalText(...) never receives an empty string, keeping the remaining Notification.Builder calls (including setRequestPromotedOngoing(true)) unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@android/app/src/main/java/me/tinykitten/trainlcd/LiveUpdateModule.kt`:
- Around line 187-202: shortCriticalText can end up empty if passingStationName,
stationName, and nextStationName are all empty; update the when expression that
defines shortCriticalText to provide a safe fallback (e.g. contentTitle or a
localized string resource like a default "Live update") so
setShortCriticalText(...) never receives an empty string, keeping the remaining
Notification.Builder calls (including setRequestPromotedOngoing(true))
unchanged.
https://claude.ai/code/session_01Cp8SCMwaTBZz3TujNfAzhV
Summary by CodeRabbit
新機能