Search in sources :

Example 1 with IDisplayManager

use of android.hardware.display.IDisplayManager in project robolectric by robolectric.

the class ShadowDisplayManagerGlobal method getInstance.

@Implementation
public static synchronized DisplayManagerGlobal getInstance() {
    if (instance == null) {
        MyDisplayManager myIDisplayManager = new MyDisplayManager();
        IDisplayManager proxy = ReflectionHelpers.createDelegatingProxy(IDisplayManager.class, myIDisplayManager);
        instance = ReflectionHelpers.callConstructor(DisplayManagerGlobal.class, ClassParameter.from(IDisplayManager.class, proxy));
        ShadowDisplayManagerGlobal shadow = Shadow.extract(instance);
        shadow.mDm = myIDisplayManager;
        Bootstrap.setUpDisplay();
    }
    return instance;
}
Also used : DisplayManagerGlobal(android.hardware.display.DisplayManagerGlobal) IDisplayManager(android.hardware.display.IDisplayManager) Implementation(org.robolectric.annotation.Implementation)

Aggregations

DisplayManagerGlobal (android.hardware.display.DisplayManagerGlobal)1 IDisplayManager (android.hardware.display.IDisplayManager)1 Implementation (org.robolectric.annotation.Implementation)1