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

Commit 25eda8c2 authored by Chandru S's avatar Chandru S
Browse files

Revert "setOpaque to true on the surface whenever blur is not su..."

Revert submission 32837458

Reason for revert: This introduced a bug :( we rely on isBlurOpaque=false+blur radius of 0 to show the wallpaper behind the lockscreen. With this fix+battery saver enabled, the wallpaper is no longer visible. Working on a better fix that handles all scenarios.

Reverted changes: /q/submissionid:32837458

Change-Id: I03171687cb4bc24637d4b888e88980e512c0ee00
parent 3b11fdb8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -87,7 +87,7 @@ object WindowRootViewBinder {
                                "appliedBlurRadius",
                                blurRadiusToApply,
                            )
                            viewModel.onBlurApplied(blurRadiusToApply, lastScheduleBlurOpaqueness)
                            viewModel.onBlurApplied(blurRadiusToApply)
                        }

                        combine(viewModel.blurRadius, viewModel.isBlurOpaque, ::Pair)
+14 −18
Original line number Diff line number Diff line
@@ -69,15 +69,13 @@ constructor(
            .merge()

    val blurRadius: Flow<Float> =
        blurInteractor.isBlurCurrentlySupported
            .flatMapLatest { blurSupported ->
        blurInteractor.isBlurCurrentlySupported.flatMapLatest { blurSupported ->
            if (blurSupported) {
                _blurRadius
            } else {
                flowOf(0f)
            }
        }
            .logIfPossible("blurRadius")

    val isPersistentEarlyWakeupRequired =
        blurInteractor.isBlurCurrentlySupported
@@ -98,19 +96,17 @@ constructor(
            .logIfPossible("isPersistentEarlyWakeupRequired")

    val isBlurOpaque =
        blurInteractor.isBlurCurrentlySupported
            .flatMapLatest { blurSupported ->
        blurInteractor.isBlurCurrentlySupported.flatMapLatest { blurSupported ->
            if (blurSupported) {
                blurInteractor.isBlurOpaque.distinctUntilChanged().logIfPossible("isBlurOpaque")
            } else {
                    flowOf(true)
                flowOf(false)
            }
        }
            .logIfPossible("isBlurOpaque")

    fun onBlurApplied(blurRadius: Int, isOpaque: Boolean) {
    fun onBlurApplied(blurRadius: Int) {
        if (isLoggable) {
            Log.d(TAG, "blur applied for radius blurRadius: $blurRadius, isOpaque: $isOpaque")
            Log.d(TAG, "blur applied for radius $blurRadius")
        }
        blurInteractor.onBlurApplied(blurRadius)
    }