Update logic on deciding whether to bulk animate stickers.

This commit is contained in:
Greyson Parrelli
2021-01-25 13:49:16 -05:00
parent 17fb815805
commit 073034dd3c
3 changed files with 66 additions and 29 deletions

View File

@@ -17,6 +17,7 @@ import org.thoughtcrime.securesms.BuildConfig;
import org.thoughtcrime.securesms.util.AppSignatureUtil;
import org.thoughtcrime.securesms.util.ByteUnit;
import org.thoughtcrime.securesms.util.CensorshipUtil;
import org.thoughtcrime.securesms.util.DeviceProperties;
import org.thoughtcrime.securesms.util.ServiceUtil;
import org.thoughtcrime.securesms.util.TextSecurePreferences;
import org.thoughtcrime.securesms.util.Util;
@@ -54,6 +55,7 @@ public class LogSectionSystemInfo implements LogSection {
builder.append("ABIs : ").append(TextUtils.join(", ", getSupportedAbis())).append("\n");
builder.append("Memory : ").append(getMemoryUsage()).append("\n");
builder.append("Memclass : ").append(getMemoryClass(context)).append("\n");
builder.append("MemInfo : ").append(getMemoryInfo(context)).append("\n");
builder.append("OS Host : ").append(Build.HOST).append("\n");
builder.append("Censored : ").append(CensorshipUtil.isCensored(context)).append("\n");
builder.append("Play Services : ").append(getPlayServicesString(context)).append("\n");
@@ -102,6 +104,12 @@ public class LogSectionSystemInfo implements LogSection {
return activityManager.getMemoryClass() + lowMem;
}
private static @NonNull String getMemoryInfo(Context context) {
ActivityManager.MemoryInfo info = DeviceProperties.getMemoryInfo(context);
return String.format(Locale.US, "availMem: %d mb, totalMem: %d mb, threshold: %d mb, lowMemory: %b",
ByteUnit.BYTES.toMegabytes(info.availMem), ByteUnit.BYTES.toMegabytes(info.totalMem), ByteUnit.BYTES.toMegabytes(info.threshold), info.lowMemory);
}
private static @NonNull Iterable<String> getSupportedAbis() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
return Arrays.asList(Build.SUPPORTED_ABIS);