Merge "Make the notif panel focusable during screen off so touch events don't go to the app behind." into sc-dev

This commit is contained in:
Josh Tsuji
2021-06-28 18:33:45 +00:00
committed by Android (Google) Code Review
4 changed files with 22 additions and 5 deletions

View File

@@ -99,6 +99,7 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW
mCallbacks = Lists.newArrayList(); mCallbacks = Lists.newArrayList();
private final SysuiColorExtractor mColorExtractor; private final SysuiColorExtractor mColorExtractor;
private final UnlockedScreenOffAnimationController mUnlockedScreenOffAnimationController;
private float mFaceAuthDisplayBrightness = LayoutParams.BRIGHTNESS_OVERRIDE_NONE; private float mFaceAuthDisplayBrightness = LayoutParams.BRIGHTNESS_OVERRIDE_NONE;
@Inject @Inject
@@ -110,7 +111,8 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW
KeyguardBypassController keyguardBypassController, KeyguardBypassController keyguardBypassController,
SysuiColorExtractor colorExtractor, SysuiColorExtractor colorExtractor,
DumpManager dumpManager, DumpManager dumpManager,
KeyguardStateController keyguardStateController) { KeyguardStateController keyguardStateController,
UnlockedScreenOffAnimationController unlockedScreenOffAnimationController) {
mContext = context; mContext = context;
mWindowManager = windowManager; mWindowManager = windowManager;
mActivityManager = activityManager; mActivityManager = activityManager;
@@ -121,6 +123,7 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW
mKeyguardViewMediator = keyguardViewMediator; mKeyguardViewMediator = keyguardViewMediator;
mKeyguardBypassController = keyguardBypassController; mKeyguardBypassController = keyguardBypassController;
mColorExtractor = colorExtractor; mColorExtractor = colorExtractor;
mUnlockedScreenOffAnimationController = unlockedScreenOffAnimationController;
dumpManager.registerDumpable(getClass().getName(), this); dumpManager.registerDumpable(getClass().getName(), this);
mLockScreenDisplayTimeout = context.getResources() mLockScreenDisplayTimeout = context.getResources()
@@ -300,7 +303,11 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW
private void applyFocusableFlag(State state) { private void applyFocusableFlag(State state) {
boolean panelFocusable = state.mNotificationShadeFocusable && state.mPanelExpanded; boolean panelFocusable = state.mNotificationShadeFocusable && state.mPanelExpanded;
if (state.mBouncerShowing && (state.mKeyguardOccluded || state.mKeyguardNeedsInput) if (state.mBouncerShowing && (state.mKeyguardOccluded || state.mKeyguardNeedsInput)
|| ENABLE_REMOTE_INPUT && state.mRemoteInputActive) { || ENABLE_REMOTE_INPUT && state.mRemoteInputActive
// 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.
|| mUnlockedScreenOffAnimationController.isScreenOffAnimationPlaying()) {
mLpChanged.flags &= ~LayoutParams.FLAG_NOT_FOCUSABLE; mLpChanged.flags &= ~LayoutParams.FLAG_NOT_FOCUSABLE;
mLpChanged.flags &= ~LayoutParams.FLAG_ALT_FOCUSABLE_IM; mLpChanged.flags &= ~LayoutParams.FLAG_ALT_FOCUSABLE_IM;
} else if (state.isKeyguardShowingAndNotOccluded() || panelFocusable) { } else if (state.isKeyguardShowingAndNotOccluded() || panelFocusable) {

View File

@@ -72,6 +72,7 @@ public class NotificationShadeWindowControllerImplTest extends SysuiTestCase {
@Mock ColorExtractor.GradientColors mGradientColors; @Mock ColorExtractor.GradientColors mGradientColors;
@Mock private DumpManager mDumpManager; @Mock private DumpManager mDumpManager;
@Mock private KeyguardStateController mKeyguardStateController; @Mock private KeyguardStateController mKeyguardStateController;
@Mock private UnlockedScreenOffAnimationController mUnlockedScreenOffAnimationController;
@Captor private ArgumentCaptor<WindowManager.LayoutParams> mLayoutParameters; @Captor private ArgumentCaptor<WindowManager.LayoutParams> mLayoutParameters;
private NotificationShadeWindowControllerImpl mNotificationShadeWindowController; private NotificationShadeWindowControllerImpl mNotificationShadeWindowController;
@@ -85,7 +86,8 @@ public class NotificationShadeWindowControllerImplTest extends SysuiTestCase {
mNotificationShadeWindowController = new NotificationShadeWindowControllerImpl(mContext, mNotificationShadeWindowController = new NotificationShadeWindowControllerImpl(mContext,
mWindowManager, mActivityManager, mDozeParameters, mStatusBarStateController, mWindowManager, mActivityManager, mDozeParameters, mStatusBarStateController,
mConfigurationController, mKeyguardViewMediator, mKeyguardBypassController, mConfigurationController, mKeyguardViewMediator, mKeyguardBypassController,
mColorExtractor, mDumpManager, mKeyguardStateController); mColorExtractor, mDumpManager, mKeyguardStateController,
mUnlockedScreenOffAnimationController);
mNotificationShadeWindowController.setNotificationShadeView(mNotificationShadeWindowView); mNotificationShadeWindowController.setNotificationShadeView(mNotificationShadeWindowView);
mNotificationShadeWindowController.attach(); mNotificationShadeWindowController.attach();

View File

@@ -98,6 +98,7 @@ import com.android.systemui.statusbar.phone.KeyguardBypassController;
import com.android.systemui.statusbar.phone.NotificationShadeWindowControllerImpl; import com.android.systemui.statusbar.phone.NotificationShadeWindowControllerImpl;
import com.android.systemui.statusbar.phone.NotificationShadeWindowView; import com.android.systemui.statusbar.phone.NotificationShadeWindowView;
import com.android.systemui.statusbar.phone.ShadeController; import com.android.systemui.statusbar.phone.ShadeController;
import com.android.systemui.statusbar.phone.UnlockedScreenOffAnimationController;
import com.android.systemui.statusbar.policy.BatteryController; import com.android.systemui.statusbar.policy.BatteryController;
import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.statusbar.policy.ConfigurationController;
import com.android.systemui.statusbar.policy.HeadsUpManager; import com.android.systemui.statusbar.policy.HeadsUpManager;
@@ -233,6 +234,8 @@ public class BubblesTest extends SysuiTestCase {
private ShellTaskOrganizer mShellTaskOrganizer; private ShellTaskOrganizer mShellTaskOrganizer;
@Mock @Mock
private KeyguardStateController mKeyguardStateController; private KeyguardStateController mKeyguardStateController;
@Mock
private UnlockedScreenOffAnimationController mUnlockedScreenOffAnimationController;
private TestableBubblePositioner mPositioner; private TestableBubblePositioner mPositioner;
@@ -255,7 +258,8 @@ public class BubblesTest extends SysuiTestCase {
mNotificationShadeWindowController = new NotificationShadeWindowControllerImpl(mContext, mNotificationShadeWindowController = new NotificationShadeWindowControllerImpl(mContext,
mWindowManager, mActivityManager, mDozeParameters, mStatusBarStateController, mWindowManager, mActivityManager, mDozeParameters, mStatusBarStateController,
mConfigurationController, mKeyguardViewMediator, mKeyguardBypassController, mConfigurationController, mKeyguardViewMediator, mKeyguardBypassController,
mColorExtractor, mDumpManager, mKeyguardStateController); mColorExtractor, mDumpManager, mKeyguardStateController,
mUnlockedScreenOffAnimationController);
mNotificationShadeWindowController.setNotificationShadeView(mNotificationShadeWindowView); mNotificationShadeWindowController.setNotificationShadeView(mNotificationShadeWindowView);
mNotificationShadeWindowController.attach(); mNotificationShadeWindowController.attach();

View File

@@ -81,6 +81,7 @@ import com.android.systemui.statusbar.phone.KeyguardBypassController;
import com.android.systemui.statusbar.phone.NotificationShadeWindowControllerImpl; import com.android.systemui.statusbar.phone.NotificationShadeWindowControllerImpl;
import com.android.systemui.statusbar.phone.NotificationShadeWindowView; import com.android.systemui.statusbar.phone.NotificationShadeWindowView;
import com.android.systemui.statusbar.phone.ShadeController; import com.android.systemui.statusbar.phone.ShadeController;
import com.android.systemui.statusbar.phone.UnlockedScreenOffAnimationController;
import com.android.systemui.statusbar.policy.BatteryController; import com.android.systemui.statusbar.policy.BatteryController;
import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.statusbar.policy.ConfigurationController;
import com.android.systemui.statusbar.policy.HeadsUpManager; import com.android.systemui.statusbar.policy.HeadsUpManager;
@@ -197,6 +198,8 @@ public class NewNotifPipelineBubblesTest extends SysuiTestCase {
private ShellTaskOrganizer mShellTaskOrganizer; private ShellTaskOrganizer mShellTaskOrganizer;
@Mock @Mock
private KeyguardStateController mKeyguardStateController; private KeyguardStateController mKeyguardStateController;
@Mock
private UnlockedScreenOffAnimationController mUnlockedScreenOffAnimationController;
private TestableBubblePositioner mPositioner; private TestableBubblePositioner mPositioner;
@@ -218,7 +221,8 @@ public class NewNotifPipelineBubblesTest extends SysuiTestCase {
mNotificationShadeWindowController = new NotificationShadeWindowControllerImpl(mContext, mNotificationShadeWindowController = new NotificationShadeWindowControllerImpl(mContext,
mWindowManager, mActivityManager, mDozeParameters, mStatusBarStateController, mWindowManager, mActivityManager, mDozeParameters, mStatusBarStateController,
mConfigurationController, mKeyguardViewMediator, mKeyguardBypassController, mConfigurationController, mKeyguardViewMediator, mKeyguardBypassController,
mColorExtractor, mDumpManager, mKeyguardStateController); mColorExtractor, mDumpManager, mKeyguardStateController,
mUnlockedScreenOffAnimationController);
mNotificationShadeWindowController.setNotificationShadeView(mNotificationShadeWindowView); mNotificationShadeWindowController.setNotificationShadeView(mNotificationShadeWindowView);
mNotificationShadeWindowController.attach(); mNotificationShadeWindowController.attach();