From 9fa39bd255f2bc248941ae5924a0a70cc25de19e Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Fri, 22 Mar 2013 18:42:14 -0700 Subject: App ops: don't crash when provide read access is off. If the caller supplied an empty selection string (instead of null) we would crash due to creating a bad SQLite statement. Change-Id: I462803b80c81815ed9a3a320c23060daa28e8114 --- core/java/android/content/ContentProvider.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/java/android') diff --git a/core/java/android/content/ContentProvider.java b/core/java/android/content/ContentProvider.java index 4968268..cf627d7 100644 --- a/core/java/android/content/ContentProvider.java +++ b/core/java/android/content/ContentProvider.java @@ -609,7 +609,7 @@ public abstract class ContentProvider implements ComponentCallbacks2 { // selection statement with a dummy one that will always be false. // This way we will get a cursor back that has the correct structure // but contains no rows. - if (selection == null) { + if (selection == null || selection.isEmpty()) { selection = "'A' = 'B'"; } else { selection = "'A' = 'B' AND (" + selection + ")"; -- cgit v1.1