Skip to content

Commit

Permalink
chore: cover some inspection issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacksgong committed Aug 21, 2017
1 parent 362fe35 commit bf2bec1
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
7 changes: 7 additions & 0 deletions .idea/dictionaries/Jacksgong.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,11 @@ public static boolean isDownloaderProcess(final Context context) {
final ActivityManager activityManager = (ActivityManager) context.
getSystemService(Context.ACTIVITY_SERVICE);

if (activityManager == null) {
FileDownloadLog.w(FileDownloadUtils.class, "fail to get the activity manager!");
return false;
}

final List<ActivityManager.RunningAppProcessInfo> runningAppProcessInfoList =
activityManager.getRunningAppProcesses();

Expand Down Expand Up @@ -466,6 +471,12 @@ public static String getThreadPoolName(String name) {
public static boolean isNetworkNotOnWifiType() {
final ConnectivityManager manager = (ConnectivityManager) FileDownloadHelper.getAppContext().
getSystemService(Context.CONNECTIVITY_SERVICE);

if (manager == null) {
FileDownloadLog.w(FileDownloadUtils.class, "failed to get connectivity manager!");
return true;
}

final NetworkInfo info = manager.getActiveNetworkInfo();

return info == null || info.getType() != ConnectivityManager.TYPE_WIFI;
Expand Down

0 comments on commit bf2bec1

Please sign in to comment.