Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e5dcb121d1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (existing != null && existing.importance >= NotificationManager.IMPORTANCE_HIGH) return | ||
| if (existing != null) { | ||
| manager.deleteNotificationChannel(TURN_CHANNEL_ID) |
There was a problem hiding this comment.
Avoid deleting and recreating the turn channel with the same ID
On Android 8+ this migration does not actually raise existing users to IMPORTANCE_HIGH. NotificationManager.createNotificationChannel() preserves the prior settings for an existing/deleted channel ID, so when turn_events was already created at IMPORTANCE_DEFAULT (or the user later lowered/blocked it), deleting and recreating it here restores the same lower importance instead of enabling heads-up alerts. That means the new behavior never takes effect for those installs, and ensureTurnChannel() will keep deleting/recreating the channel on every completed-turn notification, which also increments Android's visible "deleted channels" counter in Settings.
Useful? React with 👍 / 👎.
Motivation
Description
IMPORTANCE_HIGHand recreate the channel when an existing channel has lower importance to enable heads-up behavior and stronger alerts.ic_launcher_foregroundand loading the app icon as the large icon viapackageManager.getApplicationIcon(...).toBitmap().PRIORITY_HIGHand setDEFAULT_ALLso pre-Oreo devices also receive popup-style behavior; addedandroidx.core.graphics.drawable.toBitmapimport and updatedCodexDroidNotifications.kt.Testing
bash ./gradlew :app:compileDebugKotlinto validate Kotlin compilation, but the build could not run in the environment due to a missing Android SDK configuration (ANDROID_HOME/local.propertiessdk.dir), so compilation could not be verified here.Codex Task