From 3e3956936b9f4090e1bf7ca50ee7f55d4004fe27 Mon Sep 17 00:00:00 2001 From: misaochan Date: Fri, 25 May 2018 20:26:07 +1000 Subject: [PATCH] Simplify formatting --- .../nrw/commons/upload/ShareActivity.java | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/fr/free/nrw/commons/upload/ShareActivity.java b/app/src/main/java/fr/free/nrw/commons/upload/ShareActivity.java index a3f017fe2..dd6631fa2 100644 --- a/app/src/main/java/fr/free/nrw/commons/upload/ShareActivity.java +++ b/app/src/main/java/fr/free/nrw/commons/upload/ShareActivity.java @@ -460,7 +460,7 @@ public class ShareActivity },mwApi); fileAsyncTask.execute(); } catch (IOException e) { - Timber.d(e, "IO Exception: "); + Timber.e(e, "IO Exception: "); } } } else { @@ -479,8 +479,8 @@ public class ShareActivity detectUnwantedPicturesAsync.execute(); } - /* - * to display permission snackbar in share activity + /** + * Displays Snackbar to ask for location permissions */ private Snackbar requestPermissionUsingSnackBar(String rationale, final String[] perms, @@ -502,23 +502,18 @@ public class ShareActivity // TODO: there might be a more proper solution than this String copyPath = null; try { - ParcelFileDescriptor descriptor - = getContentResolver().openFileDescriptor(mediaUri, "r"); + ParcelFileDescriptor descriptor = getContentResolver().openFileDescriptor(mediaUri, "r"); if (descriptor != null) { boolean useExtStorage = prefs.getBoolean("useExternalStorage", true); if (useExtStorage) { - copyPath = Environment.getExternalStorageDirectory().toString() - + "/CommonsApp/" + new Date().getTime() + ".jpg"; + copyPath = Environment.getExternalStorageDirectory().toString() + "/CommonsApp/" + new Date().getTime() + ".jpg"; File newFile = new File(Environment.getExternalStorageDirectory().toString() + "/CommonsApp"); newFile.mkdir(); - FileUtils.copy( - descriptor.getFileDescriptor(), - copyPath); + FileUtils.copy(descriptor.getFileDescriptor(), copyPath); Timber.d("Filepath (copied): %s", copyPath); return copyPath; } - copyPath = getApplicationContext().getCacheDir().getAbsolutePath() - + "/" + new Date().getTime() + ".jpg"; + copyPath = getApplicationContext().getCacheDir().getAbsolutePath() + "/" + new Date().getTime() + ".jpg"; FileUtils.copy( descriptor.getFileDescriptor(), copyPath); @@ -622,9 +617,7 @@ public class ShareActivity newFragment.show(fragmentManager, "dialog"); break; } - } - } } haveCheckedForOtherImages = true; //Finished checking for other images