Fix uploads getting stuck (#2309)

* Fix uploads getting stuck

* Fix test

* Use single instance of Gson across the app

* More logs to help debug upload failure

* Add request identifier

* wip

* Fix issues with image quality check dialogs
This commit is contained in:
Vivek Maskara 2019-01-24 13:26:18 +05:30 committed by Josephine Lim
parent 07f9af19f5
commit 532ab8aeae
16 changed files with 85 additions and 91 deletions

View file

@ -12,21 +12,13 @@ import static fr.free.nrw.commons.contributions.ContributionController.NEARBY_GA
public class IntentUtils {
/**
* Check if the intent should be handled by nearby list or map fragment
*/
public static boolean shouldNearbyHandle(int requestCode, int resultCode, Intent data) {
return resultCode == Activity.RESULT_OK
&& (requestCode == NEARBY_CAMERA_UPLOAD_REQUEST_CODE || requestCode == NEARBY_GALLERY_UPLOAD_REQUEST_CODE)
&& data != null;
}
/**
* Check if the intent should be handled by contributions list fragment
*/
public static boolean shouldContributionsListHandle(int requestCode, int resultCode, Intent data) {
public static boolean shouldContributionsHandle(int requestCode, int resultCode, Intent data) {
return resultCode == Activity.RESULT_OK
&& (requestCode == GALLERY_UPLOAD_REQUEST_CODE || requestCode == CAMERA_UPLOAD_REQUEST_CODE)
&& (requestCode == GALLERY_UPLOAD_REQUEST_CODE || requestCode == CAMERA_UPLOAD_REQUEST_CODE
|| requestCode == NEARBY_CAMERA_UPLOAD_REQUEST_CODE || requestCode == NEARBY_GALLERY_UPLOAD_REQUEST_CODE)
&& data != null;
}