Closed Bug 727958 Opened 12 years ago Closed 12 years ago

Sync set-up screen results in StrictMode policy violation

Categories

(Firefox for Android Graveyard :: Android Sync, defect, P1)

ARM
Android
defect

Tracking

(Not tracked)

RESOLVED FIXED
mozilla13

People

(Reporter: Margaret, Assigned: liuche)

Details

(Keywords: regression, Whiteboard: [inbound])

This is a regression between 161ce815ab79 and 6bad0010d092.

From logcat:

02-16 10:45:21.605 19222 19222 I SetupSync: SetupSyncActivity constructor called.
02-16 10:45:21.605 19222 19222 I SetupSync: Called SetupSyncActivity.onCreate.
02-16 10:45:21.605 19222 19222 D SetupSync: AccountManager.get(android.app.Application@40532de0)
02-16 10:45:21.605 19222 19222 I SetupSync: Called SetupSyncActivity.onResume.
02-16 10:45:21.605 19222 19222 D SetupSync: Checking internet connectivity.
02-16 10:45:21.605 19222 19222 D SetupSync: Internet connected.
02-16 10:45:21.745 19222 19222 D StrictMode: StrictMode policy violation; ~duration=139 ms: android.os.StrictMode$StrictModeDiskReadViolation: policy=279 violation=2
02-16 10:45:21.745 19222 19222 D StrictMode: 	at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:745)
02-16 10:45:21.745 19222 19222 D StrictMode: 	at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1354)
02-16 10:45:21.745 19222 19222 D StrictMode: 	at android.database.sqlite.SQLiteDatabase.queryWithFactory(SQLiteDatabase.java:1244)
02-16 10:45:21.745 19222 19222 D StrictMode: 	at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1198)
02-16 10:45:21.745 19222 19222 D StrictMode: 	at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1280)
02-16 10:45:21.745 19222 19222 D StrictMode: 	at android.accounts.AccountManagerService.getAccountsByType(AccountManagerService.java:377)
02-16 10:45:21.745 19222 19222 D StrictMode: 	at android.accounts.AccountManagerService.getAccounts(AccountManagerService.java:1279)
02-16 10:45:21.745 19222 19222 D StrictMode: 	at android.accounts.IAccountManager$Stub.onTransact(IAccountManager.java:94)
02-16 10:45:21.745 19222 19222 D StrictMode: 	at android.os.Binder.execTransact(Binder.java:336)
02-16 10:45:21.745 19222 19222 D StrictMode: 	at dalvik.system.NativeStart.run(Native Method)
02-16 10:45:21.745 19222 19222 D StrictMode: # via Binder call with stack:
02-16 10:45:21.745 19222 19222 D StrictMode: android.os.StrictMode$LogStackTrace
02-16 10:45:21.745 19222 19222 D StrictMode: 	at android.os.StrictMode.readAndHandleBinderCallViolations(StrictMode.java:1062)
02-16 10:45:21.745 19222 19222 D StrictMode: 	at android.os.Parcel.readExceptionCode(Parcel.java:1304)
02-16 10:45:21.745 19222 19222 D StrictMode: 	at android.os.Parcel.readException(Parcel.java:1273)
02-16 10:45:21.745 19222 19222 D StrictMode: 	at android.accounts.IAccountManager$Stub$Proxy.getAccounts(IAccountManager.java:475)
02-16 10:45:21.745 19222 19222 D StrictMode: 	at android.accounts.AccountManager.getAccountsByType(AccountManager.java:391)
02-16 10:45:21.745 19222 19222 D StrictMode: 	at org.mozilla.gecko.sync.setup.activities.SetupSyncActivity.onResume(SetupSyncActivity.java:124)
02-16 10:45:21.745 19222 19222 D StrictMode: 	at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1150)
02-16 10:45:21.745 19222 19222 D StrictMode: 	at android.app.Activity.performResume(Activity.java:3912)
02-16 10:45:21.745 19222 19222 D StrictMode: 	at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2191)
02-16 10:45:21.745 19222 19222 D StrictMode: 	at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2228)
02-16 10:45:21.745 19222 19222 D StrictMode: 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1721)
02-16 10:45:21.745 19222 19222 D StrictMode: 	at android.app.ActivityThread.access$1500(ActivityThread.java:124)
02-16 10:45:21.745 19222 19222 D StrictMode: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:968)
02-16 10:45:21.745 19222 19222 D StrictMode: 	at android.os.Handler.dispatchMessage(Handler.java:99)
02-16 10:45:21.745 19222 19222 D StrictMode: 	at android.os.Looper.loop(Looper.java:130)
02-16 10:45:21.745 19222 19222 D StrictMode: 	at org.mozilla.gecko.GeckoApp$34.run(GeckoApp.java:1824)
02-16 10:45:21.745 19222 19222 D StrictMode: 	at android.os.Handler.handleCallback(Handler.java:587)
02-16 10:45:21.745 19222 19222 D StrictMode: 	at android.os.Handler.dispatchMessage(Handler.java:92)
02-16 10:45:21.745 19222 19222 D StrictMode: 	at android.os.Looper.loop(Looper.java:130)
02-16 10:45:21.745 19222 19222 D StrictMode: 	at android.app.ActivityThread.main(ActivityThread.java:3806)
02-16 10:45:21.745 19222 19222 D StrictMode: 	at java.lang.reflect.Method.invokeNative(Native Method)
02-16 10:45:21.745 19222 19222 D StrictMode: 	at java.lang.reflect.Method.invoke(Method.java:507)
02-16 10:45:21.745 19222 19222 D StrictMode: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
02-16 10:45:21.745 19222 19222 D StrictMode: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
02-16 10:45:21.745 19222 19222 D StrictMode: 	at dalvik.system.NativeStart.main(Native Method)
02-16 10:45:22.045  1658  1831 I ActivityManager: Displayed org.mozilla.fennec_leibovic/org.mozilla.gecko.sync.setup.activities.SetupSyncActivity: +458ms
02-16 10:45:22.045 19222 19222 I GeckoApp: stop
Chenxia, would you please take a look at this? mozilla-inbound is in this state right now.
14:24:53 <@rnewman> essentially, you should behave as if getAccountsByType is *not* allowed to be called from the main thread
14:25:12 <@rnewman> so you have to split onResume into something that works on a new thread
14:25:22 <@rnewman> and calls back into the UI thread when it gets a result
Assignee: rnewman → liuche
tracking-fennec: --- → ?
Chenxia, do you have an ETA on this? Or a workaround I can use? Without being able to set up sync, I'm having a tough time testing my patch from bug 722020, and I would like to land that today.
https://hg.mozilla.org/mozilla-central/rev/254cf55a96a6
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla13
Product: Mozilla Services → Android Background Services
tracking-fennec: ? → ---
Product: Android Background Services → Firefox for Android
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.