|
@@ -1,48 +1,26 @@
|
|
|
package com.owncloud.android.services;
|
|
|
|
|
|
-import android.accounts.Account;
|
|
|
import android.app.Service;
|
|
|
import android.content.Intent;
|
|
|
-import android.os.Bundle;
|
|
|
-import android.os.Handler;
|
|
|
import android.os.IBinder;
|
|
|
-import android.os.Message;
|
|
|
-import android.os.RemoteException;
|
|
|
-import android.util.Log;
|
|
|
-import android.widget.Toast;
|
|
|
-
|
|
|
-import com.owncloud.android.authentication.AccountUtils;
|
|
|
-import com.owncloud.android.lib.common.OwnCloudAccount;
|
|
|
-import com.owncloud.android.lib.common.OwnCloudClient;
|
|
|
-import com.owncloud.android.lib.common.OwnCloudClientManagerFactory;
|
|
|
-import com.owncloud.android.lib.common.utils.Log_OC;
|
|
|
-import com.owncloud.android.ui.activity.FileDisplayActivity;
|
|
|
-import com.owncloud.android.ui.asynctasks.AsyncTaskHelper;
|
|
|
-
|
|
|
-import org.apache.commons.httpclient.NameValuePair;
|
|
|
-import org.apache.commons.httpclient.methods.DeleteMethod;
|
|
|
-import org.apache.commons.httpclient.methods.GetMethod;
|
|
|
-import org.apache.commons.httpclient.methods.PostMethod;
|
|
|
-import org.apache.commons.httpclient.methods.PutMethod;
|
|
|
-import org.apache.commons.httpclient.methods.StringRequestEntity;
|
|
|
-import org.apache.commons.io.IOUtils;
|
|
|
-
|
|
|
-import java.io.IOException;
|
|
|
-import java.io.InputStream;
|
|
|
-import java.io.OutputStream;
|
|
|
-import java.net.InetSocketAddress;
|
|
|
-import java.net.Socket;
|
|
|
-import java.net.SocketAddress;
|
|
|
-import java.util.Map;
|
|
|
|
|
|
import de.luhmer.owncloud.accountimporter.helper.InputStreamBinder;
|
|
|
-import de.luhmer.owncloud.accountimporter.helper.NextcloudRequest;
|
|
|
|
|
|
public class AccountManagerService extends Service {
|
|
|
|
|
|
+ private InputStreamBinder mBinder;
|
|
|
+
|
|
|
@Override
|
|
|
public IBinder onBind(Intent intent) {
|
|
|
- return (new InputStreamBinder(this));
|
|
|
+ if(mBinder == null) {
|
|
|
+ mBinder = new InputStreamBinder(this);
|
|
|
+ }
|
|
|
+ return mBinder;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public boolean onUnbind(Intent intent) {
|
|
|
+ return super.onUnbind(intent);
|
|
|
}
|
|
|
|
|
|
}
|