Fix bugs regarding IllegalStateException during moving position in cursorwindow.
"startPos + addedRows < requiredPos" could miss a row in boundary position. Because of the fluctuating row size, "startPos + addedRows < requiredPos" expression could miss a row in boundary position. For example, simply speaking, if window capacity = 120 and requiredPos = 120, "fillWindow" needs to be newly called and "starPos" is 80 for the window. Unfortunately 120th row is bigger than the rest size of the window, the row for requiredPos is not in the window. Then, startPos has to be newly set and the 120th row has to be included in the window. But by the expression above "startPos + addedRows < requiredPos", the row for requiredPos is regarded as included in the window. In that case, by "mCurrentRowID = Long.valueOf(getLong(mRowIdColumnIndex));" statment in AbstractCursor, IllegalStateException is thrown. This patch contains modification of the expression as "startPos + addedRows <= requiredPos". Change-Id: Iaee75241e495949b0a624b836843da18d0bcb98d
Loading
Please register or sign in to comment