Android Contacts.CONTENT_STREQUENT_URI выдает SQLiteException на Android 4.1.2 и 4.4.2

Мне нужна помощь.

Я пытаюсь запросить strequent таблицу ( ContactsContract.CONTENT_STREQUENT_URI ) на Android, чтобы получать strequent и наиболее часто встречающиеся контакты.

 Cursor cursor = context.getContentResolver().query(Contacts.CONTENT_STREQUENT_URI, new String[]{Contacts._ID, Contacts.LOOKUP_KEY, Contacts.STARRED, Utils.hasHoneycomb() ? Contacts.DISPLAY_NAME_PRIMARY : Contacts.DISPLAY_NAME}, null, null, null ); 

На большинстве устройств и версиях Android он работает нормально. Но в версиях Android 4.1.2 я получаю это SQLiteException

 {AsyncTask #2} android.database.sqlite.SQLiteException: near "(": syntax error (code 1): , while compiling: SELECT * FROM (SELECT _id, lookup, starred, display_name, 9223372036854775807 AS times_used, 9223372036854775807 AS last_time_used FROM view_contacts WHERE (view_contacts.[single_is_restricted] = 0(1)) AND (starred=1) GROUP BY _id ORDER BY display_name COLLATE LOCALIZED ASC) UNION ALL SELECT * FROM (SELECT _id, lookup, starred, display_name, SUM(data_usage_stat.times_used) AS times_used, MAX(data_usage_stat.last_time_used) AS last_time_used FROM view_data_usage_stat AS data_usage_stat INNER JOIN view_contacts ON ((data_usage_stat.times_used > 0) AND (contact_id=view_contacts._id)) WHERE (view_contacts.[single_is_restricted] = 0 AND ((starred =0 OR starred IS NULL) AND account_type NOT IN ('com.android.contacts.sim'))) GROUP BY _id HAVING contact_id IN default_directory ORDER BY (CASE WHEN (strftime('%s', 'now') - last_time_used/1000) < 259200 THEN 0 WHEN (strftime('%s', 'now') - last_time_used/1000) < 2592000 THEN 1 ELSE 2 END), times_used DESC LIMIT 10) at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:184) at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:140) at android.content.ContentProviderProxy.query(ContentProviderNative.java:366) at android.content.ContentResolver.query(ContentResolver.java:371) at android.content.ContentResolver.query(ContentResolver.java:314) at (...) 

Я уверен, что это другое SQLiteException которое я получаю в версиях Android 4.4.2, связано:

  android.database.sqlite.SQLiteException: near ")": syntax error (code 1): , while compiling: SELECT * FROM (SELECT _id, lookup, starred, display_name, 9223372036854775807 AS times_used, 9223372036854775807 AS last_time_used FROM view_contacts WHERE (view_contacts.[single_is_restricted] = 0 AND ) AND (starred=1) GROUP BY _id ORDER BY display_name COLLATE LOCALIZED ASC) UNION ALL SELECT * FROM (SELECT _id, lookup, starred, display_name, SUM(data_usage_stat.times_used) AS times_used, MAX(data_usage_stat.last_time_used) AS last_time_used FROM view_data_usage_stat AS data_usage_stat INNER JOIN view_contacts ON ((data_usage_stat.times_used > 0) AND (contact_id=view_contacts._id)) WHERE (view_contacts.[single_is_restricted] = 0((starred =0 OR starred IS NULL) AND account_type NOT IN ('com.android.contacts.sim'))) GROUP BY _id HAVING contact_id IN default_directory ORDER BY (CASE WHEN (strftime('%s', 'now') - last_time_used/1000) < 259200 THEN 0 WHEN (strftime('%s', 'now') - last_time_used/1000) < 604800 THEN 1 WHEN (strftime('%s', 'now') - last_time_used/1000) < 1209600 THEN 2 WHEN (strftime('%s', 'now') - last_time_used/1000) < 2592000 THEN 3 ELSE 4 END), times_used DESC LIMIT 10) WHERE (strftime('%s', 'now') - last_time_used/1000) <2592000 at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:181) at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:137) at android.content.ContentProviderProxy.query(ContentProviderNative.java:413) at android.content.ContentResolver.query(ContentResolver.java:464) at android.content.ContentResolver.query(ContentResolver.java:407) at (...) 

Я понимаю, что Android Content Resolver неправильно строит SQL-запрос. Я что-то упускаю? Кто-нибудь сталкивался с этим или может предложить обходное решение? Есть ли другой / более простой запрос, который можно использовать? Я хотел бы сохранить эту функцию для этих версий Android 🙁