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

Commit ba62b637 authored by Ady Abraham's avatar Ady Abraham Committed by Automerger Merge Worker
Browse files

Merge "DisplayModeService: check for null before accessing display mode" into sc-dev am: 7fc7f6bc

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15133562

Change-Id: I42ef2a7a34d31c7339cfc57182b8c0cda2559b7a
parents 1ed08ec3 7fc7f6bc
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -1528,8 +1528,14 @@ public final class DisplayManagerService extends SystemService {
            if (requestedModeId == 0 && requestedRefreshRate != 0) {
                // Scan supported modes returned by display.getInfo() to find a mode with the same
                // size as the default display mode but with the specified refresh rate instead.
                requestedModeId = display.getDisplayInfoLocked().findDefaultModeByRefreshRate(
                        requestedRefreshRate).getModeId();
                Display.Mode mode = display.getDisplayInfoLocked().findDefaultModeByRefreshRate(
                        requestedRefreshRate);
                if (mode != null) {
                    requestedModeId = mode.getModeId();
                } else {
                    Slog.e(TAG, "Couldn't find a mode for the requestedRefreshRate: "
                            + requestedRefreshRate + " on Display: " + displayId);
                }
            }
            mDisplayModeDirector.getAppRequestObserver().setAppRequest(
                    displayId, requestedModeId, requestedMaxRefreshRate);