Revert "Fix DisplayState sanitization."

This reverts commit b6ddf525be3c2abbde59ae1533494b18a7961087.

Reason for revert: b/352098820

Change-Id: Ie505ebeda960412e79327fddc8ac7c6d3900727d
diff --git a/services/surfaceflinger/tests/Credentials_test.cpp b/services/surfaceflinger/tests/Credentials_test.cpp
index d355e72..ebe11fb 100644
--- a/services/surfaceflinger/tests/Credentials_test.cpp
+++ b/services/surfaceflinger/tests/Credentials_test.cpp
@@ -26,7 +26,6 @@
 #include <private/android_filesystem_config.h>
 #include <private/gui/ComposerServiceAIDL.h>
 #include <ui/DisplayMode.h>
-#include <ui/DisplayState.h>
 #include <ui/DynamicDisplayInfo.h>
 #include <utils/String8.h>
 #include <functional>
@@ -277,7 +276,7 @@
 TEST_F(CredentialsTest, CaptureLayersTest) {
     setupBackgroundSurface();
     sp<GraphicBuffer> outBuffer;
-    std::function<status_t()> condition = [=, this]() {
+    std::function<status_t()> condition = [=]() {
         LayerCaptureArgs captureArgs;
         captureArgs.layerHandle = mBGSurfaceControl->getHandle();
         captureArgs.sourceCrop = {0, 0, 1, 1};
@@ -397,56 +396,6 @@
     }
 }
 
-TEST_F(CredentialsTest, DisplayTransactionPermissionTest) {
-    const auto display = getFirstDisplayToken();
-
-    ui::DisplayState displayState;
-    ASSERT_EQ(NO_ERROR, SurfaceComposerClient::getDisplayState(display, &displayState));
-    const ui::Rotation initialOrientation = displayState.orientation;
-
-    // Set display orientation from an untrusted process. This should fail silently.
-    {
-        UIDFaker f{AID_BIN};
-        Transaction transaction;
-        Rect layerStackRect;
-        Rect displayRect;
-        transaction.setDisplayProjection(display, initialOrientation + ui::ROTATION_90,
-                                         layerStackRect, displayRect);
-        transaction.apply(/*synchronous=*/true);
-    }
-
-    // Verify that the display orientation did not change.
-    ASSERT_EQ(NO_ERROR, SurfaceComposerClient::getDisplayState(display, &displayState));
-    ASSERT_EQ(initialOrientation, displayState.orientation);
-
-    // Set display orientation from a trusted process.
-    {
-        UIDFaker f{AID_SYSTEM};
-        Transaction transaction;
-        Rect layerStackRect;
-        Rect displayRect;
-        transaction.setDisplayProjection(display, initialOrientation + ui::ROTATION_90,
-                                         layerStackRect, displayRect);
-        transaction.apply(/*synchronous=*/true);
-    }
-
-    // Verify that the display orientation did change.
-    ASSERT_EQ(NO_ERROR, SurfaceComposerClient::getDisplayState(display, &displayState));
-    ASSERT_EQ(initialOrientation + ui::ROTATION_90, displayState.orientation);
-
-    // Reset orientation
-    {
-        UIDFaker f{AID_SYSTEM};
-        Transaction transaction;
-        Rect layerStackRect;
-        Rect displayRect;
-        transaction.setDisplayProjection(display, initialOrientation, layerStackRect, displayRect);
-        transaction.apply(/*synchronous=*/true);
-    }
-    ASSERT_EQ(NO_ERROR, SurfaceComposerClient::getDisplayState(display, &displayState));
-    ASSERT_EQ(initialOrientation, displayState.orientation);
-}
-
 } // namespace android
 
 // TODO(b/129481165): remove the #pragma below and fix conversion issues