Add option to skip GC after test
This is useful for measuring the memory usage of a scenario that
consumes memory but that would result in no memory change if a GC
is performed after the test. An example of this type of scenario
is posting and then canceling a notification.
For the case of the SmallIconStressMicrobenchmark, the size of the
icon (impact on System UI) can be captured, when listeners,
GarbageCollectionPreparer and ProcessShowmapListener, are added and
GC is not run after the test.
Bug: 141675221
Test: adb shell am instrument -w -r
-e class android.platform.test.scenario.notification.SmallIconStressMicrobenchmark
-e listener android.device.preparers.GarbageCollectionPreparer,android.device.collectors.ProcessShowmapListener
-e showmap-process-names com.android.systemui
-e garbagecollection-process-names com.android.systemui
-e garbagecollection-run-after false
android.platform.test.scenario/androidx.test.runner.AndroidJUnitRunner
Change-Id: I3911dcb7aebcfe980f8b6df93e26850147b6874d
2 files changed