mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 21:03:54 +01:00
Remove unnecessary context var
This commit is contained in:
parent
df7a944c78
commit
927ceb9aba
2 changed files with 3 additions and 7 deletions
|
|
@ -106,7 +106,7 @@ public class FileProcessor implements SimilarImageDialogFragment.onResponse {
|
||||||
ParcelFileDescriptor descriptor = contentResolver.openFileDescriptor(mediaUri, "r");
|
ParcelFileDescriptor descriptor = contentResolver.openFileDescriptor(mediaUri, "r");
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||||
if (descriptor != null) {
|
if (descriptor != null) {
|
||||||
imageObj = new GPSExtractor(descriptor.getFileDescriptor(), context, prefs);
|
imageObj = new GPSExtractor(descriptor.getFileDescriptor(), prefs);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
String filePath = getPathOfMediaOrCopy();
|
String filePath = getPathOfMediaOrCopy();
|
||||||
|
|
@ -161,7 +161,7 @@ public class FileProcessor implements SimilarImageDialogFragment.onResponse {
|
||||||
}
|
}
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||||
if (descriptor != null) {
|
if (descriptor != null) {
|
||||||
tempImageObj = new GPSExtractor(descriptor.getFileDescriptor(), context, prefs);
|
tempImageObj = new GPSExtractor(descriptor.getFileDescriptor(), prefs);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (filePath != null) {
|
if (filePath != null) {
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,6 @@ import timber.log.Timber;
|
||||||
*/
|
*/
|
||||||
public class GPSExtractor {
|
public class GPSExtractor {
|
||||||
|
|
||||||
private final Context context;
|
|
||||||
private SharedPreferences prefs;
|
private SharedPreferences prefs;
|
||||||
private ExifInterface exif;
|
private ExifInterface exif;
|
||||||
private double decLatitude;
|
private double decLatitude;
|
||||||
|
|
@ -38,11 +37,9 @@ public class GPSExtractor {
|
||||||
/**
|
/**
|
||||||
* Construct from the file descriptor of the image (only for API 24 or newer).
|
* Construct from the file descriptor of the image (only for API 24 or newer).
|
||||||
* @param fileDescriptor the file descriptor of the image
|
* @param fileDescriptor the file descriptor of the image
|
||||||
* @param context the context
|
|
||||||
*/
|
*/
|
||||||
@RequiresApi(24)
|
@RequiresApi(24)
|
||||||
public GPSExtractor(@NonNull FileDescriptor fileDescriptor, Context context, SharedPreferences prefs) {
|
public GPSExtractor(@NonNull FileDescriptor fileDescriptor, SharedPreferences prefs) {
|
||||||
this.context = context;
|
|
||||||
this.prefs = prefs;
|
this.prefs = prefs;
|
||||||
try {
|
try {
|
||||||
exif = new ExifInterface(fileDescriptor);
|
exif = new ExifInterface(fileDescriptor);
|
||||||
|
|
@ -63,7 +60,6 @@ public class GPSExtractor {
|
||||||
} catch (IOException | IllegalArgumentException e) {
|
} catch (IOException | IllegalArgumentException e) {
|
||||||
Timber.w(e);
|
Timber.w(e);
|
||||||
}
|
}
|
||||||
this.context = context;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue