diff options
author | Andrew Lee <anwlee@google.com> | 2015-04-29 14:34:07 -0700 |
---|---|---|
committer | Andrew Lee <anwlee@google.com> | 2015-05-01 11:42:51 -0700 |
commit | 2814d5b00bed0dda6152e749a552e9951ad22480 (patch) | |
tree | feea708c5df64ac7a7daf93400375ec01b1e3d4f /InCallUI | |
parent | ec3a0803d99d202fc4bc9085e185b11300eade00 (diff) |
DO NOT MERGE Use new Call.Details.PROPERTY_* values.
Bug: 20160395
Change-Id: Ibc877c3d6898770bce4bd96bdcbe673061141892
Diffstat (limited to 'InCallUI')
-rw-r--r-- | InCallUI/src/com/android/incallui/Call.java | 8 | ||||
-rw-r--r-- | InCallUI/src/com/android/incallui/CallCardPresenter.java | 14 | ||||
-rw-r--r-- | InCallUI/src/com/android/incallui/StatusBarNotifier.java | 8 |
3 files changed, 13 insertions, 17 deletions
diff --git a/InCallUI/src/com/android/incallui/Call.java b/InCallUI/src/com/android/incallui/Call.java index 8ca524e26..4324a5766 100644 --- a/InCallUI/src/com/android/incallui/Call.java +++ b/InCallUI/src/com/android/incallui/Call.java @@ -22,7 +22,6 @@ import com.android.incallui.CallList.Listener; import android.content.Context; import android.hardware.camera2.CameraCharacteristics; import android.net.Uri; -import android.telecom.CallProperties; import android.telecom.DisconnectCause; import android.telecom.GatewayInfo; import android.telecom.InCallService.VideoCall; @@ -401,8 +400,8 @@ public final class Call { 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. */ @@ -411,7 +410,8 @@ public final class Call { } 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 c5407df9c..9a5f96414 100644 --- a/InCallUI/src/com/android/incallui/CallCardPresenter.java +++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java @@ -328,11 +328,11 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> 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(); @@ -387,7 +387,7 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> // 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(); @@ -763,12 +763,8 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> 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 @@ -777,7 +773,7 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> } 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 caca6d48d..1dd8a6cc5 100644 --- a/InCallUI/src/com/android/incallui/StatusBarNotifier.java +++ b/InCallUI/src/com/android/incallui/StatusBarNotifier.java @@ -318,7 +318,7 @@ public class StatusBarNotifier implements InCallPresenter.InCallStateListener, * 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)) { @@ -345,7 +345,7 @@ public class StatusBarNotifier implements InCallPresenter.InCallStateListener, */ 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); } @@ -389,12 +389,12 @@ public class StatusBarNotifier implements InCallPresenter.InCallStateListener, */ 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; |