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

Android app stops working, notification disappears, have to toggle "Enable Services" to reconnect #106

Open
ohbobva opened this issue May 28, 2015 · 2 comments

Comments

@ohbobva
Copy link

ohbobva commented May 28, 2015

Very frequently, it appears the Android service stops. The notification disappears. If I check for connected peers, it says zero (even though there should be one). If I open the "Connect" screen, the "Enable Services" box is still checked. However, I have to toggle the check mark in order in order to start working again. Then, the notification icon returns until the next time this happens.

App Version: 0.92
Nexus 5
Android 5.1

Any thoughts or suggestions?

@lakeman
Copy link
Member

lakeman commented May 28, 2015

That is a bit odd.

We start and stop the notification, and disable access to the network here;
https://github.com/servalproject/batphone/blob/0.92/src/org/servalproject/Control.java#L108

Which should be called whenever we hear a broadcast intent related to the wifi network connection.;
https://github.com/servalproject/batphone/blob/0.92/src/org/servalproject/batphone/BatPhone.java#L97

Perhaps your wifi supplicant is faltering, and there's a race condition when we check if the network is now usable. So the last message we hear turns everything off instead of on.

In our back end daemon, we've been meaning to swap from preiodically scanning the interface list, to using a net link socket to wait for the OS to push network changes to us. This change would help to save power and make the detection of network changes more reliable.

If I'm right about the above issue, this change in detecting viable network interfaces should make your problem go away as well.

@ohbobva
Copy link
Author

ohbobva commented May 29, 2015

I'd like to followup to report that...

On 2 other android devices[1], sometimes, if the device is rebooted, the notification shows up, after reboot, but the service appears to be hung. The Connect screen says, "Starting", and never changes until the "Enable Services" check box is toggled, then everything is fine.

[1] HTC Inspire 4G (Android 2.3.5), and LG Optimus V / VM670 (Android 2.2.2)

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

No branches or pull requests

2 participants