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

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

Merge "Clean up aconfig flag media_lockscreen_launch_animation." into main

parents 55d95393 e76ed4c3
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -1404,16 +1404,6 @@ flag {
   }
}

flag {
    name: "media_lockscreen_launch_animation"
    namespace : "systemui"
    description : "Enable the origin launch animation for UMO when opening on top of lockscreen."
    bug : "346865769"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
  name: "expand_heads_up_on_inline_reply"
  namespace: "systemui"
+0 −65
Original line number Diff line number Diff line
@@ -32,14 +32,12 @@ import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.keyguard.KeyguardUpdateMonitor
import com.android.systemui.ActivityIntentHelper
import com.android.systemui.Flags
import com.android.systemui.SysuiTestCase
import com.android.systemui.animation.ActivityTransitionAnimator
import com.android.systemui.animation.LaunchableView
import com.android.systemui.assist.AssistManager
import com.android.systemui.communal.domain.interactor.CommunalSceneInteractor
import com.android.systemui.communal.domain.interactor.CommunalSettingsInteractor
import com.android.systemui.communal.domain.interactor.communalSettingsInteractor
import com.android.systemui.keyguard.KeyguardViewMediator
import com.android.systemui.keyguard.WakefulnessLifecycle
import com.android.systemui.kosmos.testScope
@@ -392,7 +390,6 @@ class LegacyActivityStarterInternalImplTest : SysuiTestCase() {
        verify(centralSurfaces).getAnimatorControllerFromNotification(associatedView)
    }

    @EnableFlags(Flags.FLAG_MEDIA_LOCKSCREEN_LAUNCH_ANIMATION)
    @Test
    fun startPendingIntentDismissingKeyguard_transitionAnimator_animateOverOcclusion() {
        val parent = FrameLayout(context)
@@ -426,40 +423,6 @@ class LegacyActivityStarterInternalImplTest : SysuiTestCase() {
            )
    }

    @DisableFlags(Flags.FLAG_MEDIA_LOCKSCREEN_LAUNCH_ANIMATION)
    @Test
    fun startPendingIntentDismissingKeyguard_transitionAnimator_doNotAnimateOverOcclusion() {
        val parent = FrameLayout(context)
        val view =
            object : View(context), LaunchableView {
                override fun setShouldBlockVisibilityChanges(block: Boolean) {}
            }
        parent.addView(view)
        val controller = ActivityTransitionAnimator.Controller.fromView(view)
        val pendingIntent = mock(PendingIntent::class.java)
        `when`(pendingIntent.isActivity).thenReturn(true)
        `when`(keyguardStateController.isShowing).thenReturn(true)
        `when`(keyguardStateController.isOccluded).thenReturn(true)

        underTest.startPendingIntentDismissingKeyguard(
            intent = pendingIntent,
            dismissShade = true,
            animationController = controller,
            showOverLockscreen = true,
            skipLockscreenChecks = true,
        )
        mainExecutor.runAllReady()

        verify(activityTransitionAnimator)
            .startPendingIntentWithAnimation(
                nullable(ActivityTransitionAnimator.Controller::class.java),
                eq(false),
                nullable(String::class.java),
                eq(true),
                any(),
            )
    }

    @Test
    fun startPendingIntentDismissingKeyguard_transitionAnimator_animateCommunal() {
        val parent = FrameLayout(context)
@@ -564,7 +527,6 @@ class LegacyActivityStarterInternalImplTest : SysuiTestCase() {
        verify(userTracker).userHandle
    }

    @EnableFlags(Flags.FLAG_MEDIA_LOCKSCREEN_LAUNCH_ANIMATION)
    @Test
    fun startActivity_transitionAnimator_animateOverOcclusion() {
        val intent = mock(Intent::class.java)
@@ -591,33 +553,6 @@ class LegacyActivityStarterInternalImplTest : SysuiTestCase() {
            )
    }

    @DisableFlags(Flags.FLAG_MEDIA_LOCKSCREEN_LAUNCH_ANIMATION)
    @Test
    fun startActivity_transitionAnimator_doNotAnimateOverOcclusion() {
        val intent = mock(Intent::class.java)
        val parent = FrameLayout(context)
        val view =
            object : View(context), LaunchableView {
                override fun setShouldBlockVisibilityChanges(block: Boolean) {}
            }
        parent.addView(view)
        val controller = ActivityTransitionAnimator.Controller.fromView(view)
        `when`(keyguardStateController.isShowing).thenReturn(true)
        `when`(keyguardStateController.isOccluded).thenReturn(true)

        mainExecutor.runAllReady()
        underTest.startActivity(intent, true, controller, true, null)

        verify(activityTransitionAnimator)
            .startIntentWithAnimation(
                nullable(ActivityTransitionAnimator.Controller::class.java),
                eq(false),
                nullable(String::class.java),
                eq(true),
                any(),
            )
    }

    @Test
    fun dismissKeyguardThenExecute_startWakeAndUnlock() {
        `when`(wakefulnessLifecycle.wakefulness).thenReturn(WakefulnessLifecycle.WAKEFULNESS_ASLEEP)
+8 −20
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@ import static android.provider.Settings.ACTION_MEDIA_CONTROLS_SETTINGS;

import static com.android.settingslib.flags.Flags.legacyLeAudioSharing;
import static com.android.systemui.Flags.communalHub;
import static com.android.systemui.Flags.mediaLockscreenLaunchAnimation;
import static com.android.systemui.media.controls.domain.pipeline.MediaActionsKt.getNotificationActions;
import static com.android.systemui.media.controls.ui.viewmodel.MediaControlViewModel.MEDIA_PLAYER_SCRIM_END_ALPHA;
import static com.android.systemui.media.controls.ui.viewmodel.MediaControlViewModel.MEDIA_PLAYER_SCRIM_START_ALPHA;
@@ -531,7 +530,6 @@ public class MediaControlPanel {
                        && mActivityIntentHelper.wouldPendingShowOverLockscreen(clickIntent,
                        mLockscreenUserManager.getCurrentUserId());
                if (showOverLockscreen) {
                    if (mediaLockscreenLaunchAnimation()) {
                    mActivityStarter.startPendingIntentMaybeDismissingKeyguard(
                            clickIntent,
                            /* dismissShade = */ true,
@@ -540,16 +538,6 @@ public class MediaControlPanel {
                            /* fillIntent = */ null,
                            /* extraOptions = */ null,
                            /* customMessage */ null);
                    } else {
                        try {
                            ActivityOptions opts = ActivityOptions.makeBasic();
                            opts.setPendingIntentBackgroundActivityStartMode(
                                    ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED);
                            clickIntent.send(opts.toBundle());
                        } catch (PendingIntent.CanceledException e) {
                            Log.e(TAG, "Pending intent for " + key + " was cancelled");
                        }
                    }
                } else {
                    mActivityStarter.postStartActivityDismissingKeyguard(clickIntent,
                            buildLaunchAnimatorController(mMediaViewHolder.getPlayer()));
+1 −1
Original line number Diff line number Diff line
@@ -543,7 +543,7 @@ constructor(
        showOverLockscreen: Boolean,
    ): Boolean {
        // TODO(b/294418322): always support launch animations when occluded.
        val ignoreOcclusion = showOverLockscreen && Flags.mediaLockscreenLaunchAnimation()
        val ignoreOcclusion = showOverLockscreen
        if (isKeyguardOccluded() && !ignoreOcclusion) {
            return false
        }
+1 −3
Original line number Diff line number Diff line
@@ -33,7 +33,6 @@ import android.view.View
import android.view.WindowManager
import com.android.keyguard.KeyguardUpdateMonitor
import com.android.systemui.ActivityIntentHelper
import com.android.systemui.Flags.mediaLockscreenLaunchAnimation
import com.android.systemui.animation.ActivityTransitionAnimator
import com.android.systemui.animation.DelegateTransitionAnimatorController
import com.android.systemui.animation.TransitionAnimator
@@ -682,8 +681,7 @@ constructor(
        showOverLockscreen: Boolean,
    ): Boolean {
        // TODO(b/294418322): always support launch animations when occluded.
        val ignoreOcclusion =
            (showOverLockscreen && mediaLockscreenLaunchAnimation()) || isCommunalWidgetLaunch()
        val ignoreOcclusion = showOverLockscreen || isCommunalWidgetLaunch()
        if (keyguardStateController.isOccluded && !ignoreOcclusion) {
            return false
        }
Loading