Skip to content

Commit

Permalink
Add Shuffle in package request
Browse files Browse the repository at this point in the history
  • Loading branch information
Schoumi committed Jun 4, 2019
1 parent 1f97fe7 commit 5c7e021
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Bundle;

import org.eu.exodus_privacy.exodusprivacy.listener.NetworkListener;
import org.eu.exodus_privacy.exodusprivacy.R;
import org.eu.exodus_privacy.exodusprivacy.objects.Application;
import org.eu.exodus_privacy.exodusprivacy.objects.Report;
import org.eu.exodus_privacy.exodusprivacy.objects.Tracker;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
Expand All @@ -45,15 +39,23 @@
import java.util.Arrays;
import java.util.Calendar;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Random;
import java.util.TimeZone;

import java.util.concurrent.Semaphore;

import org.eu.exodus_privacy.exodusprivacy.R;
import org.eu.exodus_privacy.exodusprivacy.listener.NetworkListener;
import org.eu.exodus_privacy.exodusprivacy.objects.Application;
import org.eu.exodus_privacy.exodusprivacy.objects.Report;
import org.eu.exodus_privacy.exodusprivacy.objects.Tracker;

/*
Singleton that handle all network connection
*/
Expand Down Expand Up @@ -255,6 +257,7 @@ private void getReports(Message mes, Map<String,String> handles) {
packages.add(handleList.get(val));
}

Collections.shuffle(packages);

for(int i = 0; i < packages.size(); i++) {
mes.listener.onProgress(R.string.parse_application,i+1,packages.size());
Expand Down

0 comments on commit 5c7e021

Please sign in to comment.