[DO NOT MERGE] Move device config high_refresh_rate_blacklist to display_manager

high_refresh_rate_blacklist belongs to smooth display feature. Move the
key from namespace window_manager to display_manager.

Bug: 139138964
Test: atest WmTests:HighRefreshRateBlacklistTest
Test: Manual adb shell device_config/dumpsys window
Change-Id: I3ae8ecce80ef97c4683a1c18ad81dc78456e9d57
This commit is contained in:
Long Ling
2019-08-13 16:07:14 -07:00
parent 36f6254ee3
commit 5a570b3898
4 changed files with 20 additions and 18 deletions

View File

@@ -868,5 +868,16 @@ public final class DisplayManager {
* @hide * @hide
*/ */
String KEY_PEAK_REFRESH_RATE_DEFAULT = "peak_refresh_rate_default"; 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";
} }
} }

View File

@@ -358,15 +358,6 @@ public final class DeviceConfig {
*/ */
String KEY_SYSTEM_GESTURE_EXCLUSION_LOG_DEBOUNCE_MILLIS = String KEY_SYSTEM_GESTURE_EXCLUSION_LOG_DEBOUNCE_MILLIS =
"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(); private static final Object sLock = new Object();

View File

@@ -16,7 +16,7 @@
package com.android.server.wm; 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.NonNull;
import android.annotation.Nullable; import android.annotation.Nullable;
@@ -58,9 +58,9 @@ class HighRefreshRateBlacklist {
@VisibleForTesting @VisibleForTesting
HighRefreshRateBlacklist(Resources r, DeviceConfigInterface deviceConfig) { HighRefreshRateBlacklist(Resources r, DeviceConfigInterface deviceConfig) {
mDefaultBlacklist = r.getStringArray(R.array.config_highRefreshRateBlacklist); mDefaultBlacklist = r.getStringArray(R.array.config_highRefreshRateBlacklist);
deviceConfig.addOnPropertyChangedListener(DeviceConfig.NAMESPACE_WINDOW_MANAGER, deviceConfig.addOnPropertyChangedListener(DeviceConfig.NAMESPACE_DISPLAY_MANAGER,
BackgroundThread.getExecutor(), new OnPropertyChangedListener()); 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); KEY_HIGH_REFRESH_RATE_BLACKLIST);
updateBlacklist(property); updateBlacklist(property);
} }

View File

@@ -16,7 +16,7 @@
package com.android.server.wm; 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.assertFalse;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
@@ -126,9 +126,9 @@ public class HighRefreshRateBlacklistTest {
@Override @Override
public String getProperty(String namespace, String name) { 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)) { || !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."); + "supported.");
} }
return mBlacklist; return mBlacklist;
@@ -138,8 +138,8 @@ public class HighRefreshRateBlacklistTest {
public void addOnPropertyChangedListener(String namespace, Executor executor, public void addOnPropertyChangedListener(String namespace, Executor executor,
DeviceConfig.OnPropertyChangedListener listener) { DeviceConfig.OnPropertyChangedListener listener) {
if (!DeviceConfig.NAMESPACE_WINDOW_MANAGER.equals(namespace)) { if (!DeviceConfig.NAMESPACE_DISPLAY_MANAGER.equals(namespace)) {
throw new IllegalArgumentException("Only things in NAMESPACE_WINDOW_MANAGER " throw new IllegalArgumentException("Only things in NAMESPACE_DISPLAY_MANAGER "
+ "supported."); + "supported.");
} }
mListeners.add(new Pair<>(listener, executor)); mListeners.add(new Pair<>(listener, executor));
@@ -153,7 +153,7 @@ public class HighRefreshRateBlacklistTest {
final Executor executor = listenerInfo.second; final Executor executor = listenerInfo.second;
final DeviceConfig.OnPropertyChangedListener listener = listenerInfo.first; final DeviceConfig.OnPropertyChangedListener listener = listenerInfo.first;
executor.execute(() -> { executor.execute(() -> {
listener.onPropertyChanged(DeviceConfig.NAMESPACE_WINDOW_MANAGER, listener.onPropertyChanged(DeviceConfig.NAMESPACE_DISPLAY_MANAGER,
KEY_HIGH_REFRESH_RATE_BLACKLIST, blacklist); KEY_HIGH_REFRESH_RATE_BLACKLIST, blacklist);
latch.countDown(); latch.countDown();
}); });