Loading packages/SystemUI/aconfig/systemui.aconfig +0 −10 Original line number Diff line number Diff line Loading @@ -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" Loading packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardTransitionRepository.kt +5 −29 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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 Loading Loading @@ -270,9 +264,7 @@ constructor( animator.addListener(animatorListener) animator.addUpdateListener(updateListener) animator.start() if (transitionRaceConditionPart2()) { withContextMutex.unlock() } return@withContext null } ?: run { Loading @@ -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 } } Loading @@ -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) { Loading @@ -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 { Loading @@ -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, Loading Loading
packages/SystemUI/aconfig/systemui.aconfig +0 −10 Original line number Diff line number Diff line Loading @@ -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" Loading
packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardTransitionRepository.kt +5 −29 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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 Loading Loading @@ -270,9 +264,7 @@ constructor( animator.addListener(animatorListener) animator.addUpdateListener(updateListener) animator.start() if (transitionRaceConditionPart2()) { withContextMutex.unlock() } return@withContext null } ?: run { Loading @@ -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 } } Loading @@ -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) { Loading @@ -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 { Loading @@ -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, Loading