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

Commit d2ac3f03 authored by Matt Pietal's avatar Matt Pietal
Browse files

Remove dreaming hosted lockscreen - Part #2

Bug: 364380926
Test: atest SystemUITests
Flag: EXEMPT cleanup old code
Change-Id: Id7f5113df3555508018ef14c5edd08c1a0faa3b8
parent 9e815b97
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -18,8 +18,6 @@ package com.android.keyguard;

import static android.view.View.INVISIBLE;

import static com.android.systemui.flags.Flags.LOCKSCREEN_WALLPAPER_DREAM_ENABLED;

import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.atLeast;
import static org.mockito.Mockito.mock;
@@ -171,7 +169,6 @@ public class KeyguardClockSwitchControllerBaseTest extends SysuiTestCase {
        when(mSmartspaceController.buildAndConnectView(any())).thenReturn(mFakeSmartspaceView);
        mExecutor = new FakeExecutor(new FakeSystemClock());
        mFakeFeatureFlags = new FakeFeatureFlags();
        mFakeFeatureFlags.set(LOCKSCREEN_WALLPAPER_DREAM_ENABLED, false);
        mController = new KeyguardClockSwitchController(
                mView,
                mStatusBarStateController,
@@ -188,7 +185,6 @@ public class KeyguardClockSwitchControllerBaseTest extends SysuiTestCase {
                mLogBuffer,
                KeyguardInteractorFactory.create(mFakeFeatureFlags).getKeyguardInteractor(),
                mKeyguardClockInteractor,
                mFakeFeatureFlags,
                mock(InWindowLauncherUnlockAnimationManager.class)
        );

+0 −62
Original line number Diff line number Diff line
/*
 * Copyright (C) 2023 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.keyguard

import android.view.View
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.flags.Flags.LOCKSCREEN_WALLPAPER_DREAM_ENABLED
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.runBlocking
import org.junit.Assert.assertEquals
import org.junit.Test
import org.junit.runner.RunWith

@RunWith(AndroidJUnit4::class)
@SmallTest
class KeyguardClockSwitchControllerWithCoroutinesTest : KeyguardClockSwitchControllerBaseTest() {

    @Test
    fun testStatusAreaVisibility_onLockscreenHostedDreamStateChanged() =
        runBlocking(IMMEDIATE) {
            // GIVEN starting state for the keyguard clock and wallpaper dream enabled
            mFakeFeatureFlags.set(LOCKSCREEN_WALLPAPER_DREAM_ENABLED, true)
            init()

            // WHEN dreaming starts
            mController.mIsActiveDreamLockscreenHostedCallback.accept(
                true /* isActiveDreamLockscreenHosted */
            )

            // THEN the status area is hidden
            mExecutor.runAllReady()
            assertEquals(View.INVISIBLE, mStatusArea.visibility)

            // WHEN dreaming stops
            mController.mIsActiveDreamLockscreenHostedCallback.accept(
                false /* isActiveDreamLockscreenHosted */
            )
            mExecutor.runAllReady()

            // THEN status area view is visible
            assertEquals(View.VISIBLE, mStatusArea.visibility)
        }

    companion object {
        private val IMMEDIATE = Dispatchers.Main.immediate
    }
}
+0 −5
Original line number Diff line number Diff line
@@ -42,7 +42,6 @@ import com.android.systemui.dock.DockManager
import com.android.systemui.dump.DumpManager
import com.android.systemui.flags.DisableSceneContainer
import com.android.systemui.flags.FakeFeatureFlagsClassic
import com.android.systemui.flags.Flags.LOCKSCREEN_WALLPAPER_DREAM_ENABLED
import com.android.systemui.flags.Flags.SPLIT_SHADE_SUBPIXEL_OPTIMIZATION
import com.android.systemui.flags.andSceneContainer
import com.android.systemui.keyevent.domain.interactor.SysUIKeyEventHandler
@@ -128,8 +127,6 @@ class NotificationShadeWindowViewControllerTest(flags: FlagsParameterization) :
    private lateinit var lockscreenShadeTransitionController: LockscreenShadeTransitionController
    @Mock private lateinit var phoneStatusBarViewController: PhoneStatusBarViewController
    @Mock private lateinit var pulsingGestureListener: PulsingGestureListener
    @Mock
    private lateinit var mLockscreenHostedDreamGestureListener: LockscreenHostedDreamGestureListener
    @Mock private lateinit var notificationInsetsController: NotificationInsetsController
    @Mock private lateinit var mGlanceableHubContainerController: GlanceableHubContainerController
    @Mock(answer = Answers.RETURNS_DEEP_STUBS)
