BramBonne / privacypolice

Source code for Wi-Fi Privacy Police, available on Google Play at https://play.google.com/store/apps/details?id=be.uhasselt.privacypolice
GNU General Public License v2.0
159 stars 17 forks source link

Is constantly scanning wifis, even when Wifi is off #41

Closed dicer closed 8 years ago

dicer commented 8 years ago

I'm on CM13 and have a problem with Privacy Police 2.2.3 (from fdroid): The app is constantly scanning in the background. So even when wifi is completely disabled, it keeps scanning every few seconds. Might this be, because I have background wifi scanning always enabled?

Here are some logs:

05-29 02:35:13.473  4592  4592 V PrivacyPolice: Ensuring we're still awake
05-29 02:35:13.486  4592  4592 D PrivacyPolice: Wi-Fi scan performed, results are: [SSID: YYYY, BSSID: xxxxxxxxx, capabilities: [WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS], level: -50, frequency: 2412, timestamp: 545672298239, distance: ?(cm), distanceSd: ?(cm), passpoint: no, ChannelBandwidth: 1, centerFreq0: 2432, centerFreq1: 0, 80211mcResponder: is not supported]
05-29 02:35:13.490  4592  4592 E PrivacyPolice: Null pointer exception when handling networks. Wi-Fi was probably suddenly disabled after a scan. Exception info: Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference
05-29 02:35:15.934  4592  4592 V PrivacyPolice: Ensuring we're still awake
05-29 02:35:15.940  4592  4592 D PrivacyPolice: Wi-Fi scan performed, results are: [SSID: YYYY, BSSID: xxxxxxxxx, capabilities: [WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS], level: -51, frequency: 2412, timestamp: 545674761985, distance: ?(cm), distanceSd: ?(cm), passpoint: no, ChannelBandwidth: 1, centerFreq0: 2432, centerFreq1: 0, 80211mcResponder: is not supported]
05-29 02:35:15.944  4592  4592 E PrivacyPolice: Null pointer exception when handling networks. Wi-Fi was probably suddenly disabled after a scan. Exception info: Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference
05-29 02:35:18.433  4592  4592 V PrivacyPolice: Ensuring we're still awake
05-29 02:35:18.439  4592  4592 D PrivacyPolice: Wi-Fi scan performed, results are: [SSID: YYYY, BSSID: xxxxxxxxx, capabilities: [WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS], level: -45, frequency: 2412, timestamp: 545677260553, distance: ?(cm), distanceSd: ?(cm), passpoint: no, ChannelBandwidth: 1, centerFreq0: 2432, centerFreq1: 0, 80211mcResponder: is not supported]
05-29 02:35:18.442  4592  4592 E PrivacyPolice: Null pointer exception when handling networks. Wi-Fi was probably suddenly disabled after a scan. Exception info: Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference
05-29 02:35:20.930  4592  4592 V PrivacyPolice: Ensuring we're still awake
05-29 02:35:20.936  4592  4592 D PrivacyPolice: Wi-Fi scan performed, results are: [SSID: YYYY, BSSID: xxxxxxxxx, capabilities: [WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS], level: -46, frequency: 2412, timestamp: 545679769984, distance: ?(cm), distanceSd: ?(cm), passpoint: no, ChannelBandwidth: 1, centerFreq0: 2432, centerFreq1: 0, 80211mcResponder: is not supported]
05-29 02:35:20.938  4592  4592 E PrivacyPolice: Null pointer exception when handling networks. Wi-Fi was probably suddenly disabled after a scan. Exception info: Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference
05-29 02:35:23.433  4592  4592 V PrivacyPolice: Ensuring we're still awake
05-29 02:35:23.438  4592  4592 D PrivacyPolice: Wi-Fi scan performed, results are: [SSID: YYYY, BSSID: xxxxxxxxx, capabilities: [WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS], level: -46, frequency: 2412, timestamp: 545682261052, distance: ?(cm), distanceSd: ?(cm), passpoint: no, ChannelBandwidth: 1, centerFreq0: 2432, centerFreq1: 0, 80211mcResponder: is not supported]
05-29 02:35:23.440  4592  4592 E PrivacyPolice: Null pointer exception when handling networks. Wi-Fi was probably suddenly disabled after a scan. Exception info: Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference
05-29 02:35:25.933  4592  4592 V PrivacyPolice: Ensuring we're still awake
05-29 02:35:25.941  4592  4592 D PrivacyPolice: Wi-Fi scan performed, results are: [SSID: YYYY, BSSID: xxxxxxxxx, capabilities: [WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS], level: -44, frequency: 2412, timestamp: 545684787584, distance: ?(cm), distanceSd: ?(cm), passpoint: no, ChannelBandwidth: 1, centerFreq0: 2432, centerFreq1: 0, 80211mcResponder: is not supported]
05-29 02:35:25.944  4592  4592 E PrivacyPolice: Null pointer exception when handling networks. Wi-Fi was probably suddenly disabled after a scan. Exception info: Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference
05-29 02:35:28.432  4592  4592 V PrivacyPolice: Ensuring we're still awake
05-29 02:35:28.460  4592  4592 D PrivacyPolice: Wi-Fi scan performed, results are: [SSID: YYYY, BSSID: xxxxxxxxx, capabilities: [WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS], level: -42, frequency: 2412, timestamp: 545687260684, distance: ?(cm), distanceSd: ?(cm), passpoint: no, ChannelBandwidth: 1, centerFreq0: 2432, centerFreq1: 0, 80211mcResponder: is not supported]
05-29 02:35:28.465  4592  4592 E PrivacyPolice: Null pointer exception when handling networks. Wi-Fi was probably suddenly disabled after a scan. Exception info: Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference
05-29 02:35:30.973  4592  4592 V PrivacyPolice: Ensuring we're still awake
05-29 02:35:31.019  4592  4592 D PrivacyPolice: Wi-Fi scan performed, results are: [SSID: YYYY, BSSID: xxxxxxxxx, capabilities: [WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS], level: -39, frequency: 2412, timestamp: 545689761176, distance: ?(cm), distanceSd: ?(cm), passpoint: no, ChannelBandwidth: 1, centerFreq0: 2432, centerFreq1: 0, 80211mcResponder: is not supported]
05-29 02:35:31.025  4592  4592 E PrivacyPolice: Null pointer exception when handling networks. Wi-Fi was probably suddenly disabled after a scan. Exception info: Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference
05-29 02:35:33.437  4592  4592 V PrivacyPolice: Ensuring we're still awake
05-29 02:35:33.446  4592  4592 D PrivacyPolice: Wi-Fi scan performed, results are: [SSID: YYYY, BSSID: xxxxxxxxx, capabilities: [WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS], level: -40, frequency: 2412, timestamp: 545692264686, distance: ?(cm), distanceSd: ?(cm), passpoint: no, ChannelBandwidth: 1, centerFreq0: 2432, centerFreq1: 0, 80211mcResponder: is not supported]
05-29 02:35:33.450  4592  4592 E PrivacyPolice: Null pointer exception when handling networks. Wi-Fi was probably suddenly disabled after a scan. Exception info: Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference
05-29 02:35:35.938  4592  4592 V PrivacyPolice: Ensuring we're still awake
05-29 02:35:35.953  4592  4592 D PrivacyPolice: Wi-Fi scan performed, results are: [SSID: YYYY, BSSID: xxxxxxxxx, capabilities: [WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS], level: -43, frequency: 2412, timestamp: 545694762931, distance: ?(cm), distanceSd: ?(cm), passpoint: no, ChannelBandwidth: 1, centerFreq0: 2432, centerFreq1: 0, 80211mcResponder: is not supported]
05-29 02:35:35.957  4592  4592 E PrivacyPolice: Null pointer exception when handling networks. Wi-Fi was probably suddenly disabled after a scan. Exception info: Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference
05-29 02:35:38.437  4592  4592 V PrivacyPolice: Ensuring we're still awake
05-29 02:35:38.444  4592  4592 D PrivacyPolice: Wi-Fi scan performed, results are: [SSID: YYYY, BSSID: xxxxxxxxx, capabilities: [WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS], level: -40, frequency: 2412, timestamp: 545697280384, distance: ?(cm), distanceSd: ?(cm), passpoint: no, ChannelBandwidth: 1, centerFreq0: 2432, centerFreq1: 0, 80211mcResponder: is not supported]
05-29 02:35:38.451  4592  4592 E PrivacyPolice: Null pointer exception when handling networks. Wi-Fi was probably suddenly disabled after a scan. Exception info: Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference
dicer commented 8 years ago

