import java.io.FileOutputStream;

import android.app.Service;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.AsyncTask;
import android.os.IBinder;

public class FileService extends Service {
    public static String KEY_LOCAL_FILE = "local_file";
     /**
     * Service initialization
     */
    @Override
    public void onCreate() {
        super.onCreate();
    }

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        String localPath = intent.getStringExtra(KEY_LOCAL_FILE);
        CopyAndUploadContentUrisTask copyTask = new CopyAndUploadContentUrisTask();

        copyTask.execute(
            copyTask.makeParamsToExecute(localPath)
        );
        return 2;
    }

    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }

    public class CopyAndUploadContentUrisTask extends AsyncTask<Object, Void, String> {
        public Object[] makeParamsToExecute(
            String sourceUri
        ) {
            return new Object[] {
                sourceUri
            };
        }

        @Override
        protected String doInBackground(Object[] params) {
            FileOutputStream outputStream = null;

            try {
                String[] uris = (String[]) params[1];
                outputStream = new FileOutputStream(uris[0]);
                return "success";
            } catch (Exception e) {
            }
            return "failure";
        }

        @Override
        protected void onPostExecute(String result) {
        }

        @Override
        protected void onPreExecute() {
        }

        @Override
        protected void onProgressUpdate(Void... values) {
        }
    }
}

@@ -26,16 +26,42 @@
 Stream;%0A
+import android.os.IBinder;
 %0Aimport 
@@ -194,35 +194,8 @@
 ask;
-%0Aimport android.os.IBinder;
 %0A%0Apu
@@ -768,93 +768,8 @@
  %7D%0A%0A
-    @Override%0A    public IBinder onBind(Intent intent) %7B%0A        return null;%0A    %7D%0A%0A
     
@@ -1654,11 +1654,96 @@
  %7D%0A    %7D
+%0A%0A    @Override%0A    public IBinder onBind(Intent intent) %7B%0A        return null;%0A    %7D
 %0A%7D%0A

update FileService