Merge pull request #914 from wangkai9799/master

网络切换导致下载失败
master
lyy 3 years ago committed by GitHub
commit aa292e4389
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      PublicComponent/src/main/java/com/arialyy/aria/core/AriaConfig.java
  2. 2
      PublicComponent/src/main/java/com/arialyy/aria/util/NetUtils.java

@ -157,7 +157,7 @@ public class AriaConfig {
}
}
private boolean isNetworkAvailable() {
public boolean isNetworkAvailable() {
// 获取手机所有连接管理对象(包括对wi-fi,net等连接的管理)
ConnectivityManager connectivityManager =
(ConnectivityManager) getAPP().getSystemService(Context.CONNECTIVITY_SERVICE);

@ -61,7 +61,7 @@ public class NetUtils {
return true;
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
return AriaConfig.getInstance().isConnectedNet();
return AriaConfig.getInstance().isNetworkAvailable();
}
ConnectivityManager cm =
(ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);

Loading…
Cancel
Save