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

Commit 106facf4 authored by Huihong Luo's avatar Huihong Luo
Browse files

Add a new API to start HDCP

When SurfaceFlinger detects a secure surface, it can call this
api to inform HWC to start HDCP negotiations.

Bug: 369161085
Test: manual
Change-Id: Idbc90d43a1f64a5457d3da0ca97c5843b0793337
parent e4ffbaab
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -23,23 +23,23 @@ package android.hardware.graphics.common;
@Backing(type="int")
enum DisplayHotplugEvent {
    /**
     * Display is successfully connected.
     * Connected may be called more than once and the behavior of subsequent
     * calls is that SurfaceFlinger queries the display properties again.
     * Display was successfully connected.
     * CONNECTED may be emitted more than once and the behavior of subsequent
     * events is that SurfaceFlinger queries the display properties again.
     */
    CONNECTED = 0,

    /** Display is successfully disconnected */
    /** Display was successfully disconnected */
    DISCONNECTED = 1,

    /** Display is plugged in, but an unknown error occurred */
    /** Unknown error occurred */
    ERROR_UNKNOWN = -1,

    /** Display is plugged in, but incompatible cable error detected */
    /** Display was plugged in, but incompatible cable error detected */
    ERROR_INCOMPATIBLE_CABLE = -2,

    /**
     * Display is plugged in, but exceeds the max number of
     * Display was plugged in, but exceeds the max number of
     * displays that can be simultaneously connected
     */
    ERROR_TOO_MANY_DISPLAYS = -3,
+1 −0
Original line number Diff line number Diff line
@@ -88,6 +88,7 @@ interface IComposerClient {
  android.hardware.graphics.composer3.DisplayConfiguration[] getDisplayConfigurations(long display, int maxFrameIntervalNs);
  oneway void notifyExpectedPresent(long display, in android.hardware.graphics.composer3.ClockMonotonicTimestamp expectedPresentTime, int frameIntervalNs);
  int getMaxLayerPictureProfiles(long display);
  oneway void startHdcpNegotiation(long display, in android.hardware.drm.HdcpLevels levels);
  const int EX_BAD_CONFIG = 1;
  const int EX_BAD_DISPLAY = 2;
  const int EX_BAD_LAYER = 3;
+18 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package android.hardware.graphics.composer3;

import android.hardware.drm.HdcpLevels;
import android.hardware.graphics.common.DisplayDecorationSupport;
import android.hardware.graphics.common.Hdr;
import android.hardware.graphics.common.HdrConversionCapability;
@@ -938,4 +939,21 @@ interface IComposerClient {
     * pipeline, a value of zero should be returned here.
     */
    int getMaxLayerPictureProfiles(long display);

    /**
     * Supports HDCP lazy activation.
     *
     * When SurfaceFlinger detects secure layers, this method is called to instruct HWC side that
     * HDCP negotiation process can be started.
     *
     * When HDCP is successfully started or failed to start, HWC reports the HDCP levels via
     * IComposerCallback.onHdcpLevelsChanged().
     *
     * @param display is the display whose HDCP negotiation can be started.
     * @param levels is the desired HDCP levels.
     *
     * @see IComposerCallback.onHdcpLevelsChanged
     *
     */
    oneway void startHdcpNegotiation(long display, in HdcpLevels levels);
}