Skip to content

fix(android): avoid API 26 network callback overload on Android 7#8904

Open
atavism wants to merge 1 commit into
mainfrom
atavism/default-network
Open

fix(android): avoid API 26 network callback overload on Android 7#8904
atavism wants to merge 1 commit into
mainfrom
atavism/default-network

Conversation

@atavism

@atavism atavism commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Bug Fixes
    • Improved Android network callback registration across different OS versions.
    • Fixed behavior on older Android releases so the app uses the supported callback method for each API level.

Copilot AI review requested due to automatic review settings July 9, 2026 20:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 0d6826f4-b806-4af0-8514-20038d0290b1

📥 Commits

Reviewing files that changed from the base of the PR and between 9388beb and 477896e.

📒 Files selected for processing (1)
  • android/app/src/main/kotlin/org/getlantern/lantern/service/DefaultNetworkListener.kt

📝 Walkthrough

Walkthrough

The Android API-level branch for registerDefaultNetworkCallback in DefaultNetworkListener.register() was split: API 24–25 now uses the one-argument overload, while API 26–30 continues using the two-argument overload with mainHandler.

Changes

Network Callback Registration Fix

Layer / File(s) Summary
API-level branching for registerDefaultNetworkCallback
android/app/src/main/kotlin/org/getlantern/lantern/service/DefaultNetworkListener.kt
Splits the previous combined 24..30 API range into 24–25 (one-argument overload) and 26–30 (two-argument overload with mainHandler), with a comment explaining the API 26 handler overload addition; minor closing-brace structure adjustment.

Estimated code review effort: 1 (Trivial) | ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is clear and matches the main change: adjusting the network callback overload used on older Android versions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch atavism/default-network

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@jigar-f jigar-f left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

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.

3 participants