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

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

Merge "[DO NOT MERGE] Move device config high_refresh_rate_blacklist to...

Merge "[DO NOT MERGE] Move device config high_refresh_rate_blacklist to display_manager" into qt-qpr1-dev
parents 6fdfdbed 5a570b38
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
@@ -358,15 +358,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 60hz.
         *
         * @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.addOnPropertyChangedListener(DeviceConfig.NAMESPACE_WINDOW_MANAGER,
        deviceConfig.addOnPropertyChangedListener(DeviceConfig.NAMESPACE_DISPLAY_MANAGER,
                BackgroundThread.getExecutor(), new OnPropertyChangedListener());
        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);
    }
+6 −6
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;
@@ -126,9 +126,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;
@@ -138,8 +138,8 @@ public class HighRefreshRateBlacklistTest {
        public void addOnPropertyChangedListener(String namespace, Executor executor,
                DeviceConfig.OnPropertyChangedListener 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));
@@ -153,7 +153,7 @@ public class HighRefreshRateBlacklistTest {
                final Executor executor = listenerInfo.second;
                final DeviceConfig.OnPropertyChangedListener listener = listenerInfo.first;
                executor.execute(() -> {
                    listener.onPropertyChanged(DeviceConfig.NAMESPACE_WINDOW_MANAGER,
                    listener.onPropertyChanged(DeviceConfig.NAMESPACE_DISPLAY_MANAGER,
                            KEY_HIGH_REFRESH_RATE_BLACKLIST, blacklist);
                    latch.countDown();
                });