Closed
Bug 746362
Opened 13 years ago
Closed 13 years ago
StrictMode violation in saving Sync migration state
Categories
(Firefox for Android Graveyard :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 14
People
(Reporter: gcp, Assigned: gcp)
References
Details
Attachments
(1 file)
|
4.35 KB,
patch
|
blassey
:
review+
mfinkle
:
approval-mozilla-central+
|
Details | Diff | Splinter Review |
Saving the Preference means hitting disk in the main thread:
D/StrictMode(14963): StrictMode policy violation; ~duration=39 ms: android.os.StrictMode$StrictModeDiskReadViolation: policy=31 violation=2
D/StrictMode(14963): at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1067)
D/StrictMode(14963): at dalvik.system.BlockGuard$WrappedFileSystem.open(BlockGuard.java:235)
D/StrictMode(14963): at java.io.FileOutputStream.<init>(FileOutputStream.java:101)
D/StrictMode(14963): at java.io.FileOutputStream.<init>(FileOutputStream.java:77)
D/StrictMode(14963): at android.app.SharedPreferencesImpl.createFileOutputStream(SharedPreferencesImpl.java:521)
D/StrictMode(14963): at android.app.SharedPreferencesImpl.writeToFile(SharedPreferencesImpl.java:569)
D/StrictMode(14963): at android.app.SharedPreferencesImpl.access$800(SharedPreferencesImpl.java:47)
D/StrictMode(14963): at android.app.SharedPreferencesImpl$2.run(SharedPreferencesImpl.java:489)
D/StrictMode(14963): at android.app.SharedPreferencesImpl.enqueueDiskWrite(SharedPreferencesImpl.java:510)
D/StrictMode(14963): at android.app.SharedPreferencesImpl.access$100(SharedPreferencesImpl.java:47)
D/StrictMode(14963): at android.app.SharedPreferencesImpl$EditorImpl.commit(SharedPreferencesImpl.java:432)
D/StrictMode(14963): at org.mozilla.gecko.ProfileMigrator.setMigratedSync(ProfileMigrator.java:362)
D/StrictMode(14963): at org.mozilla.gecko.ProfileMigrator$SyncTask$3.onPostExecute(ProfileMigrator.java:527)
D/StrictMode(14963): at org.mozilla.gecko.ProfileMigrator$SyncTask$3.onPostExecute(ProfileMigrator.java:522)
D/StrictMode(14963): at android.os.AsyncTask.finish(AsyncTask.java:590)
D/StrictMode(14963): at android.os.AsyncTask.access$600(AsyncTask.java:149)
D/StrictMode(14963): at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:603)
D/StrictMode(14963): at android.os.Handler.dispatchMessage(Handler.java:99)
D/StrictMode(14963): at android.os.Looper.loop(Looper.java:132)
D/StrictMode(14963): at android.app.ActivityThread.main(ActivityThread.java:4126)
D/StrictMode(14963): at java.lang.reflect.Method.invokeNative(Native Method)
D/StrictMode(14963): at java.lang.reflect.Method.invoke(Method.java:491)
D/StrictMode(14963): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:844)
D/StrictMode(14963): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
D/StrictMode(14963): at dalvik.system.NativeStart.main(Native Method)
| Assignee | ||
Comment 1•13 years ago
|
||
This is arguably less critical as it will only happen once. But the code that causes it just landed so we might as well fix it now.
Assignee: nobody → gpascutto
Attachment #615934 -
Flags: review?(blassey.bugs)
Comment 2•13 years ago
|
||
Comment on attachment 615934 [details] [diff] [review]
Patch 1. Save settings in the background thread
Review of attachment 615934 [details] [diff] [review]:
-----------------------------------------------------------------
::: mobile/android/base/ProfileMigrator.java
@@ -502,5 @@
> Log.i(LOGTAG, "Migrating Sync account succeeded.");
> }
> setMigratedSync();
> }
> - }.execute(params);
this was being run on the main UI thread. Is this change intentional and ok?
Attachment #615934 -
Flags: review?(blassey.bugs) → review+
| Assignee | ||
Updated•13 years ago
|
Attachment #615934 -
Flags: approval-mozilla-central?
| Assignee | ||
Comment 3•13 years ago
|
||
>this was being run on the main UI thread. Is this change intentional and ok?
It changed from createSyncAccountTask, which was an AsyncTask, into a Runnable calling the createSyncAccount method in the background thread. None of those ran on the UI thread.
The preference check was on the main thread, and that's this bug.
So this is intentional and OK.
Updated•13 years ago
|
Attachment #615934 -
Flags: approval-mozilla-central? → approval-mozilla-central+
| Assignee | ||
Comment 4•13 years ago
|
||
Comment 5•13 years ago
|
||
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 14
Updated•5 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•