@@ -181,7 +178,6 @@ class NotificationShadeWindowViewControllerTest(flags: FlagsParameterization) :

        featureFlagsClassic = FakeFeatureFlagsClassic()
        featureFlagsClassic.set(SPLIT_SHADE_SUBPIXEL_OPTIMIZATION, true)
        featureFlagsClassic.set(LOCKSCREEN_WALLPAPER_DREAM_ENABLED, false)
        mSetFlagsRule.enableFlags(Flags.FLAG_REVAMPED_BOUNCER_MESSAGES)

        testScope = TestScope()
@@ -213,7 +209,6 @@ class NotificationShadeWindowViewControllerTest(flags: FlagsParameterization) :
                shadeLogger,
                dumpManager,
                pulsingGestureListener,
                mLockscreenHostedDreamGestureListener,
                keyguardTransitionInteractor,
                mGlanceableHubContainerController,
                notificationLaunchAnimationInteractor,
+0 −4
Original line number Diff line number Diff line
@@ -111,8 +111,6 @@ class NotificationShadeWindowViewTest : SysuiTestCase() {
    @Mock private lateinit var dumpManager: DumpManager
    @Mock private lateinit var pulsingGestureListener: PulsingGestureListener
    @Mock private lateinit var sysUiUnfoldComponent: SysUIUnfoldComponent
    @Mock
    private lateinit var mLockscreenHostedDreamGestureListener: LockscreenHostedDreamGestureListener
    @Mock private lateinit var keyguardBouncerComponentFactory: KeyguardBouncerComponent.Factory
    @Mock private lateinit var keyguardBouncerComponent: KeyguardBouncerComponent
    @Mock
@@ -156,7 +154,6 @@ class NotificationShadeWindowViewTest : SysuiTestCase() {

        val featureFlags = FakeFeatureFlags()
        featureFlags.set(Flags.SPLIT_SHADE_SUBPIXEL_OPTIMIZATION, true)
        featureFlags.set(Flags.LOCKSCREEN_WALLPAPER_DREAM_ENABLED, false)
        mSetFlagsRule.enableFlags(AConfigFlags.FLAG_REVAMPED_BOUNCER_MESSAGES)
        testScope = TestScope()
        controller =
@@ -184,7 +181,6 @@ class NotificationShadeWindowViewTest : SysuiTestCase() {
                shadeLogger,
                dumpManager,
                pulsingGestureListener,
                mLockscreenHostedDreamGestureListener,
                keyguardTransitionInteractor,
                mGlanceableHubContainerController,
                NotificationLaunchAnimationInteractor(NotificationLaunchAnimationRepository()),
+0 −2
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ package com.android.systemui.statusbar;
import static android.app.admin.DevicePolicyManager.DEVICE_OWNER_TYPE_DEFAULT;

import static com.android.systemui.flags.Flags.KEYGUARD_TALKBACK_FIX;
import static com.android.systemui.flags.Flags.LOCKSCREEN_WALLPAPER_DREAM_ENABLED;
import static com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController.INDICATION_TYPE_TRANSIENT;
import static com.android.systemui.keyguard.ScreenLifecycle.SCREEN_ON;

@@ -273,7 +272,6 @@ public class KeyguardIndicationControllerBaseTest extends SysuiTestCase {

        mFlags = new FakeFeatureFlags();
        mFlags.set(KEYGUARD_TALKBACK_FIX, true);
        mFlags.set(LOCKSCREEN_WALLPAPER_DREAM_ENABLED, false);
        mController = new KeyguardIndicationController(
                mContext,
                mTestableLooper.getLooper(),
Loading