Fixed mega blunder in calls history on tablets
This commit is contained in:
parent
1b1f5c70ee
commit
b4f851aa9e
2 changed files with 12 additions and 6 deletions
|
@ -578,9 +578,13 @@ public class LinphoneActivity extends LinphoneGenericActivity implements OnClick
|
||||||
}
|
}
|
||||||
|
|
||||||
public void displayHistoryDetail(String sipUri, CallLog log) {
|
public void displayHistoryDetail(String sipUri, CallLog log) {
|
||||||
Address lAddress;
|
Address lAddress = null;
|
||||||
|
LinphoneContact c = null;
|
||||||
|
|
||||||
lAddress = Factory.instance().createAddress(sipUri);
|
lAddress = Factory.instance().createAddress(sipUri);
|
||||||
LinphoneContact c = ContactsManager.getInstance().findContactFromAddress(lAddress);
|
if (lAddress != null) {
|
||||||
|
c = ContactsManager.getInstance().findContactFromAddress(lAddress);
|
||||||
|
}
|
||||||
|
|
||||||
String displayName = c != null ? c.getFullName() : LinphoneUtils.getAddressDisplayName(sipUri);
|
String displayName = c != null ? c.getFullName() : LinphoneUtils.getAddressDisplayName(sipUri);
|
||||||
String pictureUri = c != null && c.getPhotoUri() != null ? c.getPhotoUri().toString() : null;
|
String pictureUri = c != null && c.getPhotoUri() != null ? c.getPhotoUri().toString() : null;
|
||||||
|
@ -602,10 +606,10 @@ public class LinphoneActivity extends LinphoneGenericActivity implements OnClick
|
||||||
Fragment fragment2 = getFragmentManager().findFragmentById(R.id.fragmentContainer2);
|
Fragment fragment2 = getFragmentManager().findFragmentById(R.id.fragmentContainer2);
|
||||||
if (fragment2 != null && fragment2.isVisible() && currentFragment == FragmentsAvailable.HISTORY_DETAIL) {
|
if (fragment2 != null && fragment2.isVisible() && currentFragment == FragmentsAvailable.HISTORY_DETAIL) {
|
||||||
HistoryDetailFragment historyDetailFragment = (HistoryDetailFragment) fragment2;
|
HistoryDetailFragment historyDetailFragment = (HistoryDetailFragment) fragment2;
|
||||||
historyDetailFragment.changeDisplayedHistory(lAddress.asStringUriOnly(), displayName, pictureUri, status, callTime, callDate);
|
historyDetailFragment.changeDisplayedHistory(sipUri, displayName, pictureUri, status, callTime, callDate);
|
||||||
} else {
|
} else {
|
||||||
Bundle extras = new Bundle();
|
Bundle extras = new Bundle();
|
||||||
extras.putString("SipUri", lAddress.asString());
|
extras.putString("SipUri", sipUri);
|
||||||
if (displayName != null) {
|
if (displayName != null) {
|
||||||
extras.putString("DisplayName", displayName);
|
extras.putString("DisplayName", displayName);
|
||||||
extras.putString("PictureUri", pictureUri);
|
extras.putString("PictureUri", pictureUri);
|
||||||
|
|
|
@ -129,11 +129,13 @@ public class HistoryListFragment extends Fragment implements OnClickListener, On
|
||||||
public void displayFirstLog(){
|
public void displayFirstLog(){
|
||||||
if (mLogs != null && mLogs.size() > 0) {
|
if (mLogs != null && mLogs.size() > 0) {
|
||||||
CallLog log = mLogs.get(0);
|
CallLog log = mLogs.get(0);
|
||||||
|
String addr;
|
||||||
if (log.getDir() == Call.Dir.Incoming) {
|
if (log.getDir() == Call.Dir.Incoming) {
|
||||||
LinphoneActivity.instance().displayHistoryDetail(mLogs.get(0).getFromAddress().toString(), mLogs.get(0));
|
addr = log.getFromAddress().asString();
|
||||||
} else {
|
} else {
|
||||||
LinphoneActivity.instance().displayHistoryDetail(mLogs.get(0).getToAddress().toString(), mLogs.get(0));
|
addr = log.getToAddress().asString();
|
||||||
}
|
}
|
||||||
|
LinphoneActivity.instance().displayHistoryDetail(addr, log);
|
||||||
} else {
|
} else {
|
||||||
LinphoneActivity.instance().displayEmptyFragment();
|
LinphoneActivity.instance().displayEmptyFragment();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue