File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
platform/jvm/capture/src/main/kotlin/io/bitdrift/capture/reports/exitinfo Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ internal class PreviousRunInfoResolver(
4343 override fun initLegacyWatcher (sdkDirectory : String ) {
4444 if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .R ) return
4545
46- legacyStateFile = File (sdkDirectory, " reports/previous_run_info.state " )
46+ legacyStateFile = createPersistedStateFile (sdkDirectory)
4747 legacySnapshot = readPersistedState()
4848 writePersistedState(PreviousRunInfo (hasFatallyTerminated = false ))
4949 }
@@ -72,6 +72,14 @@ internal class PreviousRunInfoResolver(
7272 is LatestAppExitReasonResult .Error -> null
7373 }
7474
75+ private fun createPersistedStateFile (sdkDirectory : String ): File ? =
76+ runCatching {
77+ File (sdkDirectory, " reports/previous_run_info.state" )
78+ }.getOrElse {
79+ internalLogger.logInternalError { " Couldn't create legacy state file" }
80+ null
81+ }
82+
7583 private fun readPersistedState (): PreviousRunInfo ? {
7684 val file =
7785 legacyStateFile ? : run {
You can’t perform that action at this time.
0 commit comments