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

Commit 38559184 authored by Vladimir Komsiyski's avatar Vladimir Komsiyski Committed by Android (Google) Code Review
Browse files

Merge "Do not crash when trying to sleep non-existent display" into main

parents bc121cbf 16262bab
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -6460,8 +6460,10 @@ public final class PowerManagerService extends SystemService
                groupIds = mDisplayManagerInternal.getDisplayGroupIds();
            } else {
                DisplayInfo displayInfo = mDisplayManagerInternal.getDisplayInfo(displayId);
                Preconditions.checkArgument(displayInfo != null, "display ID(%d) doesn't exist",
                        displayId);
                if (displayInfo == null) {
                    Slog.w(TAG, "Can not sleep non-existent display ID " + displayId);
                    return;
                }
                int groupId = displayInfo.displayGroupId;
                if (groupId == Display.INVALID_DISPLAY_GROUP) {
                    throw new IllegalArgumentException("invalid display group ID");