Skip to content
This repository was archived by the owner on May 19, 2020. It is now read-only.

Usage Stats are wrong #13

Open
Vel-San opened this issue Oct 7, 2018 · 5 comments
Open

Usage Stats are wrong #13

Vel-San opened this issue Oct 7, 2018 · 5 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@Vel-San
Copy link
Owner

Vel-San commented Oct 7, 2018

Dear Users,

I've found a bug in the newly implemented usage stats ( in Selected Apps screen ), i'll be updating it with the new release.

Bug: Numbers sometimes do not update, or stay the same from 1 day to another.
Expected: Numbers should reset every day, stats should be saved/shown second by second.

@Vel-San Vel-San added bug Something isn't working help wanted Extra attention is needed labels Oct 7, 2018
@Vel-San Vel-San self-assigned this Oct 7, 2018
@rey501
Copy link

rey501 commented Mar 7, 2019

Hello, it very good apps.
and as you mention this bug for "usage stats ( in Selected Apps screen )" , i resolved that as using following code

public class UStats {
........
........
private static void printUsageStats(List usageStatsList, int j) {
..........
.......
/add following code/
long TimeInforground=usageStatsList.get(i).getTotalTimeInForeground();
int minutes = (int) ((TimeInforground / (100060)) % 60);
int seconds = (int) (TimeInforground / 1000) % 60 ;
int hours = (int) ((TimeInforground / (1000
6060)) % 24);
String result = String.format("%02d h, %02d min, %02d sec",
hours,
minutes,
seconds );
/
*****************************************/

 /***remove following old code*******/
 /***String result = String.format("%02d h, %02d min, %02d sec",
                    TimeUnit.MILLISECONDS.toHours(usageStatsList.get(i).getTotalTimeInForeground()),
                    TimeUnit.MILLISECONDS.toMinutes(usageStatsList.get(i).getTotalTimeInForeground()) -
                            TimeUnit.MILLISECONDS.toMinutes(TimeUnit.MILLISECONDS.toHours(usageStatsList.get(i).getTotalTimeInForeground())),
                    TimeUnit.MILLISECONDS.toSeconds(usageStatsList.get(i).getTotalTimeInForeground()) -
                            TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(usageStatsList.get(i).getTotalTimeInForeground()))
            );***/

NOTE: hope this is the correct way to do this as i test its working fine

@Vel-San
Copy link
Owner Author

Vel-San commented Mar 7, 2019

@rey501 Hey!

Thankyou so much for your contribution. I'll test this whenever i can this evening. Can you make a pull request? If not, I'll add you to the list of contributors when i replace my code with yours :)

@rey501
Copy link

rey501 commented Mar 7, 2019

Thank you.
As i am not very much aware of able to do pull request or not.
Could you please test this code and replace if all working fine ?

@Vel-San
Copy link
Owner Author

Vel-San commented Mar 8, 2019

@rey501

I have a lot of things happening in life right now and i'm not going to be able to do changes and publish them. I will try and work as much as i can in my free time and will give feedback.

Thanks again!

@Vel-San
Copy link
Owner Author

Vel-San commented Nov 6, 2019

Thank you.
As i am not very much aware of able to do pull request or not.
Could you please test this code and replace if all working fine ?

Unfortunalty the stats are a little off still ( couple of minutes or so , and sometimes correct. ) I'll have to leave this for a later time.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants