Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Improve the media location access dialog strings #5276

Open
sivaraam opened this issue Sep 4, 2023 · 10 comments · May be fixed by #5368
Open

[Bug]: Improve the media location access dialog strings #5276

sivaraam opened this issue Sep 4, 2023 · 10 comments · May be fixed by #5368

Comments

@sivaraam
Copy link
Member

sivaraam commented Sep 4, 2023

Summary

We show a dialog requesting for media location access permission so that we would be able to access the location from images. The title and description of that dialog are as follows:

Title: Media location access denied
Description: We may not be able to automatically obtain location data from pictures you upload. Please add the appropriate location for each picture before submitting

This is completely misleading since hitting "Ok" on that dialog is shown right before we request for the permission. The strings are appropriate to be shown only if we shown them right after knowing that we're denied that permission.

We need to tweak the code such that we show an appropriate string before requesting for the media location permission. We could show the above string if we're denied that permission for some reason.

Steps to reproduce

  1. "Freshly" install app from master branch
  2. Login to the app
  3. Note the description in the "Media location access" permission dialog
  4. Hit on "Ok"
  5. Observe that you're shown the dialog requesting for media access

Expected behaviour

We should show an dialog stating why we need the media location access permission. If we're denied the permission, we should show the existing description shown above.

Actual behaviour

We're showing a dialog with the existing description above before requesting access to the media location permission.

Device name

OnePlus Nord

Android version

Android 12

Commons app version

master @ Sep 04

Device logs

No response

Screen-shots

No response

Would you like to work on the issue?

None

@1911-revo
Copy link

Hello, I've also observed this bug. Would it be possible for me to give it a try?
u7442130 workshop 10

@1911-revo
Copy link

@sivaraam Just for double check: Do you mean we should display a dialogue block before requesting for media location access permission? For now, that dialogue block will be displayed if the user declines the request.

@1911-revo
Copy link

@nicolas-raoul , I found another potential bug when I was working on this issue (please see below). If you can confirm this bug, then we can possibly open a new issue.

Summary:
A bug that leads to the crash of the app.

Title: Location Bug

Description: If a user declines the request for location access, the app will crash when the user tries to upload a picture. I guess this is due to the reason that the app doesn't have location access and can't implement a location function. If so, the app should request the user for location access again instead of crashing directly.

Steps to reproduce
"Freshly" install the app from the Google Play Store.
Log in to the app.
Note the description in the "Media location access" permission dialogue and decline it. (Important. Possibly, it is the root of this bug.)
Go back to the "Contributions" page .
Click the "+" button and use the "Albums" icon (the middle one) to start uploading a photo.
Choose a photo and click the "Add(1)" button.
You will see a block that indicates "Step 1 of 4 : Media Details". Click the map icon that is near the text (see the screenshot 1).
A map interface will be displayed and click the "location" button (see the screenshot 2).
The App crashes.

Expected behaviour
We should request the user for location access again instead of crashing.

Actual behaviour
The App crashes.

Device name
Oppo Reno 8

Android version
Android 13

Commons app version
Version 4.1.0

Device logs
No response

Screen-shots:
bug reproduce 1
Bug reproduce 2

Would you like to work on the issue?
None

@nicolas-raoul
Copy link
Member

@1911-revo I can not reproduce the crash on my Pixel7 strangely. Would you mind installing from the latest main branch, trying again, and sending a screencast if it happens again? Thanks a lot!

1911-revo added a commit to 1911-revo/apps-android-commons that referenced this issue Oct 28, 2023
1911-revo added a commit to 1911-revo/apps-android-commons that referenced this issue Oct 28, 2023
@1911-revo
Copy link

@nicolas-raoul , I just found a potential bug based on this current pull request:
The developer-defined dialog will pop up even if the user has already granted the location permission.
This is because I deleted the following code since this piece of code prevents the displaying of dialog blocks due to some unknown reasons.
Anyway, the purpose of this thing has been accomplished, unfortunately there is still this little bug.
I apologize for the inconvenience, and I will return to revise this pull request at a later time to address the bug.
image

@nicolas-raoul
Copy link
Member

@sivaraam Any opinion on the proposed pull request? :-)

@sivaraam
Copy link
Member Author

@sivaraam Just for double check: Do you mean we should display a dialogue block before requesting for media location access permission? For now, that dialogue block will be displayed if the user declines the request.

Apologies for the rather delayed response @1911-revo. I'm kind of unable to reproduce the issue described here at the moment. So, I'm not able to give a suggestion on what the suggested flow should be. Are you able to get the "Media location" access dialog now?

A map interface will be displayed and click the "location" button (see the screenshot 2).

This crash should hopefully be fixed now I suppose.

@ShashwatKedia
Copy link
Contributor

@sivaraam, As mentioned here, the ACCESS_MEDIA_LOCATION is a runtime permission, but the permission request states that access to media and photos is requested, instead of asking for access to media location. Upon accepting this permission, sometimes only the ACCESS_MEDIA_LOCATION is given, but not the READ_EXTERNAL_STORAGE or WRITE_EXTERNAL_STORAGE, thus this behaviour was observed by you. I think it would be better if we show the dialog for asking for External storage permissions, but we will ask for both permissions during runtime. Also, this permission is asked just as the app is opened, which is against the Android guidelines (which state that we should ask for permissions only when the user is interacting with a feature that requires that permission).

@ShashwatKedia
Copy link
Contributor

@nicolas-raoul @sivaraam, what are your thoughts on the above comment? Do you think I should implement the above flow?

@sivaraam
Copy link
Member Author

Hi Shaswat! From your comment, I could roughly understand that you're proposing to avoid asking for the permission as soon as the app is opened. I'm not very sure what flow you're actually proposing as a solution. Could you elaborate on the same?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants