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

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

Merge changes Ie62c35fb,I1a061dc1 into main

* changes:
  Fix for shade transparency bug when bouncer_ui_revamp flag is not enabled.
  setOpaque to true on the surface whenever blur is not supported.
parents f5d7074e 5869e2f8
Loading
Loading
Loading
Loading
+8 −3
Original line number Original line Diff line number Diff line
@@ -316,9 +316,14 @@ constructor(
    }
    }


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


    /** Callback that updates the window blur value and is called only once per frame. */
    /** Callback that updates the window blur value and is called only once per frame. */
    @VisibleForTesting
    @VisibleForTesting
+1 −1
Original line number Original line Diff line number Diff line
@@ -87,7 +87,7 @@ object WindowRootViewBinder {
                                "appliedBlurRadius",
                                "appliedBlurRadius",
                                blurRadiusToApply,
                                blurRadiusToApply,
                            )
                            )
                            viewModel.onBlurApplied(blurRadiusToApply)
                            viewModel.onBlurApplied(blurRadiusToApply, lastScheduleBlurOpaqueness)
                        }
                        }


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


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


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


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


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