From 90dc14c7bc629b8109f5fe1f44e051f7d7859a35 Mon Sep 17 00:00:00 2001 From: Andrew Rabert Date: Sun, 5 Mar 2017 11:22:09 -0500 Subject: [PATCH] Prevent WifiManager leak --- .../main/java/net/nullsum/audinaut/service/DownloadService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/net/nullsum/audinaut/service/DownloadService.java b/app/src/main/java/net/nullsum/audinaut/service/DownloadService.java index 9d338d4..2a2ef05 100644 --- a/app/src/main/java/net/nullsum/audinaut/service/DownloadService.java +++ b/app/src/main/java/net/nullsum/audinaut/service/DownloadService.java @@ -231,7 +231,7 @@ public class DownloadService extends Service { wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, this.getClass().getName()); wakeLock.setReferenceCounted(false); - WifiManager wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE); + WifiManager wifiManager = (WifiManager) this.getSystemService(Context.WIFI_SERVICE); wifiLock = wifiManager.createWifiLock(WifiManager.WIFI_MODE_FULL, "downloadServiceLock"); keepScreenOn = prefs.getBoolean(Constants.PREFERENCES_KEY_KEEP_SCREEN_ON, false);