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
This commit is contained in:
Tiger Huang
2021-03-30 22:01:57 +08:00
parent aad3a86112
commit c1577580cd
2 changed files with 3 additions and 3 deletions

View File

@@ -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);
}

View File

@@ -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();