Merge pull request #8723 from volzhs/fix-android-master

Fix possible memory leak for Android and update gradle
This commit is contained in:
Rémi Verschelde 2017-05-12 08:24:22 +02:00 committed by GitHub
commit 413e68fced
3 changed files with 6 additions and 5 deletions

View File

@ -3,7 +3,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
classpath 'com.android.tools.build:gradle:2.3.1'
$$GRADLE_CLASSPATH$$
}
}

View File

@ -1,6 +1,7 @@
#Wed Apr 10 15:27:10 PDT 2013
#Fri May 12 08:50:03 KST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-bin.zip
org.gradle.jvmargs=-Xmx1536M

View File

@ -569,10 +569,10 @@ public abstract class DownloaderService extends CustomIntentService implements I
*/
void pollNetworkState() {
if (null == mConnectivityManager) {
mConnectivityManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
mConnectivityManager = (ConnectivityManager) getApplicationContext().getSystemService(Context.CONNECTIVITY_SERVICE);
}
if (null == mWifiManager) {
mWifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
mWifiManager = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE);
}
if (mConnectivityManager == null) {
Log.w(Constants.TAG,