summaryrefslogtreecommitdiffstats
path: root/core/java/android/database
diff options
context:
space:
mode:
authorKarl Rosaen <krosaen@google.com>2009-06-22 12:51:35 -0700
committerKarl Rosaen <krosaen@google.com>2009-06-22 12:51:35 -0700
commit6dc0ef005d31f1aaf277164e8bc79be9068e8bf2 (patch)
treed510d489717e9c47129fad6c65ff4d4690fc198e /core/java/android/database
parentd6dd686bc7adba448af1bc36a022cddba9f9561f (diff)
downloadframeworks_base-6dc0ef005d31f1aaf277164e8bc79be9068e8bf2.zip
frameworks_base-6dc0ef005d31f1aaf277164e8bc79be9068e8bf2.tar.gz
frameworks_base-6dc0ef005d31f1aaf277164e8bc79be9068e8bf2.tar.bz2
BulkCursorToCursorAdaptor.respond no longer assumes RemoteException is impossible, fails more gracefully.
This fixes bug 1923131 which was crashing the system process in some cases when the search dialog was calling respond on its cursor to GlobalSearch.
Diffstat (limited to 'core/java/android/database')
-rw-r--r--core/java/android/database/BulkCursorToCursorAdaptor.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/core/java/android/database/BulkCursorToCursorAdaptor.java b/core/java/android/database/BulkCursorToCursorAdaptor.java
index c26810a..cf30dd9 100644
--- a/core/java/android/database/BulkCursorToCursorAdaptor.java
+++ b/core/java/android/database/BulkCursorToCursorAdaptor.java
@@ -247,9 +247,11 @@ public final class BulkCursorToCursorAdaptor extends AbstractWindowedCursor {
try {
return mBulkCursor.respond(extras);
} catch (RemoteException e) {
- // This should never happen because the system kills processes that are using remote
- // cursors when the provider process is killed.
- throw new RuntimeException(e);
+ // the system kills processes that are using remote cursors when the provider process
+ // is killed, but this can still happen if this is being called from the system process,
+ // so, better to log and return an empty bundle.
+ Log.w(TAG, "respond() threw RemoteException, returning an empty bundle.", e);
+ return Bundle.EMPTY;
}
}
}