i.putExtra(FileUploader.KEY_INSTANT_UPLOAD, true);
// instant upload behaviour
+ i = addInstantUploadBehaviour(i, context);
+
+ context.startService(i);
+ }
+
+ private Intent addInstantUploadBehaviour(Intent i, Context context){
SharedPreferences appPreferences = PreferenceManager.getDefaultSharedPreferences(context);
String behaviour = appPreferences.getString("prefs_instant_behaviour", "NOTHING");
Log_OC.d(TAG, "upload file and delete file in original place");
}
- context.startService(i);
+ return i;
}
private void handleNewVideoAction(Context context, Intent intent) {
i.putExtra(FileUploader.KEY_INSTANT_UPLOAD, true);
// instant upload behaviour
- SharedPreferences appPreferences = PreferenceManager.getDefaultSharedPreferences(context);
- String behaviour = appPreferences.getString("prefs_instant_behaviour", "NOTHING");
-
- if (behaviour.equalsIgnoreCase("NOTHING")) {
- Log_OC.d(TAG, "upload file and do nothing");
- i.putExtra(FileUploader.KEY_LOCAL_BEHAVIOUR, FileUploader.LOCAL_BEHAVIOUR_FORGET);
- } else if (behaviour.equalsIgnoreCase("COPY")) {
- i.putExtra(FileUploader.KEY_LOCAL_BEHAVIOUR, FileUploader.LOCAL_BEHAVIOUR_COPY);
- Log_OC.d(TAG, "upload file and copy file to oc folder");
- } else if (behaviour.equalsIgnoreCase("MOVE")) {
- i.putExtra(FileUploader.KEY_LOCAL_BEHAVIOUR, FileUploader.LOCAL_BEHAVIOUR_MOVE);
- Log_OC.d(TAG, "upload file and move file to oc folder");
- } else if (behaviour.equalsIgnoreCase("DELETE")){
- i.putExtra(FileUploader.KEY_LOCAL_BEHAVIOUR, FileUploader.LOCAL_BEHAVIOUR_REMOVE);
- Log_OC.d(TAG, "upload file and delete file in original place");
- }
+ i = addInstantUploadBehaviour(i, context);
context.startService(i);
i.putExtra(FileUploader.KEY_INSTANT_UPLOAD, true);
// instant upload behaviour
- SharedPreferences appPreferences = PreferenceManager.getDefaultSharedPreferences(context);
- String behaviour = appPreferences.getString("prefs_instant_behaviour", "NOTHING");
-
- if (behaviour.equalsIgnoreCase("NOTHING")) {
- Log_OC.d(TAG, "upload file and do nothing");
- i.putExtra(FileUploader.KEY_LOCAL_BEHAVIOUR, FileUploader.LOCAL_BEHAVIOUR_FORGET);
- } else if (behaviour.equalsIgnoreCase("COPY")) {
- i.putExtra(FileUploader.KEY_LOCAL_BEHAVIOUR, FileUploader.LOCAL_BEHAVIOUR_COPY);
- Log_OC.d(TAG, "upload file and copy file to oc folder");
- } else if (behaviour.equalsIgnoreCase("MOVE")) {
- i.putExtra(FileUploader.KEY_LOCAL_BEHAVIOUR, FileUploader.LOCAL_BEHAVIOUR_MOVE);
- Log_OC.d(TAG, "upload file and move file to oc folder");
- } else if (behaviour.equalsIgnoreCase("DELETE")){
- i.putExtra(FileUploader.KEY_LOCAL_BEHAVIOUR, FileUploader.LOCAL_BEHAVIOUR_REMOVE);
- Log_OC.d(TAG, "upload file and delete file in original place");
- }
+ i = addInstantUploadBehaviour(i, context);
context.startService(i);