Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

chore: Disable chromecast behind a local feature flag #1822

Merged
merged 2 commits into from
Sep 25, 2023

Conversation

omerhabib26
Copy link
Contributor

Description

LEARNER-9610

  • Configure Chromecast based on locally defined feature flag

- Configure chromecast based on locally defined feature flag
fix: LEARNER-9610
@codecov
Copy link

codecov bot commented Sep 20, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.01% ⚠️

Comparison is base (b4dc1df) 1.10% compared to head (6375a83) 1.09%.
Report is 1 commits behind head on app_nav.

Additional details and impacted files
@@             Coverage Diff              @@
##             app_nav   #1822      +/-   ##
============================================
- Coverage       1.10%   1.09%   -0.01%     
  Complexity       137     137              
============================================
  Files            536     536              
  Lines          25797   25866      +69     
  Branches        3294    3298       +4     
============================================
  Hits             284     284              
- Misses         25486   25555      +69     
  Partials          27      27              
Files Changed Coverage Δ
...c/main/java/org/edx/mobile/base/BaseAppActivity.kt 0.00% <0.00%> (ø)
...ain/java/org/edx/mobile/player/PlayerFragment.java 0.00% <0.00%> (ø)
...bile/src/main/java/org/edx/mobile/util/Config.java 10.28% <0.00%> (-0.06%) ⬇️
...obile/view/app_nav/CourseUnitNavigationActivity.kt 0.00% <0.00%> (ø)

... and 17 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@farhan-arshad-dev farhan-arshad-dev left a comment

Choose a reason for hiding this comment

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

Minor concerns, otherwise LTGM 🏎️ .

PS: Incapable of conducting manual testing for this PR.

@@ -82,6 +82,7 @@ public class Config {
private static final String COURSE_VIDEOS_ENABLED = "COURSE_VIDEOS_ENABLED";
private static final String DOWNLOAD_TO_SD_CARD_ENABLED = "DOWNLOAD_TO_SD_CARD_ENABLED";
private static final String ANNOUNCEMENTS_ENABLED = "ANNOUNCEMENTS_ENABLED";
private static final String CHROME_CAST_ENABLED = "CHROME_CAST_ENABLED";
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO CHROMECAST_ENABLED is more appropriate cuz CHROMECAST is a single word.

@@ -84,7 +90,7 @@ abstract class BaseAppActivity : AppCompatActivity(), CastStateListener {
*/
try {
if (isInForeground) {
if (mediaRouteMenuItem != null) {
if (config.isChromeCastEnabled && mediaRouteMenuItem != null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO better to move the config.isChromeCastEnabled with isInForeground, cuz no need to invalidateOptionsMenu if there is no ChromeCast.

@@ -653,7 +653,7 @@ class CourseUnitNavigationActivity : BaseFragmentActivity(), CourseUnitFragment.

override fun showGoogleCastButton(): Boolean {
val component = getCurrentComponent()
return if (component is VideoBlockModel) {
return if (config.isChromeCastEnabled && component is VideoBlockModel) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think there is no need to check the config here, cuz before calling the showGoogleCastButton BaseAppActivity has the null check at Line#93

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add this check here because this method is calling from multiple places.

@omerhabib26 omerhabib26 merged commit ee01956 into app_nav Sep 25, 2023
2 of 5 checks passed
@omerhabib26 omerhabib26 deleted the omer/LEARNER-9610 branch September 25, 2023 07:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants