mawaqit / android-tv-app

Prayer times App for Android TV
https://mawaqit.net
Other
38 stars 17 forks source link

fix: connectivity service using `internet_connection_checker_plus` #1103

Closed YassinNouh21 closed 5 months ago

YassinNouh21 commented 5 months ago

📝 Summary

This PR adapts the connectivity service of the app to use the internet_connection_checker_plus package, which provides more robust connectivity checking by not only checking for network connectivity, but also pinging the internet to ensure the app can actually access external resources.

Description

This PR addresses the issue of the app's current connectivity service, which only checks for network connectivity without verifying the app's ability to access the internet. The changes made in this PR replace the existing ConnectivityService with a new implementation that uses the internet_connection_checker_plus package.

The new ConnectivityProvider now listens to the stream of connectivity status from the internet_connection_checker_plus package and transforms it into a stream of ConnectivityStatus values, which can be consumed by the rest of the app.

This approach provides a more reliable way to determine the app's connectivity status, as it not only checks for network availability but also verifies the app's ability to access external resources by pinging the internet.

Tests

🧪 Use case 1: Verify connectivity status changes

💬 Description: Ensure that the ConnectivityProvider correctly emits ConnectivityStatus.connected when the device has internet connectivity and ConnectivityStatus.disconnected when the device loses internet connectivity.

📷 Screenshots or GIFs (if applicable):

**Checklist:** --- - [x] **Coding Standards:** I have reviewed my code to ensure it follows the project's coding standards. - [x] **Testing:** I have tested the changes and they work as expected. - [x] **Merge Conflicts:** I have resolved any merge conflicts with the latest main/development branch. - [x] **Branch Status:** The branch is up-to-date with the target branch (main/development).