Skip to content

Commit

Permalink
lay out some plan
Browse files Browse the repository at this point in the history
  • Loading branch information
pyricau committed Jul 17, 2023
1 parent 4655645 commit 53f3df4
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion papa/src/main/java/papa/AppLaunch.kt
Original file line number Diff line number Diff line change
@@ -1,11 +1,36 @@
package papa

/*
TODO Plan to make this more usable:
- Move it out of PapaEvent into its own dedicated thing
- Potentially split out from all the existing app start data gathering, which allows moving it into
its own artifact
- Remove savedInstanceState, this should instead become "the list of activities involved in the
launch" and for each activity we can have savedInstanceState
- We should capture timings for each activity.
- Remove the cold vs warm vs hot launch type, which instead should be determined live based on
launch attributes. This allows anyone to make different determinations. For each activity involved
in the launch we can capture its state transitions. E.g. initial states and all states until it
launch end. Alternatively this could be tracked as a history instead of a list of activity
("activity A created with state, then destroyed then activity B created no state"). Then "hot" is
just "a single activity was resumed". Then we can have "did the launch involve a process start", which
has data about whether it was a first install etc, and also whether the process importance was not 100.
Though actually this is more "did the activity launch happen after first post or not". And in the
"not" case there's information about the process importance at startup.
- trampolined becomes "activities.size > 1"
- API for activities to call up until on resume and say "hey I'm in a launch please keep waiting
until I tell you I'm done loading". And capture the next frame after that. Basically a useful version
of reportFullyDrawn.
*/
/**
* The app came was in the background and came to the foreground. In practice this means the app
* had 0 activity in started or resumed state, and now has at least one activity in resumed state.
*
* Going from "paused" back to "resumed" isn't considered a foregrounding here. This is
* an intentional decision, as a paused by not stopped activity is still visible and rendering.
* an intentional decision, as a paused but not stopped activity is still visible and rendering.
*
* Currently we report an [AppLaunch] if at any point in time we go from 1 to 0 to 1 resumed
* activity. This can lead to false positives (e.g. when finishing one activity restarts a new
Expand Down

0 comments on commit 53f3df4

Please sign in to comment.