From 0552994436e2afdec3d35fed5aac0f87e8e3e0bb Mon Sep 17 00:00:00 2001 From: Ajay Panicker Date: Wed, 14 Dec 2016 18:43:07 -0800 Subject: [PATCH] Prevent SQL query from having a bad where clause Bug: 33092708 Test: Sanity test MAP on carkit Change-Id: I6c7f54f60877cf2c57df9b3521604660321214ff --- src/com/android/bluetooth/map/BluetoothMapContent.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/com/android/bluetooth/map/BluetoothMapContent.java b/src/com/android/bluetooth/map/BluetoothMapContent.java index face4b53..c5f83840 100644 --- a/src/com/android/bluetooth/map/BluetoothMapContent.java +++ b/src/com/android/bluetooth/map/BluetoothMapContent.java @@ -1650,10 +1650,8 @@ public class BluetoothMapContent { private String setWhereFilterFolderType(BluetoothMapFolderElement folderElement, FilterInfo fi) { - String where = ""; - if(folderElement.shouldIgnore()) { - where = "1=1"; - } else { + String where = "1=1"; + if (!folderElement.shouldIgnore()) { if (fi.mMsgType == FilterInfo.TYPE_SMS) { where = setWhereFilterFolderTypeSms(folderElement.getName()); } else if (fi.mMsgType == FilterInfo.TYPE_MMS) { @@ -1664,6 +1662,7 @@ public class BluetoothMapContent { where = setWhereFilterFolderTypeIm(folderElement.getFolderId()); } } + return where; } -- 2.11.0