Skip to content
Commit a666f83b authored by T.J. Mercier's avatar T.J. Mercier
Browse files

Freeze all package processes before killing

Apps are able to prevent their death by forking multiple processes
under different services and monitoring for the death of any of these.
When a child death is detected, the remaining process restarts the
terminating/terminated service before it's able to be killed itself.
This is now prevented by freezing all processes before killing any of
them so that no process can react to the death of another.

Bug: 148425913
Test: vsoc_arm64:/ $ monkey -p com.haok.nirvana 1
Test: bash arg: -p
Test: bash arg: com.haok.nirvana
Test: bash arg: 1
Test: args: [-p, com.haok.nirvana, 1]
Test: arg: "-p"
Test: arg: "com.haok.nirvana"
Test: arg: "1"
Test: data="com.haok.nirvana"
Test: Events injected: 1
Test: ## Network stats: elapsed time=3200ms (0ms mobile, 0ms wifi, 3200ms not connected)
Test: vsoc_arm64:/ $ ps -eo pid,uid,ppid,name|grep 10088
Test: 6827 10088  2973 com.haok.nirvana
Test: 6850 10088  2973 com.haok.nirvana:resident
Test: 6867 10088  2973 android.media
Test: 6895 10088     1 app_d
Test: 6899 10088     1 app_d
Test: vsoc_arm64:/ $ am force-stop com.haok.nirvana
Test: vsoc_arm64:/ $ ps -eo pid,uid,ppid,name |grep 10088
Test: 1|vsoc_arm64:/ $
Test: Also tested manually on Pixel 6 Pro
Change-Id: Ib0231eaf4b11b15a3d6bac5dc5486844f0f81d18
parent b61b9e11
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment