Replace getLocationData() with getFileMetadata(true)

This commit is contained in:
misaochan 2016-09-17 17:44:07 +12:00
parent 333a0e0510
commit 5102507fc8

View file

@ -104,7 +104,7 @@ public class ShareActivity
private void uploadBegins() { private void uploadBegins() {
getFileMetadata(); getFileMetadata(true);
Toast startingToast = Toast.makeText(getApplicationContext(), R.string.uploading_started, Toast.LENGTH_LONG); Toast startingToast = Toast.makeText(getApplicationContext(), R.string.uploading_started, Toast.LENGTH_LONG);
startingToast.show(); startingToast.show();
@ -292,10 +292,9 @@ public class ShareActivity
}).show(); }).show();
} }
} else if (useNewPermissions && storagePermission && !locationPermission) { } else if (useNewPermissions && storagePermission && !locationPermission) {
getFileMetadata(); getFileMetadata(true);
} else if(!useNewPermissions || (storagePermission && locationPermission)) { } else if(!useNewPermissions || (storagePermission && locationPermission)) {
getFileMetadata(); getFileMetadata(true);
getLocationData();
} }
} }
@ -308,7 +307,7 @@ public class ShareActivity
case 1: { case 1: {
if (grantResults.length > 0 if (grantResults.length > 0
&& grantResults[0] == PackageManager.PERMISSION_GRANTED) { && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
getFileMetadata(); getFileMetadata(true);
} }
return; return;
} }
@ -316,7 +315,7 @@ public class ShareActivity
case 2: { case 2: {
if (grantResults.length > 0 if (grantResults.length > 0
&& grantResults[0] == PackageManager.PERMISSION_GRANTED) { && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
getLocationData(); getFileMetadata(false);
} }
return; return;
} }
@ -324,11 +323,11 @@ public class ShareActivity
case 3: { case 3: {
if (grantResults.length > 1 if (grantResults.length > 1
&& grantResults[0] == PackageManager.PERMISSION_GRANTED) { && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
getFileMetadata(); getFileMetadata(true);
} }
if (grantResults.length > 1 if (grantResults.length > 1
&& grantResults[1] == PackageManager.PERMISSION_GRANTED) { && grantResults[1] == PackageManager.PERMISSION_GRANTED) {
getLocationData(); getFileMetadata(false);
} }
return; return;
} }
@ -339,7 +338,7 @@ public class ShareActivity
&& grantResults[0] == PackageManager.PERMISSION_GRANTED) { && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
//It is OK to call this at both (1) and (4) because if perm had been granted at //It is OK to call this at both (1) and (4) because if perm had been granted at
//snackbar, user should not be prompted at submit button //snackbar, user should not be prompted at submit button
getFileMetadata(); getFileMetadata(true);
//Uploading only begins if storage permission granted from arrow icon //Uploading only begins if storage permission granted from arrow icon
uploadBegins(); uploadBegins();
@ -359,7 +358,7 @@ public class ShareActivity
} }
if (filePath != null && !filePath.equals("")) { if (filePath != null && !filePath.equals("")) {
// Gets image coords from exif data // Gets image coords from exif data or user location
decimalCoords = imageObj.getCoords(gpsEnabled); decimalCoords = imageObj.getCoords(gpsEnabled);
useImageCoords(); useImageCoords();
} }