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

Commit f2d67d01 authored by Aurélien Pomini's avatar Aurélien Pomini
Browse files

Small validation fix

No one ever calls the setStreamWithCrops API with a map of several
elements with one of the key being ORIENTATION_UNKNOWN: UNKNOWN is only
used internally.

But if it happens, it could lead to undefined behaviours

Flag: EXEMPT bugfix
Bug: 380271538
Test: presubmit
Change-Id: I69aca9ecf031485bcbfc4b149c6c426aa306797d
parent 24b62eb6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3181,7 +3181,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
                    throw new IllegalArgumentException("Invalid crop rect supplied: " + crop);
                }
                int orientation = screenOrientations[i];
                if (orientation == ORIENTATION_UNKNOWN && cropMap.size() > 1) {
                if (orientation == ORIENTATION_UNKNOWN && crops.size() > 1) {
                    throw new IllegalArgumentException("Invalid crops supplied: the UNKNOWN"
                            + "screen orientation should only be used in a singleton map");
                }