Fail-safe

This commit is contained in:
M66B 2020-03-23 19:48:43 +01:00
parent 7710722b0a
commit bc811325ab
1 changed files with 19 additions and 16 deletions

View File

@ -343,7 +343,8 @@ class ImageHelper {
lld.setLevel(1);
boolean slow = true;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
try {
// 2G GSM ~14.4 Kbps
// G GPRS ~26.8 Kbps
// E EDGE ~108.8 Kbps
@ -359,6 +360,8 @@ class ImageHelper {
int kbps = caps.getLinkDownstreamBandwidthKbps();
slow = (kbps < SLOW_CONNECTION);
}
} catch (Throwable ex) {
Log.e(ex);
}
ExecutorService executor = (slow ? executor_1 : executor_n);