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

Commit 9b1a9aac authored by radhakrishna's avatar radhakrishna Committed by Linux Build Service Account
Browse files

base: Add support for FLAG_SUPPORTS_PROTECTED_BUFFERS

For the clients (WFD) which need secure HWC composition,
FLAG_SUPPORTS_PROTECTED_BUFFERS need to be set.
- Define new flag VIRTUAL_DISPLAY_SUPPORTS_PROTECTED_BUFFERS
- In VirtualDisplayAdapter, add support for the flag
FLAG_SUPPORTS_PROTECTED_BUFFERS.

CRs-Fixed: 653794
Change-Id: Ib954943f3e27067b2805188771f951c115833237
parent 2da7d414
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -175,6 +175,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;

    /**
     * Virtual display flag: Only show this display's own content; do not mirror
+6 −0
Original line number Diff line number Diff line
@@ -274,6 +274,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;