use of android.hardware.display.DisplayManager in project android_frameworks_base by ResurrectionRemix.
the class MediaProjection method createVirtualDisplay.
/**
* @hide
*/
public VirtualDisplay createVirtualDisplay(@NonNull String name, int width, int height, int dpi, boolean isSecure, @Nullable Surface surface, @Nullable VirtualDisplay.Callback callback, @Nullable Handler handler) {
DisplayManager dm = (DisplayManager) mContext.getSystemService(Context.DISPLAY_SERVICE);
int flags = isSecure ? DisplayManager.VIRTUAL_DISPLAY_FLAG_SECURE : 0;
return dm.createVirtualDisplay(this, name, width, height, dpi, surface, flags | DisplayManager.VIRTUAL_DISPLAY_FLAG_AUTO_MIRROR | DisplayManager.VIRTUAL_DISPLAY_FLAG_PRESENTATION, callback, handler);
}
use of android.hardware.display.DisplayManager in project android_frameworks_base by ResurrectionRemix.
the class DividerView method updateDisplayInfo.
private void updateDisplayInfo() {
final DisplayManager displayManager = (DisplayManager) mContext.getSystemService(Context.DISPLAY_SERVICE);
Display display = displayManager.getDisplay(Display.DEFAULT_DISPLAY);
final DisplayInfo info = new DisplayInfo();
display.getDisplayInfo(info);
mDisplayWidth = info.logicalWidth;
mDisplayHeight = info.logicalHeight;
mSnapAlgorithm = null;
initializeSnapAlgorithm();
}
use of android.hardware.display.DisplayManager in project android_frameworks_base by DirtyUnicorns.
the class MediaProjection method createVirtualDisplay.
/**
* @hide
*/
public VirtualDisplay createVirtualDisplay(@NonNull String name, int width, int height, int dpi, boolean isSecure, @Nullable Surface surface, @Nullable VirtualDisplay.Callback callback, @Nullable Handler handler) {
DisplayManager dm = (DisplayManager) mContext.getSystemService(Context.DISPLAY_SERVICE);
int flags = isSecure ? DisplayManager.VIRTUAL_DISPLAY_FLAG_SECURE : 0;
return dm.createVirtualDisplay(this, name, width, height, dpi, surface, flags | DisplayManager.VIRTUAL_DISPLAY_FLAG_AUTO_MIRROR | DisplayManager.VIRTUAL_DISPLAY_FLAG_PRESENTATION, callback, handler);
}
use of android.hardware.display.DisplayManager in project android_frameworks_base by DirtyUnicorns.
the class PackageManagerService method getDefaultDisplayMetrics.
private static void getDefaultDisplayMetrics(Context context, DisplayMetrics metrics) {
DisplayManager displayManager = (DisplayManager) context.getSystemService(Context.DISPLAY_SERVICE);
displayManager.getDisplay(Display.DEFAULT_DISPLAY).getMetrics(metrics);
}
use of android.hardware.display.DisplayManager in project platform_frameworks_base by android.
the class DividerView method updateDisplayInfo.
private void updateDisplayInfo() {
final DisplayManager displayManager = (DisplayManager) mContext.getSystemService(Context.DISPLAY_SERVICE);
Display display = displayManager.getDisplay(Display.DEFAULT_DISPLAY);
final DisplayInfo info = new DisplayInfo();
display.getDisplayInfo(info);
mDisplayWidth = info.logicalWidth;
mDisplayHeight = info.logicalHeight;
mSnapAlgorithm = null;
initializeSnapAlgorithm();
}
Aggregations