Merge "Check if the display is organized only for the trusted displays." into sc-v2-dev
diff --git a/tests/framework/base/windowmanager/src/android/server/wm/DisplayAreaPolicyTests.java b/tests/framework/base/windowmanager/src/android/server/wm/DisplayAreaPolicyTests.java
index 4f9b023..7dd3d2b 100644
--- a/tests/framework/base/windowmanager/src/android/server/wm/DisplayAreaPolicyTests.java
+++ b/tests/framework/base/windowmanager/src/android/server/wm/DisplayAreaPolicyTests.java
@@ -24,6 +24,7 @@
import android.platform.test.annotations.Presubmit;
import android.server.wm.WindowManagerState.DisplayArea;
import android.server.wm.WindowManagerState.DisplayContent;
+import android.view.Display;
import org.junit.Before;
import org.junit.Test;
@@ -52,6 +53,10 @@
mDisplays = mWmState.getDisplays();
}
+ private boolean isTrustedDisplay(DisplayContent displayContent) {
+ return (displayContent.getFlags() & Display.FLAG_TRUSTED) != 0;
+ }
+
/**
* DisplayContent should have feature id of FEATURE_ROOT. It should be organized.
*/
@@ -59,7 +64,10 @@
public void testDisplayContent() {
for (DisplayContent displayContent : mDisplays) {
assertThat(displayContent.getFeatureId()).isEqualTo(FEATURE_ROOT);
- assertThat(displayContent.isOrganized()).isTrue();
+ // DisplayAreaOrganizerController registers the organizer for the trusted displays only.
+ if (isTrustedDisplay(displayContent)) {
+ assertThat(displayContent.isOrganized()).isTrue();
+ }
}
}