Tracking changes to always sending Game content type to the HAL
Bug: 202007307
Test: atest MinimalPostProcessingTests
Change-Id: I24b000dedd320fb1e4f3e81ff5f20e3cdc644a04
diff --git a/tests/framework/base/windowmanager/src/android/server/wm/MinimalPostProcessingTests.java b/tests/framework/base/windowmanager/src/android/server/wm/MinimalPostProcessingTests.java
index 5946a18..d468092 100644
--- a/tests/framework/base/windowmanager/src/android/server/wm/MinimalPostProcessingTests.java
+++ b/tests/framework/base/windowmanager/src/android/server/wm/MinimalPostProcessingTests.java
@@ -24,10 +24,12 @@
import static android.server.wm.app.Components.MinimalPostProcessingActivity.EXTRA_PREFER_MPP;
import static android.server.wm.app.Components.POPUP_MPP_ACTIVITY;
+import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertTrue;
import android.content.ComponentName;
+import android.content.pm.PackageManager;
import android.platform.test.annotations.Presubmit;
import org.junit.Test;
@@ -66,10 +68,20 @@
private void assertDisplayRequestedMinimalPostProcessing(ComponentName name, boolean on) {
final int displayId = getDisplayId(name);
-
- boolean supported = isMinimalPostProcessingSupported(displayId);
boolean requested = isMinimalPostProcessingRequested(displayId);
+ PackageManager packageManager = mContext.getPackageManager();
+ // For TV Android S is requesting minimal post processing regardless if it's supported,
+ // because the same signal is used by HAL implementations to disable on-device processing.
+ final boolean isTv = packageManager.hasSystemFeature(PackageManager.FEATURE_LEANBACK);
+ if (isTv) {
+ // TODO(b/202378408): Verify that minimal post-processing is requested only if
+ // it's supported once we have a separate API for disabling on-device processing.
+ assertEquals(requested, on);
+ return;
+ }
+
+ boolean supported = isMinimalPostProcessingSupported(displayId);
assertTrue(supported ? requested == on : !requested);
}