Add the process name to the kill reason when available
This was from feedback from partner app developers. When live debugging, the pid is sufficient because we can query what processes are running on the device. However, when apps are evaluating this information from field data - say, from ApplicationExitInfo - they have no way of knowing what process is represented by the pid. This change adds the process name after the pid in the log. I added to the end of the existing string to hopefully not be disruptive to existing log parsers. Note that, when manually testing, I noticed that the process name is not always available. Presumably the pid no longer refers to an active process by the time this code is run but I'm not sure what situations that would happen in. Bug: 337380439 Test: atest android.app.cts.ActivityManagerAppExitInfoTest Test: Added a debugging logcat in addExitInfoLocked that showed the following (expected) ApplicationExitInfo object was added when force quitting an app from Settings: ApplicationExitInfo(timestamp=6/11/24, 2:46 AM pid=2994 realUid=10208 packageUid=10208 definingUid=10208 user=0 process=com.google.android.apps.photos reason=10 (USER REQUESTED) subreason=21 (FORCE STOP) status=0 importance=230 pss=0.00 rss=0.00 description=stop com.google.android.apps.photos due to from pid 2229 (com.android.settings) state=empty trace=null Flag: EXEMPT bugfix Change-Id: Ieb5764716eebc41357a9dc697fecd12c906cac4b
Loading
Please register or sign in to comment