b18f27dbf4
If a query returns 100 rows and say only 10 rows fit in 1MB, then client receiving the cursor from the ContentProvider needs to paginate. ContentProvider returns count of total data everytime it returns a page (= 1MB) of data to the client. Returning total count causes reading (and skipping unwanted) data from sqlite. Instead, it should be sufficient to get total count once and re-use the count value during the life of the cursor until a requery is performed on the cursor. (Count won't change unless data is changed - in which case the cursor is asked to perform requery anyway. So doing count once and reusing it should work) Change-Id: I3520d94524dda07be9bcff56b6fbae5276af1d3b