aragaer / jtt_android

android jtt app
MIT License
13 stars 6 forks source link

Fails to update time #17

Closed dalb8 closed 7 years ago

dalb8 commented 7 years ago

I notice that JTT doesn't correspond to the current time. Sometimes it will if I swipe to a different view. Using stock LG G4 with Android 6.

aragaer commented 7 years ago

Looks like the "tick" event isn't delivered. I'm going to dig out the sources and try to look at the problem

aragaer commented 7 years ago

It seems I am unable to reproduce it now - I've seen the issue on my phone, but after another update which didn't change anything significant it just worked for several days without a problem.

I have published new version as a beta, you can opt-in by visiting the following link: https://play.google.com/apps/testing/com.aragaer.jtt

I have yet to fix couple other issues before actually publishing this new version. I'd also like having some actual feedback on how the new version behaves.

dalb8 commented 7 years ago

I'm using the beta but it's stuck at about 0140 UTC; even though I went to bed at 2300 UTC and have been up since 0620

aragaer commented 7 years ago

Well.... I guess I'll need a logcat output to figure out what is happening. I've got something similar yesterday but the application was for some reason killed by lowmemkiller which explains the lack of updates.

dalb8 commented 7 years ago

sorry, I don't have access adb for a while

aragaer commented 7 years ago

I think there's some button in options that allows you to take a crash dump. It includes logcat as well.

dalb8 commented 7 years ago

I don't see any option in JTT.

I noticed earlier that the clock tab was was wrong while the today tab was correct.

aragaer commented 7 years ago

No, that's in the android settings, not JTT settings.

Now that is really strange - both are updated on the same event and if there was some error, the whole application would crash.

aragaer commented 7 years ago

I've got this "no longer updating" on a phone I use for testing and I think the problem is that service is not started as a foreground service. That will require some alterations to the code. I'll try to do that on weekend.

aragaer commented 7 years ago

