Merge "Fix WM presubmit failures" into tm-qpr-dev am: b8cbfd3fd5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19095348 Change-Id: I9464f7b36328ff57e42529f4dd6cacef8b74f62d Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -88,26 +88,15 @@ public class SizeConfigurationBucketsTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests that null size configuration buckets unflips the correct configuration flags.
|
* Tests that {@code null} size configuration buckets do not unflip the configuration flags.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testNullSizeConfigurationBuckets() {
|
public void testNullSizeConfigurationBuckets() {
|
||||||
// Check that all 3 size configurations are filtered out of the diff if the buckets are null
|
|
||||||
// and non-size attributes of screen layout are unchanged. Add a non-size related config
|
|
||||||
// change (i.e. CONFIG_LOCALE) to test that the diff is not set to zero.
|
|
||||||
final int diff = CONFIG_SCREEN_SIZE | CONFIG_SMALLEST_SCREEN_SIZE | CONFIG_SCREEN_LAYOUT
|
final int diff = CONFIG_SCREEN_SIZE | CONFIG_SMALLEST_SCREEN_SIZE | CONFIG_SCREEN_LAYOUT
|
||||||
| CONFIG_LOCALE;
|
| CONFIG_LOCALE;
|
||||||
final int filteredDiffNonSizeLayoutUnchanged = SizeConfigurationBuckets.filterDiff(diff,
|
final int filteredDiffNonSizeLayoutUnchanged = SizeConfigurationBuckets.filterDiff(diff,
|
||||||
Configuration.EMPTY, Configuration.EMPTY, null);
|
Configuration.EMPTY, Configuration.EMPTY, null);
|
||||||
assertEquals(CONFIG_LOCALE, filteredDiffNonSizeLayoutUnchanged);
|
assertEquals(diff, filteredDiffNonSizeLayoutUnchanged);
|
||||||
|
|
||||||
// Check that only screen size and smallest screen size are filtered out of the diff if the
|
|
||||||
// buckets are null and non-size attributes of screen layout are changed.
|
|
||||||
final Configuration newConfig = new Configuration();
|
|
||||||
newConfig.screenLayout |= SCREENLAYOUT_ROUND_YES;
|
|
||||||
final int filteredDiffNonSizeLayoutChanged = SizeConfigurationBuckets.filterDiff(diff,
|
|
||||||
Configuration.EMPTY, newConfig, null);
|
|
||||||
assertEquals(CONFIG_SCREEN_LAYOUT | CONFIG_LOCALE, filteredDiffNonSizeLayoutChanged);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW;
|
|||||||
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
|
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
|
||||||
import static android.content.pm.ActivityInfo.CONFIG_ORIENTATION;
|
import static android.content.pm.ActivityInfo.CONFIG_ORIENTATION;
|
||||||
import static android.content.pm.ActivityInfo.CONFIG_SCREEN_LAYOUT;
|
import static android.content.pm.ActivityInfo.CONFIG_SCREEN_LAYOUT;
|
||||||
|
import static android.content.pm.ActivityInfo.CONFIG_SCREEN_SIZE;
|
||||||
|
import static android.content.pm.ActivityInfo.CONFIG_SMALLEST_SCREEN_SIZE;
|
||||||
import static android.content.pm.ActivityInfo.FLAG_SUPPORTS_PICTURE_IN_PICTURE;
|
import static android.content.pm.ActivityInfo.FLAG_SUPPORTS_PICTURE_IN_PICTURE;
|
||||||
import static android.content.pm.ActivityInfo.LOCK_TASK_LAUNCH_MODE_ALWAYS;
|
import static android.content.pm.ActivityInfo.LOCK_TASK_LAUNCH_MODE_ALWAYS;
|
||||||
import static android.content.pm.ActivityInfo.LOCK_TASK_LAUNCH_MODE_DEFAULT;
|
import static android.content.pm.ActivityInfo.LOCK_TASK_LAUNCH_MODE_DEFAULT;
|
||||||
@@ -182,6 +184,10 @@ public class ActivityRecordTests extends WindowTestsBase {
|
|||||||
|
|
||||||
private final String mPackageName = getInstrumentation().getTargetContext().getPackageName();
|
private final String mPackageName = getInstrumentation().getTargetContext().getPackageName();
|
||||||
|
|
||||||
|
private static final int ORIENTATION_CONFIG_CHANGES =
|
||||||
|
CONFIG_ORIENTATION | CONFIG_SCREEN_LAYOUT | CONFIG_SCREEN_SIZE
|
||||||
|
| CONFIG_SMALLEST_SCREEN_SIZE;
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
setBooted(mAtm);
|
setBooted(mAtm);
|
||||||
@@ -487,7 +493,7 @@ public class ActivityRecordTests extends WindowTestsBase {
|
|||||||
public void testSetRequestedOrientationUpdatesConfiguration() throws Exception {
|
public void testSetRequestedOrientationUpdatesConfiguration() throws Exception {
|
||||||
final ActivityRecord activity = new ActivityBuilder(mAtm)
|
final ActivityRecord activity = new ActivityBuilder(mAtm)
|
||||||
.setCreateTask(true)
|
.setCreateTask(true)
|
||||||
.setConfigChanges(CONFIG_ORIENTATION | CONFIG_SCREEN_LAYOUT)
|
.setConfigChanges(ORIENTATION_CONFIG_CHANGES)
|
||||||
.build();
|
.build();
|
||||||
activity.setState(RESUMED, "Testing");
|
activity.setState(RESUMED, "Testing");
|
||||||
|
|
||||||
@@ -710,7 +716,7 @@ public class ActivityRecordTests extends WindowTestsBase {
|
|||||||
final ActivityRecord activity = new ActivityBuilder(mAtm)
|
final ActivityRecord activity = new ActivityBuilder(mAtm)
|
||||||
.setCreateTask(true)
|
.setCreateTask(true)
|
||||||
.setLaunchTaskBehind(true)
|
.setLaunchTaskBehind(true)
|
||||||
.setConfigChanges(CONFIG_ORIENTATION | CONFIG_SCREEN_LAYOUT)
|
.setConfigChanges(ORIENTATION_CONFIG_CHANGES)
|
||||||
.build();
|
.build();
|
||||||
final Task task = activity.getTask();
|
final Task task = activity.getTask();
|
||||||
activity.setState(STOPPED, "Testing");
|
activity.setState(STOPPED, "Testing");
|
||||||
|
|||||||
Reference in New Issue
Block a user