Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 69e782c2 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Log the initial screen off and sleep timeout values" into main

parents c8e5a9da 77c687eb
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import android.content.Context
import android.content.Intent
import android.os.RemoteException
import android.provider.DocumentsContract
import android.util.Log
import android.view.KeyEvent
import android.view.MotionEvent
import androidx.test.core.app.ActivityScenario
@@ -152,11 +153,6 @@ abstract class ActivityTestJunit4<T : Activity?> {
        mActivityScenario = ActivityScenario.launch(intent)
    }

    @Throws(RemoteException::class)
    protected fun resetStorage() {
        device!!.waitForIdle()
    }

    @Throws(IOException::class)
    private fun disableScreenOffAndSleepTimeouts() {
        initialScreenOffTimeoutValue = device!!.executeShellCommand(
@@ -165,6 +161,11 @@ abstract class ActivityTestJunit4<T : Activity?> {
        initialSleepTimeoutValue = device!!.executeShellCommand(
            "settings get secure sleep_timeout"
        )
        Log.w(
            TAG,
            """initialScreenOffTimeoutValue = '$initialScreenOffTimeoutValue'
                |initialSleepTimeoutValue = '$initialSleepTimeoutValue'""".trimMargin()
        )
        device!!.executeShellCommand("settings put system screen_off_timeout -1")
        device!!.executeShellCommand("settings put secure sleep_timeout -1")
    }
@@ -192,5 +193,6 @@ abstract class ActivityTestJunit4<T : Activity?> {

    companion object {
        const val TIMEOUT = 5000
        const val TAG = "ActivityTestJunit4"
    }
}