Skip to content

Commit

Permalink
Handle private calls for history (fix #302)
Browse files Browse the repository at this point in the history
  • Loading branch information
Neamar committed Nov 15, 2015
1 parent 14ebc13 commit 6a69340
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@ public void onReceive(final Context context, Intent intent) {
}

if (intent.getStringExtra(TelephonyManager.EXTRA_STATE).equals(TelephonyManager.EXTRA_STATE_RINGING)) {
ContactPojo contactPojo = contactProvider.findByPhone(intent.getStringExtra(TelephonyManager.EXTRA_INCOMING_NUMBER));
String phoneNumber = intent.getStringExtra(TelephonyManager.EXTRA_INCOMING_NUMBER);

if(phoneNumber == null) {
// Skipping (private call)
return;
}

ContactPojo contactPojo = contactProvider.findByPhone(phoneNumber);
if (contactPojo != null) {
dataHandler.addToHistory(context, contactPojo.id);
}
Expand Down

0 comments on commit 6a69340

Please sign in to comment.