aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTsung-Mao Fang <tmfang@google.com>2022-03-15 11:41:46 +0800
committerTsung-Mao Fang <tmfang@google.com>2022-03-15 12:08:28 +0800
commit2d2725c2b83bebffa10e1d340e24aecf630a6332 (patch)
treec07b21202384270df069523ff3f6695435cacfe2
parent3eeba7f916e767f8fdf90a8c5be94d1f9e39370f (diff)
downloadrobolectric-shadows-2d2725c2b83bebffa10e1d340e24aecf630a6332.tar.gz
Add new parameter for dispatchResized API
Because the interface changed in Android T, we need to add new parameter for dispatchResized API. Test: Run Settings tests Fix: 224665081 Change-Id: I875ef91d4f619b3eb0938464a08b6154ba5bd9db
-rw-r--r--shadows/framework/src/main/java/org/robolectric/shadows/ShadowViewRootImpl.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/shadows/framework/src/main/java/org/robolectric/shadows/ShadowViewRootImpl.java b/shadows/framework/src/main/java/org/robolectric/shadows/ShadowViewRootImpl.java
index c42e50710..d59981fc2 100644
--- a/shadows/framework/src/main/java/org/robolectric/shadows/ShadowViewRootImpl.java
+++ b/shadows/framework/src/main/java/org/robolectric/shadows/ShadowViewRootImpl.java
@@ -150,7 +150,7 @@ public class ShadowViewRootImpl {
ClassParameter.from(android.view.DisplayCutout.ParcelableWrapper.class,
new android.view.DisplayCutout.ParcelableWrapper()));
// END-INTERNAL
- } else if (apiLevel >= Build.VERSION_CODES.S) {
+ } else if (apiLevel <= Build.VERSION_CODES.S_V2) {
// BEGIN-INTERNAL
ReflectionHelpers.callInstanceMethod(ViewRootImpl.class, component, "dispatchResized",
ClassParameter.from(ClientWindowFrames.class, clientWindowFrame),
@@ -160,6 +160,17 @@ public class ShadowViewRootImpl {
ClassParameter.from(boolean.class, false),
ClassParameter.from(int.class, 0));
// END-INTERNAL
+ } else if (apiLevel >= Build.VERSION_CODES.TIRAMISU) {
+ // BEGIN-INTERNAL
+ ReflectionHelpers.callInstanceMethod(ViewRootImpl.class, component, "dispatchResized",
+ ClassParameter.from(ClientWindowFrames.class, clientWindowFrame),
+ ClassParameter.from(boolean.class, true),
+ ClassParameter.from(MergedConfiguration.class, new MergedConfiguration()),
+ ClassParameter.from(boolean.class, false),
+ ClassParameter.from(boolean.class, false),
+ ClassParameter.from(int.class, 0),
+ ClassParameter.from(int.class, 0));
+ // END-INTERNAL
} else {
throw new RuntimeException("Could not find AndroidRuntimeAdapter for API level: " + apiLevel);
}