diff --git a/app/src/main/java/fr/free/nrw/commons/upload/FileProcessor.java b/app/src/main/java/fr/free/nrw/commons/upload/FileProcessor.java index 2845b8d1f..561648b60 100644 --- a/app/src/main/java/fr/free/nrw/commons/upload/FileProcessor.java +++ b/app/src/main/java/fr/free/nrw/commons/upload/FileProcessor.java @@ -106,7 +106,7 @@ public class FileProcessor implements SimilarImageDialogFragment.onResponse { ParcelFileDescriptor descriptor = contentResolver.openFileDescriptor(mediaUri, "r"); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { if (descriptor != null) { - imageObj = new GPSExtractor(descriptor.getFileDescriptor(), context, prefs); + imageObj = new GPSExtractor(descriptor.getFileDescriptor(), prefs); } } else { String filePath = getPathOfMediaOrCopy(); @@ -161,7 +161,7 @@ public class FileProcessor implements SimilarImageDialogFragment.onResponse { } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { if (descriptor != null) { - tempImageObj = new GPSExtractor(descriptor.getFileDescriptor(), context, prefs); + tempImageObj = new GPSExtractor(descriptor.getFileDescriptor(), prefs); } } else { if (filePath != null) { diff --git a/app/src/main/java/fr/free/nrw/commons/upload/GPSExtractor.java b/app/src/main/java/fr/free/nrw/commons/upload/GPSExtractor.java index fcbb17ac5..4923730fa 100644 --- a/app/src/main/java/fr/free/nrw/commons/upload/GPSExtractor.java +++ b/app/src/main/java/fr/free/nrw/commons/upload/GPSExtractor.java @@ -24,7 +24,6 @@ import timber.log.Timber; */ public class GPSExtractor { - private final Context context; private SharedPreferences prefs; private ExifInterface exif; private double decLatitude; @@ -38,11 +37,9 @@ public class GPSExtractor { /** * Construct from the file descriptor of the image (only for API 24 or newer). * @param fileDescriptor the file descriptor of the image - * @param context the context */ @RequiresApi(24) - public GPSExtractor(@NonNull FileDescriptor fileDescriptor, Context context, SharedPreferences prefs) { - this.context = context; + public GPSExtractor(@NonNull FileDescriptor fileDescriptor, SharedPreferences prefs) { this.prefs = prefs; try { exif = new ExifInterface(fileDescriptor); @@ -63,7 +60,6 @@ public class GPSExtractor { } catch (IOException | IllegalArgumentException e) { Timber.w(e); } - this.context = context; } /**