From 209ddf98714e029e3d46730e403976de1d6ca404 Mon Sep 17 00:00:00 2001 From: Jing Ji Date: Mon, 1 Nov 2021 13:43:53 -0700 Subject: [PATCH] Explicitly exit from the am instrument after test completes To speed up the test. For a trivial am instrument run: [Before] 0m01.53s real 0m00.16s user 0m00.16s system [After] 0m00.72s real 0m00.21s user 0m00.11s system Bug: 204195830 Test: am instrument -w Change-Id: I66196d1db9169681dabb2e5dacdd18e6105ad75a --- cmds/am/src/com/android/commands/am/Instrument.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmds/am/src/com/android/commands/am/Instrument.java b/cmds/am/src/com/android/commands/am/Instrument.java index 1e72ddf8ecfca..0b439df403e02 100644 --- a/cmds/am/src/com/android/commands/am/Instrument.java +++ b/cmds/am/src/com/android/commands/am/Instrument.java @@ -545,6 +545,8 @@ public class Instrument { mWm.setAnimationScales(oldAnims); } } + // Exit from here instead of going down the path of normal shutdown which is slow. + System.exit(0); } private static String readLogcat(long startTimeMs) {