Skip to content
Snippets Groups Projects
Commit 2b4f94e9 authored by Alexandre Lision's avatar Alexandre Lision
Browse files

* #36758: displayed name in ui are the same as in daemon history

parent fd1ef4f4
Branches
Tags
No related merge requests found
......@@ -4,5 +4,5 @@
android:propertyName="y"
android:valueFrom="2000"
android:valueTo="0"
android:interpolator="@android:anim/overshoot_interpolator"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:valueType="floatType" />
\ No newline at end of file
......@@ -4,5 +4,5 @@
android:propertyName="y"
android:valueFrom="0"
android:valueTo="2000"
android:interpolator="@android:anim/overshoot_interpolator"
android:interpolator="@android:anim/accelerate_interpolator"
android:valueType="floatType" />
\ No newline at end of file
......@@ -57,7 +57,7 @@ public class HistoryLoader extends AsyncTaskLoader<ArrayList<HistoryEntry>> {
if (historyEntries.containsKey(number_called)) {
// It's a direct match
historyEntries.get(number_called).addHistoryCall(new HistoryCall(entry));
historyEntries.get(number_called).addHistoryCall(new HistoryCall(entry), contact);
} else {
// Maybe we can extract the extension @ account pattern
Pattern p = Pattern.compile("<sip:([^@]+)@([^>]+)>");
......@@ -65,17 +65,17 @@ public class HistoryLoader extends AsyncTaskLoader<ArrayList<HistoryEntry>> {
if (m.find()) {
if (historyEntries.containsKey(m.group(1) + "@" + m.group(2))) {
historyEntries.get(m.group(1) + "@" + m.group(2)).addHistoryCall(new HistoryCall(entry));
historyEntries.get(m.group(1) + "@" + m.group(2)).addHistoryCall(new HistoryCall(entry), contact);
} else {
HistoryEntry e = new HistoryEntry(entry.get(ServiceConstants.history.ACCOUNT_ID_KEY), contact);
e.addHistoryCall(new HistoryCall(entry));
e.addHistoryCall(new HistoryCall(entry), contact);
historyEntries.put(m.group(1) + "@" + m.group(2), e);
}
} else {
HistoryEntry e = new HistoryEntry(entry.get(ServiceConstants.history.ACCOUNT_ID_KEY), contact);
e.addHistoryCall(new HistoryCall(entry));
e.addHistoryCall(new HistoryCall(entry), contact);
historyEntries.put(number_called, e);
}
......
......@@ -323,4 +323,12 @@ public class CallContact implements Parcelable {
contact_photo = new WeakReference<Bitmap>(externalBMP);
}
/**
* A contact is Unknown when his name == his phone number
* @return true when Name == Number
*/
public boolean isUnknown() {
return mDisplayName.contentEquals(phones.get(0).getNumber());
}
}
......@@ -83,7 +83,14 @@ public class HistoryEntry implements Parcelable {
this.contact = contact;
}
public void addHistoryCall(HistoryCall historyCall) {
/**
* Each call is associated with a contact.
* When adding a call to an HIstoryEntry, this methods also verifies if we can update
* the contact (if contact is Unknown, replace it)
* @param historyCall The call to put in this HistoryEntry
* @param linkedTo The associated CallContact
*/
public void addHistoryCall(HistoryCall historyCall, CallContact linkedTo) {
calls.put(historyCall.call_start, historyCall);
if (historyCall.isIncoming()) {
++incoming_sum;
......@@ -92,6 +99,9 @@ public class HistoryEntry implements Parcelable {
}
if (historyCall.isMissed())
missed_sum++;
if(contact.isUnknown() && !linkedTo.isUnknown())
setContact(linkedTo);
}
public String getNumber() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment