Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix keepAlive interval for non GCM Android #6644 #7388

Closed
wants to merge 2 commits into from

Conversation

rkohrt
Copy link

@rkohrt rkohrt commented Feb 3, 2018

This is a rewrite of #7100 with the suggested changes of Moxie. It should achieve the same thing as the original pull request while not braking the API.

I added an AlarmManager alarm, to periodically send a KeepAlive message and waking any threads that may be stuck in blocking wait, while the device is sleeping.

This fixes #6644
It depends on my changes in signalapp/libsignal-service-java#48

First time contributor checklist

Contributor checklist

  • Oneplus one, Android 7.1.2
  • My contribution is fully baked and ready to be merged as is
  • I ensure that all the open issues my contribution fixes are mentioned in the commit message of my first commit using the Fixes #1234 syntax

@moxie0
Copy link
Contributor

moxie0 commented Mar 7, 2018

The way I want to do this is as follows:

  1. In the Android app, the logic does not change at all. The diff to the Android app should be 1 line.

  2. In the service library, there are two different implementations of a single sleep interface. One, the default, uses Thread.sleep(). The other, an optional implementation for non-play devices, uses the alarm manager.

  3. All together, the logic and implementation for Play devices will be exactly the same as it is now

Thanks!.

@moxie0 moxie0 closed this Mar 7, 2018
@theBoatman
Copy link

@moxie0 I have an implementation that I think could match your wishes. Can you please take a short look whether this goes in the right direction?

https://github.com/theBoatman/libsignal-service-java
https://github.com/theBoatman/Signal-Android

I was not able to put the android implementation of sleep in the service library. (It compiled, but I was not able to use it in the app.) That is probably just a dependency issue and not a big blocker. The key of this is that the implementation of AndroidThread.sleep() works and matches your needs and I think that might be the case.

The code works for me at the moment, but needs a little bit more testing. If you think that version has a chance to get merged, then I will continue to work on it. (Testing, coding styles etc...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Messages can take hours to be received
3 participants