Open Bug 881819 Opened 7 years ago Updated 7 years ago

StrictMode violation in Android's ActivityChooserModel

Categories

(Firefox for Android :: General, defect)

ARM
Android
defect
Not set
normal

Tracking

()

People

(Reporter: sriram, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

D/StrictMode( 3888): StrictMode policy violation; ~duration=97 ms: android.os.StrictMode$StrictModeDiskReadViolation: policy=31 violation=2
D/StrictMode( 3888): 	at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1107)
D/StrictMode( 3888): 	at libcore.io.BlockGuardOs.open(BlockGuardOs.java:106)
D/StrictMode( 3888): 	at libcore.io.IoBridge.open(IoBridge.java:400)
D/StrictMode( 3888): 	at java.io.FileInputStream.<init>(FileInputStream.java:78)
D/StrictMode( 3888): 	at android.app.ContextImpl.openFileInput(ContextImpl.java:693)
D/StrictMode( 3888): 	at android.content.ContextWrapper.openFileInput(ContextWrapper.java:167)
D/StrictMode( 3888): 	at org.mozilla.gecko.widget.ActivityChooserModel.readHistoricalDataImpl(ActivityChooserModel.java:996)
D/StrictMode( 3888): 	at org.mozilla.gecko.widget.ActivityChooserModel.readHistoricalDataIfNeeded(ActivityChooserModel.java:748)
D/StrictMode( 3888): 	at org.mozilla.gecko.widget.ActivityChooserModel.ensureConsistentState(ActivityChooserModel.java:689)
D/StrictMode( 3888): 	at org.mozilla.gecko.widget.ActivityChooserModel.getDefaultActivity(ActivityChooserModel.java:537)
D/StrictMode( 3888): 	at org.mozilla.gecko.widget.GeckoActionProvider.onCreateActionView(GeckoActionProvider.java:57)
D/StrictMode( 3888): 	at org.mozilla.gecko.widget.GeckoActionProvider.getView(GeckoActionProvider.java:64)
D/StrictMode( 3888): 	at org.mozilla.gecko.menu.GeckoMenuItem.getActionView(GeckoMenuItem.java:90)
D/StrictMode( 3888): 	at org.mozilla.gecko.menu.GeckoMenu$MenuItemsAdapter.getView(GeckoMenu.java:537)
D/StrictMode( 3888): 	at android.widget.HeaderViewListAdapter.getView(HeaderViewListAdapter.java:220)
D/StrictMode( 3888): 	at android.widget.AbsListView.obtainView(AbsListView.java:2159)
D/StrictMode( 3888): 	at android.widget.ListView.measureHeightOfChildren(ListView.java:1246)
D/StrictMode( 3888): 	at android.widget.ListView.onMeasure(ListView.java:1158)
D/StrictMode( 3888): 	at android.view.View.measure(View.java:15518)
D/StrictMode( 3888): 	at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4825)
D/StrictMode( 3888): 	at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1404)
D/StrictMode( 3888): 	at android.widget.LinearLayout.measureHorizontal(LinearLayout.java:1052)
D/StrictMode( 3888): 	at android.widget.LinearLayout.onMeasure(LinearLayout.java:590)
D/StrictMode( 3888): 	at org.mozilla.gecko.menu.MenuPanel.onMeasure(MenuPanel.java:33)
D/StrictMode( 3888): 	at android.view.View.measure(View.java:15518)
D/StrictMode( 3888): 	at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:681)
D/StrictMode( 3888): 	at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:461)
D/StrictMode( 3888): 	at android.view.View.measure(View.java:15518)
D/StrictMode( 3888): 	at org.mozilla.gecko.menu.MenuPopup.setPanelView(MenuPopup.java:71)
D/StrictMode( 3888): 	at org.mozilla.gecko.BrowserToolbar.from(BrowserToolbar.java:425)
D/StrictMode( 3888): 	at org.mozilla.gecko.BrowserApp.onCreate(BrowserApp.java:415)
D/StrictMode( 3888): 	at android.app.Activity.performCreate(Activity.java:5104)
D/StrictMode( 3888): 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
D/StrictMode( 3888): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
D/StrictMode( 3888): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
D/StrictMode( 3888): 	at android.app.ActivityThread.access$600(ActivityThread.java:141)
D/StrictMode( 3888): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
D/StrictMode( 3888): 	at android.os.Handler.dispatchMessage(Handler.java:99)
D/StrictMode( 3888): 	at android.os.Looper.loop(Looper.java:137)
D/StrictMode( 3888): 	at android.app.ActivityThread.main(ActivityThread.java:5041)
D/StrictMode( 3888): 	at java.lang.reflect.Method.invokeNative(Native Method)
D/StrictMode( 3888): 	at java.lang.reflect.Method.invoke(Method.java:511)
D/StrictMode( 3888): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
D/StrictMode( 3888): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
D/StrictMode( 3888): 	at dalvik.system.NativeStart.main(Native Method)
Attached patch PatchSplinter Review
Moving everything to an asynctask. So, all reads (usually happens only one time) will move to a background thread -- just like the writes.
Attachment #761146 - Flags: review?(mark.finkle)
Comment on attachment 761146 [details] [diff] [review]
Patch

Sriram and I talked on IRC. This patch introduces a race. He is working on another patch.
Attachment #761146 - Flags: review?(mark.finkle) → review-
You need to log in before you can comment on or make changes to this bug.