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

Commit 58a56dd7 authored by Justin Weir's avatar Justin Weir
Browse files

Deprecate startExpandLatencyTracking

Puts the only call to startExpandLatencyTracking behind the Scene
Container flag and marks it as deprecated. This needs to be
reimplemented in a different way for Flexiglass.

Flag: ACONFIG com.android.systemui.scene_container DEVELOPMENT
Test: Updated and ran affected test
Bug: 303267342
Bug: 329863123
Change-Id: I16e3522a655023f8352211020374b6d1cfa3d421
parent 4299a537
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -86,7 +86,6 @@ import com.android.systemui.broadcast.BroadcastDispatcher;
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.dump.DumpManager;
import com.android.systemui.flags.FeatureFlags;
import com.android.systemui.keyguard.KeyguardUnlockAnimationController;
import com.android.systemui.keyguard.KeyguardWmStateRefactor;
import com.android.systemui.keyguard.WakefulnessLifecycle;
@@ -146,7 +145,6 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
    private static final long MAX_BACKOFF_MILLIS = 10 * 60 * 1000;

    private final Context mContext;
    private final FeatureFlags mFeatureFlags;
    private final SceneContainerFlags mSceneContainerFlags;
    private final Executor mMainExecutor;
    private final ShellInterface mShellInterface;
@@ -209,8 +207,10 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
        @Override
        public void onStatusBarTouchEvent(MotionEvent event) {
            verifyCallerAndClearCallingIdentity("onStatusBarTouchEvent", () -> {
                // TODO move this logic to message queue
                if (event.getActionMasked() == ACTION_DOWN) {
                if (mSceneContainerFlags.isEnabled()) {
                    //TODO(b/329863123) implement latency tracking for shade scene
                    Log.i(TAG_OPS, "Scene container enabled. Latency tracking not started.");
                } else if (event.getActionMasked() == ACTION_DOWN) {
                    mShadeViewControllerLazy.get().startExpandLatencyTracking();
                }
                mHandler.post(() -> {
@@ -600,7 +600,6 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
            KeyguardUnlockAnimationController sysuiUnlockAnimationController,
            InWindowLauncherUnlockAnimationManager inWindowLauncherUnlockAnimationManager,
            AssistUtils assistUtils,
            FeatureFlags featureFlags,
            SceneContainerFlags sceneContainerFlags,
            DumpManager dumpManager,
            Optional<UnfoldTransitionProgressForwarder> unfoldTransitionProgressForwarder,
@@ -613,7 +612,6 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
        }

        mContext = context;
        mFeatureFlags = featureFlags;
        mSceneContainerFlags = sceneContainerFlags;
        mMainExecutor = mainExecutor;
        mShellInterface = shellInterface;
+1 −0
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ interface ShadeViewController {
    fun disableHeader(state1: Int, state2: Int, animated: Boolean)

    /** If the latency tracker is enabled, begins tracking expand latency. */
    @Deprecated("No longer supported. Do not add new calls to this.")
    fun startExpandLatencyTracking()

    /** Sets the alpha value of the shade to a value between 0 and 255. */
+9 −18
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ import android.content.Context
import android.content.pm.PackageManager
import android.content.pm.ResolveInfo
import android.os.PowerManager
import android.os.Process;
import android.os.Process
import android.os.UserHandle
import android.testing.AndroidTestingRunner
import android.testing.TestableContext
@@ -34,8 +34,6 @@ import com.android.systemui.SysuiTestCase
import com.android.systemui.broadcast.BroadcastDispatcher
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.dump.DumpManager
import com.android.systemui.flags.FakeFeatureFlags
import com.android.systemui.flags.Flags
import com.android.systemui.keyguard.KeyguardUnlockAnimationController
import com.android.systemui.keyguard.WakefulnessLifecycle
import com.android.systemui.keyguard.ui.view.InWindowLauncherUnlockAnimationManager
@@ -96,7 +94,6 @@ class OverviewProxyServiceTest : SysuiTestCase() {
    private val displayTracker = FakeDisplayTracker(mContext)
    private val fakeSystemClock = FakeSystemClock()
    private val sysUiState = SysUiState(displayTracker, kosmos.sceneContainerPlugin)
    private val featureFlags = FakeFeatureFlags()
    private val wakefulnessLifecycle =
        WakefulnessLifecycle(mContext, null, fakeSystemClock, dumpManager)

@@ -121,8 +118,7 @@ class OverviewProxyServiceTest : SysuiTestCase() {
    @Mock
    private lateinit var unfoldTransitionProgressForwarder:
        Optional<UnfoldTransitionProgressForwarder>
    @Mock
    private lateinit var broadcastDispatcher: BroadcastDispatcher
    @Mock private lateinit var broadcastDispatcher: BroadcastDispatcher

    @Before
    fun setUp() {
@@ -205,16 +201,14 @@ class OverviewProxyServiceTest : SysuiTestCase() {

    @Test
    fun connectToOverviewService_primaryUser_expectBindService() {
        val mockitoSession = ExtendedMockito.mockitoSession()
                .spyStatic(Process::class.java)
                .startMocking()
        val mockitoSession =
            ExtendedMockito.mockitoSession().spyStatic(Process::class.java).startMocking()
        try {
            `when`(Process.myUserHandle()).thenReturn(UserHandle.SYSTEM)
            val spyContext = spy(context)
            val ops = createOverviewProxyService(spyContext)
            ops.startConnectionToCurrentUser()
            verify(spyContext, atLeast(1)).bindServiceAsUser(any(), any(),
                anyInt(), any())
            verify(spyContext, atLeast(1)).bindServiceAsUser(any(), any(), anyInt(), any())
        } finally {
            mockitoSession.finishMocking()
        }
@@ -222,16 +216,14 @@ class OverviewProxyServiceTest : SysuiTestCase() {

    @Test
    fun connectToOverviewService_nonPrimaryUser_expectNoBindService() {
        val mockitoSession = ExtendedMockito.mockitoSession()
                .spyStatic(Process::class.java)
                .startMocking()
        val mockitoSession =
            ExtendedMockito.mockitoSession().spyStatic(Process::class.java).startMocking()
        try {
            `when`(Process.myUserHandle()).thenReturn(UserHandle.of(12345))
            val spyContext = spy(context)
            val ops = createOverviewProxyService(spyContext)
            ops.startConnectionToCurrentUser()
            verify(spyContext, times(0)).bindServiceAsUser(any(), any(),
                anyInt(), any())
            verify(spyContext, times(0)).bindServiceAsUser(any(), any(), anyInt(), any())
        } finally {
            mockitoSession.finishMocking()
        }
@@ -257,7 +249,6 @@ class OverviewProxyServiceTest : SysuiTestCase() {
            sysuiUnlockAnimationController,
            inWindowLauncherUnlockAnimationManager,
            assistUtils,
            featureFlags,
            FakeSceneContainerFlags(),
            dumpManager,
            unfoldTransitionProgressForwarder,