diff options
author | Andrew Lee <anwlee@google.com> | 2015-05-01 19:08:17 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-05-01 19:08:17 +0000 |
commit | c413f2bc5cf1b273b255361876129488164ec874 (patch) | |
tree | 2b558f4d4d984b2f5f0296586863d172381e39f4 /InCallUI | |
parent | 994be9773e44d666ebf0732279205cdd545b1af4 (diff) | |
parent | aab33b0240b08f3015baf5e1b1c1955b3b56067c (diff) |
am fb0d0e34: am c2407405: am de7626f3: Merge "Use new Call.Details.PROPERTY_* values." into mnc-dev
* commit 'fb0d0e34db7eed06f92344b65765555b842b51f3':
Use new Call.Details.PROPERTY_* values.
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 4e9240543..5cf0f9b1a 100644 --- a/InCallUI/src/com/android/incallui/Call.java +++ b/InCallUI/src/com/android/incallui/Call.java @@ -25,7 +25,6 @@ import android.hardware.camera2.CameraCharacteristics; 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 @@ public 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. */ @@ -435,7 +434,8 @@ public 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 5a28cb9a2..ee13e061f 100644 --- a/InCallUI/src/com/android/incallui/CallCardPresenter.java +++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java @@ -304,11 +304,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(); @@ -353,7 +353,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(); @@ -735,12 +735,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 @@ -749,7 +745,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 f1fb5688d..86f997575 100644 --- a/InCallUI/src/com/android/incallui/StatusBarNotifier.java +++ b/InCallUI/src/com/android/incallui/StatusBarNotifier.java @@ -308,7 +308,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)) { @@ -335,7 +335,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); } @@ -379,12 +379,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; |