Loading libs/WindowManager/Jetpack/src/androidx/window/extensions/area/WindowAreaComponentImpl.java +4 −1 Original line number Diff line number Diff line Loading @@ -126,7 +126,10 @@ public class WindowAreaComponentImpl implements WindowAreaComponent, return state.getIdentifier(); } } return INVALID_DEVICE_STATE_IDENTIFIER; // If RDMV2 flag is enabled but not properly configured, let's fall back to RDMV1 if // possible. return getRdmV1Identifier(currentSupportedDeviceStates); } public WindowAreaComponentImpl(@NonNull Context context) { Loading libs/WindowManager/Jetpack/tests/unittest/src/androidx/window/extensions/area/WindowAreaComponentImplTests.java +10 −3 Original line number Diff line number Diff line Loading @@ -143,13 +143,20 @@ public class WindowAreaComponentImplTests { } @Test public void testRdmV2Identifier_whenStateIsProperlyConfigured() { public void testFallsBackToRdmV1() { // Test that if we try to get RDMV2 but it's not available, that we get RDMV1 if it is // available. final List<DeviceState> supportedStates = new ArrayList<>(); supportedStates.add(REAR_DISPLAY_STATE_V1); assertEquals(INVALID_DEVICE_STATE_IDENTIFIER, assertEquals(REAR_DISPLAY_STATE_V1.getIdentifier(), WindowAreaComponentImpl.getRdmV2Identifier(supportedStates)); } @Test public void testRdmV2Identifier_whenStateIsProperlyConfigured() { final List<DeviceState> supportedStates = new ArrayList<>(); supportedStates.add(REAR_DISPLAY_STATE_V1); supportedStates.add(REAR_DISPLAY_STATE_V2); assertEquals(REAR_DISPLAY_STATE_V2.getIdentifier(), WindowAreaComponentImpl.getRdmV2Identifier(supportedStates)); Loading Loading
libs/WindowManager/Jetpack/src/androidx/window/extensions/area/WindowAreaComponentImpl.java +4 −1 Original line number Diff line number Diff line Loading @@ -126,7 +126,10 @@ public class WindowAreaComponentImpl implements WindowAreaComponent, return state.getIdentifier(); } } return INVALID_DEVICE_STATE_IDENTIFIER; // If RDMV2 flag is enabled but not properly configured, let's fall back to RDMV1 if // possible. return getRdmV1Identifier(currentSupportedDeviceStates); } public WindowAreaComponentImpl(@NonNull Context context) { Loading
libs/WindowManager/Jetpack/tests/unittest/src/androidx/window/extensions/area/WindowAreaComponentImplTests.java +10 −3 Original line number Diff line number Diff line Loading @@ -143,13 +143,20 @@ public class WindowAreaComponentImplTests { } @Test public void testRdmV2Identifier_whenStateIsProperlyConfigured() { public void testFallsBackToRdmV1() { // Test that if we try to get RDMV2 but it's not available, that we get RDMV1 if it is // available. final List<DeviceState> supportedStates = new ArrayList<>(); supportedStates.add(REAR_DISPLAY_STATE_V1); assertEquals(INVALID_DEVICE_STATE_IDENTIFIER, assertEquals(REAR_DISPLAY_STATE_V1.getIdentifier(), WindowAreaComponentImpl.getRdmV2Identifier(supportedStates)); } @Test public void testRdmV2Identifier_whenStateIsProperlyConfigured() { final List<DeviceState> supportedStates = new ArrayList<>(); supportedStates.add(REAR_DISPLAY_STATE_V1); supportedStates.add(REAR_DISPLAY_STATE_V2); assertEquals(REAR_DISPLAY_STATE_V2.getIdentifier(), WindowAreaComponentImpl.getRdmV2Identifier(supportedStates)); Loading