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

Commit 90e1a4d4 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Protect against null Displays."

parents 6b9b10ed 91c2838a
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -664,6 +664,12 @@ public class DisplayModeDirector {

        private void updateDisplayModes(int displayId) {
            Display d = mContext.getSystemService(DisplayManager.class).getDisplay(displayId);
            if (d == null) {
                // We can occasionally get a display added or changed event for a display that was
                // subsequently removed, which means this returns null. Check this case and bail
                // out early; if it gets re-attached we'll eventually get another call back for it.
                return;
            }
            DisplayInfo info = new DisplayInfo();
            d.getDisplayInfo(info);
            boolean changed = false;