Fixed some logs verbosity

This commit is contained in:
Sylvain Berfini 2019-07-01 15:28:41 +02:00
parent 0f3061c928
commit 5fd28edb36
2 changed files with 26 additions and 25 deletions

View file

@ -209,7 +209,6 @@ class AndroidContact implements Serializable {
} }
void updateNativeContactWithPresenceInfo(String value) { void updateNativeContactWithPresenceInfo(String value) {
if (!isLinphoneAddressMimeEntryAlreadyExisting(value)) {
Log.d("[Contact] Adding presence information " + value); Log.d("[Contact] Adding presence information " + value);
addChangesToCommit( addChangesToCommit(
ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI) ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI)
@ -226,9 +225,8 @@ class AndroidContact implements Serializable {
.withValue("data3", value) // Detail .withValue("data3", value) // Detail
.build()); .build());
} }
}
private boolean isLinphoneAddressMimeEntryAlreadyExisting(String value) { boolean isLinphoneAddressMimeEntryAlreadyExisting(String value) {
boolean result = false; boolean result = false;
ContentResolver resolver = LinphoneService.instance().getContentResolver(); ContentResolver resolver = LinphoneService.instance().getContentResolver();
@ -603,17 +601,17 @@ class AndroidContact implements Serializable {
if (LinphoneService.instance().getResources().getBoolean(R.bool.use_linphone_tag)) { if (LinphoneService.instance().getResources().getBoolean(R.bool.use_linphone_tag)) {
if (mAndroidId != null && (mAndroidRawId == null || !isAndroidRawIdLinphone)) { if (mAndroidId != null && (mAndroidRawId == null || !isAndroidRawIdLinphone)) {
if (mAndroidRawId == null) { if (mAndroidRawId == null) {
Log.i("[Contact] RAW ID not found for contact " + mAndroidId); Log.d("[Contact] RAW ID not found for contact " + mAndroidId);
mAndroidRawId = findRawContactID(); mAndroidRawId = findRawContactID();
} }
Log.i("[Contact] Found RAW ID for contact " + mAndroidId + " : " + mAndroidRawId); Log.d("[Contact] Found RAW ID for contact " + mAndroidId + " : " + mAndroidRawId);
String linphoneRawId = findLinphoneRawContactId(); String linphoneRawId = findLinphoneRawContactId();
if (linphoneRawId == null) { if (linphoneRawId == null) {
Log.i("[Contact] Linphone RAW ID not found for contact " + mAndroidId); Log.d("[Contact] Linphone RAW ID not found for contact " + mAndroidId);
createRawLinphoneContactFromExistingAndroidContact(); createRawLinphoneContactFromExistingAndroidContact();
} else { } else {
Log.i( Log.d(
"[Contact] Linphone RAW ID found for contact " "[Contact] Linphone RAW ID found for contact "
+ mAndroidId + mAndroidId
+ " : " + " : "

View file

@ -559,12 +559,13 @@ public class LinphoneContact extends AndroidContact
Log.d("[Linphone Contact] Found first name " + data2 + " and last name " + data3); Log.d("[Linphone Contact] Found first name " + data2 + " and last name " + data3);
setFirstNameAndLastName(data2, data3, false); setFirstNameAndLastName(data2, data3, false);
} else { } else {
Log.w("[Linphone Contact] Unexpected MIME type " + mime); Log.d("[Linphone Contact] Skipping unused MIME type " + mime);
} }
} }
public synchronized void updateNativeContactWithPresenceInfo() { public synchronized void updateNativeContactWithPresenceInfo() {
Log.d("[Contact] Trying to update native contact with presence information"); Log.d("[Contact] Trying to update native contact with presence information");
// Creation of the raw contact with the presence information (tablet) // Creation of the raw contact with the presence information (tablet)
createRawLinphoneContactFromExistingAndroidContactIfNeeded(); createRawLinphoneContactFromExistingAndroidContactIfNeeded();
@ -583,10 +584,12 @@ public class LinphoneContact extends AndroidContact
// If presence is not null // If presence is not null
if (pm != null && pm.getBasicStatus().equals(PresenceBasicStatus.Open)) { if (pm != null && pm.getBasicStatus().equals(PresenceBasicStatus.Open)) {
Log.d("[Contact] Found presence information for phone number " + value); Log.d("[Contact] Found presence information for phone number " + value);
if (!isLinphoneAddressMimeEntryAlreadyExisting(value)) {
// Do the action on the contact only once if it has not been done yet // Do the action on the contact only once if it has not been done yet
updateNativeContactWithPresenceInfo(value); updateNativeContactWithPresenceInfo(value);
} }
} }
}
saveChangesCommited(); saveChangesCommited();
} }