Acquire a wakelock before sending KEYCODE_SLEEP
To prevent device testing via ADB over ethernet entering standby mode,
acquire a wake lock before sending KEYCODE_SLEEP to device.
We might lose connection when device entering standby mode, end up fail the test.
Test: atest com.android.cts.net.HostsideRestrictBackgroundNetworkTests#testDozeModeNonMetered_whitelisted
Bug: 233154541
Change-Id: I09e0af35d32a8001913d3414c0c41ffbb10ace3d
Merged-In: Icb28d2db6f25bd12ba00f56e5d6e56fa108bdcbd
diff --git a/tests/cts/hostside/app/AndroidManifest.xml b/tests/cts/hostside/app/AndroidManifest.xml
index d56e5d4..56d3cb5 100644
--- a/tests/cts/hostside/app/AndroidManifest.xml
+++ b/tests/cts/hostside/app/AndroidManifest.xml
@@ -30,6 +30,7 @@
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>
+ <uses-permission android:name="android.permission.WAKE_LOCK" />
<application android:requestLegacyExternalStorage="true">
<uses-library android:name="android.test.runner"/>