Opened 8 months ago

Closed 6 months ago

Last modified 6 weeks ago

#4522 closed change (fixed)

Leaking and stacking dialogs in MainPreferences

Reported by: diegocarloslima Assignee: diegocarloslima
Priority: P5 Milestone: Adblock-Plus-for-Samsung-Browser-1.1.0
Module: Adblock-Plus-for-Samsung-Browser Keywords:
Cc: Blocked By:
Blocking: Platform: Samsung Browser
Ready: yes Confidential: no
Tester: Scheer Verified working: yes
Review URL(s):

https://codereview.adblockplus.org/29356560/

Description

Background

The dialogs created in MainPreferences aren't dismissed when the app goes to background and new ones are created every time the app goes to foreground. This may result in many instances of a dialog being showed and also a WindowLeaked error if the app is killed like the following:

10-11 17:46:24.555 24749-24749/org.adblockplus.adblockplussbrowser E/WindowManager: android.view.WindowLeaked: Activity org.adblockplus.sbrowser.contentblocker.MainPreferences has leaked window com.android.internal.policy.PhoneWindow$DecorView{a4f959a V.E...... R....... 0,0-1026,830} that was originally added here
    at android.view.ViewRootImpl.<init>(ViewRootImpl.java:368)
    at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:299)
    at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:85)
    at android.app.Dialog.show(Dialog.java:319)
    at org.adblockplus.sbrowser.contentblocker.MainPreferences.checkSetupStatus(MainPreferences.java:187)
    at org.adblockplus.sbrowser.contentblocker.MainPreferences.checkAAStatusAndProceed(MainPreferences.java:162)
    at org.adblockplus.sbrowser.contentblocker.MainPreferences.checkForCompatibleSBrowserAndProceed(MainPreferences.java:132)
    at org.adblockplus.sbrowser.contentblocker.MainPreferences.onEngineCreated(MainPreferences.java:201)
    at org.adblockplus.sbrowser.contentblocker.engine.EngineService$CreationNotifier$1.run(EngineService.java:152)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:148)
    at android.app.ActivityThread.main(ActivityThread.java:5417)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

What to change

Make sure that when app goes to background, the current active dialog is dismissed and recreated when the app goes back to foreground.

Change History (4)

comment:1 Changed 8 months ago by diegocarloslima

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:2 Changed 6 months ago by abpbot

A commit referencing this issue has landed:
Issue 4522 - Leaking and stacking dialogs in MainPreferences

comment:3 Changed 6 months ago by diegocarloslima

  • Milestone set to Adblock-Plus-for-Samsung-Browser-next
  • Resolution set to fixed
  • Status changed from reviewing to closed

comment:4 Changed 6 weeks ago by scheer

  • Tester changed from Unknown to Scheer
  • Verified working set
  • When the app goes to background, the current active dialog is dismissed and recreated when the app goes back to foreground and does not display the following error message:
24749-24749/org.adblockplus.adblockplussbrowser E/WindowManager: android.view.WindowLeaked: Activity org.adblockplus.sbrowser.contentblocker.MainPreferences has leaked window com.android.internal.policy.PhoneWindow$DecorView{a4f959a V.E...... R....... 0,0-1026,830} that was originally added here
    at android.view.ViewRootImpl.<init>(ViewRootImpl.java:368)
    at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:299)
    at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:85)
    at android.app.Dialog.show(Dialog.java:319)
    at org.adblockplus.sbrowser.contentblocker.MainPreferences.checkSetupStatus(MainPreferences.java:187)
    at org.adblockplus.sbrowser.contentblocker.MainPreferences.checkAAStatusAndProceed(MainPreferences.java:162)
    at org.adblockplus.sbrowser.contentblocker.MainPreferences.checkForCompatibleSBrowserAndProceed(MainPreferences.java:132)
    at org.adblockplus.sbrowser.contentblocker.MainPreferences.onEngineCreated(MainPreferences.java:201)
    at org.adblockplus.sbrowser.contentblocker.engine.EngineService$CreationNotifier$1.run(EngineService.java:152)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:148)
    at android.app.ActivityThread.main(ActivityThread.java:5417)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

adblockplussbrowser-release-signed-1
Galaxy S7
Android 7.0

Note: See TracTickets for help on using tickets.