"Give permissions" dialog in Nearby activity keeps flickering
See original GitHub issueSummary:
“Give permissions” dialog in Nearby activity keeps flickering. You cannot select the “give permissions” option while it is doing that, and eventually it crashes.
This problem seems to occur in master
branch. Actually, I’m testing PR #1672 , but that is based on master at the time of my testing, and that PR is unlikely to be the cause since there is no relevant change in that PR. I haven’t had that issue the last time I tested master, so it is likely to be a change in the last few weeks or so (or alternatively, it could be caused by my phone’s recent update to Android 8.0.0). After this, I will test with an emulator on Android 7.0, and also test 2.8-release
branch to see if that has the same problem.
Steps to reproduce:
- Turn off location permissions for the app
- Load Nearby
Add System logs:
On “warning”, because there is too much nonsense in “debug”
06-29 02:48:24.511 21978-21978/fr.free.nrw.commons.debug W/Activity: Can reqeust only one set of permissions at a time
06-29 02:48:26.981 21978-21978/fr.free.nrw.commons.debug W/Activity: Can reqeust only one set of permissions at a time
06-29 02:48:27.095 21978-21978/fr.free.nrw.commons.debug E/ViewRootImpl: sendUserActionEvent() returned.
06-29 02:48:27.178 21978-21978/fr.free.nrw.commons.debug W/Activity: Can reqeust only one set of permissions at a time
06-29 02:48:27.327 21978-21978/fr.free.nrw.commons.debug E/ViewRootImpl: sendUserActionEvent() returned.
06-29 02:48:27.393 21978-21978/fr.free.nrw.commons.debug W/Activity: Can reqeust only one set of permissions at a time
06-29 02:48:27.590 21978-21978/fr.free.nrw.commons.debug E/ViewRootImpl: sendUserActionEvent() returned.
06-29 02:48:32.851 3642-4133/? E/SamsungWindowManager: prepareAddWindowLw - exceeded windows limit 40 < 41 win=Window{e7d9d3 u0 fr.free.nrw.commons.debug/fr.free.nrw.commons.nearby.NearbyActivity}
06-29 02:48:32.857 21978-21978/fr.free.nrw.commons.debug E/AndroidRuntime: FATAL EXCEPTION: main
Process: fr.free.nrw.commons.debug, PID: 21978
java.lang.RuntimeException: Failure delivering result ResultInfo{who=@android:requestPermissions:, request=1, result=-1, data=Intent { act=android.content.pm.action.REQUEST_PERMISSIONS (has extras) }} to activity {fr.free.nrw.commons.debug/fr.free.nrw.commons.nearby.NearbyActivity}: android.view.WindowManager$BadTokenException: Unable to add window -- window android.view.ViewRootImpl$W@24fa3cd has already been added
at android.app.ActivityThread.deliverResults(ActivityThread.java:4491)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:4534)
at android.app.ActivityThread.-wrap20(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1752)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6944)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
Caused by: android.view.WindowManager$BadTokenException: Unable to add window -- window android.view.ViewRootImpl$W@24fa3cd has already been added
at android.view.ViewRootImpl.setView(ViewRootImpl.java:966)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:381)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:100)
at android.app.Dialog.show(Dialog.java:420)
at fr.free.nrw.commons.nearby.NearbyActivity.showLocationPermissionDeniedErrorDialog(NearbyActivity.java:254)
at fr.free.nrw.commons.nearby.NearbyActivity.onRequestPermissionsResult(NearbyActivity.java:229)
at android.app.Activity.dispatchRequestPermissionsResult(Activity.java:7728)
at android.app.Activity.dispatchActivityResult(Activity.java:7551)
at android.app.ActivityThread.deliverResults(ActivityThread.java:4487)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:4534)
at android.app.ActivityThread.-wrap20(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1752)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6944)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
06-29 02:48:32.862 3642-4133/? W/ActivityManager: crash : fr.free.nrw.commons.debug,0
06-29 02:48:32.863 3642-4133/? W/ActivityManager: Force finishing activity fr.free.nrw.commons.debug/fr.free.nrw.commons.nearby.NearbyActivity
06-29 02:48:32.868 3642-4133/? W/ActivityManager: Force finishing activity fr.free.nrw.commons.debug/fr.free.nrw.commons.contributions.ContributionsActivity
06-29 02:48:32.869 3642-4133/? W/MultiScreenManagerService: moveTaskBackToDisplayIfNeeded(): root activity or app is null, task=TaskRecord{aef1e0ed0 #11801 A=fr.free.nrw.commons.debug U=0 StackId=1 sz=34}, rootActivity=null
06-29 02:48:33.025 21893-21905/? W/PkgUtils: p: fr.free.nrw.commons.debug, u:0
06-29 02:48:33.365 3642-3664/? W/ActivityManager: Activity pause timeout for ActivityRecord{62232ce u0 fr.free.nrw.commons.debug/fr.free.nrw.commons.nearby.NearbyActivity t11801 f}
06-29 02:48:42.874 3642-3664/? W/ActivityManager: Activity destroy timeout for ActivityRecord{f105487 u0 fr.free.nrw.commons.debug/fr.free.nrw.commons.contributions.ContributionsActivity t11801 f}
06-29 02:48:43.801 3642-3664/? W/ActivityManager: Activity destroy timeout for ActivityRecord{62232ce u0 fr.free.nrw.commons.debug/fr.free.nrw.commons.nearby.NearbyActivity t11801 f}
Device and Android version:
Samsung Galaxy S7 Android 8.0.0
Commons app version:
Would you like to work on the issue?
Preferably not…
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (9 by maintainers)
Top GitHub Comments
Ok I will send the pull request for this issue. And report other issues also.
Do you mean that you would like to submit fixes for the other issues at the same time, too? Sure, by all means, feel free to submit multiple PRs, assuming there aren’t any requested changes outstanding on your original PR. We have been having a bit of a backlog with PR reviews, so it’s totally fine to have multiple PRs open at the same time.