Merge pull request #3345 from element-hq/feature/bma/removePipFlag

Allow `PictureInPicture` mode for Element Call.
This commit is contained in:
Benoit Marty 2024-08-27 21:55:59 +02:00 committed by GitHub
commit 4f062cdd10
2 changed files with 1 additions and 16 deletions

View file

@ -24,9 +24,6 @@ import com.squareup.anvil.annotations.ContributesBinding
import io.element.android.libraries.core.bool.orFalse import io.element.android.libraries.core.bool.orFalse
import io.element.android.libraries.di.AppScope import io.element.android.libraries.di.AppScope
import io.element.android.libraries.di.ApplicationContext import io.element.android.libraries.di.ApplicationContext
import io.element.android.libraries.featureflag.api.FeatureFlagService
import io.element.android.libraries.featureflag.api.FeatureFlags
import kotlinx.coroutines.runBlocking
import javax.inject.Inject import javax.inject.Inject
interface PipSupportProvider { interface PipSupportProvider {
@ -37,15 +34,10 @@ interface PipSupportProvider {
@ContributesBinding(AppScope::class) @ContributesBinding(AppScope::class)
class DefaultPipSupportProvider @Inject constructor( class DefaultPipSupportProvider @Inject constructor(
@ApplicationContext private val context: Context, @ApplicationContext private val context: Context,
private val featureFlagService: FeatureFlagService,
) : PipSupportProvider { ) : PipSupportProvider {
override fun isPipSupported(): Boolean { override fun isPipSupported(): Boolean {
val isSupportedByTheOs = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && val isSupportedByTheOs = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O &&
context.packageManager?.hasSystemFeature(PackageManager.FEATURE_PICTURE_IN_PICTURE).orFalse() context.packageManager?.hasSystemFeature(PackageManager.FEATURE_PICTURE_IN_PICTURE).orFalse()
return if (isSupportedByTheOs) { return isSupportedByTheOs
runBlocking { featureFlagService.isFeatureEnabled(FeatureFlags.PictureInPicture) }
} else {
false
}
} }
} }

View file

@ -120,13 +120,6 @@ enum class FeatureFlags(
defaultValue = { true }, defaultValue = { true },
isFinished = false, isFinished = false,
), ),
PictureInPicture(
key = "feature.pictureInPicture",
title = "Picture in Picture for Calls",
description = "Allow the Call to be rendered in PiP mode",
defaultValue = { it.buildType != BuildType.RELEASE },
isFinished = false,
),
PinnedEvents( PinnedEvents(
key = "feature.pinnedEvents", key = "feature.pinnedEvents",
title = "Pinned Events", title = "Pinned Events",