mirror of
https://github.com/oxen-io/session-android.git
synced 2025-10-25 09:08:37 +00:00
Break long filter thread id calls up into chunks of 900.
// FREEBIE Fixes #2462 Closes #2860
This commit is contained in:
committed by
Jake McGinty
parent
b8a231c40f
commit
797b296f3a
@@ -20,15 +20,11 @@ import android.annotation.SuppressLint;
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.Shader;
|
||||
import android.graphics.Typeface;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.os.Build.VERSION;
|
||||
import android.os.Build.VERSION_CODES;
|
||||
import android.provider.Telephony;
|
||||
import android.telephony.SmsManager;
|
||||
import android.telephony.TelephonyManager;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableString;
|
||||
@@ -37,7 +33,6 @@ import android.text.style.StyleSpan;
|
||||
import android.widget.EditText;
|
||||
|
||||
import org.thoughtcrime.securesms.BuildConfig;
|
||||
import org.thoughtcrime.securesms.TextSecureExpiredException;
|
||||
import org.thoughtcrime.securesms.mms.OutgoingLegacyMmsConnection;
|
||||
import org.whispersystems.textsecure.api.util.InvalidNumberException;
|
||||
import org.whispersystems.textsecure.api.util.PhoneNumberFormatter;
|
||||
@@ -202,6 +197,19 @@ public class Util {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static <T> List<List<T>> partition(List<T> list, int partitionSize) {
|
||||
List<List<T>> results = new LinkedList<>();
|
||||
|
||||
for (int index=0;index<list.size();index+=partitionSize) {
|
||||
int offset = index * partitionSize;
|
||||
int subListSize = Math.min(partitionSize, list.size() - offset);
|
||||
|
||||
results.add(list.subList(offset, offset + subListSize));
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
public static List<String> split(String source, String delimiter) {
|
||||
List<String> results = new LinkedList<>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user