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

Commit d4b815cf authored by Cosmin Băieș's avatar Cosmin Băieș
Browse files

Fix NotificationShade toggling FLAG_NOT_FOCUSABLE

This fixes some issues caused by the NotificationShade becoming
focusable momentarily (by temporarily toggling off FLAG_NOT_FOCUSABLE
on their window) when locking the screen and animating in AOD.

This is essentially a revert of [1], which meant to make the window
focusable to block touches on the app under the NotificationShade
window. The problem with this approach is that focusability does not
impact where the touch events are actually dispatched, so it didn't fix
the original issue, but does create issues with the IME.

  [1]: I81843d4901f6f3bb0bb00f3d8eaa713da494b0fe

Test: FlickerTestsIme2:com.android.server.wm.flicker.ime.ShowImeOnUnlockScreenTest
Bug: 300446848
Flag: NONE
Change-Id: Ief3a46664ef87e4c23c732189867eda63e9e5688
parent 41f79f55
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -155,7 +155,6 @@ public class NotificationShadeWindowControllerImplTest extends SysuiTestCase {
                mColorExtractor,
                mDumpManager,
                mKeyguardStateController,
                mKosmos.getScreenOffAnimationController(),
                mAuthController,
                mKosmos::getShadeInteractor,
                mShadeWindowLogger,
+2 −12
Original line number Diff line number Diff line
@@ -68,7 +68,6 @@ import com.android.systemui.statusbar.StatusBarState;
import com.android.systemui.statusbar.SysuiStatusBarStateController;
import com.android.systemui.statusbar.phone.DozeParameters;
import com.android.systemui.statusbar.phone.KeyguardBypassController;
import com.android.systemui.statusbar.phone.ScreenOffAnimationController;
import com.android.systemui.statusbar.phone.ScrimController;
import com.android.systemui.statusbar.phone.StatusBarWindowCallback;
import com.android.systemui.statusbar.policy.ConfigurationController;
@@ -131,7 +130,6 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW
            mCallbacks = new ArrayList<>();

    private final SysuiColorExtractor mColorExtractor;
    private final ScreenOffAnimationController mScreenOffAnimationController;
    /**
     * Layout params would be aggregated and dispatched all at once if this is > 0.
     *
@@ -159,7 +157,6 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW
            SysuiColorExtractor colorExtractor,
            DumpManager dumpManager,
            KeyguardStateController keyguardStateController,
            ScreenOffAnimationController screenOffAnimationController,
            AuthController authController,
            Lazy<ShadeInteractor> shadeInteractorLazy,
            ShadeWindowLogger logger,
@@ -179,7 +176,6 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW
        mKeyguardBypassController = keyguardBypassController;
        mBackgroundExecutor = backgroundExecutor;
        mColorExtractor = colorExtractor;
        mScreenOffAnimationController = screenOffAnimationController;
        // prefix with {slow} to make sure this dumps at the END of the critical section.
        dumpManager.registerCriticalDumpable("{slow}NotificationShadeWindowControllerImpl", this);
        mAuthController = authController;
@@ -441,14 +437,8 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW
    private void applyFocusableFlag(NotificationShadeWindowState state) {
        boolean panelFocusable = state.notificationShadeFocusable && state.shadeOrQsExpanded;
        if (state.bouncerShowing && (state.keyguardOccluded || state.keyguardNeedsInput)
                || ENABLE_REMOTE_INPUT && state.remoteInputActive
                // Make the panel focusable if we're doing the screen off animation, since the light
                // reveal scrim is drawing in the panel and should consume touch events so that they
                // don't go to the app behind.
                || mScreenOffAnimationController.shouldIgnoreKeyguardTouches()) {
            mLpChanged.flags &= ~LayoutParams.FLAG_NOT_FOCUSABLE;
            mLpChanged.flags &= ~LayoutParams.FLAG_ALT_FOCUSABLE_IM;
        } else if (state.glanceableHubShowing) {
                || (ENABLE_REMOTE_INPUT && state.remoteInputActive)
                || state.glanceableHubShowing) {
            mLpChanged.flags &= ~LayoutParams.FLAG_NOT_FOCUSABLE;
            mLpChanged.flags &= ~LayoutParams.FLAG_ALT_FOCUSABLE_IM;
        } else if (state.isKeyguardShowingAndNotOccluded() || panelFocusable) {
+0 −1
Original line number Diff line number Diff line
@@ -262,7 +262,6 @@ public class KeyguardViewMediatorTest extends SysuiTestCase {
                mColorExtractor,
                mDumpManager,
                mKeyguardStateController,
                mScreenOffAnimationController,
                mAuthController,
                () -> mShadeInteractor,
                mShadeWindowLogger,
+0 −3
Original line number Diff line number Diff line
@@ -338,8 +338,6 @@ public class BubblesTest extends SysuiTestCase {
    @Mock
    private KeyguardStateController mKeyguardStateController;
    @Mock
    private ScreenOffAnimationController mScreenOffAnimationController;
    @Mock
    Transitions mTransitions;
    @Mock
    private Optional<OneHandedController> mOneHandedOptional;
@@ -491,7 +489,6 @@ public class BubblesTest extends SysuiTestCase {
                mColorExtractor,
                mDumpManager,
                mKeyguardStateController,
                mScreenOffAnimationController,
                mAuthController,
                () -> mShadeInteractor,
                mShadeWindowLogger,
+0 −2
Original line number Diff line number Diff line
@@ -56,7 +56,6 @@ import com.android.systemui.shade.data.repository.shadeRepository
import com.android.systemui.shade.domain.interactor.shadeInteractor
import com.android.systemui.shade.shadeController
import com.android.systemui.statusbar.notification.stack.domain.interactor.sharedNotificationContainerInteractor
import com.android.systemui.statusbar.phone.screenOffAnimationController
import com.android.systemui.statusbar.pipeline.mobile.data.repository.fakeMobileConnectionsRepository
import com.android.systemui.statusbar.policy.data.repository.fakeDeviceProvisioningRepository
import com.android.systemui.statusbar.policy.domain.interactor.deviceProvisioningInteractor
@@ -90,7 +89,6 @@ class KosmosJavaAdapter(
    val simBouncerInteractor by lazy { kosmos.simBouncerInteractor }
    val statusBarStateController by lazy { kosmos.statusBarStateController }
    val interactionJankMonitor by lazy { kosmos.interactionJankMonitor }
    val screenOffAnimationController by lazy { kosmos.screenOffAnimationController }
    val fakeSceneContainerConfig by lazy { kosmos.sceneContainerConfig }
    val sceneInteractor by lazy { kosmos.sceneInteractor }
    val falsingCollector by lazy { kosmos.falsingCollector }
Loading