Remove boolean useGPS entirely

This commit is contained in:
misaochan 2018-06-23 20:03:13 +10:00
parent 0b58e28ba5
commit fe3dda18ce
3 changed files with 6 additions and 12 deletions

View file

@ -115,7 +115,7 @@ public class FileProcessor implements SimilarImageDialogFragment.onResponse {
}
}
decimalCoords = imageObj.getCoords(gpsEnabled);
decimalCoords = imageObj.getCoords();
if (decimalCoords == null || !imageObj.imageCoordsExists) {
//Find other photos taken around the same time which has gps coordinates
if (!haveCheckedForOtherImages)
@ -170,8 +170,8 @@ public class FileProcessor implements SimilarImageDialogFragment.onResponse {
}
if (tempImageObj != null) {
Timber.d("not null fild EXIF" + tempImageObj.imageCoordsExists + " coords" + tempImageObj.getCoords(gpsEnabled));
if (tempImageObj.getCoords(gpsEnabled) != null && tempImageObj.imageCoordsExists) {
Timber.d("not null fild EXIF" + tempImageObj.imageCoordsExists + " coords" + tempImageObj.getCoords());
if (tempImageObj.getCoords() != null && tempImageObj.imageCoordsExists) {
// Current image has gps coordinates and it's not current gps locaiton
Timber.d("This file has image coords:" + file.getAbsolutePath());
SimilarImageDialogFragment newFragment = new SimilarImageDialogFragment();
@ -250,7 +250,7 @@ public class FileProcessor implements SimilarImageDialogFragment.onResponse {
@Override
public void onPositiveResponse() {
imageObj = tempImageObj;
decimalCoords = imageObj.getCoords(false);// Not necessary to use gps as image already ha EXIF data
decimalCoords = imageObj.getCoords();// Not necessary to use gps as image already ha EXIF data
Timber.d("EXIF from tempImageObj");
useImageCoords();
}

View file

@ -1,10 +1,7 @@
package fr.free.nrw.commons.upload;
import android.content.SharedPreferences;
import android.location.Location;
import android.location.LocationListener;
import android.media.ExifInterface;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.RequiresApi;
@ -24,8 +21,6 @@ public class GPSExtractor {
private ExifInterface exif;
private double decLatitude;
private double decLongitude;
private Double currentLatitude = null;
private Double currentLongitude = null;
public boolean imageCoordsExists;
/**
@ -58,11 +53,10 @@ public class GPSExtractor {
/**
* Extracts geolocation (either of image from EXIF data, or of user)
* @param useGPS set to true if location permissions allowed (by API 23), false if disallowed
* @return coordinates as string (needs to be passed as a String in API query)
*/
@Nullable
public String getCoords(boolean useGPS) {
public String getCoords() {
String latitude;
String longitude;
String latitudeRef;

View file

@ -340,7 +340,7 @@ public class MultipleShareActivity extends AuthenticatedActivity
if (gpsExtractor != null) {
//get image coordinates from exif data or user location
return gpsExtractor.getCoords(locationPermitted);
return gpsExtractor.getCoords();
}
} catch (FileNotFoundException fnfe) {