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

Commit 62ee5ad1 authored by Matt Pietal's avatar Matt Pietal Committed by Android (Google) Code Review
Browse files

Merge "Remove flag transition_race_condition_part2" into main

parents 72a6e9d6 2e66a6a8
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -1441,16 +1441,6 @@ flag {
  bug: "362719719"
}

flag {
  name: "transition_race_condition_part2"
  namespace: "systemui"
  description: "Thread-safe keyguard transitions"
  bug: "409585200"
  metadata {
       purpose: PURPOSE_BUGFIX
  }
}

flag {
   name: "media_projection_request_attribution_fix"
   namespace: "systemui"
+5 −29
Original line number Diff line number Diff line
@@ -26,7 +26,6 @@ import android.util.Log
import com.android.app.animation.Interpolators
import com.android.app.tracing.coroutines.flow.traceAs
import com.android.app.tracing.coroutines.withContextTraced as withContext
import com.android.systemui.Flags.transitionRaceConditionPart2
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.keyguard.shared.model.KeyguardState
@@ -193,14 +192,9 @@ constructor(

        // Animators must be started on the main thread.
        return withContext("$TAG#startTransition", mainDispatcher) {
            if (!transitionRaceConditionPart2()) {
                withContextMutex.unlock()
            }
            if (lastStep.from == info.from && lastStep.to == info.to) {
                Log.i(TAG, "Duplicate call to start the transition, rejecting: $info")
                if (transitionRaceConditionPart2()) {
                withContextMutex.unlock()
                }
                return@withContext null
            }
            val isAnimatorRunning = lastAnimator?.isRunning() ?: false
@@ -270,9 +264,7 @@ constructor(
                animator.addListener(animatorListener)
                animator.addUpdateListener(updateListener)
                animator.start()
                if (transitionRaceConditionPart2()) {
                withContextMutex.unlock()
                }
                return@withContext null
            }
                ?: run {
@@ -283,9 +275,7 @@ constructor(

                    // No animator, so it's manual. Provide a mechanism to callback
                    updateTransitionId = UUID.randomUUID()
                    if (transitionRaceConditionPart2()) {
                    withContextMutex.unlock()
                    }
                    return@withContext updateTransitionId
                }
        }
@@ -301,17 +291,10 @@ constructor(
        // requires the same lock
        withContextMutex.lock()
        withContext("$TAG#updateTransition", mainDispatcher) {
            if (!transitionRaceConditionPart2()) {
                withContextMutex.unlock()
            }

            updateTransitionInternal(transitionId, value, state)

            if (transitionRaceConditionPart2()) {
            withContextMutex.unlock()
        }
    }
    }

    override suspend fun forceFinishCurrentTransition() {
        if (lastAnimator?.isRunning != true) {
@@ -321,10 +304,6 @@ constructor(
        withContextMutex.lock()

        return withContext("$TAG#forceFinishCurrentTransition", mainDispatcher) {
            if (!transitionRaceConditionPart2()) {
                withContextMutex.unlock()
            }

            Log.d(TAG, "forceFinishCurrentTransition() - emitting FINISHED early.")

            lastAnimator?.apply {
@@ -339,12 +318,9 @@ constructor(
                // Ask the listener to emit FINISHED and clean up its state.
                animatorListener?.onAnimationEnd(this)
            }

            if (transitionRaceConditionPart2()) {
            withContextMutex.unlock()
        }
    }
    }

    private suspend fun updateTransitionInternal(
        transitionId: UUID,