Refactoring

pull/203/head
M66B 3 years ago
parent e72c3dbef5
commit 982eeb7043

@ -1334,15 +1334,16 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
final boolean capUtf8 = final boolean capUtf8 =
iservice.hasCapability("UTF8=ACCEPT") || iservice.hasCapability("UTF8=ACCEPT") ||
iservice.hasCapability("UTF8=ONLY"); iservice.hasCapability("UTF8=ONLY");
Log.i(account.name + " idle=" + capIdle);
if (!capIdle || account.poll_interval < OPTIMIZE_KEEP_ALIVE_INTERVAL)
optimizeAccount(account, "IDLE");
final boolean capNotify = iservice.hasCapability("NOTIFY"); final boolean capNotify = iservice.hasCapability("NOTIFY");
String capabilities = TextUtils.join(" ", iservice.getCapabilities()); String capabilities = TextUtils.join(" ", iservice.getCapabilities());
if (capabilities.length() > 500) if (capabilities.length() > 500)
capabilities = capabilities.substring(0, 500) + "..."; capabilities = capabilities.substring(0, 500) + "...";
Log.i(account.name + " idle=" + capIdle);
if (!capIdle || account.poll_interval < OPTIMIZE_KEEP_ALIVE_INTERVAL)
optimizeAccount(account, "IDLE");
db.account().setAccountState(account.id, "connected"); db.account().setAccountState(account.id, "connected");
db.account().setAccountCapabilities(account.id, capabilities, capIdle, capUtf8); db.account().setAccountCapabilities(account.id, capabilities, capIdle, capUtf8);
db.account().setAccountError(account.id, null); db.account().setAccountError(account.id, null);

Loading…
Cancel
Save