File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
core/java/androidx/test/espresso/base Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,9 @@ The following artifacts were released:
1616
1717** Bug Fixes**
1818
19+ * Fix #2349 , where multi-process + different rotation on 2 activities would
20+ instantly timeout when waiting for the UI to rotate.
21+
1922** New Features**
2023
2124** Breaking Changes**
Original file line number Diff line number Diff line change 1919import static java .util .Collections .unmodifiableList ;
2020
2121import android .app .Activity ;
22+ import android .app .Application ;
2223import android .content .Context ;
2324import android .os .Build ;
2425import android .util .Log ;
2526import androidx .test .espresso .NoActivityResumedException ;
2627import androidx .test .espresso .UiController ;
2728import java .util .Arrays ;
2829import java .util .List ;
30+ import java .util .Objects ;
2931
3032/** Helper methods to synchronize configuration changes with onView actions. */
3133final class ConfigurationSynchronizationUtils {
@@ -49,6 +51,13 @@ public static void waitForConfigurationChangesOnActivity(
4951 if (Build .VERSION .SDK_INT >= 24 && currentActivity .isInMultiWindowMode ()) {
5052 return ;
5153 }
54+ // If the application is running activities in different processes, activities that aren't
55+ // on the main process may have a different orientation
56+ if (Build .VERSION .SDK_INT >= 28
57+ && !Objects .equals (
58+ currentActivity .getApplicationInfo ().processName , Application .getProcessName ())) {
59+ return ;
60+ }
5261
5362 int applicationOrientation = appContext .getResources ().getConfiguration ().orientation ;
5463 if (applicationOrientation != currentActivity .getResources ().getConfiguration ().orientation ) {
You can’t perform that action at this time.
0 commit comments