Fixed some logs verbosity
This commit is contained in:
parent
0f3061c928
commit
5fd28edb36
2 changed files with 26 additions and 25 deletions
|
@ -209,26 +209,24 @@ 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)
|
.withValue(ContactsContract.Data.RAW_CONTACT_ID, mAndroidRawId)
|
||||||
.withValue(ContactsContract.Data.RAW_CONTACT_ID, mAndroidRawId)
|
.withValue(
|
||||||
.withValue(
|
ContactsContract.Data.MIMETYPE,
|
||||||
ContactsContract.Data.MIMETYPE,
|
ContactsManager.getInstance()
|
||||||
ContactsManager.getInstance()
|
.getString(R.string.linphone_address_mime_type))
|
||||||
.getString(R.string.linphone_address_mime_type))
|
.withValue("data1", value) // phone number
|
||||||
.withValue("data1", value) // phone number
|
.withValue(
|
||||||
.withValue(
|
"data2",
|
||||||
"data2",
|
ContactsManager.getInstance()
|
||||||
ContactsManager.getInstance()
|
.getString(R.string.app_name)) // Summary
|
||||||
.getString(R.string.app_name)) // Summary
|
.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
|
||||||
+ " : "
|
+ " : "
|
||||||
|
|
|
@ -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,8 +584,10 @@ 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);
|
||||||
// Do the action on the contact only once if it has not been done yet
|
if (!isLinphoneAddressMimeEntryAlreadyExisting(value)) {
|
||||||
updateNativeContactWithPresenceInfo(value);
|
// Do the action on the contact only once if it has not been done yet
|
||||||
|
updateNativeContactWithPresenceInfo(value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
saveChangesCommited();
|
saveChangesCommited();
|
||||||
|
|
Loading…
Reference in a new issue