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:
16
16
17
17
** Bug Fixes**
18
18
19
+ * Fix #2349 , where multi-process + different rotation on 2 activities would
20
+ instantly timeout when waiting for the UI to rotate.
21
+
19
22
** New Features**
20
23
21
24
** Breaking Changes**
Original file line number Diff line number Diff line change 19
19
import static java .util .Collections .unmodifiableList ;
20
20
21
21
import android .app .Activity ;
22
+ import android .app .Application ;
22
23
import android .content .Context ;
23
24
import android .os .Build ;
24
25
import android .util .Log ;
25
26
import androidx .test .espresso .NoActivityResumedException ;
26
27
import androidx .test .espresso .UiController ;
27
28
import java .util .Arrays ;
28
29
import java .util .List ;
30
+ import java .util .Objects ;
29
31
30
32
/** Helper methods to synchronize configuration changes with onView actions. */
31
33
final class ConfigurationSynchronizationUtils {
@@ -49,6 +51,13 @@ public static void waitForConfigurationChangesOnActivity(
49
51
if (Build .VERSION .SDK_INT >= 24 && currentActivity .isInMultiWindowMode ()) {
50
52
return ;
51
53
}
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
+ }
52
61
53
62
int applicationOrientation = appContext .getResources ().getConfiguration ().orientation ;
54
63
if (applicationOrientation != currentActivity .getResources ().getConfiguration ().orientation ) {
You can’t perform that action at this time.
0 commit comments