Opened on 01/18/2018 at 01:04:08 PM
Closed on 01/23/2018 at 03:46:15 PM
Last modified on 01/24/2018 at 09:49:31 AM
#6289 closed defect (fixed)
Fix OnSharedPreferenceChangeListener
Reported by: | jwangenheim | Assignee: | jwangenheim |
---|---|---|---|
Priority: | P2 | Milestone: | Adblock-Plus-for-Samsung-Browser-1.1.3 |
Module: | Adblock-Plus-for-Samsung-Browser | Keywords: | |
Cc: | diegocarloslima, mario | Blocked By: | |
Blocking: | Platform: | Android | |
Ready: | yes | Confidential: | no |
Tester: | Unknown | Verified working: | no |
Review URL(s): |
Description
Environment
ABP/SI version 1.1.2
Samsung Galaxy S6
Android 6.0.1
How to reproduce
- Install the debug version of ABP/SI
- Open the LogCat view in Android Studio
- Finish the initialization and enable ABP content blocker in Samsung Internet (use about:contentblock)
- Check/uncheck the AcceptableAds option
Observed behaviour
No preference change is logged
Expected behaviour
A preference change should be logged
SharedPreferences keeps listeners in a WeakHashMap. This means it will become the target of garbage collection as soon as you leave the current scope. It will work at first, but eventually, will get garbage collected, removed from the WeakHashMap and stop working.
We should keep a reference to the listener in a field of our MainPreferences class.
Attachments (0)
Change History (5)
comment:1 Changed on 01/19/2018 at 03:14:17 PM by jwangenheim
- Review URL(s) modified (diff)
- Status changed from new to reviewing
comment:2 Changed on 01/19/2018 at 03:14:29 PM by jwangenheim
- Owner set to jwangenheim
comment:3 Changed on 01/23/2018 at 03:43:36 PM by abpbot
comment:4 Changed on 01/23/2018 at 03:46:15 PM by jwangenheim
- Resolution set to fixed
- Status changed from reviewing to closed
comment:5 Changed on 01/24/2018 at 09:49:31 AM by mario
- Milestone set to Adblock-Plus-for-Samsung-Browser-1.1.3
Note: See
TracTickets for help on using
tickets.
A commit referencing this issue has landed:
Issue 6289 - Fix OnSharedPreferenceChangeListener