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;
}
Aggregations