summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIhab Awad <ihab@google.com>2014-07-09 12:33:19 -0700
committerSantos Cordon <santoscordon@google.com>2014-07-14 18:20:02 +0000
commit4feb57b986dc6b1edc5dc026a926b4934778716d (patch)
treeb4e6c675f146de4a087790373d2a7005f05428ff
parentbe720ee5b611396446bc93068ff1389bd3dc59e8 (diff)
Implement multi-SIM capabilities (4/6) [DO NOT MERGE]
Bug:16292368 Change-Id: I24de420bcba2215b70a3faacd858fe848388a31e (cherry picked from commit e01f3db6e2bf865790c6849b594eb0472918ca8d)
-rw-r--r--InCallUI/src/com/android/incallui/CallCardPresenter.java19
1 files changed, 15 insertions, 4 deletions
diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java
index 9993ffbc4..552998ebc 100644
--- a/InCallUI/src/com/android/incallui/CallCardPresenter.java
+++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java
@@ -23,6 +23,7 @@ import android.graphics.drawable.Drawable;
import android.telecomm.CallCapabilities;
import android.telecomm.CallServiceDescriptor;
import android.telecomm.PhoneAccount;
+import android.telecomm.TelecommManager;
import android.telephony.DisconnectCause;
import android.text.TextUtils;
import android.text.format.DateUtils;
@@ -54,6 +55,7 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
private ContactCacheEntry mSecondaryContactInfo;
private CallTimer mCallTimer;
private Context mContext;
+ private TelecommManager mTelecommManager;
public CallCardPresenter() {
// create the call timer
@@ -405,7 +407,8 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
private Drawable getConnectionIcon() {
PhoneAccount account = mPrimary.getAccount();
if (account != null) {
- return account.getIcon(mContext);
+ return getTelecommManager().getPhoneAccountMetadata(account)
+ .getIcon(mContext);
}
return null;
}
@@ -429,7 +432,7 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
}
PhoneAccount account = mPrimary.getAccount();
if (account != null) {
- return account.getLabel(mContext);
+ return getTelecommManager().getPhoneAccountMetadata(account).getLabel();
}
return null;
}
@@ -437,7 +440,7 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
private String getSecondaryCallProviderLabel() {
PhoneAccount account = mSecondary.getAccount();
if (account != null) {
- return account.getLabel(mContext);
+ return getTelecommManager().getPhoneAccountMetadata(account).getLabel();
}
return null;
}
@@ -445,7 +448,8 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
private Drawable getSecondaryCallProviderIcon() {
PhoneAccount account = mSecondary.getAccount();
if (account != null) {
- return account.getIcon(mContext);
+ return getTelecommManager().getPhoneAccountMetadata(account)
+ .getIcon(mContext);
}
return null;
}
@@ -520,4 +524,11 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
void setPrimaryLabel(String label);
void setEndCallButtonEnabled(boolean enabled);
}
+
+ private TelecommManager getTelecommManager() {
+ if (mTelecommManager == null) {
+ mTelecommManager = TelecommManager.from(mContext);
+ }
+ return mTelecommManager;
+ }
}