Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions espresso/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ The following artifacts were released:

**Bug Fixes**

Fix #2349, where multi-process + different rotation on 2 activities, would instantly timeout when waiting for the UI to rotate.

**New Features**

**Breaking Changes**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import static java.util.Collections.unmodifiableList;

import android.app.Application;
import android.app.Activity;
import android.content.Context;
import android.os.Build;
Expand All @@ -26,6 +27,7 @@
import androidx.test.espresso.UiController;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;

/** Helper methods to synchronize configuration changes with onView actions. */
final class ConfigurationSynchronizationUtils {
Expand All @@ -49,6 +51,12 @@ public static void waitForConfigurationChangesOnActivity(
if (Build.VERSION.SDK_INT >= 24 && currentActivity.isInMultiWindowMode()) {
return;
}
// If the application is running activities in different processes, activities that aren't
// on the main process may have a different orientation
if (Build.VERSION.SDK_INT >= 28 && !Objects.equals(
currentActivity.getApplicationInfo().processName, Application.getProcessName())) {
return;
}

int applicationOrientation = appContext.getResources().getConfiguration().orientation;
if (applicationOrientation != currentActivity.getResources().getConfiguration().orientation) {
Expand Down