-
Notifications
You must be signed in to change notification settings - Fork 334
chore: Disable chromecast behind a local feature flag #1822
Conversation
- Configure chromecast based on locally defined feature flag fix: LEARNER-9610
Codecov ReportPatch coverage has no change and project coverage change:
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
☔ View full report in Codecov by Sentry. |
There was a problem hiding this 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"; |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
Description
LEARNER-9610