If I wrap the cursor in a "MyCursor" object and forward all the methods on I'm
seeing that Count is being called by the ICursorInvoker:
0x1 in MinefieldManagement.Provider.MyCursor.get_Count at
c:\Projects\MinefieldManagement\MinefieldManagement\Provider\MinefieldDataProvider.cs:183
C#
0x9 in Android.Database.ICursorInvoker.n_GetCount at
/Users/builder/data/lanes/monodroid-mac-monodroid-4.2.7-branch/0e9eea34/source/monodroid/src/Mono.Android/platforms/android-14/src/generated/Android.Database.ICursor.cs:219
C#
0xC in object.c279bfc1-6dc5-4f8f-b576-58cb01b20d3d C#
0x12 in Android.Runtime.JNIEnv.CallObjectMethod at
/Users/builder/data/lanes/monodroid-mac-monodroid-4.2.7-branch/0e9eea34/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:141
C#
0xB6 in Android.Content.ContentResolver.Query at
/Users/builder/data/lanes/monodroid-mac-monodroid-4.2.7-branch/0e9eea34/source/monodroid/src/Mono.Android/platforms/android-14/src/generated/Android.Content.ContentResolver.cs:576
C#
> 0xD1 in
> MinefieldManagement.Overlays.MinefieldOverlay.OnSingleTapConfirmed at
> c:\Projects\MinefieldManagement\MinefieldManagement\Overlays\MinefieldOverlay.cs:337
> C#
My guess is that it's getting stuck in ContentResolver.Query:
// force query execution
qCursor.getCount();
long durationMillis = SystemClock.uptimeMillis() - startTime;
maybeLogQueryToEventLog(durationMillis, uri, projection, selection,
sortOrder);
// Wrap the cursor object into CursorWrapperInner object
CursorWrapperInner wrapper = new CursorWrapperInner(qCursor,
stableProvider != null ? stableProvider :
acquireProvider(uri));
stableProvider = null;
return wrapper;
} catch (RemoteException e) {
// Arbitrary and not worth documenting, as Activity
// Manager will kill this process shortly anyway.
return null;
} finally {
if (unstableProvider != null) {
releaseUnstableProvider(unstableProvider);
}
if (stableProvider != null) {
releaseProvider(stableProvider);
}
}
Possibly in one of those release calls or maybeLogQueryToEventLog which is a
terrible function name.
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Jonathan Pryor
Sent: Wednesday, November 21, 2012 10:02 AM
To: Discussions related to Mono for Android
Subject: Re: [mono-android] ContentResolver.Query takes greater than 10 seconds
when returning while the actual DB query takes 4ms
On Nov 20, 2012, at 6:02 PM, Jeremy A. Kolb - ARA/NED <[email protected]> wrote:
> I don't understand why though... all the time seems to be taken up after the
> return from my ContentProvider.Query method.
ContentProvider.Query() returns an ICursor. Are you returning a custom ICursor
or something created by Java?
If you implement ICursor yourself, you could tell if Android is enumerating the
ICursor before returning...
- Jon
_______________________________________________
Monodroid mailing list
[email protected]
UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid
_______________________________________________
Monodroid mailing list
[email protected]
UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid