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

Commit 3c74ec20 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes from topic "revert-32837458-PTQFLPPVWV" into main

* changes:
  Revert "setOpaque to true on the surface whenever blur is not su..."
  Revert "Fix for shade transparency bug when bouncer_ui_revamp fl..."
parents 6f89b52b 25eda8c2
Loading
Loading
Loading
Loading
+3 −8
Original line number Diff line number Diff line
@@ -316,14 +316,9 @@ constructor(
    }

    private val shouldBlurBeOpaque: Boolean
        get() {
            return if (Flags.notificationShadeBlur()) {
                // blur should be opaque when blur is not supported.
                !windowRootViewBlurInteractor.isBlurCurrentlySupported.value
            } else {
                scrimsVisible && !areBlursDisabledForAppLaunch
            }
        }
        get() =
            if (Flags.notificationShadeBlur()) false
            else scrimsVisible && !areBlursDisabledForAppLaunch

    /** Callback that updates the window blur value and is called only once per frame. */
    @VisibleForTesting
+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)
    }