Merge "Hdr format settings [Backend]" into sc-dev

This commit is contained in:
Kriti Dang
2021-03-29 13:33:57 +00:00
committed by Android (Google) Code Review
6 changed files with 49 additions and 0 deletions

View File

@@ -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);

View File

@@ -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.
*

View File

@@ -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);

View File

@@ -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);

View File

@@ -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.
*

View File

@@ -2477,6 +2477,11 @@ public final class DisplayManagerService extends SystemService {
}
}
@Override // Binder call
public int[] getUserDisabledHdrTypes() {
return mUserDisabledHdrTypes;
}
@Override // Binder call
public void requestColorMode(int displayId, int colorMode) {
mContext.enforceCallingOrSelfPermission(