summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNancy Chen <nancychen@google.com>2015-12-29 20:39:54 +0000
committerandroid-build-merger <android-build-merger@google.com>2015-12-29 20:39:54 +0000
commit45b0e7788426634b48c67765631e7bcb884c0fac (patch)
treec488feec0b6564a6e53b33081dd55a0e27edc44f
parent5d4b284ae574a8eef8021184d6fa95e4f45a82ea (diff)
parent29c01f36e9381b7bad135a9701aa3dffaf495b2f (diff)
Make TelecomManager APIs compatible with Lollipop (3/3).
am: 0c4c2782de * commit '0c4c2782dea7ddf27f4e30c0bf499bc6d02ae083': Make TelecomManager APIs compatible with Lollipop (3/3).
-rw-r--r--InCallUI/src/com/android/incallui/Call.java5
-rw-r--r--InCallUI/src/com/android/incallui/CallCardPresenter.java8
-rw-r--r--InCallUI/src/com/android/incallui/InCallPresenter.java4
3 files changed, 12 insertions, 5 deletions
diff --git a/InCallUI/src/com/android/incallui/Call.java b/InCallUI/src/com/android/incallui/Call.java
index 161c641dd..3ec94f9df 100644
--- a/InCallUI/src/com/android/incallui/Call.java
+++ b/InCallUI/src/com/android/incallui/Call.java
@@ -34,6 +34,7 @@ import android.text.TextUtils;
import com.android.contacts.common.CallUtil;
import com.android.contacts.common.compat.SdkVersionOverride;
+import com.android.contacts.common.compat.telecom.TelecomManagerCompat;
import com.android.contacts.common.testing.NeededForTesting;
import com.android.dialer.util.IntentUtil;
import com.android.incallui.compat.telecom.DetailsCompat;
@@ -176,6 +177,7 @@ public class Call {
return mCameraDirection;
}
+ @Override
public String toString() {
return "(CameraDir:" + getCameraDir() + ")";
}
@@ -609,7 +611,8 @@ public class Call {
if (mPhoneAccountHandle != null) {
TelecomManager mgr = InCallPresenter.getInstance().getTelecomManager();
- PhoneAccount phoneAccount = mgr.getPhoneAccount(mPhoneAccountHandle);
+ PhoneAccount phoneAccount =
+ TelecomManagerCompat.getPhoneAccount(mgr, mPhoneAccountHandle);
if (phoneAccount != null) {
mIsCallSubjectSupported = phoneAccount.hasCapabilities(
PhoneAccount.CAPABILITY_CALL_SUBJECT);
diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java
index 02c4b9929..0b17e1a03 100644
--- a/InCallUI/src/com/android/incallui/CallCardPresenter.java
+++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java
@@ -398,7 +398,7 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
PhoneAccountHandle accountHandle = mPrimary.getAccountHandle();
if (accountHandle != null) {
TelecomManager mgr = InCallPresenter.getInstance().getTelecomManager();
- PhoneAccount account = mgr.getPhoneAccount(accountHandle);
+ PhoneAccount account = TelecomManagerCompat.getPhoneAccount(mgr, accountHandle);
if (account != null) {
return getNumberFromHandle(account.getSubscriptionAddress());
}
@@ -836,7 +836,9 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
if (accountHandle == null) {
return null;
}
- return InCallPresenter.getInstance().getTelecomManager().getPhoneAccount(accountHandle);
+ return TelecomManagerCompat.getPhoneAccount(
+ InCallPresenter.getInstance().getTelecomManager(),
+ accountHandle);
}
/**
@@ -856,7 +858,7 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
PhoneAccount account = getAccountForCall(call);
TelecomManager mgr = InCallPresenter.getInstance().getTelecomManager();
if (account != null && !TextUtils.isEmpty(account.getLabel())
- && mgr.getCallCapablePhoneAccounts().size() > 1) {
+ && TelecomManagerCompat.getCallCapablePhoneAccounts(mgr).size() > 1) {
return account.getLabel().toString();
}
return null;
diff --git a/InCallUI/src/com/android/incallui/InCallPresenter.java b/InCallUI/src/com/android/incallui/InCallPresenter.java
index d4dbda82a..f50da8dbd 100644
--- a/InCallUI/src/com/android/incallui/InCallPresenter.java
+++ b/InCallUI/src/com/android/incallui/InCallPresenter.java
@@ -44,6 +44,7 @@ import android.view.WindowManager;
import com.android.contacts.common.GeoUtil;
import com.android.contacts.common.compat.CompatUtils;
import com.android.contacts.common.compat.SdkVersionOverride;
+import com.android.contacts.common.compat.telecom.TelecomManagerCompat;
import com.android.contacts.common.interactions.TouchPointManager;
import com.android.contacts.common.testing.NeededForTesting;
import com.android.contacts.common.util.MaterialColorMapUtils.MaterialPalette;
@@ -1791,7 +1792,8 @@ public class InCallPresenter implements CallList.Listener,
final TelecomManager tm = getTelecomManager();
if (tm != null) {
- final PhoneAccount account = tm.getPhoneAccount(phoneAccountHandle);
+ final PhoneAccount account =
+ TelecomManagerCompat.getPhoneAccount(tm, phoneAccountHandle);
// For single-sim devices, there will be no selected highlight color, so the phone
// account will default to NO_HIGHLIGHT_COLOR.
if (account != null && CompatUtils.isLollipopMr1Compatible()) {