Currently, WebappDataStorage and WebappRegistry use SharedPreferences#apply() in an AsyncTask to write to SharedPreferences. However, that method is async, so it can be called from the UI thread. Writing to SharedPreferences from a background thread introduces a race condition where it may also be modified from the UI thread; SharedPreferences are written all at once for all prefs across the whole app.
Both classes need to be refactored to write from the UI thread only.
Comment 1 by wnwen@chromium.org
, Sep 21 2016