Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e2fb4b81 authored by Justin Weir's avatar Justin Weir
Browse files

Fix warnings

Only one warning fix changes any behavior. At the end of
reorderAllPlayers, there was a block of code that looks like it will execute but actually just declares a lambda that does not run.

Bug: 209148780
Test: ran all tests
Change-Id: I316c4ef7b459fe4a7e539e0aa57b873c6b688716
parent 5ec5a80c
Loading
Loading
Loading
Loading
+5 −9
Original line number Diff line number Diff line
@@ -127,7 +127,7 @@ class MediaCarouselController @Inject constructor(
    private val visualStabilityCallback: OnReorderingAllowedListener
    private var needsReordering: Boolean = false
    private var keysNeedRemoval = mutableSetOf<String>()
    protected var shouldScrollToActivePlayer: Boolean = false
    var shouldScrollToActivePlayer: Boolean = false
    private var isRtl: Boolean = false
        set(value) {
            if (value != field) {
@@ -413,9 +413,7 @@ class MediaCarouselController @Inject constructor(
                            .indexOfFirst { key -> it == key }
                    mediaCarouselScrollHandler
                            .scrollToPlayer(previousVisibleIndex, activeMediaIndex)
                } ?: {
                    mediaCarouselScrollHandler.scrollToPlayer(destIndex = activeMediaIndex)
                }
                } ?: mediaCarouselScrollHandler.scrollToPlayer(destIndex = activeMediaIndex)
            }
        }
    }
@@ -432,7 +430,7 @@ class MediaCarouselController @Inject constructor(
        val curVisibleMediaKey = MediaPlayerData.playerKeys()
                .elementAtOrNull(mediaCarouselScrollHandler.visibleMediaIndex)
        if (existingPlayer == null) {
            var newPlayer = mediaControlPanelFactory.get()
            val newPlayer = mediaControlPanelFactory.get()
            newPlayer.attachPlayer(MediaViewHolder.create(
                    LayoutInflater.from(context), mediaContent))
            newPlayer.mediaViewController.sizeChangedListener = this::updateCarouselDimensions
@@ -480,7 +478,7 @@ class MediaCarouselController @Inject constructor(
            MediaPlayerData.removeMediaPlayer(existingSmartspaceMediaKey)
        }

        var newRecs = mediaControlPanelFactory.get()
        val newRecs = mediaControlPanelFactory.get()
        newRecs.attachRecommendation(
                RecommendationViewHolder.create(LayoutInflater.from(context), mediaContent))
        newRecs.mediaViewController.sizeChangedListener = this::updateCarouselDimensions
@@ -1048,7 +1046,5 @@ internal object MediaPlayerData {
        return false
    }

    fun isSsReactivated(key: String): Boolean = mediaData.get(key)?.let {
        it.isSsReactivated
    } ?: false
    fun isSsReactivated(key: String): Boolean = mediaData.get(key)?.isSsReactivated ?: false
}
 No newline at end of file