Created
July 16, 2020 15:01
-
-
Save yangweigbh/43e36e3e84f3bc8d2b8f75a3eb1bc15a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (ApplicationExitInfo exitInfo: unprocessedExitInfos) { | |
if (exitInfo.getReason() == ApplicationExitInfo.REASON_ANR) { | |
UUID uuid = UUID.randomUUID(); | |
String fileName = "anr_info_" + uuid.toString() + ".trace"; | |
File outFile = new File(getFilesDir().getAbsolutePath() + "/" + fileName); | |
try (InputStream inputStream = exitInfo.getTraceInputStream()) { | |
copyStreamToFile(inputStream, outFile); | |
} catch (IOException e) { | |
Log.e(TAG, "copyStreamToFile: ", e); | |
} | |
// upload the file to server | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment