summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Louis Chang <louischang@google.com> 2023-08-30 09:29:17 +0000
committer Eric Biggers <ebiggers@google.com> 2023-09-11 19:01:34 +0000
commit223294a83fa42ecbd1f151afb0ffd0f6fc8947b6 (patch)
tree7fecf09d4e4688f73c8aad4a7146d701236bc95f
parent6e10088cf0ab348310185732f2ad3a3e437e5896 (diff)
Relaunch the activity with current configuration to avoid flakiness
The activity was relaunched with empty configuration, which unfortunately reset the SCREENLAYOUT_COMPAT_NEEDED bit of the app’s configuration. Therefore, the later test failed while comparing the configuration between the app and the activity. Bug: 295234586 Test: attest ActivityThreadTest Change-Id: Id667768cf345136038ab1d626141a014d2f1e616 Merged-In: Id667768cf345136038ab1d626141a014d2f1e616 (cherry picked from commit ef51f596258e6032ac6b9e23eee7394f574d43e5)
-rw-r--r--core/tests/coretests/src/android/app/activity/ActivityThreadTest.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/tests/coretests/src/android/app/activity/ActivityThreadTest.java b/core/tests/coretests/src/android/app/activity/ActivityThreadTest.java
index b73a87c8f0d9..5ca7080f2fa8 100644
--- a/core/tests/coretests/src/android/app/activity/ActivityThreadTest.java
+++ b/core/tests/coretests/src/android/app/activity/ActivityThreadTest.java
@@ -784,8 +784,10 @@ public class ActivityThreadTest {
}
private static ClientTransaction newRelaunchResumeTransaction(Activity activity) {
+ final Configuration currentConfig = activity.getResources().getConfiguration();
final ClientTransactionItem callbackItem = ActivityRelaunchItem.obtain(null,
- null, 0, new MergedConfiguration(), false /* preserveWindow */);
+ null, 0, new MergedConfiguration(currentConfig, currentConfig),
+ false /* preserveWindow */);
final ResumeActivityItem resumeStateRequest =
ResumeActivityItem.obtain(true /* isForward */,
false /* shouldSendCompatFakeFocus*/);