Merge "Try to fix ActivityThreadTest failure on foldables" into sc-v2-dev am: 88c6602ef9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16280314 Change-Id: Ia222646249843c3e04eca50ca82e4aac0f43fa57
This commit is contained in:
@@ -309,18 +309,22 @@ public class ActivityThreadTest {
|
|||||||
final int numOfConfig = activity.mNumOfConfigChanges;
|
final int numOfConfig = activity.mNumOfConfigChanges;
|
||||||
|
|
||||||
final Configuration processConfigLandscape = new Configuration();
|
final Configuration processConfigLandscape = new Configuration();
|
||||||
|
processConfigLandscape.orientation = ORIENTATION_LANDSCAPE;
|
||||||
processConfigLandscape.windowConfiguration.setBounds(new Rect(0, 0, 100, 60));
|
processConfigLandscape.windowConfiguration.setBounds(new Rect(0, 0, 100, 60));
|
||||||
processConfigLandscape.seq = BASE_SEQ + 1;
|
processConfigLandscape.seq = BASE_SEQ + 1;
|
||||||
|
|
||||||
final Configuration activityConfigLandscape = new Configuration();
|
final Configuration activityConfigLandscape = new Configuration();
|
||||||
|
activityConfigLandscape.orientation = ORIENTATION_LANDSCAPE;
|
||||||
activityConfigLandscape.windowConfiguration.setBounds(new Rect(0, 0, 100, 50));
|
activityConfigLandscape.windowConfiguration.setBounds(new Rect(0, 0, 100, 50));
|
||||||
activityConfigLandscape.seq = BASE_SEQ + 2;
|
activityConfigLandscape.seq = BASE_SEQ + 2;
|
||||||
|
|
||||||
final Configuration processConfigPortrait = new Configuration();
|
final Configuration processConfigPortrait = new Configuration();
|
||||||
|
processConfigPortrait.orientation = ORIENTATION_PORTRAIT;
|
||||||
processConfigPortrait.windowConfiguration.setBounds(new Rect(0, 0, 60, 100));
|
processConfigPortrait.windowConfiguration.setBounds(new Rect(0, 0, 60, 100));
|
||||||
processConfigPortrait.seq = BASE_SEQ + 3;
|
processConfigPortrait.seq = BASE_SEQ + 3;
|
||||||
|
|
||||||
final Configuration activityConfigPortrait = new Configuration();
|
final Configuration activityConfigPortrait = new Configuration();
|
||||||
|
activityConfigPortrait.orientation = ORIENTATION_PORTRAIT;
|
||||||
activityConfigPortrait.windowConfiguration.setBounds(new Rect(0, 0, 50, 100));
|
activityConfigPortrait.windowConfiguration.setBounds(new Rect(0, 0, 50, 100));
|
||||||
activityConfigPortrait.seq = BASE_SEQ + 4;
|
activityConfigPortrait.seq = BASE_SEQ + 4;
|
||||||
|
|
||||||
@@ -348,7 +352,8 @@ public class ActivityThreadTest {
|
|||||||
assertEquals(activityConfigPortrait.windowConfiguration.getBounds(), bounds);
|
assertEquals(activityConfigPortrait.windowConfiguration.getBounds(), bounds);
|
||||||
|
|
||||||
// Ensure that Activity#onConfigurationChanged() not be called because the changes in
|
// Ensure that Activity#onConfigurationChanged() not be called because the changes in
|
||||||
// WindowConfiguration shouldn't be reported.
|
// WindowConfiguration shouldn't be reported, and we only apply the latest Configuration
|
||||||
|
// update in transaction.
|
||||||
assertEquals(numOfConfig, activity.mNumOfConfigChanges);
|
assertEquals(numOfConfig, activity.mNumOfConfigChanges);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user