Skip to content

Live Update通知をPromoted Ongoing対応してAOD・ロック画面・ステータスバーに表示#5392

Merged
TinyKitten merged 1 commit intodevfrom
claude/android-16-live-status-2uqfo
Feb 21, 2026
Merged

Live Update通知をPromoted Ongoing対応してAOD・ロック画面・ステータスバーに表示#5392
TinyKitten merged 1 commit intodevfrom
claude/android-16-live-status-2uqfo

Conversation

@TinyKitten
Copy link
Member

@TinyKitten TinyKitten commented Feb 21, 2026

https://claude.ai/code/session_01Cp8SCMwaTBZz3TujNfAzhV

Summary by CodeRabbit

新機能

  • 通知機能が強化されました。新しいシステム権限が追加されたことにより、アプリは重要な情報をより効果的に表示し、優先度を高めて配信するようになりました。これにより、ユーザーは重要なアラートを確実に受け取ることができます。

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 21, 2026

📝 Walkthrough

Walkthrough

AndroidManifest.xmlに新しいAndroidパーミッション(POST_PROMOTED_NOTIFICATIONS)を追加し、LiveUpdateModule.ktの通知ビルダーにshortCriticalTextの計算と2つの設定呼び出し(setShortCriticalText、setRequestPromotedOngoing)を追加しました。

Changes

Cohort / File(s) Summary
マニフェスト設定
android/app/src/main/AndroidManifest.xml
昇格通知のためのandroid.permission.POST_PROMOTED_NOTIFICATIONSパーミッションを新規追加。
通知ロジック拡張
android/app/src/main/java/me/tinykitten/trainlcd/LiveUpdateModule.kt
駅名の優先順位に基づくshortCriticalTextの計算式を追加し、通知ビルダーにsetShortCriticalText()とsetRequestPromotedOngoing(true)の設定呼び出しを追加。

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

Suggested labels

android

Poem

🐰 ウサギが通知を華やかに装い
昇格フラグをひらりと翻す
駅名の優先順位をつけて
ユーザーへのメッセージをぐんと磨いた
小さな変更が大きな気遣い✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PRタイトルは、AndroidManifestにPOST_PROMOTED_NOTIFICATIONS権限を追加し、LiveUpdateModuleでPromoted Ongoingを設定して、AOD・ロック画面・ステータスバーに通知を表示するという変更内容を正確に反映している。

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch claude/android-16-live-status-2uqfo

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 | 🟡 Minor

shortCriticalText が空になるケースのフォールバックを追加してください

passingStationNamestationNamenextStationName がすべて空文字になる可能性があり、その場合 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants