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

Runtime permission dialogs behave badly on orientation changes in Android 6, 7 #2571

Open
lognaturel opened this issue Sep 24, 2018 · 8 comments

Comments

@lognaturel
Copy link
Member

Software and hardware versions

Collect v1.17.0-beta.0, Android 6.0 and 7.0

Problem description

From @mmarciniak90 at #2506 (comment) verifying the phone data permission check:

Case 1:

The user sees information that 'ODK Collect does not make calls...'
The user changes device orientation
The user sees the dialog with Deny / Allow buttons
Case 2:

The user sees the dialog with Deny / Allow buttons
The user changes device orientation eg. 4 times
The user clicks on Deny
The user sees an empty screen and needs to click 4 times to see the dialog with information that 'ODK Collect does not make calls...'
A similar situation is when the user clicks on Allow in point 3
Problems are not visible on Android 8.1

@grzesiek2010 suggests in #2506 (comment) that this is a problem for all of the permission checks.

The best approach to take here needs discussion. Since this is not hugely disruptive, it's not very high priority.

Steps to reproduce the problem

  1. Use an Android 6.0+ device
  2. Make sure Collect does not have permissions to read phone state
  3. Load a form like preloads.xml.txt which reads phone data
  4. See the permissions dialog, rotate the screen

Expected behavior

A single dialog is shown and does the right thing on orientation changes

@grzesiek2010
Copy link
Member

@grzesiek2010 suggests in #2506 (comment) that this is a problem for all of the permission checks.

In fact, the problem I pointed out is different (but also related to changing device orientation). I created a separate issue which I think we should fix firs.

#2574

@getodk-bot
Copy link
Member

getodk-bot commented Oct 19, 2018

Hello @grzesiek2010, you have been unassigned from this issue because you have not updated this issue or any referenced pull requests for over 15 days.

You can reclaim this issue or claim any other issue by commenting @opendatakit-bot claim on that issue.

Thanks for your contributions, and hope to see you again soon!

@seadowg
Copy link
Member

seadowg commented Feb 16, 2023

@getodk/testers are you able to double-check if this is still a problem or not?

@dbemke
Copy link

dbemke commented Feb 17, 2023

I'm able to reproduce those steps on Android 8.1, 10, 11

Steps to reproduce the problem

  1. Go to the metadata form.
    metadata.xml.txt
  2. When you see a permission asking to allow to make phone call, rotate the device.
  3. Tap "deny" ( the number how many times you need to tap deny depends on the number of rotation done before).
  4. Then there is a "Loading Form" state, click the device back button.
  5. "Read phone state permission" appears, tap "ok".

After that there is a dark screen.

rotatepermissiondenybackbutton.mp4

On Android 13 there is a bit different scenario

Steps to reproduce the problem

  1. Go to the metadata form.
  2. When you see a permission asking to allow to make phone call, rotate the device.
  3. The user is unable to tap "allow" or "deny".
  4. Click the device back button a few times until there is the "Loading form" state.
  5. Click the device back button again.
  6. When the is a dialog with "save changes"/"ignore" , tap "save changes".

After that there is a crash
crash

It is also possible to reproduce that crash on other Android versions if the user follows steps 1-4 and while on the "Loading form" state, taps the hierarchy view button. Another tricky way to reproduce it on some devices is following steps 1-6 but in step 2 the rotation should be done "halfway through" ( starting to rotate the screen and the moment the screen is moved a bit, going back quickly to the initial position - so the screen really didn't rotate).

@dbemke
Copy link

dbemke commented Feb 17, 2023

Rotating the screen while different permissions are displayed and then tapping "deny" results in the dialog to "open settings"/"ok" not appearing. Should I file a separate issue or add steps to reproduce here?

@seadowg
Copy link
Member

seadowg commented Feb 17, 2023

@dbemke I think adding repro steps here is good, as I imagine it'll be a good thing to work on at the same time as fixing everything else here.

@dbemke
Copy link

dbemke commented Feb 20, 2023

ODK Collect version

the store version 2022.4.4, the master faf9891

Android version

8.1, 10, 13

Device used

Nexus 5X, Galaxy M12, Pixel 6a

Problem description

After rotating the screen while a permission dialog is displayed in widgets (that required granting some permissions: image widget, video widget and geo widgets) and tapping "deny", there is no dialog with "open settings”/”ok”.

Steps to reproduce the problem

  1. Go to All widgets form.
  2. Go to e.g. Image widget.
  3. Tap "Take Picture”
  4. When the dialog asking to allow to take picture and record video appear, rotate the screen.
  5. Tap "deny”

Expected behavior

Dialog about camera permission (with "open settings”/”ok”) should appear.

@dbemke
Copy link

dbemke commented Feb 20, 2023

ODK Collect version

the store version 2022.4.4, the master 30a0e14

Android version

8.1, 10, 13

Device used

Nexus 5X, Galaxy M12, Pixel 6a

Problem description

After rotating the screen while a permission dialog is displayed while scanning a QR code (to add a project) and tapping "allow”, the scanner doesn’t work and the user needs to click the device back button a few times to go back to the main menu. On Android 13 after rotating the user is unable to tap "allow”.

Steps to reproduce the problem

  1. Go to "Add project”.
  2. When the dialog asking to allow to take picture and record video appears, rotate the screen.
  3. Tap "allow”

Expected behavior

After granting the camera permission the user should be able to scan a QR code.

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

No branches or pull requests

5 participants