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

Commit 208dca1e authored by Piotr Wilczyński's avatar Piotr Wilczyński Committed by Android (Google) Code Review
Browse files

Merge "Highest HDR/SDR raio API" into main

parents abe2fb86 3b7b7ab4
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -50805,6 +50805,7 @@ package android.view {
    method public android.view.Display.HdrCapabilities getHdrCapabilities();
    method public float getHdrSdrRatio();
    method @Deprecated public int getHeight();
    method @FlaggedApi("com.android.server.display.feature.flags.highest_hdr_sdr_ratio_api") public float getHighestHdrSdrRatio();
    method @Deprecated public void getMetrics(android.util.DisplayMetrics);
    method public android.view.Display.Mode getMode();
    method public String getName();
+15 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import static android.hardware.display.DisplayManager.EventsMask;
import static android.view.Display.HdrCapabilities.HdrType;

import android.Manifest;
import android.annotation.FlaggedApi;
import android.annotation.FloatRange;
import android.annotation.IntDef;
import android.annotation.NonNull;
@@ -1231,6 +1232,20 @@ public final class DisplayManagerGlobal {
        }
    }

    /**
     * @param displayId The ID of the display
     * @return The highest HDR/SDR ratio of the ratios defined in Display Device Config. If no
     * HDR/SDR map is defined, this always returns 1.
     */
    @FlaggedApi(com.android.server.display.feature.flags.Flags.FLAG_HIGHEST_HDR_SDR_RATIO_API)
    public float getHighestHdrSdrRatio(int displayId) {
        try {
            return mDm.getHighestHdrSdrRatio(displayId);
        } catch (RemoteException ex) {
            throw ex.rethrowFromSystemServer();
        }
    }

    /**
     * @see DisplayManager#getDozeBrightnessSensorValueToBrightness
     */
+3 −0
Original line number Diff line number Diff line
@@ -247,6 +247,9 @@ interface IDisplayManager {
    @EnforcePermission("RESTRICT_DISPLAY_MODES")
    void requestDisplayModes(in IBinder token, int displayId, in @nullable int[] modeIds);

    // Get the highest defined HDR/SDR ratio for a display.
    float getHighestHdrSdrRatio(int displayId);

    // Get the mapping between the doze brightness sensor values and brightness values
    @EnforcePermission("CONTROL_DISPLAY_BRIGHTNESS")
    float[] getDozeBrightnessSensorValueToBrightness(int displayId);
+11 −0
Original line number Diff line number Diff line
@@ -20,6 +20,8 @@ import static android.Manifest.permission.CONFIGURE_DISPLAY_COLOR_MODE;
import static android.Manifest.permission.CONTROL_DISPLAY_BRIGHTNESS;
import static android.hardware.flags.Flags.FLAG_OVERLAYPROPERTIES_CLASS_API;

import static com.android.server.display.feature.flags.Flags.FLAG_HIGHEST_HDR_SDR_RATIO_API;

import android.Manifest;
import android.annotation.FlaggedApi;
import android.annotation.IntDef;
@@ -1498,6 +1500,15 @@ public final class Display {
        }
    }

    /**
     * @return The highest possible HDR/SDR ratio. If {@link #isHdrSdrRatioAvailable()} returns
     * false, this method returns 1.
     */
    @FlaggedApi(FLAG_HIGHEST_HDR_SDR_RATIO_API)
    public float getHighestHdrSdrRatio() {
        return mGlobal.getHighestHdrSdrRatio(mDisplayId);
    }

    /**
     * Sets the default {@link Display.Mode} to use for the display.  The display mode includes
     * preference for resolution and refresh rate.
+0 −2
Original line number Diff line number Diff line
@@ -796,7 +796,6 @@ public class DisplayDeviceConfig {
    private DensityMapping mDensityMapping;
    private String mLoadedFrom = null;


    // Represents the auto-brightness brightening light debounce.
    private long mAutoBrightnessBrighteningLightDebounce =
            INVALID_AUTO_BRIGHTNESS_LIGHT_DEBOUNCE;
@@ -1686,7 +1685,6 @@ public class DisplayDeviceConfig {
                + "\n"
                + "mLuxThrottlingData=" + mLuxThrottlingData
                + ", mHbmData=" + mHbmData

                + ", mThermalBrightnessThrottlingDataMapByThrottlingId="
                + mThermalBrightnessThrottlingDataMapByThrottlingId
                + "\n"
Loading