kryptco / krypton-android

DEPRECATED Krypton turns your Android device into a U2F Authenticator: strong, unphishable 2FA.
https://krypt.co
Other
203 stars 50 forks source link

New SQSPollers whenever MainActivity becomes visible #57

Closed kennylevinsen closed 7 years ago

kennylevinsen commented 7 years ago

Every time MainActivity becomes visible, an SQSPoller is started for every pairing. Tapping around a bit (back and forth from settings, changing app back and forth) can easily result in 3-4 SQSPoller sets. The connection count is pollers * pairings, so the connections add up quite fast.

Poller lifetime should be managed so that new pollers aren't started if one is already present.

A second consideration would be to up the request timeout from 10 seconds to something higher (20?) in order to lower network activity. I have not played enough with Firebase/GCM to know whether or not relying on it entirely rather than polling (or only polling whenever a GCM message wakes you up) would be a viable strategy.