Run AM as a top-app process

Bug: 379892006
Bug: 383813628
Test: Build
Flag: NONE for a script change
Change-Id: I2281f6f1f575016d6c4dcb85c620d8a2c9a1a2cb
diff --git a/cmds/am/am.sh b/cmds/am/am.sh
index 54c2d39..76ec214 100755
--- a/cmds/am/am.sh
+++ b/cmds/am/am.sh
@@ -1,5 +1,8 @@
 #!/system/bin/sh
 
+# set to top-app process group
+settaskprofile $$ SCHED_SP_TOP_APP >/dev/null 2>&1 || true
+
 if [ "$1" != "instrument" ] ; then
     cmd activity "$@"
 else