Ok, I've looked again at the problem and it seems it's something different. I guess I will have to try and reproduce it exactly as it was. Can you please give me your location (I mean coordinates that you've set in the app - with two decimal digits precision) and the date it happened.

dalb8 commented 7 years ago

57.35,-4.46

I noticed it after first install on a new phone around 11/2016.

Using the beta, usually the today tab is correct but it takes a few seconds for the clock tab sync with it after I switch to it.

On 4 March 2017 22:36:41 GMT+00:00, Ilya Konovalov notifications@github.com wrote:

Ok, I've looked again at the problem and it seems it's something different. I guess I will have to try and reproduce it exactly as it was. Can you please give me your location (I mean coordinates that you've set in the app - with two decimal digits precision) and the date it happened.

aragaer commented 7 years ago

So you are saying that "today" tab shows correct hour while "clock" tab shows incorrect hour, right? That's really weird and I am looking at the code and it seems really simple here and I can't explain how these two things can appear different.

I've found yet another possible problem why data can be out-of-sync/delayed and I've pushed a temporary solution to beta.

dalb8 commented 7 years ago

On 5 March 2017 18:36:35 GMT+00:00, Ilya Konovalov notifications@github.com wrote:

So you are saying that "today" tab shows correct hour while "clock" tab shows incorrect hour, right? Yes, sometimes. At this moment, both are wrong and I'm using the latest beta

aragaer commented 7 years ago

Looking at the time and location, the correct value should be somewhere near end of the first quarter of the hour of the Boar (which starts at 9.13 PM and ends at 11.23 PM on that day). Was that correct? Was the value in the notification correct?

dalb8 commented 7 years ago

I can't remember what it showed and I've since moved away but at the moment there's a 14 hour discrepancy.

Now 51.x, -8.x @ 0913 . It's showing hour of Dragon in notification; 1926 - 2134 and hour of the dog; 1926 - 2134 in both tabs of the app.

dalb8 commented 7 years ago

Now they're all showing correct time

aragaer commented 7 years ago

Now this is strange - 1926 - 2134 is the correct time for hour of the dog, but not for hour of the dragon. Notification shows correct hour name (dragon is in the morning), but incorrect hour start and end times which means the application got an error when calculating those. But still managed to create the notification itself.

aragaer commented 7 years ago

I have seen the same thing happening on my own phone but the only thing I see in logs is that the application is killed by some memory-freeing service. I can't yet explain why it would kill the service (it doesn't use that much memory) and why the service isn't actually restarted.

dalb8 commented 7 years ago

I've a feeling this is to do with Doze. I've disabled battery optimisations for JTT and I'm hoping that will fix things.

dalb8 commented 7 years ago

OK disabling battery optimization doesn't fix it.

aragaer commented 7 years ago

Without logcat output I am completely lost now.

dalb8 commented 7 years ago

I don't know if this is of any help. I opened the app and swiped around a bit.

03-31 16:21:45.090  5548  5548 W SplitWindow: update focus... 
03-31 16:21:45.121  5548  5548 I Timeline: Timeline: Activity_idle id: android.os.BinderProxy@5fcdfdd time:866934016
03-31 16:21:52.950  1312  2821 W sensors_hal_Time: timestampCalc: Adjusting timestamp for rollover: 1975364888055481, 1
03-31 16:21:57.890  5548  5548 I ViewRootImpl: ViewRoot's Touch Event : ACTION_DOWN
03-31 16:21:58.004  5548  5548 I ViewRootImpl: ViewRoot's Touch Event : ACTION_UP
03-31 16:22:00.769  5548  5548 I ViewRootImpl: ViewRoot's Touch Event : ACTION_DOWN
03-31 16:22:00.900  5548  5548 I ViewRootImpl: ViewRoot's Touch Event : ACTION_UP
03-31 16:22:03.616  5548  5548 I ViewRootImpl: ViewRoot's Touch Event : ACTION_DOWN
03-31 16:22:03.754  5548  5548 I ViewRootImpl: ViewRoot's Touch Event : ACTION_UP
03-31 16:22:04.772  5548  5548 I ViewRootImpl: ViewRoot's Touch Event : ACTION_DOWN
03-31 16:22:04.896  5548  5548 I ViewRootImpl: ViewRoot's Touch Event : ACTION_UP
03-31 16:22:07.618  5548  5548 I ViewRootImpl: ViewRoot's Touch Event : ACTION_DOWN
03-31 16:22:07.707  5548  5548 I ViewRootImpl: ViewRoot's Touch Event : ACTION_UP
03-31 16:22:07.725  5548  5548 D ViewAO  : isWindowSplit called.. by aspectj
03-31 16:22:07.737  5548  5548 D ViewAO  : isWindowSplit called.. by aspectj
03-31 16:22:07.836  5548  5548 V ViewRootImpl: Contents drawing finished : PopupWindow:2042e5f
03-31 16:22:07.838  5548  5548 W SplitWindow: update focus... 
03-31 16:22:22.892  5548  5548 W IInputConnectionWrapper: getTextBeforeCursor on inactive InputConnection
03-31 16:22:22.903  5548  5548 W IInputConnectionWrapper: getTextBeforeCursor on inactive InputConnection
03-31 16:22:27.127  5548  5548 W SplitWindow: update focus... 
03-31 16:22:27.153  5548  5548 I Timeline: Timeline: Activity_idle id: android.os.BinderProxy@5fcdfdd time:866976048
03-31 16:22:28.979  5548  5548 I ViewRootImpl: ViewRoot's KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_BACK, scanCode=0, metaState=0, flags=0x48, repeatCount=0, eventTime=866977865, downTime=866977865, deviceId=-1, source=0x101 } to com.android.internal.policy.PhoneWindow$DecorView{a69b50a V.E...... R....... 0,0-1440,2392}
03-31 16:22:29.039  5548  5548 I ViewRootImpl: ViewRoot's KeyEvent { action=ACTION_UP, keyCode=KEYCODE_BACK, scanCode=0, metaState=0, flags=0x48, repeatCount=0, eventTime=866977932, downTime=866977865, deviceId=-1, source=0x101 } to com.android.internal.policy.PhoneWindow$DecorView{a69b50a V.E...... R....... 0,0-1440,2392}
03-31 16:22:29.062  5548  5548 W SplitWindow: update focus... 
03-31 16:22:29.124  5548  5548 W IInputConnectionWrapper: getTextBeforeCursor on inactive InputConnection
03-31 16:22:29.157  5548  5548 W IInputConnectionWrapper: getTextBeforeCursor on inactive InputConnection

Wait a bit ...

03-31 16:31:41.016  1312  3410 I ActivityManager: Process com.aragaer.jtt (pid 5548) has died

Then I opened up the app and swiped around but nothing in the log

dalb8 commented 7 years ago

I've restarted the app and so far the time is correct. If it goes wrong later I'll post a log.

aragaer commented 7 years ago

That's the message when ActivityManager noticed that JTT has died. But it might be more interesting to see any message of why it had died. Still, the fact that it did die explains why the notification isn't updated.

dalb8 commented 7 years ago

New beta is working well so far.