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

Commit 7010f95c authored by Kriti Dang's avatar Kriti Dang Committed by Brian Lindahl
Browse files

Hdr format settings [Backend]

Adding new APIs in display manager to get the user disabled formats, to get the formats
supported by device and get formats reported by display.

Bug: 172905874
Test: N/A
Change-Id: I58a7714f03a3e165bbd22f2fa7a021ad90b41b39
Merged-In: I58a7714f03a3e165bbd22f2fa7a021ad90b41b39
(cherry picked from commit 25f18220)
parent 396cf5e2
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1142,6 +1142,7 @@ package android.hardware.display {
  public final class DisplayManager {
    method public boolean areUserDisabledHdrTypesAllowed();
    method @RequiresPermission(android.Manifest.permission.MODIFY_REFRESH_RATE_SWITCHING_TYPE) public int getRefreshRateSwitchingType();
    method @NonNull public int[] getUserDisabledHdrTypes();
    method public boolean isMinimalPostProcessingRequested(int);
    method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public void setAreUserDisabledHdrTypesAllowed(boolean);
    method @RequiresPermission(android.Manifest.permission.MODIFY_REFRESH_RATE_SWITCHING_TYPE) public void setRefreshRateSwitchingType(int);
@@ -2597,6 +2598,7 @@ package android.view {
  }

  public final class Display {
    method @NonNull public int[] getReportedHdrTypes();
    method @NonNull public android.graphics.ColorSpace[] getSupportedWideColorGamut();
    method public int getType();
    method public boolean hasAccess(int);
+11 −0
Original line number Diff line number Diff line
@@ -748,6 +748,17 @@ public final class DisplayManager {
        return mGlobal.areUserDisabledHdrTypesAllowed();
    }

    /**
     * Returns the HDR formats disabled by the user.
     *
     * @hide
     */
    @TestApi
    public @NonNull int[] getUserDisabledHdrTypes() {
        return mGlobal.getUserDisabledHdrTypes();
    }


    /**
     * Creates a virtual display.
     *
+12 −0
Original line number Diff line number Diff line
@@ -551,6 +551,18 @@ public final class DisplayManagerGlobal {
        }
    }

    /**
     * Returns the HDR formats disabled by the user.
     *
     */
    public int[] getUserDisabledHdrTypes() {
        try {
            return mDm.getUserDisabledHdrTypes();
        } catch (RemoteException ex) {
            throw ex.rethrowFromSystemServer();
        }
    }

    public void requestColorMode(int displayId, int colorMode) {
        try {
            mDm.requestColorMode(displayId, colorMode);
+3 −0
Original line number Diff line number Diff line
@@ -77,6 +77,9 @@ interface IDisplayManager {
    // No permissions required.
    boolean areUserDisabledHdrTypesAllowed();

    // No permissions required.
    int[] getUserDisabledHdrTypes();

    // Requires CONFIGURE_DISPLAY_COLOR_MODE
    void requestColorMode(int displayId, int colorMode);

+16 −0
Original line number Diff line number Diff line
@@ -1095,6 +1095,22 @@ public final class Display {
        }
    }

    /**
     * @hide
     * Returns the display's HDR supported types.
     *
     * @see #isHdr()
     * @see HdrCapabilities#getSupportedHdrTypes()
     */
    @TestApi
    @NonNull
    public int[] getReportedHdrTypes() {
        synchronized (mLock) {
            updateDisplayInfoLocked();
            return mDisplayInfo.hdrCapabilities.getSupportedHdrTypes();
        }
    }

    /**
     * Returns whether this display supports any HDR type.
     *
Loading