Skip to content

Commit

Permalink
fix(android): report activity launched with saved state as warm launch
Browse files Browse the repository at this point in the history
closes #1246
  • Loading branch information
abhaysood committed Sep 16, 2024
1 parent c5a62d6 commit 544dc9d
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,18 @@ internal class LaunchTracker(
}
}

// Cold launch hasn't completed yet.
// However, the activity has a saved state, so it must be a warm launch. The process
// was recreated but the system still retained some state. This is not a cold launch as
// the process didn't really start from scratch.
onCreateRecord.hasSavedState -> "Warm"

processInfo.isForegroundProcess() -> "Cold"

// While the process was starting in background the system must have decided to create
// the activity and it got resumed. This is not a cold start as the system likely got a
// chance to warm up before the activity was created. Sadly the system doesn't tell us
// when it decided to do so, the data for this can be noisy.
else -> "Warm"
}
}
Expand Down

0 comments on commit 544dc9d

Please sign in to comment.