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

Commit 664d6f1f authored by Deepanshu Gupta's avatar Deepanshu Gupta
Browse files

Add DisplayManager service to BridgeContext

ViewRoot now holds a reference to the DisplayManager. The change updates
the BridgeContext to provide the DisplayManager instance.

Change-Id: I4a5f00eda337939c72bad47b0ca6a7403454228d
parent c726f6b5
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -58,6 +58,7 @@ import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.hardware.display.DisplayManager;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
@@ -101,6 +102,7 @@ public final class BridgeContext extends Context {
    private final ApplicationInfo mApplicationInfo;
    private final IProjectCallback mProjectCallback;
    private final WindowManager mWindowManager;
    private final DisplayManager mDisplayManager;

    private Resources.Theme mTheme;

@@ -149,6 +151,7 @@ public final class BridgeContext extends Context {
        }

        mWindowManager = new WindowManagerImpl(mMetrics);
        mDisplayManager = new DisplayManager(this);
    }

    /**
@@ -455,6 +458,10 @@ public final class BridgeContext extends Context {
            return new PowerManager(this, new BridgePowerManager(), new Handler());
        }

        if (DISPLAY_SERVICE.equals(service)) {
            return mDisplayManager;
        }

        throw new UnsupportedOperationException("Unsupported Service: " + service);
    }