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

Commit 0ecd3e13 authored by raylinhsu's avatar raylinhsu Committed by Raylin Hsu
Browse files

DO NOT MERGE "Set fixed fps when ambient or display brightness is high"

Force the display to stay at fixed fps when ambient and
display brightness are high.

Bug: 177636374
Test: atest DisplayModeDirectorTest
Test: no fps transition in the blocking zone when the display state change
Test: check if the lux will update when the display state change
Change-Id: I7d8ed657544bd1423ca8b9afefc87e58530c44dc
parent 76f79a77
Loading
Loading
Loading
Loading
+29 −0
Original line number Diff line number Diff line
@@ -4138,6 +4138,35 @@
         If non-positive, then the refresh rate is unchanged even if thresholds are configured. -->
    <integer name="config_defaultRefreshRateInZone">0</integer>

    <!-- The display uses different gamma curves for different refresh rates. It's hard for panel
         vendor to tune the curves to have exact same brightness for different refresh rate. So
         flicker could be observed at switch time. The issue can be observed on the screen with
         even full white content at the high brightness. To prevent flickering, we support fixed
         refresh rates if the display and ambient brightness are equal to or above the provided
         thresholds. You can define multiple threshold levels as higher brightness environments
         may have lower display brightness requirements for the flickering is visible. And the
         high brightness environment could have higher threshold.
         For example, fixed refresh rate if
             display brightness >= disp0 && ambient brightness >= amb0
             || display brightness >= disp1 && ambient brightness >= amb1 -->
    <integer-array translatable="false" name="config_highDisplayBrightnessThresholdsOfFixedRefreshRate">
         <!--
           <item>disp0</item>
           <item>disp1</item>
        -->
    </integer-array>

    <integer-array translatable="false" name="config_highAmbientBrightnessThresholdsOfFixedRefreshRate">
         <!--
           <item>amb0</item>
           <item>amb1</item>
        -->
    </integer-array>

    <!-- Default refresh rate in the high zone defined by brightness and ambient thresholds.
         If non-positive, then the refresh rate is unchanged even if thresholds are configured. -->
    <integer name="config_fixedRefreshRateInHighZone">0</integer>

    <!-- The type of the light sensor to be used by the display framework for things like
         auto-brightness. If unset, then it just gets the default sensor of type TYPE_LIGHT. -->
    <string name="config_displayLightSensorType" translatable="false" />
+5 −0
Original line number Diff line number Diff line
@@ -3783,6 +3783,11 @@
  <java-symbol type="array" name="config_brightnessThresholdsOfPeakRefreshRate" />
  <java-symbol type="array" name="config_ambientThresholdsOfPeakRefreshRate" />

  <!-- For fixed refresh rate displays in high brightness-->
  <java-symbol type="integer" name="config_fixedRefreshRateInHighZone" />
  <java-symbol type="array" name="config_highDisplayBrightnessThresholdsOfFixedRefreshRate" />
  <java-symbol type="array" name="config_highAmbientBrightnessThresholdsOfFixedRefreshRate" />

  <!-- For Auto-Brightness -->
  <java-symbol type="string" name="config_displayLightSensorType" />

+7 −0
Original line number Diff line number Diff line
filegroup {
    name: "services.core-sources-deviceconfig-interface",
    srcs: [
         "java/com/android/server/utils/DeviceConfigInterface.java"
    ],
}

filegroup {
    name: "services.core-sources",
    srcs: ["java/**/*.java"],
+426 −147

File changed.

Preview size limit exceeded, changes collapsed.

+12 −1
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
 * limitations under the License.
 */

package com.android.server.wm.utils;
package com.android.server.utils;

import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -53,6 +53,11 @@ public interface DeviceConfigInterface {
     */
    boolean getBoolean(@NonNull String namespace, @NonNull String name, boolean defaultValue);

    /**
     * @see DeviceConfig#getFloat
     */
    float getFloat(@NonNull String namespace, @NonNull String name, float defaultValue);

    /**
     * @see DeviceConfig#addOnPropertiesChangedListener
     */
@@ -95,6 +100,12 @@ public interface DeviceConfigInterface {
            return DeviceConfig.getBoolean(namespace, name, defaultValue);
        }

        @Override
        public float getFloat(@NonNull String namespace, @NonNull String name,
                float defaultValue) {
            return DeviceConfig.getFloat(namespace, name, defaultValue);
        }

        @Override
        public void addOnPropertiesChangedListener(String namespace, Executor executor,
                DeviceConfig.OnPropertiesChangedListener listener) {
Loading