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

Commit 57c3440f authored by Diego Perez's avatar Diego Perez Committed by Jerome Gaillard
Browse files

Create a mock Display Mode

Recycler view gets the refresh rate of the display during its setup.
Implementing a Mode that returns a fake refresh rate.

Bug: 32328330
Change-Id: I1025641ec37ca3ec90309b30ad270fd996fd8d46
(cherry picked from commit 4a1c85c71f4de5faeeab2791f80dd7a1ad423f2c)
parent 5058633a
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ package com.android.layoutlib.bridge.android.view;

import android.util.DisplayMetrics;
import android.view.Display;
import android.view.Display.Mode;
import android.view.DisplayAdjustments;
import android.view.DisplayInfo;
import android.view.View;
@@ -33,6 +34,9 @@ public class WindowManagerImpl implements WindowManager {
        DisplayInfo info = new DisplayInfo();
        info.logicalHeight = mMetrics.heightPixels;
        info.logicalWidth = mMetrics.widthPixels;
        info.supportedModes = new Mode[] {
                new Mode(0, mMetrics.widthPixels, mMetrics.heightPixels, 60f)
        };
        mDisplay = new Display(null, Display.DEFAULT_DISPLAY, info,
                DisplayAdjustments.DEFAULT_DISPLAY_ADJUSTMENTS);
    }