diff --git a/src/main/java/com/owncloud/android/services/OperationsService.java b/src/main/java/com/owncloud/android/services/OperationsService.java index 9e13fd7c420d..19cca43f3d7e 100644 --- a/src/main/java/com/owncloud/android/services/OperationsService.java +++ b/src/main/java/com/owncloud/android/services/OperationsService.java @@ -37,7 +37,6 @@ import android.text.TextUtils; import android.util.Pair; -import com.nextcloud.client.account.UserAccountManager; import com.owncloud.android.MainApp; import com.owncloud.android.datamodel.FileDataStorageManager; import com.owncloud.android.datamodel.OCFile; @@ -75,8 +74,6 @@ import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.ConcurrentMap; -import javax.inject.Inject; - import dagger.android.AndroidInjection; public class OperationsService extends Service { @@ -136,8 +133,6 @@ public class OperationsService extends Service { private ConcurrentMap> mUndispatchedFinishedOperations = new ConcurrentHashMap<>(); - @Inject UserAccountManager accountManager; - private static class Target { public Uri mServerUrl; public Account mAccount; @@ -163,7 +158,7 @@ public void onCreate() { HandlerThread thread = new HandlerThread("Operations thread", Process.THREAD_PRIORITY_BACKGROUND); thread.start(); - mOperationsHandler = new ServiceHandler(thread.getLooper(), this, accountManager); + mOperationsHandler = new ServiceHandler(thread.getLooper(), this); mOperationsBinder = new OperationsServiceBinder(mOperationsHandler); // Separated worker thread for download of folders (WIP) @@ -399,16 +394,14 @@ private static class ServiceHandler extends Handler { private Target mLastTarget; private OwnCloudClient mOwnCloudClient; private FileDataStorageManager mStorageManager; - private UserAccountManager accountManager; - public ServiceHandler(Looper looper, OperationsService service, UserAccountManager accountManager) { + public ServiceHandler(Looper looper, OperationsService service) { super(looper); if (service == null) { throw new IllegalArgumentException("Received invalid NULL in parameter 'service'"); } mService = service; - this.accountManager = accountManager; } @Override diff --git a/src/main/java/com/owncloud/android/ui/activities/data/activities/ActivitiesServiceApiImpl.java b/src/main/java/com/owncloud/android/ui/activities/data/activities/ActivitiesServiceApiImpl.java index 987f0c2320fc..8492c655699c 100644 --- a/src/main/java/com/owncloud/android/ui/activities/data/activities/ActivitiesServiceApiImpl.java +++ b/src/main/java/com/owncloud/android/ui/activities/data/activities/ActivitiesServiceApiImpl.java @@ -28,7 +28,6 @@ import android.content.Context; import android.os.AsyncTask; -import com.nextcloud.client.account.User; import com.nextcloud.client.account.UserAccountManager; import com.nextcloud.common.NextcloudClient; import com.owncloud.android.MainApp; @@ -59,9 +58,7 @@ public ActivitiesServiceApiImpl(UserAccountManager accountManager) { @Override public void getAllActivities(int lastGiven, ActivitiesServiceCallback> callback) { - User user = accountManager.getUser(); - GetActivityListTask getActivityListTask = new GetActivityListTask(user.toPlatformAccount(), - accountManager, + GetActivityListTask getActivityListTask = new GetActivityListTask(accountManager.getUser().toPlatformAccount(), lastGiven, callback); getActivityListTask.execute(); @@ -72,17 +69,14 @@ private static class GetActivityListTask extends AsyncTask private final ActivitiesServiceCallback> callback; private List activities; private Account account; - private UserAccountManager accountManager; private int lastGiven; private String errorMessage; private NextcloudClient client; private GetActivityListTask(Account account, - UserAccountManager accountManager, int lastGiven, ActivitiesServiceCallback> callback) { this.account = account; - this.accountManager = accountManager; this.lastGiven = lastGiven; this.callback = callback; activities = new ArrayList<>();