1 package com.android.bedstead.nene.bugreports
2 
3 import com.android.bedstead.nene.TestApis
4 import com.android.bedstead.nene.utils.UndoableContext
5 
6 /** Test APIs related to bug reports. */
7 object BugReports {
8 
9     /**
10      * When true, bug reports will skip calling the underlying component.
11      *
12      * This means the bug reports are generally not useful but are much quicker to take - which
13      * can be useful during tests.
14      */
setTakeQuickBugReportsnull15     fun setTakeQuickBugReports(isQuick: Boolean): UndoableContext =
16         TestApis.properties().set("dumpstate.dry_run", if (isQuick) "true" else "false")
17 
18     /** True if quick bug reports are enabled. */
19     fun willTakeQuickBugReports(): Boolean =
20         TestApis.properties().get("dumpstate.dry_run")?.contains("true") ?: false
21 
22 }