Closed Bug 746365 Opened 8 years ago Closed 8 years ago

StrictMode violation in checking Profile Migration status

Categories

(Firefox for Android :: General, defect)

ARM
Android
defect
Not set

Tracking

()

RESOLVED FIXED
Firefox 14
Tracking Status
blocking-fennec1.0 --- soft

People

(Reporter: gcp, Assigned: gcp)

Details

Attachments

(1 file)

Reading the hasMigrationRun preference hits disk on the main thread:

D/StrictMode(15215): StrictMode policy violation; ~duration=207 ms: android.os.StrictMode$StrictModeDiskReadViolation: policy=31 violation=2
D/StrictMode(15215): 	at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1067)
D/StrictMode(15215): 	at android.app.SharedPreferencesImpl.awaitLoadedLocked(SharedPreferencesImpl.java:182)
D/StrictMode(15215): 	at android.app.SharedPreferencesImpl.getBoolean(SharedPreferencesImpl.java:239)
D/StrictMode(15215): 	at org.mozilla.gecko.ProfileMigrator.areBookmarksMigrated(ProfileMigrator.java:310)
D/StrictMode(15215): 	at org.mozilla.gecko.ProfileMigrator.hasMigrationRun(ProfileMigrator.java:324)
D/StrictMode(15215): 	at org.mozilla.gecko.GeckoApp.checkMigrateProfile(GeckoApp.java:2296)
D/StrictMode(15215): 	at org.mozilla.gecko.GeckoApp.initialize(GeckoApp.java:1654)
D/StrictMode(15215): 	at org.mozilla.gecko.GeckoApp.onWindowFocusChanged(GeckoApp.java:2025)
D/StrictMode(15215): 	at com.android.internal.policy.impl.PhoneWindow$DecorView.onWindowFocusChanged(PhoneWindow.java:2304)
D/StrictMode(15215): 	at android.view.View.dispatchWindowFocusChanged(View.java:4703)
D/StrictMode(15215): 	at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:752)
D/StrictMode(15215): 	at android.view.ViewRoot.handleMessage(ViewRoot.java:2162)
D/StrictMode(15215): 	at android.os.Handler.dispatchMessage(Handler.java:99)
D/StrictMode(15215): 	at android.os.Looper.loop(Looper.java:132)
D/StrictMode(15215): 	at android.app.ActivityThread.main(ActivityThread.java:4126)
D/StrictMode(15215): 	at java.lang.reflect.Method.invokeNative(Native Method)
D/StrictMode(15215): 	at java.lang.reflect.Method.invoke(Method.java:491)
D/StrictMode(15215): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:844)
D/StrictMode(15215): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
D/StrictMode(15215): 	at dalvik.system.NativeStart.main(Native Method)
We can hit this on every startup and there's a potential startup time regression.
blocking-fennec1.0: --- → ?
Assignee: nobody → gpascutto
Attachment #615919 - Flags: review?(blassey.bugs)
FWIW, this was caused by Bug 715550 splitting Sync Migration and Profile Migration and moving the latter earlier in the startup. The SharedPreference check is really the only thing outside the handler, but indeed that does mean a read from disk.
Attachment #615919 - Flags: review?(blassey.bugs) → review+
Attachment #615919 - Flags: approval-mozilla-central?
Attachment #615919 - Flags: approval-mozilla-central? → approval-mozilla-central+
blocking-fennec1.0: ? → soft
https://hg.mozilla.org/mozilla-central/rev/1008d8219540
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 14
You need to log in before you can comment on or make changes to this bug.