Prevent WifiManager leak

This commit is contained in:
Andrew Rabert 2017-03-05 11:22:09 -05:00
parent ccdef60311
commit 90dc14c7bc
1 changed files with 1 additions and 1 deletions

View File

@ -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);