My goal is to get all rows from native db with a specific email address on Android Gingerbread and above.
This query gets only the rows where the case also matches.
Please try (I suppose that mail is String object):
Cursor cursor = context.getContentResolver().query(ContactsContract.CommonDataKinds.Email.CONTENT_URI,
new String[] {Contacts._ID}, "lower("+ContactsContract.CommonDataKinds.Email.ADDRESS + ")=lower('"+ email +"')",
null, null);
or
Cursor cursor = context.getContentResolver().query(ContactsContract.CommonDataKinds.Email.CONTENT_URI,
new String[] {Contacts._ID}, "lower("+ContactsContract.CommonDataKinds.Email.ADDRESS + ")=lower('"+ email +"')",
new String[] {}, null);