Skip to content

Getting wrong sessions/stats for some applications #3

@shadygoneinsane

Description

@shadygoneinsane

I could find some applications for which the getSessions() in AppUsageManager.kt gives Session object starting from midnight i.e from 00:00:00 to a time from where the actual first session started which is the subsequent session in the sessions list.

This causes the overall usage time to be much more than what it actually is and gives the wrong session info as well..

For reference, I am attaching some screenshots,

Issue_session_1_1
Issue_session_1_2
Issue_session_1_3

I believe this is due to the fact that we consider 'startTime' for events that are not initialized as 'timeStart' - I will test some more and put my observations here, meanwhile please check if you are getting the same issue as well.

                      UsageEvents.Event.ACTIVITY_PAUSED -> { // same as MOVE_TO_BACKGROUND
                                    // end time
                                    if(startTime == 0L) {
                                        if(!isInitialized) {
                                            startTime = timeStart
                                            endTime = event.timeStamp
                                        }
                                    } else {
                                        endTime = event.timeStamp
                                    }
                                }

I appreciate your time and effort put in this project, Thanks for this project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions