Merge "Add a SystemApi to control display saturation." into pi-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
49c27f2267
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user