StrictMode policy violation while opening Sync Settings

NEW
Unassigned

Status

()

Firefox for Android
General
P3
normal
10 months ago
4 months ago

People

(Reporter: Grisha, Unassigned)

Tracking

(Depends on: 1 bug, Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

10 months ago
08-17 18:12:08.555 14781 14781 D StrictMode: StrictMode policy violation; ~duration=15 ms: android.os.StrictMode$StrictModeDiskReadViolation: policy=65567 violation=2
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1415)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at java.io.UnixFileSystem.checkAccess(UnixFileSystem.java:251)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at java.io.File.exists(File.java:807)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.app.ContextImpl.getDataDir(ContextImpl.java:2165)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.app.ContextImpl.getPreferencesDir(ContextImpl.java:498)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.app.ContextImpl.getSharedPreferencesPath(ContextImpl.java:692)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.app.ContextImpl.getSharedPreferences(ContextImpl.java:360)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:167)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.preference.PreferenceManager.getSharedPreferences(PreferenceManager.java:510)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.preference.Preference.getSharedPreferences(Preference.java:1203)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.preference.Preference.dispatchSetInitialValue(Preference.java:1554)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.preference.Preference.onAttachedToHierarchy(Preference.java:1327)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.preference.PreferenceInflater.onMergeRoots(PreferenceInflater.java:110)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.preference.PreferenceInflater.onMergeRoots(PreferenceInflater.java:104)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.preference.GenericInflater.inflate(GenericInflater.java:321)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.preference.GenericInflater.inflate(GenericInflater.java:264)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.preference.PreferenceManager.inflateFromResource(PreferenceManager.java:324)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at java.lang.reflect.Method.invoke(Native Method)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at org.mozilla.gecko.background.preferences.PreferenceManagerCompat.inflateFromResource(PreferenceManagerCompat.java:145)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at org.mozilla.gecko.background.preferences.PreferenceFragment.addPreferencesFromResource(PreferenceFragment.java:230)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at org.mozilla.gecko.fxa.activities.FxAccountStatusFragment.addPreferences(FxAccountStatusFragment.java:166)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at org.mozilla.gecko.fxa.activities.FxAccountStatusFragment.onCreate(FxAccountStatusFragment.java:162)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.support.v4.app.Fragment.performCreate(Unknown Source:15)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.support.v4.app.FragmentManagerImpl.moveToState(Unknown Source:327)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.support.v4.app.BackStackRecord.setLastIn(Unknown Source:46)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.support.v4.app.BackStackRecord.calculateFragments(Unknown Source:88)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.support.v4.app.BackStackRecord.run(Unknown Source:73)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.support.v4.app.FragmentManagerImpl.execPendingActions(Unknown Source:146)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.support.v4.app.FragmentController.execPendingActions(Unknown Source:4)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.support.v4.app.FragmentActivity.onStart(Unknown Source:32)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1333)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.app.Activity.performStart(Activity.java:6997)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2780)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.app.ActivityThread.-wrap11(Unknown Source:0)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.os.Handler.dispatchMessage(Handler.java:105)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.os.Looper.loop(Looper.java:164)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.app.ActivityThread.main(ActivityThread.java:6540)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at java.lang.reflect.Method.invoke(Native Method)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
08-17 18:12:08.555 14781 14781 D StrictMode: StrictMode policy violation; ~duration=15 ms: android.os.StrictMode$StrictModeDiskReadViolation: policy=65567 violation=2
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1415)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at java.io.UnixFileSystem.checkAccess(UnixFileSystem.java:251)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at java.io.File.exists(File.java:807)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.app.ContextImpl.ensurePrivateDirExists(ContextImpl.java:553)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.app.ContextImpl.ensurePrivateDirExists(ContextImpl.java:544)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.app.ContextImpl.getPreferencesDir(ContextImpl.java:500)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.app.ContextImpl.getSharedPreferencesPath(ContextImpl.java:692)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.app.ContextImpl.getSharedPreferences(ContextImpl.java:360)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:167)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.preference.PreferenceManager.getSharedPreferences(PreferenceManager.java:510)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.preference.Preference.getSharedPreferences(Preference.java:1203)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.preference.Preference.dispatchSetInitialValue(Preference.java:1554)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.preference.Preference.onAttachedToHierarchy(Preference.java:1327)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.preference.PreferenceInflater.onMergeRoots(PreferenceInflater.java:110)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.preference.PreferenceInflater.onMergeRoots(PreferenceInflater.java:104)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.preference.GenericInflater.inflate(GenericInflater.java:321)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.preference.GenericInflater.inflate(GenericInflater.java:264)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.preference.PreferenceManager.inflateFromResource(PreferenceManager.java:324)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at java.lang.reflect.Method.invoke(Native Method)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at org.mozilla.gecko.background.preferences.PreferenceManagerCompat.inflateFromResource(PreferenceManagerCompat.java:145)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at org.mozilla.gecko.background.preferences.PreferenceFragment.addPreferencesFromResource(PreferenceFragment.java:230)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at org.mozilla.gecko.fxa.activities.FxAccountStatusFragment.addPreferences(FxAccountStatusFragment.java:166)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at org.mozilla.gecko.fxa.activities.FxAccountStatusFragment.onCreate(FxAccountStatusFragment.java:162)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.support.v4.app.Fragment.performCreate(Unknown Source:15)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.support.v4.app.FragmentManagerImpl.moveToState(Unknown Source:327)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.support.v4.app.BackStackRecord.setLastIn(Unknown Source:46)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.support.v4.app.BackStackRecord.calculateFragments(Unknown Source:88)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.support.v4.app.BackStackRecord.run(Unknown Source:73)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.support.v4.app.FragmentManagerImpl.execPendingActions(Unknown Source:146)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.support.v4.app.FragmentController.execPendingActions(Unknown Source:4)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.support.v4.app.FragmentActivity.onStart(Unknown Source:32)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1333)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.app.Activity.performStart(Activity.java:6997)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2780)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.app.ActivityThread.-wrap11(Unknown Source:0)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.os.Handler.dispatchMessage(Handler.java:105)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.os.Looper.loop(Looper.java:164)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.app.ActivityThread.main(ActivityThread.java:6540)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at java.lang.reflect.Method.invoke(Native Method)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
08-17 18:12:08.555 14781 14781 D StrictMode: StrictMode policy violation; ~duration=9 ms: android.os.StrictMode$StrictModeDiskReadViolation: policy=65567 violation=2
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1415)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at java.io.UnixFileSystem.checkAccess(UnixFileSystem.java:251)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at java.io.File.exists(File.java:807)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.app.ContextImpl.ensurePrivateDirExists(ContextImpl.java:553)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.app.ContextImpl.ensurePrivateDirExists(ContextImpl.java:544)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.app.ContextImpl.getPreferencesDir(ContextImpl.java:500)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.app.ContextImpl.getSharedPreferencesPath(ContextImpl.java:692)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.app.ContextImpl.getSharedPreferences(ContextImpl.java:360)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:167)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at org.mozilla.gecko.fxa.authenticator.AndroidFxAccount.getSyncPrefs(AndroidFxAccount.java:382)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at org.mozilla.gecko.fxa.activities.FxAccountStatusFragment.refresh(FxAccountStatusFragment.java:444)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at org.mozilla.gecko.fxa.activities.FxAccountStatusActivity.onResume(FxAccountStatusActivity.java:95)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1354)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.app.Activity.performResume(Activity.java:7084)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3619)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3684)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2898)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.app.ActivityThread.-wrap11(Unknown Source:0)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.os.Handler.dispatchMessage(Handler.java:105)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.os.Looper.loop(Looper.java:164)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at android.app.ActivityThread.main(ActivityThread.java:6540)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at java.lang.reflect.Method.invoke(Native Method)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
08-17 18:12:08.555 14781 14781 D StrictMode: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Note that SharedPreferences _technically_ hits disk, and so can cause this. It's rarely worth the effort to fix: you either block UI inflation to wait for a background read (bad), or you just make sure SharedPreferences is inited somewhere else first (acceptable).
(Reporter)

Comment 2

4 months ago
Indeed, and the latter is what I propose to do in Bug 1407316.
Depends on: 1407316
You need to log in before you can comment on or make changes to this bug.