infinum / android_connectionbuddy

Utility library for handling connectivity change events.
Apache License 2.0
94 stars 17 forks source link

Fix/duplicate subscription #88

Closed ikocijan closed 5 years ago

ikocijan commented 5 years ago

This is a fix for duplicate subscription bug.

In a case when you would call registerForConnectivityEvents twice for the same object, the library would register a new intent filter, but it wouldn't be added to the networkReceiversHashMap. This would result in a bug when the user unsubscribes. He would be unsubscribed from the first receiver, but not from the second.