Details
-
User Story
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
None
-
None
Description
Overview:
Starting in Android 12 (API level 31), you can access your app's native crash tombstone as a protocol buffer through the ApplicationExitInfo.getTraceInputStream() method. The protocol buffer is serialized using this schema. Previously, the only way to get access to this information was through the Android Debug Bridge (adb).
Example:
ActivityManager activityManager: ActivityManager = getSystemService(Context.ACTIVITY_SERVICE); MutableList<ApplicationExitInfo> exitReasons = activityManager.getHistoricalProcessExitReasons(/* packageName = */ null, /* pid = */ 0, /* maxNum = */ 5); for ( ApplicationExitInfo aei: exitReasons ) { if ( aei.getReason() == REASON_CRASH_NATIVE ) { // Get the tombstone input stream. InputStream tombstoneInputStream = aei.getTraceInputStream(); // The tombstone parser built with protoc uses the tombstone schema, then parses the trace. Tombstone tombstone = Tombstone.parseFrom(trace); } }
Proposed Action:
Research usefulness. Also, check if it is android only.