Prefetch column names in bulk cursor adaptor.
If the remote end of a bulk cursor died, then it was possible for getColumnNames() to return null, violating the invariant that it never returns null. As a result, the application could crash in strange ways due to an NPE. Since we are often interested in the column names anyhow, prefetch them when setting up the bulk cursor adaptor. This way, a remote cursor will never return null even if the remote end died. It is possible for an application to continue to use a remote cursor even after the provider has died unless it needs to requery it for some reason. Of course at that point, bad things will happen... but usually the app is better prepared for it than if it just randomly encounters a null array of column names. This change also optimizes the bulk cursor adaptor to return the initial cursor window back to the client, potentially saving an extra RPC. Because the communication protocol between the CursorToBulkCursorAdaptor and BulkCursorToCursorAdaptor was getting a little hard to follow, introduced a new type called BulkCursorDescriptor to hold all of the necessary parameters. Deleted several unnecessary IBulkCursor methods that are never actually called remotely. Bug: 6168809 Change-Id: I9aaf6f067c6434a575e2fdbf678243d5ad10755f
Loading
Please register or sign in to comment