Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 01baf6ce authored by Jeff Chang's avatar Jeff Chang
Browse files

Add argument checking when resize virtual display

Align the same behavior with createVirtualDisplay

Bug: 120223677
Test: atest CtsWindowManagerDeviceTestCases:ActivityViewTest#testResizeActivityView
Change-Id: I8eb9e11ef5c245fa281f603ea0d3eb7445c4f3db
parent 204a7dd8
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2020,6 +2020,10 @@ public final class DisplayManagerService extends SystemService {
        @Override // Binder call
        public void resizeVirtualDisplay(IVirtualDisplayCallback callback,
                int width, int height, int densityDpi) {
            if (width <= 0 || height <= 0 || densityDpi <= 0) {
                throw new IllegalArgumentException("width, height, and densityDpi must be "
                        + "greater than 0");
            }
            final long token = Binder.clearCallingIdentity();
            try {
                resizeVirtualDisplayInternal(callback.asBinder(), width, height, densityDpi);