Added capabilities to account

This commit is contained in:
M66B
2018-08-06 16:22:01 +00:00
parent a63a5767c1
commit 0069c4e9d7
7 changed files with 714 additions and 10 deletions

View File

@@ -334,9 +334,19 @@ public class ServiceSynchronize extends LifecycleService {
public void opened(ConnectionEvent e) {
Log.i(Helper.TAG, account.name + " opened");
try {
DB db = DB.getInstance(ServiceSynchronize.this);
List<String> capabilities = new ArrayList<>();
if (fstore.hasCapability("IDLE"))
capabilities.add("IDLE");
if (fstore.hasCapability("MOVE"))
capabilities.add("MOVE");
account.capabilities = capabilities.toArray(new String[0]);
db.account().updateAccount(account);
Log.i(Helper.TAG, "capabilities=" + TextUtils.join(",", capabilities));
synchronizeFolders(account, fstore);
DB db = DB.getInstance(ServiceSynchronize.this);
for (final EntityFolder folder : db.folder().getFolders(account.id, true)) {
Log.i(Helper.TAG, account.name + " sync folder " + folder.name);
Thread thread = new Thread(new Runnable() {