Count isActivityEmbedded() state to show split screen warning dialog

According to Activity#isInMultiWindowMode() API design,
When the Task is in fullscreen windowing mode, and the app is in
ActivityEmbedding split (two activities split left and right),
Activity.isInMultiWindowMode() == true.

With the reason, we should consider additional condidion for
foldable device in unfolded mode, while settings activities
config to embedded activity, we can't only count on
isInMultiWindowMode() for split-screen mode

Bug: 278176550
Bug: 276938441
Test: atest CombinedBiometricProfileSettingsTest
Test: atest FingerprintSettingsFragmentTest
Test: manaul go to split screen mode and try to enroll face
Test: manual unfold device and enroll finger or face
Change-Id: I02bd223f27889e74e67b73051531a5b4554f3de1
This commit is contained in:
lbill
2023-04-14 09:36:54 +00:00
parent f77643bec7
commit 09276c9639
5 changed files with 25 additions and 19 deletions

View File

@@ -62,7 +62,7 @@ public class FaceSettingsEnrollButtonPreferenceControllerTest {
@Test
public void testOnClick_inFullScreen() {
when(mListener.checkInMultiWindowMode()).thenReturn(false);
when(mListener.onShowSplitScreenDialog()).thenReturn(false);
mController.onClick(mButton);
assertThat(mController.isClicked()).isTrue();
@@ -71,7 +71,7 @@ public class FaceSettingsEnrollButtonPreferenceControllerTest {
@Test
public void testOnClick_inMultiWindow() {
when(mListener.checkInMultiWindowMode()).thenReturn(true);
when(mListener.onShowSplitScreenDialog()).thenReturn(true);
mController.onClick(mButton);
assertThat(mController.isClicked()).isFalse();