Merge "Screen wakeup is added in VTS tests setup" into main am: 27db8f3a13

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/3039832

Change-Id: Ic78b08bdec16e89389beb34710cc8e91971cf37a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/confirmationui/aidl/vts/functional/VtsHalConfirmationUITargetTest.cpp b/confirmationui/aidl/vts/functional/VtsHalConfirmationUITargetTest.cpp
index 61dae8b..7ffd146 100644
--- a/confirmationui/aidl/vts/functional/VtsHalConfirmationUITargetTest.cpp
+++ b/confirmationui/aidl/vts/functional/VtsHalConfirmationUITargetTest.cpp
@@ -192,6 +192,12 @@
   public:
     void TearDown() override { confirmator_->abort(); }
     void SetUp() override {
+        // Wake up the device in-case screen is off. b/332827323
+        int ret = system("input keyevent KEYCODE_WAKEUP");
+        if (ret != 0) {
+            ALOGE("Failed to run keyevent KEYCODE_WAKEUP command");
+        }
+        usleep(100000);  // wait for 100ms to wake up the screen.
         std::string name = GetParam();
         ASSERT_TRUE(AServiceManager_isDeclared(name.c_str())) << name;
         ndk::SpAIBinder binder(AServiceManager_waitForService(name.c_str()));