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

Commit 0041910e authored by raylinhsu's avatar raylinhsu Committed by Automerger Merge Worker
Browse files

Set fixed fps when ambient or display brightness is high am: 4a0a896a

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12871941

Change-Id: I529bf124d2062c22b0b7c72d47a7f08b8dbabb59
parents 93c11a4a 4a0a896a
Loading
Loading
Loading
Loading
+29 −0
Original line number Diff line number Diff line
@@ -4167,6 +4167,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
@@ -3789,6 +3789,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