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

Commit a8bdca6e authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "base: Add support for FLAG_SUPPORTS_PROTECTED_BUFFERS"

parents 09d5e3ae b496b4f1
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -170,6 +170,28 @@ public final class DisplayManager {
     * @see #createVirtualDisplay
     */
    public static final int VIRTUAL_DISPLAY_FLAG_SECURE = 1 << 2;
    /**
     * Virtual display flag: Create a secure display that uses HWC secure
     * blending.
     *
     * <h3>Secure virtual displays that use HWC secure blending</h3>
     * <p>
     * When this flag is set, the virtual display is considered secure and uses
     * HWC secure blending for composing the surfaces. The caller promises to take
     * reasonable measures, such as over-the-air encryption, to prevent the contents
     * of the display from being intercepted or recorded on a persistent medium.
     * </p>
     *
     * <h3>Secure virtual displays that don't use HWC secure blending</h3>
     * <p>
     * When this flag is not set, HWC secure blending is not supported for this
     * virtual display.
     * </p>
     *
     * @see Display#FLAG_SUPPORTS_PROTECTED_BUFFERS
     * @hide
     */
    public static final int VIRTUAL_DISPLAY_FLAG_SUPPORTS_PROTECTED_BUFFERS = 1 << 3;

    /** @hide */
    public DisplayManager(Context context) {
+6 −0
Original line number Diff line number Diff line
@@ -162,6 +162,12 @@ final class VirtualDisplayAdapter extends DisplayAdapter {
                }
                if ((mFlags & DisplayManager.VIRTUAL_DISPLAY_FLAG_SECURE) != 0) {
                    mInfo.flags |= DisplayDeviceInfo.FLAG_SECURE;
                    if ((mFlags & DisplayManager.
                                VIRTUAL_DISPLAY_FLAG_SUPPORTS_PROTECTED_BUFFERS)
                            != 0) {
                        mInfo.flags |=
                                DisplayDeviceInfo.FLAG_SUPPORTS_PROTECTED_BUFFERS;
                    }
                }
                if ((mFlags & DisplayManager.VIRTUAL_DISPLAY_FLAG_PRESENTATION) != 0) {
                    mInfo.flags |= DisplayDeviceInfo.FLAG_PRESENTATION;