Commit graph

5849 commits

Author SHA1 Message Date
Ritika Pahwa
81030d1e78
5136: Fix retried uploads stuck in queued state (#5272)
* fix stuck uploads

* automate retries for failed uploads once the user returns to the app

* UploadWorker: modify PendingIntent flag and Android version code

* MainActivity: remove automatic retry logic

* Revert "MainActivity: remove automatic retry logic"

* set work request as expedited

* handle notification for foreground service on older versions of Android

* set backoff criteria for work requests

* enqueue failed uploads for a retry

* revert "enqueue failed uploads for a retry"

* limit the number of retries for a failed upload

* add a popup that suggests users to switch to unrestricted battery usage mode

* take users to the battery settings page on the first big upload

* take users to battery optimisation settings page using the standard intent

* add instructions to the battery optimisation settings popup

* remove the first usage of fr.free.nrw.commons from the popup

* comply with the wording in the OS settings

* modify battery optimisation popup instructions, add comments and rename firstBigUploadSet

* add filename to the retry log statement

* update database version

* make battery optimisation dialog appear only on Android 6 and above

* use foreground service instead of setting work request as expedited

* fix retried uploads stuck in queued state

* use MIN_BACKOFF_MILLIS constant instead of using the number 10 and add comments

* factorise the creation of the new OneTimeWorkRequest at one place

* ensure work requests are in accordance with the unit tests

* forbid retries for images which have got uploaded without caption

* add a TODO for the suggestion related to retries

* revert "forbid retries for images which have got uploaded without caption"
2023-09-09 22:46:13 +05:30
Kaartic Sivaraam
4540f54d59
Fix document picker trigger bug (#5275)
* Revert "Revert a1b6973 until we find out why it uses OPEN_DOCUMENT by default on fresh install"

This reverts commit 7ce3b7ebb1.

* Potential fix for get_content picker being used in first run

The initial state of the 'openDocumentPhotoPickerPref' seems to be incorrect
during a fresh install on some devices.

Try to ensure we always use the proper initial state by propagating the default
to the preference access code.

This hopefully fixes #5274
2023-09-04 11:18:58 +09:00
Nicolas Raoul
7ce3b7ebb1 Revert a1b6973 until we find out why it uses OPEN_DOCUMENT by default on fresh install 2023-09-03 23:28:02 +09:00
Ritika Pahwa
5073ca08c3
5196: Fix in-app camera location loss (#5249)
Merging as this is a great improvement, additional issues/bugs can be filed as GitHub issues.

* fix in-app camera location loss

* fix failing unit tests

* UploadMediaDetailFragmentUnitTest: modify testOnActivityResultAddLocationDialog to have null location

* reintroduce removed variable

* enable prePopulateCategoriesAndDepictionsBy for current user location

* add relevant comment and fix failing test

* modify dialog and disable location tag redaction from EXIF

* modify in-app camera dialog flow and change location to inAppPictureLocation

* change location to inAppPictureLocation

* fix location flow

* preferences.xml: remove redundant default value

* inform users about location loss happening for first upload

* FileProcessor.kt: remove commented-out code

* prevent user location from getting attached to images with no EXIF location in normal and custom selector

* handle onPermissionDenied for location permission

* remove last location when the user turns the GPS off

* disable photo picker and in app camera preferences in settings for logged-out users

* remove debug statements and add toast inside runnables
2023-09-01 15:45:50 +09:00
translatewiki.net
1cab938d81 Localisation updates from https://translatewiki.net. 2023-08-31 13:02:53 +02:00
translatewiki.net
dc608ed8f5 Localisation updates from https://translatewiki.net. 2023-08-28 13:04:14 +02:00
translatewiki.net
f561b2c199 Localisation updates from https://translatewiki.net. 2023-08-24 13:03:20 +02:00
translatewiki.net
9d5deed58f Localisation updates from https://translatewiki.net. 2023-08-21 13:02:20 +02:00
translatewiki.net
a620cc9de6 Localisation updates from https://translatewiki.net. 2023-08-17 13:03:15 +02:00
translatewiki.net
07f7b7e0a2 Localisation updates from https://translatewiki.net. 2023-08-14 13:03:22 +02:00
Matija Nalis
d2cd6df3ca
use correct geo: URI format (#5268)
(like OsmAnd, StreetComplete etc do), which works with all apps, and not only some.
2023-08-11 07:44:06 +09:00
translatewiki.net
4ec08e8325 Localisation updates from https://translatewiki.net. 2023-08-10 13:06:31 +02:00
translatewiki.net
bb2c1b0ba1 Localisation updates from https://translatewiki.net. 2023-08-07 13:02:08 +02:00
translatewiki.net
3ddd8448e8 Localisation updates from https://translatewiki.net. 2023-08-03 13:02:15 +02:00
translatewiki.net
0a9b431846 Localisation updates from https://translatewiki.net. 2023-07-31 13:02:22 +02:00
translatewiki.net
9e0c95172f Localisation updates from https://translatewiki.net. 2023-07-27 13:04:37 +02:00
Jean-Baptiste
7db72f90f4
Bump actions (#5229) 2023-07-25 17:53:24 +09:00
Kaartic Sivaraam
a1b6973614
Toggle photo picker switch behaviour and tweak phrases (#5250)
* photo picker: toggle behaviour of switch and adjust phrasing for better UX

The enable state used to trigger the GET_CONTENT intent. Alter the flow
such that the GET_CONTENT intent is triggered when switch is disabled.
Adjust default value and other parts of code naming to reflect this.

The existing phrasing had a lot of tech jargon in it which could
result in the non-technical users being confused. Tweak the phrasing
to avoid such phrases.

The documentation in the website could also use some follow up
improvements.

* Adjust strings to clearly convey that location loss is a "risk"
2023-07-25 17:48:53 +09:00
translatewiki.net
8a9aa962bc Localisation updates from https://translatewiki.net. 2023-07-24 13:02:46 +02:00
paco-arana
3f529e674f
Removed comma separator (#5261)
* Removed comma separator from file descriptions

* Removed a redundant line that deleted the last comma of the descriptions

* Added a line to formatDescriptions that replaces every instance of "}}, " with "}}" to remove the comma between descriptions.

* Specified separator as an empty string instead of default value ", " for .joinToString method. Deleted previous fix using .replace method.

* Restored buffer.replace() in updateDescription
2023-07-20 23:14:21 +09:00
translatewiki.net
cdb2e4278c Localisation updates from https://translatewiki.net. 2023-07-20 13:01:53 +02:00
translatewiki.net
d75f693435 Localisation updates from https://translatewiki.net. 2023-07-17 13:02:16 +02:00
translatewiki.net
b86a92ad11 Localisation updates from https://translatewiki.net. 2023-07-13 13:02:46 +02:00
translatewiki.net
0b25c07fcd Localisation updates from https://translatewiki.net. 2023-07-10 13:04:12 +02:00
translatewiki.net
5c0ed12491 Localisation updates from https://translatewiki.net. 2023-07-06 13:03:21 +02:00
AnkitThakur98
2593f4e1b6
Replaced junit.framework with org.junit (#5253) 2023-07-06 14:25:49 +09:00
Alfusainey Jallow
368e1c753d
Fix resource leak bug (#5251)
Signed-off-by: Alfusainey Jallow <alf.jallow@gmail.com>
2023-07-06 00:20:46 +05:30
translatewiki.net
532e5375c2 Localisation updates from https://translatewiki.net. 2023-07-03 13:02:59 +02:00
translatewiki.net
a4ef6bb3d3 Localisation updates from https://translatewiki.net. 2023-06-29 13:02:50 +02:00
translatewiki.net
fffb2ab175 Localisation updates from https://translatewiki.net. 2023-06-26 13:02:41 +02:00
translatewiki.net
95b4c3be82 Localisation updates from https://translatewiki.net. 2023-06-22 13:04:03 +02:00
Matija Nalis
b1a272ef49
allow running GitHub workflow manually (#5248) 2023-06-22 09:55:44 +05:30
Kaartic Sivaraam
f4e8de79fb
nearby: make sure places is initialized (#5241)
On taking a look at the following stack trace:

  java.lang.NullPointerException: Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference
  at fr.free.nrw.commons.nearby.fragments.NearbyParentFragment.updatePlaceList(NearbyParentFragment.java:777)
  at fr.free.nrw.commons.nearby.fragments.NearbyParentFragment.lambda$initFilterChips$10$NearbyParentFragment(NearbyParentFragment.java:730)
  at fr.free.nrw.commons.nearby.fragments.-$$Lambda$NearbyParentFragment$AGol6SoJlvIYd45Vbz6tTjDiWU4.onCheckedChanged(Unknown Source:2)
  at android.widget.CompoundButton.setChecked(CompoundButton.java:235)
  at com.google.android.material.chip.Chip.setChecked(Chip.java:665)
  at android.widget.CompoundButton.toggle(CompoundButton.java:150)
  ...

... it seems clear the 'places' list is trying to be iterated
in the updatePlaceList method when it is empty. This is resulting
in an NPE and consequently an app crash.

Avoid the same by ensuring it is always initialized to an empty list.
2023-06-19 20:23:20 +09:00
translatewiki.net
00b69c6731 Localisation updates from https://translatewiki.net. 2023-06-19 13:01:47 +02:00
Ritika Pahwa
4a9101c614
FilePickerTest: fix failing unit test (#5237) 2023-06-16 19:41:07 +09:00
Kaartic Sivaraam
4cb3b0cfe9
Reduce minSdk back to 21 (#5236)
Commit 0f0358f22 (Bump minSdk to 29, 2023-04-30) bumped the minSdk to
29 since it was found to be necessary for publishing the app to Play
Store.

On futher analysis[1], it seems like that might actually not be necessary.
The crux is:

  1. We (rightly) answer "No" to the Play Console question:

       "Does your app access location in the background in APKs or
        app bundles targeting Android 9 (Pie) or older (SDK level 28 or lower)?"

  2. We do not request for the ACCESS_BACKGROUND_LOCATION permission.

So, it should be safe for us to have the minSdkVersion as 21 itself. If
again we face any rejection of the app update, let us handle it at that
point. I clearly am not able to see any valid reason for Play store to
reject the app update.

[1]: https://github.com/commons-app/apps-android-commons/issues/5223#issuecomment-1569554999

Co-authored-by: Kaartic Sivaraam <kaartic.sn@zohocorp.com>
2023-06-16 15:52:15 +09:00
translatewiki.net
231b96d00e Localisation updates from https://translatewiki.net. 2023-06-15 13:04:03 +02:00
Ritika Pahwa
9a0f35c681
5196: Fix location stripped from EXIF metadata (#5227)
* MainActivity: add ACCESS_MEDIA_LOCATION permission check to retain location info in EXIF metadata

* remove redundant permission check and optimise imports

* FilePicker: switch to ACTION_OPEN_DOCUMENT intent for opening image files

* add a comment explaining the change

* implement GET_CONTENT photo picker toggle switch

* add location loss warning pop up

* SettingsFragment: modify the comment about GET_CONTENT takeover for more clarity
2023-06-15 10:05:55 +09:00
translatewiki.net
4d71c305f2 Localisation updates from https://translatewiki.net. 2023-06-12 13:11:57 +02:00
translatewiki.net
40f3e7fa7c Localisation updates from https://translatewiki.net. 2023-06-08 13:01:52 +02:00
tpettwa1
3f664d62f8
Added changes to readme.md + comments. (#5230)
* Update README.md

* Update LatLng.java

* Update LoginActivity.java

* Updated LoginActivity.java to feature javadoc syntax
2023-06-07 10:31:53 +09:00
translatewiki.net
cbc54c71d9 Localisation updates from https://translatewiki.net. 2023-06-05 13:01:39 +02:00
translatewiki.net
81fcc7bc0a Localisation updates from https://translatewiki.net. 2023-06-01 13:02:16 +02:00
translatewiki.net
55ce4c2515 Localisation updates from https://translatewiki.net. 2023-05-29 13:01:54 +02:00
translatewiki.net
e9b5bb8e7a Localisation updates from https://translatewiki.net. 2023-05-25 13:02:07 +02:00
translatewiki.net
4f1764fa12 Localisation updates from https://translatewiki.net. 2023-05-22 13:01:51 +02:00
translatewiki.net
d8cc62b8bc Localisation updates from https://translatewiki.net. 2023-05-18 13:02:02 +02:00
translatewiki.net
e5e07b64cc Localisation updates from https://translatewiki.net. 2023-05-15 13:01:45 +02:00
translatewiki.net
05de0c9454 Localisation updates from https://translatewiki.net. 2023-05-11 13:08:58 +02:00
translatewiki.net
955cbc96c4 Localisation updates from https://translatewiki.net. 2023-05-08 13:02:43 +02:00