mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-19 22:29:53 +01:00
Merge branch 'wifi-manager-memory-leak' into 'master'
Use application context to get WifiManager See merge request !535
This commit is contained in:
@@ -146,7 +146,7 @@ public class BriarReportPrimer implements ReportPrimer {
|
|||||||
NetworkInfo wifi = cm.getNetworkInfo(TYPE_WIFI);
|
NetworkInfo wifi = cm.getNetworkInfo(TYPE_WIFI);
|
||||||
boolean wifiAvailable = wifi != null && wifi.isAvailable();
|
boolean wifiAvailable = wifi != null && wifi.isAvailable();
|
||||||
// Is wifi enabled?
|
// Is wifi enabled?
|
||||||
o = ctx.getSystemService(WIFI_SERVICE);
|
o = ctx.getApplicationContext().getSystemService(WIFI_SERVICE);
|
||||||
WifiManager wm = (WifiManager) o;
|
WifiManager wm = (WifiManager) o;
|
||||||
boolean wifiEnabled = wm != null &&
|
boolean wifiEnabled = wm != null &&
|
||||||
wm.getWifiState() == WIFI_STATE_ENABLED;
|
wm.getWifiState() == WIFI_STATE_ENABLED;
|
||||||
|
|||||||
Reference in New Issue
Block a user