Skip to content

Comments

fixed #2 - Extra miui permissions Dialog (cancellable => false)#3

Open
Anshul1507 wants to merge 1 commit intooddlyspaced:mainfrom
Anshul1507:main
Open

fixed #2 - Extra miui permissions Dialog (cancellable => false)#3
Anshul1507 wants to merge 1 commit intooddlyspaced:mainfrom
Anshul1507:main

Conversation

@Anshul1507
Copy link

@Anshul1507 Anshul1507 commented Mar 17, 2022

Setting Dialog for Extra miui permissions cancellable false to not bypass the permission flow.

@Anshul1507
Copy link
Author

Anshul1507 commented Mar 17, 2022

Hold on with this PR @oddlyspaced, there are other issues related to this.

I have tested this code in MIUI 8 (Android 11) and the outcomes are:
On the current codebase (before this PR), On opening the app, we have the first non-cancellable dialog to enable accessible service, after giving that permission, we have a second cancellable dialog for the permission of Display popup windows while running in the background.

The issue is here, after allowing this permission when I get back to the app, it again shows me that cancellable second dialog, and the loop goes on if I follow up the flow (Clicking on Dialog to give permission > Allow permission > Back to app > Shows dialog).
So, here the second dialog is cancellable as per that,
Case 1: if user cancel that dialog without giving permission, the app does not work correctly
Case 2: if the user cancels that dialog after giving the permission, the app works.

That infinite loop of second permission dialog is due to showing dialog if the device is MIUI in onResume() method, We can solve this issue by checking if this "display popup windows while running in the background" is given by the user in that else if case of onResume() method.

@Anshul1507
Copy link
Author

I have somewhat solved this problem, but I need confirmation of one permission.
Are we only asking that permission "display popup windows while running in the background" only for MIUI devices?
App is working fine in devices other than MIUI without this permission?

@oddlyspaced
Copy link
Owner

Can you possibly check on a device running MIUI 12?

Also I specifically made the MIUI Permission dialog not cancellable so that the user can just skip it once they enable the permission. I'm currently exploring a better way to implement it. If you have any ideas feel free to create a PR or share them.

@Anshul1507
Copy link
Author

Ohh My bad @oddlyspaced, The device in which I was testing is MIUI 12.5.6

@Anshul1507
Copy link
Author

I have somewhat solved this problem, but I need confirmation of one permission. Are we only asking that permission "display popup windows while running in the background" only for MIUI devices? App is working fine in devices other than MIUI without this permission?

Are we using "display popup windows" permission for all kinds of devices?

@oddlyspaced
Copy link
Owner

That particular permission is only limited to miui devices afaik. And the service malfunctioning thing is also miui specific as far as my experience goes.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants