summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Tiger Huang <tigerhuang@google.com> 2021-03-30 22:01:57 +0800
committer Tiger Huang <tigerhuang@google.com> 2021-03-30 15:59:00 +0000
commitc1577580cdc1237b5cb81c4393832faeb40b35d7 (patch)
treefeacb7116f8b217d13a8492a6d7ff80651d0c89a
parentaad3a86112ca23b4b965b29f3228d432154aea26 (diff)
Don't throw unsupported exception over binder call
Otherwise, Parcel will fail to read the arguments and the exception won't be sent to the caller. Bug: 179771384 Bug: 184037368 Test: atest DisplayPolicyTests Change-Id: I820067f409e9b061d338967f036445b7dc10a59c
-rw-r--r--services/core/java/com/android/server/wm/DisplayPolicy.java4
-rw-r--r--services/tests/wmtests/src/com/android/server/wm/DisplayPolicyTests.java2
2 files changed, 3 insertions, 3 deletions
diff --git a/services/core/java/com/android/server/wm/DisplayPolicy.java b/services/core/java/com/android/server/wm/DisplayPolicy.java
index d929d50919c6..8c5470578e80 100644
--- a/services/core/java/com/android/server/wm/DisplayPolicy.java
+++ b/services/core/java/com/android/server/wm/DisplayPolicy.java
@@ -905,8 +905,8 @@ public class DisplayPolicy {
&& win.mActivityRecord.fillsParent()
&& (win.mAttrs.privateFlags & PRIVATE_FLAG_FORCE_DRAW_BAR_BACKGROUNDS) != 0
&& attrs.getFitInsetsTypes() != 0) {
- throw new RuntimeException("Illegal attributes: Main activity window that isn't"
- + " translucent trying to fit insets: "
+ throw new IllegalArgumentException("Illegal attributes: Main activity window"
+ + " that isn't translucent trying to fit insets: "
+ attrs.getFitInsetsTypes()
+ " attrs=" + attrs);
}
diff --git a/services/tests/wmtests/src/com/android/server/wm/DisplayPolicyTests.java b/services/tests/wmtests/src/com/android/server/wm/DisplayPolicyTests.java
index 47cf53b621d3..c163ef152af6 100644
--- a/services/tests/wmtests/src/com/android/server/wm/DisplayPolicyTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/DisplayPolicyTests.java
@@ -227,7 +227,7 @@ public class DisplayPolicyTests extends WindowTestsBase {
assertEquals(mAppWindow, policy.getTopFullscreenOpaqueWindow());
}
- @Test(expected = RuntimeException.class)
+ @Test(expected = IllegalArgumentException.class)
public void testMainAppWindowDisallowFitSystemWindowTypes() {
final DisplayPolicy policy = mDisplayContent.getDisplayPolicy();
final WindowState activity = createBaseApplicationWindow();