Actually: When I turn Wifi on, the errors stop, but it keeps scanning:

05-29 02:44:53.733  4592  4592 V PrivacyPolice: Ensuring we're still awake
05-29 02:44:53.743  4592  4592 D PrivacyPolice: Wi-Fi scan performed, results are: [SSID: YYYY, BSSID: xxxxxxxxx, capabilities: [WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS], level: -40, frequency: 2412, timestamp: 546252288384, distance: ?(cm), distanceSd: ?(cm), passpoint: no, ChannelBandwidth: 1, centerFreq0: 2432, centerFreq1: 0, 80211mcResponder: is not supported]
05-29 02:44:53.962  4592  4592 I PrivacyPolice: Enabling "YYYY"
05-29 02:44:55.016  4592  4592 I PrivacyPolice: Reassociating, because WifiManager doesn't seem to be eager to reconnect.
05-29 02:45:19.967  4592  4592 V PrivacyPolice: Ensuring we're still awake
05-29 02:45:20.039  4592  4592 D PrivacyPolice: Wi-Fi scan performed, results are: [SSID: YYYY, BSSID: xxxxxxxxx, capabilities: [WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS], level: -40, frequency: 2412, timestamp: 546278886279, distance: ?(cm), distanceSd: ?(cm), passpoint: no, ChannelBandwidth: 1, centerFreq0: 2432, centerFreq1: 0, 80211mcResponder: is not supported]
05-29 02:45:20.219  4592  4592 I PrivacyPolice: Enabling "YYYY"
05-29 02:45:23.844  4592  4592 V PrivacyPolice: Ensuring we're still awake
05-29 02:45:23.873  4592  4592 D PrivacyPolice: Wi-Fi scan performed, results are: [SSID: YYYY, BSSID: xxxxxxxxx, capabilities: [WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS], level: -41, frequency: 2412, timestamp: 546282816846, distance: ?(cm), distanceSd: ?(cm), passpoint: no, ChannelBandwidth: 1, centerFreq0: 2432, centerFreq1: 0, 80211mcResponder: is not supported]
05-29 02:45:24.042  4592  4592 I PrivacyPolice: Enabling "YYYY"
05-29 02:45:26.349  4592  4592 V PrivacyPolice: Ensuring we're still awake
05-29 02:45:26.361  4592  4592 D PrivacyPolice: Wi-Fi scan performed, results are: [SSID: YYYY, BSSID: xxxxxxxxx, capabilities: [WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS], level: -40, frequency: 2412, timestamp: 546285316650, distance: ?(cm), distanceSd: ?(cm), passpoint: no, ChannelBandwidth: 1, centerFreq0: 2432, centerFreq1: 0, 80211mcResponder: is not supported]
05-29 02:45:26.516  4592  4592 I PrivacyPolice: Enabling "YYYY"
05-29 02:45:28.838  4592  4592 V PrivacyPolice: Ensuring we're still awake
05-29 02:45:28.846  4592  4592 D PrivacyPolice: Wi-Fi scan performed, results are: [SSID: YYYY, BSSID: xxxxxxxxx, capabilities: [WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS], level: -40, frequency: 2412, timestamp: 546287828375, distance: ?(cm), distanceSd: ?(cm), passpoint: no, ChannelBandwidth: 1, centerFreq0: 2432, centerFreq1: 0, 80211mcResponder: is not supported]
05-29 02:45:28.959  4592  4592 I PrivacyPolice: Enabling "YYYY"
05-29 02:45:31.379  4592  4592 V PrivacyPolice: Ensuring we're still awake
05-29 02:45:31.388  4592  4592 D PrivacyPolice: Wi-Fi scan performed, results are: [SSID: YYYY, BSSID: xxxxxxxxx, capabilities: [WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS], level: -41, frequency: 2412, timestamp: 546290316689, distance: ?(cm), distanceSd: ?(cm), passpoint: no, ChannelBandwidth: 1, centerFreq0: 2432, centerFreq1: 0, 80211mcResponder: is not supported]
05-29 02:45:31.498  4592  4592 I PrivacyPolice: Enabling "YYYY"
05-29 02:45:33.863  4592  4592 V PrivacyPolice: Ensuring we're still awake
05-29 02:45:33.872  4592  4592 D PrivacyPolice: Wi-Fi scan performed, results are: [SSID: YYYY, BSSID: xxxxxxxxx, capabilities: [WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS], level: -40, frequency: 2412, timestamp: 546292846050, distance: ?(cm), distanceSd: ?(cm), passpoint: no, ChannelBandwidth: 1, centerFreq0: 2432, centerFreq1: 0, 80211mcResponder: is not supported]
05-29 02:45:33.971  4592  4592 I PrivacyPolice: Enabling "YYYY"
05-29 02:45:36.374  4592  4592 V PrivacyPolice: Ensuring we're still awake
05-29 02:45:36.452  4592  4592 D PrivacyPolice: Wi-Fi scan performed, results are: [SSID: YYYY, BSSID: xxxxxxxxx, capabilities: [WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS], level: -41, frequency: 2412, timestamp: 546295318222, distance: ?(cm), distanceSd: ?(cm), passpoint: no, ChannelBandwidth: 1, centerFreq0: 2432, centerFreq1: 0, 80211mcResponder: is not supported]
05-29 02:45:36.573  4592  4592 I PrivacyPolice: Enabling "YYYY"
05-29 02:45:38.871  4592  4592 V PrivacyPolice: Ensuring we're still awake
05-29 02:45:38.884  4592  4592 D PrivacyPolice: Wi-Fi scan performed, results are: [SSID: YYYY, BSSID: xxxxxxxxx, capabilities: [WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS], level: -41, frequency: 2412, timestamp: 546297811478, distance: ?(cm), distanceSd: ?(cm), passpoint: no, ChannelBandwidth: 1, centerFreq0: 2432, centerFreq1: 0, 80211mcResponder: is not supported]
05-29 02:45:39.017  4592  4592 I PrivacyPolice: Enabling "YYYY"
05-29 02:45:41.355  4592  4592 V PrivacyPolice: Ensuring we're still awake
05-29 02:45:41.364  4592  4592 D PrivacyPolice: Wi-Fi scan performed, results are: [SSID: YYYY, BSSID: xxxxxxxxx, capabilities: [WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS], level: -41, frequency: 2412, timestamp: 546300323501, distance: ?(cm), distanceSd: ?(cm), passpoint: no, ChannelBandwidth: 1, centerFreq0: 2432, centerFreq1: 0, 80211mcResponder: is not supported]
05-29 02:45:41.470  4592  4592 I PrivacyPolice: Enabling "YYYY"
05-29 02:45:43.873  4592  4592 V PrivacyPolice: Ensuring we're still awake
05-29 02:45:43.881  4592  4592 D PrivacyPolice: Wi-Fi scan performed, results are: [SSID: YYYY, BSSID: xxxxxxxxx, capabilities: [WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS], level: -41, frequency: 2412, timestamp: 546302823356, distance: ?(cm), distanceSd: ?(cm), passpoint: no, ChannelBandwidth: 1, centerFreq0: 2432, centerFreq1: 0, 80211mcResponder: is not supported]
05-29 02:45:43.974  4592  4592 I PrivacyPolice: Enabling "YYYY"
05-29 02:45:46.356  4592  4592 V PrivacyPolice: Ensuring we're still awake
05-29 02:45:46.362  4592  4592 D PrivacyPolice: Wi-Fi scan performed, results are: [SSID: YYYY, BSSID: xxxxxxxxx, capabilities: [WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS], level: -45, frequency: 2412, timestamp: 546305338735, distance: ?(cm), distanceSd: ?(cm), passpoint: no, ChannelBandwidth: 1, centerFreq0: 2432, centerFreq1: 0, 80211mcResponder: is not supported]
05-29 02:45:46.454  4592  4592 I PrivacyPolice: Enabling "YYYY"
05-29 02:45:48.845  4592  4592 V PrivacyPolice: Ensuring we're still awake
05-29 02:45:48.853  4592  4592 D PrivacyPolice: Wi-Fi scan performed, results are: [SSID: YYYY, BSSID: xxxxxxxxx, capabilities: [WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS], level: -43, frequency: 2412, timestamp: 546307824961, distance: ?(cm), distanceSd: ?(cm), passpoint: no, ChannelBandwidth: 1, centerFreq0: 2432, centerFreq1: 0, 80211mcResponder: is not supported]
05-29 02:45:48.993  4592  4592 I PrivacyPolice: Enabling "YYYY"
05-29 02:45:51.347  4592  4592 V PrivacyPolice: Ensuring we're still awake
05-29 02:45:51.352  4592  4592 D PrivacyPolice: Wi-Fi scan performed, results are: [SSID: YYYY, BSSID: xxxxxxxxx, capabilities: [WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS], level: -43, frequency: 2412, timestamp: 546310321007, distance: ?(cm), distanceSd: ?(cm), passpoint: no, ChannelBandwidth: 1, centerFreq0: 2432, centerFreq1: 0, 80211mcResponder: is not supported]
05-29 02:45:51.459  4592  4592 I PrivacyPolice: Enabling "YYYY"
05-29 02:45:53.843  4592  4592 V PrivacyPolice: Ensuring we're still awake
05-29 02:45:53.852  4592  4592 D PrivacyPolice: Wi-Fi scan performed, results are: [SSID: YYYY, BSSID: xxxxxxxxx, capabilities: [WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS], level: -41, frequency: 2412, timestamp: 546312823430, distance: ?(cm), distanceSd: ?(cm), passpoint: no, ChannelBandwidth: 1, centerFreq0: 2432, centerFreq1: 0, 80211mcResponder: is not supported]
05-29 02:45:53.982  4592  4592 I PrivacyPolice: Enabling "YYYY"
05-29 02:45:56.387  4592  4592 V PrivacyPolice: Ensuring we're still awake
05-29 02:45:56.400  4592  4592 D PrivacyPolice: Wi-Fi scan performed, results are: [SSID: YYYY, BSSID: xxxxxxxxx, capabilities: [WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS], level: -42, frequency: 2412, timestamp: 546315318441, distance: ?(cm), distanceSd: ?(cm), passpoint: no, ChannelBandwidth: 1, centerFreq0: 2432, centerFreq1: 0, 80211mcResponder: is not supported]
05-29 02:45:56.537  4592  4592 I PrivacyPolice: Enabling "YYYY"
BramBonne commented 8 years ago

Hi Felix! Thanks for catching this!

It indeed seems to be related to the case where background scanning is enabled. I'll fix this in a future release, but it shouldn't be a major issue (all networks will be disabled when Wi-Fi is disabled, which should be desired behavior).