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

Commit 5cfde635 authored by Bryce Lee's avatar Bryce Lee Committed by android-build-merger
Browse files

Merge "Use application context getting secondary displays." into oc-dev am: 456882b5

am: 356cccd6

Change-Id: I291e1249e9e0b5a975faade4ee105b3e6711db67
parents 4f8e9241 356cccd6
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -340,7 +340,12 @@ public final class DisplayManager {
    private Display getOrCreateDisplayLocked(int displayId, boolean assumeValid) {
        Display display = mDisplays.get(displayId);
        if (display == null) {
            display = mGlobal.getCompatibleDisplay(displayId, mContext.getResources());
            // TODO: We cannot currently provide any override configurations for metrics on displays
            // other than the display the context is associated with.
            final Context context = mContext.getDisplay().getDisplayId() == displayId
                    ? mContext : mContext.getApplicationContext();

            display = mGlobal.getCompatibleDisplay(displayId, context.getResources());
            if (display != null) {
                mDisplays.put(displayId, display);
            }