import java.util.HashMap;
import java.util.Map;
+import com.owncloud.android.MainApp;
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.db.ProviderMeta.ProviderTableMeta;
@Override
public void onDestroy() {
- super.onDestroy();
unregisterReceiver(mDownloadReceiver);
mObserversMap = null; // TODO study carefully the life cycle of Services to grant the best possible observance
Log_OC.d(TAG, "Bye, bye");
+ super.onDestroy();
}
null);
if (c == null || !c.moveToFirst()) return;
AccountManager acm = AccountManager.get(this);
- Account[] accounts = acm.getAccounts();
+ Account[] accounts = acm.getAccountsByType(MainApp.getAccountType());
do {
Account account = null;
for (Account a : accounts)
OwnCloudFileObserver observer =
new OwnCloudFileObserver( path,
account,
- getApplicationContext(),
- OwnCloudFileObserver.CHANGES_ONLY);
+ getApplicationContext());
mObserversMap.put(path, observer);
if (new File(path).exists()) {
observer.startWatching();
/// the local file was never registered to observe before
observer = new OwnCloudFileObserver( localPath,
account,
- getApplicationContext(),
- OwnCloudFileObserver.CHANGES_ONLY);
+ getApplicationContext());
mObserversMap.put(localPath, observer);
Log_OC.d(TAG, "Observer added for path " + localPath);