Use new Call.Details.PROPERTY_* values.
Bug: 20160395
Change-Id: Ibc877c3d6898770bce4bd96bdcbe673061141892
diff --git a/InCallUI/src/com/android/incallui/Call.java b/InCallUI/src/com/android/incallui/Call.java
index 4e92405..5cf0f9b 100644
--- a/InCallUI/src/com/android/incallui/Call.java
+++ b/InCallUI/src/com/android/incallui/Call.java
@@ -25,7 +25,6 @@
import android.net.Uri;
import android.os.Bundle;
import android.os.Trace;
-import android.telecom.CallProperties;
import android.telecom.DisconnectCause;
import android.telecom.GatewayInfo;
import android.telecom.InCallService.VideoCall;
@@ -425,8 +424,8 @@
return (capabilities == (capabilities & mTelecommCall.getDetails().getCallCapabilities()));
}
- private boolean hasProperty(int property) {
- return property == (property & mTelecommCall.getDetails().getCallProperties());
+ public boolean hasProperty(int property) {
+ return mTelecommCall.getDetails().hasProperty(property);
}
/** Gets the time when the call first became active. */
@@ -435,7 +434,8 @@
}
public boolean isConferenceCall() {
- return hasProperty(CallProperties.CONFERENCE);
+ return mTelecommCall.getDetails().hasProperty(
+ android.telecom.Call.Details.PROPERTY_CONFERENCE);
}
public GatewayInfo getGatewayInfo() {
diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java
index 5a28cb9..ee13e06 100644
--- a/InCallUI/src/com/android/incallui/CallCardPresenter.java
+++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java
@@ -304,11 +304,11 @@
getConnectionLabel(),
getCallStateIcon(),
getGatewayNumber(),
- primaryCallCan(Details.CAPABILITY_WIFI),
+ mPrimary.hasProperty(Details.PROPERTY_WIFI),
mPrimary.isConferenceCall());
boolean showHdAudioIndicator =
- isPrimaryCallActive() && primaryCallCan(Details.CAPABILITY_HIGH_DEF_AUDIO);
+ isPrimaryCallActive() && mPrimary.hasProperty(Details.PROPERTY_HIGH_DEF_AUDIO);
getUi().showHdAudioIndicator(showHdAudioIndicator);
setCallbackNumber();
@@ -353,7 +353,7 @@
// number.
boolean isEmergencyCall = PhoneNumberUtils.isEmergencyNumber(
getNumberFromHandle(mPrimary.getHandle()));
- boolean showCallbackNumber = mPrimary.can(Details.CAPABILITY_SHOW_CALLBACK_NUMBER);
+ boolean showCallbackNumber = mPrimary.hasProperty(Details.PROPERTY_EMERGENCY_CALLBACK_MODE);
if (isEmergencyCall || showCallbackNumber) {
callbackNumber = getSubscriptionNumber();
@@ -735,12 +735,8 @@
return mPrimary != null && mPrimary.getState() == Call.State.ACTIVE;
}
- private boolean primaryCallCan(int capability) {
- return mPrimary.getTelecommCall().getDetails().can(capability);
- }
-
private String getConferenceString(Call call) {
- boolean isGenericConference = call.can(Details.CAPABILITY_GENERIC_CONFERENCE);
+ boolean isGenericConference = call.hasProperty(Details.PROPERTY_GENERIC_CONFERENCE);
Log.v(this, "getConferenceString: " + isGenericConference);
final int resId = isGenericConference
@@ -749,7 +745,7 @@
}
private Drawable getConferencePhoto(Call call) {
- boolean isGenericConference = call.can(Details.CAPABILITY_GENERIC_CONFERENCE);
+ boolean isGenericConference = call.hasProperty(Details.PROPERTY_GENERIC_CONFERENCE);
Log.v(this, "getConferencePhoto: " + isGenericConference);
final int resId = isGenericConference
diff --git a/InCallUI/src/com/android/incallui/StatusBarNotifier.java b/InCallUI/src/com/android/incallui/StatusBarNotifier.java
index f1fb568..86f9975 100644
--- a/InCallUI/src/com/android/incallui/StatusBarNotifier.java
+++ b/InCallUI/src/com/android/incallui/StatusBarNotifier.java
@@ -308,7 +308,7 @@
* Returns the main string to use in the notification.
*/
private String getContentTitle(ContactCacheEntry contactInfo, Call call) {
- if (call.isConferenceCall() && !call.can(Details.CAPABILITY_GENERIC_CONFERENCE)) {
+ if (call.isConferenceCall() && !call.hasProperty(Details.PROPERTY_GENERIC_CONFERENCE)) {
return mContext.getResources().getString(R.string.card_title_conf_call);
}
if (TextUtils.isEmpty(contactInfo.name)) {
@@ -335,7 +335,7 @@
*/
private Bitmap getLargeIconToDisplay(ContactCacheEntry contactInfo, Call call) {
Bitmap largeIcon = null;
- if (call.isConferenceCall() && !call.can(Details.CAPABILITY_GENERIC_CONFERENCE)) {
+ if (call.isConferenceCall() && !call.hasProperty(Details.PROPERTY_GENERIC_CONFERENCE)) {
largeIcon = BitmapFactory.decodeResource(mContext.getResources(),
R.drawable.img_conference);
}
@@ -379,12 +379,12 @@
*/
private int getContentString(Call call) {
int resId = R.string.notification_ongoing_call;
- if (call.can(Details.CAPABILITY_WIFI)) {
+ if (call.hasProperty(Details.PROPERTY_WIFI)) {
resId = R.string.notification_ongoing_call_wifi;
}
if (call.getState() == Call.State.INCOMING || call.getState() == Call.State.CALL_WAITING) {
- if (call.can(Details.CAPABILITY_WIFI)) {
+ if (call.hasProperty(Details.PROPERTY_WIFI)) {
resId = R.string.notification_incoming_call_wifi;
} else {
resId = R.string.notification_incoming_call;