Search in sources :

Example 11 with DisplayManager

use of android.hardware.display.DisplayManager in project platform_frameworks_base by android.

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);
}
Also used : DisplayManager(android.hardware.display.DisplayManager)

Example 12 with DisplayManager

use of android.hardware.display.DisplayManager in project platform_frameworks_base by android.

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);
}
Also used : DisplayManager(android.hardware.display.DisplayManager)

Example 13 with DisplayManager

use of android.hardware.display.DisplayManager in project android_frameworks_base by AOSPA.

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();
}
Also used : DisplayInfo(android.view.DisplayInfo) DisplayManager(android.hardware.display.DisplayManager) Display(android.view.Display)

Example 14 with DisplayManager

use of android.hardware.display.DisplayManager in project android_frameworks_base by AOSPA.

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);
}
Also used : DisplayManager(android.hardware.display.DisplayManager)

Example 15 with DisplayManager

use of android.hardware.display.DisplayManager in project android_frameworks_base by DirtyUnicorns.

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();
}
Also used : DisplayInfo(android.view.DisplayInfo) DisplayManager(android.hardware.display.DisplayManager) Display(android.view.Display)

Aggregations

DisplayManager (android.hardware.display.DisplayManager)23 Display (android.view.Display)13 DisplayInfo (android.view.DisplayInfo)7 DisplayMetrics (android.util.DisplayMetrics)4 Test (org.junit.Test)2 Config (org.robolectric.annotation.Config)2 SuppressLint (android.annotation.SuppressLint)1 Point (android.graphics.Point)1 MediaMuxer (android.media.MediaMuxer)1 Handler (android.os.Handler)1 PowerManager (android.os.PowerManager)1 RequiresApi (android.support.annotation.RequiresApi)1 Fragment (android.support.v4.app.Fragment)1 View (android.view.View)1 WindowManager (android.view.WindowManager)1 AccessibilityEvent (android.view.accessibility.AccessibilityEvent)1 AccessibilityManager (android.view.accessibility.AccessibilityManager)1 Nullable (androidx.annotation.Nullable)1 File (java.io.File)1 IOException (java.io.IOException)1