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

Commit b55eff02 authored by Long Ling's avatar Long Ling Committed by Android (Google) Code Review
Browse files

Merge "Move device config key high_refresh_rate_blacklist to display_manager"

parents d5c504d5 1961cf1c
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -868,5 +868,16 @@ public final class DisplayManager {
         * @hide
         */
        String KEY_PEAK_REFRESH_RATE_DEFAULT = "peak_refresh_rate_default";

        /**
         * Key for controlling which packages are explicitly blocked from running at refresh rates
         * higher than 60hz. An app may be added to this list if they exhibit performance issues at
         * higher refresh rates.
         *
         * @see android.provider.DeviceConfig#NAMESPACE_DISPLAY_MANAGER
         * @see android.R.array#config_highRefreshRateBlacklist
         * @hide
         */
        String KEY_HIGH_REFRESH_RATE_BLACKLIST = "high_refresh_rate_blacklist";
    }
}
+0 −9
Original line number Diff line number Diff line
@@ -367,15 +367,6 @@ public final class DeviceConfig {
         */
        String KEY_SYSTEM_GESTURE_EXCLUSION_LOG_DEBOUNCE_MILLIS =
                "system_gesture_exclusion_log_debounce_millis";

        /**
         * Key for controlling which packages are explicitly blocked from running at refresh rates
         * higher than 90hz.
         *
         * @see android.provider.DeviceConfig#NAMESPACE_WINDOW_MANAGER
         * @hide
         */
        String KEY_HIGH_REFRESH_RATE_BLACKLIST = "high_refresh_rate_blacklist";
    }

    private static final Object sLock = new Object();
+3 −3
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@

package com.android.server.wm;

import static android.provider.DeviceConfig.WindowManager.KEY_HIGH_REFRESH_RATE_BLACKLIST;
import static android.hardware.display.DisplayManager.DeviceConfig.KEY_HIGH_REFRESH_RATE_BLACKLIST;

import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -58,9 +58,9 @@ class HighRefreshRateBlacklist {
    @VisibleForTesting
    HighRefreshRateBlacklist(Resources r, DeviceConfigInterface deviceConfig) {
        mDefaultBlacklist = r.getStringArray(R.array.config_highRefreshRateBlacklist);
        deviceConfig.addOnPropertiesChangedListener(DeviceConfig.NAMESPACE_WINDOW_MANAGER,
        deviceConfig.addOnPropertiesChangedListener(DeviceConfig.NAMESPACE_DISPLAY_MANAGER,
                BackgroundThread.getExecutor(), new OnPropertiesChangedListener());
        final String property = deviceConfig.getProperty(DeviceConfig.NAMESPACE_WINDOW_MANAGER,
        final String property = deviceConfig.getProperty(DeviceConfig.NAMESPACE_DISPLAY_MANAGER,
                KEY_HIGH_REFRESH_RATE_BLACKLIST);
        updateBlacklist(property);
    }
+5 −5
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@

package com.android.server.wm;

import static android.provider.DeviceConfig.WindowManager.KEY_HIGH_REFRESH_RATE_BLACKLIST;
import static android.hardware.display.DisplayManager.DeviceConfig.KEY_HIGH_REFRESH_RATE_BLACKLIST;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
@@ -128,9 +128,9 @@ public class HighRefreshRateBlacklistTest {

        @Override
        public String getProperty(String namespace, String name) {
            if (!DeviceConfig.NAMESPACE_WINDOW_MANAGER.equals(namespace)
            if (!DeviceConfig.NAMESPACE_DISPLAY_MANAGER.equals(namespace)
                    || !KEY_HIGH_REFRESH_RATE_BLACKLIST.equals(name)) {
                throw new IllegalArgumentException("Only things in NAMESPACE_WINDOW_MANAGER "
                throw new IllegalArgumentException("Only things in NAMESPACE_DISPLAY_MANAGER "
                        + "supported.");
            }
            return mBlacklist;
@@ -140,8 +140,8 @@ public class HighRefreshRateBlacklistTest {
        public void addOnPropertiesChangedListener(String namespace, Executor executor,
                DeviceConfig.OnPropertiesChangedListener listener) {

            if (!DeviceConfig.NAMESPACE_WINDOW_MANAGER.equals(namespace)) {
                throw new IllegalArgumentException("Only things in NAMESPACE_WINDOW_MANAGER "
            if (!DeviceConfig.NAMESPACE_DISPLAY_MANAGER.equals(namespace)) {
                throw new IllegalArgumentException("Only things in NAMESPACE_DISPLAY_MANAGER "
                        + "supported.");
            }
            mListeners.add(new Pair<>(listener, executor));