Skip to content

Conversation

MihaiCristianCondrea
Copy link
Owner

Summary

  • ensure AppUpdateNotificationsManager guards notification channel creation behind the runtime SDK level
  • add JVM unit tests that mock AppUpdateManager results and verify Play Store intents and notification behavior

Testing

  • ./gradlew test (fails: Android SDK not available in container)

https://chatgpt.com/codex/tasks/task_e_68c97637f974832dbddeb70b7567debc

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

Codex Review: Here are some suggestions.

Reply with @codex fix comments to fix any unresolved comments.

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, or 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 fix this CI failure" or "@codex address that feedback".

Comment on lines 31 to +42
private final Context context;
private final IntSupplier sdkIntSupplier;
private final String updateChannelId = "update_channel";
private final int updateNotificationId = 0;

public AppUpdateNotificationsManager(Context context) {
this(context, () -> Build.VERSION.SDK_INT);
}

AppUpdateNotificationsManager(Context context, IntSupplier sdkIntSupplier) {
this.context = context;
this.sdkIntSupplier = sdkIntSupplier;

Choose a reason for hiding this comment

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

[P1] Avoid API‑24 java.util.function dependency in manager constructor

The new sdkIntSupplier field introduces java.util.function.IntSupplier. That type only exists on Android API 24+ (or when core library desugaring is configured), yet the app’s minSdk is 23 and no desugaring dependency is declared in app/build.gradle. When AppUpdateNotificationsManager is loaded on API 23 devices (e.g., from MainActivity), the VM will fail with NoClassDefFoundError: java/util/function/IntSupplier, crashing update notification checks on those devices. Passing the SDK value as an int or using a project-defined interface avoids raising the effective minSdk.

Useful? React with 👍 / 👎.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant