Implement app termination monitoring introduced in Android 11
Android 11 introduces the ActivityManager.getHistoricalProcessExitReasons() method, which reports the reasons for any recent process terminations. Apps can use this method to gather crash diagnostic information, such as whether a process termination is due to ANRs, memory issues, or other reasons. Additionally, you can use the new setProcessStateSummary() method to store custom state information for later analysis.
https://developer.android.com/about/versions/11/features#additional
https://medium.com/@yangweigbh/monitoring-app-termination-on-android-11-97d514a3f9