The whole point of deprecating the CONTENT_FREQUENT_URI
as well as the TIMES_CONTACTED
and LAST_TIME_CONTACTED
fields in the Contacts table are to prevent apps from accessing the information you're looking for.
Google now considers this info to be sensitive user info, and will not allow apps to obtain that going forward.
However, from my experience, it seems that all devices I know of or are used by our users still allow access to the deprecated API, so if you need something that will be ok for most of your users within the next year or so, you can still use it.
Code should be something like:
String[] projection = new String[] { Contacts._ID, Contacts.DISPLAY_NAME, Contacts.LAST_TIME_CONTACTED };
Cursor lastContacted = getContentResolver().query(Contacts.CONTENT_URI, projection, Contacts.LAST_TIME_CONTACTED + " < " + lastDayTimestamp, null, Contacts.LAST_TIME_CONTACTED + " DESC");
DatabaseUtils.dumpCursor(lastContacted);
Cursor mostContacted = getContentResolver().query(Contacts.CONTENT_URI, projection, null, null, Contacts.TIMES_CONTACTED + " DESC");
DatabaseUtils.dumpCursor(mostContacted); // might want to limit this to 3