Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-99584

Android 12 - Provide apps direct access to tombstone traces

XMLWordPrintable

    • Icon: User Story User Story
    • Resolution: Unresolved
    • Icon: Not Evaluated Not Evaluated
    • None
    • None
    • Extras: Android
    • None

      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.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qtandroidteam Qt Android Team
            samuelmira Samuel Mira
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes