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

Commit 1abaa53d authored by Craig Mautner's avatar Craig Mautner
Browse files

Do not reuse DisplayAdjustment in Display.

Because the DisplayAdjustment in Display can be modified it should not
use the reference of the DisplayAdjustment that is passed in to
construct the Display. Copy the members of the DisplayAdjustment
instead.

Fixes bug 9622994

Change-Id: I8201b02eba3ef35af3e01f10402cd5dafec1fb23
parent 9e424cfb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -208,7 +208,7 @@ public final class Display {
        mGlobal = global;
        mDisplayId = displayId;
        mDisplayInfo = displayInfo;
        mDisplayAdjustments = daj;
        mDisplayAdjustments = new DisplayAdjustments(daj);
        mIsValid = true;

        // Cache properties that cannot change as long as the display is valid.
+4 −0
Original line number Diff line number Diff line
@@ -37,6 +37,10 @@ public class DisplayAdjustments {
        mActivityToken = token;
    }

    public DisplayAdjustments(DisplayAdjustments daj) {
        this (daj.getCompatibilityInfo(), daj.getActivityToken());
    }

    public DisplayAdjustments(CompatibilityInfo compatInfo, IBinder token) {
        setCompatibilityInfo(compatInfo);
        mActivityToken = token;