Merge "Add a SystemApi to control display saturation." into pi-dev

This commit is contained in:
TreeHugger Robot
2018-03-29 20:55:22 +00:00
committed by Android (Google) Code Review
7 changed files with 73 additions and 2 deletions

View File

@@ -534,6 +534,19 @@ public final class DisplayManager {
return mGlobal.getWifiDisplayStatus();
}
/**
* Set the level of color saturation to apply to the display.
* @param level The amount of saturation to apply, between 0 and 1 inclusive.
* 0 produces a grayscale image, 1 is normal.
*
* @hide
*/
@SystemApi
@RequiresPermission(Manifest.permission.CONTROL_DISPLAY_SATURATION)
public void setSaturationLevel(float level) {
mGlobal.setSaturationLevel(level);
}
/**
* Creates a virtual display.
*

View File

@@ -384,6 +384,17 @@ public final class DisplayManagerGlobal {
}
}
/**
* Set the level of color saturation to apply to the display.
*/
public void setSaturationLevel(float level) {
try {
mDm.setSaturationLevel(level);
} catch (RemoteException ex) {
throw ex.rethrowFromSystemServer();
}
}
public VirtualDisplay createVirtualDisplay(Context context, MediaProjection projection,
String name, int width, int height, int densityDpi, Surface surface, int flags,
VirtualDisplay.Callback callback, Handler handler, String uniqueId) {

View File

@@ -65,6 +65,9 @@ interface IDisplayManager {
// Requires CONFIGURE_DISPLAY_COLOR_MODE
void requestColorMode(int displayId, int colorMode);
// Requires CONTROL_DISPLAY_SATURATION
void setSaturationLevel(float level);
// Requires CAPTURE_VIDEO_OUTPUT, CAPTURE_SECURE_VIDEO_OUTPUT, or an appropriate
// MediaProjection token for certain combinations of flags.
int createVirtualDisplay(in IVirtualDisplayCallback callback,