Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Issue 29340827: Issue 3931 - Crash on filter list request/delivery (Closed)

Created:
April 26, 2016, 9:34 a.m. by René Jeschke
Modified:
April 27, 2016, 9:57 a.m.
Reviewers:
Felix Dahlke
Visibility:
Public.

Description

Issue 3931 - Crash on filter list request/delivery

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+27 lines, -5 lines) Patch
M src/org/adblockplus/sbrowser/contentblocker/MainPreferences.java View 5 chunks +27 lines, -5 lines 1 comment Download

Messages

Total messages: 3
René Jeschke
April 26, 2016, 9:35 a.m. (2016-04-26 09:35:33 UTC) #1
Felix Dahlke
LGTM since this is a bit of an emergency fix, but I do have a ...
April 26, 2016, 5:39 p.m. (2016-04-26 17:39:10 UTC) #2
René Jeschke
April 26, 2016, 5:48 p.m. (2016-04-26 17:48:54 UTC) #3
On 2016/04/26 17:39:10, Felix Dahlke wrote:
> LGTM since this is a bit of an emergency fix, but I do have a question, see
> below.
> 
>
https://codereview.adblockplus.org/29340827/diff/29340828/src/org/adblockplus...
> File src/org/adblockplus/sbrowser/contentblocker/MainPreferences.java (right):
> 
>
https://codereview.adblockplus.org/29340827/diff/29340828/src/org/adblockplus...
> src/org/adblockplus/sbrowser/contentblocker/MainPreferences.java:70: try
> What causes this issue? Did we change the type of this key? If so, this is
> rather migration code than a workaround.

Hm, yeah, didn't made that clear in the issue, here's the thing:

The current code uses differing context objects for requesting shared prefs.
This was because only the application context is global, and a activity context
is local. So requesting the prefs with both context types yields different
underlying prefs.

Android seems to be behave pretty strange then and creates keys with default
(String) values when they are missing, somehow this was caused by the differing
prefs states. So in the end, by checking if the key existed in one pref, it
seems to be created inside the other one or something like this.^^

But: the issue was there before the code change, the code change only made it
visible because of the new dialogue and its exit point for updating SBrowser.

Powered by Google App Engine
This is Rietveld