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

Commit ce302339 authored by Bryan Mawhinney's avatar Bryan Mawhinney Committed by android-build-merger
Browse files

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

am: 49c27f22

Change-Id: I426c85c95a4ececdb3ff3d88d3e6c3b6a68bcaf5
parents 925804d8 49c27f22
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ package android {
    field public static final java.lang.String CONFIGURE_DISPLAY_BRIGHTNESS = "android.permission.CONFIGURE_DISPLAY_BRIGHTNESS";
    field public static final java.lang.String CONNECTIVITY_INTERNAL = "android.permission.CONNECTIVITY_INTERNAL";
    field public static final java.lang.String CONNECTIVITY_USE_RESTRICTED_NETWORKS = "android.permission.CONNECTIVITY_USE_RESTRICTED_NETWORKS";
    field public static final java.lang.String CONTROL_DISPLAY_SATURATION = "android.permission.CONTROL_DISPLAY_SATURATION";
    field public static final java.lang.String CONTROL_INCALL_EXPERIENCE = "android.permission.CONTROL_INCALL_EXPERIENCE";
    field public static final java.lang.String CONTROL_LOCATION_UPDATES = "android.permission.CONTROL_LOCATION_UPDATES";
    field public static final java.lang.String CONTROL_VPN = "android.permission.CONTROL_VPN";
@@ -1252,6 +1253,7 @@ package android.hardware.display {
    method public android.hardware.display.BrightnessConfiguration getDefaultBrightnessConfiguration();
    method public android.graphics.Point getStableDisplaySize();
    method public void setBrightnessConfiguration(android.hardware.display.BrightnessConfiguration);
    method public void setSaturationLevel(float);
  }

}
+13 −0
Original line number Diff line number Diff line
@@ -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.
     *
+11 −0
Original line number Diff line number Diff line
@@ -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) {
+3 −0
Original line number Diff line number Diff line
@@ -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,
+6 −0
Original line number Diff line number Diff line
@@ -3121,6 +3121,12 @@
    <permission android:name="android.permission.CONFIGURE_DISPLAY_COLOR_MODE"
        android:protectionLevel="signature" />

    <!-- Allows an application to control the color saturation of the display.
         @hide
         @SystemApi -->
    <permission android:name="android.permission.CONTROL_DISPLAY_SATURATION"
        android:protectionLevel="signature|privileged" />

    <!-- Allows an application to collect usage infomation about brightness slider changes.
         <p>Not for use by third-party applications.</p>
         @hide
Loading